AprilTags are fiducial markers designed for visual detection and localization. VPI supports detection and pose estimation of a number of common tag families, and may be used as a drop-in replacement for the reference detection algorithm.
For more information, refer to the landing page for AprilTags at April Robotics.
Input | Detection output |
---|---|
Implementation of the detector is divided into the following stages:
Stage | Description | Backends |
---|---|---|
Decimation | Input is decimated by a factor of 2 | PVA/CPU |
Adaptive thresholding | Decide whether pixels are black or white in the decimated image | PVA/CPU |
Connected component labeling | Assign unique IDs to contiguous regions of black/white pixels | PVA/CPU |
Gradient cluster generation | Cluster all the coordinates which lie on the edge between a given black/white region pair | PVA/CPU |
Quad fitting | Attempt to fit quadrilaterals to each gradient cluster | CPU |
Decoding | Attempt to decode each quadrilateral as an AprilTag | CPU |
When choosing VPI_BACKEND_PVA, VPI will use PVA for the stages which support this backend and fall back to CPU for the remainder. The VPIStream and input/output buffers should be created with support for both PVA and CPU.
In general, there are eight mathematical solutions to 3D pose estimation from homography decomposition [1]. Of these eight, only two of these are valid subject to the constraints that (1) the camera is in front of the tag and (2) the camera is facing the tag.
The pose estimator attempts to estimate both of these pose candidates via SVD followed by a fixed number of iterations which minimize corner reprojection error. If both pose candidates are valid, the estimator returns the pose which results in the least corner reprojection error.
For list of limitations, constraints and backends that implements the algorithm, consult reference documentation of the following functions:
Function | Description |
---|---|
vpiInitAprilTagDecodeParams | Initializes VPIAprilTagDecodeParams with default values. |
vpiCreateAprilTagDetector | Creates a AprilTag detector payload. |
vpiSubmitAprilTagDetector | Submits a AprilTag detector operation to the stream. |
vpiSubmitAprilTagPoseEstimation | Submits a AprilTag pose estimation operation to the stream. |
For information on how to use the performance tables below, see Algorithm Performance Tables.
Before comparing measurements, consult Comparing Algorithm Elapsed Times.
For further information on how performance was benchmarked, see Performance Benchmark.