-
基于激光三角法的线激光传感器如图1所示。传感器内的激光发射系统将线型激光投射到被测物表面上,反射光经成像透镜组后被传感器内另一端的相机接收并形成条纹图像,根据条纹图像在相机上的成像位置可计算得到被测物表面的三维轮廓信息。
-
线激光传感器的边缘检测与提取误差是指在轮廓测量时,轮廓边缘处微倒角的倾斜度和光条图像边缘的提取算法等对边缘测量结果产生的偏差,可分别概括为边缘特征误差和图像处理误差。
(1)边缘特征误差
被测物边缘特征是指被测物轮廓边缘处的微倒角或微圆角,对其测量时的倾斜度或曲率较大,降低了该处被测点的成像精度,影响轮廓边缘检测精度,产生测量误差。在激光三角测量中,由于被测面倾斜所产生的误差一般可达10~103 μm。
如图2所示,线激光传感器在测量距离H下对工件进行轮廓测量,图2(b)中的阴影区域为工件轮廓边缘处的微倒角,被测点P的反射光线与所在平面法线的夹角为倾斜角θ,在倾斜角θ的影响下,点P处的光斑质心在成像平面上的位置被改变,使测量结果发生偏移或缺失,产生边缘特征误差。
(2)图像处理误差
图3所示为线激光传感器在轮廓测量时其内部相机拍摄被测物表面光条得到的条纹图像。在像平面UOV上形成灰色区域所包围的初始条纹,测量系统根据设定的阈值对条纹图像进行二值化分割,可得到黑色区域的粗提取条纹,并在此基础上进一步获取条纹中心坐标以实现精确测量。
目前越来越多的条纹中心提取算法被提出,但对算法的提取精度和有效性没有统一的评价标准,加上图像分割时的阈值设定的不准确性,使条纹图像在U轴方向两端的像素点极易被剔除,如图3所示,图中的黑色条纹相比灰色条纹在U轴方向上缺失了2个像素点,产生了测量误差。像素点的缺失会导致尺寸测量结果的偏小,单位像素点剔除误差等于Y轴数据点间距δy,即Y轴精度,其值取决于像素尺寸和物距,可用测量结果中的相邻点间距的均值表征:
$${\delta _y} = \dfrac{{\displaystyle\sum\limits_{i = 2}^N {(|{y_i} - {y_{i - 1}}|)} }}{N}$$ (1) 式中:N表示数据点个数;yi表示第i个点的Y轴坐标。若图像处理剔除了x个像素点,则图像处理误差可表示为:
$${\delta _{image}} = x \cdot {\delta _y}$$ (2) 边缘特征误差和图像处理误差均会导致轮廓边缘信息的偏移和缺失,因此一般测量时边缘检测与提取误差会使尺寸测量结果偏小。
-
如图2(a)所示,线激光传感器在对工件表面测量时,扇形激光面无法投射到垂直侧面上,因此理论上传感器无法得到工件垂直侧面处的点云数据,且根据线激光传感器的测量原理可知,Y轴数据点间距为微米级。但由于实际测量活动受到环境光、空间位置、电磁辐射等因素的干扰,在被测工件的垂直侧面处会出现毫米级间距的点云数据,即出现了“伪侧面”现象,如图4(a)所示,选取图中的三维点云模型在X轴方向上中间处的某帧点云,其边缘放大图如图4(b)所示。
“伪侧面”就是离散的垂直侧面噪声,其并非是被测物的真实轮廓信息,它的产生具有一定的随机性,需对其进行滤除。
-
针对线激光传感器在工件轮廓测量中出现的边缘偏差,需先滤除垂直侧面噪声,再对边缘检测与提取误差进行补偿。
-
垂直侧面噪声中相邻两点的间距均远大于传感器的Y轴数据点间距,因此提出一种基于曼哈顿距离和切比雪夫距离的去噪算法,搜索每一帧数据中的垂直侧面噪声并对其进行滤除。
(1)遍历点Pi (yi, zi)(i=2, 3···, N−1)与其相邻两点Pi−1 (yi-1, zi−1)和Pi+1 (yi+1, zi+1)的曼哈顿距离Mi−、Mi+和切比雪夫距离Qi−、Qi+:
$$\left\{ \begin{array}{l} {M_i}^ - = \left| {{y_i} - {y_{i - 1}}} \right| + \left| {{ {\textit{z}}_i} - { {\textit{z}}_{i - 1}}} \right| \\ {M_i}^ + = \left| {{y_i} - {y_{i + 1}}} \right| + \left| {{ {\textit{z}}_i} - { {\textit{z}}_{i + 1}}} \right| \\ {Q_i}^ - = \max \left( {\left| {{y_i} - {y_{i - 1}}} \right|,\left| {{z_i} - { {\textit{z}}_{i - 1}}} \right|} \right) \\ {Q_i}^ + = \max \left( {\left| {{y_i} - {y_{i + 1}}} \right|,\left| {{z_i} - { {\textit{z}}_{i + 1}}} \right|} \right) \end{array} \right.$$ (3) (2)根据Y轴数据点间距δy设置过滤系数R,判断切比雪夫距离Qi是否存在异常:
$${V_i} = \left\{ \begin{array}{l} {\kern 1pt} {\kern 1pt} \;\,1\;,\;\;{Q_i}^ - > R \cap {Q_i}^ + > R \\ \;\;0\;,\;\;{Q_i}^ - < R \cup {Q_i}^ + < R \end{array} \right.$$ (4) (3)若Vi=0,说明Pi为有效点,保留Pi并根据步骤(2)对下一个点继续检测;若Vi=1,说明Pi为可疑点,进一步对其判断:
$${U_i} = \left\{ \begin{array}{l} {\kern 1pt} {\kern 1pt} \,1\;,\;({M_i}^ - - {Q_i}^ - )\; > R \cap ({M_i}^ + - {Q_i}^ + )\; > R \\ \;0\;,\;({M_i}^ - - {Q_i}^ - )\; < R \cup ({M_i}^ + - {Q_i}^ + )\; < R \end{array} \right.$$ (5) (4)若Ui=0,说明Pi为有效点,保留Pi并根据步骤(2)继续对下一个点检测;若Ui=1,说明Pi为噪声点,对其滤除并根据步骤(2)对下一个点继续检测。
式中,N为每一帧的测量数据点个数;V为可疑点筛选函数;U为噪声点确定函数。算法的具体实现流程如图5所示。
-
轮廓边缘点及其附近点包含轮廓边缘丰富的几何特征信息,因此针对滤噪后的每一帧测量数据,以轮廓边缘点Pedge为核心,通过邻域点Pnext构建基于最小二乘法的边缘轮廓曲线,通过插值补偿缺失数据点,实现边缘检测与提取误差的补偿。
(1)遍历点Pi (yi, zi)(i=2,3…, N)的高度突变信号:
$${W_i} = \left\{ \begin{array}{l} {\kern 1pt} {\kern 1pt} \;{\kern 1pt} 1\;\;\,,\;\;\;\;{ {\textit{z}}_i} - { {\textit{z}}_{i - 1}}\;\;\,\, > R \\ \; - 1\;,\; - ({ {\textit{z}}_i} - { {\textit{z}}_{i - 1}}) > R \\ \;\;0\;\;,\;\;\;\,\left| {{\kern 1pt} { {\textit{z}}_i} - { {\textit{z}}_{i - 1}}{\kern 1pt} } \right|\;\; < R \end{array} \right.$$ (6) (2)若V=±1,表示Pi的高度发生突变,此时存在轮廓边缘点:
$${P_{edge}} = \left\{ \begin{array}{l} {P_i}\;\;\;,\;W = 1 \\ {P_{i - 1}}\;,\;W = - 1 \end{array} \right.$$ (7) (3)搜索边缘点在领域T内的第t个相邻点:
$${P_{next}}^{\left( t \right)} = \left\{ \begin{array}{l} {P_{i + t}}\;\;\;,\;W = 1 \\ {P_{i - 1 - t}}\;,\;W = - 1 \end{array} \right.\;$$ (8) (4)根据边缘点Pedge与其T个相邻点Pnext构建基于最小二乘法的多项式拟合函数:
$$\left\{ \begin{array}{l} {\textit{z}}(y) = \displaystyle\sum\limits_{j = 0}^T {{a_i}{y^j}} \\ {P_0} = {P_{edge}},{P_1} = {P_{next}}^{(1)}, \cdots ,{P_T} = {P_{next}}^{(T)} \end{array} \right.$$ (9) (5)根据所拟合的多项式z(y),设置插值点Y轴间距ya,进行插值补偿,得到补偿点:
$$\left\{ \begin{array}{l} {P_{add}}^{\left( k \right)}(({y_i} - k \cdot {y_a})\;,\; {\textit{z}}({y_i} - k \cdot {y_a})),W = 1 \\ {P_{add}}^{\left( k \right)}(({y_{i - 1}} + k \cdot {y_a})\;,\; {\textit{z}}({y_{i - 1}} + k \cdot {y_a}))\,,W = - 1 \end{array} \right.$$ (10) 式中:W为高度突变信号函数;Pedge为轮廓边缘点;T为邻域内点数,表示邻域半径;Pnext(t)表示轮廓边缘点的第t个相邻点,t
$ \in $ [1,T];z(y)为多项式拟合函数;aj(j=0,1…)为其系数;Padd(k)为边缘点的第k个插值补偿点,k$ \in $ [1,K],K为补偿系数。图6为ya=δy,T=2,K=2的插值补偿示意图。 -
为了验证文中所提算法的有效性,以二级标准量块作为被测工件,选择nxSensor-I90线激光扫描仪作为测试对象,以MERA60高精度电控转台作为尺寸测量辅助设备,利用上位机实现线激光传感器对量块三维轮廓数据的采集和优化。相关设备参数如表1所示,实验环境为光线较暗的室内。
表 1 设备参数指标
Table 1. Parameters of equipment
Module Indicators and parameters Standard gauge block Limit deviation: ±0.6 μm Edge feature: Chamfer Line laser sensor Y axis accuracy: 0.045 mm Z axis range: −60-40 mm High-precision rotary table Resolution: 0.02° Positioning accuracy: 0.05° -
实验平台和装置如图7所示,将线激光传感器沿其X轴方向对量块表面进行扫描,测量结果产生了垂直侧面噪声,如图4所示。
通过文中的垂直侧面噪声滤除算法,设置过滤系数R=0.10 mm,再次测量得到如图8所示的结果。通过与图4对比显示,垂直侧面噪声已被滤除,表明了文中算法对于噪声滤除的可行性和有效性。
-
针对线激光传感器提出了一种基于高精度转台的量块尺寸测量方法,以准确获得量块的尺寸测量值,进而可计算边缘检测与提取误差。
-
标准尺寸测量方案设计如图9所示。将标准量块固定于高精度转台中心处,线激光传感器固定于机械臂末端并保持静止,确保激光光条覆盖量块的被测宽度,通过上位机连接运动控制器并控制转台转动,如图10所示,具体流程如下:
(1)控制转台使光条在量块表面以角速度ω保持顺时针转动,在光条与量块表面中心线平行前,启动线激光传感器采样共M帧;
(2)根据第m帧(m=1,2,…,M)采样所得点云数据中的边缘点Am (0,yAm,zAm)和Bm (0,yBm,zBm)的距离表征第m帧的宽度测量值lm:
$${l_m} = \sqrt {{{({y_{Am}} - {y_{Bm}})}^2} + {{({z_{Am}} - {z_{Bm}})}^2}} $$ (11) 设边缘检测与提取误差服从均匀分布,则尺寸测量值Lmeas和宽度测量值lm满足:
$${L_{meas}} = {l_m} \cdot \cos ( - \alpha + \frac{\omega }{F}(m - 1))$$ (12) 式中:F表示线激光传感器的采样频率;α表示光条与量块表面中心线的夹角;
(3)对公式(12)采用最小二乘拟合可得到尺寸测量值Lmeas,则边缘检测与提取误差Δ可用尺寸测量误差的均方根值表征:
$$\Delta = \sqrt {\frac{1}{n}\sum\limits_{i = 1}^n {{{({L_{meas}}^{(i)} - {L_{true}})}^2}} } $$ (13) 式中:n表示测量次数;Ltrue表示量块的标称尺寸。
-
分别对标称尺寸为20 mm、40 mm和60 mm的标准量块进行尺寸测量实验,其中根据公式(12)采用最小二乘法拟合得到了单次尺寸测量值Lmeas的结果如图11所示,图中采样帧数M=150。尺寸测量结果如表2所示,表中边缘误差结果包括量块宽度方向上两端边缘误差之和。设定边缘检测与提取误差补偿算法的领域半径T=3,根据公式(1)计算得到Y轴精度δy≈0.078 mm,分别选择ya=δy、K=2和ya=δy/2、K=5,加入补偿算法后再次进行测量实验,结果如表2所示。
图 11 (a) 20 mm量块尺寸测量;(b) 40 mm量块尺寸测量;(c) 60 mm量块尺寸测量
Figure 11. (a) Dimension measurement of 20 mm gauge block; (b) Dimen-sion measurement of 40 mm gauge block; (c) Dimension measurement of 60 mm gauge block
表 2 误差补偿前后的尺寸测量结果(单位:mm)
Table 2. Dimension measurement results before and after error compensation (Unit: mm)
Size of gauge block No compensation ya=0.078 mm, K=2 ya=0.039 mm, K=5 Lmeas Δ Lmeas Δ Lmeas Δ 20 19.59 0.43 19.90 0.10 19.96 0.04 40 39.57 39.91 39.98 60 59.55 59.89 39.95 根据表2结果可知,未经优化前,线激光传感器对标准量块的尺寸测量误差均值为0.43 mm,经算法在不同参数下补偿后的尺寸测量误差均值为0.10 mm和0.04 mm,比优化前分别降低4倍和10倍,测量误差降低了一个数量级;图12所示为不同量块的尺寸测量误差在补偿前后的对比,直观表现了算法对误差补偿的显著效果,说明了边缘检测与提取算法对误差补偿的可行性与有效性。
Correction method for edge deviation of line laser sensor
-
摘要: 为了修正线激光传感器在轮廓测量中的边缘偏差,提出了一种边缘偏差修正方法。该方法通过分析边缘偏差的主要误差来源,建立一种基于曼哈顿距离和切比雪夫距离的混合去噪模型,实现杂散噪声的滤除;采用最小二乘法对线激光轮廓测量误差模型进行补偿。为了验证该方法的有效性,以量块的标称尺寸作为评价指标进行测量校准实验。实验结果表明:该修正方法对杂散噪声的滤除效果显著;其中,未经补偿的尺寸测量误差为0.43 mm,经修正方法补偿后的尺寸测量误差最小达0.04 mm,比前者降低了一个数量级。因此,该方法可有效修正边缘偏差,提高线激光传感器的轮廓测量精度。Abstract: In order to correct the edge deviation of the line laser sensor in profile measurement, an edge deviation correction method was proposed. This method established a hybrid denoising model based on Manhattan distance and Chebyshev distance by analyzing the main error sources of edge deviation, and have achieved the filtering of spurious noise. In addition, the error model of line laser profile measurement was compensated by the least square. In order to verify the effectiveness of this method, the nominal size of the gauge block was used as an evaluation index to carry out measurement and calibration experiments. The experimental results show that the correction method has a significant effect on filtering stray noise. Among them, the uncompensated size measurement error is 0.43 mm, and the size measurement error is compensated is as small as 0.04 mm after the correction method , which is an order of magnitude lower than the former. Therefore, this method can effectively correct the edge deviation and improve the profile measurement accuracy of the line laser sensor.
-
Key words:
- line laser /
- profile measurement /
- error compensation /
- point cloud /
- algorithm
-
表 1 设备参数指标
Table 1. Parameters of equipment
Module Indicators and parameters Standard gauge block Limit deviation: ±0.6 μm Edge feature: Chamfer Line laser sensor Y axis accuracy: 0.045 mm Z axis range: −60-40 mm High-precision rotary table Resolution: 0.02° Positioning accuracy: 0.05° 表 2 误差补偿前后的尺寸测量结果(单位:mm)
Table 2. Dimension measurement results before and after error compensation (Unit: mm)
Size of gauge block No compensation ya=0.078 mm, K=2 ya=0.039 mm, K=5 Lmeas Δ Lmeas Δ Lmeas Δ 20 19.59 0.43 19.90 0.10 19.96 0.04 40 39.57 39.91 39.98 60 59.55 59.89 39.95 -
[1] Ma G Q, Liu L, Yu Z L, et al. Application and development of three-dimensional profile measurement for large and complex surface [J]. Chinese Optics, 2019, 12(2): 214-228. (in Chinese) doi: 10.3788/co.20191202.0214 [2] Zhou Z, Liu W, Wu Q, et al. A combined measurement method for large-size aerospace components [J]. Sensors, 2020, 20(17): 4843. doi: 10.3390/s20174843 [3] Zhang T, Li B, Zou Y B. Scanning imaging system based on stripe type laser sensor and robot [J]. Infrared and Laser Engineering, 2015, 44(1): 53-58. (in Chinese) doi: 10.3969/j.issn.1007-2276.2015.01.009 [4] Wang Y H, Zhang Q, Hu Y, et al. 3D small-field surface imaging based on microscopic fringe projection profilometry: a review [J]. Chinese Optics, 2021, 14(3): 447-457. (in Chinese) doi: 10.37188/CO.2020-0199 [5] Song X F, Li J P, Chen H J, et al. Laser centerline extraction method for 3D measurement of structured light in multi-scenarios [J]. Infrared and Laser Engineering, 2020, 49(1): 0113004. (in Chinese) doi: 10.3788/IRLA202049.0113004 [6] Wu X J, Tang N, Liu B, et al. A novel high precise laser 3D profile scanning method with flexible calibration [J]. Optics and Lasers in Engineering, 2020, 132: 105938. doi: 10.1016/j.optlaseng.2019.105938 [7] Pan H H, Wang Y W, Xu D B, et al. Calibration of line-structure light plane using non-specific target [J]. Optics and Precision Engineering, 2021, 29(1): 54-60. (in Chinese) doi: 10.37188/OPE.20212901.0054 [8] Tang J, Tan X, Li X, et al. Research on edge detection algorithm based on line laser scanning [J]. Procedia CIRP, 2019, 84: 1101-1106. doi: 10.1016/j.procir.2019.04.264 [9] Wang C J, Shi N N, Sun T, et al. Image deblurring for laser active illumination based on light vein features [J]. Optics and Precision Engineering, 2016, 24(5): 1159-1167. (in Chinese) doi: 10.3788/OPE.20162405.1159 [10] Zhang H X, Wang Q, Zhang T F, et al. Detection algorithm of image edge for laser active imaging [J]. Laser & Infrared, 2016, 46(6): 755-760. (in Chinese) doi: 10.3969/j.issn.1001-5078.2016.06.022 [11] He L H, Zhang J Z, Zhang L. Fast and robust edge detection method for line laser strip [J]. Application Research of Computers, 2018, 35(10): 3173-3175. (in Chinese) doi: 10.3969/j.issn.1001-3695.2018.10.068 [12] Chen L Y, Xiong Q Q. High precision adaptive detection of sub-pixel edge of laser image [J]. Laser Journal, 2020, 41(11): 86-90. (in Chinese) [13] Wu F F, Hu X X, Hu Y, et al. Research on medium thickness plate laser line endpoint extraction algorithm of contour detection. [J]. Group Technology & Production Modernization, 2017, 34(3): 58-62. (in Chinese) doi: 10.3969/j.issn.1006-3269.2017.03.013