Package trclib.vision

Class TrcOpenCvColorBlobPipeline.DetectedObject

java.lang.Object
trclib.vision.TrcOpenCvDetector.DetectedObject<org.opencv.core.MatOfPoint>
trclib.vision.TrcOpenCvColorBlobPipeline.DetectedObject
All Implemented Interfaces:
TrcVisionTargetInfo.ObjectInfo
Enclosing class:
TrcOpenCvColorBlobPipeline

public static class TrcOpenCvColorBlobPipeline.DetectedObject extends TrcOpenCvDetector.DetectedObject<org.opencv.core.MatOfPoint>
This class encapsulates info of the detected object. It extends TrcOpenCvDetector.DetectedObject that requires it to provide a method to return the detected object rect and area.
  • Field Details

    • rotatedRect

      public final org.opencv.core.RotatedRect rotatedRect
    • vertices

      public final org.opencv.core.Point[] vertices
    • pixelWidth

      public final double pixelWidth
    • pixelHeight

      public final double pixelHeight
    • rotatedAngle

      public final double rotatedAngle
  • Constructor Details

    • DetectedObject

      public DetectedObject(String label, org.opencv.core.MatOfPoint contour)
      Constructor: Creates an instance of the object.
      Parameters:
      label - specifies the object label.
      contour - specifies the contour of the detected object.
  • Method Details

    • getObjectRect

      public org.opencv.core.Rect getObjectRect()
      This method returns the rect of the detected object.
      Returns:
      rect of the detected object.
    • getObjectArea

      public double getObjectArea()
      This method returns the area of the detected object.
      Returns:
      area of the detected object.
    • getPixelWidth

      public Double getPixelWidth()
      This method returns the object's pixel width.
      Returns:
      object pixel width, null if not supported.
    • getPixelHeight

      public Double getPixelHeight()
      This method returns the object's pixel height.
      Returns:
      object pixel height, null if not supported.
    • getRotatedAngle

      public Double getRotatedAngle()
      This method returns the object's rotated rectangle angle.
      Returns:
      rotated rectangle angle.
    • getObjectPose

      public TrcPose2D getObjectPose()
      This method returns the pose of the detected object relative to the camera.
      Returns:
      pose of the detected object relative to camera.
    • getObjectWidth

      public Double getObjectWidth()
      This method returns the real world width of the detected object.
      Returns:
      real world width of the detected object.
    • getObjectDepth

      public Double getObjectDepth()
      This method returns the real world depth of the detected object.
      Returns:
      real world depth of the detected object.
    • getRotatedRectVertices

      public org.opencv.core.Point[] getRotatedRectVertices()
      This method returns the rotated rect vertices of the detected object.
      Returns:
      rotated rect vertices.