相机校准:如何正确做 [英] Camera Calibration: How to do it right

查看:91
本文介绍了相机校准:如何正确做的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过众所周知的Zhang方法使用棋盘格来校准摄像机,然后进行捆绑调整,这在Matlab和OpenCV中都可用.有很多经验准则,但根据我的个人经验,准确性是相当随机的.它有时可能真的很好,但有时也真的很糟糕.只需将棋盘放置在不同的位置,结果实际上就会有很大的不同.假设目标摄像机是直线的,水平视场角为110度.

I am trying to calibrate a camera using a checkerboard by the well known Zhang's method followed by bundle adjustment, which is available in both Matlab and OpenCV. There are a lot of empirical guidelines but from my personal experience the accuracy is pretty random. It could sometimes be really good but also sometimes really bad. The result actually can vary quite a bit just by simply placing the checkerboard at different locations. Suppose the target camera is rectilinear with 110 degree horizontal FOV.

  1. 棋盘格中的平方数是否会影响准确性?张在原始论文中使用8x8,而没有真正解释原因.

  1. Does the number of squares in the checkerboard affect the accuracy? Zhang uses 8x8 in his original paper without really explaining why.

正方形的长度会影响精度吗?张使用17厘米x 17厘米,而没有真正解释原因.

Does the length of the square affect the accuracy? Zhang uses 17cm x 17cm without really explaining why.

不同棋盘位置/方向的最佳快照数量是多少?张仅使用5张图片.我看到有人建议使用20到30张不同角度的棋盘图像,并填充整个视场,并向左,向右,顶部和底部倾斜,并建议不要将棋盘放置在相似的位置/方向,否则结果将是偏向那个位置/方向.这是正确的吗?

What is the optimal number of snap shots of different checkerboard position/orientation? Zhang uses 5 images only. I saw people suggesting 20~30 images with checkerboards at various angles, fills the entire field of view, tilted to the left, right, top and bottom, and suggested there should be no checkerboard placed at similar position/orientation otherwise the result will be biased towards that position/orientation. Is this correct?

目标是弄清楚工作流程以获得一致的校准结果.

The goal is to figure out a workflow to get consistent calibration result.

推荐答案

如果获得的准确度是相当随机的",那么您可能做错了:通过稳定的光学器件和操作良好的程序,您应该始终获得RMS十分之一像素内的投影误差.当然,这是否对应于3D空间中毫米或米的变化,取决于您的光学器件和传感器分辨率(校准不是绕过物理学的方法).

If the accuracy you get is "pretty random" then you are likely not doing it right: with stable optics and a well conducted procedure you should consistently be getting RMS projection errors within a few tenths of a pixel. Whether this corresponds to variances of millimeters or meters in 3D space depends, of course, on your optics and sensor resolution (calibration is not a way around physics).

我前段时间在

I wrote time ago a few suggestions in this answer, and I recommend you follow them. In particular, pay attention to locking the focus distance (I have seen & heard countless people trying to calibrate a camera on autofocus, and be sorely disappointed). As for the size of the target, again it depends on your optics and camera resolution, but generally speaking the goals are (1) to fill with measurements both the field of view and the volume of space you'll be working with, and (2) to observe significant perspective foreshortening, because that is what constrains the solution for the FOV. Good luck!

关于连续校准中参数值的变化,我要做的第一件事是计算交叉RMS误差,即,在数据集2上校准了相机的情况下,数据集1上的RMS误差,反之亦然.如果任何一个明显高于校准误差,则表明相机在两次校准之间发生了变化,因此所有可能性均已关闭.您是否启用了自动{对焦,光圈,变焦,稳定}功能?将它们全部关闭:自动曝光是校准的祸根,唯一的例外是曝光时间.否则,您需要查看在参数上观察到的变化是否确实有意义(提示,通常没有意义).千分之几的像素的焦距变化可能与当今的传感器分辨率无关-您可以通过以mm表示它并将其与传感器的点距进行比较来验证这一点.同样,主点位置通常以数十像素的顺序变化,因为除非您仔细地设计校准程序非常来估计它,否则很难观察到它.

Concerning variations on the parameter values across successive calibrations, the first thing I'd do is calculate the cross RMS errors, i.e. the RMS error on dataset 1 with the camera calibrated on dataset 2, and vice versa. If either is significantly higher than the calibration errors, it's an indication that the camera has changed between the two calibrations and so all odds are off. Do you have auto-{focus,iris,zoom,stabilization} on? Turn them all off: auto-anything is the bane of calibration, with the only exception of exposure time. Otherwise, you need to see if the variations you observe on the parameters are actually meaningful (hint, they often are not). A variation of the focal length in pixels of several parts per thousand is probably irrelevant with today's sensor resolutions - you can verify that by expressing it in mm, and comparing it to the dot pitch of the sensor. Also, variations of the position of the principal point in the order of tens of pixels are common, since it is poorly observed unless your calibration procedure is very carefully designed to estimate it.

这篇关于相机校准:如何正确做的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆