From f2c3178314f13be2c41c258050ee451db5dba042 Mon Sep 17 00:00:00 2001 From: ke Date: Mon, 28 May 2018 11:00:06 -0400 Subject: [PATCH] Fix a bug in two point ransac; Close issue #15 --- src/image_processor.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/image_processor.cpp b/src/image_processor.cpp index adc3c24..08f9736 100644 --- a/src/image_processor.cpp +++ b/src/image_processor.cpp @@ -1109,8 +1109,9 @@ void ImageProcessor::twoPointRansac( 0, raw_inlier_idx.size()-1)]; int idx_diff = random_gen.uniformInteger( 1, raw_inlier_idx.size()-1); - int pair_idx2 = pair_idx1+idx_diff < raw_inlier_idx.size() ? - pair_idx1+idx_diff : pair_idx1+idx_diff-raw_inlier_idx.size(); + int pair_idx2 = raw_inlier_idx[ + pair_idx1+idx_diff < raw_inlier_idx.size() ? + pair_idx1+idx_diff : pair_idx1+idx_diff-raw_inlier_idx.size()]; // Construct the model; Vector2d coeff_tx(coeff_t(pair_idx1, 0), coeff_t(pair_idx2, 0));