Merge pull request #19942 from berak:calib3d_fix_usac_mask

pull/19959/head
Alexander Alekhin 4 years ago
commit 29fb4f98b1
  1. 5
      modules/calib3d/src/usac/ransac_solvers.cpp

@ -408,10 +408,11 @@ int mergePoints (InputArray pts1_, InputArray pts2_, Mat &pts, bool ispnp) {
void saveMask (OutputArray mask, const std::vector<bool> &inliers_mask) {
if (mask.needed()) {
const int points_size = (int) inliers_mask.size();
mask.create(points_size, 1, CV_8U);
auto * maskptr = mask.getMat().ptr<uchar>();
Mat tmp_mask(points_size, 1, CV_8U);
auto * maskptr = tmp_mask.ptr<uchar>();
for (int i = 0; i < points_size; i++)
maskptr[i] = (uchar) inliers_mask[i];
tmp_mask.copyTo(mask);
}
}
void setParameters (Ptr<Model> &params, EstimationMethod estimator, const UsacParams &usac_params,

Loading…
Cancel
Save