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; }
162 BrightnessList m_brightnessHistory;
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.
Definition: LED.h:47
void markAsUsed()
Call from inside the tracking algorithm to mark that it was used.
Definition: LED.h:149
cv::Point2f getInverseLocation() const
Gets the most-recently-added position, in a xy-origin-at-bottom-left coordinate system.
Definition: LED.h:111
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:104
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
ZeroBasedBeaconId getID() const
Tells which LED I am.
Definition: LED.h:89
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:143
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:107
bool wasUsedLastFrame() const
Used for a status display in debug windows.
Definition: LED.h:146
OneBasedBeaconId getOneBasedID() const
Gets either the raw negative sentinel ID or a 1-based ID (for display purposes)
Definition: LED.h:93
bool identified() const
Do we have a positive identification as a known LED?
Definition: LED.h:96
OneBasedBeaconId makeOneBased(ZeroBasedBeaconId id)
Overloaded conversion function to turn any beacon ID into one-based, respecting the convention that n...
Definition: BeaconIdTypes.h:79
cv::Size imageSize
Size of the image the measurement came from.
Definition: LedMeasurement.h:80
Definition: LedMeasurement.h:41
bool beaconIdentified(ZeroBasedBeaconId id)
Does the given beacon ID indicate that it's identified?
Definition: BeaconIdTypes.h:118
cv::Point2f getLocationForTracking() const
Gets the most-recently-added position in the coordinate system to be used for tracking.
Definition: LED.h:123
Header file for class that identifies LEDs based on blink codes.
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