Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

cv::SolvePnP with CV_ITERATIVE under OpenCV 3.3

Hi all, I have a problem with the function cv::SolvePnP. The same call works PERFECTLY under OpenCV 3.1 with three points (markers). This is the call:

cv::solvePnP(Markers3DCoord_world,ImagePoints,Mat(IntrinsicMatx),Mat(Distortionparams),rot_vec_l,vec_tras_l,true,cv::CV_ITERATIVE); Markes3DCoord_world are std::vector of Point3f whereas ImagePoints are std::vector of Point2f

I know that the problem would be ambigous in general with three points, but using an Iterative optimization (flags set to true and method: CV_ITERATIVE) if I use a good initial guess I obtain the solution I am seeking. The same method on OpenCV 3.3 crashes. Why is that? If i use the same method with a standard tracking of a chessboard (with n° of points = 12) it works perfectly. In this case the call is: flag_err=solvePnP(Markers3DCoord_world,ImagePoints,Mat(IntrinsicMatx),Mat(Distortionparams),rot_vec_l,vec_tras_l,false,cv::CV_ITERATIVE);

What's the matter with solvePnP under OpenCV 3.3?

Thanks

cv::SolvePnP with CV_ITERATIVE under OpenCV 3.3

Hi all, I have a problem with the function cv::SolvePnP. The same call function works PERFECTLY under OpenCV 3.1 with three points (markers). This is the call:

cv::solvePnP(Markers3DCoord_world,ImagePoints,Mat(IntrinsicMatx),Mat(Distortionparams),rot_vec_l,vec_tras_l,true,cv::CV_ITERATIVE); Markes3DCoord_world are std::vector of Point3f Point3f, whereas ImagePoints are std::vector of Point2f

I know that the problem per se would be ambigous in general with three points, points (P3P problem), but using an the Iterative optimization of the Levenberg-Marquardt optimization algorithm (flags set to true and method: CV_ITERATIVE) if I use a good initial guess I obtain the solution that I am seeking. The seeking under OpenCV 3.1. Now the problem is that the same method on OpenCV 3.3 crashes. seems to crash. Why is that? If i use the same method under OpenCV 3.3 but with a standard tracking of a chessboard (with higher n° of points = 12) 12 ( as in the case of a chessboard tracking) it works perfectly. In this case the call is: flag_err=solvePnP(Markers3DCoord_world,ImagePoints,Mat(IntrinsicMatx),Mat(Distortionparams),rot_vec_l,vec_tras_l,false,cv::CV_ITERATIVE);

What's the matter with solvePnP under OpenCV 3.3?

Thanks