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>
41 static const bool USING_INVERTED_LED_POSITION =
true;
49 static const int SENTINEL_NO_IDENTIFIER_OBJECT_OR_INSUFFICIENT_DATA =
51 static const int SENTINEL_INSUFFICIENT_EXTREMA_DIFFERENCE = -2;
53 SENTINEL_NO_PATTERN_RECOGNIZED_DESPITE_SUFFICIENT_DATA = -3;
54 static const int SENTINEL_NO_IDENTIFIER_OBJECT = -4;
55 static const int SENTINEL_MARKED_MISIDENTIFIED = -5;
65 static const uint8_t MAX_NOVELTY = 4;
80 return m_latestMeasurement;
112 return cv::Point2f(m_latestMeasurement.
imageSize.width -
113 m_latestMeasurement.
loc.x,
115 m_latestMeasurement.
loc.y);
133 KeyPointIterator
nearest(KeyPointList &keypoints,
134 double threshold)
const;
137 LedMeasurementVecIterator
nearest(LedMeasurementVec &meas,
138 double threshold)
const;
151 void resetUsed() { m_wasUsedLastFrame =
false; }
159 LedMeasurement m_latestMeasurement;
162 BrightnessList m_brightnessHistory;
166 ZeroBasedBeaconId m_id =
167 ZeroBasedBeaconId(SENTINEL_NO_IDENTIFIER_OBJECT);
170 LedIdentifier *m_identifier =
nullptr;
173 bool m_lastBright =
false;
175 bool m_newlyRecognized =
false;
178 bool m_wasUsedLastFrame =
false;
184 #endif // INCLUDED_LED_h_GUID_C53E1134_AD6B_46B0_4808_19C7EAA7D0EC
Helper class to keep track of the state of a blob over time. This is used to help determine the ident...
cv::Point2f getLocation() const
Reports the most-recently-added position.
void markAsUsed()
Call from inside the tracking algorithm to mark that it was used.
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...
Led(LedIdentifier *identifier, LedMeasurement const &meas)
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...
bool isBright() const
Returns the most-recent boolean "bright" state according to the LED identifier. Note that the value i...
bool identified() const
Do we have a positive identification as a known LED?
uint8_t novelty() const
Returns a value (decreasing per frame from some maximum down to a minimum of zero) indicating how new...
OneBasedBeaconId getOneBasedID() const
Gets either the raw negative sentinel ID or a 1-based ID (for display purposes)
cv::Point2f getLocationForTracking() const
Gets the most-recently-added position in the coordinate system to be used for tracking.
cv::Point2f getInverseLocation() const
Gets the most-recently-added position, in a xy-origin-at-bottom-left coordinate system.
ZeroBasedBeaconId getID() const
Tells which LED I am.
cv::Size imageSize
Size of the image the measurement came from.
Header file for class that identifies LEDs based on blink codes.
bool wasUsedLastFrame() const
Used for a status display in debug windows.
Helper class to identify an LED based on its pattern of brightness over time. The base class defines ...