Omnidirectional Camera
Davide Scaramuzza
Definition 定义
omnidirectional camera (from omni, meaning all) 广角相机: 在一个水平面有360度视野的相机,或视野能覆盖半个球或近似整个球的相机
Background 背景知识
大多数商业相机可以使用 pinhole 相机模型来描述,使用一个 perspective projection 来建模。但是存在一些高畸变成像设备如广角相机,它们不能使用传统小孔相机模型来描述。
目前存在几种构建广角相机的方法。Dioptric cameras 使用一组 shaped lenses(如鱼眼镜头),可以得到大于180度视野,(稍微多余半球); Catadioptric cameras 则使用一个标准相机和一个 shaped mirror — such as a parabolic, hyperbolic, or elliptical mirror,其在水平面可以提供360度视野,仰角方向大于100度;polydioptric camera 通过组合多个相机来重叠相机视野
Theory 理论
0.1 Central omnidirectional cameras
一个视觉系统是 central 的话,那么 被观测物体的所有入射光线汇交于3D空间的一个点,这个点称为 projection center 或 single effective viewpoint。
A vision system is said to be central when the optical rays to the viewed objects intersect in a single point in 3D called projection center or single effective viewpoint
这个属性我们称之为 single effective viewpoint property。 perspective camera 就是一个 central projection system,因为所有的入射光线交于一点: camera optical center。
所有现代鱼眼相机都是 central,所以他们都满足这个属性 single effective viewpoint property。Central catadioptric cameras 由一个相机+mirror 构建,相机和 mirror 的距离需要选择合适。Baker and Nayar [6] 证明了满足 single viewpoint property 的 mirrors 具有什么数学形式, the class of rotated (swept) conic sections, that is, hyperbolic, parabolic, and elliptical mirrors
为什么 single effective viewpoint 是如此的重要了? 1)it allows the user to generate geometrically correct perspective images from the pictures captured by the omnidirectional camera,When the geometry of the omnidirectional camera is known, that is, when the
camera is calibrated, one can precompute this direction for each pixel. 2)Epipolar geometry holds for any central camera, both perspective and omnidirectional,这样就可以应用 Epipolar geometry 相关知识到广角相机的图像中了。
0.2 Omnidirectional camera model and calibration
omnidirectional camera 的建模要比标准的 perspective camera 复杂一些。因为在建模的时候需要考虑: catadioptric camera中的 mirror 反射 或者 fisheye camera 中的 镜头折射问题
the reflection operated by the mirror in the case of a catadioptric camera or the refraction caused by the lens in the case of a fisheye camera
这里我们介绍 omnidirectional vision and robotics 中标准的两个不同投影模型,这两个模型其对应的 Matlab toolboxes 可以直接下载应用,所以被广泛使用。
第一个模型就是 the unified projection model for central catadioptric cameras, Geyer and Daniilidis [7] 在2000年提出的,Barreto and Araujo [8]后来优化了一下。这个模型包括了 catadioptric cameras相机中三类 mirror: cameras using a hyperbolic, parabolic, or elliptical mirror. 这个模型是专门针对 central catadioptric cameras 的,不实用于 fisheye cameras。在文献[9]中分析了使用该模型近似分析鱼眼镜头,精度有限。
第二个模型是 unifies both central catadioptric cameras and fisheye cameras under a general model also known as Taylor model,由 Scaramuzza et al. [10,11]于2006年提出,优势就是使用一个模型( a Taylor polynomial)分析 catadioptric and dioptric cameras
0.3 Unified model for central catadioptric cameras
Geyer and Daniilidis 在 2000年那篇经典文献指出:任意的 catadioptric (parabolic, hyperbolic, elliptical) 和标准的 perspective
projection 都等同于一个 projective mapping ,该映射将 位于 single viewpoint 一个球上的点 投影到 一个平面内,该平面的 the projection center on the perpendicular to the plane and distant ǫ from the center of the sphere
scene point 和 image point 的投影关系如下:
the camera and mirror reference frames differ only by a translation along z 相机坐标系和 mirror 坐标系
1)投影的第一步是将 scene point 投影到 the unit sphere
2)将投影点的坐标变换到一个新坐标系下表示,新坐标系的原点位于
新坐标为
注意这个新坐标系原点的位置不同,对应的mirror( 曲线反射面)类型会不一样。
3)接着将点 投影到 normalized image plane
4)最后通过相机内参数矩阵 K 将点投影到相机图像坐标系
function g −1 is bijective and that its inverse g is given by
上面的映射是将 成像平面上的点映射到 the unit vector Ps in the mirror reference frame
方程(6)可以通过反转方程(3)得到,满足约束: Ps 在单位球上。
方程(6)是 central catadioptric cameras 投影模型的核心。It expresses the relation between the point m on the normalized
image plane and the unit vector Ps in the mirror reference frame.
这个模型可以准确用于描述 all central catadioptric cameras (parabolic, hyperbolic, and elliptical mirror) and standard perspective cameras. 将该模型用于鱼眼相机存在精度有限的问题。为了克服这个问题,一个新的统一模型被提出来。
0.4 Unified model for catadioptric and fisheye cameras
该模型 Scaramuzza et al. in 2006 提出来的。它与上面的模型主要区别在于 函数 g 的选择。为了克服针对鱼眼相机参数模型的知识缺乏。作者提出使用 Taylor polynomial, the relation between the normalized image point ˜ m = (x m ,y m ,1) and the unit vector P s in the fisheye (mirror) reference frame can be written as:
0.5 Omnidirectional camera calibration
这里主要介绍三个 开源的 Matlab 标定程序,which differ mainly for the projection model adopted and the
type of calibration pattern:
1) The toolbox of Mei 使用棋盘格图像标定,使用 Geyer and Daniilidis 的投影模型,该工具箱特征适用于 catadioptric cameras using hyperbolic, parabolic, folded mirrors, and spherical mirrors
2) The toolbox of Barreto 使用直线图像标定,没有使用棋盘格,它也使用 Geyer and Daniilidis 的投影模型,该工具箱特别适用于 parabolic mirrors
3) the toolbox of Scaramuzza 使用棋盘格图像标定,它使用 the unified Taylor model for catadioptric and fisheye cameras,该工具箱适用于 catadioptric cameras using hyperbolic, parabolic, folded mirrors, spherical,and elliptical mirrors. 此外它还使用于市面上大多数鱼眼相机, it works with a wide range of fisheye lenses available on the market — such as Nikon, Sigma, Omnitech-Robotics, and many others — with field of view up to 195 degrees
标定工具:---improvedOcamCalib的使用及标定结果
这个标定工具也是基于Scaramuzza的鱼眼相机标定模型
相关论文:Improved wide-angle, fisheye and omnidirectional camera calibration, 阅读了S的原文和这篇论文,个人觉得这篇论文描述的更加详细清楚;
-
安装:
Download and extract the original toolbox Scaramuzza_OCamCalib_v3.0 from
Davide Scaramuzzas Homepage LinkDownload this repository and copy the content of the src folder to the main directory of ocam_calib.
You should be asked to replace C_calib_data.m and optimizefunction.m -> click yes.
The first file contains additional varibles for statistics.
The second file contains additional code lines to save statistics but is actually not used by the improved toolbox. -
calibration and test:
在执行完成第二步后就会发现improvedOcamCalib文件其实作用已经不大了,接下来就在matlab中运行文件夹Scaramuzza_OCamCalib_v3.0_win中的文件,在matlab张将该文件添加到路径,最好不要添加improvedOcamCalib进入路径,在后面查看函数定义的时候会有一点乱;- Run ocam_calibUrban.m !!! (instead of ocam_calib)
- press (in that order)
- read names
- extract grid corners
- calibration
- non-linear refinement (LM least squares)
or robust non-linear refinement (LM least squares with Huber)
按照这个步骤运行,这中间会遇到交互的问题,主要时参数的设定,如:
EXTRACTION OF THE GRID CORNERS
Do you want to use the automatic image selection
or do you want to process the images individually ( [] = automatic, other = individual )?
这里虽然提示 [] 代表 automatic, 但是直接输入[] 并不会进入自动部分,检查代码时该变量也并不为空,因此,如果想要完全automatic,直接回车即可;
同时也会遇到标定板参数的设定:
Number of squares along the X direction:
Number of squares along the Y direction:
这里需要输入的内环棋盘格方块的个数,即如果我的棋盘格内角点数位6x8, 那么square number 就是5x7 就是不计算最外层方块的个数;因此这里X输入5,Y输入7;
X coordinate (along height) of the omnidirectional image center:x方向的大小,虽然这里提示along height,但是,最主要的要跟上面填入的标定板的方向一致,即6x8对应图像的640x480, 所以这里填入320x240;
How to calibrate all test images/cameras at once
- If not done already,
copy the images from FisheyeDataSets to the ocam_calib folder - Download SampleImages.zip from Davide Scaramuzzas Homepage Link
- Run Step1_perform_test_calibrations.m (this takes quite a while)
(If you want to run it fully automatic with polynomial order 4, go to
calibration.m and comment out line 31) - Compare results with Step2_compare_results.m
附:https://blog.csdn.net/m_zhangJingDong/article/details/78461369
http://blog.csdn.net/hust_sheng/article/details/77976619
https://blog.csdn.net/u011178262/article/details/86656153
————————————————
版权声明:本文为CSDN博主「O天涯海阁O」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/zhangjunhit/article/details/89137958