Fix a bug in two point ransac; Close issue #15

This commit is contained in:
ke 2018-05-28 11:00:06 -04:00
parent 610728c8c4
commit f2c3178314

View File

@ -1109,8 +1109,9 @@ void ImageProcessor::twoPointRansac(
0, raw_inlier_idx.size()-1)]; 0, raw_inlier_idx.size()-1)];
int idx_diff = random_gen.uniformInteger( int idx_diff = random_gen.uniformInteger(
1, raw_inlier_idx.size()-1); 1, raw_inlier_idx.size()-1);
int pair_idx2 = pair_idx1+idx_diff < raw_inlier_idx.size() ? int pair_idx2 = raw_inlier_idx[
pair_idx1+idx_diff : pair_idx1+idx_diff-raw_inlier_idx.size(); pair_idx1+idx_diff < raw_inlier_idx.size() ?
pair_idx1+idx_diff : pair_idx1+idx_diff-raw_inlier_idx.size()];
// Construct the model; // Construct the model;
Vector2d coeff_tx(coeff_t(pair_idx1, 0), coeff_t(pair_idx2, 0)); Vector2d coeff_tx(coeff_t(pair_idx1, 0), coeff_t(pair_idx2, 0));