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 classDetector configuration.static classQuad threshold parameters. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a family of tags to be detected.voidAdds a family of tags to be detected.voidUnregister all families.voidclose()Detect tags from an 8-bit image.Gets detector configuration.Gets quad threshold parameters.voidremoveFamily(String fam) Removes a family of tags from the detector.voidsetConfig(AprilTagDetector.Config config) Sets detector configuration.voidSets quad threshold parameters.
-
Constructor Details
-
AprilTagDetector
public AprilTagDetector()Constructs an AprilTagDetector.
-
-
Method Details
-
close
- Specified by:
closein 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)
-