MCPcopy Create free account
hub / github.com/PJLab-ADG/Livox-Mapping / distDirectSC

Method distDirectSC

SC-PGO/include/scancontext/Scancontext.cpp:69–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67
68
69double SCManager::distDirectSC ( MatrixXd &_sc1, MatrixXd &_sc2 )
70{
71 int num_eff_cols = 0; // i.e., to exclude all-nonzero sector
72 double sum_sector_similarity = 0;
73 for ( int col_idx = 0; col_idx < _sc1.cols(); col_idx++ )
74 {
75 VectorXd col_sc1 = _sc1.col(col_idx);
76 VectorXd col_sc2 = _sc2.col(col_idx);
77
78 if( (col_sc1.norm() == 0) | (col_sc2.norm() == 0) )
79 continue; // don't count this sector pair.
80
81 double sector_similarity = col_sc1.dot(col_sc2) / (col_sc1.norm() * col_sc2.norm());
82
83 sum_sector_similarity = sum_sector_similarity + sector_similarity;
84 num_eff_cols = num_eff_cols + 1;
85 }
86
87 double sc_sim = sum_sector_similarity / num_eff_cols;
88 return 1.0 - sc_sim;
89
90} // distDirectSC
91
92
93int SCManager::fastAlignUsingVkey( MatrixXd & _vkey1, MatrixXd & _vkey2)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected