Package org.hyperonline.hyperlib.vision
Class HeightIndicatorPipeline
- java.lang.Object
-
- org.hyperonline.hyperlib.vision.HeightIndicatorPipeline
-
- All Implemented Interfaces:
edu.wpi.first.vision.VisionPipeline
,VisionGUIPipeline
public class HeightIndicatorPipeline extends java.lang.Object implements VisionGUIPipeline
Pipeline that draws an indicator around a target, showing what the goal height should be. This is currently done by drawing two bars above and below the center of the target.
-
-
Constructor Summary
Constructors Constructor Description HeightIndicatorPipeline(java.util.function.Supplier<? extends VisionResult> targetLocation, java.util.function.IntSupplier height, int b, int g, int r)
Construct a new pipeline with the specified parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
process(org.opencv.core.Mat mat)
Read an input image.void
writeOutput(org.opencv.core.Mat mat)
Draw indicators onto the output image.
-
-
-
Constructor Detail
-
HeightIndicatorPipeline
public HeightIndicatorPipeline(java.util.function.Supplier<? extends VisionResult> targetLocation, java.util.function.IntSupplier height, int b, int g, int r)
Construct a new pipeline with the specified parameters.- Parameters:
targetLocation
- Supplier of the target location, so this pipeline knows where to draw the indicator. Usually this is the getLastResult method of some pipeline which runs before this one.height
- The goal height of the target. Usually this is a constant or the get method of a preference.b
- Blue component of colorg
- Green component of colorr
- Red component of color
-
-
Method Detail
-
process
public void process(org.opencv.core.Mat mat)
Read an input image. This method should extract any useful information from the input mat, and update any shared variables that the robot thread may access. It should NOT modify the image. Instead, save any information you want to print, and use it in the next call to writeOutput.- Specified by:
process
in interfaceVisionGUIPipeline
- Specified by:
process
in interfaceedu.wpi.first.vision.VisionPipeline
- Parameters:
mat
- image to process
-
writeOutput
public void writeOutput(org.opencv.core.Mat mat)
Draw indicators onto the output image.- Specified by:
writeOutput
in interfaceVisionGUIPipeline
- Parameters:
mat
- image to write the indicators on
-
-