Package edu.wpi.first.apriltag
Class AprilTagDetector
java.lang.Object
edu.wpi.first.apriltag.AprilTagDetector
- All Implemented Interfaces:
AutoCloseable
An AprilTag detector engine. This is expensive to set up and tear down, so most use cases should
only create one of these, add a family to it, set up any other configuration, and repeatedly call
Detect().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Detector configuration.static class
Quad threshold parameters. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a family of tags to be detected.void
Adds a family of tags to be detected.void
Unregister all families.void
close()
Detect tags from an 8-bit image.Gets detector configuration.Gets quad threshold parameters.void
removeFamily
(String fam) Removes a family of tags from the detector.void
setConfig
(AprilTagDetector.Config config) Sets detector configuration.void
Sets quad threshold parameters.
-
Constructor Details
-
AprilTagDetector
public AprilTagDetector()Constructs an AprilTagDetector.
-
-
Method Details
-
close
- Specified by:
close
in interfaceAutoCloseable
-
setConfig
Sets detector configuration.- Parameters:
config
- Configuration
-
getConfig
Gets detector configuration.- Returns:
- Configuration
-
setQuadThresholdParameters
Sets quad threshold parameters.- Parameters:
params
- Parameters
-
getQuadThresholdParameters
Gets quad threshold parameters.- Returns:
- Parameters
-
addFamily
Adds a family of tags to be detected.- Parameters:
fam
- Family name, e.g. "tag16h5"- Throws:
IllegalArgumentException
- if family name not recognized
-
addFamily
Adds a family of tags to be detected.- Parameters:
fam
- Family name, e.g. "tag16h5"bitsCorrected
- Maximum number of bits to correct- Throws:
IllegalArgumentException
- if family name not recognized
-
removeFamily
Removes a family of tags from the detector.- Parameters:
fam
- Family name, e.g. "tag16h5"
-
clearFamilies
Unregister all families. -
detect
Detect tags from an 8-bit image.The image must be grayscale.
- Parameters:
img
- 8-bit OpenCV Mat image- Returns:
- Results (array of AprilTagDetection)
-