基于平行面多靶标标定的单目大视场平面测量 下载: 815次
ing at the problem of inconvenient placement of a target in the measuring plane and the difficulty of making a large-scale target in wide-area monocular plane measurement system, a method of calibrating with small-size plane targets laid on a parallel plane is proposed. A parallel plane is selected as a calibration plane, a single small-size plane target is placed reasonably in a plurality of positions on the calibration plane for shooting, and a large-scale plane target is constructed by combining the photos and the nonlinear optimization method is used to complete the optimization of the internal and external parameters of the camera. Combining with the parallel constraint and the distance parameter, the homography matrix between the measuring plane and the image plane is obtained and then the wide-area plane measurement is realized. The precision model of plane measurement is established, and the distribution of precision in the measuring area and the factors influencing measurement precision such as the internal parameters, the installation angle and height of the camera are analyzed theoretically and experimentally. The experimental results show that the proposed method can effectively guarantee the overall measurement precision. In the calibration in a trapezoidal visual field with an upper line of 920 mm, a lower line of 1360 mm and height of 920 mm, the measurement error is lower than 0.6% in the measuring plane away from the calibration plane 200 mm. The distribution of errors in the measuring area is consistent with that of the precision model. This method is fully applicable to the wide-area plane measurement.
1 引言
单目视觉测量具有非接触、视场大、精度高和成本低等优点[1-4],越来越多地应用于大尺寸平面目标的二维测量[5-6]。目前单目大视场平面测量主要存在以下问题:1) 测量平面内难以布置平面靶标进行摄像机标定;2) 视场范围大,采用小尺寸平面靶标标定精度低,而大尺寸平面靶标又难以加工;3) 摄像机倾斜安装,图像平面与测量平面不平行,测量范围内各处测量精度不同。
为了解决测量平面内难以布置靶标的问题,刘昶[7]采用双平面相机模型,将平面靶标放置在与测量平面平行且距离已知的两个平面上进行标定,该方法须在两个平面上布置靶标。张振等[6]在单应矩阵中引入高度参数,实现不同高度平面的二维测量,此方法要求在三维空间内布置控制点。
针对大视场测量的标定问题,文献[ 8-10]进行了深入的研究,提出采用多个小靶标拟合大靶标的方法,然而该方法针对三维视觉的摄像机标定问题。李为民等[11]采用多项式拟合摄像机模型,提出一种大视场差分标定方法,此方法要求各子靶标之间保持平行。方勇纯等[12]将多个小尺寸平面靶标铺设在平面上,融合各个靶标的单应矩阵得到整个视场的全局单应矩阵,实现大视场平面测量,但是该方法未考虑摄像机畸变。
在平面测量时,一般采用图像平面与测量平面平行的安装形式。在这种情况下,待测物的世界坐标与图像坐标仅差一个放大倍数[1],测量平面内各位置的测量精度基本相同。然而在大部分测量场合,难以满足平行安装条件,从而导致测量平面内各位置的测量精度不同。张振等[6]利用数值模拟的方式深入分析了相机安装角度对平面测量分辨率的影响,然而未建立平面测量的精度模型。
针对单目大视场平面测量存在的问题,本文提出一种将小尺寸平面靶标放置在测量平面的平行面上进行标定的方法。将小尺寸平面靶标放置在平行面上的多个位置进行拍摄,并整合成一个大尺寸平面靶标。该方法仅设置一个平行面用于布置小尺寸平面靶标,相比双平行平面标定法[7,12]减少了一个平面,相比基于变高单应的方法[6]无需在三维空间布置控制点。对于图像平面与测量平面不平行的情况,建立平面测量的精度模型,对测量区域内各处精度的分布和影响精度的因素进行了分析。
2 测量原理
2.1 摄像机模型
如
式中
式中
由于加工制造等原因,实际的镜头并非理想的透视成像,而是存在一定的径向畸变和切向畸变[13]。一般情况下,切向畸变较小[14],本文予以忽略,仅考虑二阶径向畸变。记(
式中
2.2 基于单应的平面测量原理
在进行平面测量时,将测量坐标系
记单应矩阵为
(5)式定义了测量平面到图像平面的可逆齐次变换[15]。若单应矩阵
由(6)式可知,平面测量的关键是标定出测量平面与图像平面之间的单应矩阵
2.3 平面测量步骤
在摄像机内参
1) 拍摄测量平面上的待测物,利用图像处理算法,如尺度不变特征变换(SIFT)角点提取算法,从图像中提取待测物关键点带畸变的图像坐标
2) 采用Levenberg-Marquardt法求解非线性方程组(3)式,获得畸变矫正后的图像坐标(
3) 根据(6)式,利用单应矩阵计算出待测物关键点在测量坐标系下的二维齐次坐标
3 标定原理
针对测量平面
3.1 构建大尺寸平面靶标
首先,对摄像机内参进行预先标定。将小靶标放置在摄像机的近场区域,尽量使拍摄到的小靶标能够充满整个图幅。在不同的相对位置下,拍摄多幅图像,采用张氏法[16]标定出摄像机内参
在标定出摄像机内参之后,如
将(7)式写成分量形式为
由于所有位置的小靶标共面,理论上各个小靶标坐标系
式中
记第
由(10)式将所有位置小靶标的特征点统一至标定坐标系
3.2 摄像机内外参的非线性优化
根据以上分析,结合(1)式,可得第
式中
式中
3.3 求解测量平面到图像平面的单应矩阵
建立测量坐标系
由此得到测量平面到图像平面的单应矩阵
4 平面测量精度分析
4.1 精度模型
如
对(14)式求偏导,可得
假设
总体测量精度为
4.2 精度模型分析
由(15)~(19)式可知,平面测量精度的影响因素有:像素坐标提取精度
由(15)、(16)式可知,摄像机等效焦距
为便于精度分析,将一组参数代入(17)~(19)式,如
表 1. 精度分析参数
Table 1. Parameters for precision analysis
|
图 4. (a)测量区域内不同位置的测量精度分布;(b) yM=-500 mm时,测量精度随xM的分布;(c) xM=0 mm时,测量精度随yM的分布
Fig. 4. (a) Distribution of measurement precision of different positions in the measuring area; (b) distribution of measurement precision versus xM, when yM=-500 mm; (c) distribution of measurement precision versus yM, when xM=0 mm
根据精度模型(17)~(19)式较难看出摄像机安装角度
综上所述,为了获取较高的测量精度,应选用长焦距高分辨率摄像机、使摄像机图像平面与测量平面平行、降低安装高度,但是这样会导致测量区域变小。在工程测量中,应根据实际需求妥善处理测量区域大小与测量精度的关系。
5 实验与结果分析
采用的摄像机图像分辨率为4032 pixel×3024 pixel,像素物理尺寸为1.22 μm,镜头焦距为4 mm。如
5.1 标定实验
按照3.1节所述方法,对摄像机进行预标定,获得摄像机内参为
为了对比标定效果,分别进行两组实验。第一组实验按照
5.2 精度测量实验
图 8. 精度测量实验示意图。(a)测量平面;(b)小靶标摆放位置;(c)小靶标特征点间距
Fig. 8. Schematic of precision measurement experiment. (a) Measuring planes; (b) positions of small targets; (c) feature point intervals of a small target
相对测量误差为
由每个测量平面上9个位置的小靶标,可得9组测量误差。这9组测量误差实际表征了测量区域内9个位置的测量误差。根据以上方法,在各测量平面上,分别利用多靶标和单靶标方法获得标定参数,并测量各平面上9个位置的测量误差。
实际上,5.1节利用单靶标方法标定时,分别单独采用了
图 9. 0 mm平面内各位置测量误差。(a)绝对误差;(b)相对误差
Fig. 9. Measurement error of different positions on 0 mm plane. (a) Absolute error; (b) relative error
图 10. 100 mm平面内各位置测量误差。(a)绝对误差;(b)相对误差
Fig. 10. Measurement error of different positions on 100 mm plane. (a) Absolute error; (b) relative error
图 11. 200 mm平面内各位置测量误差。(a)绝对误差;(b)相对误差
Fig. 11. Measurement error of different positions on 200 mm plane. (a) Absolute error; (b) relative error
计算一个测量平面上9个位置测量误差的平均值和最大值,将其作为该测量平面的平均和最大测量误差,称之为该平面的整体测量误差。对于多靶标方法,绘制各测量平面整体测量误差如
图 12. 采用多靶标方法获得的各测量平面整体测量误差与距离的关系。(a)绝对误差;(b)相对误差
Fig. 12. Relationship between total measurement error and distance of different planes using multi-target method. (a) Absolute error; (b) relative error
图 13. 采用多靶标方法获得的各测量平面内测量误差分布。(a)绝对误差;(b)相对误差
Fig. 13. Measurement error distribution of different planes using multi-target method. (a) Absolute error; (b) relative error
小靶标在摆放时
(22)式可以表示该小靶标位置
(23)式可以表示该小靶标位置
图 14. 50 mm平面内不同位置XM轴和YM轴的误差。(a)绝对误差;(b)相对误差
Fig. 14. Error of XM and YM axes in different positions on the 50 mm plane. (a) Absolute error; (b) relative error
6 结论
提出了一种基于平行面多靶标标定的单目大视场平面测量方法,在测量平面的平行面上的多个位置布置并拍摄一个小尺寸平面靶标,利用平面约束关系将多个位置的小尺寸平面靶标转化成一个大尺寸平面靶标,用于摄像机内、外参的优化求解,结合测量平面到标定平面的平行关系和距离约束获得测量平面到图像平面的单应矩阵,从而实现大视场平面测量。同时,建立了平面测量的精度模型,对测量区域各位置精度的分布以及影响平面测量精度的因素进行了理论分析和实验验证。实验结果表明,本文方法具有较高的整体测量精度,所建精度模型的误差分布与通过实验获得的误差分布一致。对于一般工业应用,与基于变高单应的方法[6]相比,该方法无须布置三维控制点,只需一幅小尺寸靶标,标定装置简单、成本低。相对基于全局单应的方法[12],该方法只须一个标定平面,减少了一个平面或省去了移动摄像机;同时,引入了相机畸变参数,提高了测量精度。但是,为了保证精度,该方法须要对摄像机进行预标定,并要求所有小靶标共面。本文模型可用于指导摄像机的选取、安装和待测物体的摆放等工作。该方法解决了测量平面内难以布置靶标以及大视场测量时高精度大尺寸靶标制造困难的问题,可广泛应用于单目大视场平面测量。
[1] 黄桂平, 李广云, 王保丰, 等. 单目视觉测量技术研究[J]. 计量学报, 2004, 25(4): 314-317.
黄桂平, 李广云, 王保丰, 等. 单目视觉测量技术研究[J]. 计量学报, 2004, 25(4): 314-317.
Huang Guiping, Li Guangyun, Wang Baofeng, et al. Evolution for monocular vision measurement[J]. Acta Metrologica Sinica, 2004, 25(4): 314-317.
Huang Guiping, Li Guangyun, Wang Baofeng, et al. Evolution for monocular vision measurement[J]. Acta Metrologica Sinica, 2004, 25(4): 314-317.
[2] 邾继贵, 李艳军, 叶声华, 等. 单摄像机虚拟立体视觉测量技术研究[J]. 光学学报, 2005, 25(7): 943-948.
邾继贵, 李艳军, 叶声华, 等. 单摄像机虚拟立体视觉测量技术研究[J]. 光学学报, 2005, 25(7): 943-948.
[3] 王保丰, 李广云, 王红明, 等. 单相机几何量检测新方法[J]. 仪器仪表学报, 2008, 29(3): 589-593.
王保丰, 李广云, 王红明, 等. 单相机几何量检测新方法[J]. 仪器仪表学报, 2008, 29(3): 589-593.
Wang Baofeng, Li Guangyun, Wang Hongming, et al. New method for geometrical shape acquisition using single camera[J]. Chinese Journal of Scientific Instrument, 2008, 29(3): 589-593.
Wang Baofeng, Li Guangyun, Wang Hongming, et al. New method for geometrical shape acquisition using single camera[J]. Chinese Journal of Scientific Instrument, 2008, 29(3): 589-593.
[4] 刘学军, 王美珍, 甄艳, 等. 单幅图像几何量测研究进展[J]. 武汉大学学报信息科学版, 2011, 36(8): 941-947.
刘学军, 王美珍, 甄艳, 等. 单幅图像几何量测研究进展[J]. 武汉大学学报信息科学版, 2011, 36(8): 941-947.
Liu Xuejun, Wang Meizhen, Zhen Yan, et al. Geometric measurement based on single image: a survey[J]. Geomatics and Information Science of Wuhan University, 2011, 36(8): 941-947.
Liu Xuejun, Wang Meizhen, Zhen Yan, et al. Geometric measurement based on single image: a survey[J]. Geomatics and Information Science of Wuhan University, 2011, 36(8): 941-947.
[5] 刘昶, 韦飞云, 孙维广. 基于双平行平面相机模型的钢板尺寸视觉测量[J]. 光学精密工程, 2016, 24(4): 714-725.
刘昶, 韦飞云, 孙维广. 基于双平行平面相机模型的钢板尺寸视觉测量[J]. 光学精密工程, 2016, 24(4): 714-725.
[6] 张振, 徐枫, 沈洁, 等. 基于变高单应的单目视觉平面测量方法[J]. 仪器仪表学报, 2014, 35(8): 1860-1868.
张振, 徐枫, 沈洁, 等. 基于变高单应的单目视觉平面测量方法[J]. 仪器仪表学报, 2014, 35(8): 1860-1868.
Zhang Zhen, Xu Feng, Shen Jie, et al. Plane measurement method with monocular vision based on variable-height homography[J]. Chinese Journal of Scientific Instrument, 2014, 35(8): 1860-1868.
Zhang Zhen, Xu Feng, Shen Jie, et al. Plane measurement method with monocular vision based on variable-height homography[J]. Chinese Journal of Scientific Instrument, 2014, 35(8): 1860-1868.
[7] 刘昶. 二维目标视觉测量的双平行平面标定[J]. 光学学报, 2013, 33(11): 1115004.
刘昶. 二维目标视觉测量的双平行平面标定[J]. 光学学报, 2013, 33(11): 1115004.
[8] 孙军华, 刘震, 张广军, 等. 基于柔性立体靶标的摄像机标定[J]. 光学学报, 2009, 29(12): 3433-3439.
孙军华, 刘震, 张广军, 等. 基于柔性立体靶标的摄像机标定[J]. 光学学报, 2009, 29(12): 3433-3439.
[9] 杨博文, 张丽艳, 叶南, 等. 面向大视场视觉测量的摄像机标定技术[J]. 光学学报, 2012, 32(9): 0915001.
杨博文, 张丽艳, 叶南, 等. 面向大视场视觉测量的摄像机标定技术[J]. 光学学报, 2012, 32(9): 0915001.
[10] 霍炬, 杨宁, 杨明, 等. 基于小靶标拼接的大视场摄像机标定方法[J]. 红外与激光工程, 2013, 42(6): 1474-1479.
霍炬, 杨宁, 杨明, 等. 基于小靶标拼接的大视场摄像机标定方法[J]. 红外与激光工程, 2013, 42(6): 1474-1479.
Huo Ju, Yang Ning, Yang Ming, et al. Calibration of camera with wide field-of-view based on spliced small targets[J]. Infrared and Laser Engineering, 2013, 42(6): 1474-1479.
Huo Ju, Yang Ning, Yang Ming, et al. Calibration of camera with wide field-of-view based on spliced small targets[J]. Infrared and Laser Engineering, 2013, 42(6): 1474-1479.
[11] 李为民, 俞巧云, 刘超. 采用分离式差分标定靶的单摄像机标定方法[J]. 光学学报, 2006, 26(5): 697-701.
李为民, 俞巧云, 刘超. 采用分离式差分标定靶的单摄像机标定方法[J]. 光学学报, 2006, 26(5): 697-701.
[12] 方勇纯, 张雪波, 王聪媛, 等. 基于全局单应矩阵的单目视觉测量方法: CN104616292A[P].2015-5-13.
方勇纯, 张雪波, 王聪媛, 等. 基于全局单应矩阵的单目视觉测量方法: CN104616292A[P].2015-5-13.
FangYongchun, ZhangXuebo, WangCongyuan, et al. Monocular vision measurement method based on global homography matrix: CN104616292A[P]. 2015-5-13.
FangYongchun, ZhangXuebo, WangCongyuan, et al. Monocular vision measurement method based on global homography matrix: CN104616292A[P]. 2015-5-13.
[13] 张广军. 视觉测量[M]. 北京: 科学出版社, 2008: 33- 36.
张广军. 视觉测量[M]. 北京: 科学出版社, 2008: 33- 36.
ZhangGuangjun. Vision measurement[M]. Beijing: Science Press, 2008: 33- 36.
ZhangGuangjun. Vision measurement[M]. Beijing: Science Press, 2008: 33- 36.
[14] Wei G Q, De Ma S. Implicit and explicit camera calibration: theory and experiments[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 1994, 16(5): 469-480.
Wei G Q, De Ma S. Implicit and explicit camera calibration: theory and experiments[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 1994, 16(5): 469-480.
[15] 曾慧, 邓小明, 赵训坡, 等. 基于线对应的单应矩阵估计及其在视觉测量中的应用[J]. 自动化学报, 2007, 33(5): 449-455.
曾慧, 邓小明, 赵训坡, 等. 基于线对应的单应矩阵估计及其在视觉测量中的应用[J]. 自动化学报, 2007, 33(5): 449-455.
Zeng Hui, Deng Xiaoming, Zhao Xunpo, et al. Line-based homography estimation and its application in visual metrology[J]. Acta Automatica Sinica, 2007, 33(5): 449-455.
Zeng Hui, Deng Xiaoming, Zhao Xunpo, et al. Line-based homography estimation and its application in visual metrology[J]. Acta Automatica Sinica, 2007, 33(5): 449-455.
[16] Zhang Z. A flexible new technique for camera calibration[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2000, 22(11): 1330-1334.
Zhang Z. A flexible new technique for camera calibration[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2000, 22(11): 1330-1334.
[17] HartleyR, ZissermanA. Multiple view geometry in computer vision second edition[M]. Cambridge: Cambridge University Press, 2003: 88- 90.
HartleyR, ZissermanA. Multiple view geometry in computer vision second edition[M]. Cambridge: Cambridge University Press, 2003: 88- 90.
Article Outline
杨东升, 毕树生, 蔡月日, 袁畅. 基于平行面多靶标标定的单目大视场平面测量[J]. 光学学报, 2017, 37(10): 1015001. Dongsheng Yang, Shusheng Bi, Yueri Cai, Chang Yuan. Wide-Area Monocular Plane Measurement Based on Calibration on a Parallel Plane Using Multiple Targets[J]. Acta Optica Sinica, 2017, 37(10): 1015001.