【发布时间】:2015-01-07 18:00:46
【问题描述】:
我正在尝试使用以下 OpenCV 函数使一对相机的输出不失真:
cv::stereoCalibrate(object_points, image_points_left, image_points_right,cameraMatrixLeft, distCoeffsLeft, cameraMatrixRight, distCoeffsRight,cv::Size(sensor_width, sensor_height),R, T, E, F);
cv::stereoRectify(cameraMatrixLeft, distCoeffsLeft, cameraMatrixRight, distCoeffsRight, cv::Size(sensor_width, sensor_height), R, T, R1, R2, P1, P2, Q);
cv::undistortPoints(src_left, dst_left, cameraMatrixLeft, distCoeffsLeft, R1, P1);
cv::undistortPoints(src_right, dst_right, cameraMatrixRight, distCoeffsRight, R2, P2);
据我了解,函数cv::undistortPoints 还应该根据我的立体相机设置使用矩阵R1、R2、P1 和P2 来校正输出,即将极线设置为平行于图像 y 轴并裁剪图像。
这是正确的吗?
但是,在src_left 和src_right 中的点上执行的映射是“倾斜的”,即未失真的输出图像是倾斜的,在图像的边界(尤其是半角)上留下了空白区域。我相信这种倾斜来自旋转矩阵R1 和R2,并且对应于围绕 z 轴的旋转。
现在这是我的问题:
- 为什么(校正后的)输出图像没有填满整个图像空间?
【问题讨论】:
标签: c++ opencv computer-vision calibration