Skip to content

Commit c30305f

Browse files
committed
Tweaks for ransac estimators.
1 parent 84483a0 commit c30305f

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

modules/opencv/features2d/ransac_est.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -361,9 +361,8 @@ struct MatchRefinementHSvd
361361
{
362362
p.declare(&C::n_iters, "n_iters", "number of ransac iterations", 100);
363363
p.declare(&C::reprojection_error, "reprojection_error", "error threshold", 8);
364-
p.declare(&C::min_inliers, "min_inliers", "minimum number of inliers", 100);
365-
p.declare(&C::inlier_thresh, "inlier_thresh", "The inlier threshold of pose found.", 20);
366-
364+
p.declare(&C::min_inliers, "min_inliers", "minimum number of inliers", 25);
365+
p.declare(&C::inlier_thresh, "inlier_thresh", "The inlier threshold of pose found.", 30);
367366
}
368367
static void
369368
declare_io(const tendrils& p, tendrils& inputs, tendrils& outputs)
@@ -386,8 +385,8 @@ struct MatchRefinementHSvd
386385
*found_out = false;
387386
matches_t good_matches, good_matches_H;
388387
std::remove_copy_if(matches_in->begin(), matches_in->end(), std::back_inserter(good_matches),
389-
match_distance_predicate<60>());
390-
if (good_matches.size() < *inlier_thresh)
388+
match_distance_predicate<55>());
389+
if (good_matches.size() < *min_inliers)
391390
return ecto::OK;
392391

393392
//collate the matches into contiguous blocks of 3d points.
@@ -429,15 +428,15 @@ struct MatchRefinementHSvd
429428
*matches_out = good_matches;
430429
*matches_mask = inlier_mask;
431430
float inlier_percentage = 100 * float(demeaned_train_pts.size()) / good_matches.size();
432-
*found_out = inlier_percentage > *inlier_thresh && *min_inliers/2 < demeaned_test_pts.size();
431+
*found_out = inlier_percentage > *inlier_thresh && *min_inliers / 2 < demeaned_test_pts.size();
433432
return ecto::OK;
434433
}
435434
ecto::spore<cv::Mat> K, train_2d, test_2d, test_3d, train_3d, R_out, T_out;
436435
ecto::spore<matches_t> matches_in, matches_out;
437436
ecto::spore<cv::Mat> matches_mask;
438437
ecto::spore<bool> found_out;
439438
ecto::spore<unsigned> n_iters, min_inliers;
440-
ecto::spore<float> reprojection_error,inlier_thresh;
439+
ecto::spore<float> reprojection_error, inlier_thresh;
441440

442441
};
443442
ECTO_CELL(features2d, MatchRefinement, "MatchRefinement",

0 commit comments

Comments
 (0)