﻿ 基于单应性矩阵的线结构光系统简易标定方法
 光电工程  2019, Vol. 46 Issue (12): 180677      DOI: 10.12086/oee.2019.180677

An easy line-structured light system calibration method based on homography matrix
Ping Yishan, Liu Yuankun
School of Electronics and Information Engineering, Sichuan University, Chengdu, Sichuan 610065, China
Abstract: An easy line-structured light system calibration method is proposed, which is based on the constructed light plane and homography matrix. In this method, the sequential images of the light plane and calibration target are obtained at different positions by shifting a translating target plane within the depth of camera's field, then a series of feature points would be extracted from these images to form a light plane. Then, a homography matrix, which is the mapping relationship between the light plane and the image plane of camera, can be calculated. In the experiment, the 3D data can be obtained by using this homography matrix when image coordinates of the light plane are extracted in an arbitrary image. Then the entire object can be measured by using a translation device. For the real data of calibration, the maximum residual error is less than 0.05 mm, standard deviation is less than 0.02 mm, the relative error of the measured distance between the two planes is less than 1.3%. The proposed method can make the entire calibration process easy and flexible to use.
Keywords: machine vision    line-structured light    homography matrix    calibration    light plane

1 引言

2 原理 2.1 线结构光系统标定

 图 1 线结构光传感器数学模型 Fig. 1 Mathematic model of line-structured light sensor

 $s\left[ {\begin{array}{*{20}{c}} {{u_i}} \\ {{v_i}} \\ 1 \end{array}} \right] = {\mathit{\pmb{A}}}({\mathit{\pmb{R}}}\;\, {\mathit{\pmb{t}}})\left[ {\begin{array}{*{20}{c}} {{X_{wi}}} \\ {{Y_{wi}}} \\ {{Z_{wi}}} \\ 1 \end{array}} \right],$ (1)

 ${\mathit{\pmb{A}}} = \left[ {\begin{array}{*{20}{c}} {{f_x}}&\gamma &{{u_0}} \\ 0&{{f_y}}&{{v_0}} \\ 0&0&1 \end{array}} \right],$ (2)
 ${\mathit{\pmb{R}}} = [\begin{array}{*{20}{c}} {{{\mathit{\pmb{r}}}_{\rm{1}}}}&{{{\mathit{\pmb{r}}}_{\rm{2}}}}&{{{\mathit{\pmb{r}}}_{\rm{3}}}} \end{array}],$ (3)

 $s\left[ {\begin{array}{*{20}{c}} {{u_i}} \\ {{v_i}} \\ 1 \end{array}} \right] = {\mathit{\pmb{A}}}\left[ {\begin{array}{*{20}{c}} {{\mathit{\pmb{r}}_1}}&{{\mathit{\pmb{r}}_2}}&{{\mathit{\pmb{r}}_3}}&t \end{array}} \right] \cdot \left[ {\begin{array}{*{20}{c}} {{X_{{\rm{w}}i}}} \\ {{Y_{{\rm{w}}i}}} \\ {{Z_{{\rm{w}}i}}} \\ 1 \end{array}} \right]。$ (4)

 $s\left[ {\begin{array}{*{20}{c}} {{u_i}} \\ {{v_i}} \\ 1 \end{array}} \right] = {\mathit{\pmb{A}}}\left[ {\begin{array}{*{20}{c}} {{{\mathit{\pmb{r}}}_1}}&{{{\mathit{\pmb{r}}}_2}}&{{{\mathit{\pmb{r}}}_3}}&t \end{array}} \right]\left[ {\begin{array}{*{20}{c}} {{X_{{\rm{w}}i}}} \\ 0 \\ {{Z_{{\rm{w}}i}}} \\ 1 \end{array}} \right]\\ \;\;\;\;\;\;\;\;\;\;\;\; {\rm{ = }}{\mathit{\pmb{A}}}\left[ {\begin{array}{*{20}{c}} {{{\mathit{\pmb{r}}}_1}}&{{{\mathit{\pmb{r}}}_3}}&{\mathit{\pmb{t}}} \end{array}} \right]\left[ {\begin{array}{*{20}{c}} {{X_{{\rm{w}}i}}} \\ {{Z_{{\rm{w}}i}}} \\ 1 \end{array}} \right],$ (5)

 $s\tilde {\mathit{\pmb{m}}} = {\mathit{\pmb{H}}}\tilde {\mathit{\pmb{M}}},$ (6)

2.2 线结构光系统测量

 $\left\{ \begin{gathered} {X_{{\rm{w}}i}}{\rm{ = }}\frac{{{u_i}{h_{11}} + {v_i}{h_{12}} + {h_{13}}}}{{{u_i}{h_{31}} + {v_i}{h_{32}} + {h_{33}}}} \\ {Z_{{\rm{w}}i}}{\rm{ = }}\frac{{{u_i}{h_{21}} + {v_i}{h_{22}} + {h_{23}}}}{{{u_i}{h_{31}} + {v_i}{h_{32}} + {h_{33}}}} \\ \end{gathered} \right.。$ (7)

3 实验与结果分析

 图 2 线结构光三维测量系统 Fig. 2 Line-structured light three-dimension measurement system
3.1 标定靶设计及标定实验

 图 3 线结构光系统标定实验流程图 Fig. 3 The process for calibration of line-structured light system

 $\left\{ \begin{gathered} y = ax + b \\ y = cx + d \\ \end{gathered} \right.。$ (8)
 图 4 图像处理。(a)相机捕获的光刀图像；(b)角点提取；(c)特征点提取 Fig. 4 Image processing. (a) Image of light strip captured by CCD; (b) Corner points extraction; (c) Characteristic points extraction

 图 5 特征点图 Fig. 5 Image of characteristic point

 ${\mathit{\pmb{H}}} = \left[ \begin{gathered} {\rm{ - 0}}{\rm{.0102\;\;\;\;- 3}}{\rm{.1817\;\;\;793}}{\rm{.3240}} \\ {\rm{ 4}}{\rm{.9858\;\;\;\;- 0}}{\rm{.7313\;\;\;172}}{\rm{.6058}} \\ {\rm{ 0}}{\rm{.0000\;\;\;\;- 0}}{\rm{.0013\;\;\;\;1}}{\rm{.0000}} \\ \end{gathered} \right]。$

 Methods The proposed method Ref.[20] Directions Xw direction Zw direction Xw direction Zw direction Maximum residual error/mm 0.0373 0.0416 0.0533 0.0385 Standard deviation/mm 0.0199 0.0197 0.0196 0.0239

 图 6 误差分布。(a)本文提出的方法；(b)文献[20]的方法 Fig. 6 Error distribution. (a) The proposed method; (b) The method of Ref. [20]

3.2 测量实验

 图 7 三维阶梯实物及测量结果。(a)三维阶梯标准件；(b)采用本文提出的方法恢复物体三维形貌 Fig. 7 3D shape of the stepped object. (a) Workpiece of stepped object; (b) Restored result using the proposed method

 Step No. 1 2 3 4 5 RMS error/mm 0.0481 0.0507 0.0544 0.057 0.0632

 Distance/mm Reference distance/mm Calculated dis-tance/mm Relative error/% d12 20 19.7499 1.25 d13 40 39.6151 0.96 d14 60 59.4493 0.92 d15 80 79.2831 0.90 d23 20 19.8481 0.76 d24 40 39.6655 0.84 d25 60 59.4820 0.86 d34 20 19.5776 1.05 d35 40 39.5776 1.06 d45 20 19.8218 0.89

5 结论

 [1] Chen F, Brown G M, Song M M. Overview of three-dimensional shape measurement using optical methods[J]. Optical Engineering, 2000, 39(1): 10-22. [Crossref] [2] Li Y H, Zhou J B, Liu L J. Research progress of the line structured light measurement technique[J]. Journal of Hebei University of Science and Technology, 2018, 39(2): 115-124. 李玥华, 周京博, 刘利剑. 线结构光测量技术研究进展[J]. 河北科技大学学报, 2018, 39(2): 115-124 [Crossref] [3] Huang Z H, Luo Z, Li S, et al. Calibration method of large-arrange small-angle laser triangulation measuring system[J]. Opto-Electronic Engineering, 2012, 39(7): 26-30. 黄战华, 罗曾, 李莎, 等. 激光三角法大量程小夹角位移测量系统的标定方法研究[J]. 光电工程, 2012, 39(7): 26-30 [Crossref] [4] Huang Q, Wang Z Y, Li J L, et al. Automatic recognition of bolts on locomotive running gear based on laser scanner 3D measurement[J]. Opto-Electronic Engineering, 2018, 45(1): 170532. 黄潜, 王泽勇, 李金龙, 等. 基于三维扫描的机车走行部螺栓识别与定位[J]. 光电工程, 2018, 45(1): 170532 [Crossref] [5] Wu K H, Wang W J. Detection method of obstacle for plant protection UAV based on structured light vision[J]. Opto-Electronic Engineering, 2018, 45(4): 170613. 吴开华, 王文杰. 植保无人机结构光视觉的障碍物检测方法[J]. 光电工程, 2018, 45(4): 170613 [Crossref] [6] Wei Z Z, Li C Q, Ding B S. Line structured light vision sensor calibration using parallel straight lines features[J]. Optik, 2014, 125(17): 4990-4997. [Crossref] [7] Yang H, Cai N, Lin B, et al. Camera calibration method based on phase encoding for out-of-focus condition[J]. Opto-Electronic Engineering, 2018, 45(7): 180100. 杨浩, 蔡宁, 林斌, 等. 适用于离焦状态相机的相位编码标定方法[J]. 光电工程, 2018, 45(7): 180100 [Crossref] [8] Zhang Z Y. A flexible new technique for camera calibration[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2000, 22(11): 1330-1334. [Crossref] [9] Cui X M, Li C, Yuan D B, et al. Calibration of a line structured light vision measuring system based on the drawing method[J]. Science & Technology Review, 2014, 32(24): 64-67. 崔希民, 李聪, 袁德宝, 等. 基于拉丝法的线结构光视觉测量系统标定[J]. 科技导报, 2014, 32(24): 64-67 [Crossref] [10] Duan F J, Liu F M, Ye S H. A new accurate method for the calibration of line structured light sensor[J]. Chinese Journal of Scientific Instrument, 2000, 21(1): 108-110. 段发阶, 刘凤梅, 叶声华. 一种新型线结构光传感器结构参数标定方法[J]. 仪器仪表学报, 2000, 21(1): 108-110 [Crossref] [11] Chen T F, Zhao J B, Wu X. New calibration method for line structured light sensor based on planar target[J]. Acta Optica Sinica, 2015, 35(1): 0112004. 陈天飞, 赵吉宾, 吴翔. 基于共面靶标的线结构光传感器标定新方法[J]. 光学学报, 2015, 35(1): 0112004 [Crossref] [12] Wei Z Z, Shao M W, Zhang G J, et al. Parallel-based calibration method for line-structured light vision sensor[J]. Optical Engineering, 2014, 53(3): 033101. [Crossref] [13] Zhang G J, Wei Z Z, Sun Z W, et al. A method of structured light based 3D vision inspection using BP neural network[J]. Chinese Journal of Scientific Instrument, 2002, 23(1): 31-35. 张广军, 魏振忠, 孙志武, 等. 基于BP神经网络的结构光三维视觉检测方法研究[J]. 仪器仪表学报, 2002, 23(1): 31-35 [Crossref] [14] Zhao H J, Shi S G, Jiang H Z, et al. Calibration of AOTF-based 3D measurement system using multiplane model based on phase fringe and BP neural network[J]. Optics Express, 2017, 25(9): 10413-10433. [Crossref] [15] Dipanda A, Woo S, Marzani F, et al. 3-D shape reconstruction in an active stereo vision system using genetic algorithms[J]. Pattern Recognition, 2003, 36(9): 2143-2159. [Crossref] [16] Sun Y J, Zhang X F, Jian M W, et al. An improved genetic algorithm for three-dimensional reconstruction from a single uniform texture image[J]. Soft Computing, 2018, 22(2): 477-486. [Crossref] [17] Zou Y Y, Li P F, Zuo K Z. Field calibration method for three-line structured light vision sensor[J]. Infrared and Laser Engineering, 2018, 47(6): 617002. 邹媛媛, 李鹏飞, 左克铸. 三线结构光视觉传感器现场标定方法[J]. 红外与激光工程, 2018, 47(6): 617002 [Crossref] [18] Gan H, Zhang C, Li L, et al. Sub-pixel extraction of laser stripe in complex background[J]. Opto-Electronic Engineering, 2019, 46(2): 180457. 甘宏, 张超, 李林, 等. 复杂背景下激光条纹中心亚像素提取方法[J]. 光电工程, 2019, 46(2): 180457 [Crossref] [19] Harris C, Stephens M. A combined corner and edge detector[C]// Proceedings of the 4th Alvey Vision Conference, 1988: 147–151. [20] Zhang Q C, Su X Y, Zou X P. Calibration of 3-D measurement system using multi-sensor with line structured-illuminated laser[J]. Laser Technology, 2005, 29(3): 225-227, 232. 张启灿, 苏显渝, 邹小平. 多个线结构光传感器三维测量系统的校准[J]. 激光技术, 2005, 29(3): 225-227, 232 [Crossref]