Package org.photonvision.vision.target
Enum Class TargetModel
- All Implemented Interfaces:
Serializable
,Comparable<TargetModel>
,Constable
,Releasable
A model representing the vertices of targets with known shapes. The vertices are in the EDN
coordinate system. When creating a TargetModel, the vertices must be supplied in a certain order
to ensure correct correspondence with corners detected in 2D for use with SolvePNP. For planar
targets, we expect the target's Z-axis to point towards the camera.
SolvePNPPipe
expects 3d object points to correspond to the CornerDetectionPipe
implementation. The 2d corner detection finds the 4 extreme corners (bottom-left, bottom-right,
top-right, top-left). To match our expectations, this means the model vertices would look like:
- (+x, +y, 0)
- (-x, +y, 0)
- (-x, -y, 0)
- (+x, -y, 0)
AprilTag models are currently only used for drawing on the output stream.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescription -
Method Summary
Modifier and TypeMethodDescriptiondouble
List<org.opencv.core.Point3>
org.opencv.core.MatOfPoint3f
org.opencv.core.MatOfPoint3f
org.opencv.core.MatOfPoint3f
void
release()
void
setBoxHeight
(double boxHeight) void
setRealWorldCoordinatesArray
(List<org.opencv.core.Point3> realWorldCoordinatesArray) static TargetModel
Returns the enum constant of this class with the specified name.static TargetModel[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
k2016HighGoal
-
k2019DualTarget
-
k2020HighGoalOuter
-
kCircularPowerCell7in
-
k2022CircularCargoBall
-
kAprilTag6in_16h5
-
kAprilTag6p5in_36h11
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
getRealWorldCoordinatesArray
-
getBoxHeight
public double getBoxHeight() -
setRealWorldCoordinatesArray
-
setBoxHeight
public void setBoxHeight(double boxHeight) -
getRealWorldTargetCoordinates
public org.opencv.core.MatOfPoint3f getRealWorldTargetCoordinates() -
getVisualizationBoxBottom
public org.opencv.core.MatOfPoint3f getVisualizationBoxBottom() -
getVisualizationBoxTop
public org.opencv.core.MatOfPoint3f getVisualizationBoxTop() -
release
public void release()- Specified by:
release
in interfaceReleasable
-