MCPcopy Create free account
hub / github.com/AutonomousFieldRoboticsLab/SVIn / normalize

Method normalize

pose_graph/ThirdParty/DBoW/BowVector.cpp:52–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50// --------------------------------------------------------------------------
51
52void BowVector::normalize(LNorm norm_type) {
53 double norm = 0.0;
54 BowVector::iterator it;
55
56 if (norm_type == DBoW2::L1) {
57 for (it = begin(); it != end(); ++it) norm += fabs(it->second);
58 } else {
59 for (it = begin(); it != end(); ++it) norm += it->second * it->second;
60 norm = sqrt(norm);
61 }
62
63 if (norm > 0.0) {
64 for (it = begin(); it != end(); ++it) it->second /= norm;
65 }
66}
67
68// --------------------------------------------------------------------------
69

Callers 9

FrameRelativeAdapterMethod · 0.80
setBestMatchMethod · 0.80
TESTFunction · 0.80
oplusMethod · 0.80
transformMethod · 0.80
Pose3dClass · 0.80

Calls

no outgoing calls

Tested by 1

TESTFunction · 0.64