校准立体摄像机时出错

时间:2018-07-06 16:34:34

标签: python computer-vision opencv3.0 camera-calibration

我想使用openCv校准拖车相机。我使用了自爆代码,但出现此错误

代码:

TERMINATION_CRITERIA = (cv2.TERM_CRITERIA_EPS , 30,0.001)
(_, _, _, _, _, rotationMatrix, translationVector, _, _) = cv2.stereoCalibrate(
        objectPoints, leftImagePoints, rightImagePoints,
        leftCameraMatrix, leftDistortionCoefficients,
        rightCameraMatrix, rightDistortionCoefficients,
        imageSize, None, None, None, None,TERMINATION_CRITERIA,
        cv2.CALIB_FIX_INTRINSIC)
  

错误:        cv2.CALIB_FIX_INTRINSIC,TERMINATION_CRITERIA)       SystemError:新样式的getargs格式,但参数不是元组

1 个答案:

答案 0 :(得分:0)

我相信您需要根据documentation

切换最后两个参数
TERMINATION_CRITERIA = (cv2.TERM_CRITERIA_EPS , 30,0.001)
(_, _, _, _, _, rotationMatrix, translationVector, _, _) = cv2.stereoCalibrate(
        objectPoints, leftImagePoints, rightImagePoints,
        leftCameraMatrix, leftDistortionCoefficients,
        rightCameraMatrix, rightDistortionCoefficients,
        imageSize, None, None, None, None,
        TERMINATION_CRITERIA, cv2.CALIB_FIX_INTRINSIC) #switched<>