MCPcopy Create free account
hub / github.com/amov-lab/Prometheus / _vector_stdev

Function _vector_stdev

Modules/object_detection/cpp_nodes/aruco_det_v2.cpp:139–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137
138
139float _vector_stdev(std::vector<float>& x)
140{
141 float sum, mean, accum, stdev;
142 sum = std::accumulate(std::begin(x), std::end(x), 0.0);
143 mean = sum / x.size();
144 accum = 0.0;
145 std::for_each (std::begin(x), std::end(x), [&](const float d) {
146 accum += (d - mean) * (d - mean);
147 });
148 stdev = sqrt(accum / (x.size() - 1));
149 return stdev;
150}
151
152
153int main(int argc, char **argv)

Callers 1

mainFunction · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected