[go: up one dir, main page]

CN103047943B - Based on the door skin geomery detection method of single projection coded structured light - Google Patents

Based on the door skin geomery detection method of single projection coded structured light Download PDF

Info

Publication number
CN103047943B
CN103047943B CN201210590601.3A CN201210590601A CN103047943B CN 103047943 B CN103047943 B CN 103047943B CN 201210590601 A CN201210590601 A CN 201210590601A CN 103047943 B CN103047943 B CN 103047943B
Authority
CN
China
Prior art keywords
image
coordinate
projection
point cloud
array
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN201210590601.3A
Other languages
Chinese (zh)
Other versions
CN103047943A (en
Inventor
崔岸
张�成
陈洪柱
王希阁
徐倩
陈勇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jilin University
Original Assignee
Jilin University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jilin University filed Critical Jilin University
Priority to CN201210590601.3A priority Critical patent/CN103047943B/en
Publication of CN103047943A publication Critical patent/CN103047943A/en
Application granted granted Critical
Publication of CN103047943B publication Critical patent/CN103047943B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Length Measuring Devices By Optical Means (AREA)
  • Image Analysis (AREA)

Abstract

本发明公开了一种基于单投射编码结构光的车门外板形状尺寸检测方法,旨在打破结构光视觉检测技术用于汽车车门外板形状尺寸在线检测是罕见的状况。步骤为:1.结构光检测系统标定阶段:对摄像机(2)和投影仪(4)进行标定,建立起空间位置和图像坐标之间对应的非线性关系;2.编码投影模板设计阶段;3.检测图像解码识别阶段:利用投影仪(4)向车门外板表面投射编码投影模板,再利用摄像机(2)对车门外板表面图像进行拍摄,将拍摄的图像传送到计算机中进行图像处理以及识别;4.空间点云坐标计算以及误差评定阶段:1)计算车门外板表面投影图像特征点的三维空间坐标;2)对计算得到的检测点云与三坐标测量机测得的点云模型进行配准。

The invention discloses a method for detecting the shape and size of an outer panel of a car door based on single-projection coded structured light, aiming at breaking the rare situation that structured light visual detection technology is used for online detection of the shape and size of an outer panel of a car door. The steps are: 1. The structured light detection system calibration stage: calibrate the camera (2) and the projector (4), and establish the corresponding nonlinear relationship between the spatial position and the image coordinates; 2. The coding projection template design stage; 3 . Detection image decoding and recognition stage: use the projector (4) to project the coded projection template to the surface of the door outer panel, then use the camera (2) to shoot the image of the surface of the door outer panel, and send the captured image to the computer for image processing and Recognition; 4. Spatial point cloud coordinate calculation and error evaluation stage: 1) Calculate the three-dimensional space coordinates of the feature points of the projected image on the surface of the outer panel of the car door; 2) Compare the calculated detection point cloud with the point cloud model measured by the three-coordinate measuring machine for registration.

Description

基于单投射编码结构光的车门外板形状尺寸检测方法Detection method of shape and size of car door outer panel based on single-projection coded structured light

技术领域technical field

本发明涉及一种针对车门外板形状尺寸的非接触在线检测方法,更具体地说,本发明涉及一种基于单投射编码结构光的车门外板形状尺寸检测方法。The invention relates to a non-contact on-line detection method for the shape and size of a car door outer panel, more specifically, the invention relates to a method for detecting the shape and size of a car door outer panel based on single-projection coded structured light.

背景技术Background technique

汽车车门外板多为空间立体曲面,一般是指汽车冲压件和多个冲压件焊接而成的组件;车门外板形状尺寸检测是评价汽车车门外板制造质量的一个重要手段,车门外板制造精度严重影响着汽车的装配、安全以及视觉美观性。目前常用的检测手段主要是利用三坐标测量机进行抽样离线检测,虽然可以获得较高检测精度,但是由于其属于点对点的接触性检测,容易对车门表面造成破坏,而且耗用的时间较长,因此无法实现100%在线检测。21世纪以来,基于视觉的三维感知技术的发展推动了制造工业检测手段的巨大变革,一个特定物体的空间轮廓尺寸可以仅有一系列的点形成,即点云。结构光视觉技术具有非接触、大量程和自动化程度高等优势,可以通过投射一副特定编码模板到检测物体表面,由于模板是经过伪随机阵列编码的,因此只需投射一副图像,有利于进行对车门外板进行在线尺寸检测,最后采用三角测量法对物体表面特征点的空间坐标进行计算,可以获得描述车门外板表面特征的三维点云,具有速度快,自动化程度高、精度较高的优点,具有较大的发展潜力。Most of the outer panels of automobile doors are three-dimensional curved surfaces, which generally refer to automobile stamping parts and components welded by multiple stamping parts; the shape and size detection of the outer panel of the door is an important means to evaluate the manufacturing quality of the outer panel of the automobile door. Accuracy seriously affects the assembly, safety and visual aesthetics of the car. At present, the commonly used detection method is mainly to use the three-coordinate measuring machine to conduct sampling off-line detection. Although it can obtain high detection accuracy, it is easy to cause damage to the surface of the car door because it belongs to point-to-point contact detection, and it takes a long time. Therefore, 100% online detection cannot be realized. Since the 21st century, the development of vision-based three-dimensional perception technology has promoted a huge change in the detection methods of the manufacturing industry. The spatial outline size of a specific object can only be formed by a series of points, that is, the point cloud. Structured light vision technology has the advantages of non-contact, large range and high degree of automation. It can project a specific coding template to the surface of the detection object. Since the template is coded by a pseudo-random array, only one image needs to be projected, which is conducive to Carry out online size detection on the outer panel of the car door, and finally use the triangulation method to calculate the spatial coordinates of the feature points on the surface of the object, and obtain a three-dimensional point cloud describing the surface characteristics of the outer panel of the car door, which has the advantages of fast speed, high degree of automation and high precision Advantages, great potential for development.

基于空间邻域编码策略的结构光三维视觉技术,自二十一世纪来在国内已经取得了较大的发展,目前就结构光视觉技术本身研究而言,已经发表了较多的专利和论文。关于结构光三维视觉技术在三维重构方面的应用可以参阅中国专利公布号为CN101697233A,公布日为20120606,发明名称为“一种基于结构光的三维物体表面重建方法”以及香港大学SongZhan的博士学位论文(SongZhan.UseofStructuredLightfor3DReconstruction,TheChineseUniversityofHongKong,August2008),该论文对结构光技术的几种常用方法都给出详细的介绍以及具体的应用过程。虽然目前关于结构光视觉技术的研究越来越多,但是将结构光视觉检测技术应用于汽车车门外板形状尺寸在线检测的研究却十分罕见。The structured light 3D vision technology based on the spatial neighborhood coding strategy has achieved great development in China since the 21st century. At present, as far as the research on the structured light vision technology itself is concerned, many patents and papers have been published. For the application of structured light 3D vision technology in 3D reconstruction, please refer to the Chinese patent publication No. CN101697233A, the publication date is 20120606, the title of the invention is "a method for reconstructing the surface of 3D objects based on structured light" and the Ph.D. Thesis (SongZhan.UseofStructuredLightfor3DReconstruction,TheChineseUniversityofHongKong,August2008), this paper gives a detailed introduction and specific application process to several commonly used methods of structured light technology. Although there are more and more researches on structured light vision technology, the research on applying structured light vision detection technology to the online detection of the shape and size of the outer panel of the car door is very rare.

发明内容Contents of the invention

本发明所要解决的技术问题是打破结构光视觉检测技术应用于汽车车门外板形状尺寸在线检测是十分罕见的状况,提供了一种基于单投射编码结构光的车门外板形状尺寸检测方法。The technical problem to be solved by the present invention is to break the rare situation that the structured light visual detection technology is applied to the online detection of the shape and size of the outer panel of the car door, and provide a method for detecting the shape and size of the outer panel of the car door based on single-projection coded structured light.

为解决上述技术问题,本发明是采用如下技术方案实现的:所述的基于单投射编码结构光的车门外板形状尺寸检测方法的步骤如下:In order to solve the above-mentioned technical problems, the present invention is realized by adopting the following technical scheme: the steps of the method for detecting the shape and size of the outer panel of the car door based on single-projection coded structured light are as follows:

1.结构光检测系统标定阶段:1. Calibration stage of structured light detection system:

为了保证检测的顺利进行,必须对结构光检测系统中的摄像机和投影仪进行标定,建立起空间位置和图像坐标之间的对应的非线性关系,利用这种非线性关系计算检测图像特征点对应的空间坐标;In order to ensure the smooth progress of the detection, it is necessary to calibrate the camera and projector in the structured light detection system, establish the corresponding nonlinear relationship between the spatial position and the image coordinates, and use this nonlinear relationship to calculate and detect the corresponding image feature points. space coordinates;

2.编码投影模板设计阶段:2. Code projection template design stage:

检测过程中只需投射一幅编码图案到车门外板表面,该编码图案是一个大小为40行45列的由4个不同方向的X-型基元符号构成的图形阵列,图形阵列中图形的排列顺序由一个伪随机M阵列决定,该图形阵列具有以下特性:每3×3子阵列内的图形在整个阵列模板中只出现一次,而且任意两个子阵列中对应位置的图形至少有3个不一样;除边缘外的每个X-型基元符号都经过了编码,其编码值大小都由其3×3邻域内的元素共同决定,该图形阵列根据X-型基元符号较长主惯性轴与基轴夹角不同分别赋予了不同的码字,因此图形阵列又对应着一个40×45的数字阵列,该阵列称为伪随机M阵列;During the detection process, it is only necessary to project a coded pattern onto the surface of the outer panel of the car door. The coded pattern is a graphic array with a size of 40 rows and 45 columns consisting of 4 X-shaped primitive symbols in different directions. The arrangement order is determined by a pseudo-random M array, which has the following characteristics: the graphics in each 3×3 sub-array appear only once in the entire array template, and there are at least 3 different graphics in the corresponding positions in any two sub-arrays. The same; each X-type primitive symbol except the edge has been coded, and the size of its coded value is determined by the elements in its 3×3 neighborhood. The different angles between the axis and the base axis give different codewords, so the graphic array corresponds to a 40×45 digital array, which is called a pseudo-random M array;

3.检测图像解码识别阶段:3. Detection image decoding recognition stage:

利用投影仪向轿车车门外板表面投射编码投影模板,再利用摄像机对车门外板表面图像进行拍摄,并将拍摄的图像传送到计算机中进行图像处理以及识别;Use the projector to project the coded projection template to the surface of the outer panel of the car door, and then use the camera to capture the image of the surface of the outer panel of the car door, and send the captured image to the computer for image processing and recognition;

4.空间点云坐标计算以及误差评定阶段:4. Space point cloud coordinate calculation and error evaluation stage:

(1)计算车门外板表面投影图像特征点的三维空间坐标;(1) Calculate the three-dimensional space coordinates of the projected image feature points on the surface of the outer panel of the car door;

(2)对计算得到的检测点云与三坐标测量机测得的点云模型进行配准。(2) Register the calculated detection point cloud with the point cloud model measured by the three-coordinate measuring machine.

技术方案中所述的结构光检测系统标定阶段的步骤如下:The steps in the calibration phase of the structured light detection system described in the technical proposal are as follows:

1)对摄像机进行标定:1) Calibrate the camera:

利用张正友标定的方法进行标定,采用投影仪投射设计的12×16黑白棋盘格标靶到标定平面的右侧,然后再利用摄像机拍摄整个标定平面,拍摄得到的12幅图像中左下角的摄像机标靶图像进行特征角点提取,每个摄像机标靶图像提取100个角点,12幅图像总共得到1200个特征角点图像坐标,根据张正友标定方法,世界坐标系设定在棋盘格图像最左上角处的一个角点上,Z方向坐标值取为零,由于每个棋盘格尺寸大小精确设计为30mm,因此棋盘格特征角点在X和Y方向的世界坐标可精确得知,因此在得到平面图像特征角点坐标以及对应点的空间坐标以后,即可利用工具箱完成标定,计算得到摄像机的内外部参数;Use Zhang Zhengyou’s calibration method to calibrate, and use a projector to project the designed 12×16 black and white checkerboard target to the right side of the calibration plane, and then use the camera to shoot the entire calibration plane. The camera mark in the lower left corner of the 12 images obtained is Extract feature corners from the target image, extract 100 corners from each camera target image, and obtain 1200 feature corner image coordinates in total from 12 images. According to Zhang Zhengyou’s calibration method, the world coordinate system is set at the upper left corner of the checkerboard image At a corner point at , the coordinate value in the Z direction is taken as zero. Since the size of each checkerboard is precisely designed to be 30mm, the world coordinates of the corner points of the checkerboard feature in the X and Y directions can be accurately known. Therefore, the obtained plane After the image feature corner coordinates and the spatial coordinates of the corresponding points, the toolbox can be used to complete the calibration and calculate the internal and external parameters of the camera;

2)对投影仪进行标定:2) Calibrate the projector:

对摄像机图像中的投影标靶进行特征角点的提取,然后再根据已经得到的摄像机的内外参数结果,根据光平面相交法计算位于标定平面上投影图像的特征角点在世界坐标系下的空间坐标,至此,投影标靶的图像坐标和空间坐标都已经计算得出,因此,采用与摄像机标定相同的方法计算投影仪标定参数,得到投影仪的内外部参数以及投影仪和摄像机之间的旋转平移矩阵。Extract the feature corners of the projected target in the camera image, and then calculate the space of the feature corners of the projected image on the calibration plane in the world coordinate system according to the obtained internal and external parameters of the camera and the light plane intersection method Coordinates, so far, the image coordinates and space coordinates of the projection target have been calculated, therefore, the calibration parameters of the projector are calculated using the same method as the camera calibration, and the internal and external parameters of the projector and the rotation between the projector and the camera are obtained translation matrix.

技术方案中所述的编码投影模板设计阶段的步骤如下:The steps in the coding projection template design phase described in the technical proposal are as follows:

1)对应图形阵列的伪随机M数组生成:1) Pseudo-random M array generation corresponding to the graphic array:

伪随机M数组的特征在于,特定3×3窗口的子数组在全部数组中具有唯一性,任意两个窗口之间的汉明距离越大,表示两者之间的区别越大,伪随机M数组汉明距离计算方式如下式:The characteristic of the pseudo-random M array is that the sub-array of a specific 3×3 window is unique in the entire array. The larger the Hamming distance between any two windows, the greater the difference between the two. The pseudo-random M The calculation method of array Hamming distance is as follows:

其中:V(ij)表示3×3邻域的9元素向量,H表示两不同3×3邻域之间对应位置向量出现不同码字的次数,即为汉明距离,汉明距离越大,表示窗口相异程度越大,编码投影模板设计阶段中构造的伪随机M阵列,将最小汉明距离大小设定为3,即表示任意两个3×3窗口的子阵列对应的元素至少有3个是不一样的,这样的设计有利于增强子阵列的稳定性以及对检测对象表面空间变化程度的适应性;Among them: V (ij) represents the 9-element vector of the 3×3 neighborhood, and H represents the number of times that different codewords appear in the corresponding position vectors between two different 3×3 neighborhoods, which is the Hamming distance. The larger the Hamming distance, Indicates that the greater the degree of difference between the windows, the pseudo-random M array constructed in the design stage of the encoding projection template, the minimum Hamming distance is set to 3, which means that the elements corresponding to any two sub-arrays of 3×3 windows have at least 3 The two are different, such a design is conducive to enhancing the stability of the sub-array and the adaptability to the degree of spatial variation of the surface of the detection object;

编码投影模板设计阶段中需要生成数字基元为{0,1,2,3},最小汉明距离等于3,大小为40×45的伪随机M阵列;采用循环填充法完成符合编码投影模板设计要求的伪随机阵列构建,首先在阵列左上角生成3×3的子阵列,然后沿右侧依次代入3×1的子阵列,比较相邻3×3窗口间的汉明距离大小是否符合条件,不符合重新代入,符合条件则依次向右进行直到边界为止;然后沿初始3×3数组的下方依次代入1×3子阵列,方法同上,直到边界为止;其次再依次在4×4的空白位置代入一个新的码值,组成一个新的3×3子阵列,和前面生成的所有子阵列比较汉明距离大小,符合条件继续,不符合重新代入,如代入所有可能码字都不满足,则重新开始本次构建过程;In the code projection template design stage, it is necessary to generate a pseudo-random M array with a digital primitive of {0,1,2,3}, a minimum Hamming distance equal to 3, and a size of 40×45; the circular filling method is used to complete the code projection template design To construct the required pseudo-random array, first generate a 3×3 subarray in the upper left corner of the array, and then substitute a 3×1 subarray along the right side to compare whether the Hamming distance between adjacent 3×3 windows meets the conditions. If it does not meet the requirements, proceed to the right until the boundary; then substitute the 1×3 sub-array along the bottom of the initial 3×3 array, the method is the same as above, until the boundary; and then proceed to the blank position of 4×4 Substituting a new code value to form a new 3×3 sub-array, comparing the Hamming distance with all the sub-arrays generated before, if the condition is met, continue, if not, re-substituting, if substituting all possible code words is not satisfied, then Restart the build process;

2)基于几何特征的X-型基元符号设计:2) X-type primitive symbol design based on geometric features:

构造编码投影模板的几何基元图形常采用方形或者圆形,但是由于出现阴影或者遮挡情况下,以几何中心作为特征角点的圆形或者方形图案比较容易发生几何中心的偏移或者产生歧义角点,导致角点坐标提取不准,而根据棋盘格的角点特征,设计一类X-型的几何基元在遮挡或者缺失的情况下具有比较稳定的角点特征,该X-型基元符号以棋盘格图像为特征设计,关于特征角点中心对称,由成中心对称的三角形或正方形组成,根据较长主惯性轴与基轴之间的夹角角度大小{0°,45°,90°,135°}的不同分别对应4个码字{0,1,2,3};Geometric primitives for constructing coded projection templates often use squares or circles, but due to shadows or occlusions, circular or square patterns with geometric centers as feature corners are more likely to have geometric center offsets or ambiguous angles. point, resulting in inaccurate extraction of corner coordinates, and according to the corner characteristics of the checkerboard, a class of X-shaped geometric primitives is designed to have relatively stable corner characteristics in the case of occlusion or absence. The symbol is designed with a checkerboard image as the feature, symmetrical about the center of the feature corner, and composed of a triangle or square that is symmetrical to the center, according to the angle between the longer main inertial axis and the base axis {0°, 45°, 90 The difference of °,135°} corresponds to 4 codewords {0,1,2,3} respectively;

根据上述的对应的码字和图形的对应关系,按照得到的伪随机M阵列模版,将X-型基元依次代入到图形阵列模板当中,生成大小为768×1024的编码投影模板,单个X-型基元符号大小为10×10pixel,X-型基元符号间的间隔设定为9pixel,该编码投影模板以黑色为背景,白色作为X-型基元图形的底色,生成单色编码投影模板,有利于降低车门外板表面反光程度。According to the correspondence between the above corresponding codewords and graphics, according to the obtained pseudo-random M array template, the X-type primitives are sequentially substituted into the graphics array template to generate a coded projection template with a size of 768×1024. A single X- The size of the type primitive symbol is 10×10pixel, and the interval between the X-type primitive symbols is set to 9pixel. The coding projection template uses black as the background and white as the background color of the X-type primitive graphics to generate a monochrome coding projection The template is beneficial to reduce the degree of reflection on the surface of the outer panel of the car door.

技术方案中所述的检测图像解码识别阶段的步骤如下:The steps in the detection image decoding and recognition stage described in the technical solution are as follows:

1)对摄像机图像中车门外板表面的初始检测的图像进行图像预处理;1) Image preprocessing is carried out on the image of the initial detection of the surface of the outer panel of the car door in the camera image;

2)对摄像机图像中车门外板表面的投影图像进行基元分割及模式识别;2) Perform primitive segmentation and pattern recognition on the projected image on the surface of the door outer panel in the camera image;

3)对摄像机图像中车门外板表面投影图像特征角点和编码投影模板特征角点进行立体匹配。3) Stereo matching is performed on the feature corner points of the projected image on the surface of the door outer panel and the feature corner points of the coded projection template in the camera image.

技术方案中所述的对摄像机图像中车门外板表面的初始检测的图像进行图像预处理包括如下步骤:The image preprocessing described in the technical solution to the image of the initial detection of the surface of the outer panel of the car door in the camera image includes the following steps:

1)对摄像机图像中的目标区域图像采取掩膜操作,获得投射有编码投影模板的车门外板表面的局部区域图像,剔除无用背景区域;1) Take a mask operation on the target area image in the camera image, obtain the local area image on the surface of the door outer panel projected with the coded projection template, and eliminate the useless background area;

2)对获得的目标区域图像进行高斯滤波,剔除噪声;2) Gaussian filtering is performed on the obtained target area image to remove noise;

3)计算目标区域图像背景的平均灰度值,并与原始图像灰度值相减,对背景进行剔除,使背景灰度均匀化,避免背景图像中灰度梯度变化,影响边缘提取的结果,导致提取出过多的非基元符号边缘,给分割标记带来干扰;3) Calculate the average gray value of the image background in the target area, and subtract it from the original image gray value, remove the background, make the background gray uniform, avoid the gray gradient change in the background image, and affect the edge extraction result, Leading to the extraction of too many non-primitive symbol edges, causing interference to the segmentation mark;

4)为了使目标区域图像中的X-型基元符号边缘更加突出,采用拉普拉斯5邻域边缘增强法强化目标区域图像中X-型基元符号边缘,利于边缘提取。4) In order to make the edge of the X-type primitive symbol in the image of the target area more prominent, the Laplacian 5-neighborhood edge enhancement method is used to strengthen the edge of the X-type primitive symbol in the image of the target area, which is beneficial to edge extraction.

技术方案中所述的对摄像机图像中车门外板表面的投影图像进行基元分割及模式识别包括如下步骤:Carrying out primitive segmentation and pattern recognition of the projected image on the surface of the outer panel of the car door in the camera image described in the technical solution includes the following steps:

1)X-型基元符号边缘提取及分割标记:1) X-type primitive symbol edge extraction and segmentation marking:

采用canny算子对局部目标区域图像进行边缘提取,能够获得全部X-型基元符号的边缘以及大量非基元符号边缘,边缘提取后图像为二值图像,边缘部分强度值为1,非边缘强度值为0;在进行角点计算以及较长主惯性轴角度计算时,要利用到所有的基元符号的边缘的坐标位置,如果存在较多的非基元符号的边缘,会导致出现多个非基元符号特征角点以及角点提取不准,因此需要进行剔除;并且由于在计算X-型基元符号边缘图像的特征角点坐标以及对X-型基元符号的码字进行还原需要单独对每个X-型基元符号边缘进行计算,使得不同的X-型基元符号之间保持相对独立,在计算过程中互不影响,因此还需要对每个X-型基元符号采用分割标记算法对不同的X-型基元符号进行分类标号,按照标号的不同依次进行计算,不同标号的X-型基元符号不能同时进行运算;The canny operator is used to extract the edge of the local target area image, and the edges of all X-type primitive symbols and a large number of non-primitive symbols can be obtained. After edge extraction, the image is a binary image, and the intensity value of the edge part is 1, and the non-edge The intensity value is 0; when calculating the corner point and the long main inertial axis angle, the coordinate positions of the edges of all primitive symbols should be used. If there are many edges of non-primitive symbols, it will cause multiple A non-primitive symbol feature corner point and corner point extraction are not accurate, so it needs to be eliminated; and because of calculating the feature corner point coordinates of the X-type primitive symbol edge image and restoring the codeword of the X-type primitive symbol It is necessary to calculate the edge of each X-type primitive symbol separately, so that the different X-type primitive symbols remain relatively independent and do not affect each other during the calculation process, so it is also necessary to calculate each X-type primitive symbol Use the segmentation labeling algorithm to classify and label different X-type primitive symbols, and perform calculations according to the different labels, and the X-type primitive symbols with different labels cannot be operated at the same time;

2)摄像机图像中车门外板表面投影图像特征角点提取:2) Feature corner point extraction of the projected image on the surface of the outer panel of the door in the camera image:

a.基于形心的特征角点粗定位:a. Coarse positioning of feature corners based on centroid:

采用形心坐标计算公式,对得到的每个X-型基元符号的边缘坐标以及灰度强度值对按照标记顺序利用静矩公式单独计算形心坐标;Using the formula for calculating the centroid coordinates, calculate the centroid coordinates separately using the static moment formula for the obtained edge coordinates and gray intensity value pairs of each X-type primitive symbol according to the marking order;

首先静矩公式为:First, the static moment formula is:

Mm pp qq == ∫∫ -- ∞∞ ∞∞ ∫∫ -- ∞∞ ∞∞ xx pp ythe y qq ff (( xx ,, ythe y )) dd xx dd ythe y -- -- -- (( 88 ))

公式中:x表示x轴方向坐标值,y表示y轴方向坐标值,p、q取值根据计算的不同坐标轴的静矩来定,当计算x轴的静矩时p为0,q为1,当计算y轴静矩时p为1,q为0;将静矩公式引入到图像处理当中可写成:In the formula: x represents the coordinate value of the x-axis direction, y represents the coordinate value of the y-axis direction, and the values of p and q are determined according to the calculated static moments of different coordinate axes. When calculating the static moments of the x-axis, p is 0 and q is 1. When calculating the static moment of the y-axis, p is 1 and q is 0; introducing the static moment formula into image processing can be written as:

mm pp qq == ΣΣ ii == 00 kk -- 11 ΣΣ jj == 00 ll -- 11 ii pp jj qq ff (( ii ++ 11 ,, jj ++ 11 )) -- -- -- (( 99 ))

其中:k与l的乘积表示目标图像像素大小,f(i+1,j+1)表示图像坐标(i,j)处像素点的灰度强度,由于图像坐标系原点置于图像左上方的像素点上,图像坐标(0,0)正好对应像素坐标(1,1),因此每个像素点的坐标大小相对于其像素位置需要减1,在此处图像中边缘像素点为全部1,其余像素点都为0;Among them: the product of k and l represents the pixel size of the target image, f(i+1, j+1) represents the grayscale intensity of the pixel at the image coordinates (i, j), since the origin of the image coordinate system is placed at the upper left of the image On the pixel point, the image coordinate (0,0) corresponds to the pixel coordinate (1,1), so the coordinate size of each pixel point needs to be reduced by 1 relative to its pixel position. Here, the edge pixel points in the image are all 1, The remaining pixels are all 0;

则形心坐标为:Then the centroid coordinates are:

xx cc == mm 1010 mm 0000 ,, ythe y cc == mm 0101 mm 0000 -- -- -- (( 1010 ))

xc表示X-型基元符号在x方向的形心坐标;x c represents the centroid coordinates of the X-type primitive symbol in the x direction;

yc表示X-型基元符号在y方向的形心坐标;y c represents the centroid coordinates of the X-type primitive symbol in the y direction;

计算X-型基元符号形心时,根据标号1-n从小到大依次进行,当对标号为a的基元符号边缘计算形心坐标时,其中:1≤a≤n,只有标号为a的边缘坐标像素灰度值大小为1,其余都全部设定为零,因此避免其他边缘的对形心坐标计算的影响,同理依次进行n次计算,计算得到所有X-型基元符号边缘图像的形心坐标;When calculating the centroid of the X-type primitive symbol, proceed in order from small to large according to the labels 1-n. When calculating the centroid coordinates of the edge of the primitive symbol labeled a, where: 1≤a≤n, only the label is a The gray value of the edge coordinate pixel is 1, and the rest are all set to zero, so to avoid the influence of other edges on the calculation of the centroid coordinates, similarly perform n times of calculations in turn, and calculate all the X-type primitive symbol edges The centroid coordinates of the image;

b.基于Harris的特征角点精定位b. Fine positioning of feature corners based on Harris

由于采用基于形心的角点粗定位算法是基于X-型基元符号的边缘形状得到的角点坐标,当X-型基元符号发生变形时,得到的角点坐标相对于其真实角点坐标会发生偏移,因此在完成角点粗定位之后,还需将角点粗定位得到的结果代入到原初始图像中,在原始图像中以粗定位提取得到的坐标为中心,在其3×3的邻域内采用Harris角点提取算法根据灰度梯度进行搜索,寻找梯度变化最大点,取灰度梯度最大点位置坐标作为精定位坐标,得到的特征角点精定位结果;Since the corner point coarse positioning algorithm based on the centroid is based on the corner point coordinates obtained from the edge shape of the X-type primitive symbol, when the X-type primitive symbol is deformed, the obtained corner point coordinates are relative to its real corner point The coordinates will be shifted, so after the rough positioning of the corner points is completed, the results obtained by the rough positioning of the corner points need to be substituted into the original initial image. In the original image, the coordinates obtained by the rough positioning are taken as the center, and the 3× In the neighborhood of 3, the Harris corner point extraction algorithm is used to search according to the gray gradient to find the point with the largest gradient change, and the position coordinates of the point with the largest gray gradient gradient are taken as the fine positioning coordinates to obtain the fine positioning result of the characteristic corner points;

3)对摄像机图像中车门外板表面投影图像中X-型基元符号进行码字识别还原:3) Recognize and restore the code word of the X-type primitive symbol in the projected image on the surface of the door outer panel in the camera image:

采用计算较长主惯性轴和基轴之间的夹角对码字进行还原,采用惯性力矩积分公式计算较长主惯性轴和基轴之间的夹角,惯性力矩积分公式如下:The codeword is restored by calculating the angle between the longer main inertia axis and the base axis, and the inertia moment integral formula is used to calculate the angle between the longer main inertia axis and the base axis. The inertia moment integral formula is as follows:

CMCM pp qq == ΣΣ ii == 00 kk -- 11 ΣΣ jj == 00 ll -- 11 (( ii -- xx cc )) pp (( jj -- ythe y cc )) qq ff (( ii ++ 11 ,, jj ++ 11 )) -- -- -- (( 1111 ))

较长主惯性轴与水平坐标轴之间夹角公式如下:The formula for the angle between the longer main inertial axis and the horizontal coordinate axis is as follows:

αα == 11 22 aa rr cc tt aa nno (( 22 CMCM 1111 CMCM 2020 -- CMCM 0202 )) -- -- -- (( 1212 ))

X-基元符号上的小箭头方向指向的是较长主惯性轴的方向,而水平相邻的两个X-型基元形心之间的连线为基线,由于在投影过程中,由于无法保证水平投影使得图形阵列与水平方向保持一致,因此基线与水平方向之间存在着一定大小的角度,其夹角公式为:The direction of the small arrow on the X-type primitive symbol points to the direction of the longer main inertial axis, and the line between the centroids of two horizontally adjacent X-type primitives is the baseline, because in the projection process, due to There is no guarantee that the horizontal projection will keep the graphics array consistent with the horizontal direction, so there is a certain angle between the baseline and the horizontal direction, and the angle formula is:

ββ == aa rr cc tt aa nno (( ythe y nno -- ythe y nno -- 11 xx nno -- xx nno -- 11 )) -- -- -- (( 1313 ))

其中:(xn,yn)表示的是第n个X-型基元符号的特征角点坐标,则最后可得较长主惯性轴和基线之间夹角为:Among them: (x n , y n ) represents the characteristic corner point coordinates of the nth X-type primitive symbol, then finally the angle between the longer main inertial axis and the baseline can be obtained as:

Δ=α-β(14)Δ = α - β (14)

将差值范围设定为±10°,比较Δ与{0,45,90,135}之间的差值,如果两者之间的差值在设定误差范围内,则按照对应角度对应的{0,1,2,3}进行码字还原,依次进行比较,得到检测图像的码字矩阵。Set the difference range to ±10°, compare the difference between Δ and {0, 45, 90, 135}, if the difference between the two is within the set error range, then follow the {0 corresponding to the corresponding angle , 1, 2, 3} to restore the codeword, and compare them in turn to obtain the codeword matrix of the detected image.

技术方案中所述的对摄像机图像中车门外板表面投影图像特征角点和编码投影模板特征角点进行立体匹配是指:The three-dimensional matching of the feature corner points of the projection image on the surface of the door outer panel in the camera image and the feature corner points of the coded projection template as described in the technical solution refers to:

对目标图像完成解码工作之后,得到一个码字阵列,每个码字代表的不仅是一个X-型基元符号,而且也代表这个X-型基元符号的特征角点,同时也代表特征角点的图像坐标,为了确定目标图像中X-型基元符号在投影模板中的具体位置,即确定拍摄图像中X-型基元符号在投影模板中的对应位置,或者说摄像机图像中车门外板表面投影图像中特征角点所对应的在投影模板中的对应角点位置,实现摄像机图像和投影模板的一一匹配,根据基于邻域的空间编码策略,每个X-型基元符号的码值都由其上下左右8个邻域组成,因此为了方便立体匹配的进行,需要按照图中所示组合方式计算每个X-型基元符号的码值,这样得到的码值具有唯一性;After the target image is decoded, a codeword array is obtained, and each codeword represents not only an X-type primitive symbol, but also the characteristic corner point of the X-type primitive symbol, and also represents the characteristic angle The image coordinates of the point, in order to determine the specific position of the X-type primitive symbol in the target image in the projection template, that is, to determine the corresponding position of the X-type primitive symbol in the projection template in the captured image, or the camera image outside the door The corresponding corner positions in the projection template corresponding to the feature corners in the projection image on the surface of the board realize the one-to-one matching between the camera image and the projection template. According to the neighborhood-based spatial encoding strategy, each X-type primitive symbol The code value is composed of 8 neighborhoods of its upper, lower, left, and right sides. Therefore, in order to facilitate stereo matching, it is necessary to calculate the code value of each X-type primitive symbol according to the combination shown in the figure, so that the obtained code value is unique. ;

在得到每个对应X-型基元符号的码值之后,再采用循环搜索算法对原始伪随机M阵列进行搜索,根据检测得到的码值对原始编码投影模板的码值进行循环对比,取相似度最高的码值作立体匹配的结果,确定检测图像中每个X-型基元符号在原始编码投影模板中对应的位置。After obtaining the code value of each corresponding X-type primitive symbol, the circular search algorithm is used to search the original pseudo-random M array. The code value with the highest degree is used as the result of stereo matching, and the corresponding position of each X-type primitive symbol in the detection image in the original coding projection template is determined.

技术方案中所述的空间点云坐标计算及误差评定阶段的步骤如下:The steps in the space point cloud coordinate calculation and error assessment phase described in the technical proposal are as follows:

1)计算车门外板表面投影图像特征点的三维空间坐标1) Calculate the three-dimensional space coordinates of the feature points of the projected image on the surface of the outer panel of the car door

在实现摄像机图像特征角点和投影图像特征角点的一一匹配之后,利用结构光检测系统的标定结果,采用三角测量法计算出车门外板表面投影图像特征点的三维空间坐标,其中深度方向的空间坐标ZR的计算公式为:After realizing the one-to-one matching of the feature corners of the camera image and the feature corners of the projection image, using the calibration results of the structured light detection system, the triangulation method is used to calculate the three-dimensional space coordinates of the feature points of the projection image on the surface of the outer panel of the door, where the depth direction The calculation formula of the space coordinate Z R is:

ZZ RR == || || xx LL &OverBar;&OverBar; || || 22 (( &alpha;&alpha; &OverBar;&OverBar; RR ,, TT )) -- << &alpha;&alpha; &OverBar;&OverBar; RR ,, xx &OverBar;&OverBar; LL >> << xx &OverBar;&OverBar; LL ,, TT >> || || &alpha;&alpha; &OverBar;&OverBar; RR || || 22 || || xx LL &OverBar;&OverBar; || || 22 -- (( &alpha;&alpha; &OverBar;&OverBar; RR ,, xx &OverBar;&OverBar; LL )) 22 -- -- -- (( 1515 ))

式中:等表示的是点积操作符,其中表示的是完成立体匹配的左右图像坐标向量,R和T分别表示的是投影仪坐标系到摄像机坐标系的旋转矩阵和平移向量;采用三角测量法空间坐标计算公式,利用结构光系统标定结果,对车门表面特征点空间坐标进行计算,得到检测点云示意图;In the formula: etc. represent the dot product operator, where and Represents the left and right image coordinate vectors that complete the stereo matching, R and T represent the rotation matrix and translation vector from the projector coordinate system to the camera coordinate system respectively; use the triangulation method space coordinate calculation formula, and use the structured light system to calibrate the results, Calculate the space coordinates of the feature points on the surface of the car door to obtain a schematic diagram of the detection point cloud;

2)对计算得到的检测点云与三坐标测量机测得的点云模型进行配准:2) Register the calculated detection point cloud with the point cloud model measured by the three-coordinate measuring machine:

采用基于ICP的配准方法,其主要步骤分为粗配准和精配准两步,粗配准方法以高斯曲率和平均曲率作为配准特征,计算检测点云中每个点的高斯曲率和平均曲率,在点云模型中搜索与之最接近的点,设定误差条件,使检测点云与点云模型达到比较接近的状态,得初始配准结果;对初始匹配后的检测点云和点云模型采用ICP算法进行精确配准,使得检测点云和点云模型之间的形状偏差达到最小,采用的最小距离目标函数为:Using the ICP-based registration method, the main steps are divided into two steps: coarse registration and fine registration. The coarse registration method uses Gaussian curvature and average curvature as registration features, and calculates the Gaussian curvature and the average curvature of each point in the detected point cloud. Average curvature, search for the closest point in the point cloud model, set the error conditions, make the detection point cloud and the point cloud model reach a relatively close state, and get the initial registration result; the detection point cloud and the initial matching The point cloud model uses the ICP algorithm for precise registration, which minimizes the shape deviation between the detected point cloud and the point cloud model. The minimum distance objective function used is:

&Delta;&Delta; ii == &Sigma;&Sigma; jj == 11 Mm || || TT ii &CenterDot;&CenterDot; (( pp jj )) -- nno jj || || 22 -- -- -- (( 1616 ))

上式中,{pj(xj,yj,zj)|=1,2...k}=Pp为进行初始配准后得到的检测点云,{nj(xj,yj,zj)|j=1,2...k}=Nc为点云模型,得到的点云配准最终结果;In the above formula, {p j (x j , y j , z j )|=1, 2...k}=P p is the detection point cloud obtained after initial registration, {n j (x j , y j , z j )|j=1, 2...k}=N c is the point cloud model, and the final result of point cloud registration is obtained;

使检测点云与点云模型达到最佳配准之后,为了简化图像处理迭代过程,通过最近点搜索算法对配准后检测点云在点云模型中的最近点进行搜索,计算两者之间的距离,以此表示偏差;After the detection point cloud and the point cloud model achieve the best registration, in order to simplify the iterative process of image processing, the nearest point search algorithm is used to search for the closest point of the registered detection point cloud in the point cloud model, and calculate the distance between the two The distance, which represents the deviation;

为了更加清晰的表示出检测点云中不同区域的误差大小,利用颜色色斑图对误差进行表示,首先将颜色索引级别设定为64个级别,建立点云偏差数据和颜色索引之间的关系式如下:In order to express the error of different areas in the detection point cloud more clearly, the error is represented by the color patch map. First, the color index level is set to 64 levels, and the relationship between the point cloud deviation data and the color index is established. The formula is as follows:

RR GG BB __ ll ee vv ee ll == rr oo uu nno dd (( &Delta;&Delta; -- &Delta;&Delta; mm ii nno &Delta;&Delta; maxmax -- &Delta;&Delta; minmin ** (( LL -- 11 )) )) -- -- -- (( 1717 ))

公式中:Δ表示得到的偏差值大小,Δmax表示最大偏差值,Δmin表示最小偏差值,L表示颜色索引分级,RGB_level能计算得到检测点云中所有点的颜色索值大小。In the formula: Δ represents the obtained deviation value, Δ max represents the maximum deviation value, Δ min represents the minimum deviation value, L represents the color index classification, and RGB_level can calculate the color index value of all points in the detected point cloud.

与现有技术相比本发明的有益效果是:Compared with prior art, the beneficial effects of the present invention are:

1.目前针对车门外板外表面形状尺寸检测主要采用的是三坐标测量机,虽然检测精度较高但是检测速度较慢,而且不能实现100%在线检测,只能抽样检测,而且接触性检测容易对表面造成划伤。本发明所述的基于单投射编码结构光的车门外板形状尺寸检测方法以计算机视觉技术为基础,开发了一种能够针对运动物体进行形状尺寸检测的非接触检测方法,能实现自动化操作,检测速度较快,能够达到对车门外板外表面的100%在线检测目的。1. At present, the three-coordinate measuring machine is mainly used for the detection of the shape and size of the outer surface of the door outer panel. Although the detection accuracy is high, the detection speed is slow, and 100% online detection cannot be achieved, only sampling detection is possible, and contact detection is easy. cause scratches to the surface. The method for detecting the shape and size of the door outer panel based on single-projection encoded structured light in the present invention is based on computer vision technology, and develops a non-contact detection method that can detect the shape and size of moving objects, which can realize automatic operation and detection. The speed is fast, and it can achieve the purpose of 100% online detection of the outer surface of the outer panel of the car door.

2.本发明所述的基于单投射编码结构光的车门外板形状尺寸检测方法采用基于空间邻域编码策略的结构光视觉技术对运动物体进行检测,设计了一种以X-型几何图案作为基元的投影仪编码模板,当检测对象表面发生遮挡或者深度剧烈变化时,投影到检测物体表面的投影基元会随表面结构变化发生变形,X-型基元能够有效地改善基元变形导致的几何特征点位置的偏移现象,保证特征角点提取精度。2. The method for detecting the shape and size of the door outer panel based on single-projection coded structured light of the present invention uses the structured light vision technology based on the spatial neighborhood coding strategy to detect moving objects, and designs an X-shaped geometric pattern as The projector encoding template of the primitive, when the surface of the detection object is occluded or the depth changes drastically, the projection primitive projected onto the surface of the detection object will be deformed with the change of the surface structure, and the X-type primitive can effectively improve the deformation caused by the primitive The offset phenomenon of the geometric feature point position ensures the accuracy of feature corner point extraction.

3.本发明所述的基于单投射编码结构光的车门外板形状尺寸检测方法采用的结构光系统标定方法较为简便快捷,只需要进行一次成像即能完成摄像机和投影仪标定,方便实时搭建检测系统;同时采用颜色色斑图对检测误差进行表示,有利于检测结果清晰化。3. The structured light system calibration method adopted in the method for detecting the shape and size of the door outer panel based on single-projection coded structured light in the present invention is relatively simple and fast. Only one imaging is required to complete the calibration of the camera and projector, which is convenient for real-time construction and detection System; at the same time, the detection error is represented by the color patch map, which is conducive to the clarity of the detection results.

附图说明Description of drawings

下面结合附图对本发明作进一步的说明:Below in conjunction with accompanying drawing, the present invention will be further described:

图1是本发明所采用的基于单投射编码结构光的车门外板形状尺寸检测系统在线检测车门外板表面形状尺寸的示意图;Fig. 1 is a schematic diagram of the online detection of the surface shape and size of the door outer panel by the car door outer panel shape and size detection system based on single-projection coded structured light used in the present invention;

图2-a是本发明所采用的基于单投射编码结构光的车门外板形状尺寸检测方法中的摄像机成像示意图;Figure 2-a is a schematic diagram of camera imaging in the method for detecting the shape and size of the outer panel of a car door based on single-projection coded structured light adopted in the present invention;

图2-b是本发明所采用的基于单投射编码结构光的车门外板形状尺寸检测方法中的投影仪投影图像示意图;Fig. 2-b is a schematic diagram of the projected image of the projector in the method for detecting the shape and size of the outer panel of the car door based on single-projection coded structured light adopted in the present invention;

图3-1是本发明所述的基于单投射编码结构光的车门外板形状尺寸检测方法中的光平面相交示意图(任意平面);Figure 3-1 is a schematic diagram of light plane intersection (arbitrary plane) in the method for detecting the shape and size of the outer panel of a car door based on single-projection coded structured light according to the present invention;

图3-2是本发明所述的基于单投射编码结构光的车门外板形状尺寸检测方法中的空间几何变换原理示意图;Fig. 3-2 is a schematic diagram of the principle of spatial geometric transformation in the method for detecting the shape and size of the door outer panel based on single-projection coded structured light according to the present invention;

图4是本发明所述的基于单投射编码结构光的车门外板形状尺寸检测方法中的光平面相交示意图(标定平面);Fig. 4 is a schematic diagram of light plane intersection (calibration plane) in the method for detecting the shape and size of the outer panel of the car door based on single-projection coded structured light according to the present invention;

图5-a是本发明所述的基于单投射编码结构光的车门外板形状尺寸检测方法中生成的随机3x3子阵列示意图;Fig. 5-a is a schematic diagram of a random 3x3 sub-array generated in the method for detecting the shape and size of a door outer panel based on single-projection coded structured light according to the present invention;

图5-b是本发明所述的基于单投射编码结构光的车门外板形状尺寸检测方法中向右按顺序添加3x1列向量示意图;Fig. 5-b is a schematic diagram of sequentially adding 3x1 column vectors to the right in the method for detecting the shape and size of the outer panel of a car door based on single-projection coded structured light according to the present invention;

图5-c是本发明所述的基于单投射编码结构光的车门外板形状尺寸检测方法中向下按顺序添加1x3行向量示意图;Figure 5-c is a schematic diagram of sequentially adding 1x3 row vectors downward in the method for detecting the shape and size of the outer panel of a car door based on single-projection coded structured light according to the present invention;

图5-d是本发明所述的基于单投射编码结构光的车门外板形状尺寸检测方法中按顺序添加一个随机基元值构成一个新的3x3子阵列示意图;Fig. 5-d is a schematic diagram of a new 3x3 sub-array by sequentially adding a random primitive value in the method for detecting the shape and size of the outer panel of a car door based on single-projection coded structured light according to the present invention;

图6是本发明所述的基于单投射编码结构光的车门外板形状尺寸检测方法中对应用于检测车门外板表面形状尺寸的编码投影模板中码字排列规则的伪随机M阵列部分阵列结果示意图;Fig. 6 is the partial array result of the pseudo-random M array corresponding to the code word arrangement rule in the coded projection template used to detect the surface shape and size of the door outer panel in the method for detecting the shape and size of the outer panel of the car door based on single-projection coded structured light according to the present invention schematic diagram;

图7是本发明所述的基于单投射编码结构光的车门外板形状尺寸检测方法中用于检测车门外板表面形状尺寸的投影模板中的X-型基元符号以及码字分类规则示意图;7 is a schematic diagram of X-type primitive symbols and code word classification rules in the projection template used to detect the surface shape and size of the door outer panel in the method for detecting the shape and size of the outer panel of the car door based on single-projection coded structured light according to the present invention;

图8-a是本发明所述的基于单投射编码结构光的车门外板形状尺寸检测方法中用于投影仪投影到车门外板表面检测形状尺寸大小的伪随机M阵列编码投影模板;Fig. 8-a is a pseudo-random M-array coded projection template used for projecting a projector onto the surface of a car door outer panel to detect the shape and size in the method for detecting the shape and size of a car door outer panel based on single-projection coded structured light according to the present invention;

图8-b是图8-a中矩形方框局部区域的放大示意图;Figure 8-b is an enlarged schematic diagram of a local area of the rectangular box in Figure 8-a;

图9是本发明所述的基于单投射编码结构光的车门外板形状尺寸检测方法中对采用摄像机对车门外板表面投影图像进行拍摄得到的灰度图像进行图像预处理操作的流程框图;9 is a block diagram of the image preprocessing operation for the grayscale image obtained by shooting the projected image of the surface of the door outer panel by using a camera in the method for detecting the shape and size of the outer panel of the door based on single-projection coded structured light according to the present invention;

图10是本发明所述的基于单投射编码结构光的车门外板形状尺寸检测方法中对预处理之后车门外板表面X-型基元符号边缘增强图像进行基元分割标记及解码识别操作的流程框图;Fig. 10 is a schematic diagram of performing element segmentation marking and decoding recognition operations on the edge-enhanced image of the X-type primitive symbol on the surface of the door outer panel after preprocessing in the method for detecting the shape and size of the outer panel of the car door based on single-projection coded structured light according to the present invention flow chart;

图11是本发明所述的基于单投射编码结构光的车门外板形状尺寸检测方法中对预处理后的得到检测图像进行边缘提取得到的X-型基元符号边缘示意图;11 is a schematic diagram of the X-type primitive symbol edge obtained by performing edge extraction on the preprocessed detected image in the method for detecting the shape and size of the outer panel of the car door based on single-projection coded structured light according to the present invention;

图12-a是本发明所述的基于单投射编码结构光的车门外板形状尺寸检测方法中对X-型基元符号边缘图像进行基元分割标记以及非基元区域剔除后得到的X-型基元符号边缘图像;Fig. 12-a is the X-shaped primitive symbol edge image of the X-shaped primitive symbol edge image in the method for detecting the shape and size of the door outer panel based on single-projection coded structured light according to the present invention. type primitive symbol edge image;

图12-b是图12-a中矩形方框局部区域的放大示意图;Figure 12-b is an enlarged schematic diagram of a local area of the rectangular box in Figure 12-a;

图13是本发明所述的基于单投射编码结构光的车门外板形状尺寸检测方法中对摄像机图像中车门外板表面投影图像进行边缘提取后进行特征角点粗定位得到粗定位结果局部区域放大图;Fig. 13 is the detection method for the shape and size of the door outer panel based on single-projection coded structured light according to the present invention. After the edge extraction is performed on the projection image of the door outer panel surface in the camera image, the rough positioning of the feature corners is performed to obtain the local area enlargement of the coarse positioning result. picture;

图14是本发明所述的基于单投射编码结构光的车门外板形状尺寸检测方法中对摄像机图像中车门外板表面投影图像以特征角点粗定位坐标为中心在3×3邻域内进行Harris特征角点精定位得到的特征角点精定位结果局部区域放大图;Fig. 14 shows the projection image of the surface of the door outer panel in the camera image in the method for detecting the shape and size of the outer panel of the car door based on single-projection coded structured light according to the present invention. Harris The enlarged map of the local area of the fine positioning result of the feature corner points obtained by the fine positioning of the feature corner points;

图15是本发明所述的基于单投射编码结构光的车门外板形状尺寸检测方法中摄像机图像中车门外板表面投影图像中局部区域X-型基元符号较长主惯性轴与基轴之间夹角示意图;Fig. 15 shows the relationship between the X-type primitive symbol in the local area in the projection image of the surface of the door outer panel in the camera image in the method for detecting the shape and size of the outer panel of the car door based on single-projection coded structured light according to the present invention. Schematic diagram of the included angle;

图16是本发明所述的基于单投射编码结构光的车门外板形状尺寸检测方法中对检测得到的车门外板表面投影图像以及投影模板中非边缘基元进行编码的码值组合方式示意图;Fig. 16 is a schematic diagram of the code value combination method for encoding the detected projected image of the surface of the door outer panel and the non-edge primitives in the projection template in the method for detecting the shape and size of the outer door panel based on single-projection encoded structured light according to the present invention;

图17是本发明所述的基于单投射编码结构光的车门外板形状尺寸检测方法中采用编码结构光视觉技术对车门外板表面形状尺寸进行检测得到的三维点云示意图;Fig. 17 is a schematic diagram of a three-dimensional point cloud obtained by detecting the surface shape and size of the door outer panel using the coded structured light vision technology in the method for detecting the shape and size of the outer door panel based on single-projection encoded structured light according to the present invention;

图18是本发明所述的基于单投射编码结构光的车门外板形状尺寸检测方法中采用三坐标测量机对车门外板进行检测得到的点云CAD模型示意图;18 is a schematic diagram of a point cloud CAD model obtained by using a three-coordinate measuring machine to detect the door outer panel in the method for detecting the shape and size of the outer panel of the car door based on single-projection coded structured light according to the present invention;

图19是本发明所述的基于单投射编码结构光的车门外板形状尺寸检测方法中将检测得到的三维点云和三坐标测量机检测得到的点云CAD模型置于同一世界坐标系下得到的检测点云和点云CAD模型相对位置示意图;Fig. 19 is obtained by placing the detected three-dimensional point cloud and the point cloud CAD model detected by a three-coordinate measuring machine in the same world coordinate system in the method for detecting the shape and size of the door outer panel based on single-projection coded structured light according to the present invention Schematic diagram of the relative position of the detected point cloud and point cloud CAD model;

图20-a是本发明所述的基于单投射编码结构光的车门外板形状尺寸检测方法中采用基于ICP的配准算法对点云进行粗配准的结果示意图;Fig. 20-a is a schematic diagram of the results of coarse registration of point clouds using an ICP-based registration algorithm in the method for detecting the shape and size of a door outer panel based on single-projection coded structured light according to the present invention;

图20-b是本发明所述的基于单投射编码结构光的车门外板形状尺寸检测方法中采用基于ICP的配准算法对点云进行精配准的结果示意图;Fig. 20-b is a schematic diagram of the results of precise registration of point clouds using an ICP-based registration algorithm in the method for detecting the shape and size of a door outer panel based on single-projection coded structured light according to the present invention;

图21是本发明所述的基于单投射编码结构光的车门外板形状尺寸检测方法中采用计算两点云之间最近点之间距离的方法表示检测点云和点云CAD模型之间偏差得到的偏差统计分布图;Fig. 21 shows the method of calculating the distance between the closest points between two point clouds in the method for detecting the shape and size of the door outer panel based on single-projection coded structured light according to the present invention, indicating that the deviation between the detected point cloud and the point cloud CAD model is obtained The statistical distribution map of the deviation;

图22是本发明所述的基于单投射编码结构光的车门外板形状尺寸检测方法的流程框图;Fig. 22 is a flow chart of the method for detecting the shape and size of the door outer panel based on single-projection coded structured light according to the present invention;

图中:1.车门外板流水线,2.摄像机,3.信息处理终端设备,4.投影仪,In the figure: 1. Door outer panel assembly line, 2. Camera, 3. Information processing terminal equipment, 4. Projector,

具体实施方式detailed description

下面结合附图对本发明作详细的描述:The present invention is described in detail below in conjunction with accompanying drawing:

参阅图1,图中是本发明设计的一种基于单投射编码结构光的车门外板形状尺寸检测系统的简化示意图,其中标注1的是车门外板流水线,标注2的是摄像机,标注3的是信息处理终端设备,标注4的是投影仪,当车门外板流水线1沿轨道缓慢移动时,由投影仪4投影图案到车门外板表面,然后再由摄像机2进行摄取,再传输到信息处理终端设备3进行处理,最终得到车门外板表面的检测结果,将所得检测结果与点云CAD模型进行对比,既可获知该车门外板表面的制造精度是否满足生产要求。Referring to Fig. 1, the figure is a simplified schematic diagram of a door outer panel shape and size detection system based on single-projection coded structured light designed by the present invention, wherein the one marked with 1 is the assembly line of the outer panel of the car door, the one marked with 2 is the camera, and the one marked with 3 It is an information processing terminal device, and the one marked with 4 is a projector. When the door outer panel assembly line 1 moves slowly along the track, the projector 4 projects the pattern onto the surface of the door outer panel, and then the camera 2 takes it and transmits it to the information processing The terminal device 3 performs processing, and finally obtains the detection result of the surface of the outer panel of the car door. By comparing the obtained detection result with the point cloud CAD model, it can be known whether the manufacturing accuracy of the surface of the outer panel of the car door meets the production requirements.

检测时,摄像机2位于车门外板正前方1.5米处,摄像机2采用的是北京大恒图像设备公司生产的型号为DH-HV1302UM-T的分辨率为1280×1024的CMOS和焦距f为12.5-75mm的CCTV镜头;投影仪4被放置于车门外板正前方1.5米处,使用型号是InfocusLP260的投影仪,标准分辨率为800×600,支持最大分辨率为1024×768。参阅图2,标定平面为一个长2米宽1米的白底写字板,左下角粘有9×9的摄像机棋盘格标靶,右侧留有空间以供投射投影棋盘格标靶。During detection, the camera 2 is located 1.5 meters directly in front of the outer panel of the car door. The camera 2 adopts a CMOS model DH-HV1302UM-T produced by Beijing Daheng Image Equipment Co., Ltd. with a resolution of 1280×1024 and a focal length f of 12.5- 75mm CCTV lens; Projector 4 is placed 1.5 meters directly in front of the outer panel of the car door, using a projector model of InfocusLP260, with a standard resolution of 800×600 and a maximum supported resolution of 1024×768. Referring to Figure 2, the calibration plane is a white-bottomed writing board with a length of 2 meters and a width of 1 meter. A 9×9 camera checkerboard target is glued to the lower left corner, and a space is left on the right side for the projection checkerboard target.

车门外板形状尺寸的整个检测过程主要分成4个阶段:1.基于单投射编码结构光的车门外板形状尺寸检测系统(简曰结构光检测系统)标定阶段;2.编码投影模板设计阶段;3.检测图像解码识别阶段;4.空间点云坐标计算以及误差评定阶段。The entire detection process of the shape and size of the outer door panel is mainly divided into four stages: 1. The calibration stage of the shape and size detection system of the door outer panel based on single-projection coded structured light (structured light detection system for short); 2. The stage of coded projection template design; 3. Detection image decoding and recognition stage; 4. Spatial point cloud coordinate calculation and error evaluation stage.

1.结构光检测系统标定阶段1. Calibration stage of structured light detection system

为了保证检测的顺利进行,首先必须对本方法所采用的设备即结构光检测系统的两个组成部分即摄像机2和投影仪4进行标定,才能建立起空间位置和图像坐标之间的对应的非线性关系,利用这种非线性关系,才能计算检测图像特征点对应的空间坐标。In order to ensure the smooth progress of the detection, it is first necessary to calibrate the two components of the equipment used in this method, that is, the structured light detection system, namely the camera 2 and the projector 4, in order to establish the corresponding nonlinearity between the spatial position and the image coordinates. Using this nonlinear relationship, the spatial coordinates corresponding to the feature points of the detected image can be calculated.

本发明采用基于平面的标定方法对结构光检测系统进行标定,共拍摄12幅图像,摄像机2以标定平面左下角尺寸为270×270mm的9×9黑白棋盘格图像作为标靶,投影仪标靶是采用投影仪4投射到标定平面右侧的12×16黑白棋盘格图像。The present invention uses a plane-based calibration method to calibrate the structured light detection system, and takes 12 images in total. The camera 2 uses a 9×9 black and white checkerboard image with a size of 270×270 mm in the lower left corner of the calibration plane as a target, and the projector targets It is a 12×16 black and white checkerboard image projected to the right side of the calibration plane by projector 4.

1)对摄像机进行标定1) Calibrate the camera

参阅图2,利用张正友标定的方法(ZHANGZY,AFlexibleNewTechniqueforCameraCalibration[R].MicrosoftCorporation,NSR-TR-98-71,1998)进行标定,首先在标定平面的左下角粘贴9×9的摄像机棋盘格标靶并用投影仪4投射设计的12×16棋盘格标靶到标定平面的右侧,然后再利用摄像机2拍摄整个标定平面,标定平面如图2-a所示。将拍摄得到的12幅图像中左下角的摄像机棋盘格标靶图像进行特征角点提取,每个摄像机棋盘格标靶图像可以提取100个角点,12幅图像总共得到1200个特征角点图像坐标。根据张正友标定方法,世界坐标系设定在摄像机棋盘格标靶图像最左上角处的一个角点上,Z方向坐标值取为零,由于每个棋盘格尺寸大小精确设计为30mm,因此棋盘格特征角点在X和Y方向的世界坐标可精确得知。因此在得到标定平面上棋盘格标靶图像特征角点坐标以及对应点的空间坐标以后,即可利用工具箱完成标定,计算得到摄像机2的内外部参数。Referring to Figure 2, use Zhang Zhengyou’s calibration method (ZHANGZY, AFlexibleNewTechniqueforCameraCalibration[R].MicrosoftCorporation, NSR-TR-98-71, 1998) for calibration, first paste a 9×9 camera checkerboard target on the lower left corner of the calibration plane and use Projector 4 projects the designed 12×16 checkerboard target to the right side of the calibration plane, and then uses camera 2 to photograph the entire calibration plane, as shown in Figure 2-a. The camera checkerboard target image in the lower left corner of the 12 captured images is subjected to feature corner extraction. Each camera checkerboard target image can extract 100 corner points, and a total of 1200 feature corner image coordinates are obtained from the 12 images. . According to Zhang Zhengyou's calibration method, the world coordinate system is set at a corner point at the upper left corner of the camera checkerboard target image, and the coordinate value in the Z direction is taken as zero. Since the size of each checkerboard is precisely designed to be 30mm, the checkerboard The world coordinates of the feature corners in the X and Y directions can be accurately known. Therefore, after obtaining the coordinates of the characteristic corner points of the checkerboard target image on the calibration plane and the spatial coordinates of the corresponding points, the toolbox can be used to complete the calibration and calculate the internal and external parameters of the camera 2 .

2)对投影仪进行标定2) Calibrate the projector

参阅图3-1,首先对摄像机图像中的投影标靶进行特征角点的提取,然后再根据已经得到的摄像机2的内外参数结果,根据光平面相交法可以计算位于标定平面上投影图像的特征角点在世界坐标系下的空间坐标,至此,投影模板的图像坐标和空间坐标都已经计算得出,因此可以采用与摄像机标定相同的方法计算投影仪的标定参数,得到投影仪4的内外部参数以及投影仪4和摄像机2之间的旋转平移矩阵。Referring to Figure 3-1, first extract the feature corners of the projected target in the camera image, and then calculate the features of the projected image on the calibration plane according to the obtained internal and external parameters of camera 2 according to the light plane intersection method The spatial coordinates of the corner points in the world coordinate system. So far, the image coordinates and spatial coordinates of the projection template have been calculated. Therefore, the calibration parameters of the projector can be calculated by the same method as the camera calibration, and the internal and external dimensions of the projector 4 can be obtained. parameters and the rotation-translation matrix between projector4 and camera2.

由于需要在摄像机2标定的基础上,采用光平面相交法计算标定平面上投影图像特征角点的空间坐标,因此需要对光平面相交法进行详细介绍:Since it is necessary to use the light plane intersection method to calculate the spatial coordinates of the projected image feature corners on the calibration plane on the basis of camera 2 calibration, it is necessary to introduce the light plane intersection method in detail:

参阅图3-2,根据空间几何变换原理可知,在一个三维空间当中对一个平面进行定义,只需要知道该平面上任意一个已知点以及通过该点的一个非0的法向量既可。而旋转矩阵R的第三列向量n可以看作是摄像机2参考坐标系下,通过世界坐标系原点的标定平面π的法向量,而平移矩阵可以看作是世界坐标系原点p在摄像机坐标系下的空间坐标。Referring to Figure 3-2, according to the principle of spatial geometric transformation, to define a plane in a three-dimensional space, it is only necessary to know any known point on the plane and a non-zero normal vector passing through the point. The third column vector n of the rotation matrix R can be regarded as the normal vector of the calibration plane π passing through the origin of the world coordinate system under the reference coordinate system of camera 2, and the translation matrix can be regarded as the origin p of the world coordinate system in the camera coordinate system The space coordinates below.

因此标定平面π上任意点r的方程可以表示为:Therefore, the equation of any point r on the calibration plane π can be expressed as:

n×(r-p)=0(1)n×(r-p)=0(1)

公式(1)为两矢量间数量积形式,用表示是笛卡尔坐标系各方向单位向量,则法向量n以及点向量r可以表示为:Formula (1) is in the form of the quantitative product between two vectors, using The representation is a unit vector in each direction of the Cartesian coordinate system, then the normal vector n and the point vector r can be expressed as:

nno == aa xx ^^ ++ bb ythe y ^^ ++ cc zz ^^ -- -- -- (( 22 ))

rr == xx &times;&times; xx ^^ ++ ythe y &times;&times; ythe y ^^ ++ zz &times;&times; zz ^^ -- -- -- (( 33 ))

设d=-n×p,由于n和p已知,因此d也可知,标定平面π的方程可以表示为:Let d=-n×p, since n and p are known, so d is also known, the equation of the calibration plane π can be expressed as:

ax+by+cz+d=0,(a,b,c∈R且不都等于0)(4)ax+by+cz+d=0, (a, b, c∈R and not all equal to 0) (4)

利用摄像机2标定结果,将摄像机图像中投影仪标靶特征角点图像坐标代入到反透视投影变换矩阵当中,计算其对应的空间点坐标,公式如下:Using the calibration result of camera 2, the image coordinates of the characteristic corner points of the projector target in the camera image are substituted into the reverse perspective projection transformation matrix, and the corresponding spatial point coordinates are calculated. The formula is as follows:

sthe s RR xx sRR ythe y sRR zz sthe s == &lsqb;&lsqb; KK intint KK ee xx tt &rsqb;&rsqb; -- 11 xx ythe y 11 -- -- -- (( 55 ))

s在上式中表示比例因子,Kint和Kext分别表示摄像机的内外部参数,s的大小确定了计算得到的空间点坐标在空间中的具体位置和深度,如图3所示,当s不同时,空间点坐标所形成的平面在空间中的位置也不同。因此为了求解标定平面上投影图像特征点的空间坐标,需要确定一个比例因子s,使得采用式(5)计算得到的空间点位于标定平面上,如图4所示,在计算得到特定比例因子s的情况下,空间点都位于标定平面上,则此时得到空间点坐标则为标定平面上投影图像特征角点的世界坐标。因此将空间坐标(sRx,sRy,sRz)代入到平面方程式(4)中,得到的公式如下:s represents the scale factor in the above formula, K int and K ext represent the internal and external parameters of the camera respectively, and the size of s determines the specific position and depth of the calculated spatial point coordinates in space, as shown in Figure 3, when s At the same time, the position of the plane formed by the spatial point coordinates in space is also different. Therefore, in order to solve the spatial coordinates of the projected image feature points on the calibration plane, it is necessary to determine a scale factor s, so that the spatial points calculated by formula (5) are located on the calibration plane, as shown in Figure 4. After the calculation, the specific scale factor s In the case of , the spatial points are all located on the calibration plane, and the coordinates of the spatial points obtained at this time are the world coordinates of the feature corner points of the projected image on the calibration plane. Therefore, substituting the space coordinates (sR x , sR y , sR z ) into the plane equation (4), the obtained formula is as follows:

a(sRx)+b(sRy)+c(sRz)+d=0(6)a(sR x )+b(sR y )+c(sR z )+d=0(6)

上式中a、b、c以及d均为已知数,Rx、Ry以及Rz可以通过摄像机2的标定结果利用透视投影变换公式既可求出。得到标定平面上投影图像特征角点的空间坐标后,同时再对投影仪投射的投影标靶进行特征角点提取,则可以获得标定所需的全部二维的图像坐标以及对应的空间三维坐标,再利用“逆相机”标定方法,既可对投影仪4进行标定。In the above formula, a, b, c, and d are all known numbers, and R x , R y , and R z can be obtained by using the perspective projection transformation formula from the calibration result of the camera 2 . After obtaining the spatial coordinates of the feature corners of the projection image on the calibration plane, and then extracting the feature corners of the projection target projected by the projector, all the two-dimensional image coordinates and corresponding three-dimensional coordinates required for calibration can be obtained. The projector 4 can be calibrated by using the "reverse camera" calibration method.

根据得到摄像机2以及投影仪标定结果,进行反投影误差计算,摄像机2标定在x方向的平均误差为0.17827pixel,摄像机2标定在在y方向的平均误差为0.16199pixel;投影仪标定在x方向的平均误差为0.38383pixel,投影仪标定在y方向的平均误差为0.4555pixel。摄像机2和投影仪4之间的旋转平移矩阵为:According to the calibration results of camera 2 and projector, calculate the back-projection error. The average error of camera 2 calibration in the x direction is 0.17827pixel, and the average error of camera 2 calibration in the y direction is 0.16199pixel; the projector is calibrated in the x direction The average error is 0.38383pixel, and the average error of the projector calibration in the y direction is 0.4555pixel. The rotation-translation matrix between camera 2 and projector 4 is:

RR == 0.97110.9711 0.03530.0353 -- 0.23620.2362 -- 0.00330.0033 0.99090.9909 0.13450.1345 0.23880.2388 -- 0.12980.1298 0.96240.9624 TT == 326.3736326.3736 -- 413.8772413.8772 -- 558.2592558.2592

2.编码投影模板设计阶段2. Code projection template design stage

为满足100%在线检测,实现对动态对象的检测目的,本发明所述的基于单投射编码结构光的车门外板形状尺寸检测方法中采用的是基于邻域编码策略的结构光视觉技术,在检测过程中只需投射一幅编码图案,该编码图案是一个大小为40行45列的由4个不同方向的X-型基元符号构成的图形阵列,图形阵列中图形的排列顺序由一个伪随机M阵列决定,该图形阵列具有以下特性:每3×3子阵列内的图形在整个阵列模板中只出现一次,而且任意两个子阵列中对应位置的图形至少有3个不一样。除边缘外的每个X-型基元符号都经过了编码,其编码值大小都由其3×3邻域内的元素共同决定。该图形阵列根据X-型基元符号较长主惯性轴与基轴夹角不同分别赋予了不同的码字,因此图形阵列又对应着一个40×45的数字阵列,该阵列称为伪随机M阵列,伪随机M阵列具有的特性决定了图形阵列的特性,采用本发明设计的编码投影模板有利于实现对动态物体的检测,并且具有较好的适应性和稳定性。In order to meet 100% online detection and realize the detection of dynamic objects, the method for detecting the shape and size of the outer panel of the car door based on single-projection coded structured light in the present invention adopts the structured light vision technology based on the neighborhood coding strategy. During the detection process, only one coding pattern needs to be projected. The coding pattern is a graphics array with a size of 40 rows and 45 columns consisting of 4 X-shaped primitive symbols in different directions. The arrangement order of graphics in the graphics array is determined by a pseudo The random M array determines that the pattern array has the following characteristics: the pattern in each 3×3 subarray appears only once in the entire array template, and at least 3 patterns in corresponding positions in any two subarrays are different. Each X-shaped primitive symbol except the edge is coded, and its coded value size is jointly determined by the elements in its 3×3 neighborhood. The graphic array is given different codewords according to the angle between the longer main inertial axis and the base axis of the X-type primitive symbol, so the graphic array corresponds to a 40×45 digital array, which is called a pseudo-random M Array, the characteristics of the pseudo-random M array determine the characteristics of the graphic array, and the coding projection template designed by the present invention is beneficial to the detection of dynamic objects, and has better adaptability and stability.

1)对应图形阵列的伪随机M数组生成1) Pseudo-random M array generation corresponding to the graphic array

伪随机M数组的特征在于,特定窗口大小(3×3)的子数组在全部数组中具有唯一性,任意两个窗口之间的汉明距离越大,表示两者之间的区别越大。伪随机M数组汉明距离计算方式如下式:The characteristic of the pseudo-random M array is that the sub-array of a specific window size (3×3) is unique in the entire array, and the greater the Hamming distance between any two windows, the greater the difference between them. The calculation method of the pseudo-random M array Hamming distance is as follows:

其中:V(ij)表示3×3邻域的9元素向量,H表示两不同3×3邻域之间对应位置向量出现不同码字的次数,即为汉明距离,汉明距离越大,表示窗口相异程度越大。本发明构造的伪随机M阵列,将最小汉明距离大小设定为3,即表示任意两个3×3窗口的子阵列对应的元素至少有3个是不一样的,这样的设计有利于增强子阵列的稳定性以及对检测对象表面空间变化程度的适应性。Among them: V (ij) represents the 9-element vector of the 3×3 neighborhood, and H represents the number of times that different codewords appear in the corresponding position vectors between two different 3×3 neighborhoods, which is the Hamming distance. The larger the Hamming distance, Indicates the greater the degree of window dissimilarity. In the pseudo-random M array constructed by the present invention, the minimum Hamming distance is set to 3, which means that at least 3 elements corresponding to any two sub-arrays of 3×3 windows are different, and such a design is conducive to enhancing The stability of the sub-array and its adaptability to the degree of spatial variation of the surface of the detection object.

参阅图5-a至图5-d与图6,本发明需要生成数字基元为{0,1,2,3},最小汉明距离等于3,大小为40×45的伪随机M阵列;采用图中所示循环填充法可以完成符合本发明要求的伪随机阵列构建,首先在阵列左上角生成3×3的子阵列,然后沿右侧依次代入3×1的子阵列,比较相邻3×3窗口间的汉明距离大小是否符合条件,不符合重新代入,符合条件则依次向右进行直到边界为止;然后沿初始3×3数组的下方依次代入1×3子阵列,方法同上,直到边界为止;其次再依次在4×4的空白位置代入一个新的码值,组成一个新的3×3子阵列,和前面生成的所有子阵列比较汉明距离大小,符合条件继续,不符合重新代入,如代入所有可能码字都不满足,则重新开始本次构建过程。本发明采用图5-a至图5-d中所示方法得到的最小汉明距离等于3的部分阵列结果如图6所示。Referring to Fig. 5-a to Fig. 5-d and Fig. 6, the present invention needs to generate a pseudo-random M array whose digital primitives are {0, 1, 2, 3}, the minimum Hamming distance is equal to 3, and the size is 40×45; The construction of the pseudo-random array that meets the requirements of the present invention can be completed by using the circular filling method shown in the figure. First, a 3×3 subarray is generated in the upper left corner of the array, and then a 3×1 subarray is sequentially substituted along the right side, and the adjacent 3 subarrays are compared. Whether the Hamming distance between the ×3 windows meets the conditions, if not, re-substitute, if the conditions are met, proceed to the right until the boundary; then follow the bottom of the initial 3×3 array and substitute into the 1×3 sub-array, the method is the same as above, until to the boundary; secondly, substitute a new code value in the blank position of 4×4 to form a new 3×3 subarray, and compare the Hamming distance with all the subarrays generated before. Substituting, if all possible codewords are not satisfied, restart the construction process. Figure 6 shows the results of partial arrays with the minimum Hamming distance equal to 3 obtained by the present invention using the methods shown in Figure 5-a to Figure 5-d.

2)基于几何特征的X-型基元符号设计2) X-shaped primitive symbol design based on geometric features

一般来说,构造编码投影模板的几何基元图形常采用方形或者圆形,但是由于出现阴影或者遮挡情况下,以几何中心作为特征角点的圆形或者方形图案比较容易发生几何中心的偏移或者产生歧义角点,导致角点坐标提取不准。而本发明根据棋盘格的角点特征,设计一类X-型的如图7中所示的几何基元在遮挡或者缺失的情况下具有比较稳定的角点特征。该X-型基元符号以棋盘格图像为特征设计,关于特征角点中心对称,由成中心对称的三角形或正方形组成。根据较长主惯性轴与基轴之间的夹角角度大小{0°,45°,90°,135°}的不同分别对应4个码字{0,1,2,3}。Generally speaking, the geometric primitives for constructing coding projection templates often use squares or circles, but due to shadows or occlusions, circular or square patterns with geometric centers as feature corners are more likely to have geometric center deviations Or ambiguous corner points are generated, resulting in inaccurate extraction of corner point coordinates. However, according to the corner feature of the checkerboard, the present invention designs a class of X-shaped geometric primitives as shown in FIG. The X-shaped primitive symbol is characterized by a checkerboard image, is symmetrical about the center of the characteristic corners, and is composed of triangles or squares that are symmetrical to the center. According to the angles {0°, 45°, 90°, 135°} between the longer main inertial axis and the base axis, the four codewords {0, 1, 2, 3} are respectively corresponding.

根据上述的对应的码字和图形的对应关系,按照得到的伪随机M阵列模版,将X-型基元符号依次代入到图形阵列模板当中,生成大小为768×1024的如图8所示的编码投影模板,单个X-型基元符号大小为10×10pixel,X-型基元符号间的间隔设定为9pixel。该编码投影模板以黑色为背景,白色作为X-型基元符号的底色,生成单色编码投影模板,有利于降低车门外板表面反光程度。According to the correspondence between the above-mentioned corresponding codewords and graphics, and according to the obtained pseudo-random M array template, the X-type primitive symbols are sequentially substituted into the graphics array template, and a size of 768×1024 is generated as shown in Figure 8 Encoding projection template, the size of a single X-type primitive symbol is 10×10pixel, and the interval between X-type primitive symbols is set to 9pixel. The coded projection template uses black as the background and white as the background color of the X-shaped primitive symbol to generate a single-color coded projection template, which is beneficial to reduce the degree of reflection on the surface of the outer panel of the car door.

3.检测图像解码识别阶段3. Detection image decoding recognition stage

完成结构光检测系统标定以及编码投影模板设计后,可以开始进行检测;首先将已完成编码的投影模板通过计算机与投影仪4相连接,利用投影仪4向轿车车门外板表面投射本发明设计的编码投影模板,再从一个合适的角度利用摄像机2对车门外板表面图像进行拍摄,并将拍摄的图像传送到个人计算机中进行一系列图像处理以及识别过程。After completing the calibration of the structured light detection system and the design of the coded projection template, the detection can be started; first, the coded projection template is connected to the projector 4 through the computer, and the projector 4 is used to project the surface of the car door outer panel to the surface of the car door outer panel. Encode the projection template, and then use the camera 2 to shoot the surface image of the door outer panel from a suitable angle, and transmit the captured image to a personal computer for a series of image processing and recognition processes.

1)对摄像机图像中车门外板表面的初始检测图像进行图像预处理1) Perform image preprocessing on the initial detection image of the surface of the door outer panel in the camera image

参阅图9,由于摄像机2拍摄的图像具有较多的无用背景,而且图像容易受到车门外板表面反光以及噪声影响,因此需要剔除无用的背景减少图像处理时间以及复杂程度,并且对图像反光进行调整并对噪声进行降噪处理,对摄像机2拍摄的车门外板表面初始检测图像进行图像预处理的步骤如下:Referring to Figure 9, since the image captured by camera 2 has many useless backgrounds, and the image is easily affected by the reflection and noise on the surface of the outer panel of the car door, it is necessary to eliminate the useless background to reduce the time and complexity of image processing, and adjust the reflection of the image And noise reduction processing is carried out to the noise, and the steps of image preprocessing are carried out to the initial detection image of the surface of the outer panel of the car door captured by the camera 2 as follows:

(1)对摄像机图像中的目标区域图像采取掩膜操作,获得摄像机图像中车门外板表面投影有所设计的编码投影模板的局部区域图像,剔除无用背景区域;(1) Take a mask operation to the target area image in the camera image, obtain the local area image of the coded projection template designed for the projection of the outer panel surface of the car door in the camera image, and remove the useless background area;

(2)对获得的目标区域图像进行高斯滤波,剔除噪声;(2) Gaussian filtering is performed on the obtained target area image to remove noise;

(3)计算目标区域图像背景的平均灰度值,并与原始图像灰度值相减,对背景进行剔除,使背景灰度均匀化,避免背景图像中灰度梯度变化,影响边缘提取的结果,导致提取出过多的非X-型基元符号边缘,给分割标记带来干扰;(3) Calculate the average gray value of the image background in the target area, and subtract it from the gray value of the original image to remove the background to make the background gray uniform, avoid the gray gradient change in the background image, and affect the edge extraction results , leading to the extraction of too many non-X-type primitive symbol edges, which will interfere with the segmentation mark;

(4)为了使目标区域图像中的X-型基元符号边缘更加突出,采用拉普拉斯5邻域边缘增强法强化目标区域图像中X-型基元符号边缘,以利于边缘提取。(4) In order to make the edge of the X-type primitive symbol in the image of the target area more prominent, the Laplacian 5-neighborhood edge enhancement method is used to enhance the edge of the X-type primitive symbol in the image of the target area to facilitate edge extraction.

2)对摄像机图像中车门外板表面的投影图像进行基元分割及模式识别2) Carry out primitive segmentation and pattern recognition on the projected image of the surface of the door outer panel in the camera image

参阅图10,由于在X-型基元符号的定义过程中,我们采用的是利用X-型基元符号较长主惯性轴和基轴之间夹角的不同来对码字进行的分类定义,因此我们需要采用同样的方法对摄像机图像中的X-型基元符号进行识别。首先,我们需要对预处理后的目标区域图像进行X-型基元符号边缘提取,然后再利用提取到的X-型基元符号的边缘点坐标计算X-型基元符号的形心坐标,以形心坐标作为角点粗提取的结果。在形心坐标的基础上对原图像上其邻域内的灰度梯度进行计算,取梯度最大值点作为特征点。由于在投影过程中,不能保持投影图像和水平方向完全水平,因此在计算较长主惯性轴和基轴之间夹角的时候,只能对X-型基元符号的边缘采用惯性力矩公式计算较长主惯性轴和水平轴之间的夹角,然后再利用相邻两个X-型基元符号之间特征角点的坐标计算基轴和水平轴之间的夹角,然后再将两夹角大小相减,即能得到较长主惯性轴和基轴之间的夹角,具体的步骤如下。Referring to Fig. 10, since in the definition process of the X-type primitive symbol, what we adopt is to utilize the difference of the included angle between the long main inertial axis and the base axis of the X-type primitive symbol to classify and define the code words , so we need to use the same method to identify the X-type primitive symbols in the camera image. First, we need to extract the X-type primitive symbol edge from the preprocessed image of the target area, and then use the extracted edge point coordinates of the X-type primitive symbol to calculate the centroid coordinates of the X-type primitive symbol. The centroid coordinates are used as the result of rough extraction of corner points. On the basis of the centroid coordinates, the gray gradient in its neighborhood on the original image is calculated, and the gradient maximum point is taken as the feature point. Since the projected image and the horizontal direction cannot be kept completely horizontal during the projection process, when calculating the angle between the longer main inertial axis and the base axis, only the edge of the X-type primitive symbol can be calculated using the formula for the moment of inertia The angle between the longer main inertial axis and the horizontal axis, and then use the coordinates of the characteristic corner points between two adjacent X-type primitive symbols to calculate the angle between the base axis and the horizontal axis, and then the two By subtracting the included angles, the included angle between the longer main inertial axis and the base axis can be obtained. The specific steps are as follows.

(1)X-型基元符号边缘提取及分割标记(1) X-type primitive symbol edge extraction and segmentation marking

由于已经获得了车门外板表面投影有编码投影模板的局部目标区域图像,并进行了图像预处理,因此可以直接采用canny算子对局部目标区域图像进行边缘提取,能够获得全部X-型基元符号的边缘以及大量非基元边缘,边缘提取后图像为二值图像,边缘部分强度值为1,非边缘强度值为0;由于存在大量非基元符号边缘,在接下来进行角点计算以及较长主惯性轴角度计算时,由于要利用到所有的基元符号的边缘的坐标位置,如果存在较多的非基元符号的边缘,会导致出现多个非基元符号特征角点以及角点提取不准,因此需要进行剔除;并且由于在计算X-型基元符号边缘图像的特征角点坐标以及对基元符号的码字进行还原需要单独对每个基元符号边缘进行计算,使得不同的基元符号之间保持相对独立,在计算过程中互不影响,因此还需要对每个基元符号采用分割标记算法对不同的基元符号进行分类标号,按照标号的不同依次进行计算,不同标号的基元符号不能同时进行运算。Since the image of the local target area with the coded projection template projected on the surface of the door outer panel has been obtained, and the image preprocessing has been performed, the edge extraction of the local target area image can be directly performed using the canny operator, and all X-type primitives can be obtained The edge of the symbol and a large number of non-primitive edges, the image after edge extraction is a binary image, the edge part intensity value is 1, and the non-edge intensity value is 0; due to the existence of a large number of non-primitive symbol edges, the corner calculation and When calculating the angle of the longer main inertial axis, since the coordinate positions of the edges of all primitive symbols are used, if there are more edges of non-primitive symbols, multiple non-primitive symbol feature corners and corners will appear. The point extraction is inaccurate, so it needs to be eliminated; and because the feature corner coordinates of the X-type primitive symbol edge image and the restoration of the codeword of the primitive symbol need to be calculated separately for each primitive symbol edge, making Different primitive symbols remain relatively independent and do not affect each other in the calculation process. Therefore, it is necessary to use a segmentation labeling algorithm for each primitive symbol to classify and label different primitive symbols, and perform calculations according to the different labels. Primitive symbols with different labels cannot be operated on at the same time.

参阅图11,采用8邻域区域生长算法从左到右从上到下对图像进行搜索,确保所有独立连通的区域都进行标记和分割,使其可以进行独立操作,互不影响。由于存在大量非基元符号边缘(噪声点或曝光过强区域),经过初步标记得到的标记个数为1810个,还需要对同样经过标记的非基元符号边缘以及噪声点进行剔除。考虑到基元符号边缘形状大小基本一致,即边缘像素个数基本一致,而噪声点以及曝光过强的区域则存在两个极端,噪声点多是零碎的单个或几个像素点,而强光区域则是含有较多的边缘像素点,因此采用平均阈值法对所有标记区域计算像素个数的方法,取平均数的2/3和4/3作为上限和下限,消除噪声点或者曝光区域对X-型基元符号边缘提取结果的影响,同时对符合要求的X-型基元符号边缘区域进行重新标记和分割,标号为1-n,最终标记得到的结果为1713个。对非基元边缘区域进行剔除后得到如图中12-a所示的结果,虽然某些X-型基元符号区域也被误剔除,但是比例非常之小,不影响整体效果,图12-b所示为X-型基元符号边缘点检测放大图。Referring to Figure 11, the 8-neighborhood region growing algorithm is used to search the image from left to right and from top to bottom to ensure that all independently connected regions are marked and segmented so that they can be operated independently without affecting each other. Due to the existence of a large number of non-primitive symbol edges (noise points or overexposed areas), the number of marks obtained after preliminary marking is 1810, and the same marked non-primitive symbol edges and noise points need to be eliminated. Considering that the shape and size of the edge of the primitive symbol are basically the same, that is, the number of edge pixels is basically the same, but there are two extremes in the noise point and the overexposed area. The noise point is mostly fragmented single or a few pixels, while the strong light The area contains more edge pixels, so the average threshold method is used to calculate the number of pixels in all marked areas, and 2/3 and 4/3 of the average number are taken as the upper and lower limits to eliminate noise points or exposure areas. The influence of the X-type primitive symbol edge extraction results, while re-marking and segmenting the X-type primitive symbol edge regions that meet the requirements, the labels are 1-n, and the final marking results are 1713. After removing the non-primitive edge area, the result shown in Figure 12-a is obtained. Although some X-shaped primitive symbol areas are also mistakenly eliminated, the proportion is very small and does not affect the overall effect. Figure 12- b shows the enlarged view of the X-type primitive symbol edge point detection.

(2)摄像机图像中车门外板表面投影图像特征角点提取(2) Feature corner point extraction of the projected image on the surface of the outer panel of the door in the camera image

对标记后得到X-型基元符号边缘图像进行特征角点提取,需要对每个X-型基元符号边缘区域单独进行特征角点坐标计算,其步骤主要分为两步:To extract the feature corners of the edge image of the X-type primitive symbol obtained after marking, it is necessary to separately calculate the coordinates of the feature corners for each X-type primitive symbol edge area, and the steps are mainly divided into two steps:

a.基于形心的特征角点粗定位a. Coarse positioning of feature corners based on centroid

采用形心坐标计算公式,对得到的每个X-型基元符号的边缘坐标以及灰度强度值(1或0)对按照标记顺序利用静矩公式单独计算形心坐标;Using the centroid coordinates calculation formula, the obtained edge coordinates and gray intensity values (1 or 0) of each X-type primitive symbol are used to calculate the centroid coordinates separately according to the marking order using the static moment formula;

首先静矩公式为:First, the static moment formula is:

Mm pp qq == &Integral;&Integral; -- &infin;&infin; &infin;&infin; &Integral;&Integral; -- &infin;&infin; &infin;&infin; xx pp ythe y qq ff (( xx ,, ythe y )) dd xx dd ythe y -- -- -- (( 88 ))

公式(7)中x表示x轴方向坐标值,y表示y轴方向坐标值,p、q取值根据计算的不同坐标轴的静矩来定,当计算x轴的静矩时p为0,q为1,当计算y轴静矩时p为1,q为0。将静矩公式引入到图像处理当中可写成:In the formula (7), x represents the coordinate value of the x-axis direction, y represents the coordinate value of the y-axis direction, and the values of p and q are determined according to the calculated static moments of different coordinate axes. When calculating the static moments of the x-axis, p is 0, q is 1, p is 1 and q is 0 when calculating the y-axis static moment. Introducing the static moment formula into image processing can be written as:

mm pp qq == &Sigma;&Sigma; ii == 00 kk -- 11 &Sigma;&Sigma; jj == 00 ll -- 11 ii pp jj qq ff (( ii ++ 11 ,, jj ++ 11 )) -- -- -- (( 99 ))

上式中k与l的乘积表示目标图像像素大小,f(i+1,j+1)表示图像坐标(i,j)处像素点的灰度强度,由于图像坐标系原点置于图像左上方的像素点上,图像坐标(0,0)正好对应像素坐标(1,1),因此每个像素点的坐标大小相对于其像素位置需要减1。在此处图像中边缘像素点为全部1,其余像素点都为0;The product of k and l in the above formula represents the pixel size of the target image, and f(i+1, j+1) represents the grayscale intensity of the pixel at the image coordinates (i, j), since the origin of the image coordinate system is placed at the upper left of the image On the pixel, the image coordinate (0,0) corresponds to the pixel coordinate (1,1), so the coordinate size of each pixel needs to be reduced by 1 relative to its pixel position. In the image here, the edge pixels are all 1, and the rest of the pixels are 0;

则形心坐标可以为:Then the centroid coordinates can be:

xx cc == mm 1010 mm 0000 ,, ythe y cc == mm 0101 mm 0000 -- -- -- (( 1010 ))

xc表示X-型基元符号在x方向的形心坐标;x c represents the centroid coordinates of the X-type primitive symbol in the x direction;

yc表示X-型基元符号在y方向的形心坐标;y c represents the centroid coordinates of the X-type primitive symbol in the y direction;

计算X-型基元符号形心时,根据标号1-n从小到大依次进行,当对标号为a(1≤a≤n)的X-型基元符号边缘计算形心坐标时,只有标号为a的边缘坐标像素灰度值大小为1,其余都全部设定为零,因此可以避免其他边缘的对形心坐标计算的影响,同理依次进行n次计算,可以计算得到所有X-型基元符号边缘图像的形心坐标。When calculating the centroid of an X-type primitive symbol, proceed according to the labels 1-n from small to large, and when calculating the centroid coordinates of the edge of an X-type primitive symbol labeled a (1≤a≤n), only the label The gray value of the edge coordinate pixel of a is 1, and the rest are all set to zero, so the influence of other edges on the calculation of the centroid coordinates can be avoided. In the same way, n times of calculations can be performed sequentially to obtain all X-type The centroid coordinates of the primitive symbol edge image.

b.基于Harris的特征角点精定位b. Fine positioning of feature corners based on Harris

由于采用基于形心的角点粗定位算法是基于X-型基元符号的边缘形状得到的角点坐标,当X-型基元符号发生变形时,得到的角点坐标相对于其真实角点坐标会发生轻微偏移,因此在完成角点粗定位之后,还需将角点粗定位得到的结果代入到原初始图像中,在原始图像中以粗定位提取得到的坐标为中心,在其邻域内(3×3)采用Harris角点提取算法根据灰度梯度进行搜索,寻找梯度变化最大点,取灰度梯度最大点位置坐标作为精定位坐标,得到的特征角点精定位结果如附图14所示,将两者坐标值置于原初始图像中进行比较,结果证明精定位得到的结果较为精确。Since the corner point coarse positioning algorithm based on the centroid is based on the corner point coordinates obtained from the edge shape of the X-type primitive symbol, when the X-type primitive symbol is deformed, the obtained corner point coordinates are relative to its real corner point The coordinates will be slightly shifted, so after the rough positioning of the corner points is completed, the results of the rough positioning of the corner points need to be substituted into the original initial image. In the original image, the coordinates obtained by the rough positioning are taken as the center, and the In the domain (3×3), the Harris corner point extraction algorithm is used to search according to the gray gradient to find the point with the largest gradient change, and the position coordinates of the point with the largest gray gradient gradient are taken as the fine positioning coordinates. The result of fine positioning of the characteristic corner points is shown in Figure 14 As shown, the coordinate values of the two are placed in the original initial image for comparison, and the result proves that the result obtained by fine positioning is more accurate.

(3)对摄像机图像中车门外板表面投影图像中X-型基元符号进行码字识别还原(3) Recognize and restore the codewords of the X-type primitive symbols in the projected image on the surface of the outer panel of the car door in the camera image

由于在设计过程中,采用的是X-型基元符号较长主惯性轴和基轴之间的夹角对码字进行归类,因此根据这种对应关系,同样需要采用计算较长主惯性轴和基轴之间的夹角对码字进行还原,一般来说常采用的惯性力矩积分公式计算较长主惯性轴和基轴之间的夹角,惯性力矩积分公式如下:Since in the design process, the X-type primitive symbol is used to classify the codewords by the angle between the longer main inertial axis and the base axis, so according to this correspondence, it is also necessary to calculate the longer main inertia The angle between the axis and the base axis restores the codeword. Generally speaking, the inertial moment integral formula is often used to calculate the angle between the longer main inertial axis and the base axis. The inertial moment integral formula is as follows:

cmcm pp qq == &Sigma;&Sigma; ii == 00 kk -- 11 &Sigma;&Sigma; jj == 00 ll -- 11 (( ii -- xx cc )) pp (( jj -- ythe y cc )) qq ff (( ii ++ 11 ,, jj ++ 11 )) -- -- -- (( 1111 ))

式中:i表示的是某个基元区域边缘点在x方向的坐标,j表示的在y方向的坐标,f表示的是像素强度值(0或1),xc和ye表示的形心坐标;In the formula: i represents the coordinates of an edge point of a certain primitive area in the x direction, j represents the coordinates in the y direction, f represents the pixel intensity value (0 or 1), x c and y e represent the shape heart coordinates;

较长主惯性轴与水平坐标轴之间夹角公式如下:The formula for the angle between the longer main inertial axis and the horizontal coordinate axis is as follows:

&alpha;&alpha; == 11 22 aa rr cc tt aa nno (( 22 CMCM 1111 CMCM 2020 -- CMCM 0202 )) -- -- -- (( 1212 ))

参阅图15,X-型基元符号上的小箭头方向指向的是较长主惯性轴的方向,而图中第一行中从左到右,连线相邻两个X-型基元符号的特征角点的连线为基线,由于在投影过程中,无法保证水平投影,使得图形阵列与水平方向保持一致,因此基线与水平方向之间存在着一定大小的角度,其夹角公式为:Referring to Figure 15, the direction of the small arrow on the X-type primitive symbol points to the direction of the longer main inertial axis, and in the first row in the figure, from left to right, two adjacent X-type primitive symbols are connected by a line The connection line of the characteristic corners of is the baseline. Since the horizontal projection cannot be guaranteed during the projection process, the graphic array is consistent with the horizontal direction. Therefore, there is a certain angle between the baseline and the horizontal direction. The angle formula is:

&beta;&beta; == aa rr cc tt aa nno (( ythe y nno -- ythe y nno -- 11 xx nno -- xx nno -- 11 )) -- -- -- (( 1313 ))

其中(xn,yn)表示的是第n个X-型基元符号的特征角点坐标,则最后可得较长主惯性轴和基线之间夹角为:Where (x n , y n ) represents the characteristic corner point coordinates of the nth X-type primitive symbol, then finally the angle between the longer main inertial axis and the baseline can be obtained as:

Δ=α-β(14)Δ = α - β (14)

将差值范围设定为±10°,比较Δ与{0,45,90,135}之间的差值,如果两者之间的差值在设定误差范围内,则按照对应角度对应的{0,1,2,3}进行码字还原,依次进行比较,得到检测图像的码字矩阵。Set the difference range to ±10°, compare the difference between Δ and {0, 45, 90, 135}, if the difference between the two is within the set error range, then follow the {0 corresponding to the corresponding angle , 1, 2, 3} to restore the codeword, and compare them in turn to obtain the codeword matrix of the detected image.

3)对摄像机图像中车门外板表面投影图像特征角点和编码投影模板特征角点进行立体匹配3) Stereo matching of the feature corners of the projected image on the surface of the door outer panel and the feature corners of the coded projection template in the camera image

参阅图16,对目标图像完成解码工作之后,可以得到一个码字阵列,每个码字代表的不仅是一个X-型基元符号,而且也代表这个X-型基元符号的特征角点,同时也代表特征角点的图像坐标。为了确定目标图像中X-型基元符号在投影模板中的具体位置,即确定拍摄图像X-型基元符号在投影模板中的对应位置,或者说摄像机图像中车门外板表面投影图像中特征角点在投影模板中的对应角点位置,实现摄像机图像和投影模板的一一匹配。根据基于邻域的空间编码策略,每个X-型基元符号的码值都由其上下左右8个邻域组成,因此为了方便立体匹配的进行,需要按照图中所示组合方式计算每个X-型基元符号的码值,这样得到的码值具有唯一性。Referring to Figure 16, after the target image is decoded, a codeword array can be obtained, each codeword represents not only an X-type primitive symbol, but also a characteristic corner of the X-type primitive symbol, It also represents the image coordinates of the feature corners. In order to determine the specific position of the X-type primitive symbol in the target image in the projection template, that is to determine the corresponding position of the X-type primitive symbol in the projection template in the captured image, or the features in the projected image of the surface of the door outer panel in the camera image The corresponding corner positions of the corner points in the projection template realize the one-to-one matching between the camera image and the projection template. According to the neighborhood-based spatial coding strategy, the code value of each X-type primitive symbol is composed of its 8 neighborhoods. Therefore, in order to facilitate stereo matching, it is necessary to calculate each The code value of the X-type primitive symbol, and the code value obtained in this way is unique.

在得到每个对应X-型基元符号的码值之后,再采用循环搜索算法对原始伪随机M阵列进行搜索,根据检测得到的码值对原始编码投影模板的码值进行循环对比,取相似度最高的码值作立体匹配的结果,确定检测图像中每个X-型基元符号在原始编码投影模板中对应的位置。After obtaining the code value of each corresponding X-type primitive symbol, the circular search algorithm is used to search the original pseudo-random M array. The code value with the highest degree is used as the result of stereo matching, and the corresponding position of each X-type primitive symbol in the detection image in the original coding projection template is determined.

4.摄像机图像中车门外板表面投影图像特征角点对应的空间点云坐标计算及误差评定阶段4. In the camera image, the space point cloud coordinate calculation and error evaluation stage corresponding to the feature corner points of the projected image on the surface of the outer panel of the door

1)计算车门外板表面投影图像特征点的三维空间坐标1) Calculate the three-dimensional space coordinates of the feature points of the projected image on the surface of the outer panel of the car door

参阅图17,在实现摄像机图像特征角点和投影图像特征角点的一一匹配之后,利用结构光检测系统的标定结果,采用三角测量法计算出车门外板表面投影图像特征点的三维空间坐标,其中深度方向的空间坐标ZR的计算公式为:Referring to Figure 17, after one-to-one matching of the feature corners of the camera image and the feature corners of the projected image, the three-dimensional space coordinates of the feature points of the projected image on the surface of the door outer panel are calculated using the triangulation method using the calibration results of the structured light detection system , where the calculation formula of the spatial coordinate Z R in the depth direction is:

ZZ RR == || || xx LL &OverBar;&OverBar; || || 22 (( &alpha;&alpha; &OverBar;&OverBar; RR ,, TT )) -- << &alpha;&alpha; &OverBar;&OverBar; RR ,, xx &OverBar;&OverBar; LL >> << xx &OverBar;&OverBar; LL ,, TT >> || || &alpha;&alpha; &OverBar;&OverBar; RR || || 22 || || xx LL &OverBar;&OverBar; || || 22 -- (( &alpha;&alpha; &OverBar;&OverBar; RR ,, xx &OverBar;&OverBar; LL )) 22 -- -- -- (( 1515 ))

式中等表示的是点积操作符,其中表示的是完成立体匹配的左右图像坐标向量,R和T分别表示的是投影仪坐标系到摄像机坐标系的旋转矩阵和平移向量。采用三角测量法空间坐标计算公式,利用结构光系统标定结果,对车门表面特征点空间坐标进行计算,得到如图中所示的检测点云示意图。In the formula etc. represent the dot product operator, where and Represents the left and right image coordinate vectors for stereo matching, and R and T represent the rotation matrix and translation vector from the projector coordinate system to the camera coordinate system, respectively. The space coordinate calculation formula of the triangulation method is used, and the calibration results of the structured light system are used to calculate the space coordinates of the feature points on the surface of the car door, and the detection point cloud diagram shown in the figure is obtained.

2)对计算得到的检测点云与三坐标测量机测得的点云模型进行配准2) Register the calculated detection point cloud with the point cloud model measured by the three-coordinate measuring machine

参阅图17与图18,本发明中计算得到的点云如图17所示,三坐标测量机检测得到的某车门外板表面点云模型如图18所示。由于计算得到的点云和由三坐标测量机得到的点云模型坐标不统一,放入同一坐标系下后,两者不重合,如图19所示,因此需要进行配准,才能进行精度评估。本发明采用的是基于ICP(IterativeClosestAlgorithm)的配准方法,其主要步骤分为粗配准和精配准两步,粗配准方法以高斯曲率和平均曲率作为配准特征,计算检测点云中每个点的高斯曲率和平均曲率,在点云模型中搜索与之最接近的点,设定误差条件,使检测点云与点云模型达到比较接近的状态,初始配准结果如图20-a。对初始匹配后的检测点云和点云模型采用ICP算法进行精确配准,使得检测点云和点云模型之间的形状偏差达到最小,采用的最小距离目标函数为:Referring to Fig. 17 and Fig. 18, the point cloud calculated in the present invention is shown in Fig. 17, and the point cloud model of a door outer panel surface detected by a three-coordinate measuring machine is shown in Fig. 18. Since the coordinates of the calculated point cloud and the point cloud model obtained by the three-coordinate measuring machine are not uniform, the two do not overlap after being placed in the same coordinate system, as shown in Figure 19, so registration is required for accuracy evaluation . The present invention adopts a registration method based on ICP (IterativeClosestAlgorithm), and its main steps are divided into two steps: coarse registration and fine registration. The coarse registration method uses Gaussian curvature and average curvature as registration features to calculate and detect the For the Gaussian curvature and average curvature of each point, search for the closest point in the point cloud model, and set the error conditions so that the detection point cloud and the point cloud model are relatively close. The initial registration results are shown in Figure 20- a. The ICP algorithm is used for precise registration of the detected point cloud and the point cloud model after the initial matching, so that the shape deviation between the detected point cloud and the point cloud model is minimized, and the minimum distance objective function adopted is:

&Delta;&Delta; ii == &Sigma;&Sigma; jj == 11 Mm || || TT ii &CenterDot;&CenterDot; (( pp jj )) -- nno jj || || 22 -- -- -- (( 1616 ))

上式中,{pj(xj,yj,zj)|=1,2...k}=Pp为进行初始配准后得到的检测点云,{nj(xj,yj,zj)|j=1,2...k}=Nc为点云模型,得到的点云配准最终结果如图20-b。In the above formula, {p j (x j , y j , z j )|=1, 2...k}=P p is the detection point cloud obtained after initial registration, {n j (x j , y j , z j )|j=1, 2...k}=N c is the point cloud model, and the final result of point cloud registration is shown in Figure 20-b.

使检测点云与点云模型达到最佳配准之后,为了简化图像处理迭代过程,通过最近点搜索算法对配准后检测点云在点云模型中的最近点进行搜索,计算两者之间的距离,以此表示偏差,如附图21所示为偏差值域分布图以及偏差值域频率图。After achieving the best registration between the detected point cloud and the point cloud model, in order to simplify the iterative process of image processing, the nearest point search algorithm is used to search for the closest point of the registered detected point cloud in the point cloud model, and calculate the distance between the two The distance is used to represent the deviation, as shown in Figure 21 is the distribution map of the deviation value domain and the frequency diagram of the deviation value domain.

为了更加清晰的表示出检测点云中不同区域的误差大小,本发明中利用颜色色斑图对误差进行表示,首先将颜色索引级别设定为64个级别,建立点云偏差数据和颜色索引之间的关系式如下:In order to express more clearly the size of errors in different regions of the detected point cloud, the color patch map is used to represent the errors in the present invention. First, the color index level is set to 64 levels, and the relationship between the point cloud deviation data and the color index is established. The relationship between them is as follows:

RR GG BB __ ll ee vv ee ll == rr oo uu nno dd (( &Delta;&Delta; -- &Delta;&Delta; mm ii nno &Delta;&Delta; maxmax -- &Delta;&Delta; minmin ** (( LL -- 11 )) )) -- -- -- (( 1717 ))

公式16中:Δ表示得到的偏差值大小,Δmax表示最大偏差值,Δmin表示最小偏差值,L表示颜色索引分级,RGB_level能计算得到检测点云中所有点的颜色索值大小。In formula 16: Δ represents the obtained deviation value, Δ max represents the maximum deviation value, Δ min represents the minimum deviation value, L represents the color index classification, and RGB_level can calculate the color index value of all points in the detected point cloud.

实施例Example

一、结构光检测系统标定阶段1. Calibration stage of structured light detection system

1.摄像机标定1. Camera calibration

参阅图2,利用张正友标定的方法(ZHANGZY,AFlexibleNewTechniqueforCameraCalibration[R].MicrosoftCorporation,NSR-TR-98-71,1998)进行标定,首先在标定平面的左下角粘贴9×9的摄像机棋盘格标靶并用投影仪4投射设计的12×16棋盘格标靶到标定平面的右侧,然后再利用摄像机2拍摄整个标定平面,标定平面如图2-a所示。将拍摄得到的12幅图像中左下角的摄像机棋盘格标靶图像进行特征角点提取,每个摄像机棋盘格标靶图像可以提取100个角点,12幅图像总共得到1200个特征角点图像坐标。根据张正友标定方法,世界坐标系设定在摄像机棋盘格标靶图像最左上角处的一个角点上,Z方向坐标值取为零,由于每个棋盘格尺寸大小精确设计为30mm,因此棋盘格特征角点在X和Y方向的世界坐标可精确得知。因此在得到标定平面上棋盘格标靶图像特征角点坐标以及对应点的空间坐标以后,即可利用工具箱完成标定,计算得到摄像机2的内部参数Kcint以及非线性畸变参数kc如下:Referring to Figure 2, use Zhang Zhengyou’s calibration method (ZHANGZY, AFlexibleNewTechniqueforCameraCalibration[R].MicrosoftCorporation, NSR-TR-98-71, 1998) for calibration, first paste a 9×9 camera checkerboard target on the lower left corner of the calibration plane and use The projector 4 projects the designed 12×16 checkerboard target to the right side of the calibration plane, and then uses the camera 2 to shoot the entire calibration plane, as shown in Figure 2-a. The camera checkerboard target image in the lower left corner of the 12 captured images is subjected to feature corner extraction. Each camera checkerboard target image can extract 100 corner points, and a total of 1200 feature corner image coordinates are obtained from the 12 images. . According to Zhang Zhengyou's calibration method, the world coordinate system is set at a corner point at the upper left corner of the camera checkerboard target image, and the coordinate value in the Z direction is taken as zero. Since the size of each checkerboard is precisely designed to be 30mm, the checkerboard The world coordinates of the feature corners in the X and Y directions can be accurately known. Therefore, after obtaining the coordinates of the characteristic corners of the checkerboard target image on the calibration plane and the spatial coordinates of the corresponding points, the toolbox can be used to complete the calibration, and the internal parameters Kc int and nonlinear distortion parameters kc of the camera 2 are calculated as follows:

Kck intint == 2691.61642691.6164 00 639.5639.5 00 2669.11562669.1156 511.5511.5 00 00 11

kc=[-0.325021.561770.00075-0.008760.00000]k c = [-0.325021.561770.00075-0.008760.00000]

2)投影仪标定2) Projector calibration

参阅图3-1,首先对摄像机图像中的投影标靶进行特征角点的提取,然后再根据已经得到的摄像机2的内外参数结果,根据光平面相交法可以计算位于标定平面上投影图像的特征角点在世界坐标系下的空间坐标,至此,投影模板的图像坐标和空间坐标都已经计算得出,因此可以采用与摄像机标定相同的方法计算投影仪的标定参数,得到投影仪4的内部参数以及投影仪4和摄像机2之间的旋转平移矩阵。其中投影仪4的内部参数Kp-int以及非线性畸变参数kp如下:Referring to Figure 3-1, first extract the feature corners of the projected target in the camera image, and then calculate the features of the projected image on the calibration plane according to the obtained internal and external parameters of camera 2 according to the light plane intersection method The spatial coordinates of the corner points in the world coordinate system. So far, the image coordinates and spatial coordinates of the projection template have been calculated. Therefore, the calibration parameters of the projector can be calculated by the same method as the camera calibration, and the internal parameters of the projector 4 can be obtained. And the rotation-translation matrix between projector4 and camera2. Wherein the internal parameter K p-int and the nonlinear distortion parameter k p of the projector 4 are as follows:

KK pp -- intint == 2429.67672429.6767 00 473.275473.275 00 2416.76722416.7672 762.576762.576 00 00 11

kp=[0.092470.074290.01070-0.001770] kp = [0.092470.074290.01070-0.001770]

而影仪4和摄像机2之间的旋转矩阵R和平移矩阵T如下:The rotation matrix R and translation matrix T between the projector 4 and the camera 2 are as follows:

RR == 0.97110.9711 0.03530.0353 -- 0.23620.2362 -- 0.00330.0033 0.99090.9909 0.13450.1345 0.23880.2388 -- 0.12980.1298 0.96240.9624 TT == 326.3736326.3736 -- 413.8772413.8772 -- 558.2592558.2592

二、编码投影模版设计阶段2. Code projection template design stage

1)对应图形阵列的伪随机M数组生成1) Pseudo-random M array generation corresponding to the graphic array

本发明构造的伪随机M阵列,将最小汉明距离大小设定为3,即表示任意两个3×3窗口的子阵列对应的元素至少有3个是不一样的,这样的设计有利于增强子阵列的稳定性以及对检测对象表面空间变化程度的适应性。In the pseudo-random M array constructed by the present invention, the minimum Hamming distance is set to 3, which means that at least 3 elements corresponding to any two sub-arrays of 3×3 windows are different, and such a design is conducive to enhancing The stability of the sub-array and its adaptability to the degree of spatial variation of the surface of the detection object.

参阅图5-a至图5-d与图6,本发明需要生成数字基元为{0,1,2,3},最小汉明距离等于3,大小为40×45的伪随机M阵列;采用图中所示循环填充法可以完成符合本发明要求的伪随机阵列构建,首先在阵列左上角生成3×3的子阵列,然后沿右侧依次代入3×1的子阵列,比较相邻3×3窗口间的汉明距离大小是否符合条件,不符合重新代入,符合条件则依次向右进行直到边界为止;然后沿初始3×3数组的下方依次代入1×3子阵列,方法同上,直到边界为止;其次再依次在4×4的空白位置代入一个新的码值,组成一个新的3×3子阵列,和前面生成的所有子阵列比较汉明距离大小,符合条件继续,不符合重新代入,如代入所有可能码字都不满足,则重新开始本次构建过程。本发明采用图5-a至图5-d中所示方法得到的最小汉明距离等于3的部分阵列结果如图6所示。Referring to Fig. 5-a to Fig. 5-d and Fig. 6, the present invention needs to generate a pseudo-random M array whose digital primitives are {0, 1, 2, 3}, the minimum Hamming distance is equal to 3, and the size is 40×45; The construction of the pseudo-random array that meets the requirements of the present invention can be completed by using the circular filling method shown in the figure. First, a 3×3 subarray is generated in the upper left corner of the array, and then a 3×1 subarray is sequentially substituted along the right side, and the adjacent 3 subarrays are compared. Whether the Hamming distance between the ×3 windows meets the conditions, if not, re-substitute, if the conditions are met, proceed to the right until the boundary; then follow the bottom of the initial 3×3 array and substitute into the 1×3 sub-array, the method is the same as above, until to the boundary; secondly, substitute a new code value in the blank position of 4×4 to form a new 3×3 subarray, and compare the Hamming distance with all the subarrays generated before. Substituting, if all possible codewords are not satisfied, restart the construction process. Figure 6 shows the results of partial arrays with the minimum Hamming distance equal to 3 obtained by the present invention using the methods shown in Figure 5-a to Figure 5-d.

2)基于几何特征的X-型基元符号设计2) X-shaped primitive symbol design based on geometric features

本发明根据棋盘格的角点特征,设计一类X-型的如图7中所示的几何基元在遮挡或者缺失的情况下具有比较稳定的角点特征。该X-型基元符号以棋盘格图像为特征设计,关于特征角点中心对称,由成中心对称的三角形或正方形组成。根据较长主惯性轴与基轴之间的夹角角度大小{0°,45°,90°,135°}的不同分别对应4个码字{0,1,2,3}。According to the corner features of the checkerboard, the present invention designs a class of X-shaped geometric primitives as shown in FIG. 7 to have relatively stable corner features in the case of occlusion or loss. The X-shaped primitive symbol is characterized by a checkerboard image, is symmetrical about the center of the characteristic corners, and is composed of triangles or squares that are symmetrical to the center. According to the angles {0°, 45°, 90°, 135°} between the longer main inertial axis and the base axis, the four codewords {0, 1, 2, 3} are respectively corresponding.

根据上述的对应的码字和图形的对应关系,按照得到的伪随机M阵列模版,将X-型基元符号依次代入到图形阵列模板当中,生成大小为768×1024的如图8所示的编码投影模板,单个X-型基元符号大小为10×10pixel,X-型基元符号间的间隔设定为9pixel。该编码投影模板以黑色为背景,白色作为X-型基元符号的底色,生成单色编码投影模板,有利于降低车门外板表面反光程度。According to the correspondence between the above-mentioned corresponding codewords and graphics, and according to the obtained pseudo-random M array template, the X-type primitive symbols are sequentially substituted into the graphics array template, and a size of 768×1024 is generated as shown in Figure 8 Encoding projection template, the size of a single X-type primitive symbol is 10×10pixel, and the interval between X-type primitive symbols is set to 9pixel. The coded projection template uses black as the background and white as the background color of the X-shaped primitive symbol to generate a single-color coded projection template, which is beneficial to reduce the degree of reflection on the surface of the outer panel of the car door.

三、检测图像解码识别阶段3. Detection image decoding and recognition stage

1)对摄像机图像中车门外板表面的初始检测图像进行图像预处理1) Perform image preprocessing on the initial detection image of the surface of the door outer panel in the camera image

(1)对摄像机图像中的目标区域图像采取掩膜操作,获得摄像机图像中车门外板表面投影有所设计的编码投影模板的局部区域图像,剔除无用背景区域;(1) Take a mask operation to the target area image in the camera image, obtain the local area image of the coded projection template designed for the projection of the outer panel surface of the car door in the camera image, and remove the useless background area;

(2)对获得的目标区域图像进行高斯滤波,剔除噪声;(2) Gaussian filtering is performed on the obtained target area image to remove noise;

(3)计算目标区域图像背景的平均灰度值,并与原始图像灰度值相减,对背景进行剔除,使背景灰度均匀化,避免背景图像中灰度梯度变化,影响边缘提取的结果,导致提取出过多的非X-型基元符号边缘,给分割标记带来干扰;(3) Calculate the average gray value of the image background in the target area, and subtract it from the gray value of the original image to remove the background to make the background gray uniform, avoid the gray gradient change in the background image, and affect the edge extraction results , leading to the extraction of too many non-X-type primitive symbol edges, which will interfere with the segmentation mark;

(4)为了使目标区域图像中的X-型基元符号边缘更加突出,采用拉普拉斯5邻域边缘增强法强化目标区域图像中X-型基元符号边缘,以利于边缘提取。(4) In order to make the edge of the X-type primitive symbol in the image of the target area more prominent, the Laplacian 5-neighborhood edge enhancement method is used to enhance the edge of the X-type primitive symbol in the image of the target area to facilitate edge extraction.

2)对摄像机图像中车门外板表面的投影图像进行基元分割及模式识别2) Carry out primitive segmentation and pattern recognition on the projected image of the surface of the door outer panel in the camera image

参阅图10,由于在X-型基元符号的定义过程中,我们采用的是利用X-型基元符号较长主惯性轴和基轴之间夹角的不同来对码字进行的分类定义,因此我们需要采用同样的方法对摄像机图像中的X-型基元符号进行识别。Referring to Fig. 10, since in the definition process of the X-type primitive symbol, what we adopt is to utilize the difference of the included angle between the long main inertial axis and the base axis of the X-type primitive symbol to classify and define the code words , so we need to use the same method to identify the X-type primitive symbols in the camera image.

(1)X-型基元符号边缘提取及分割标记(1) X-type primitive symbol edge extraction and segmentation marking

本发明直接采用canny算子对已经进行了预处理的局部目标区域图像进行边缘提取,获得全部X-型基元符号的边缘以及大量非基元边缘,边缘提取后图像为二值图像,边缘部分强度值为1,非边缘强度值为0;由于存在大量非基元符号边缘,会导致出现多个非基元符号特征角点以及角点提取不准,因此需要进行剔除;并且由于在计算X-型基元符号边缘图像的特征角点坐标以及对基元符号的码字进行还原需要单独对每个基元符号边缘进行计算,使得不同的基元符号之间保持相对独立,在计算过程中互不影响,因此还需要对每个基元符号采用分割标记算法对不同的基元符号进行分类标号,按照标号的不同依次进行计算,不同标号的基元符号不能同时进行运算。The present invention directly uses the canny operator to extract the edge of the preprocessed local target area image to obtain the edges of all X-type primitive symbols and a large number of non-primitive edges. The image after edge extraction is a binary image, and the edge part The intensity value is 1, and the non-edge intensity value is 0; due to the existence of a large number of non-primitive symbol edges, there will be multiple non-primitive symbol feature corners and the corner point extraction is not accurate, so it needs to be eliminated; and because the calculation of X - The characteristic corner coordinates of the edge image of the primitive symbol and the restoration of the codeword of the primitive symbol need to calculate the edge of each primitive symbol separately, so that the different primitive symbols remain relatively independent. During the calculation process They do not affect each other, so it is necessary to use the segmentation labeling algorithm for each primitive symbol to classify and label different primitive symbols, and perform calculations according to the different labels, and primitive symbols with different labels cannot be operated at the same time.

参阅图11,采用8邻域区域生长算法从左到右从上到下对图像进行搜索,确保所有独立连通的区域都进行标记和分割,使其可以进行独立操作,互不影响。由于存在大量非基元符号边缘(噪声点或曝光过强区域),本发明经过初步标记得到的标记个数为1810个,还需要对同样经过标记的非基元符号边缘以及噪声点进行剔除。考虑到基元符号边缘形状大小基本一致,即边缘像素个数基本一致,而噪声点以及曝光过强的区域则存在两个极端,噪声点多是零碎的单个或几个像素点,而强光区域则是含有较多的边缘像素点,因此采用平均阈值法对所有标记区域计算像素个数的方法,取平均数的2/3和4/3作为上限和下限,消除噪声点或者曝光区域对X-型基元符号边缘提取结果的影响,同时对符合要求的X-型基元符号边缘区域进行重新标记和分割,标号为1-n,最终标记得到的结果为1713个。对非基元边缘区域进行剔除后得到如图中12-a所示的结果,虽然某些X-型基元符号区域也被误剔除,但是比例非常之小,不影响整Referring to Figure 11, the 8-neighborhood region growing algorithm is used to search the image from left to right and from top to bottom to ensure that all independently connected regions are marked and segmented so that they can be operated independently without affecting each other. Due to the existence of a large number of non-primitive symbol edges (noise points or overexposed areas), the number of marks obtained through preliminary marking in the present invention is 1810, and the same marked non-primitive symbol edges and noise points need to be eliminated. Considering that the shape and size of the edge of the primitive symbol are basically the same, that is, the number of edge pixels is basically the same, but there are two extremes in the noise point and the overexposed area. The noise point is mostly fragmented single or a few pixels, while the strong light The area contains more edge pixels, so the average threshold method is used to calculate the number of pixels in all marked areas, and 2/3 and 4/3 of the average number are taken as the upper and lower limits to eliminate noise points or exposure areas. The influence of the X-type primitive symbol edge extraction results, while re-marking and segmenting the X-type primitive symbol edge regions that meet the requirements, the labels are 1-n, and the final marking results are 1713. The results shown in Figure 12-a are obtained after removing non-primitive edge regions. Although some X-type primitive symbol regions are also mistakenly removed, the proportion is very small and does not affect the overall

体效果,图12-b所示为X-型基元符号边缘点检测放大图。Figure 12-b shows the enlarged image of X-type primitive symbol edge point detection.

(2)摄像机图像中车门外板表面投影图像特征角点提取对标记后得到X-型基元符号边缘图像进行特征角点提取,需要对每个X-型基元符号边缘区域单独进行特征角点坐标计算,其步骤主要分为两步:(2) Feature corner point extraction of the projected image on the surface of the outer panel of the car door in the camera image. To extract the feature corner points from the edge image of the X-type primitive symbol after marking, it is necessary to separately perform feature corners on the edge area of each X-type primitive symbol The calculation of point coordinates is mainly divided into two steps:

a.基于形心的特征角点粗定位a. Coarse positioning of feature corners based on centroid

采用形心坐标计算公式,对得到的每个X-型基元符号的边缘坐标以及灰度强度值(1或0)对按照标记顺序利用静矩公式单独计算形心坐标;Using the centroid coordinates calculation formula, the obtained edge coordinates and gray intensity values (1 or 0) of each X-type primitive symbol are used to calculate the centroid coordinates separately according to the marking order using the static moment formula;

b.基于Harris的特征角点精定位b. Fine positioning of feature corners based on Harris

在完成角点粗定位之后,还需将角点粗定位得到的结果代入到原初始图像中,在原始图像中以粗定位提取得到的坐标为中心,在其邻域内(3×3)采用Harris角点提取算法根据灰度梯度进行搜索,寻找梯度变化最大点,取灰度梯度最大点位置坐标作为精定位坐标,得到的特征角点精定位结果如附图14所示。After the rough positioning of the corner points is completed, the result of the rough positioning of the corner points needs to be substituted into the original initial image. In the original image, the coordinates obtained by the rough positioning are taken as the center, and Harris is used in its neighborhood (3×3). The corner point extraction algorithm searches according to the gray gradient to find the point with the largest gradient change, and takes the position coordinates of the point with the largest gray gradient as the fine positioning coordinates. The result of fine positioning of the characteristic corner points is shown in Figure 14.

(3)对摄像机图像中车门外板表面投影图像中X-型基元符号进行码字识别还原(3) Recognize and restore the codewords of the X-type primitive symbols in the projected image on the surface of the outer panel of the car door in the camera image

由于在设计过程中,采用的是X-型基元符号较长主惯性轴和基轴之间的夹角对码字进行归类,因此根据这种对应关系,同样需要采用计算较长主惯性轴和基轴之间的夹角对码字进行还原。Since in the design process, the X-type primitive symbol is used to classify the codewords by the angle between the longer main inertial axis and the base axis, so according to this correspondence, it is also necessary to calculate the longer main inertia The angle between the axis and the base axis restores the codeword.

3)对摄像机图像中车门外板表面投影图像特征角点和编码投影模板特征角点进行立体匹配3) Stereo matching of the feature corners of the projected image on the surface of the door outer panel and the feature corners of the coded projection template in the camera image

参阅图16,对目标图像完成解码工作之后,可以得到一个码字阵列,每个码字代表的不仅是一个X-型基元符号,而且也代表这个X-型基元符号的特征角点,同时也代表特征角点的图像坐标。根据基于邻域的空间编码策略,每个X-型基元符号的码值都由其上下左右8个邻域组成,因此为了方便立体匹配的进行,需要按照图中所示组合方式计算每个X-型基元符号的码值,这样得到的码值具有唯一性。Referring to Figure 16, after the target image is decoded, a codeword array can be obtained, each codeword represents not only an X-type primitive symbol, but also a characteristic corner of the X-type primitive symbol, It also represents the image coordinates of the feature corners. According to the neighborhood-based spatial coding strategy, the code value of each X-type primitive symbol is composed of its 8 neighborhoods. Therefore, in order to facilitate stereo matching, it is necessary to calculate each The code value of the X-type primitive symbol, and the code value obtained in this way is unique.

在得到每个对应X-型基元符号的码值之后,再采用循环搜索算法对原始伪随机M阵列进行搜索,根据检测得到的码值对原始编码投影模板的码值进行循环对比,取相似度最高的码值作立体匹配的结果,确定检测图像中每个X-型基元符号在原始编码投影模板中对应的位置。After obtaining the code value of each corresponding X-type primitive symbol, the circular search algorithm is used to search the original pseudo-random M array. The code value with the highest degree is used as the result of stereo matching, and the corresponding position of each X-type primitive symbol in the detection image in the original coding projection template is determined.

四、摄像机图像中车门外板表面投影图像特征角点对应的空间点云坐标计算及误差评定阶段4. Space point cloud coordinate calculation and error evaluation stage corresponding to the feature corner points of the projected image on the surface of the door outer panel in the camera image

1)计算车门外板表面投影图像特征点的三维空间坐标1) Calculate the three-dimensional space coordinates of the feature points of the projected image on the surface of the outer panel of the car door

参阅图17,在实现摄像机图像特征角点和投影图像特征角点的一一匹配之后,利用结构光检测系统的标定结果,采用三角测量法计算出车门外板表面投影图像特征点的三维空间坐标。Referring to Figure 17, after one-to-one matching of the feature corners of the camera image and the feature corners of the projected image, the three-dimensional space coordinates of the feature points of the projected image on the surface of the door outer panel are calculated using the triangulation method using the calibration results of the structured light detection system .

左右图像部分匹配点的码值及坐标如下表所示:The code values and coordinates of the matching points in the left and right images are shown in the following table:

2)对计算得到的检测点云与三坐标测量机测得的点云模型进行配准2) Register the calculated detection point cloud with the point cloud model measured by the three-coordinate measuring machine

参阅图17与图18,本发明中计算得到的点云如图17所示,三坐标测量机检测得到的某车门外板表面点云模型如图18所示。由于计算得到的点云和由三坐标测量机得到的点云模型坐标不统一,放入同一坐标系下后,两者不重合,如图19所示,因此需要进行配准,才能进行精度评估。本发明采用的是基于ICP(IterativeClosestAlgorithm)的配准方法,其主要步骤分为粗配准和精配准两步,粗配准方法以高斯曲率和平均曲率作为配准特征,计算检测点云中每个点的高斯曲率和平均曲率,在点云模型中搜索与之最接近的点,设定误差条件,使检测点云与点云模型达到比较接近的状态,初始配准结果如图20-a。对初始匹配后的检测点云和点云模型采用ICP算法进行精确配准,使得检测点云和点云模型之间的形状偏差达到最小,采用的最小距离目标函数为:Referring to Fig. 17 and Fig. 18, the point cloud calculated in the present invention is shown in Fig. 17, and the point cloud model of a door outer panel surface detected by a three-coordinate measuring machine is shown in Fig. 18. Since the coordinates of the calculated point cloud and the point cloud model obtained by the three-coordinate measuring machine are not uniform, the two do not overlap after being placed in the same coordinate system, as shown in Figure 19, so registration is required for accuracy evaluation . The present invention adopts a registration method based on ICP (IterativeClosestAlgorithm), and its main steps are divided into two steps: coarse registration and fine registration. The coarse registration method uses Gaussian curvature and average curvature as registration features to calculate and detect the For the Gaussian curvature and average curvature of each point, search for the closest point in the point cloud model, and set the error conditions so that the detection point cloud and the point cloud model are relatively close. The initial registration results are shown in Figure 20- a. The ICP algorithm is used for precise registration of the detected point cloud and the point cloud model after the initial matching, so that the shape deviation between the detected point cloud and the point cloud model is minimized, and the minimum distance objective function adopted is:

&Delta;&Delta; ii == &Sigma;&Sigma; jj == 11 Mm || || TT ii &CenterDot;&Center Dot; (( pp jj )) -- nno jj || || 22 -- -- -- (( 1616 ))

上式中,{pj(xj,yj,zj)|=1,2...k}=Pp为进行初始配准后得到的检测点In the above formula, {p j (x j , y j , z j )|=1, 2...k}=P p is the detection point obtained after the initial registration

{nj(xj,yj,zj)j=1,2...k}Nc为点云模型,得到的点云配准最终结果如图20-b。使检测点云与点云模型达到最佳配准之后,为了简化图像处理迭代过程,通过最近点搜索算法对配准后检测点云在点云模型中的最近点进行搜索,计算两者之间的距离,以此表示偏差,如附图21所示为偏差值域分布图以及偏差值域频率图。{n j (x j , y j , z j )j=1, 2...k} N c is the point cloud model, and the final result of point cloud registration is shown in Figure 20-b. After the detection point cloud and the point cloud model achieve the best registration, in order to simplify the iterative process of image processing, the nearest point search algorithm is used to search for the closest point of the registered detection point cloud in the point cloud model, and calculate the distance between the two The distance is used to represent the deviation, as shown in Figure 21 is the distribution map of the deviation value domain and the frequency diagram of the deviation value domain.

为了更加清晰的表示出检测点云中不同区域的误差大小,本发明中利用颜色色斑图对误差进行表示,首先将颜色索引级别设定为64个级别,建立点云偏差数据和颜色索引之间的关系式如下:In order to express more clearly the size of errors in different regions of the detected point cloud, the color patch map is used to represent the errors in the present invention. First, the color index level is set to 64 levels, and the relationship between the point cloud deviation data and the color index is established. The relationship between them is as follows:

RR GG BB __ ll ee vv ee ll == rr oo uu nno dd (( &Delta;&Delta; -- &Delta;&Delta; mm ii nno &Delta;&Delta; maxmax -- &Delta;&Delta; minmin ** (( LL -- 11 )) )) -- -- -- (( 1717 ))

公式16中:Δ表示得到的偏差值大小,Δmax表示最大偏差值,Δmin=表示最小偏差值,L表示颜色索引分级,RGB_level能计算得到检测点云中所有点的颜色索值大小。In Formula 16: Δ represents the obtained deviation value, Δ max represents the maximum deviation value, Δ min = represents the minimum deviation value, L represents the color index classification, and RGB_level can calculate the color index value of all points in the detected point cloud.

本发明经过对检测点云进行偏差计算,点云平均偏差大小为1.6873mm。因为本发明采用编码结构光技术对华晨汽车前车门外板进行检测得到的表面形状尺寸,如果进一步提高实验硬件水平,能够将表面偏差控制在0.75mm以内,本方法具有非常重要的工程应用价值。The present invention calculates the deviation of the detected point cloud, and the average deviation of the point cloud is 1.6873mm. Because the present invention uses encoded structured light technology to detect the surface shape and size of the front door outer panel of Brilliance Automobile, if the experimental hardware level is further improved, the surface deviation can be controlled within 0.75mm. This method has very important engineering application value.

Claims (8)

1. based on a door skin geomery detection method for single projection coded structured light, it is characterized in that, the step of the described door skin geomery detection method based on single projection coded structured light is as follows:
1) structured light detection system calibration phase:
In order to ensure carrying out smoothly of detection, must demarcate the video camera (2) in structured light detection system and projector (4), set up the nonlinear relationship of the correspondence between locus and image coordinate, utilize this nonlinear relationship to calculate the volume coordinate of detected image Feature point correspondence;
2) the coding projection stencil design stage:
A width coding pattern only need be projected to door skin surface in testing process, this coding pattern is a size is the graphic array be made up of the X-type primitive symbol of 4 different directions that 40 row 45 arrange, in graphic array, figure puts in order by a pseudorandom M array decision, this graphic array has following characteristic: the figure in every 3 × 3 subarrays only occurs once in whole array mould plate, and in any two subarrays the figure of correspondence position have at least 3 different; Each X-type primitive symbol except edge have passed through coding, its encoded radio size is all determined jointly by the element in its 3 × 3 neighborhood, this graphic array imparts different code words respectively according to the longer principal axis of inertia of X-type primitive symbol is different from standard shaft angle, therefore graphic array correspond to again the digital array of 40 × 45, and this array is called pseudorandom M array;
3) detected image decoding cognitive phase:
Utilize projector (4) to sedan door outer plate surfaces projection coding projection template, recycling video camera (2) is taken door skin surface image, and is sent in computing machine by the image of shooting and carries out image procossing and identification;
4) spatial point cloud coordinate calculates and the error evaluation stage:
(1) three dimensional space coordinate of door skin surface projection images unique point is calculated;
(2) registration is carried out to the point cloud model that the check point cloud calculated and three coordinate measuring machine record.
2. according to the door skin geomery detection method based on single projection coded structured light according to claim 1, it is characterized in that, the step of described structured light detection system calibration phase is as follows:
1) video camera is demarcated:
The method utilizing Zhang Zhengyou to demarcate is demarcated, adopt 12 × 16 black and white chessboard case marker targets of projector (4) projection design to the right side demarcating plane, and then utilize video camera (2) to take whole demarcation plane, the video camera target image taking the lower left corner in the 12 width images obtained carries out Feature corner extraction, each video camera target image extracts 100 angle points, 12 width images obtain 1200 characteristic angle dot image coordinates altogether, according to Zhang Zhengyou scaling method, world coordinate system is set on an angle point of the most left upper of cross-hatch pattern picture, Z-direction coordinate figure is taken as zero, because each gridiron pattern size careful design is 30mm, therefore gridiron pattern feature angle point can accurately be learnt at the world coordinates of X and Y-direction, therefore after the volume coordinate obtaining plane picture characteristic angle point coordinate and corresponding point, tool box can be utilized to complete demarcation, calculate the internal and external parameter of video camera (2),
2) projector is demarcated:
Projection target in camera review is carried out to the extraction of feature angle point, and then according to the inside and outside parameter result of the video camera obtained (2), intersect method according to optical plane and calculate the volume coordinate be positioned under the feature angle point alive boundary coordinate system demarcating projected image in plane, so far, image coordinate and the volume coordinate of projection target all calculate, therefore, the method identical with camera calibration is adopted to calculate projector calibrating parameter, obtain the internal and external parameter of projector (4) and the rotation translation matrix between projector (4) and video camera (2).
3., according to the door skin geomery detection method based on single projection coded structured light according to claim 1, it is characterized in that, the step in described coding projection stencil design stage is as follows:
1) the pseudorandom M array of corresponding graphic array generates:
The feature of pseudorandom M array is, the subnumber group of specific 3 × 3 windows has uniqueness in whole array, and the Hamming distance between any two windows is larger, represents that difference is between the two larger, pseudorandom M array Hamming distance account form as shown in the formula:
Wherein: V (ij)represent 9 element vector of 3 × 3 neighborhoods, H represents that between two difference 3 × 3 neighborhoods, the number of times of different code word appears in correspondence position vector, be Hamming distance, Hamming distance is larger, represent that the different degree of window is larger, the pseudorandom M array constructed in the coding projection stencil design stage, smallest hamming distance size is set as 3, namely represent that the element that the subarray of any two 3 × 3 windows is corresponding has at least 3 to be different, such being designed with is beneficial to the stability of enhancer array and the adaptability to detected object space surface intensity of variation;
Need in the coding projection stencil design stage to generate digital primitive for { 0,1,2,3}, smallest hamming distance equals 3, and size is the pseudorandom M array of 40 × 45; Employing cyclic pac king method completes the pseudorandom arrays structure meeting coding projection stencil design and require, first the subarray of 3 × 3 is generated in the array upper left corner, then the subarray of 3 × 1 is substituted into successively along right side, whether the Hamming distance size between more adjacent 3 × 3 windows is eligible, do not meet and again substitute into, eligible, carry out to the right until border successively; Then the below along initial 3 × 3 arrays substitutes into 1 × 3 subarray successively, and method is the same, until border; A new code value is substituted into successively and then at the blank position of 4 × 4, form new 3 × 3 subarrays, the all subarrays generated above compare Hamming distance size, eligible continuation, do not meet and again substitute into, as substitute into likely code word do not meet, then restart this building process;
2) based on the X-type primitive Design of Symbols of geometric properties:
The geometric primitive figure of structure coding projection template often adopts square or circular, but under there is shade or circumstance of occlusion, the skew of geometric center or the angle point that produces ambiguity is there is than being easier to using geometric center as the circle of feature angle point or square pattern, angular coordinate is caused to extract inaccurate, and according to tessellated Corner Feature, the geometric primitive designing a class X-type has more stable Corner Feature when blocking or lack, this X-type primitive symbol with cross-hatch pattern picture for characteristic Design, symmetrical about characteristic angle dot center, be made up of triangle in a center of symmetry or square, according to the angle angular dimension between longer principal axis of inertia and standard shaft { 0 °, 45 °, 90 °, 135 ° } difference respectively corresponding 4 code words { 0, 1, 2, 3},
According to the code word of above-mentioned correspondence and the corresponding relation of figure, according to the pseudorandom M array masterplate obtained, X-type primitive is updated in the middle of graphic array template successively, generate the coding projection template that size is 768 × 1024, single X-type primitive symbol size is 10 × 10pixel, the intersymbol interval of X-type primitive is set as 9pixel, this coding projection template take black as background, white is as the background color of X-type primitive figure, generate monochromatic coding projection template, be conducive to reducing door skin surface reflection degree.
4. according to the door skin geomery detection method based on single projection coded structured light according to claim 1, it is characterized in that, the step of described detected image decoding cognitive phase is as follows:
1) Image semantic classification is carried out to the image of the initial detecting on door skin surface in camera review;
2) primitive segmentation and pattern-recognition are carried out to the projected image on door skin surface in camera review;
3) Stereo matching is carried out to door skin surface projection images feature angle point in camera review and coding projection template characteristic angle point.
5. according to the door skin geomery detection method based on single projection coded structured light according to claim 4, it is characterized in that, described Image semantic classification is carried out to the image of the initial detecting on door skin surface in camera review comprise the steps:
1) masking operations is taked to the target area image in camera review, obtain the local area image that projection has the door skin surface of coding projection template, reject useless background area;
2) gaussian filtering is carried out, cancelling noise to the target area image obtained;
3) average gray value of target area image background is calculated, and subtract each other with original image gray scale, background is rejected, make background Histogram equalization, avoid shade of gray change in background image, affect the result of edge extracting, cause extracting too much non-primitive symbol edge, bring interference to dividing mark;
4) in order to make the X-type primitive symbol edge in target area image more outstanding, adopting X-type primitive symbol edge in Laplce 5 neighborhood Edge-enhancement strengthening target area image, being beneficial to edge extracting.
6. according to the door skin geomery detection method based on single projection coded structured light according to claim 4, it is characterized in that, described primitive segmentation is carried out to the projected image on door skin surface in camera review and pattern-recognition comprises the steps:
1) X-type primitive symbol edge extracting and dividing mark:
Adopt canny operator to carry out edge extracting to local target area image, can obtain the edge of whole X-type primitive symbol and a large amount of non-primitive symbol edge, after edge extracting, image is bianry image, and marginal portion intensity level is 1, and non-edge intensity level is 0; When carrying out angle point calculating and longer principal axis of inertia angle calculation, use the coordinate position at the edge of all primitive symbols, if there is the edge of more non-primitive symbol, can cause occurring that multiple non-primitive symbolic feature angle point and angle point grid are forbidden, therefore need to reject; And owing to calculating the characteristic angle point coordinate of X-type primitive symbol edge image and carrying out reduction needs to the code word of X-type primitive symbol and calculate each X-type primitive symbol edge separately, make to keep relatively independent between different X-type primitive symbols, be independent of each other in computation process, therefore also need to adopt dividing mark algorithm to carry out classification designator to different X-type primitive symbols to each X-type primitive symbol, calculate successively according to the difference of label, the X-type primitive symbol of different labels can not carry out computing simultaneously;
2) door skin surface projection images Feature corner extraction in camera review:
A. based on the feature angle point coarse positioning of the centre of form:
Adopt centre of form coordinate computing formula, to utilizing static moment formula according to flag sequence, centre of form coordinate is calculated separately to the edge coordinate of each X-type primitive symbol obtained and gray-scale intensity value;
First static moment formula is:
M p q = &Integral; - &infin; &infin; &Integral; - &infin; &infin; x p y q f ( x , y ) d x d y - - - ( 8 )
In formula: x represents x-axis direction coordinate figure, y represents y-axis direction coordinate figure, and p, q value is determined according to the static moment of the different coordinate axis calculated, and when calculating the static moment of x-axis, p is 0, q is 1, and when calculating y-axis static moment, p is 1, q is 0; Static moment formula is incorporated in the middle of image procossing and can be write as:
m p q = &Sigma; i = 0 k - 1 &Sigma; j = 0 l - 1 i p j q f ( i + 1 , j + 1 ) - - - ( 9 )
Wherein: the product representation target image pixel size of k and l, f (i+1, j+1) gray-scale intensity of image coordinate (i, j) place pixel is represented, because image coordinate system initial point is placed on the upper left pixel of image, image coordinate (0,0) just in time respective pixel coordinate (1,1), therefore the coordinate size of each pixel needs to subtract 1 relative to its location of pixels, in image, edge pixel point is whole 1 herein, and rest of pixels point is all 0;
Then centre of form coordinate is:
x c = m 10 m 00 , y c = m 01 m 00 - - - ( 10 )
X crepresent the centre of form coordinate of X-type primitive symbol in x direction;
Y crepresent the centre of form coordinate of X-type primitive symbol in y direction;
When calculating the X-type primitive symbol centre of form, carry out successively from small to large according to label 1-n, when to label being the primitive symbol edge calculations centre of form coordinate time of a, wherein: 1≤a≤n, only having label to be the edge coordinate grey scale pixel value size of a is 1, and all the other are all set as zero, therefore avoids the impact calculated centre of form coordinate at other edges, in like manner carry out n time successively to calculate, calculate the centre of form coordinate of all X-type primitive symbol edge images;
B. based on the feature angle point fine positioning of Harris
The angular coordinate obtained based on the edge shape of X-type primitive symbol owing to adopting based on the angle point coarse positioning algorithm of the centre of form, when X-type primitive symbol deforms, the angular coordinate obtained can offset relative to its true angular coordinate, therefore after completing angle point coarse positioning, the result that angle point coarse positioning obtains also is needed to be updated in original initial image, extract by coarse positioning in original image centered by the coordinate obtained, in its neighborhood of 3 × 3, adopt Harris Robust Algorithm of Image Corner Extraction to search for according to shade of gray, find graded maximum point, get shade of gray maximum point position coordinates as fine positioning coordinate, the feature angle point fine positioning result obtained,
3) code word identification reduction is carried out to X-type primitive symbol in door skin surface projection images in camera review:
Adopt the angle calculated between longer principal axis of inertia and standard shaft to reduce to code word, adopt the angle between the moment of inertia integral formula longer principal axis of inertia of calculating and standard shaft, moment of inertia integral formula is as follows:
CM p q = &Sigma; i = 0 k - 1 &Sigma; j = 0 l - 1 ( i - x c ) p ( j - y c ) q f ( i + 1 , j + 1 ) - - - ( 11 )
Between longer principal axis of inertia and horizontal axis, angle formulae is as follows:
&alpha; = 1 2 arctan ( 2 CM 11 CM 20 - CM 02 ) - - - ( 12 )
The direction of what small arrow direction on X-primitive symbol was pointed to is longer principal axis of inertia, and the line between adjacent two the X-type primitive centres of form of level is baseline, due in projection process, owing to cannot ensure that horizontal projection makes graphic array and horizontal direction be consistent, therefore there is a certain size angle between baseline and horizontal direction, its angle formulae is:
&beta; = arctan ( y n - y n - 1 x n - x n - 1 ) - - - ( 13 )
Wherein: (x n, y n) what represent is the characteristic angle point coordinate of the n-th X-type primitive symbol, then can between longer principal axis of inertia and baseline angle be finally:
Δ=α-β(14)
Difference range is set as ± 10 °, compare Δ and { 0,45,90, difference between 135}, if difference is between the two within the scope of specification error, then according to corresponding angle corresponding { 0,1,2,3} carries out code word reduction, compares successively, obtains the code word matrix of detected image.
7. according to the door skin geomery detection method based on single projection coded structured light according to claim 4, it is characterized in that, described Stereo matching is carried out to door skin surface projection images feature angle point in camera review and coding projection template characteristic angle point refer to:
After decoding effort is completed to target image, obtain a code word array, what each code word represented is not only an X-type primitive symbol, and represent the feature angle point of this X-type primitive symbol, the simultaneously image coordinate of also representative feature angle point, in order to determine the particular location of X-type primitive symbol in projection template in target image, namely determine to take the correspondence position of X-type primitive symbol in projection template in image, the corresponding corner location in projection template in other words in camera review in door skin surface projection images corresponding to feature angle point, realize the coupling one by one of camera review and projection template, according to the space encoding strategy based on neighborhood, the code value of each X-type primitive symbol by its up and down 8 neighborhoods form, therefore the carrying out of conveniently Stereo matching, need the code value calculating each X-type primitive symbol according to array mode shown in figure, the code value obtained like this has uniqueness,
After the code value obtaining each corresponding X-type primitive symbol, cyclic search algorithm is adopted to search for original pseudorandom M array again, circulation contrast is carried out according to detecting the code value of code value to original coding projection template obtained, get the result that the highest code value of similarity makes Stereo matching, determine the position that in detected image, each X-type primitive symbol is corresponding in original coding projection template.
8., according to the door skin geomery detection method based on single projection coded structured light according to claim 1, it is characterized in that, described spatial point cloud coordinate calculate and the step in error evaluation stage as follows:
1) three dimensional space coordinate of door skin surface projection images unique point is calculated
After the coupling one by one realizing camera review feature angle point and projected image feature angle point, utilize the calibration result of structured light detection system, triangulation is adopted to calculate the three dimensional space coordinate of door skin surface projection images unique point, the wherein volume coordinate Z of depth direction rcomputing formula be:
Z R = | | x L &OverBar; | | 2 < &alpha; &OverBar; R , T > - < &alpha; &OverBar; R , x &OverBar; L > < x &OverBar; L , T > | | &alpha; &OverBar; R | | 2 | | x L &OverBar; | | 2 - < &alpha; &OverBar; R , x &OverBar; L > 2 - - - ( 15 )
In formula: what represent is dot product operations symbol, wherein with what represent has been the left images coordinate vector of Stereo matching, and what R and T represented respectively is rotation matrix and the translation vector that projector coordinates is tied to camera coordinate system; Adopt triangulation spatial coordinates calculation formula, utilize structured-light system calibration result, car door surface characteristics space of points coordinate is calculated, obtains check point cloud schematic diagram;
2) registration is carried out to the point cloud model that the check point cloud calculated and three coordinate measuring machine record:
Adopt the method for registering based on ICP, its key step is divided into rough registration and smart registration two step, rough registration method is using Gaussian curvature and mean curvature as registration features, calculate Gaussian curvature and the mean curvature of each point in check point cloud, immediate point is with it searched in point cloud model, specification error condition, makes check point cloud and point cloud model reach state relatively, obtains initial registration result; Adopt ICP algorithm to carry out accuracy registration to the check point cloud after initial matching and point cloud model, make the form variations between check point cloud and point cloud model reach minimum, the minimum distance function of employing is:
&Delta; i = &Sigma; j = 1 M | | T i &CenterDot; ( p j ) - n j | | 2 - - - ( 16 )
In above formula, { p j(x j, y j, z j) | j=1,2...k}P pfor the check point cloud obtained after carrying out initial registration, { n jx j, y j, z j) | j=1,2...k}=N cfor point cloud model, the point cloud registering net result obtained;
Make after check point cloud and point cloud model reach optimal registration, in order to simplified image process iterative process, to be searched for the closest approach of check point cloud in point cloud model after registration by closest approach searching algorithm, calculate distance between the two, represent deviation with this;
In order to indicate the error size of zones of different in check point cloud more clearly, utilizing color color spot figure to represent error, is first 64 ranks by color index grade setting, and the relational expression set up between some cloud deviation data and color index is as follows:
R G B _ l e v e l = r o u n d ( &Delta; - &Delta; min &Delta; max - &Delta; min * ( L - 1 ) ) - - - ( 17 )
In formula: Δ represents the deviate size obtained, Δ maxrepresent maximum deflection difference value, Δ minrepresent minimum deviation value, L represents color index classification, RGB_level to calculate in check point cloud color rope value size a little.
CN201210590601.3A 2012-12-31 2012-12-31 Based on the door skin geomery detection method of single projection coded structured light Expired - Fee Related CN103047943B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210590601.3A CN103047943B (en) 2012-12-31 2012-12-31 Based on the door skin geomery detection method of single projection coded structured light

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210590601.3A CN103047943B (en) 2012-12-31 2012-12-31 Based on the door skin geomery detection method of single projection coded structured light

Publications (2)

Publication Number Publication Date
CN103047943A CN103047943A (en) 2013-04-17
CN103047943B true CN103047943B (en) 2016-04-06

Family

ID=48060677

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210590601.3A Expired - Fee Related CN103047943B (en) 2012-12-31 2012-12-31 Based on the door skin geomery detection method of single projection coded structured light

Country Status (1)

Country Link
CN (1) CN103047943B (en)

Families Citing this family (46)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8531650B2 (en) 2008-07-08 2013-09-10 Chiaro Technologies LLC Multiple channel locating
CN104751482B (en) * 2013-12-30 2019-03-29 联想(北京)有限公司 Structure light spot pattern generation method and structure light spot pattern generating device
US9562760B2 (en) 2014-03-10 2017-02-07 Cognex Corporation Spatially self-similar patterned illumination for depth imaging
US10775165B2 (en) * 2014-10-10 2020-09-15 Hand Held Products, Inc. Methods for improving the accuracy of dimensioning-system measurements
CN104463850A (en) * 2014-11-18 2015-03-25 北京农业智能装备技术研究中心 Apple stem/calyx detection method based on near-infrared encoding lattice structure light
CN104457607A (en) * 2014-12-10 2015-03-25 东北大学 Depth-measurement-oriented sand clock code structure optical encoding and decoding methods
CN104596444B (en) * 2015-02-15 2017-03-22 四川川大智胜软件股份有限公司 Three-dimensional photographic system and three-dimensional photographic method based on coding pattern projection
CN105043253B (en) * 2015-06-18 2018-06-05 中国计量大学 Based on area-structure light technology truck side guard railing installation dimension measuring system and method
JP6545065B2 (en) * 2015-09-30 2019-07-17 株式会社日立ビルシステム 3D point cloud data modeling device, modeling program and elevator guide rail modeling method
CN105469403A (en) * 2015-11-25 2016-04-06 天津光电高斯通信工程技术股份有限公司 Freight train door and window opening detection method
CN105423954B (en) * 2015-12-29 2018-06-26 北京航天益森风洞工程技术有限公司 A kind of measuring method for the flexible jet pipe that view-based access control model measures
CN106225719B (en) * 2016-08-04 2018-12-04 西安交通大学 A kind of generation method and device of character array structure light coding pattern
CN106251376B (en) * 2016-08-12 2019-08-06 南京航空航天大学 One kind is towards colored structures pumped FIR laser and edge extracting method
EP3364374A1 (en) * 2017-02-20 2018-08-22 My Virtual Reality Software AS Method for visualizing three-dimensional data
CN107492120B (en) * 2017-07-18 2020-04-28 北京航空航天大学 Point cloud registration method
CN109635619B (en) * 2017-08-19 2021-08-31 康耐视公司 Encoding distance topology of structured light patterns for three-dimensional reconstruction
CN109425292B (en) * 2017-08-29 2020-06-16 西安知微传感技术有限公司 Three-dimensional measurement system calibration device and method based on one-dimensional line structured light
CN109816703B (en) * 2017-11-21 2021-10-01 西安交通大学 A Point Cloud Registration Method Based on Camera Calibration and ICP Algorithm
EP3496388A1 (en) * 2017-12-05 2019-06-12 Thomson Licensing A method and apparatus for encoding a point cloud representing three-dimensional objects
CN108280852B (en) * 2018-01-16 2021-08-03 常景测量科技(武汉)有限公司 A method and system for detecting point cloud shape of doors and windows based on laser point cloud data
CN108195305B (en) * 2018-02-09 2020-03-31 京东方科技集团股份有限公司 A binocular detection system and its depth detection method
CN108458671B (en) * 2018-03-08 2020-01-03 西安知微传感技术有限公司 Calibration method of line structured light three-dimensional measurement system
CN109099867A (en) * 2018-06-26 2018-12-28 无锡新吉凯氏测量技术有限公司 A kind of jewel certification and identifying system and method based on geometric shape information
CN109146938B (en) * 2018-08-30 2020-09-15 百度在线网络技术(北京)有限公司 Method, device and equipment for calibrating position of dynamic obstacle and storage medium
CN109186468A (en) * 2018-10-16 2019-01-11 天津安通林汽车饰件有限公司 A kind of device of the intelligent measure car door mechanical parameter based on machine vision
CN109458963A (en) * 2018-12-07 2019-03-12 中国航空工业集团公司济南特种结构研究所 A kind of method of determining radome shunt bar characteristic point spatial position
CN110428458A (en) * 2018-12-26 2019-11-08 西安电子科技大学 Depth information measurement method based on the intensive shape coding of single frames
CN110006406B (en) * 2019-04-26 2024-07-09 昆明理工大学 Auxiliary scale recovery and orientation calibration device for photogrammetry post-processing
CN110926370B (en) * 2019-11-12 2021-10-29 季华实验室 Measurement methods and systems
CN110991465B (en) * 2019-11-15 2023-05-23 泰康保险集团股份有限公司 Object recognition method, device, computing device and storage medium
CN110933391B (en) * 2019-12-20 2021-11-09 成都极米科技股份有限公司 Calibration parameter compensation method and device for projection system and readable storage medium
CN111340957B (en) * 2020-02-10 2023-07-14 季华实验室 Measurement method and system
CN111504229A (en) * 2020-04-10 2020-08-07 武汉理工大学 Method for dynamically projecting patterns for visual measurement matching on curved plate
CN111739106B (en) * 2020-08-12 2020-12-25 成都极米科技股份有限公司 Corner point coding method, calibration method, device, electronic equipment and storage medium
CN112683166B (en) * 2020-12-11 2022-05-31 杭州优视泰信息技术有限公司 Die-cutting product size detection method
CN113188450B (en) * 2021-04-23 2023-03-14 封泽希 Scene depth detection method and system based on structured light
CN113393378B (en) * 2021-05-26 2023-05-02 浙江大华技术股份有限公司 Image stitching method and device of photovoltaic module, electronic device and storage medium
CN113379829A (en) * 2021-06-16 2021-09-10 劢微机器人科技(深圳)有限公司 Camera-based dimension measurement method, device, equipment and storage medium
CN113245243B (en) * 2021-06-23 2021-09-14 苏州鼎纳自动化技术有限公司 Color difference detection equipment and use method thereof
CN113538483B (en) * 2021-06-28 2022-06-14 同济大学 Coding and decoding method and measuring method of high-precision close-range photogrammetry mark
CN113362468B (en) * 2021-07-05 2022-06-03 上海大学 A kind of dimension measuring method of train wheel hub
CN113869407B (en) * 2021-09-27 2025-07-11 中科视语(北京)科技有限公司 A vehicle length measurement method and device based on monocular vision
CN114299158B (en) * 2021-12-28 2025-03-28 北京市商汤科技开发有限公司 Multi-camera system calibration method, device, system, electronic device and storage medium
CN114324363B (en) * 2021-12-31 2024-04-26 无锡艾方芯动自动化设备有限公司 Product state detection method and system
CN115235380B (en) * 2022-08-30 2023-08-08 天津大学 Three-dimensional measuring system, method, device, medium and equipment for inner wall surface
CN115502601B (en) * 2022-10-27 2023-08-22 湘潭大学 Multilayer multi-channel welding track optimization method for medium plate based on deposition size

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101261115A (en) * 2008-04-24 2008-09-10 吉林大学 Binocular Stereo Vision Measuring Method of Spatial Circle Geometric Parameters
JP4218283B2 (en) * 2002-08-22 2009-02-04 株式会社Ihi Target projection type three-dimensional shape measuring method and apparatus

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3465531B2 (en) * 1997-05-12 2003-11-10 オムロン株式会社 Object recognition method and apparatus

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4218283B2 (en) * 2002-08-22 2009-02-04 株式会社Ihi Target projection type three-dimensional shape measuring method and apparatus
CN101261115A (en) * 2008-04-24 2008-09-10 吉林大学 Binocular Stereo Vision Measuring Method of Spatial Circle Geometric Parameters

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于自适应神经网络的双摄像机标定;崔岸等;《计算机工程与应用》;20090721;第45卷(第21期);第55-57、60页 *

Also Published As

Publication number Publication date
CN103047943A (en) 2013-04-17

Similar Documents

Publication Publication Date Title
CN103047943B (en) Based on the door skin geomery detection method of single projection coded structured light
CN112116576B (en) Polarization structure light imaging and improved defect detection method
CN111243032B (en) Full-automatic detection method for checkerboard corner points
Romero-Ramirez et al. Speeded up detection of squared fiducial markers
CN100573040C (en) Calibration method of structured light measurement system for three-dimensional contour of object surface
Romero-Ramire et al. Fractal markers: A new approach for long-range marker pose estimation under occlusion
CN104318548B (en) Rapid image registration implementation method based on space sparsity and SIFT feature extraction
CN113674360B (en) A covariant-based method for line structured light and light plane calibration
CN108122256B (en) A method of it approaches under state and rotates object pose measurement
Song et al. DOE-based structured-light method for accurate 3D sensing
CN103048331B (en) Printing defect detection method based on flexible template registration
CN107578464A (en) A kind of conveyor belt workpieces measuring three-dimensional profile method based on line laser structured light
CN103729632A (en) Round Mark point positioning method based on connected region filtering
CN103020945A (en) Remote sensing image registration method of multi-source sensor
CN104568986A (en) Method for automatically detecting printing defects of remote controller panel based on SURF (Speed-Up Robust Feature) algorithm
CN103345755A (en) Chessboard angular point sub-pixel extraction method based on Harris operator
CN101398886A (en) Rapid three-dimensional face identification method based on bi-eye passiveness stereo vision
US20200258300A1 (en) Method and apparatus for generating a 3d reconstruction of an object
CN109540925B (en) Complex ceramic tile surface defect detection method based on difference method and local variance measurement operator
CN103400373A (en) Method for automatically identifying and positioning coordinates of image point of artificial mark in camera calibration control field
CN112233116A (en) Visual detection method of bump marks based on neighborhood decision and gray level co-occurrence matrix description
CN118570396B (en) A method and system for three-dimensional reconstruction of highly reflective object surfaces based on polarization line structure
CN112241964B (en) Light strip center extraction method for line structured light non-contact measurement
CN113409242A (en) Intelligent monitoring method for point cloud of rail intersection bow net
CN116125489A (en) Indoor object three-dimensional detection method, computer equipment and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20160406

Termination date: 20211231

CF01 Termination of patent right due to non-payment of annual fee