Skip to main content

RapidTag — fast realtime fiducial marker (ArUco/AprilTag) detection in Rust

Project description

RapidTag

⚠️ Work in progress — not production-ready. RapidTag is under active development and pre-1.0. APIs, behavior, and results may change without notice. Use it for research, evaluation, and prototyping, and validate it against your own data before relying on it for anything critical.

Fast, pure-Rust fiducial marker detection for realtime. RapidTag is a from-scratch Rust reimplementation of OpenCV's ArUco / AprilTag marker detector, exposed to Python via maturin / PyO3 — with no OpenCV runtime dependency. It reproduces OpenCV's detections down to the pixel while running substantially faster.

Why RapidTag

  • Faster than OpenCV~1.6× faster for realtime single-camera detection, and up to ~3.4× faster for multi-camera and offline batches (scales across cores).
  • 🎯 A true drop-in for accuracy — corners match OpenCV to 0.0000 px, so any downstream pose or tracking is identical (see below).
  • 🧵 Scales with your cores — a batch API processes many frames (a stereo pair, or a whole recording) across all cores with the GIL released.
  • 📦 No OpenCV needed at runtime — the detection pipeline and marker dictionaries are implemented in pure Rust on top of image / nalgebra.

Performance

Measured on real dual-camera data (1280×800 monochrome, AprilTag 36h11):

Workload Speed vs OpenCV
Realtime, single camera 1.57× faster
Multi-camera / offline batch (all cores) up to ~3.4× faster

Same detections, less time — the speedup comes from a leaner detection pipeline, not from skipping work.

Accuracy — verified as a drop-in replacement

Because RapidTag's corners are pixel-identical to OpenCV's, feeding them into the exact same pose pipeline (cv2.solvePnP) yields the same trajectory. Across a ~1,700-frame stereo recording of a moving AprilTag, the recovered position from RapidTag vs OpenCV corners is indistinguishable — a median difference of 0.00 mm on both cameras.

OpenCV vs RapidTag pose comparison

Install

pip install rapidtag

Prebuilt wheels are published for:

OS Architectures libc
Linux x86_64, aarch64 (arm64) glibc (manylinux) + musl (Alpine)
macOS x86_64 (Intel), arm64 (Apple Silicon)
Windows x64

Wheels are abi3 (one wheel works on CPython 3.9+). If no wheel matches, pip builds from the source distribution (needs a Rust toolchain).

Usage

import cv2            # only to load/generate images
import rapidtag

img = cv2.imread("scene.png")          # HxWx3 BGR, or HxW grayscale uint8

# --- realtime: one frame ---
corners, ids = rapidtag.detect_markers(img, "DICT_APRILTAG_36h11")
# corners: list of 4x2 [(x, y), ...] per marker (clockwise)
# ids:     list of marker ids, aligned with corners

# --- multi-camera / batch: process many frames across all cores ---
results = rapidtag.detect_markers_batch([cam0, cam1], "DICT_APRILTAG_36h11")
(c0, i0), (c1, i1) = results

# --- tunable parameters (same names/defaults as cv2.aruco.DetectorParameters) ---
p = rapidtag.DetectorParameters()
p.adaptive_thresh_constant = 7.0
p.detect_inverted_marker = True
corners, ids = rapidtag.detect_markers(img, "DICT_6X6_250", p)

print(rapidtag.predefined_dictionaries())   # list supported dictionary names

Supported dictionaries: all DICT_{4,5,6,7}X{4,5,6,7}_{50,100,250,1000}, DICT_ARUCO_ORIGINAL, DICT_ARUCO_MIP_36h12, and AprilTag DICT_APRILTAG_{16h5,25h9,36h10,36h11}.

Status

v1 — marker detection (detectMarkers, CORNER_REFINE_NONE).

Not yet implemented (future): corner sub-pixel refinement, pose estimation, grid boards, ChArUco.

Build from source

maturin develop --release        # dev install into the current virtualenv
maturin build --release          # or build a wheel

The committed build uses portable CPU baselines so one wheel works everywhere. For a max-performance build tuned to your own machine (not portable — don't redistribute it):

RUSTFLAGS="-C target-cpu=native" maturin build --release

For a wheel tuned to a specific ARM64 board, use ./scripts/build-board.sh (it picks the right CPU flags so the published portable wheels stay CPU-agnostic).

Tests

python tests/crosscheck.py     # cross-validate vs cv2.aruco on synthetic scenes
python tests/bench.py          # benchmark + parity on real camera data

The verification figures above are reproduced by the scripts in scripts/ (pnp_opencv_vs_rapidtag.py, pnp_sanity.py).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rapidtag-0.1.3.tar.gz (943.6 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

rapidtag-0.1.3-cp39-abi3-win_amd64.whl (437.1 kB view details)

Uploaded CPython 3.9+Windows x86-64

rapidtag-0.1.3-cp39-abi3-musllinux_1_2_x86_64.whl (779.6 kB view details)

Uploaded CPython 3.9+musllinux: musl 1.2+ x86-64

rapidtag-0.1.3-cp39-abi3-musllinux_1_2_aarch64.whl (744.2 kB view details)

Uploaded CPython 3.9+musllinux: musl 1.2+ ARM64

rapidtag-0.1.3-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (568.4 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ x86-64

rapidtag-0.1.3-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (567.8 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

rapidtag-0.1.3-cp39-abi3-macosx_11_0_arm64.whl (523.9 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

rapidtag-0.1.3-cp39-abi3-macosx_10_12_x86_64.whl (532.9 kB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

Details for the file rapidtag-0.1.3.tar.gz.

File metadata

  • Download URL: rapidtag-0.1.3.tar.gz
  • Upload date:
  • Size: 943.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rapidtag-0.1.3.tar.gz
Algorithm Hash digest
SHA256 705ee4e47b3ea61e07cd60a243ea1c61aeafea939f7a7656db5b0f5b510a5b5a
MD5 4332b4501616344a2b12b8246358c6b6
BLAKE2b-256 aabff81c6f35cf2f3a268867d6aa0011f882b1191722510fb98b449a04016dc4

See more details on using hashes here.

Provenance

The following attestation bundles were made for rapidtag-0.1.3.tar.gz:

Publisher: release.yml on SujithChristopher/rapidtag

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rapidtag-0.1.3-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: rapidtag-0.1.3-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 437.1 kB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rapidtag-0.1.3-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 b0b20aba91e40ccc30c618d22a454c9722c8c9e1ff4b28ec85aaf4a2719d3e78
MD5 bd8310ddfa74c7f0a2ca632df71c83f6
BLAKE2b-256 fec1e8673dd73690ce6913468cde1a86f51d6efb11e7044d60d9bc8e5f9f51df

See more details on using hashes here.

Provenance

The following attestation bundles were made for rapidtag-0.1.3-cp39-abi3-win_amd64.whl:

Publisher: release.yml on SujithChristopher/rapidtag

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rapidtag-0.1.3-cp39-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for rapidtag-0.1.3-cp39-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 118f9492ee705310c61ac9455dd3583f97cc8c19b40e672fb749df7af3f81fd2
MD5 917195297f7fcc9a48be3b40746d9931
BLAKE2b-256 636b32036c0d417ac94772119b6f5ff49409e7e81a2a25768c93f699e29fbb36

See more details on using hashes here.

Provenance

The following attestation bundles were made for rapidtag-0.1.3-cp39-abi3-musllinux_1_2_x86_64.whl:

Publisher: release.yml on SujithChristopher/rapidtag

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rapidtag-0.1.3-cp39-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for rapidtag-0.1.3-cp39-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 c13ab1abb3c7db4cce394df0f9ae1a5b24a64fce1435560f124cdee80d78184d
MD5 b255664bc31f969975b1d443d87132e2
BLAKE2b-256 5c5ae7d5e4a0ae21c001f85d9a2c600166541c3d891cc3d19323630d71a07895

See more details on using hashes here.

Provenance

The following attestation bundles were made for rapidtag-0.1.3-cp39-abi3-musllinux_1_2_aarch64.whl:

Publisher: release.yml on SujithChristopher/rapidtag

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rapidtag-0.1.3-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for rapidtag-0.1.3-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 259a4391d06b95d22a9ce3cad86aafa2115e26456f1168bb90b639ae9789e17c
MD5 078d11167983e5b373444e2f7a45d2f7
BLAKE2b-256 2bfa50aa0801f42b3aeb314ccce6409588b9a40c23399dba85bf7e46f3a4f5ab

See more details on using hashes here.

Provenance

The following attestation bundles were made for rapidtag-0.1.3-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on SujithChristopher/rapidtag

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rapidtag-0.1.3-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for rapidtag-0.1.3-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 e06d4a163bbb3a31be8a2403e5d7cc1f448f489325a00663ade07227b33310c6
MD5 acacf6cd65762d97205104ba319afd21
BLAKE2b-256 c4638a6b3d0edcd435ff2c3274bd1708a96140c5bf1c032feb48b2265a441f6c

See more details on using hashes here.

Provenance

The following attestation bundles were made for rapidtag-0.1.3-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on SujithChristopher/rapidtag

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rapidtag-0.1.3-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for rapidtag-0.1.3-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 42edc04ff411fe586e46953caf0356336d1c195c81befaeff3ab7093ff093835
MD5 4e15a85e5c7f83ec15e1a9727f83fe9d
BLAKE2b-256 c77587e83466c8694b4461ff865e73a3eda9f57917eacc54182ab04ec72a7747

See more details on using hashes here.

Provenance

The following attestation bundles were made for rapidtag-0.1.3-cp39-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on SujithChristopher/rapidtag

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rapidtag-0.1.3-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for rapidtag-0.1.3-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 eaf5c5c9decf77216ba6a4fbccf294c2fa687dfa08859007777be9855cc2ef74
MD5 0c51b44c235107e1e07a5b5233ac54b6
BLAKE2b-256 79b21bf2c27017dadac99f232ee4beb69a0635d5c40160020417f2a5f4d777a1

See more details on using hashes here.

Provenance

The following attestation bundles were made for rapidtag-0.1.3-cp39-abi3-macosx_10_12_x86_64.whl:

Publisher: release.yml on SujithChristopher/rapidtag

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page