﻿ 基于改进遗传算法的单目相机标定 Monocular Camera Calibration Based on an Improved Genetic Algorithm

Artificial Intelligence and Robotics Research
Vol.05 No.03(2016), Article ID:18201,10 pages
10.12677/AIRR.2016.53006

Monocular Camera Calibration Based on an Improved Genetic Algorithm

Mengyang Zhang, Ruikang Qin, Fudong Li, Yuequan Yang

Department of Automation, College of Information Engineering, Yangzhou University, Yangzhou Jiangsu

Received: Jul. 23rd, 2016; accepted: Aug. 7th, 2016; published: Aug. 11th, 2016

Copyright © 2016 by authors and Hans Publishers Inc.

This work is licensed under the Creative Commons Attribution International License (CC BY).

http://creativecommons.org/licenses/by/4.0/

ABSTRACT

In the Zhang Zhengyou calibration method, the solution of the camera intrinsic parameters has the drawback of the possibility of falling into local optimal solution. Considering the third order radial distortion and second-order centrifugal distortion of the lens, a scheme based on an improved genetic algorithm is proposed to solve the intrinsic parameters of the monocular camera. The proposed method can significantly increase the precision of the intrinsic parameters and can avoid falling into local optimal solution. Finally, the experiments demonstrate the effectiveness and feasibility of the proposed method.

Keywords:Monocular Camera, Camera Calibration, Corner Point Extraction, Genetic Algorithm

1. 引言

2. 相机成像模型

2.1. 相关坐标系

Figure 1. Coordinates relationship in camera calibration

，横纵坐标为的坐标系，它的横纵坐标单位为像素。另外一个物理坐标系在理想模型下以图像中心为原点，轴分别平行于轴。

(1)

(2)

2.2. 相机标定参数

(3)

(4)

1) 径像畸变的特点是，成像仪中心畸变为零，随着向边缘移动，畸变越来越严重，畸变可以表示为

(5)

2) 切向畸变是由透镜制造上的缺陷和安装时的误差造成的，畸变取为

(6)

3) 薄棱镜畸变是由于相机的镜头并未完全对准或者是相机的光轴并非正交。它可由以下的数学表达式表示为

(7)

(8)

3. 相机内参初值的确定

(9)

(10)

(11)

(12)

(13)

(14)

4. 基于改进遗传算法的内参优化

(15)

(16)

{

Step 1 基于张正友的相机标定算法，确定相机内参种群个体的初值。根据初始值，在一定范围内随机生成N个个体。

Step 2 计算个体的适应度函数值。

Step 3 采用Boltzmann法进行选择操作。使得早期阶段的选择压力较小，较差个体有生存的机会，以保持个体的多样性；随着后期选择压力变大，可缩短搜索邻域以加快优化速度。具体选择策略是，采用Boltzmann法 [15] ，具体选择的概率取为

(17)

Figure 2. Flow diagram of the improved GA

Step 4 按自适应交叉率对选中的两个体的相应基因位进行交叉，由此产生了新的个体。交叉策略是：采用自适应的方法设定交叉率为，使交叉率随着适应度和迭代次数而变化，自适应交叉率取为 [16]

(18)

Step 5采用自适应变异率以选中的个体的某基因位进行变异操作。采用自适应变异率，使变异率随个体适应度函数值和迭代次数变化而作相应变化。自适应变异率取为 [16]

(19)

Step 6 当迭代次数未达到设定的值，且最优值不满足给定的阈值，则转向Step3。

Step7 迭代结束，算法终止。

}//基于改进的遗传算法内参标定算法。

5. 实验

Figure 3. Corner extraction

Figure 4. Projection error with gradient method in the Toolbox

Figure 5. Projection error with GA in the Toolbox

Figure 6. Projection error with the improved GA

Table 1. Initialization of inner parameters

Table 2. Search areas of the improved GA

6. 结论

Monocular Camera Calibration Based on an Improved Genetic Algorithm[J]. 人工智能与机器人研究, 2016, 05(03): 53-62. http://dx.doi.org/10.12677/AIRR.2016.53006

1. 1. 庄光明, 崔建伟, 彭作祥. 基于双目定位原理的系统标定算法[J]. 计算机工程与应用, 2010, 46(8): 45-47.

2. 2. 姚楠. 基于单目视觉的运动目标跟踪定位技术研究[D]: [博士学位论文]. 上海: 上海交通大学, 2014.

3. 3. 朱枫, 何雷, 郝颖明. 视觉位姿测量中单目视觉与双目立体视觉测量精度比较[J]. 仪器仪表学报, 2007, 28(4): 165-169.

4. 4. Ulrich, M. (2003) Hierarchical Real-Time Recognition of Compound Objects in Images. Fakultät für Bauingenieur- und Vermessungswesen, Technische Universität München, Deutsche Geodätische Kommision, Reihe C, Heft Nr. 568, München. Ph.D. Thesis, Germany.

5. 5. Tsai, R. (1986) An Efficient and Accurate Camera Calibration Technique for 3D Machine Vision. Proceeding of Computer Vision and Pattern Recognition, Miami Beach, 22-26 June 1986, 364-374.

6. 6. Zhang, Z.Y. (1999) Flexible Camera Calibration by Viewing a Plane from Unknown Orientations. Proceeding of the 7th International Conference on Computer Vision, Kerkyra, 20 September-27 September 1999, 666-673. http://dx.doi.org/10.1109/iccv.1999.791289

7. 7. Hartley, R. (1997) Self-Calibration of Stationary Cameras. International Journal of Computer Vision, 22, 5-23. http://dx.doi.org/10.1023/A:1007957826135

8. 8. 冯春. 基于单目视觉的目标识别与定位研究[D]: [博士学位论文]. 南京: 南京航空航天大学, 2013.

9. 9. 祝海江, 李仕刚. 基于2D模板余3D包围式标定块的鱼眼相机标定[J]. 仪器仪表学报, 2008, 29(7): 1512-1516.

10. 10. 龚俊斌, 田金文. 基于二次曲线的线阵相机标定技术[J]. 计算机工程学报, 2013, 39(1): 283-286.

11. 11. 夏瑞雪, 卢荣胜, 刘宁, 等. 基于圆点阵列靶标的特征点坐标自动提取方法[J]. 中国机械工程, 2010, 21(16): 1906-1910.

12. 12. 李龙, 何明, 李娜. 椭圆拟合的圆环模板摄像机标定[J]. 西安电子科技大学学报, 2010, 37(6): 1148-1154.

13. 13. Zhang, Z. (2000) A Flexible New Technique for Camera Calibration. IEEE Transactions on Pattern Analysis and Machine Intelligence, 22, 1330-1334. http://dx.doi.org/10.1109/34.888718

14. 14. 郑全新. 基于单目视觉的目标识别与定位[D]: [硕士学位论文]. 济南: 山东大学, 2013.

15. 15. 李敏强, 寇纪淞, 林丹, 等. 遗传算法的基本理论与应用[M]. 北京: 科学出版社, 2002: 35-39.

16. 16. Srinvivas, M. and Patnaik, L.M. (1994) Adaptive Probabilities of Crossover and Mutation in Genetic Algorithms. IEEE Transaction on Systems, Man, and Cybernetics, 24, 656-657. http://dx.doi.org/10.1109/21.286385