From 91a84be186db02cedec22c284daf88123c5f35b1 Mon Sep 17 00:00:00 2001 From: Roman Juranek Date: Sun, 14 Jun 2020 21:37:30 +0200 Subject: [PATCH] Deterministic RANSAC --- src/ransac.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/ransac.cpp b/src/ransac.cpp index 5dd03ee..98a05a8 100644 --- a/src/ransac.cpp +++ b/src/ransac.cpp @@ -30,12 +30,12 @@ class RandomSampler set res; public: RandomSampler() - :rng(random_device()()) + :rng() { reset(0); } RandomSampler(const RandomSampler & other) - :rng(random_device()()) + :rng() { reset(0); } @@ -356,7 +356,11 @@ vector group_lines(vector & lines) for (int g = 0; g < MAX_GROUPS; ++g) { vector tmp_outl_indices; - int inl_count = estimate_single_line_group(model, outl_indices, g, INLIER_TOLERANCE, back_inserter(inl_indices), back_inserter(inl_groups), back_inserter(tmp_outl_indices)); + int inl_count = estimate_single_line_group( + model, outl_indices, g, INLIER_TOLERANCE, + back_inserter(inl_indices), + back_inserter(inl_groups), + back_inserter(tmp_outl_indices)); outl_indices = tmp_outl_indices; #if LGROUP_DEBUG_PRINTS clog << "group_lines: group " << g << ": #outliers: " << tmp_outl_indices.size() << ", #inliers: " << inl_count << endl;