摘要
针对工业大视场物镜畸变成像的实时校正问题,提出一种校正算法和CPU+GPU并行加速方案.根据光学畸变理论和相机标定技术,建立非球面畸变校正模型.利用棋盘样板计算光学中心和估计畸变系数,设计校正算法.在CPU+GPU并行加速方案基础上,设计内核自适应维度算法并优化运行程序,结合OPENGL驱动进行实时校正和显示.实验结果表明,本文设计的实时校正系统对高分辨率的畸变成像校正率可以达到98.2%,单帧耗时0.026 s,平均综合加速比为29.1.该系统精度高,可移植性强,简单易行,能够广泛应用于成像畸变的实时校正.
To solve the real-time imaging distortion correction problem of industrial wide-field objective lens,a correction algorithm and CPU + GPU parallel acceleration scheme was proposed. Firstly,a distortion correction model of aspheric surface is established according to the optical distortion theory and the camera calibration technology. Secondly,a correction algorithm is designed by using optical center and estimating distortion coefficients. Finally,based on the CPU + GPU hybrid acceleration platform,the kernel adaptive dimension algorithm is designed and the optimized running program is proposed,combined with Open GL driver for realtime correction and displaying. The experimental results show that the real-time correction system can achieve a correction rate of 98. 2%,single frame time-consuming of 0. 026 s,the average overall speedup of 29. 1 for high resolution distortion imaging. The imaging system is higher precision,transplantable and more simple,and can be widely used in the real-time imaging distortion correction.
引文
[1]WANG Ke-na.ZHOU Bei-ji,HUANG Wen-mei.A distorted image correction method based on neural networks[J].Journal of Image and Graphics,2005,10(5):603-607.王珂娜,邹北骥,黄文梅.一种基于神经网络的畸变图像校正方法[J].中国图象图形学报,2005,10(5):603-607.
[2]LAN Hai-bing,WANG Ping,LONG Teng.Nonlinear aberration correction of lens in image mosaic[J].Optics and Precision Engineering,2009,17(5):1196-1202.兰海滨,王平,龙腾.图像拼接中相机镜头非线性畸变的校正[J].光学精密工程,2009,17(5):1196-1202.
[3]MA Guang-bing,ZHANG Weng-yi,CHEN Fu.Study on image accurate geometric correction[J].Computer Engineering and Applications,2007,43(9):45-48.马广彬,章文毅,陈甫.图像几何畸变精校正研究[J].计算机工程与应用,2007,43(9):45-48.
[4]ZHU Hai-jiang,XU Xiao-bong,ZHOU Jing-lin.Fisheye image matching based on rotation matrix under spherical perspective projection[J].Acta Optica Sinica,2013,33(2):122-129.祝海江,徐晓波,周靖林.基于球面透视投影旋转矩阵的鱼眼图像匹配[J].光学学报,2013,33(2):122-129.
[5]MILANI P,PEDERSINI F.A DSP multiprocessor architecture for live camera calibration[C].International Workshop on Image Analysis for Multimedia Interactive Services Wiamis,IEEE,2010:1-4.
[6]ZHAO X,LUO Q,HAN B,et al.An image distortion correction algorithm based on quadrilateral fractal approach controlling points[J].Opto-Electronic Engineering,2009,36(5):2676-2681.
[7]DING Ying,LI Wen-hui,FAN Jing-tao,et al.Real-time calibration algorithm of distortion of wide-field view based on GPU[J].Journal of Jilin University(Engineering and Technology Edition),2010,40(1):189-194.丁莹,李文辉,范静涛,等.基于GPU的大视场景物畸变实时校正算法[J].吉林大学学报(工),2010,40(1):189-194.
[8]KIM W.An efficient correction method of wide-angle lens distortion for surveillance systems[C].IEEE International Symposium on Circuits and Systems,IEEE,2009:3206-3209.
[9]SMITH P W,JOHNSON K B,ABIDI M A.Efficient techniques for wide-angle stereo vision using surface projection models[C].IEEE Conference on Computer Vision and Pattern Recognition,1999,6(1):113-118.
[10]CAPPUCCIO F P,STRAZZULLO P,MANCINI M.Straight lines have to be straight:automatic calibration and removal of distortion from scenes of structured enviroments[M].Springer-Verlag New York,Inc.2001:14-24.
[11]ZHANG Z.Flexible camera calibration by viewing a plane from unknown orientations[C].The Proceedings of the Seventh IEEE International Conference on Computer Vision,IEEE,2002:666-673.
[12]ZHANG Shu,CHU Yan-li.GPU high performance computing of CUDA[M].China Water&Power Press,2009:141-189.张舒,褚艳利.GPU高性能运算之CUDA[M].北京:中国水利水电出版社,2009:141-189.
[13]HU Ming-yong,LI Ming-jie,ZHAO Qi,et al.Designand imaging distortion correction of pin-hole objective lens with large field[J].Acta Optica Sinica,2017(5):274-280.胡明勇,李明杰,赵奇,等.大视场针孔物镜设计及成像畸变校正[J].光学学报,2017(5):274-280.
[14]YANG Qiu-hui,YU Hao-xing,LI Tao-shen,et al.A distortion correction method for large field-of-view lens[J].Computer Applications and Software,2015(9):136-140.杨秋慧,玉昊昕,李陶深,等.一种大视场镜头的畸变校正方法[J].计算机应用与软件,2015(9):136-140.
[15]YAO Na,LIN Zhao-rong,REN Chao-feng,et at.A distortion model suitable for nonlinear distortion correction of digital video camera[J].Laser&Optoelectronics Progress,2017,51(2):167-174.姚娜,林招荣,任超锋,等.一种适合摄像机非线性畸变校正的畸变模型[J].激光与光电子学进展,2014,51(2):167-174.
[16]HAN Guang-liang,SONG Jian-zhong.An equivalent surface model of image distortion and the correction algorithm[J].Optical Technique,2005,31(1):122-124.韩广良,宋建中.一种基于畸变等效曲面的图像畸变校正[J].光学技术,2005,31(1):122-124.
[17]MILANI P,PEDERSINI F.A DSP multiprocessor architecture for live camera calibration[C].International Workshop on Image Analysis for Multimedia Interactive Services Wiamis,IEEE,2010:1-4.
[18]BAO Xue-jing,DAI Shi-jie,GUO Cheng,et al.Nonlinear distortion image correction from confocal microscope based on interpolation[J].Infrared and Laser Engineering,2017,46(11):1103006.鲍雪晶,戴仕杰,郭澄,等.基于插值的共焦显微镜非线性畸变失真图像校正[J].红外与激光工程,2017,46(11):1103006.
[19]RUI M,BARRETO J P,FALCAO G.A new solution for camera calibration and real-time image distortion correction in medical endoscopy-initial technical evaluation[J].IEEE Transactions on Biomedical Engineering,2012,59(3):634-644.