@@ -32,13 +32,14 @@ void teaser::ScalarTLSEstimator::estimate(const Eigen::RowVectorXd& X,
32
32
33
33
int N = X.cols ();
34
34
std::vector<std::pair<double , int >> h;
35
- for (size_t i= 0 ; i < N ; ++i){
36
- h.push_back (std::make_pair (X (i) - ranges (i), i+ 1 ));
37
- h.push_back (std::make_pair (X (i) + ranges (i), -i- 1 ));
35
+ for (size_t i = 0 ; i < N; ++i) {
36
+ h.push_back (std::make_pair (X (i) - ranges (i), i + 1 ));
37
+ h.push_back (std::make_pair (X (i) + ranges (i), -i - 1 ));
38
38
}
39
39
40
40
// ascending order
41
- std::sort (h.begin (), h.end (), [](std::pair<double , int > a, std::pair<double , int > b) { return a.first < b.first ; });
41
+ std::sort (h.begin (), h.end (),
42
+ [](std::pair<double , int > a, std::pair<double , int > b) { return a.first < b.first ; });
42
43
43
44
// calculate weights
44
45
Eigen::RowVectorXd weights = ranges.array ().square ();
@@ -51,10 +52,10 @@ void teaser::ScalarTLSEstimator::estimate(const Eigen::RowVectorXd& X,
51
52
double dot_X_weights = 0 ;
52
53
double dot_weights_consensus = 0 ;
53
54
int consensus_set_cardinal = 0 ;
54
- double sum_xi = 0 ;
55
+ double sum_xi = 0 ;
55
56
double sum_xi_square = 0 ;
56
57
57
- for (size_t i = 0 ; i < nr_centers ; ++i){
58
+ for (size_t i = 0 ; i < nr_centers; ++i) {
58
59
59
60
int idx = int (std::abs (h.at (i).second )) - 1 ; // Indices starting at 1
60
61
int epsilon = (h.at (i).second > 0 ) ? 1 : -1 ;
@@ -68,9 +69,9 @@ void teaser::ScalarTLSEstimator::estimate(const Eigen::RowVectorXd& X,
68
69
69
70
x_hat (i) = dot_X_weights / dot_weights_consensus;
70
71
71
- double residual = consensus_set_cardinal * x_hat (i) * x_hat (i) + sum_xi_square - 2 * sum_xi * x_hat (i);
72
+ double residual =
73
+ consensus_set_cardinal * x_hat (i) * x_hat (i) + sum_xi_square - 2 * sum_xi * x_hat (i);
72
74
x_cost (i) = residual + ranges_inverse_sum;
73
-
74
75
}
75
76
76
77
size_t min_idx;
@@ -433,7 +434,8 @@ teaser::RobustRegistrationSolver::solve(const Eigen::Matrix<double, 3, Eigen::Dy
433
434
*/
434
435
src_tims_ = computeTIMs (src, &src_tims_map_);
435
436
dst_tims_ = computeTIMs (dst, &dst_tims_map_);
436
- TEASER_DEBUG_INFO_MSG (" Starting scale solver." );
437
+ TEASER_DEBUG_INFO_MSG (
438
+ " Starting scale solver (only selecting inliers if scale estimation has been disabled." );
437
439
solveForScale (src_tims_, dst_tims_);
438
440
TEASER_DEBUG_INFO_MSG (" Scale estimation complete." );
439
441
@@ -507,10 +509,10 @@ teaser::RobustRegistrationSolver::solve(const Eigen::Matrix<double, 3, Eigen::Dy
507
509
pruned_dst_tims_.col (i) = dst.col (leaf) - dst.col (root);
508
510
509
511
// populate the TIMs map
510
- dst_tims_map_rotation_ (0 ,i) = leaf;
511
- dst_tims_map_rotation_ (1 ,i) = root;
512
- src_tims_map_rotation_ (0 ,i) = leaf;
513
- src_tims_map_rotation_ (1 ,i) = root;
512
+ dst_tims_map_rotation_ (0 , i) = leaf;
513
+ dst_tims_map_rotation_ (1 , i) = root;
514
+ src_tims_map_rotation_ (0 , i) = leaf;
515
+ src_tims_map_rotation_ (1 , i) = root;
514
516
}
515
517
} else {
516
518
// complete graph
0 commit comments