REVLib - C++
|
#include <ColorMatch.h>
Public Member Functions | |
ColorMatch () | |
void | AddColorMatch (const frc::Color &color) |
void | SetConfidenceThreshold (double confidence) |
std::optional< frc::Color > | MatchColor (const frc::Color &colorToMatch) |
std::optional< frc::Color > | MatchColor (const frc::Color &colorToMatch, double &confidence) |
frc::Color | MatchClosestColor (const frc::Color &colorToMatch, double &confidence) |
REV Robotics Color Sensor V3.
This class allows access to a REV Robotics color sensor V3 on an I2C bus.
ColorMatch::ColorMatch | ( | ) |
void ColorMatch::AddColorMatch | ( | const frc::Color & | color | ) |
Add color to match object
color | color to add to matching |
void ColorMatch::SetConfidenceThreshold | ( | double | confidence | ) |
Set the confidence interval for determining color. Defaults to 0.95
confidence | A value between 0 and 1 |
std::optional< frc::Color > ColorMatch::MatchColor | ( | const frc::Color & | colorToMatch | ) |
MatchColor uses euclidean distance to compare a given normalized RGB vector against stored values
colorToMatch | color to compare against stored colors |
std::optional< frc::Color > ColorMatch::MatchColor | ( | const frc::Color & | colorToMatch, |
double & | confidence | ||
) |
MatchColor uses euclidean distance to compare a given normalized RGB vector against stored values
colorToMatch | color to compare against stored colors |
confidence | The confidence value for this match, this is simply 1 - euclidean distance of the two color vectors |
frc::Color ColorMatch::MatchClosestColor | ( | const frc::Color & | colorToMatch, |
double & | confidence | ||
) |
MatchColor uses euclidean distance to compare a given normalized RGB vector against stored values
colorToMatch | color to compare against stored colors |
confidence | The confidence value for this match, this is simply 1 - euclidean distance of the two color vectors |