When I use solvePnPRansac function to do pose estimation for KITTI datasets: solvePnPRansac(pts_obj,pts_img,cameraMatrix,Mat(),rvec,tvec,false,100); The rvec and tvec is wrong after a while. But I use solvePnPRansac function in opencv 3.2.0, it works well.