"_rvec" and "_tvec" for solvePnPRansac() are wrong. [closed]
Environment:
OpenCV 3.1.0
OS X 10.11.4
I am using "solvePnPRansac()" to get "_rvec" and "_tvec".
However, I thought values are wrong.
Because when I tried same step with "OpenCV 2.4.12", there is the difference between both.
call "solvePnP" with arg "rvec", but set "_local_model.col" as "_rvec". ("tvec" also)
Code:
opencv-3.1.0/modules/calib3d/src/solvepnp.cpp (https://github.com/Itseez/opencv/blob...)
result = solvePnP(opoints_inliers, ipoints_inliers, cameraMatrix, distCoeffs, rvec, tvec, false, flags == SOLVEPNP_P3P ? SOLVEPNP_EPNP : flags) ? 1 : -1;
_rvec.assign(_local_model.col(0)); // output rotation vector
_tvec.assign(_local_model.col(1)); // output translation vector
I think this is right.
Code:
result = solvePnP(opoints_inliers, ipoints_inliers, cameraMatrix, distCoeffs, _local_model.col(0), _local_model.col(1), false, flags == SOLVEPNP_P3P ? SOLVEPNP_EPNP : flags) ? 1 : -1;
What do you think?
Indeed, the corresponding issue and the pull request.