mirror of
https://github.com/opencv/opencv.git
synced 2025-01-18 22:44:02 +08:00
solvePnPRansac: fix mask generation
This commit is contained in:
parent
ed55d13112
commit
60cacbfd66
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user