校准点应该如何分配?

信息处理 计算机视觉 opencv 相机校准
2022-02-08 09:32:13

我第一次在opencv中对具有棋盘图案的单个相机进行相机校准。焦点是固定的。我不知道该怎么做,似乎有很多问题:

  1. 应使用多少张图像进行校准?
  2. 应该使用什么模式?点数,方格大小
  3. 应该对校准目标应用哪些转换?旋转、倾斜、移动……

我得出的结论是,以上问题都无法单独回答,因为它们都相互依赖。例如,拍摄大量彼此非常相似的图像在直觉上不如拥有更少的图像更好地分布在帧中。

我往后退了一步,想了想到底是怎么回事。(我试过)基本上,有一个相机及其像差(焦距、失真等)的数学模型,校准是收集数据以使模型(其值)适合手头硬件的过程。这似乎主要是统计数据为了使模型很好地适应整个图像,应该从整个图像中收集样本数据。

我得出结论,以上所有问题都归结为图案的可检测点应如何分布在 3D 空间中

我想知道这个想法是否有意义。

我厌倦了阅读诸如“图像越多越好”、“至少应该使用任意数量的图像”等无法为校准质量提供量化衡量标准的建议当然,有一个重投影误差,它说明校准与提供的校准数据的匹配程度,但不是该数据首先适合校准的程度。

我得出的结论是,通过用于创建校准的样本数据的分布来评估校准的质量更有意义。说得通?


因此,上面的问题 1 和 2 合并为:在所有校准图像中检测到的校准点的总体密度(或密度分布)应该是多少?

假设我从所有校准图像中取出所有检测到的点并将它们放在一张图像中,我可以看到每个像素区域有多少校准点px2.如果我有很多图像中心有图案的图像,我会在那里得到更高的密度。

每个像素区域的校准点密度的最小(基线)值是多少? 0.1 px2?0.5 px2?

每个像素区域的校准点分布是否应该在整个图像上保持不变?或者我是否需要在边缘更高的密度(阅读:更多的样本值)?


问题 3 是要求第三维度的分布。带有图案的校准目标可以前后移动(沿光轴)或倾斜。两种转换都会导致校准点位于焦点1的平面的前面或后面。根据景深,可以检测到距焦平面一定距离的角点。这为可以检测校准点的空间增加了第三维。 校准点应如何根据距焦平面1的距离分布?鉴于远离焦点的点的检测效果不佳,大多数点是否应该在焦点1周围?


tl,博士;

在摄像头前面,有一个 3D 空间,由一个棱锥体/圆锥体包围,可以在其中检测校准点。为了获得良好的校准,校准点应如何分布在该空间中?


1我的意思是在图像中“聚焦”的点平面。

1个回答

为此,我有一些指导方针,我想分享。尽管其中一些可能对某些校准软件无效,但对于典型情况,它们具有:

1) The entire pattern should be visible in all sequences.
2) At least 1/4th of the image should be occupied by the pattern.
3) Preferably, the lighting should be uniform everywhere on the pattern. 
(As little shadows as possible)
4) The light should reflect from the pattern to the camera (as much as possible). 
Thus, objects made up of metal are not suggested.
5) There should be minimal blur. If focus/depth-of-field is an issue, 
use a smaller plate or less tilts.
6) If you can't fix the camera, it shouldn't move at all. 
For extrinsic calibration, moving the camera after calibrating will ruin the entire 
calibration. Be careful about this as even small shakes or movements distort the accuracy.
7) Don't pre-process the calibration images. 
Even if you do very smart things, you might perturb the accuracy.
8) Ideally, have 15-50 images fitting the above criterion. 
This should give you 450-1500 points to optimize in total.
9) If you are printing the pattern on a piece of paper, then make sure that 
contrast between black-white squares is significant and no strange shape is appears on the paper. 
10) Don't bend the calibration pattern. Make sure that it is as rigid (and planar) as possible
11) If you are printing on an A4 paper, make sure you have some white space around the pattern, 
remember you will want to hold it somehow.
12) If you have distortion, use small circles, they are less affected from distortion. 
If you have low resolution but less distortion use larger circles. 
13) Start with low tilts and fronto-parallel images. 
Move to the tilts and rotations in all axes, gradually, covering the entire visible space.
If you have bias in the space coverage or distribution of points, 
then it means that some regions of the space will be better calibrated.
Keep this as equal as possible. Some variation can be tolerated.

我希望这些帮助。