ON THIS PAGE

  • AprilTag
  • How to place it
  • Inputs and Outputs
  • Limitations
  • Examples of functionality
  • Reference

AprilTag

AprilTag node takes ImgFrame as input and outputs detected AprilTag markers (AprilTags message). It's based on the AprilRobotics/apriltag repository, and runs optimized detection algorithms on the CPU (on RVC4 octacore itself, or on the host when using RVC2-based devices).AprilTag marker is a visual fiducial marker, so it's similar to ArUco, ARTag and ARToolKit markers.

How to place it

Python
C++

Python

Python
1pipeline = dai.Pipeline()
2hostCamera = pipeline.create(dai.node.Camera).build()
3aprilTagNode = pipeline.create(dai.node.AprilTag)
4# Link 1920x1080 output to AprilTag input
5hostCamera.requestOutput((1920, 1080)).link(aprilTagNode.inputImage)
6# Create output queue for passthrough frames
7passthroughOutputQueue = aprilTagNode.passthroughInputImage.createOutputQueue()
8# Create output queue for detected AprilTags
9outQueue = aprilTagNode.out.createOutputQueue()

Inputs and Outputs

Limitations

RVC2
RVC4

RVC2

On the RVC2 devices, the AprilTag node runs on the host computer, so the performance will be limited by the host CPU.

Examples of functionality

Reference

class

dai::node::AprilTag

#include AprilTag.hpp
variable
AprilTagConfig initialConfig
Initial config to use when calculating spatial location data.
variable
Input inputConfig
Input AprilTagConfig message with ability to modify parameters in runtime. Default queue is non-blocking with size 4.
variable
Input inputImage
Input message with depth data used to retrieve spatial information about detected object. Default queue is non-blocking with size 4.
variable
Output out
Outputs AprilTags message that carries spatial location results.
variable
Output outConfig
Outputs AprilTagConfig message that contains current configuration.
variable
Output passthroughInputImage
Passthrough message on which the calculation was performed. Suitable for when input queue is set to non-blocking behavior.
function
AprilTag(const std::shared_ptr< PipelineImpl > & par, int64_t nodeId)
function
AprilTag(const std::shared_ptr< PipelineImpl > & par, int64_t nodeId, std::unique_ptr< Properties > props)
function
void setWaitForConfigInput(bool wait)
Specify whether or not wait until configuration message arrives to inputConfig Input.
Parameters
  • wait: True to wait for configuration message, false otherwise.

Need assistance?

Head over to Discussion Forum for technical support or any other questions you might have.