Package ftclib.vision
Class FtcVisionAprilTag.DetectedObject
java.lang.Object
ftclib.vision.FtcVisionAprilTag.DetectedObject
- All Implemented Interfaces:
TrcVisionTargetInfo.ObjectInfo
- Enclosing class:
- FtcVisionAprilTag
public static class FtcVisionAprilTag.DetectedObject
extends Object
implements TrcVisionTargetInfo.ObjectInfo
This class encapsulates info of the detected object. It extends TrcOpenCvDetector.DetectedObject that requires
it to provide methods to return the detected object rect and area.
-
Field Summary
FieldsModifier and TypeFieldDescriptionorg.firstinspires.ftc.vision.apriltag.AprilTagDetection
double
double
double
-
Constructor Summary
ConstructorsConstructorDescriptionDetectedObject
(org.firstinspires.ftc.vision.apriltag.AprilTagDetection aprilTagDetection) Constructor: Creates an instance of the object. -
Method Summary
Modifier and TypeMethodDescriptionstatic org.opencv.core.Rect
getDetectedRect
(org.firstinspires.ftc.vision.apriltag.AprilTagDetection at) This method calculates the rectangle of the detected AprilTag.double
This method returns the area of the detected object.This method returns the real world depth of the detected object.This method returns the pose of the detected object relative to the camera.org.opencv.core.Rect
This method returns the rect of the detected object.This method returns the real world width of the detected object.This method returns the object's pixel height.This method returns the object's pixel width.This method returns the object's rotated rectangle angle.org.opencv.core.Point[]
This method returns the rotated rect vertices of the detected object.toString()
This method returns the string form of the target info.
-
Field Details
-
aprilTagDetection
public org.firstinspires.ftc.vision.apriltag.AprilTagDetection aprilTagDetection -
pixelWidth
public double pixelWidth -
pixelHeight
public double pixelHeight -
rotatedAngle
public double rotatedAngle
-
-
Constructor Details
-
DetectedObject
public DetectedObject(org.firstinspires.ftc.vision.apriltag.AprilTagDetection aprilTagDetection) Constructor: Creates an instance of the object.- Parameters:
aprilTagDetection
- specifies the detected april tag object.
-
-
Method Details
-
getDetectedRect
public static org.opencv.core.Rect getDetectedRect(org.firstinspires.ftc.vision.apriltag.AprilTagDetection at) This method calculates the rectangle of the detected AprilTag.- Parameters:
at
- specifies the AprilTag info.- Returns:
- AprilTag rectangle.
-
getObjectRect
public org.opencv.core.Rect getObjectRect()This method returns the rect of the detected object.- Specified by:
getObjectRect
in interfaceTrcVisionTargetInfo.ObjectInfo
- Returns:
- rect of the detected object.
-
getObjectArea
public double getObjectArea()This method returns the area of the detected object.- Specified by:
getObjectArea
in interfaceTrcVisionTargetInfo.ObjectInfo
- Returns:
- area of the detected object.
-
getPixelWidth
This method returns the object's pixel width.- Specified by:
getPixelWidth
in interfaceTrcVisionTargetInfo.ObjectInfo
- Returns:
- object pixel width, null if not supported.
-
getPixelHeight
This method returns the object's pixel height.- Specified by:
getPixelHeight
in interfaceTrcVisionTargetInfo.ObjectInfo
- Returns:
- object pixel height, null if not supported.
-
getRotatedAngle
This method returns the object's rotated rectangle angle.- Specified by:
getRotatedAngle
in interfaceTrcVisionTargetInfo.ObjectInfo
- Returns:
- rotated rectangle angle.
-
getObjectPose
This method returns the pose of the detected object relative to the camera.- Specified by:
getObjectPose
in interfaceTrcVisionTargetInfo.ObjectInfo
- Returns:
- pose of the detected object relative to camera.
-
getObjectWidth
This method returns the real world width of the detected object.- Specified by:
getObjectWidth
in interfaceTrcVisionTargetInfo.ObjectInfo
- Returns:
- real world width of the detected object.
-
getObjectDepth
This method returns the real world depth of the detected object.- Specified by:
getObjectDepth
in interfaceTrcVisionTargetInfo.ObjectInfo
- 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.- Specified by:
getRotatedRectVertices
in interfaceTrcVisionTargetInfo.ObjectInfo
- Returns:
- rotated rect vertices.
-
toString
This method returns the string form of the target info.
-