# AprilTag

**AprilTag** 是机器人研究中常用的一种视觉基准系统：一种印刷的黑白方形标签，单张相机图像即可检测、识别该标签，并据此恢复标签完整的六自由度位姿（位置与朝向）。它由密歇根大学 APRIL 机器人实验室在埃德温·奥尔森（Edwin Olson）主持下创建，描述于 2011 年 ICRA 论文，并以一个依赖极少的轻量 C 库形式发布。<sup>[1](https://april.eecs.umich.edu/papers/details.php?name=olson2011tags)</sup><sup> • </sup><sup>[2](https://github.com/AprilRobotics/apriltag)</sup>

| 关键事实 | 详情 |
|---|---|
| 是什么 | 一种视觉基准系统：印刷方形标签编码一个 ID，从单张图像即可检测并实现完整六自由度定位<sup>[1](https://april.eecs.umich.edu/papers/details.php?name=olson2011tags)</sup> |
| 起源 | 密歇根大学 APRIL 机器人实验室；原始论文由埃德温·奥尔森发表于 ICRA 2011，第 3400–3407 页<sup>[1](https://april.eecs.umich.edu/papers/details.php?name=olson2011tags)</sup> |
| 当前版本 | AprilTag 3：检测器速度超过原来的 2 倍，小标签检测改善，布局灵活，并支持位姿估计<sup>[2](https://github.com/AprilRobotics/apriltag)</sup> |
| 推荐家族 | 多数应用推荐 tagStandard41h12；家族以数据位数加最小汉明距离命名（例如 tag36h11）<sup>[2](https://github.com/AprilRobotics/apriltag)</sup><sup> • </sup><sup>[3](https://github.com/behnamasadi/robotic_notes/blob/master/docs/apriltag_vs_aruco.md)</sup> |
| 软件 | 轻量 C 库，BSD-2-Clause 许可证；官方仅支持 Linux，但 Windows 上亦有成功安装；ROS 包版本 3.4.5，状态为维护中<sup>[2](https://github.com/AprilRobotics/apriltag)</sup><sup> • </sup><sup>[4](https://index.ros.org/p/apriltag/)</sup> |
| 检测距离 | 在一项无人机着陆研究中，全相机分辨率下 AprilTag 检测距离为 34.7 米，而 ArUco 为 16 米<sup>[5](https://www.mdpi.com/2079-9292/15/8/1582)</sup> |
| 已知局限 | 观察相机的偏航角是位姿误差的主要未校正来源；相机正对标签中心时精度最高<sup>[6](https://doi.org/10.3390/s19245480)</sup> |

## 标签的工作原理

AprilTag 是一种二维条码式标记：黑色边框环绕着一片黑白数据单元组成的网格，网格编码一个标识符。该系统为可控实验、真值获取以及简化“感知并非核心目标”的系统而设计，并以快速稳健的直线检测、更强的数字编码，以及对遮挡、形变和镜头畸变更强的鲁棒性，改进了早期的基准标记。与类似的 ARTag 系统不同，该方法是完全开源的，其算法有详细文档。<sup>[1](https://april.eecs.umich.edu/papers/details.php?name=olson2011tags)</sup>

**标签家族。** 一个家族是一组预生成的有效码字；每个家族的名称编码了其数据位数和最小汉明距离——[汉明距离](https://www.edgepedia.org/zh/hamming-distance)即任意两个编码之间相隔的比特错误数。较大的最小汉明距离带来抗误检能力：tag36h11 就是围绕大汉明距离设计的，因此误报率极低。<sup>[3](https://github.com/behnamasadi/robotic_notes/blob/master/docs/apriltag_vs_aruco.md)</sup> 代码仓库提供的家族包括 tag16h5、tag25h9、tag36h10、tag36h11、tagStandard41h12、tagStandard52h13、tagCircle21h7、tagCircle49h12 和 tagCustom48h12。<sup>[2](https://github.com/AprilRobotics/apriltag)</sup> 项目的建议是：多数应用使用 tagStandard41h12；需要更多不同标签时使用 tagStandard52h13；小型圆形物体上要最大化利用空间时使用圆形家族；递归标签使用 tagCustom48h12；自定义家族可用 AprilTag-Generation 仓库生成。<sup>[2](https://github.com/AprilRobotics/apriltag)</sup>

**AprilTag 3 的灵活布局。** 版本 3 在 AprilTag 2 的经典方形网格之外增加了新布局：数据位可以延伸到标签边框之外，布局也可以在边框内部包含不放置数据位的“空洞”。该版本提供两个基于新标准布局的家族——它在边框外再环绕一圈数据位，使数据密度和标签容量增加，但检测距离略有缩短；两个圆形标签家族；以及一个带中心空洞的家族，用于无人机场景：不同尺寸的标签可以一个套一个，从而在很宽的距离范围内都能检测到标签。<sup>[2](https://github.com/AprilRobotics/apriltag)</sup>

## 检测与位姿估计

检测器在图像中寻找四边形，采样数据位，并针对所选家族的码字进行纠错。AprilTag 的流水线采用线段聚类后接基于图的四边形拟合，这与 ArUco 的自适应阈值、轮廓和比特采样方法形成对比。<sup>[3](https://github.com/behnamasadi/robotic_notes/blob/master/docs/apriltag_vs_aruco.md)</sup> 检测器参数在速度与距离之间权衡：增大 quad_decimate 参数可加快检测，但牺牲检测距离；减小该参数（最低至 1）则有助于在标签边框未被检测为四边形时改善检测。<sup>[2](https://github.com/AprilRobotics/apriltag)</sup>

**位姿估计。** 该库提供 estimate_tag_pose 函数，输入检测结果、标签的物理尺寸（米），以及相机的焦距和光心，返回标签的位姿。标签尺寸从黑白边界相接处量起，即检测角点之间的距离，而非标签外缘。坐标系以相机中心为原点，z 轴指向镜头外，x 轴指向图像右方，y 轴向下；标签坐标系以标签为中心，z 轴指向标签内部。<sup>[2](https://github.com/AprilRobotics/apriltag)</sup> 也可选用 OpenCV 的 PnP 求解器配合 SOLVEPNP_IPPE_SQUARE 作为替代方案。<sup>[2](https://github.com/AprilRobotics/apriltag)</sup>

## 版本

原始系统于 2011 年发表。<sup>[1](https://april.eecs.umich.edu/papers/details.php?name=olson2011tags)</sup> AprilTag 2 由 John Wang 与埃德温·奥尔森在 IROS 2016 上提出，是完全重新设计的检测器，在保持标签编码方案不变的前提下提升了鲁棒性和效率，同时保留了编码系统抗误报的能力。它带来了更高的检测率、更少的误报和更低的计算时间；由于在小图像上表现更好，可以对输入图像进行降采样，从而大幅提升检测速度。这一重新设计牺牲了检测部分遮挡标签的能力。<sup>[7](https://april.eecs.umich.edu/papers/details.php?name=wang2016iros)</sup>

AprilTag 3 是当前版本，新增了速度超过原来 2 倍的检测器、改进的小标签检测、灵活布局和位姿估计，并且仍然是一个依赖极少的轻量 C 库。<sup>[2](https://github.com/AprilRobotics/apriltag)</sup> 近期发布包括 v3.4.3（2025 年 2 月）、v3.4.4（2025 年 7 月）和 v3.4.5（2025 年 8 月）。<sup>[8](https://hysenlabs.com/projects/aprilrobotics-apriltag)</sup>

## 精度与比较

比较研究将 AprilTag 与 ARTag、ArUco 和 [STag](https://www.edgepedia.org/zh/stag)——最广泛使用的开源基准标记软件包——进行对照，在包含模拟阴影和运动模糊噪声等条件下评估精度、检测率和计算成本。<sup>[9](https://doi.org/10.1007%2Fs10846-020-01307-9)</sup> 在一项无人机精确着陆比较中，AprilTag 的检测率低于 ArUco、计算时间高于 ArUco，但对部分遮挡高度鲁棒、精度高；全分辨率下其检测距离为 34.7 米，而 ArUco 为 16 米；较低的检测频率与 AprilTag 更复杂的解码和验证步骤相符——这些步骤正是为了提高鲁棒性、减少误报而设计的。<sup>[5](https://www.mdpi.com/2079-9292/15/8/1582)</sup> 另一项实验比较发现，尽管 ArUco 在检测率上始终有竞争力，但其平均误差和标准差通常更高，表明精度低于 AprilTag。<sup>[10](https://ieeexplore.ieee.org/document/9213977/)</sup>

**误差来源。** 一项对基于 AprilTag 的状态估计的分析指出，观察相机绕其垂直轴的偏航角是主要误差来源，在该实现中未加校正，使精度下降到若不补偿则系统无法胜任亚分米级任务的程度；相机正对标签中心时精度最高；作者提出了一种在室内外均有效的数据驱动概率传感器模型。<sup>[6](https://doi.org/10.3390/s19245480)</sup> 定位精度还取决于检测库：在一项对四个可检测 AprilTag 的库的比较中，后处理技术达到 0.017 像素的中位像素误差，而标准 OpenCV 角点细化则为 0.17 像素。<sup>[11](https://ieeexplore.ieee.org/document/9197427/)</sup>

## 应用

AprilTag 用于机器人导航、定位以及相机和传感器标定，也用作增强现实中的标记。<sup>[3](https://github.com/behnamasadi/robotic_notes/blob/master/docs/apriltag_vs_aruco.md)</sup><sup> • </sup><sup>[12](https://agroinnovationedu.imagelinenetwork.com/sitocommon/UserFiles/File/EDU/Award20248edizione/Torrente_Ph-D-Thesis_3D-sensing-approaches-for-Precision-Agriculture_applications-to-plant-features-characterization-and-to-weed-control-in-maize.pdf)</sup> 在研究软件中，TagSLAM 利用 AprilTag 标记执行 SLAM，为 GTSAM 因子图优化器提供前端，支持完整 SLAM、非重叠视角下的相机外参标定、用于真值的视觉定位以及回环检测。<sup>[13](https://arxiv.org/abs/1910.00679)</sup> 这些标签也用于研究型机器人之外：FIRST 机器人竞赛将 AprilTag 布置在赛场上，用于机器人定位和瞄准，并且有工具可将练习场标签布置对照官方布局进行校准。<sup>[14](https://apps.apple.com/us/app/practical-ar/id6757085499?platform=mac)</sup>

## References

1. [Edwin Olson (2011). AprilTag: A robust and flexible visual fiducial system. ICRA 2011, APRIL Laboratory paper page.](https://april.eecs.umich.edu/papers/details.php?name=olson2011tags)
2. [AprilRobotics/apriltag repository README (AprilTag 3).](https://github.com/AprilRobotics/apriltag)
3. [AprilTag vs ArUco comparison notes, behnamasadi/robotic_notes.](https://github.com/behnamasadi/robotic_notes/blob/master/docs/apriltag_vs_aruco.md)
4. [apriltag package, ROS Index.](https://index.ros.org/p/apriltag/)
5. [Experimental Evaluation of Precision Positioning in Unmanned Aerial Systems Using Fiducial Markers, Electronics (MDPI), 2026.](https://www.mdpi.com/2079-9292/15/8/1582)
6. [Syed Muhammad Abbas, Salman Aslam, Karsten Berns, Abubakr Muhammad (2019). Analysis and Improvements in AprilTag Based State Estimation. Sensors 19(24):5480.](https://doi.org/10.3390/s19245480)
7. [John Wang and Edwin Olson (2016). AprilTag 2: Efficient and robust fiducial detection. IROS 2016, APRIL Laboratory paper page.](https://april.eecs.umich.edu/papers/details.php?name=wang2016iros)
8. [AprilTag 3: install, Python usage and tag families, Hysen Labs.](https://hysenlabs.com/projects/aprilrobotics-apriltag)
9. [Michail Kalaitzakis and colleagues (2021). Fiducial Markers for Pose Estimation: Overview, Applications and Experimental Comparison of the ARTag, AprilTag, ArUco and STag Markers. Journal of Intelligent & Robotic Systems 101:71.](https://doi.org/10.1007%2Fs10846-020-01307-9)
10. [Experimental Comparison of Fiducial Markers for Pose Estimation, IEEE.](https://ieeexplore.ieee.org/document/9213977/)
11. [Determining and Improving the Localization Accuracy of AprilTag Detection, IEEE.](https://ieeexplore.ieee.org/document/9197427/)
12. [M. Torrente, Ph.D. thesis, 3D sensing approaches for precision agriculture applications.](https://agroinnovationedu.imagelinenetwork.com/sitocommon/UserFiles/File/EDU/Award20248edizione/Torrente_Ph-D-Thesis_3D-sensing-approaches-for-Precision-Agriculture_applications-to-plant-features-characterization-and-to-weed-control-in-maize.pdf)
13. [Bernd Pfrommer and Kostas Daniilidis (2019). TagSLAM: Robust SLAM with Fiducial Markers. arXiv:1910.00679.](https://arxiv.org/abs/1910.00679)
14. [PractiCal AR, App Store (FRC practice field AprilTag calibration).](https://apps.apple.com/us/app/practical-ar/id6757085499?platform=mac)

---
*Initially written Oct 15, 2026 · Edited: Oct 25, 2026*

Topic: 技术与人造世界 › 工程与制造 › 机器人技术与自动化 › Robot software, AI, and methods › Localization, state estimation, and navigation

Copyright 2026 Edgepedia

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license

Source: https://www.edgepedia.org/zh/apriltag

English original: https://www.edgepedia.org/apriltag
