OSVR-Core
|
Helper class to keep track of the state of a blob over time. More...
#include <LED.h>
Public Types | |
typedef int | ID |
Public Member Functions | |
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 measurement, so that the encoding of brightness and darkness can be used to identify it. More... | |
LedMeasurement const & | getMeasurement () const |
ZeroBasedBeaconId | getID () const |
Tells which LED I am. More... | |
OneBasedBeaconId | getOneBasedID () const |
Gets either the raw negative sentinel ID or a 1-based ID (for display purposes) | |
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 the identification of this blob with its current ID is. More... | |
cv::Point2f | getLocation () const |
Reports the most-recently-added position. | |
cv::Point2f | getInverseLocation () const |
Gets the most-recently-added position, in a xy-origin-at-bottom-left coordinate system. | |
cv::Point2f | getLocationForTracking () const |
Gets the most-recently-added position in the coordinate system to be used for tracking. More... | |
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 threshold. More... | |
LedMeasurementVecIterator | nearest (LedMeasurementVec &meas, double threshold) const |
bool | isBright () const |
Returns the most-recent boolean "bright" state according to the LED identifier. More... | |
bool | wasUsedLastFrame () const |
Used for a status display in debug windows. | |
void | markAsUsed () |
Call from inside the tracking algorithm to mark that it was used. | |
void | resetUsed () |
void | markMisidentified () |
Called from within pose estimation or elsewhere with model-based knowledge that can refute the identification of this blob. More... | |
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 measurement, so that the encoding of brightness and darkness can be used to identify it. More... | |
LedMeasurement const & | getMeasurement () const |
int | getID () const |
Tells which LED I am. More... | |
int | getOneBasedID () const |
Gets either the raw negative sentinel ID or a 1-based ID (for display purposes) | |
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 the identification of this blob with its current ID is. More... | |
cv::Point2f | getLocation () const |
Reports the most-recently-added position. | |
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 threshold. More... | |
LedMeasurementIterator | nearest (LedMeasurementList &meas, double threshold) const |
bool | isBright () const |
Returns the most-recent boolean "bright" state according to the LED identifier. More... | |
bool | wasUsedLastFrame () const |
Used for a status display in debug windows. | |
void | markAsUsed () |
Call from inside the tracking algorithm to mark that it was used. | |
void | resetUsed () |
void | markMisidentified () |
Called from within pose estimation or elsewhere with model-based knowledge that can refute the identification of this blob. More... | |
Constructors | |
Constructor takes initial values for the location and brightness, and a pointer to an object that will be used to identify the LEDs based on their brightness over time. | |
Led (LedIdentifier *identifier, LedMeasurement const &meas) | |
Led (LedIdentifier *identifier, LedMeasurement const &meas) | |
Helper class to keep track of the state of a blob over time.
This is used to help determine the identity of each LED in the scene. The LEDs are identified by their blink codes. A steady one is presumed to be a light source.
osvr::vbtracker::Led::Led | ( | LedIdentifier * | identifier, |
LedMeasurement const & | meas | ||
) |
Doesn't matter what the blobs keep ID pref is here, because this is a new blob so there's no ID to keep.
Doesn't matter what the blobs keep ID pref is here, because this is a new blob so there's no ID to keep.
void osvr::vbtracker::Led::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 measurement, so that the encoding of brightness and darkness can be used to identify it.
meas | A number of measurement parameters, of which only brightness and location are used in identifying beacon patterns. brightness is an abstract quantity that is fed into the identity detector; it may be area or summed brightness or another useful estimate of the LED state. The other parameters are carried along in the hope that they may be useful to later code. (For instance, not all identified beacons may be good choices to use in determining tracking pose) |
void osvr::vbtracker::Led::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 measurement, so that the encoding of brightness and darkness can be used to identify it.
meas | A number of measurement parameters, of which only brightness and location are used in identifying beacon patterns. brightness is an abstract quantity that is fed into the identity detector; it may be area or summed brightness or another useful estimate of the LED state. The other parameters are carried along in the hope that they may be useful to later code. (For instance, not all identified beacons may be good choices to use in determining tracking pose) |
Make the "misidentified" sentinel a little stickier than "insufficient data" or "no pattern recognized" so we can see it on the debug view.
Right now, any change in ID is considered being "newly recognized".
If newly recognized, start at max novelty
Novelty decays linearly to 0
Right now, any change in ID is considered being "newly recognized".
If newly recognized, start at max novelty
Novelty decays linearly to 0
|
inline |
Tells which LED I am.
|
inline |
Tells which LED I am.
|
inline |
Gets the most-recently-added position in the coordinate system to be used for tracking.
Provides a centralized place to switch between getLocation() and getInverseLocation() for tracking purposes.
|
inline |
Returns the most-recent boolean "bright" state according to the LED identifier.
Note that the value is only meaningful if identified()
is true.
|
inline |
Returns the most-recent boolean "bright" state according to the LED identifier.
Note that the value is only meaningful if identified()
is true.
void osvr::vbtracker::Led::markMisidentified | ( | ) |
Called from within pose estimation or elsewhere with model-based knowledge that can refute the identification of this blob.
void osvr::vbtracker::Led::markMisidentified | ( | ) |
Called from within pose estimation or elsewhere with model-based knowledge that can refute the identification of this blob.
KeyPointIterator osvr::vbtracker::Led::nearest | ( | KeyPointList & | keypoints, |
double | threshold | ||
) | const |
Find the nearest KeyPoint from a container of points to me, if there is one within the specified threshold.
Runtime: O(n) where n is the number of elements in keypoints.
LedMeasurementIterator osvr::vbtracker::Led::nearest | ( | LedMeasurementList & | meas, |
double | threshold | ||
) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
KeyPointIterator osvr::vbtracker::Led::nearest | ( | KeyPointList & | keypoints, |
double | threshold | ||
) | const |
Find the nearest KeyPoint from a container of points to me, if there is one within the specified threshold.
Runtime: O(n) where n is the number of elements in keypoints.
LedMeasurementIterator osvr::vbtracker::Led::nearest | ( | LedMeasurementVec & | meas, |
double | threshold | ||
) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inline |
Returns a value (decreasing per frame from some maximum down to a minimum of zero) indicating how new the identification of this blob with its current ID is.
This can be used to compensate for accidental mis-identifications, identity switching, or the simple fact that new identifications might contain highly novel information that would otherwise "shock" the tracked state.
|
inline |
Returns a value (decreasing per frame from some maximum down to a minimum of zero) indicating how new the identification of this blob with its current ID is.
This can be used to compensate for accidental mis-identifications, identity switching, or the simple fact that new identifications might contain highly novel information that would otherwise "shock" the tracked state.
|
static |
|
static |