-
-
Notifications
You must be signed in to change notification settings - Fork 56.5k
solvePnPRansac() returns the "wrong" rvec and tvec #9085
Copy link
Copy link
Closed
Labels
Description
System information (version)
- OpenCV => 3.3.0-rc
Detailed description
From what I have understood of the code, solvePnPRansac returns the best rvec and tvec estimated during the Minimal Sample Sets step (estimated rvec and tvec that produce the best (bigger) consensus set) and not rvec and tvec estimated using all the inliers.
The corresponding faulty code is here:
if( result <= 0 || _local_model.rows <= 0)
{
_rvec.assign(rvec); // output rotation vector
_tvec.assign(tvec); // output translation vector
if( _inliers.needed() )
_inliers.release();
return false;
}
else
{
_rvec.assign(_local_model.col(0)); // output rotation vector
_tvec.assign(_local_model.col(1)); // output translation vector
}
When result > 0 is ok, _rvec and _tvec are assigned with the _local_model insted of rvec and tvec estimated using all the inliers.
Reactions are currently unavailable