CN114972626A - A system and method for 3D reconstruction of weld seam based on coded structured light binocular vision - Google Patents
A system and method for 3D reconstruction of weld seam based on coded structured light binocular vision Download PDFInfo
- Publication number
- CN114972626A CN114972626A CN202210362368.7A CN202210362368A CN114972626A CN 114972626 A CN114972626 A CN 114972626A CN 202210362368 A CN202210362368 A CN 202210362368A CN 114972626 A CN114972626 A CN 114972626A
- Authority
- CN
- China
- Prior art keywords
- structured light
- camera
- welding seam
- industrial camera
- dimensional reconstruction
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 44
- 238000003466 welding Methods 0.000 claims abstract description 53
- 238000012937 correction Methods 0.000 claims abstract description 11
- 230000008569 process Effects 0.000 claims abstract description 8
- 238000012545 processing Methods 0.000 claims abstract description 7
- 230000010363 phase shift Effects 0.000 claims description 16
- 239000011159 matrix material Substances 0.000 claims description 12
- 230000003287 optical effect Effects 0.000 claims description 8
- 238000006243 chemical reaction Methods 0.000 claims description 6
- 238000013519 translation Methods 0.000 claims description 6
- 238000003384 imaging method Methods 0.000 claims description 4
- 238000001914 filtration Methods 0.000 claims description 3
- 230000008676 import Effects 0.000 claims description 3
- 238000005516 engineering process Methods 0.000 description 5
- 238000001514 detection method Methods 0.000 description 3
- 230000008859 change Effects 0.000 description 2
- 230000000007 visual effect Effects 0.000 description 2
- 238000012935 Averaging Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 239000003814 drug Substances 0.000 description 1
- 230000009977 dual effect Effects 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000009776 industrial production Methods 0.000 description 1
- 238000013507 mapping Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000035479 physiological effects, processes and functions Effects 0.000 description 1
- 238000012876 topography Methods 0.000 description 1
- 238000011179 visual inspection Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T17/00—Three dimensional [3D] modelling, e.g. data description of 3D objects
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/80—Analysis of captured images to determine intrinsic or extrinsic camera parameters, i.e. camera calibration
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10028—Range image; Depth image; 3D point clouds
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20228—Disparity calculation for image-based rendering
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02P—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
- Y02P90/00—Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
- Y02P90/30—Computing systems specially adapted for manufacturing
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computer Graphics (AREA)
- Geometry (AREA)
- Software Systems (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Length Measuring Devices By Optical Means (AREA)
Abstract
本发明提供了一种基于编码结构光双目视觉的焊缝三维重建系统及方法,包括计算机、焊缝三维重建程序、左工业相机、结构光发生器、右工业相机和双目安装底座;所述计算机通过焊缝三维重建程序处理采集到的图片;所述焊缝三维重建程序包括编码结构光图案生成、相机标定、图像采集、图像处理、解相位、极线校正、相位匹配和三维点云生成功能。应用本技术方案不需要单独标定投影仪和结构光平面,降低了三维重建系统标定复杂度,可以生成稠密的点云数据,重建精度高。
The present invention provides a system and method for 3D welding seam reconstruction based on coded structured light binocular vision, comprising a computer, a 3D welding seam reconstruction program, a left industrial camera, a structured light generator, a right industrial camera and a binocular mounting base; The computer processes the collected pictures through a welding seam 3D reconstruction program; the welding seam 3D reconstruction program includes coded structured light pattern generation, camera calibration, image acquisition, image processing, phase solution, epipolar correction, phase matching and 3D point cloud Generate function. The application of the technical solution does not require separate calibration of the projector and the structured light plane, reduces the calibration complexity of the three-dimensional reconstruction system, can generate dense point cloud data, and has high reconstruction accuracy.
Description
技术领域technical field
本发明涉及机器视觉技术领域,特别是一种基于编码结构光双目视觉的焊缝三维重建系统及方法。The invention relates to the technical field of machine vision, in particular to a three-dimensional reconstruction system and method for welding seam based on coded structured light binocular vision.
背景技术Background technique
三维重建技术作为机器视觉领域重要的一个分支,在机器人导航、零部件三维重建、医学中人体骨骼逆向建模、文物三维重建、地形地貌三维测绘、实时地图三维重建等领域有着越来越广泛的应用。随着工业生产要求的不断提高,精确快速的工件三维重建技术显得尤为重要。在焊接领域,传统的手工焊接受限于焊工的技术水平、生理等因素的影响,往往难以满足焊接工作的稳定性和高效性要求。随着焊接技术和工业机器人技术的不断发展,机器人焊接将逐步取代手工焊接,在焊接机器人中加入机器视觉,使机器人在不接触目标工件的情况下通过视觉的反馈信息进行作业,具有处理精度高,处理速度快等特点,将三维重建技术加入到焊接机器人系统中,可以提高焊缝识别精度和焊接加工的自动化程度、扩大机器人的应用领域具有重要意义。As an important branch in the field of machine vision, 3D reconstruction technology is widely used in the fields of robot navigation, 3D reconstruction of parts, reverse modeling of human skeleton in medicine, 3D reconstruction of cultural relics, 3D mapping of topography, and 3D reconstruction of real-time maps. application. With the continuous improvement of industrial production requirements, accurate and fast three-dimensional reconstruction technology of workpieces is particularly important. In the field of welding, traditional manual welding is limited by the technical level, physiology and other factors of the welder, and it is often difficult to meet the requirements of stability and efficiency of welding work. With the continuous development of welding technology and industrial robot technology, robot welding will gradually replace manual welding. Machine vision is added to the welding robot, so that the robot can operate through visual feedback information without touching the target workpiece, with high processing accuracy. , fast processing speed and other characteristics, adding 3D reconstruction technology to the welding robot system can improve the welding seam recognition accuracy and the automation degree of welding processing, and it is of great significance to expand the application field of robots.
常用的三维重建方法有双目立体视觉和结构光法,纯双目的方式受工件表面纹理影响比较大,表明弱纹理的待焊工件很难找到特征点,难以生成稠密点云数据;采用结构光加上单目相机的方案需要对投影仪进行标定,标定过程复杂难度大,误差难以消除。The commonly used 3D reconstruction methods include binocular stereo vision and structured light method. The pure binocular method is greatly affected by the surface texture of the workpiece, indicating that it is difficult to find feature points for the workpiece to be welded with weak texture, and it is difficult to generate dense point cloud data; The solution of light plus monocular camera needs to calibrate the projector, the calibration process is complicated and difficult, and the error is difficult to eliminate.
专利CN202110732138(申请日期为2021年6月30日,公开日期为2020年9月10日)公开了一种基于激光扫描的焊缝形状的特征提取与三维重建方法,根据激光扫描的原理、光学三角法原理设计光学结构系统,通过几何关系计算焊缝水平和垂直位置的变化信息;根据焊缝图像中心点的位置变化推导出实际焊缝中心点的偏差,通过对识别到的图像点云数据进行三维重建,还原出焊接后的整体三维图像。但还存在以下问题:1)扫描式结构光投影周期长;2)对结构光平面标定难度大;3)难以生成稠密点云数据。Patent CN202110732138 (application date is June 30, 2021, publication date is September 10, 2020) discloses a method for feature extraction and three-dimensional reconstruction of weld shape based on laser scanning, according to the principle of laser scanning, optical triangulation The optical structure system is designed according to the principle of the method, and the change information of the horizontal and vertical positions of the weld is calculated through the geometric relationship; the deviation of the actual weld center point is deduced according to the position change of the center point of the weld image. 3D reconstruction restores the overall 3D image after welding. But there are still the following problems: 1) The scanning structured light projection period is long; 2) It is difficult to calibrate the structured light plane; 3) It is difficult to generate dense point cloud data.
专利CN201710084398(申请日期为2017年2月16日,公开日期为2017年7月21日)公开了一种基于二维线结构光的焊缝三维重建方法,沿着目标焊缝进行扫描,在固定的时间间隔内,每隔一段时间对目标焊缝进行拍摄,然后获取目标焊缝的二维结构光图像,通过对结构光图像进行图像标定,得到结构光图像中一个像素点的实际长度与宽度;对焊缝二维结构光图像进行预处理,然后对结构光图像采用轮廓平均法进行焊缝中心线的提取,获得所述焊缝中心线的每一个像素点的实际坐标;对获取的每一道焊缝中心线的实际坐标,采用基于B-样条的插值法进行三维曲面拟合,从而重建出完整的三维焊缝表面。该方法可靠性较高、方法简单、检测识别效率较高。但还存在以下问题:1)需要对结构光平面进行标定,过程复杂;2)扫描式结构光投影周期长;3)无法生成稠密的点云数据。Patent CN201710084398 (application date is February 16, 2017, publication date is July 21, 2017) discloses a three-dimensional reconstruction method of weld seam based on two-dimensional line structured light The target weld is photographed at regular intervals, and then the two-dimensional structured light image of the target weld is obtained. The actual length and width of a pixel in the structured light image are obtained by calibrating the structured light image. ; Preprocess the two-dimensional structured light image of the weld, and then use the contour averaging method to extract the center line of the weld to obtain the actual coordinates of each pixel of the center line of the weld; The actual coordinates of the center line of a weld are fitted with a B-spline-based interpolation method for 3D surface fitting, thereby reconstructing a complete 3D weld surface. The method has high reliability, simple method and high detection and recognition efficiency. However, there are still the following problems: 1) the structured light plane needs to be calibrated, and the process is complicated; 2) the scanning structured light projection period is long; 3) the dense point cloud data cannot be generated.
专利CN201610280356(申请日期为2016年4月29日,公开日期为2016年7月20日)公开了一种基于线结构光视觉检测的曲线焊缝三维重建方法,线结构光视觉系统包括摄像机、线结构光投射器,所述线结构光投射器固定于所述摄像机一侧,且投射于待焊工件表面,所述曲线焊缝三维重建方法的步骤包括系统标定、焊缝检测、焊缝重建,从而重建出完整的三维曲线焊缝,该方法可以检测各种焊缝,方法简单,检测效率高。但还存在一下问题:1)需要标定结构光平面,标定误差不易控制;2)扫描式投影周期长;3)无法生成稠密的点云数据。Patent CN201610280356 (application date is April 29, 2016, publication date is July 20, 2016) discloses a three-dimensional reconstruction method for curved welds based on line structured light visual inspection. The line structured light vision system includes a camera, a line A structured light projector, the linear structured light projector is fixed on one side of the camera and projected on the surface of the workpiece to be welded, and the steps of the three-dimensional reconstruction method for a curved weld include system calibration, weld detection, and weld reconstruction, Therefore, a complete three-dimensional curved weld seam is reconstructed, and the method can detect various weld seams, and the method is simple and the detection efficiency is high. But there are still some problems: 1) the structured light plane needs to be calibrated, and the calibration error is not easy to control; 2) the scanning projection period is long; 3) the dense point cloud data cannot be generated.
综上所述,现有的焊缝三维重建方法大多都是采用线结构光,需要对结构光平面进行标定且标定难度大,扫描式线结构光往往投影周期较长,三维重建效率较低。To sum up, most of the existing methods for 3D reconstruction of welds use line structured light, which requires the calibration of the structured light plane and is difficult to calibrate. Scanning line structured light often has a long projection period and low 3D reconstruction efficiency.
发明内容SUMMARY OF THE INVENTION
有鉴于此,本发明的目的在于提供一种基于编码结构光双目视觉的焊缝三维重建系统及方法,对待焊工件及焊缝进行三维重建,将相机拍到的图像像素坐标转换为工件的三维坐标,生成稠密的点云数据。该方法不需要单独标定投影仪和结构光平面,降低了三维重建系统标定复杂度,可以生成稠密的点云数据,重建精度高。In view of this, the purpose of the present invention is to provide a three-dimensional reconstruction system and method for welding seam based on coded structured light binocular vision, to carry out three-dimensional reconstruction of the workpiece to be welded and the welding seam, and to convert the pixel coordinates of the image captured by the camera into the coordinates of the workpiece. 3D coordinates to generate dense point cloud data. The method does not require separate calibration of the projector and the structured light plane, which reduces the calibration complexity of the 3D reconstruction system, can generate dense point cloud data, and has high reconstruction accuracy.
为实现上述目的,本发明采用如下技术方案:一种基于编码结构光双目视觉的焊缝三维重建系统,包括计算机、焊缝三维重建程序、左工业相机、结构光发生器、右工业相机和双目安装底座;所述左工业相机和右工业相机之间间隔角度安装在安装底座上;所述结构光发生器安装在左工业相机和右工业相机中间;所述结构光发生器用于投射带有编码信息的机构光图案;所述左工业相机和右工业相机用于采集被编码结构光图案覆盖的待焊工件的图像并通过数据线传输到计算机中;所述计算机通过焊缝三维重建程序处理采集到的图片;所述焊缝三维重建程序包括编码结构光图案生成、相机标定、图像采集、图像处理、解相位、极线校正、相位匹配和三维点云生成功能。In order to achieve the above object, the present invention adopts the following technical scheme: a three-dimensional reconstruction system for welding seam based on coded structured light binocular vision, including a computer, a three-dimensional welding seam reconstruction program, a left industrial camera, a structured light generator, a right industrial camera and The binocular mounting base; the spaced angle between the left industrial camera and the right industrial camera is installed on the mounting base; the structured light generator is mounted between the left industrial camera and the right industrial camera; the structured light generator is used for projection tape A structured light pattern with coded information; the left industrial camera and the right industrial camera are used to capture the image of the workpiece to be welded covered by the coded structured light pattern and transmit it to the computer through the data line; the computer uses the welding seam 3D reconstruction program The acquired pictures are processed; the three-dimensional reconstruction program of the weld seam includes the functions of coding structured light pattern generation, camera calibration, image acquisition, image processing, phase solution, epipolar correction, phase matching and three-dimensional point cloud generation.
本发明还提供了一种基于编码结构光双目视觉的焊缝三维重建方法,包括以下步骤:The present invention also provides a three-dimensional reconstruction method for welding seam based on coded structured light binocular vision, comprising the following steps:
步骤A1:搭建包括计算机、左工业相机、结构光发生器、右工业相机和双目安装底座的结构光双目视觉硬件平台;Step A1: Build a structured light binocular vision hardware platform including a computer, a left industrial camera, a structured light generator, a right industrial camera and a binocular mounting base;
步骤A2:根据工作距离调整左工业相机和右工业相机的相对位置,使得公共视野最大,并调节相机的光圈和焦距,并固定相机的位置、光圈和焦距,左右相机组成双目视觉系统;Step A2: Adjust the relative position of the left industrial camera and the right industrial camera according to the working distance to maximize the public field of view, adjust the aperture and focal length of the camera, and fix the position, aperture and focal length of the camera, and the left and right cameras form a binocular vision system;
步骤A3:连接计算机和双目视觉系统,通过焊缝三维重建程序对双目视觉系统进行标定,获得两个工业相机的内外参数;Step A3: Connect the computer and the binocular vision system, calibrate the binocular vision system through the welding seam 3D reconstruction program, and obtain the internal and external parameters of the two industrial cameras;
步骤A4:通过焊缝三维重建程序生成编码结构光图案导入投影仪中控制投影仪向待焊工件投射编码结构光图像同时双目视觉系统采集图像;Step A4: Generate a coded structured light pattern through a welding seam 3D reconstruction program and import it into a projector, and control the projector to project the coded structured light image to the workpiece to be welded while the binocular vision system collects the image;
步骤A5:计算机中焊缝三维重建程序处理采集到的图像,获得待焊工件的三维点云数据,完成焊缝的三维重建。Step A5: The three-dimensional reconstruction program of the welding seam in the computer processes the collected images, obtains the three-dimensional point cloud data of the workpiece to be welded, and completes the three-dimensional reconstruction of the welding seam.
在一较佳的实施例中,步骤A3的焊缝三维重建程序采用张正友标定法对双目视觉系统获得相机的径向畸变参数k1,k2,k3和切向畸变参数p1,p2,双目联合标定得到右工业相机相对于左工业相机的旋转矩阵R和平移矩阵T。In a preferred embodiment, the three-dimensional reconstruction program of the weld seam in step A3 uses the Zhang Zhengyou calibration method to obtain the radial distortion parameters k1, k2, k3 and tangential distortion parameters p1, p2 of the camera for the binocular vision system, and the binocular joint The calibration obtains the rotation matrix R and translation matrix T of the right industrial camera relative to the left industrial camera.
在一较佳的实施例中:在步骤A4焊缝三维重建程序中,选取3种波长分别为28、26和24的光栅,采用四步相移,生成条纹的相移公式为:In a preferred embodiment: in the step A4 welding seam three-dimensional reconstruction program, select 3 kinds of gratings with wavelengths of 28, 26 and 24 respectively, adopt four-step phase shift, and the phase shift formula for generating fringes is:
其中A为背景光强,B为调制度强度,为相位值,为相移值,f为相移频率,x为编码方向上的像素坐标,N为相移步数。where A is the background light intensity, B is the modulation intensity, is the phase value, is the phase shift value, f is the phase shift frequency, x is the pixel coordinate in the encoding direction, and N is the number of phase shift steps.
在一较佳的实施例中:In a preferred embodiment:
步骤A5的实现包括以下步骤:The realization of step A5 includes the following steps:
步骤C1:通过采集到的图像得到3种不同频率的包裹相位图,多个方程联立的解相位公式为:Step C1: Obtain three kinds of wrapped phase maps of different frequencies through the collected images. The phase formula for the simultaneous solution of multiple equations is:
步骤C2:对解出来的相位进行调制度滤波,消除噪声区域:Step C2: Perform modulation filtering on the solved phase to eliminate noise areas:
步骤C3:基于权利3所述旋转矩阵R和平移矩阵T,通过极线校正算法对左右图像进行极线校正,使得左右图像共面且行对齐;Step C3: based on the rotation matrix R and the translation matrix T described in
步骤C4:基于步骤C3得到的校正后的左右展开相位,使用相位立体匹配算法得到左右展开相位中各点对应的视差d;Step C4: Based on the corrected left and right unwrapped phases obtained in step C3, use a phase stereo matching algorithm to obtain the parallax d corresponding to each point in the left and right unwrapped phases;
步骤C5:以外界某个参考点建立世界坐标系OW-XWYWZW,记空间中物点坐标为P=[XW,YW,ZW],以相机光心建立相机坐标系OC-XCYCZC,使其z轴指向相机的正方向,记物点在相机坐标系下的坐标为P=[XC,YC,ZC],以光心在成像平面的投影为原点建立图像坐标系并在图像上建立像素坐标系,用u、v表示图像像素的列与行;Step C5: Establish the world coordinate system OW-XWYWZW with a certain reference point in the outside world, record the coordinates of the object point in the space as P=[XW, YW, ZW], and establish the camera coordinate system OC-XCYCZC with the camera optical center, so that its z axis Point to the positive direction of the camera, the coordinates of the object point in the camera coordinate system are P=[XC, YC, ZC], take the projection of the optical center on the imaging plane as the origin to establish the image coordinate system and establish the pixel coordinate system on the image, Use u and v to represent the columns and rows of image pixels;
步骤C6:根据四大坐标系的转换关系,可以得到像素坐标和世界坐标的转换关系为:Step C6: According to the conversion relationship of the four coordinate systems, the conversion relationship between pixel coordinates and world coordinates can be obtained as:
步骤C7:基于权利要求3得到的标定参数,对像素坐标进行校正,将径向畸变和切向畸变合并,有:Step C7: Based on the calibration parameters obtained in
得到已知的无畸变的像素点坐标(u,v);Get the known undistorted pixel coordinates (u, v);
步骤C8:根据视差原理和步骤C5得到的像素坐标与世界坐标的对应关系有:Step C8: The correspondence between the pixel coordinates and the world coordinates obtained according to the parallax principle and step C5 is as follows:
其中焦距f、相机基线b由标定得到,空间中点P在左相机上的点坐标Pl(ul,vl)和相应的右相机对应点Pr(ur,vr);The focal length f and the camera baseline b are obtained by calibration, the point coordinates Pl(ul,vl) of the point P in the space on the left camera and the corresponding point Pr(ur,vr) of the corresponding right camera;
步骤C9:根据C8得到的待测工件焊缝的三维坐标生成稠密的点云图,完成三维重建。Step C9: Generate a dense point cloud image according to the three-dimensional coordinates of the weld seam of the workpiece to be tested obtained in C8, and complete the three-dimensional reconstruction.
与现有技术相比,本发明具有以下有益效果:Compared with the prior art, the present invention has the following beneficial effects:
本发明所提出的一种基于编码结构光双目视觉的焊缝三维重建系统及方法,利用多频外差原理与相移法相结合的结构光编码方法,对待焊工件表面各点进行唯一标记,然后基于双目相机拍摄被标记的待焊工件图像进行相位展开得到绝对相位,根据双目标定得到的内外参数进行极线校正得到无畸变、成像平面平行且行对齐的左右图像,通过立体匹配算法对左右图像相位进行匹配得到对应视差,最后根据视差原理计算得到三维坐标生成稠密点云图,完成待焊工件的三维重建。A system and method for three-dimensional reconstruction of welding seam based on coded structured light binocular vision proposed by the present invention utilizes a structured light coding method combining multi-frequency heterodyne principle and phase shift method to uniquely mark each point on the surface of the workpiece to be welded, Then, based on the binocular camera to capture the marked image of the workpiece to be welded, phase unwrapping is performed to obtain the absolute phase, and epipolar correction is performed according to the internal and external parameters obtained by the binocular camera to obtain left and right images with no distortion, parallel imaging planes and aligned rows. The phase of the left and right images is matched to obtain the corresponding parallax. Finally, the three-dimensional coordinates are calculated according to the principle of parallax to generate a dense point cloud image, and the three-dimensional reconstruction of the workpiece to be welded is completed.
本发明所提出的一种基于编码结构光双目视觉的焊缝三维重建系统及方法,不需要对投影仪和结构光平面进行标定,降低了视觉系统的标定难度,同时可以生成稠密点云数据,提高了待焊工件焊缝的三维重建精度。The system and method for 3D welding seam reconstruction based on coded structured light binocular vision proposed by the present invention does not require calibration of the projector and the structured light plane, reduces the calibration difficulty of the vision system, and can generate dense point cloud data at the same time. , which improves the 3D reconstruction accuracy of the weld seam of the workpiece to be welded.
附图说明Description of drawings
图1为本发明优选实施例的进行焊缝三维重建的流程图;FIG. 1 is a flow chart of performing three-dimensional reconstruction of a weld according to a preferred embodiment of the present invention;
图2为本发明优选实施例的硬件平台的示意图;Fig. 2 is the schematic diagram of the hardware platform of the preferred embodiment of the present invention;
图3为本发明优选实施例的焊缝三维重建程序的流程图;FIG. 3 is a flowchart of a welding seam 3D reconstruction program according to a preferred embodiment of the present invention;
图4为本发明优选实施例的焊缝三维重建程序中的相位匹配算法的流程图。FIG. 4 is a flowchart of the phase matching algorithm in the three-dimensional reconstruction program of the weld according to the preferred embodiment of the present invention.
具体实施方式Detailed ways
下面结合附图及实施例对本发明做进一步说明。The present invention will be further described below with reference to the accompanying drawings and embodiments.
应该指出,以下详细说明都是例示性的,旨在对本申请提供进一步的说明。除非另有指明,本文使用的所有技术和科学术语具有与本申请所属技术领域的普通技术人员通常理解的相同含义。It should be noted that the following detailed description is exemplary and intended to provide further explanation of the application. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs.
需要注意的是,这里所使用的术语仅是为了描述具体实施方式,而非意图限制根据本申请的示例性实施方式;如在这里所使用的,除非上下文另外明确指出,否则单数形式也意图包括复数形式,此外,还应当理解的是,当在本说明书中使用术语“包含”和/或“包括”时,其指明存在特征、步骤、操作、器件、组件和/或它们的组合。It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and not intended to limit the exemplary embodiments in accordance with the present application; as used herein, unless the context clearly dictates otherwise, the singular forms are also intended to include Plural forms, furthermore, should also be understood that when the terms "comprising" and/or "comprising" are used in this specification, they indicate the presence of features, steps, operations, devices, components and/or combinations thereof.
一种基于编码结构光双目视觉的焊缝三维重建系统,参考图1至4,包括计算机1、焊缝三维重建程序2、左工业相机3、结构光发生器4、右工业相机5和双目安装底座6;所述左工业相机3和右工业相机5呈一定角度安装在安装底座6上;所述结构光发生器5安装在左工业相机3和右工业相机4中间,所述左工业相机3和右工业相机5之间呈轴对称分布;所述结构光发生器4用于投射带有编码信息的机构光图案;所述左工业相机3和右工业相机5用于采集被编码结构光图案覆盖的待焊工件的图像并通过数据线传输到计算机1中;所述计算机1通过焊缝三维重建程序处理采集到的图片;所述焊缝三维重建程序包括编码结构光图案生成、相机标定、图像采集、图像处理、解相位、极线校正、相位匹配和三维点云生成功能。A welding seam 3D reconstruction system based on coded structured light binocular vision, referring to Figures 1 to 4, includes a
所述基于编码结构光双目视觉的焊缝三维重建方法包括以下步骤:The method for 3D reconstruction of weld seam based on coded structured light binocular vision includes the following steps:
步骤A1:搭建包括计算机、左工业相机(海康MV-CE060-10UM)、结构光发生器(UKCSIST9)、右工业相机(海康MV-CE060-10UM)和双目安装底座的结构光双目视觉硬件平台;Step A1: Build a structured light binocular including a computer, a left industrial camera (Hikvision MV-CE060-10UM), a structured light generator (UKCSIT9), a right industrial camera (Hikvision MV-CE060-10UM) and a binocular mounting base visual hardware platform;
步骤A2:根据工作距离(400mm)调整左工业相机和右工业相机的相对位置,使得公共视野最大,并调节相机的光圈和焦距以获得清晰的图像,并固定相机的位置、光圈和焦距,左右相机组成双目视觉系统;Step A2: Adjust the relative position of the left industrial camera and the right industrial camera according to the working distance (400mm) to maximize the public field of view, and adjust the aperture and focal length of the camera to obtain a clear image, and fix the position, aperture and focal length of the camera, left and right The camera forms a binocular vision system;
步骤A3:连接计算机和双目视觉系统,通过焊缝三维重建程序对双目视觉系统进行标定,获得两个工业相机的内外参数;Step A3: Connect the computer and the binocular vision system, calibrate the binocular vision system through the welding seam 3D reconstruction program, and obtain the internal and external parameters of the two industrial cameras;
步骤A4:通过焊缝三维重建程序生成编码结构光图案导入投影仪中控制投影仪向待焊工件投射编码结构光图像同时双目视觉系统采集图像;Step A4: Generate a coded structured light pattern through a welding seam 3D reconstruction program and import it into a projector, and control the projector to project the coded structured light image to the workpiece to be welded while the binocular vision system collects the image;
步骤A5:计算机中焊缝三维重建程序处理采集到的图像,获得待焊工件的三维点云数据,完成焊缝的三维重建。Step A5: The three-dimensional reconstruction program of the welding seam in the computer processes the collected images, obtains the three-dimensional point cloud data of the workpiece to be welded, and completes the three-dimensional reconstruction of the welding seam.
优选地,在步骤A3采用张正友标定法获得相机的径向畸变参数k1,k2,k3和切向畸变参数p1,p2,双目联合标定得到右相机相对于左相机的旋转矩阵R和平移矩阵T。Preferably, in step A3, the radial distortion parameters k1, k2, k3 and tangential distortion parameters p1, p2 of the camera are obtained by Zhang Zhengyou's calibration method, and the rotation matrix R and translation matrix T of the right camera relative to the left camera are obtained by the binocular joint calibration. .
优选地,在步骤A4中,根据多频外差原理选取3种波长分别为28、26和24的光栅,采用四步相移,生成条纹的相移公式为:Preferably, in step A4, three gratings with wavelengths of 28, 26 and 24 are selected according to the principle of multi-frequency heterodyne, and four-step phase shift is adopted, and the phase shift formula for generating fringes is:
其中A为背景光强,B为调制度强度,为相位值,为相移值,f为相移频率,x为编码方向上的像素坐标,N为相移步数。where A is the background light intensity, B is the modulation intensity, is the phase value, is the phase shift value, f is the phase shift frequency, x is the pixel coordinate in the encoding direction, and N is the number of phase shift steps.
优选地,步骤A5的实现包括以下步骤:Preferably, the realization of step A5 includes the following steps:
步骤C1:通过采集到的图像得到3种不同频率的包裹相位图,多个方程联立的解相位公式为:Step C1: Obtain three kinds of wrapped phase maps of different frequencies through the collected images. The phase formula for the simultaneous solution of multiple equations is:
步骤C2:对解出来的相位进行调制度滤波,消除噪声区域:Step C2: Perform modulation filtering on the solved phase to eliminate noise areas:
步骤C3:基于权利3所述旋转矩阵R和平移矩阵T,通过极线校正算法对左右图像进行极线校正,使得左右图像共面且行对齐。Step C3: based on the rotation matrix R and the translation matrix T described in right 3, polar correction is carried out to the left and right images by the polar correction algorithm, so that the left and right images are coplanar and aligned.
步骤C4:基于步骤C3得到的校正后的左右展开相位,使用相位立体匹配算法得到左右展开相位中各点对应的视差d。Step C4: Based on the corrected left and right unwrapped phases obtained in step C3, a phase stereo matching algorithm is used to obtain the parallax d corresponding to each point in the left and right unwrapped phases.
步骤C5:以外界某个参考点建立世界坐标系OW-XWYWZW,记空间中物点坐标为P=[XW,YW,ZW],以相机光心建立相机坐标系OC-XCYCZC,使其z轴指向相机的正方向,记物点在相机坐标系下的坐标为P=[XC,YC,ZC],以光心在成像平面的投影为原点建立图像坐标系并在图像上建立像素坐标系,用u、v表示图像像素的列与行;Step C5: Establish the world coordinate system OW-XWYWZW with a certain reference point in the outside world, record the coordinates of the object point in the space as P=[XW, YW, ZW], and establish the camera coordinate system OC-XCYCZC with the camera optical center, so that its z axis Point to the positive direction of the camera, the coordinates of the object point in the camera coordinate system are P=[XC, YC, ZC], take the projection of the optical center on the imaging plane as the origin to establish the image coordinate system and establish the pixel coordinate system on the image, Use u and v to represent the columns and rows of image pixels;
步骤C6:根据四大坐标系的转换关系,可以得到像素坐标和世界坐标的转换关系为:Step C6: According to the conversion relationship of the four coordinate systems, the conversion relationship between pixel coordinates and world coordinates can be obtained as:
步骤C7:基于权利要求3得到的标定参数,对像素坐标进行校正,将径向畸变和切向畸变合并,有:Step C7: Based on the calibration parameters obtained in
得到已知的无畸变的像素点坐标(u,v);Get the known undistorted pixel coordinates (u, v);
步骤C8:根据视差原理和步骤C5得到的像素坐标与世界坐标的对应关系有:Step C8: The correspondence between the pixel coordinates and the world coordinates obtained according to the parallax principle and step C5 is as follows:
其中焦距f、相机基线b由标定得到,空间中点P在左相机上的点坐标Pl(ul,vl)和相应的右相机对应点Pr(ur,vr)。The focal length f and the camera baseline b are obtained by calibration, the point coordinates Pl(ul,vl) of the point P in the space on the left camera and the corresponding point Pr(ur,vr) of the corresponding right camera.
步骤C9:根据C8得到的待测工件焊缝的三维坐标生成稠密的点云图,完成三维重建。Step C9: Generate a dense point cloud image according to the three-dimensional coordinates of the weld seam of the workpiece to be tested obtained in C8, and complete the three-dimensional reconstruction.
本专利不局限于上述最佳实施方式,任何熟悉本技术领域的技术人员在本专利的启示下都可以得出其他各种形式的焊缝三维重建方法。凡依本发明申请专利范围所做的均等变化与修饰,皆应属本专利的涵盖范围。This patent is not limited to the above-mentioned best embodiment, and any person skilled in the art can derive other various forms of three-dimensional reconstruction methods of welding seam under the inspiration of this patent. All equivalent changes and modifications made according to the scope of the patent application of the present invention shall fall within the scope of this patent.
Claims (5)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210362368.7A CN114972626B (en) | 2022-04-07 | 2022-04-07 | Weld joint three-dimensional reconstruction system and method based on coded structured light binocular vision |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210362368.7A CN114972626B (en) | 2022-04-07 | 2022-04-07 | Weld joint three-dimensional reconstruction system and method based on coded structured light binocular vision |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114972626A true CN114972626A (en) | 2022-08-30 |
CN114972626B CN114972626B (en) | 2024-09-13 |
Family
ID=82978114
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210362368.7A Active CN114972626B (en) | 2022-04-07 | 2022-04-07 | Weld joint three-dimensional reconstruction system and method based on coded structured light binocular vision |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114972626B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2024113127A1 (en) * | 2022-11-29 | 2024-06-06 | 电子科技大学 | Three-dimensional reconstruction method based on structured light and binocular vision |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107907048A (en) * | 2017-06-30 | 2018-04-13 | 长沙湘计海盾科技有限公司 | A kind of binocular stereo vision method for three-dimensional measurement based on line-structured light scanning |
CN111028295A (en) * | 2019-10-23 | 2020-04-17 | 武汉纺织大学 | A 3D imaging method based on encoded structured light and binocular |
CN112802184A (en) * | 2021-01-25 | 2021-05-14 | 三一重工股份有限公司 | Three-dimensional point cloud reconstruction method and system, electronic device and storage medium |
WO2021208231A1 (en) * | 2020-04-15 | 2021-10-21 | 上海工程技术大学 | Gap measuring system and measuring method |
CN113643372A (en) * | 2021-10-18 | 2021-11-12 | 中国科学院自动化研究所 | Three-dimensional weld extraction method and system |
-
2022
- 2022-04-07 CN CN202210362368.7A patent/CN114972626B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107907048A (en) * | 2017-06-30 | 2018-04-13 | 长沙湘计海盾科技有限公司 | A kind of binocular stereo vision method for three-dimensional measurement based on line-structured light scanning |
CN111028295A (en) * | 2019-10-23 | 2020-04-17 | 武汉纺织大学 | A 3D imaging method based on encoded structured light and binocular |
WO2021208231A1 (en) * | 2020-04-15 | 2021-10-21 | 上海工程技术大学 | Gap measuring system and measuring method |
CN112802184A (en) * | 2021-01-25 | 2021-05-14 | 三一重工股份有限公司 | Three-dimensional point cloud reconstruction method and system, electronic device and storage medium |
CN113643372A (en) * | 2021-10-18 | 2021-11-12 | 中国科学院自动化研究所 | Three-dimensional weld extraction method and system |
Non-Patent Citations (2)
Title |
---|
李靖;王炜;张茂军;: "双目立体视觉和编码结构光相结合的三维重建方法", 计算机应用, no. 2, 31 December 2012 (2012-12-31), pages 154 - 158 * |
王克鸿;杨嘉佳;孙科;: "基于视觉的焊接三维重建技术研究现状", 机械制造与自动化, no. 01, 20 February 2013 (2013-02-20), pages 1 - 5 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2024113127A1 (en) * | 2022-11-29 | 2024-06-06 | 电子科技大学 | Three-dimensional reconstruction method based on structured light and binocular vision |
Also Published As
Publication number | Publication date |
---|---|
CN114972626B (en) | 2024-09-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110288642B (en) | Three-dimensional object rapid reconstruction method based on camera array | |
CN102506757B (en) | Self-positioning method in multi-angle measurement of binocular stereo measurement system | |
CN100388319C (en) | Multi-view pose estimation and self-calibration method for 3D active vision sensor | |
WO2018103152A1 (en) | Three-dimensional digital imaging sensor, and three-dimensional scanning system and scanning method thereof | |
CN105066909B (en) | A kind of many laser stripe quick three-dimensional measuring methods of hand-held | |
CN106767533B (en) | Efficient phase-three-dimensional mapping method and system based on fringe projection technology of profiling | |
CN109307483B (en) | Phase unwrapping method based on geometric constraint of structured light system | |
CN109579695B (en) | Part measuring method based on heterogeneous stereoscopic vision | |
CN107123156A (en) | A kind of active light source projection three-dimensional reconstructing method being combined with binocular stereo vision | |
CN109727277B (en) | Body surface positioning tracking method for multi-eye stereo vision | |
AU2020103301A4 (en) | Structural light 360-degree three-dimensional surface shape measurement method based on feature phase constraints | |
WO2020199439A1 (en) | Single- and dual-camera hybrid measurement-based three-dimensional point cloud computing method | |
CN108801175B (en) | A kind of high-precision spatial pipeline measuring system and method | |
CN110940295B (en) | High-reflection object measurement method and system based on laser speckle limit constraint projection | |
CN104299211A (en) | Free-moving type three-dimensional scanning method | |
CN104408762A (en) | Method for obtaining object image information and three-dimensional model by using monocular unit and two-dimensional platform | |
CN111091076B (en) | Measurement method of tunnel boundary data based on stereo vision | |
CN106323176A (en) | Three dimensional displacement monitoring method for strip mine side slope | |
CN114143426B (en) | Three-dimensional reconstruction system and method based on panoramic structured light | |
CN111189416A (en) | Structural light 360-degree three-dimensional surface shape measuring method based on characteristic phase constraint | |
CN117346694B (en) | Detection method and detection system for composite surface type sample | |
CN107990846A (en) | Master based on single frames structure light passively combines depth information acquisition method | |
CN114170284A (en) | Multi-view point cloud registration method based on active landmark projection assistance | |
CN114972626B (en) | Weld joint three-dimensional reconstruction system and method based on coded structured light binocular vision | |
CN117073579A (en) | Structured light binocular three-dimensional measurement system and method based on stripe projection |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |