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.AprilTagDetectiondoubledoubledouble -
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.RectgetDetectedRect(org.firstinspires.ftc.vision.apriltag.AprilTagDetection at) This method calculates the rectangle of the detected AprilTag.doubleThis 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.RectThis 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:
getObjectRectin interfaceTrcVisionTargetInfo.ObjectInfo- Returns:
- rect of the detected object.
-
getObjectArea
public double getObjectArea()This method returns the area of the detected object.- Specified by:
getObjectAreain interfaceTrcVisionTargetInfo.ObjectInfo- Returns:
- area of the detected object.
-
getPixelWidth
This method returns the object's pixel width.- Specified by:
getPixelWidthin interfaceTrcVisionTargetInfo.ObjectInfo- Returns:
- object pixel width, null if not supported.
-
getPixelHeight
This method returns the object's pixel height.- Specified by:
getPixelHeightin interfaceTrcVisionTargetInfo.ObjectInfo- Returns:
- object pixel height, null if not supported.
-
getRotatedAngle
This method returns the object's rotated rectangle angle.- Specified by:
getRotatedAnglein interfaceTrcVisionTargetInfo.ObjectInfo- Returns:
- rotated rectangle angle.
-
getObjectPose
This method returns the pose of the detected object relative to the camera.- Specified by:
getObjectPosein 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:
getObjectWidthin interfaceTrcVisionTargetInfo.ObjectInfo- Returns:
- real world width of the detected object.
-
getObjectDepth
This method returns the real world depth of the detected object.- Specified by:
getObjectDepthin 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:
getRotatedRectVerticesin interfaceTrcVisionTargetInfo.ObjectInfo- Returns:
- rotated rect vertices.
-
toString
This method returns the string form of the target info.
-