2014-10-12 22:05:02 -0500 received badge ● Necromancer (source) 2014-04-07 23:24:24 -0500 answered a question Inconsistent results from SolvePnp with default set of parameters (flag CV_ITERATIVE) you need min 6 points. 4 points will work only with CV_EPNP, CV_P3P flags. I am not sure why, but I got this from practical experimentation. 2014-04-07 19:22:15 -0500 asked a question solvePnP or projectPoints cannot handle lens distortions I use openCV function projectPoints to rotate/translate and project a set of 3D points and solvePnp to find this rotation/translation. This works when distortion coefficients (lens distortion) are all zero but fails otherwise. The code is below: const int npoints = 10; // 6 min, but CV_P3P, CV_P3P can work with 4 points // extrinsic const Point3f tvec(10, 20, 30); Point3f rvec(3, 5, 7); cout << "Finding extrinsic parameters (PnP)" << endl; cout<<"Test transformations: "; cout<<"Rotation: "<cameraMatrix(3, 3); cameraMatrix << 300., 0., 200., 0, 300., 100., 0., 0., 1.; Mat_ distCoeffs(1, 5); // (k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6]]) of 4, 5, or 8 elements. distCoeffs << 1.2, 0.2, 0., 0., 0.; //distCoeffs << 0.0, 0.0, 0.0, 0.0, 0.0; cout<<"distrotion coeff: "< objectPoints(npoints); vector imagePoints(npoints); Mat rvec_est, tvec_est; vector objPts(npoints); randu(Mat(objPts), 0.0f, 100.0f); // project projectPoints(Mat(objPts), Mat(rvec), Mat(tvec), cameraMatrix, distCoeffs, Mat(imagePoints)); // extrinsic solvePnP(objPts, imagePoints, cameraMatrix, distCoeffs, rvec_est, tvec_est); cout<<"Rotation: "<