# AprilTags - which packages to use and how to generate / where to buy

**URL:** <https://accelerated-discovery.org/t/apriltags-which-packages-to-use-and-how-to-generate-where-to-buy/170>\
**Category:** Tools\
**Tags:** computer-vision\
**Created:** [May 15, 2024, 10:41am UTC](https://accelerated-discovery.org/t/apriltags-which-packages-to-use-and-how-to-generate-where-to-buy/170 "2024-05-15T10:41:04Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![sgbaird](https://yyz1.discourse-cdn.com/flex003/user_avatar/accelerated-discovery.org/sgbaird/32/341_2.png) [@sgbaird](https://accelerated-discovery.org/u/sgbaird)\
**Post date:** [May 15, 2024, 10:41am UTC](https://accelerated-discovery.org/t/apriltags-which-packages-to-use-and-how-to-generate-where-to-buy/170/1 "2024-05-15T10:41:04Z")

</div>

For context, AprilTags are a fiducial system that can be used both for IDs (similar to a QR code) and determining relative positions (i.e., they were specifically designed to maintain accuracy with this task).

Ideal specifications:

- something close to a one-click order
- adhesive backing, which is removable (OK if it takes a bit of effort)
- three sizes (i.e., “small, medium, large”) (can also base it loosely off of Hiwonder’s defaults)
- rigid
- chemical compatibility becomes a consideration. I think I had looked into this a fair bit, but I’m having trouble finding where I put those notes. Maybe better if this is done through a lamination rather than trying to get it printed directly on

In terms of [choosing a tag family](https://github.com/AprilRobotics/apriltag#choosing-a-tag-family):

> For the vast majority of applications, the tagStandard41h12 family will be the correct choice. You can find the images for the tags in the [apriltag-imgs repo](https://github.com/AprilRobotics/apriltag-imgs). Scale up the images in your favorite editor and print them out.
> 
> Some heuristics for when to choose other tag families:
> 
> 1. If you need more tags, use tagStandard52h13
> 2. If you need to maximize the use of space on a small circular object, use tagCircle49h12 (or tagCircle21h7).
> 3. If you want to make a recursive tag use tagCustom48h12.
> 4. If you want compatibility with the ArUcO detector use tag36h11
> 
> If none of these fit your needs, generate your own custom tag family [here](https://github.com/AprilRobotics/apriltag-generation).

It seems [apriltag-imgs/tagStandard41h12 at master · AprilRobotics/apriltag-imgs · GitHub](https://github.com/AprilRobotics/apriltag-imgs/tree/master/tagStandard41h12) has ~1115 images (2 at the start were other files). However, it wouldn’t be so bad to print other tag sets in that repo. For example, [apriltag-imgs/tagCircle49h12 at master · AprilRobotics/apriltag-imgs · GitHub](https://github.com/AprilRobotics/apriltag-imgs/tree/master/tagCircle49h12) and [apriltag-imgs/tagCustom48h12 at master · AprilRobotics/apriltag-imgs · GitHub](https://github.com/AprilRobotics/apriltag-imgs/tree/master/tagCustom48h12) (note: these are on the order of ~50000 files, but I could only print the first 1000 for example).

In terms of scaling to different sizes, the [image repository](https://github.com/AprilRobotics/apriltag-imgs) also says:

> Alternately, you can use the supplied native Python 3 script tag\_to\_svg.py to create a SVG (Scalable Vector Graphics) Version of a tag. For example:
> 
> ```bash
> python3 tag_to_svg.py tagStandard52h13/tag52_13_00007.png tag52_13_00007.svg --size=20mm
> 
> ```

Some vendors based on [Google Search](https://www.google.com/search?q=buy+apriltags:)

- [April Tags - VR & AR Markers - Robotics Fiducial System](https://skyhighbullseye.com/collections/apriltag-markers)
  - This has a choice between sticker and magnetic backing, e.g., [16-bit AprilTags (3"x3") | Magnet for Auto-Detection | 30 Pack](https://skyhighbullseye.com/products/16-bit-april-tags-3x3-magnet-auto-detection-30-pack) (3"x3")

- [AprilTag Targets | High-Accuracy Calibration Boards](https://www.foamcoreprint.com/apriltag-targets)

Likewise, in terms of AprilTag software, there is the official one which requires some manual installation:

> **[GitHub - AprilRobotics/apriltag: AprilTag is a visual fiducial system popular for...](https://github.com/AprilRobotics/apriltag)**
>
> AprilTag is a visual fiducial system popular for robotics research.

Or a non-official, but pip-installable version: [pupil-apriltags 1.0.4.post9.dev1+gfff8536](https://pupil-apriltags.readthedocs.io/en/latest/) (which could be a reasonable version)

It would be awesome to have [a pip-installable version attached with the main repo](https://github.com/AprilRobotics/apriltag/issues/322), though.

EDIT: [GitHub - duckietown/lib-dt-apriltags: Python bindings to the Apriltags library](https://github.com/duckietown/lib-dt-apriltags) provides Python bindings for the official repo (and is even mentioned in the official repo README), but it’s pinned to a 2021 version of `apriltags` and hasn’t been updated since 2023.

---

<div class="post-metadata">

**Author:** ![sgbaird](https://yyz1.discourse-cdn.com/flex003/user_avatar/accelerated-discovery.org/sgbaird/32/341_2.png) [@sgbaird](https://accelerated-discovery.org/u/sgbaird)\
**Post date:** [April 16, 2025, 5:24pm UTC](https://accelerated-discovery.org/t/apriltags-which-packages-to-use-and-how-to-generate-where-to-buy/170/2 "2025-04-16T17:24:08Z")

</div>

Also worth noting perhaps that there are some more recent implementations of AprilTags (I think on the official repo) that are ~~annular (i.e., could be put around a vial)~~ flexible (but not explicitly in the sense of “curved”). See [Any examples of annular / curved surface AprilTags? · Issue #380 · AprilRobotics/apriltag · GitHub](https://github.com/AprilRobotics/apriltag/issues/380)

---

<div class="post-metadata">

**Author:** ![sgbaird](https://yyz1.discourse-cdn.com/flex003/user_avatar/accelerated-discovery.org/sgbaird/32/341_2.png) [@sgbaird](https://accelerated-discovery.org/u/sgbaird)\
**Post date:** [April 16, 2025, 5:32pm UTC](https://accelerated-discovery.org/t/apriltags-which-packages-to-use-and-how-to-generate-where-to-buy/170/3 "2025-04-16T17:32:30Z")

</div>

It would probably help to compile a list of some adhesive label printing services that have decent chemical compatibility. As an aside, I bought a label printer that comes with a Python API with the intention of [setting up an inventory system](https://github.com/AccelerationConsortium/ac-training-lab/issues/172) that auto-prints AprilTags as new items are added

> <https://github.com/AccelerationConsortium/ac-training-lab/issues/70>
>
> https://github.com/AccelerationConsortium/ac-training-lab/issues/53
> 
> https://g…ithub.com/pklaus/brother\_ql
> 
> https://stackoverflow.com/questions/55521301/printing-label-from-brother-ql-800-label-printer
> 
> i.e., with new pieces of equipment, autoprint an AprilTag to be affixed to it.

---

<div class="post-metadata">

**Author:** ![sgbaird](https://yyz1.discourse-cdn.com/flex003/user_avatar/accelerated-discovery.org/sgbaird/32/341_2.png) [@sgbaird](https://accelerated-discovery.org/u/sgbaird)\
**Post date:** [May 8, 2025, 6:25pm UTC](https://accelerated-discovery.org/t/apriltags-which-packages-to-use-and-how-to-generate-where-to-buy/170/4 "2025-05-08T18:25:03Z")

</div>

A few other resources:

> **[Experimental Comparison of Fiducial Markers for Pose Estimation](https://ieeexplore.ieee.org/document/9213977)**
>
> Accurate localization is crucial for the autonomous navigation and control of Unmanned Aircraft Systems (UAS). In most applications, localization is provided from a Global Navigation Satellite System like GPS and Galileo or more recently from Visual...

- [Stack exchange AprilTag vs. Aruco](https://robotics.stackexchange.com/questions/19901/apriltag-vs-aruco-markers/19902?noredirect=1#comment51116_19902)
- [Fiducial markers on curved surface (cylinder)?](https://forum.opencv.org/t/fiducial-markers-on-curved-surface-cylinder/3366)

---

<div class="post-metadata">

**Author:** ![sgbaird](https://yyz1.discourse-cdn.com/flex003/user_avatar/accelerated-discovery.org/sgbaird/32/341_2.png) [@sgbaird](https://accelerated-discovery.org/u/sgbaird)\
**Post date:** [May 14, 2025, 6:21pm UTC](https://accelerated-discovery.org/t/apriltags-which-packages-to-use-and-how-to-generate-where-to-buy/170/5 "2025-05-14T18:21:10Z")

</div>

Nice use-case of AprilTags in the context of laboratory automation:

> **[Robotic integration for end-stations at scientific user facilities](https://pubs.rsc.org/en/content/articlelanding/2025/dd/d5dd00036j)**
>
> The integration of robotics and artificial intelligence (AI) into scientific workflows is transforming experimental research, particularly at large-scale user facilities such as the National Synchrotron Light Source II (NSLS-II). We present an...

Ideas and some references around the use of AprilTags are also described in Section 4.2.1 of an article I wrote with Stanley Lo:

> **[Review of low-cost self-driving laboratories in chemistry and materials...](https://pubs.rsc.org/en/content/articlelanding/2024/dd/d3dd00223c)**
>
> This review proposes the concept of a “frugal twin,” similar to a digital twin, but for physical experiments. Frugal twins range from simple toy examples to low-cost surrogates of high-cost research systems. For example, a color-mixing self-driving...

---

<div class="post-metadata">

**Author:** ![hereld](https://yyz1.discourse-cdn.com/flex003/user_avatar/accelerated-discovery.org/hereld/32/156_2.png) [@hereld](https://accelerated-discovery.org/u/hereld)\
**Post date:** [July 3, 2025, 8:08pm UTC](https://accelerated-discovery.org/t/apriltags-which-packages-to-use-and-how-to-generate-where-to-buy/170/6 "2025-07-03T20:08:28Z")

</div>

I’m using the apriltag package at PyPI – free and easy install with pip. I use these as the underlying tags for our lab’s RPLtags:

- apriltags are the base component, lets us leverage optimized detection of individual stamps
- tag ID identification and inferred distance are robustly computed by the apriltag package
- unfortunately, pose estimation with four corner detections has ambiguity in orientation that sometimes rears its ugly head due to noise
- many applications get around this by taking multiple frames in mobile video streams and ignoring ambiguous results
- however, we want single frame pose estimation that is robust, hence RPLtags
- layout of multiple apriltags into single RPLtag gives that robustness due to more than 4 points and known relative (in most of our templates: co-planar) constraints
- RPLtags are registered in local database with layout info and multi-tag IDs
- net benifit: robust pose estimation and huge ID space (great for future factory fun)

Regarding tag family choice, I tend toward tag36h11 because it is well-suited to a wide range of use cases with different cameras. It is less demanding of higher resolution detection than the denser families, and so can be seen more robustly at greater distance for a given resolution, or made smaller in physical size for use in constrained laboratory instrumentation labeling. It has a large enough code space for most applications of RPLtags, where our typical RPLtag template would include three apriltags in a fixed layout. By themselves, the tag36h11 family provides many hundreds of codes. In combinations of three the code space becomes hundreds of millions.

Hard at work now packaging RPLtags for general use and distribution to anybody who might find it useful!

---

<div class="post-metadata">

**Author:** ![sgbaird](https://yyz1.discourse-cdn.com/flex003/user_avatar/accelerated-discovery.org/sgbaird/32/341_2.png) [@sgbaird](https://accelerated-discovery.org/u/sgbaird)\
**Post date:** [July 9, 2025, 9:03pm UTC](https://accelerated-discovery.org/t/apriltags-which-packages-to-use-and-how-to-generate-where-to-buy/170/7 "2025-07-09T21:03:08Z")

</div>

Hi Mark, thanks for providing your perspective from ANL side! Quick Q: is the PyPI package you’re using [`apriltag`](https://pypi.org/project/apriltag/), [`pupil-apriltags`](https://pypi.org/project/pupil-apriltags), or something else? @viprorok has also been exploring AprilTag implementations within the AC as part of some larger efforts.
