Package com.revrobotics
Class ColorMatch
- java.lang.Object
-
- com.revrobotics.ColorMatch
-
public class ColorMatch extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description ColorMatch()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addColorMatch(edu.wpi.first.wpilibj.util.Color color)
Add color to match objectColorMatchResult
matchClosestColor(edu.wpi.first.wpilibj.util.Color color)
MatchColor uses euclidean distance to compare a given normalized RGB vector against stored valuesColorMatchResult
matchColor(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.
-
-
-
Method Detail
-
addColorMatch
public void addColorMatch(edu.wpi.first.wpilibj.util.Color color)
Add color to match object- Parameters:
color
- color to add to matching
-
setConfidenceThreshold
public void setConfidenceThreshold(double confidence)
Set the confidence interval for determining color. Defaults to 0.95- Parameters:
confidence
- A value between 0 and 1
-
matchColor
public ColorMatchResult matchColor(edu.wpi.first.wpilibj.util.Color colorToMatch)
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
public ColorMatchResult matchClosestColor(edu.wpi.first.wpilibj.util.Color color)
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
-
-