25 #ifndef INCLUDED_LED_h_GUID_C53E1134_AD6B_46B0_4808_19C7EAA7D0EC 26 #define INCLUDED_LED_h_GUID_C53E1134_AD6B_46B0_4808_19C7EAA7D0EC 33 #include <opencv2/core/core.hpp> 52 Led(LedIdentifier *identifier, LedMeasurement
const &meas);
56 static const ID SENTINEL_NO_IDENTIFIER_OBJECT_OR_INSUFFICIENT_DATA = -1;
57 static const ID SENTINEL_INSUFFICIENT_EXTREMA_DIFFERENCE = -2;
58 static const ID SENTINEL_NO_PATTERN_RECOGNIZED_DESPITE_SUFFICIENT_DATA =
60 static const uint8_t MAX_NOVELTY = 4;
74 LedMeasurement
const &getMeasurement()
const {
75 return m_latestMeasurement;
84 int getID()
const {
return m_id; }
99 uint8_t
novelty()
const {
return m_novelty; }
109 KeyPointIterator
nearest(KeyPointList &keypoints,
110 double threshold)
const;
113 LedMeasurementIterator
nearest(LedMeasurementList &meas,
114 double threshold)
const;
127 void resetUsed() { m_wasUsedLastFrame =
false; }
138 BrightnessList m_brightnessHistory;
148 bool m_lastBright =
false;
150 bool m_newlyRecognized =
false;
153 bool m_wasUsedLastFrame =
false;
159 #endif // INCLUDED_LED_h_GUID_C53E1134_AD6B_46B0_4808_19C7EAA7D0EC void markAsUsed()
Call from inside the tracking algorithm to mark that it was used.
Definition: LED.h:125
Header file for class that identifies LEDs based on blink codes.
The main namespace for all C++ elements of the framework, internal and external.
Definition: namespace_osvr.dox:3
Led(LedIdentifier *identifier, LedMeasurement const &meas)
Definition: LED.cpp:30
uint8_t novelty() const
Returns a value (decreasing per frame from some maximum down to a minimum of zero) indicating how new...
Definition: LED.h:99
void addMeasurement(LedMeasurement const &meas, bool blobsKeepId)
Add a new measurement for this LED, which must be for a frame that is just following the previous mea...
Definition: LED.cpp:37
void markMisidentified()
Called from within pose estimation or elsewhere with model-based knowledge that can refute the identi...
Definition: LED.cpp:76
bool isBright() const
Returns the most-recent boolean "bright" state according to the LED identifier.
Definition: LED.h:119
cv::Point2f loc
Location in image space - should be undistorted when passed to the Led class.
Definition: LedMeasurement.h:77
cv::Point2f getLocation() const
Reports the most-recently-added position.
Definition: LED.h:102
int getOneBasedID() const
Gets either the raw negative sentinel ID or a 1-based ID (for display purposes)
Definition: LED.h:88
bool wasUsedLastFrame() const
Used for a status display in debug windows.
Definition: LED.h:122
bool identified() const
Do we have a positive identification as a known LED?
Definition: LED.h:91
Definition: LedMeasurement.h:41
int getID() const
Tells which LED I am.
Definition: LED.h:84
KeyPointIterator nearest(KeyPointList &keypoints, double threshold) const
Find the nearest KeyPoint from a container of points to me, if there is one within the specified thre...
Definition: LED.cpp:74
Helper class to identify an LED based on its pattern of brightness over time.
Definition: LedIdentifier.h:53