MovidMovid
ENGINEERING GUIDE · FIDUCIALS6 min read

ArUco vs AprilTag 3: Selection, Geometry & Pose Sizing

Both ArUco and AprilTag deliver sub-pixel 2D quad localization for robotics, AR, and metrology — yet picking the wrong family or passing the wrong physical width to solvePnP silently introduces 20%–80% depth error. Here is the exact engineering breakdown.

1. Quick Decision Rules

If you need an immediate engineering default without reading every benchmark:

Default OpenCV / ChArUco workflows:

Pick DICT_4X4_50 (small IDs, long range) or DICT_6X6_250 (strong false-positive rejection). Use only the smallest dictionary size you need.

Default ROS 2 / Robotics 6-DoF pose:

Pick AprilTag tag36h11 (587 IDs, Hamming distance 11) — universally supported by apriltag_ros, OpenCV, and pupil-apriltags.

Compact high-ID or nested targets:

Pick tagStandard41h12 (2,115 IDs, 5-cell pose core) or tagCustom48h12 (42,211 IDs with a 2×2 center cutout for recursive/nested tags).

Visual-Inertial (VIO) multi-camera calibration:

Use ETH Kalibr AprilGrid (tag36h11 with 2-bit black border + auxiliary corner blocks), not bare AprilTags.

2. Architecture & Metric Comparison

Key structural differences verified against OpenCV 4.13.0 and AprilRobotics/apriltag C source:

DimensionOpenCV ArUcoAprilTag 3 ClassicAprilTag 3 Reversed Border
Representative FamiliesDICT_4X4_50 .. DICT_7X7_1000tag16h5, tag25h9, tag36h11tagStandard41h12, tagCircle21h7, tagCustom48h12
Border PolarityBlack border inside white quiet zoneBlack border inside white quiet zoneWhite inner ring + outer data ring (black core border)
Corner Order (0–3)CW from Top-Left [TL, TR, BR, BL]CCW from Bottom-Left [BL, BR, TR, TL]CCW from Bottom-Left [BL, BR, TR, TL]
Pose Size ReferenceOuter black border edge (mm)width_at_border (8 cells for 36h11)width_at_border (5 cells for 41h12 — NOT outer width!)
False-Positive GuardShrink ID count (50 vs 1000)Prefer tag36h11 over tag16h5High Hamming (h=12) + white border rejects clutter

3. The width_at_border vs total_width Pose Trap

The #1 cause of scaled 3D translation errors in AprilTag deployments is measuring the printed outer artwork width instead of the detector’s homography border width (width_at_border).

Critical Scaling Formula for Pose Estimation

AprilTag’s homography and ROS 2 apriltag_ros size parameter measure width_at_border (the black-to-white transition quad), NOT total_width. For tag36h11, full artwork with 1-cell white border is 10/8 = 1.25× wider; for reversed-border tagStandard41h12, total_width is 9/5 = 1.80× wider! Entering total_width into apriltag_ros scales Z distance by 1.80×.

ArUco 6×6 (borderBits=1): 8×8 black outer border
tag36h11: border = 8 cells, total = 10 cells (1.25×)
tagStandard41h12: border = 5 cells, total = 9 cells (1.80×)

4. Complete AprilTag 3 Family Reference

All 6 official AprilRobotics families supported natively by Movid’s generator and 45 KB WASM scanner:

FamilyIDsHamming (h)total_width / width_at_border
tag16h5305 (high FP risk)8 / 6 = 1.333×
tag25h93599 / 7 = 1.286×
tag36h1158711 (robotics default)10 / 8 = 1.250×
tagStandard41h122,11512 (reversed border)9 / 5 = 1.800×
tagCircle21h7387 (circular data)9 / 5 = 1.800×
tagCustom48h1242,21112 (2×2 center cutout)10 / 6 = 1.667×

5. Verified OpenCV 4.13 Detection Snippets

Both snippets below are automatically executed in Movid’s CI pipeline against rasterized vector PDF outputs:

OpenCV 4.13 — ArUco Detector
import cv2

# OpenCV >= 4.7 API (tested on OpenCV 4.13.0)
img = cv2.imread("captured_aruco.png", cv2.IMREAD_GRAYSCALE)
dictionary = cv2.aruco.getPredefinedDictionary(cv2.aruco.DICT_6X6_250)
params = cv2.aruco.DetectorParameters()
params.markerBorderBits = 1  # Set to 2 only if printed with borderBits=2

detector = cv2.aruco.ArucoDetector(dictionary, params)
corners, ids, _ = detector.detectMarkers(img)
print("Detected ArUco IDs:", [] if ids is None else ids.flatten().tolist())
OpenCV 4.13 — Built-in AprilTag 36h11 Detector
import cv2

# OpenCV 4.x includes built-in AprilTag 36h11 detection via cv2.aruco
img = cv2.imread("captured_apriltag.png", cv2.IMREAD_GRAYSCALE)
dictionary = cv2.aruco.getPredefinedDictionary(cv2.aruco.DICT_APRILTAG_36h11)
detector = cv2.aruco.ArucoDetector(dictionary)
corners, ids, _ = detector.detectMarkers(img)
print("Detected AprilTag 36h11 IDs:", [] if ids is None else ids.flatten().tolist())

6. Four Common Field Pitfalls

1

16-bit False Positives in Cluttered Scenes

DICT_4X4_1000 and tag16h5 have small Hamming margins. Always choose the smallest dictionary capacity (e.g. DICT_4X4_50) or upgrade to tag36h11 / DICT_6X6_250.

2

Printer “Fit to Page” Silent Scaling

PDF viewers often shrink A4 prints to ~96%, introducing a hidden 4% translation error. Always print at 100% Actual Size and verify Movid’s X and Y check rulers with a caliper.

3

Missing White Quiet Zone

Trimming paper flush against the black border destroys edge gradient contrast. Leave at least 1–2 cell widths of uninterrupted matte white margin around standard tags.

4

Mixing Up ArUco CW vs AprilTag CCW Corners

OpenCV ArUco orders corners clockwise from top-left; AprilTag orders counter-clockwise from bottom-left. Never reuse an ArUco object-point array verbatim for AprilTag solvePnP.

Launch Verified Tools with Guide Presets