solvePnPRansac: fix mask generation

pull/3405/head
Alexander Duda 10 years ago
parent ed55d13112
commit 60cacbfd66
  1. 10
      modules/calib3d/src/solvepnp.cpp

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

Loading…
Cancel
Save