Package com.revrobotics
Class ColorMatch
java.lang.Object
com.revrobotics.ColorMatch
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addColorMatch
(edu.wpi.first.wpilibj.util.Color color) Add color to match objectmatchClosestColor
(edu.wpi.first.wpilibj.util.Color color) MatchColor uses euclidean distance to compare a given normalized RGB vector against stored valuesmatchColor
(edu.wpi.first.wpilibj.util.Color colorToMatch) MatchColor uses euclidean distance to compare a given normalized RGB vector against stored valuesvoid
setConfidenceThreshold
(double confidence) Set the confidence interval for determining color.
-
Constructor Details
-
ColorMatch
public ColorMatch()
-
-
Method Details
-
addColorMatch
Add color to match object- Parameters:
color
- color to add to matching
-
setConfidenceThreshold
Set the confidence interval for determining color. Defaults to 0.95- Parameters:
confidence
- A value between 0 and 1
-
matchColor
MatchColor uses euclidean distance to compare a given normalized RGB vector against stored values- Parameters:
colorToMatch
- color to compare against stored colors- Returns:
- Matched color if detected, returns null if no color detected confidence level
-
matchClosestColor
MatchColor uses euclidean distance to compare a given normalized RGB vector against stored values- Parameters:
color
- color to compare against stored colors- Returns:
- Closest color to match
-