图像校正 [英] Image Rectification

查看:385
本文介绍了图像校正的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我需要实现图像校正。问题是从四个视点(topL,topR,bottomL,bottomR)给出对象的图像我需要做成对校正。我在OpenCV中尝试了一些代码但是没有能够取得进展。有人能告诉我一个好的方法(源代码/教程)来执行整改吗?我需要使用C / C ++ / OpenCV。


I need to implement image rectification .Problem is given image of object from four viewpoints(topL,topR,bottomL,bottomR)I need to do pairwise rectification .I tried some code in OpenCV but havent been able to make progress .Can someone tell me a good way(source code /tutorial) to execute the rectification? I need to use C/C++/OpenCV.


http://portal.acm.org/citation.cfm?id=1833349.1778777


推荐答案

这是一个非常广泛的问题,这里是你可以做到的一种方式的概述......

This is an extremely broad question, here is a general outline of one way you could do it...


  • 使用 cvGoodFeaturesToTrack()功能或角落 c>

将您找到的功能传递到 cvFindCornerSubPix(),以获得更精确的浮点表示形式强特征的位置

Pass the features you found into cvFindCornerSubPix() to get more precise floating point representations of the locations of strong features

使用上一步中的子像素特征计算两幅图像之间的光流量 cvCalcOpticalFlowPyrLK 或其他光流功能。 (我喜欢 cvCalcOpticalFlowPyrLK()

Calculate the optical flow between the two images using the sub-pixel features from the last step using cvCalcOpticalFlowPyrLK or another optical flow function. (I like cvCalcOpticalFlowPyrLK())

这是它变得棘手的地方 ...为了纠正图像,它有助于对内在的摄像机特性(视野,焦距)有一些了解,特别是如果你打算进行某种三维重建或者计算差异对应。由于您没有提及有关校准相机设置的任何信息,我将继续使用未校准的算法。

This is where it gets tricky... in order to rectify images it helps to have some knowledge about the intrinsic camera properites (field of view, focal length) especially if you are planning to do some kind of 3d reconstruction or compute disparity correspondence. Since you didn't mention anything about a calibrated camera set up I will continue on the uncalibrated algorithm.


  • 您需要找到基本矩阵,它对用于计算整流矩阵的场景的所有方面进行编码。使用 cvFindFundamentalMatrix()来执行此操作。

使用基础矩阵,您现在必须找到Homography矩阵,将两个图像映射到同一平面。使用 cvStereoRectifyUncalibrated()来执行此操作。虽然名称表明它正在纠正你的图像,但它只是返回你可以用来纠正你的图像的单应矩阵。

Armed with the Fundamental Matrix you must now find the Homography Matrix, which will map both images to the same plane. Use cvStereoRectifyUncalibrated() to do this. Although the name would suggest that it is rectifying your images it is NOT, it just returns homography matrices that you can USE to rectify your images.

最后,使用从最后一步开始的Homography矩阵,您可以通过调用 cvInitUndistortRectifyMap()来获取重映射矩阵,然后将其传递到 cvRemap()进行实际重新映射。

Finally, using the Homography matrices from the last step you can rectify both images by calling cvInitUndistortRectifyMap() to get a remap matrix and then pass that into cvRemap() to do the actual remapping.

我必须警告你有许多进入这些库调用的每个参数,您将不得不操作许多矩阵和许多图像,更不用说没有内在的相机校准细节你必须做出许多可能会对你的结果产生巨大影响的假设......这不是一件容易的事。

I must warn you that there are many parameters that go into each of these library calls and you will have to manipulate many matrices and many images, not to mention without the intrinsic camera calibration details you will have to make many assumptions that could drastically affect your results... It is no easy task.

我建议购买和/或阅读学习OpenCV ,如果你想了解更多,它远远超出范围在stackoverflow上的一个短段期望学习所有这些:)

I would recommend buying and/or reading Learning OpenCV if you want to learn more, it is far beyond the scope of a short paragraph on stackoverflow to expect to learn all of this :)

这篇关于图像校正的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆