# C201 第 2 课：标定板与标定序列的录制

> C201 相机标定课程的第二课：Kalibr 或 mrcal 该用哪种标定板，怎样制作并测量它，以及怎样录制一个覆盖两幅鱼眼图像每个部分的序列，其中有近距离视图、倾斜视图和两台相机共同看到的视图。

Page: https://egocam.ai/zh-cn/university/c201/lesson-2-targets-and-recording/

一次标定的好坏受限于两样东西：相机所看的那块实物标定板，以及为它录下的那组视图。这一课针对鱼眼双目对讲这两样东西。带全部参考来源的完整讲解在[标定板，以及如何录制标定序列](https://egocam.ai/zh-cn/calibration/targets-and-calibration-sequences/)。

当前公开的采集设备用基准标记标定板来标定。[RoboCap](https://arxiv.org/abs/2610.07217)（Ali et al.，2026）这样描述它的逐台标定："An operator sweeps the device through a calibration motion sequence against a stationary AprilGrid target"（意为：操作员让设备对着一块固定不动的 AprilGrid 标定板扫过一套标定运动序列）。[TUM VI](https://arxiv.org/abs/1804.06120) 是一个使用 195° 鱼眼双目相机的基准，它在 "A grid of AprilTags"（意为：一个由 AprilTag 组成的网格）前面录制标定数据。

## 本课用到的术语

另见[术语表的标定部分](https://egocam.ai/zh-cn/reference/glossary/)。

| 术语 | 含义 |
|---|---|
| 平面标定板（Planar calibration target） | 一块印有图案的平板，图案的几何尺寸精确已知 |
| 棋盘格角点（Checkerboard corner） | 两个黑格和两个白格相交处的鞍点 |
| 基准标记（Fiducial marker） | 一种带有自身 ID 和朝向的小方形二进制码，例如 AprilTag |
| Aprilgrid | 由 AprilTag 按固定间隙排成的网格；Kalibr 推荐的标定板 |
| ChArUco 标定板（ChArUco board） | 一种棋盘格，每个白格里有一个 ArUco 标记 |
| 覆盖（Coverage） | 标定板上检测到的角点到达了每幅图像的多大部分，包括四角 |
| 共同视野帧（Shared view） | 两台相机在同一时刻都看到标定板的一帧 |

## 选择标定板：取决于工具

| 标定板 | 只看到一部分的视图能用吗？ | 位姿会翻转吗？ | 适合 |
|---|---|---|---|
| Aprilgrid | 能 | 不会 | Kalibr 推荐的标定板 |
| ChArUco | 能 | 不会 | OpenCV |
| 棋盘格 | 不能：整个网格必须可见 | 会，在对称的标定板上 | OpenCV；Kalibr 的 `checkerboard`；mrcal 及其 mrgingham 检测器 |
| 圆点阵列 | 不能 | 会，在对称的网格上 | mrcal 的编排研究建议不要用它 |

这张表浓缩了实用指南中的[标定板类型比较](https://egocam.ai/zh-cn/calibration/targets-and-calibration-sequences/)。

对鱼眼采集设备，只看到一部分的视图很重要。要让角点到达鱼眼图像的一个角，只能让标定板伸出画面边缘，所以每个角点都知道自己身份的标定板在这里就有用了。Kalibr 的[标定板页面](https://github.com/ethz-asl/kalibr/wiki/calibration-targets)推荐 Aprilgrid，因为 "partially visible calibration boards can be used"（意为：可以使用只看到一部分的标定板），而且 "pose of the target is fully resolved (no flips)"（意为：标定板的位姿被完全确定（没有翻转））。

mrcal 走的是另一条路。它的 [how-to-calibrate 指南](https://mrcal.secretsauce.net/how-to-calibrate.html)说 "Currently the recommended method is to use a classical chessboard target, and to employ the mrgingham detector"（意为：目前推荐的方法是使用经典的棋盘格标定板，并采用 mrgingham 检测器），并提醒 mrgingham 只报告完整的标定板："a small motion that pushes one chessboard corner barely out of bounds causes the whole observation to be discarded"（意为：一个小小的运动把一个棋盘格角点刚刚推出画面之外，就会使整次观测被丢弃）。如果你打算用 mrcal，就打印一块棋盘格，并准备好在边缘处多下功夫；同一份指南说，拍摄时 "very helpful to be able to see a live feed of the camera"（意为：能看到相机的实时画面非常有帮助）。

## 制作标定板

四条规则，全部来自 Kalibr wiki 和 mrcal 文档，原文引用见[标定板页面](https://egocam.ai/zh-cn/calibration/targets-and-calibration-sequences/)：

- **平整而且刚性**。Kalibr："Make sure the calibration target is as flat as possible. Best is to glue it to a rigid plate such as aluminum or acrylic glass."（意为：确保标定板尽可能平整。最好把它粘在铝板或亚克力玻璃这样的刚性板上。）Kalibr 和 OpenCV 假定标定板完全平整；mrcal 会拟合标定板的一个小弯曲，因为大的标定板很少像看上去那样平。
- **要测量，不要假定**。Kalibr："Most printers will scale the target during the printing process. Make sure to remeasure the important sizes and adjust the target configuration accordingly."（意为：大多数打印机在打印过程中会缩放标定板。务必重新测量重要的尺寸，并相应调整标定板配置。）标定板是唯一决定公制尺度的东西，所以尺寸误差会原样传到基线上。
- **白色边框**至少一个网格单元宽，否则在某些光照下检测可能失败。检测器靠每个标签的黑色边框与周围白色之间的对比度来找到它（[基准标记的检测如何决定标定板的设计](https://egocam.ai/zh-cn/calibration/targets-and-calibration-sequences/)）。
- **视野里不要有其他标签**。Kalibr："Make sure to hide all external Apriltags while collecting the calibration dataset."（意为：采集标定数据集时，务必遮住所有外部的 Apriltag。）第二块标定板或一个无关的标签可能带有与网格自身标签相同的 ID，它的角点就会被匹配到网格上错误的点。

对于 Aprilgrid，测量一个标签黑色外边缘的边长作为 `tagSize`，测量标签之间的间隙，并把 `tagSpacing` 设为 间隙 ÷ `tagSize`。`tagSpacing` 是一个比值，不是长度（[测量打印出来的标定板](https://egocam.ai/zh-cn/kalibr/kalibr-file-reference/)）。

> **Diagram:** On an Aprilgrid, tagSize is the width of one tag across its black border, in metres. tagSpacing is not a length: it is the gap between tags divided by tagSize. The small black squares fill the gaps at the tag corners.

## 录制相机序列

做相机标定时，采集设备不动，标定板移动。Kalibr 的[多相机指南](https://github.com/ethz-asl/kalibr/wiki/multiple-camera-calibration)说 "The camera system is fixed and the calibration target is moved in front of the cameras"（意为：相机系统固定不动，标定板在相机前面移动），并建议把相机帧率降到 "to around 4 Hz while capturing the calibration data"（意为：采集标定数据时降到约 4 Hz）。它的理由："This reduces redundant information in the dataset and thus lowering the runtime of the calibration."（意为：这会减少数据集中的冗余信息，从而缩短标定的运行时间。）标定板缓慢移动时，相邻的帧几乎不增加任何新信息。移动标定板而不移动采集设备，是 Kalibr 对这个工具的约定；对相机自身的参数来说，要紧的只是标定板相对于相机的位姿，所以动哪一个都可以（[录制相机序列](https://egocam.ai/zh-cn/calibration/targets-and-calibration-sequences/)）。

视图必须包含什么，来自 mrcal 的[编排研究](https://mrcal.secretsauce.net/tour-choreography.html)，这是一项合成研究，[标定板页面](https://egocam.ai/zh-cn/calibration/targets-and-calibration-sequences/)有它的摘要：

- **近距离视图**。距离的影响非常大："we want closeups. Anything else is a waste of time."（意为：我们要的是近距离拍摄。其他一切都是浪费时间。）
- **倾斜**。"The head-on views (tilt = 0) produce quite poor results"（意为：正对的视图（倾斜 = 0）给出的结果相当差），到大约 45 度时收益递减。该研究给出了近距离视图和倾斜两者的理由："a tilted close-up view is the best-possible view for the solver to disambiguate focal length effects from the effects of chessboard range"（意为：对求解器来说，倾斜的近距离视图是把焦距的影响与棋盘格距离的影响区分开的最佳视图）。正对时，一块看起来变小的标定板可能是离得更远，也可能是透过更短的焦距看到的；倾斜使它的近边和远边不一样，这就把两者分开了。
- **足够的帧数**。"more observations is always better, but we reach the point of diminishing returns at ~ 100 frames"（意为：观测越多总是越好，但到大约 100 帧时就到了收益递减的点）。
- **不要太近**。极近的近距离视图会显出镜头的非中心特性，mrcal 的 [formulation 说明](https://mrcal.secretsauce.net/formulation.html)说要避免它，办法是 "by keeping the chessboard far-enough out to make the central model work well."（意为：让棋盘格保持足够远，使中心模型能很好地工作。）

作者补充说，这些结果来自一只合成镜头，并且 "For a specific lens and geometry, rerun these studies for your use cases."（意为：对于特定的镜头和几何配置，请针对你的使用场景重新做这些研究。）

**覆盖**是另一项要求：标定板必须到达每幅图像的每个部分，首先是四角。没有引导时，人们会漏掉它们。在 [AprilCal 用户研究](https://egocam.ai/zh-cn/calibration/targets-and-calibration-sequences/)中，按书面说明操作的新手得到的平均测试误差是 0.728 px，但最大误差的平均值是 38.6 px，作者把原因归结为覆盖："the sorts of images that novice users capture, even when attempting to follow the ROS instructions, don’t constrain the whole lens well"（意为：新手用户拍到的那类图像，即使在努力遵循 ROS 说明的情况下，也不能很好地约束整只镜头）（[Richardson、Strom 和 Olson，2013](https://april.eecs.umich.edu/media/pdfs/richardson2013iros.pdf)）。

## 共同视野帧：把两台相机联系起来的东西

外参只来自两台相机在同一时刻都看到标定板的那些帧。Kalibr 要求 "that neighbouring cameras have overlapping fields of view"（意为：相邻相机的视场有重叠），如果相机没有通过共同观测连接起来，它就会停止（[标定双目或多相机采集设备](https://egocam.ai/zh-cn/calibration/stereo-and-multi-camera-calibration/)）。

mrcal 的指南解释了近距离视图与共同视野帧之间的矛盾："it is impossible to place a calibration object at a location where it's seen by all the cameras and where it's a close-up for all the cameras. So you should get close-ups for each camera individually, and also get observations common to multiple cameras, that aren't necessarily close-ups"（意为：不可能把标定物放在一个既被所有相机看到、对所有相机又都是近距离的位置。所以应当为每台相机单独拍近距离视图，同时也拍多台相机共同的观测，后者不一定是近距离的）（[how-to-calibrate](https://mrcal.secretsauce.net/how-to-calibrate.html)）。

只有两幅图像是一起拍的，共同视野帧才有意义。如果标定板在两次曝光之间动了，求解器会把这段运动当成相机之间变换的一部分（[共同视野：相机如何被联系起来](https://egocam.ai/zh-cn/calibration/stereo-and-multi-camera-calibration/)）。mrcal 指出 "the images must be synchronized across all the cameras"（意为：图像必须在所有相机之间同步），并说明软件触发 "is usually too loose to produce usable results"（意为：通常太松，得不到可用的结果）。Kalibr 按时间戳在一个容差之内给图像配对，即 `--approx-sync`，默认 0.02 s（[Kalibr 文件参考](https://egocam.ai/zh-cn/kalibr/kalibr-file-reference/)）。

## 清晰的角点

移动要足够慢，使角点不模糊，并在良好的光线下使用短曝光（[Kalibr 工作流程，第 1 步](https://egocam.ai/zh-cn/kalibr/kalibr-workflow/)）。mrcal 的指南补充说 "Motion blur or exposure issues will all cause bias in the resulting calibration."（意为：运动模糊或曝光问题都会使得到的标定产生偏差。）

为什么明亮的光有帮助：短曝光使角点保持清晰，但它收集的光很少。在昏暗的光线下，相机不得不用更高的增益来补，这会增加噪声；或者用更长的曝光来补，这又把模糊带回来。两者都会使检测到的角点散开。在[一项研究](https://arxiv.org/pdf/2205.14724)中，Kalibr 在良好的光线下把一个 IMU 的位置定到 3.64 mm 以内，但在差的光线下 21 次运行中只有 1 次完成，它的误差是 119.96 mm。只是亮还不够：光应当均匀，标定板上没有眩光，白格也没有过曝截断。带参考来源的完整论述在[照明：标定为什么需要明亮、均匀的光](https://egocam.ai/zh-cn/calibration/targets-and-calibration-sequences/)。

## 自测

1. 你将用 Kalibr 标定，而你的鱼眼图像需要在最边缘处有角点。用哪种标定板？为什么？
2. 你的打印机设成了 100%，标签本应是 80 mm。你在 `target.yaml` 里填什么？
3. 一位同事录了 300 帧，全是正对的、一臂距离的、在图像中间的。这次录制有什么问题？
4. Kalibr 报错停止，说相机没有通过共同观测连接起来。说出两个可能的原因。
5. 为什么外参需要不必是近距离的共同视野帧，而内参需要近距离视图？

### 答案

1. Aprilgrid。每个标签单独解码，所以被图像边缘截断的标定板仍然能给出角点，而且它的位姿不会翻转。
2. 测得的值，不是预期的值。打印机会缩放标定板；测量标签的边长和间隙，并把 `tagSpacing` 设为间隙除以 `tagSize`。
3. 没有倾斜，没有近距离视图，也没有覆盖图像的四角。正对的视图给出的结果差，近距离视图最要紧，只在中间拟合的模型在边缘是错的。
4. 标定板同时出现在两台相机中的帧太少，或者相机没有同步（Kalibr 的提示信息建议检查同步容差）。
5. 没有哪个标定板位置能既对两台相机都是近距离、又被两台相机同时看到。每台相机各自的近距离视图确定它的内参；共同的视图，即使距离更远，确定相机之间的变换。

## 参考来源

- [Lee、Hanley 和 Bretl，2022：多 IMU 标定研究](https://arxiv.org/pdf/2205.14724)，Table IX。
- 实用指南：[标定板，以及如何录制标定序列](https://egocam.ai/zh-cn/calibration/targets-and-calibration-sequences/)、[标定双目或多相机采集设备](https://egocam.ai/zh-cn/calibration/stereo-and-multi-camera-calibration/)、[Kalibr 工作流程](https://egocam.ai/zh-cn/kalibr/kalibr-workflow/)、[Kalibr 文件参考](https://egocam.ai/zh-cn/kalibr/kalibr-file-reference/)、[术语表](https://egocam.ai/zh-cn/reference/glossary/)。
- Kalibr wiki，ETH Zurich ASL：[calibration targets](https://github.com/ethz-asl/kalibr/wiki/calibration-targets) 和 [multiple-camera calibration](https://github.com/ethz-asl/kalibr/wiki/multiple-camera-calibration)。
- Kogan, D. mrcal：[how to calibrate](https://mrcal.secretsauce.net/how-to-calibrate.html)、[optimal choreography](https://mrcal.secretsauce.net/tour-choreography.html) 和 [formulation](https://mrcal.secretsauce.net/formulation.html)。
- Richardson, A., Strom, J. and Olson, E. (2013). [AprilCal: Assisted and repeatable camera calibration](https://april.eecs.umich.edu/media/pdfs/richardson2013iros.pdf). *IEEE/RSJ IROS*.
- Ali, Q. et al. (2026). [RoboCap: A new platform for egocentric robot learning](https://arxiv.org/abs/2610.07217). arXiv:2610.07217.
- Schubert, D. et al. (2018). [The TUM VI benchmark for evaluating visual-inertial odometry](https://arxiv.org/abs/1804.06120). *IEEE/RSJ IROS*.
