stereoCalibrate() changes focal lengths even when it was not supposed to

后端 未结 2 865
星月不相逢
星月不相逢 2021-02-10 23:37

I noticed that opencv stereoCalibrate() changes the focal lengths in camera matrices even though I\'ve set appropriate flag (ie CV_CALIB_FIX_FOCAL_LENGTH). I\'m using two identi

相关标签:
2条回答
  • 2021-02-11 00:24

    In order to do what you want, you have to call stereoCalibrate with flags:

    CV_CALIB_USE_INTRINSIC_GUESS | CV_CALIB_FIX_FOCAL_LENGTH | CV_CALIB_FIX_PRINCIPAL_POINT
    

    If you do not use the CV_CALIB_USE_INTRINSIC_GUESS flag, stereoCalibrate will first initialize the camera matrices and distortion coefficients itself and then fix part of them in the subsequent optimization. This is stated in the documentation, although rather unclearly and without mentionning that critical flag:

    Besides the stereo-related information, the function can also perform a full calibration of each of two cameras. However, due to the high dimensionality of the parameter space and noise in the input data, the function can diverge from the correct solution. If the intrinsic parameters can be estimated with high accuracy for each of the cameras individually (for example, using calibrateCamera() ), you are recommended to do so [...].

    Using CV_CALIB_USE_INTRINSIC_GUESS in addition to any of the CV_CALIB_FIX_* flags tells the function to use what you are passing as input, otherwise, this input is simply ignored and overwritten.

    0 讨论(0)
  • 2021-02-11 00:24

    the CV_CALIB_FIX_FOCAL_LENGTH flag causes the optimization routine to just use the Fx and Fy that were passed in the intrinsic matrix.

    0 讨论(0)
提交回复
热议问题