MCPcopy Create free account
hub / github.com/OSVR/OSVR-Core / getBitsUsingThreshold

Function getBitsUsingThreshold

plugins/videobasedtracker/IdentifierHelpers.h:65–78  ·  view source on GitHub ↗

@brief Helper for implementations of LedIdentifier to turn a brightness list into a boolean list based on thresholding on the halfway point between minimum and maximum brightness.

Source from the content-addressed store, hash-verified

63 /// brightness list into a boolean list based on thresholding on the
64 /// halfway point between minimum and maximum brightness.
65 inline LedPattern getBitsUsingThreshold(const BrightnessList &brightnesses,
66 float threshold) {
67 LedPattern ret;
68 // Allocate output space for our transform.
69 ret.resize(brightnesses.size());
70
71 // Transform the brightnesses into a container of bools using this
72 // little lambda
73 std::transform(
74 begin(brightnesses), end(brightnesses), begin(ret),
75 [threshold](Brightness val) { return val >= threshold; });
76
77 return ret;
78 }
79} // End namespace vbtracker
80} // End namespace osvr
81

Callers 1

getIdMethod · 0.85

Calls 2

resizeMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected