参数如何影响整改过程?

时间:2018-01-19 13:13:00

标签: c++ opencv image-processing geometry image-rotation

为什么整改工作会这样?有人可以详细解释一下吗?外在参数如何影响整改结果?

1)我建立了一套立体相机,我可以根据需要旋转它们。我的输入图片: input image 2)我使用Matlab校准它们并通过Kalibr方法确认。所以我假设我知道完美的内在,失真和外在参数。

3)我实施了基于openCV 2.4.13和Matlab的整改作为参考。我的翻译以米为单位[0.13 0.003 0.003]。我纠正的图像:

perfect translation

4)但是我想了解翻译参数的影响。我开始用不同的值进行实验。我注意到当我在摄像机之间设置平移到矢量[0,0,0]时,图像的范围有点宽,但是尺寸相同(我们可能会在图像顶部看到更多一点)图像如下: where translation is 0

5)当我在[2 0.5 0.2]

上改变翻译时

nice try trtanslation

6)当我在[140 3 3]上改变翻译时,以毫米为单位。似乎表明比例因子对整改过程没有太大影响。我认为,深入分析它会产生很大的影响。

scale millimeters

对于所有图像,alpha参数等于0. openCV结果与类似功能的Matlab函数接近(下图)。

enter image description here

最后有人可以解释一下翻译和旋转(外在)参数如何影响整流过程并纠正这种极线几何?以下是我实施计划的方式以及我的一些评论。

我检查了一些文献,但我仍然没有找到明确的答案:

A compact algorithm for rectification of stereo pairs

Szeliski's book page 538

我初始化所有参数:

parameters = cv::Mat::zeros(height1, width1, CV_64FC1); parameters.at<double>(0,0) = fx;

首先 - 我发现所有参数都必须加倍的重要问题。第二个 - nb 1参考相机右侧,这是在左框架相机坐标中表达的。 我打电话给:

C++: void stereoRectify(InputArray cameraMatrix1, InputArray distCoeffs1, InputArray cameraMatrix2, InputArray distCoeffs2, Size imageSize, InputArray R, InputArray T, OutputArray R1, OutputArray R2, OutputArray P1, OutputArray P2, OutputArray Q, int flags=CALIB_ZERO_DISPARITY, double alpha=-1, Size newImageSize=Size(), Rect* validPixROI1=0, Rect* validPixROI2=0 )

我玩了所有参数。之后:

C++: void initUndistortRectifyMap(InputArray cameraMatrix, InputArray distCoeffs, InputArray R, InputArray newCameraMatrix, Size size, int m1type, OutputArray map1, OutputArray map2)

我重新映射:

C++: void remap(InputArray src, OutputArray dst, InputArray map1, InputArray map2, int interpolation, int borderMode=BORDER_CONSTANT, const Scalar& borderValue=Scalar())

最后,我的程序与this非常相似。 Here是openCV的文档。

对于Matlab:

[J1, J2] = rectifyStereoImages(I1, I2, stereoParams);

感谢您的时间和答案。问候。

0 个答案:

没有答案