Current Issue Cover
线结构光光条中心提取算法

曾超, 王少军, 卢红, 孔聪(武汉理工大学机电工程学院, 武汉 430070)

摘 要
目的 线结构光视觉测量是一种利用可控光源和数字图像的主动视觉测量方法,光条中心提取是线结构光视觉测量的关键技术,直接影响到线结构光视觉测量的精度。传统灰度重心法只在图像的横向或纵向上计算光条的灰度重心,没有考虑光条的法线方向,精度较低。本文提出一种改进的光条中心提取算法,以期实现光条中心的精确提取。方法 在分析线结构光的光条灰度特性基础上,基于传统的灰度重心法,提出一种改进的两步提取算法。基于图像差分法从原始图像中分离出有效的线结构光光条,采用传统灰度重心法对光条中心进行粗提取;在粗提取的光条中心点处通过自定义的方向模板确定光条的法线方向,以粗提取的光条中心点为中心,沿法线方向采用灰度重心法进行二次提取,获取线结构光光条的中心。结果 本文采用CCD相机、镜头、线激光器及辅助机构搭建线结构光视觉系统,采用提出的算法对线激光器投影产生的直线型光条、非连续光条和弯曲光条的中心进行提取。通过光条中心提取实验获取的光条中心线的走向与光条的走向大致相同,符合预期的光条中心线。本文将Steger法作为评价标准,分别计算本文算法、传统灰度重心法与Steger法提取的光条中心的偏差,通过对比实验可知,本文算法提取的光条中心的偏差更小,并且程序运行时间比Steger法减少了3 s以上。结论 本文研究线结构光的光条中心提取算法,对传统灰度重心法进行改进,能够实现直线型光条、非连续光条和弯曲光条等不同形状光条的亚像素级中心提取,并且在保证较少的程序运行时间的同时,能够提高传统灰度重心法的光条中心提取精度。
关键词
Center extraction algorithm of line structured light stripe

Zeng Chao, Wang Shaojun, Lu Hong, Kong Cong(School of Mechanical and Electronic Engineering, Wuhan University of Technology, Wuhan 430070, China)

Abstract
Objective Machine vision continues to innovate with the development of computer technology. Line structured light vision is a three-dimensional vision method and an important branch of machine vision technology. Line structured light vision has been widely used in industrial fields, such as industrial manufacturing, food processing, target tracking, defect detection, and robotics because the light stripe has obvious characteristics in images and is easy to extract and the light beam is actively controlled. Line structured light vision measurement is an active method that utilizes a controllable light source and a digital image. The method also uses the spatial position information of the light source and combines with the digital image and processing method of machine vision to obtain the three-dimensional coordinate information of the object. The information is obtained by extracting the center line of the line structured light stripe. The point coordinates on the center line of the light stripe are obtained so the center extraction of line structured light stripe is the key technology of the measurement. The center extraction directly affects the measurement accuracy of the line structured light vision system. In a vision measurement system based on line structured light, the light stripe often shows a phenomenon in which the width is not uniform, the brightness is not concentrated, and the discreteness is larger due to the influence of the quality of the light source and the surface characteristics of the object. In this regard, the precision of the center extracted by conventional methods is difficult to ensure. The increasing application of line structured light vision measurement has led scholars to focus on ensuring the accuracy and rapidity of center extraction. Because of the precision of traditional gray-gravity method is lower, an improved center extraction algorithm is proposed for accurate extraction of the center of the light stripe to rapidly obtain the sub-pixel center coordinates of the light stripe. Method An improved center extraction algorithm is proposed on the basis of the analysis of the gray-scale characteristics of the line structured light stripe to achieve accurate extraction of the center of the light stripe. This method is commonly used in the center extraction algorithm of light stripe. The method scans the stripe line by line or column by column, the gray center of gravity of each line or column is calculated, and the gray-gravity coordinates is used as the coordinates of the center of the light stripe. The traditional gray-gravity method calculates the gray center of gravity only in the lateral or longitudinal direction of the image without considering the normal direction of the light stripe. This work improves the traditional gray-gravity method. The direction template is used to obtain the normal direction of the light stripe, and the variable width is used to solve the problem of uneven distribution of width of the light stripe. An improved two-step extraction algorithm is proposed to extract the center of the light stripe. First, the effective line structured light stripe is separated from the original image by image difference method, where the background image is subtracted from the original image. The center of the light stripe is roughly extracted by the traditional gray-gravity method. The normal direction at the center point of the light stripe is finally centered by custom direction template. The direction template consists of four matrices representing directions, corresponding to the four directions of the light stripe at the pixel level, including horizontal and vertical and tilted to the left by 45ånd to the right by 45°. Finally, the center of the rough extraction is taken as the center. The pixel points participating in the calculation are determined according to the width of the light stripe in the normal direction. The gray center of gravity is used for secondary extraction along the normal direction. Finally, the center of the line structured light stripe is obtained. Result A CCD camera, lens, line laser, and auxiliary mechanism are used to build a line structured light vision system. The structure of the laser and camera is that the former is perpendicular to the horizontal plane, and the latter is tilted relative to the laser. Line structured light is generated by the line laser, and the color CCD camera and the lens of fixed focus complete the collection of light stripe image. The line laser forms a straight light stripe, a discontinuous light stripe, and a curved light stripe by illuminating different objects. The proposed algorithm is used to extract the center of straight light stripe, discontinuous light stripe, and curved light stripe. Results of the center extraction are processed through MATLAB. In the center extraction experiment of the light stripe, the orientation of the acquired center line is approximately the same as that of the light stripe, which is in accordance with the expected center line of the light stripe. The proposed algorithm extracts the center of the light stripe closer to the center extracted by Steger method than that by traditional gray-gravity method. The running time of the algorithm is reduced by more than 3s than Steger method. Conclusion This paper investigates the center extraction algorithm of line structured light stripe and proposes an improved center extraction algorithm of line structure light stripe on the basis of traditional gray-gravity method. The method can realize the sub-pixel level center extraction of straight light stripe, discontinuous light stripe, and curved light stripe. While maintaining less running time of program, the proposed method exhibits higher accuracy for center extraction of light stripe than traditional gray-gravity method.
Keywords

订阅号|日报