Class CrosshairsPipeline

  • All Implemented Interfaces:
    edu.wpi.first.vision.VisionPipeline, VisionGUIPipeline

    public class CrosshairsPipeline
    extends java.lang.Object
    implements VisionGUIPipeline
    Pipeline which draws crosshairs in a given position.
    • Constructor Summary

      Constructors 
      Constructor Description
      CrosshairsPipeline​(java.util.function.IntSupplier x, java.util.function.IntSupplier y, int b, int g, int r)
      Construct a new crosshairs pipeline.
    • 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CrosshairsPipeline

        public CrosshairsPipeline​(java.util.function.IntSupplier x,
                                  java.util.function.IntSupplier y,
                                  int b,
                                  int g,
                                  int r)
        Construct a new crosshairs pipeline. On each frame, the position of the crosshairs is read from the given suppliers. Usually, this is the method IntPreference.get().
        Parameters:
        x - Supplier for x coordinate.
        y - Supplier for y coordinate.
        b - Blue component of color.
        g - Green component of color.
        r - 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 interface VisionGUIPipeline
        Specified by:
        process in interface edu.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 interface VisionGUIPipeline
        Parameters:
        mat - image to write the indicators on