solvePnPRansac: fix mask generation

This commit is contained in:
Alexander Duda 2014-11-09 23:10:43 +01:00
parent ed55d13112
commit 60cacbfd66

View File

@ -251,14 +251,10 @@ bool cv::solvePnPRansac(InputArray _opoints, InputArray _ipoints,
if(_inliers.needed())
{
Mat _local_inliers;
int count = 0;
for (int i = 0; i < _mask_local_inliers.rows; ++i)
for (int i = 0; i < npoints; ++i)
{
if((int)_mask_local_inliers.at<uchar>(i) == 1) // inliers mask
{
_local_inliers.push_back(count); // output inliers vector
count++;
}
if((int)_mask_local_inliers.at<uchar>(i) != 0) // inliers mask
_local_inliers.push_back(i); // output inliers vector
}
_local_inliers.copyTo(_inliers);
}