Python OpenCV stereoCalibrate()太多manu值到unp

2024-09-28 17:02:30 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在使用OpenCV进行立体校准。我已经对单个摄像机进行了校准。对于以下代码段:

ret, rot, trans, ess, fund = cv2.stereoCalibrate(objectPoints=objpoints,
                                                 imagePoints1=imgpoints1,
                                                 imagePoints2=imgpoints2,
                                                 cameraMatrix1=mtx1,
                                                 distCoeffs1=dist1,
                                                 cameraMatrix2=mtx2,
                                                 distCoeffs2=dist2,
                                                 imageSize=gray1.shape[::-1],
                                                 flags=cv2.CALIB_FIX_INTRINSIC)

我得到了一个错误:

^{pr2}$

但左边已经有五个变量了。根据这个documentation,函数cv2.stereoCalibrate()应该在flags=cv2.CALIB_FIX_INTRINSIC时返回5个值。在

Python: cv2.stereoCalibrate(objectPoints, imagePoints1, imagePoints2, cameraMatrix1, distCoeffs1, cameraMatrix2, distCoeffs2, imageSize[, R[, T[, E[, F[, flags[, criteria]]]]]]) → retval, cameraMatrix1, distCoeffs1, cameraMatrix2, distCoeffs2, R, T, E, F

以及

CV_CALIB_FIX_INTRINSIC Fix cameraMatrix? and distCoeffs? so that only R, T, E , and F matrices are estimated.

PS:我发现了这个answer,但它不适用于cv2。在


Tags: fixcv2flags校准calibobjectpointsimagepoints2imagesize