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

Method meanValue

pose_graph/ThirdParty/DBoW/FBrief.cpp:20–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18// --------------------------------------------------------------------------
19
20void FBrief::meanValue(const std::vector<FBrief::pDescriptor>& descriptors, FBrief::TDescriptor& mean) {
21 mean.reset();
22
23 if (descriptors.empty()) return;
24
25 const int N2 = descriptors.size() / 2;
26
27 std::vector<int> counters(FBrief::L, 0);
28
29 std::vector<FBrief::pDescriptor>::const_iterator it;
30 for (it = descriptors.begin(); it != descriptors.end(); ++it) {
31 const FBrief::TDescriptor& desc = **it;
32 for (int i = 0; i < FBrief::L; ++i) {
33 if (desc[i]) counters[i]++;
34 }
35 }
36
37 for (int i = 0; i < FBrief::L; ++i) {
38 if (counters[i] > N2) mean.set(i);
39 }
40}
41
42// --------------------------------------------------------------------------
43

Callers

nothing calls this directly

Calls 4

setMethod · 0.80
resetMethod · 0.45
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected