我想收集位于两个摄像机焦点处的身体的高度数据,这就是我的立体声设置的样子:
当我使用标准 cv2 函数计算图像的校正版本时,它看起来非常糟糕。当我对相机并行使用类似的设置时,它起作用了。
我计算了外线,它们似乎是正确的:
However, the resulting rectified images are not (below, the original images are above):
这是我使用的代码,大部分是从 openCV 教程复制的
http://www.dmi.unict.it/~furnari/teaching/CV1617/lab1/ http://www.dmi.unict.it/~furnari/teaching/CV1617/lab1/
3d/2d 点和矩阵之前使用以下方法计算
cv2.calibrateCamera()
校准和校正过程
retval, _, _, _, _, R, T, E, F = cv2.stereoCalibrate(imager._3d_points, _2d_points_L,_2d_points_R, mtxL, distL, mtxR, distR, (img.shape[1], img.shape[0])
R1, R2, P1, P2, Q, _, _ = cv2.stereoRectify(mtxL, distL, mtxR, distR, (img.shape[1], img.shape[0]), R, T, )
map1_x, map1_y = cv2.initUndistortRectifyMap(imager.mtxL, imager.distL, R1, P1, (imLeft.shape[1], imLeft.shape[0]), cv2.CV_32FC1)
map2_x, map2_y = cv2.initUndistortRectifyMap(imager.mtxR, imager.distR, R2, P2, (imLeft.shape[1], imLeft.shape[0]), cv2.CV_32FC1)
imgL = cv2.remap(imLeft, map1_x, map1_y , cv2.INTER_CUBIC)
imgR = cv2.remap(imRight, map2_x, map2_y , cv2.INTER_CUBIC)
OpenCV 是否根本无法使用我的相机设置校正图像,或者我做错了什么?