Possible duplicate,但还没有得到答复: 我的代码部分如下:
(ret, mat1,dist1,mat2,dist2, R, T, E, F) = cv2.stereoCalibrate(
objpoints1,
imgpoints1,
imgpoints2,
imgsize1, criteria=None, flags=None)
我得到以下错误:
TypeError: stereoCalibrate() missing required argument 'distCoeffs1' (pos 5)
根据文档:Camera Calibration and 3D Reconstruction: cv2.stereoCalibrate(),“cameraMatrix1,distCoeffs1,cameraMatrix2,distCoeffs2”的参数是输入/输出,不需要将它们传递到函数调用中
见以下报价:
If any of CV_CALIB_USE_INTRINSIC_GUESS , CV_CALIB_FIX_ASPECT_RATIO , CV_CALIB_FIX_INTRINSIC , or CV_CALIB_FIX_FOCAL_LENGTH are specified, some or all of the matrix components must be initialized. See the flags description for details.
我还看到一些应用程序,其中人们忽略了这些参数,让函数来估计它们。我看不出我的代码与它们相比有什么不同,和/或我如何触发函数不检查这些参数,并按照文档和一些在线可用的应用程序中的说明工作
提前谢谢
您参考的文档可能比您实际使用的版本旧得多。对于latest OpenCV release (4.2.0),函数签名为:
其中第5个参数是
distCoeffs1
,这也会在错误消息中报告您需要将所有必需的参数(objectPoints、imagePoints1、imagePoints2、cameraMatrix1、distCoeffs1、cameraMatrix2、distCoeffs2、imageSize)传递给
stereoCalibrate()
相关问题 更多 >
编程相关推荐