Package trclib.vision

Interface TrcOpenCvPipeline<O>

Type Parameters:
O - specifies the detected object type the pipeline will produce.
All Known Implementing Classes:
FtcEocvColorBlobProcessor, FtcRawEocvColorBlobPipeline, TrcOpenCvColorBlobPipeline

public interface TrcOpenCvPipeline<O>
This interface implements the standard methods for an OpenCV pipeline.
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    annotateFrame(org.opencv.core.Mat image, String label, TrcOpenCvDetector.DetectedObject<?>[] detectedObjects, org.opencv.core.Scalar rectColor, int thickness, org.opencv.core.Scalar textColor, double fontScale)
    This method is called to overlay rectangles of the detected objects on an image.
    O[]
    This method returns the array of detected objects.
    org.opencv.core.Mat
    This method returns an intermediate processed frame.
    org.opencv.core.Mat
    This method returns the selected intermediate output Mat.
    boolean
    This method checks if image annotation is enabled.
    O[]
    process(org.opencv.core.Mat input)
    This method is called to process the input image through the pipeline.
    void
    This method is called to reset the state of the pipeline if any.
    void
    setAnnotateEnabled(boolean enabled)
    This method enables/disables image annotation of the detected object.
    void
    This method cycles to the next intermediate mat of the pipeline as the video output mat.
    void
    setVideoOutput(int intermediateStep)
    This method sets the intermediate mat of the pipeline as the video output mat.
  • Method Details

    • reset

      void reset()
      This method is called to reset the state of the pipeline if any.
    • process

      O[] process(org.opencv.core.Mat input)
      This method is called to process the input image through the pipeline.
      Parameters:
      input - specifies the input image to be processed.
      Returns:
      array of detected objects.
    • getDetectedObjects

      O[] getDetectedObjects()
      This method returns the array of detected objects.
      Returns:
      array of detected objects.
    • setAnnotateEnabled

      void setAnnotateEnabled(boolean enabled)
      This method enables/disables image annotation of the detected object.
      Parameters:
      enabled - specifies true to enable annotation, false to disable.
    • isAnnotateEnabled

      boolean isAnnotateEnabled()
      This method checks if image annotation is enabled.
      Returns:
      true if annotation is enabled, false otherwise.
    • setVideoOutput

      void setVideoOutput(int intermediateStep)
      This method sets the intermediate mat of the pipeline as the video output mat.
      Parameters:
      intermediateStep - specifies the intermediate mat used as video output (0 is the original input frame).
    • setNextVideoOutput

      void setNextVideoOutput()
      This method cycles to the next intermediate mat of the pipeline as the video output mat.
    • getIntermediateOutput

      org.opencv.core.Mat getIntermediateOutput(int step)
      This method returns an intermediate processed frame. Typically, a pipeline processes a frame in a number of steps. It may be useful to see an intermediate frame for a step in the pipeline for tuning or debugging purposes.
      Parameters:
      step - specifies the intermediate step (0 is the original input frame).
      Returns:
      processed frame of the specified step.
    • getSelectedOutput

      org.opencv.core.Mat getSelectedOutput()
      This method returns the selected intermediate output Mat.
      Returns:
      selected output mat.
    • annotateFrame

      default void annotateFrame(org.opencv.core.Mat image, String label, TrcOpenCvDetector.DetectedObject<?>[] detectedObjects, org.opencv.core.Scalar rectColor, int thickness, org.opencv.core.Scalar textColor, double fontScale)
      This method is called to overlay rectangles of the detected objects on an image.
      Parameters:
      image - specifies the frame to be rendered to the video output.
      label - specifies the text label to be annotated on the detected object, can be null if not provided.
      detectedObjects - specifies the detected objects.
      rectColor - specifies the color of the annotated rectangle.
      thickness - specifies the thickness of the annotated rectangle.
      textColor - specifies the color of the annotated text.
      fontScale - specifies the scale factor that is multiplied by the font-specific base size.