有多个不同波长激光器的三维扫描方法及扫描仪 技术领域 Three-dimensional scanning method and scanner with multiple different wavelength lasers
[0001] 本发明涉及三维扫描技术, 尤其是一种三维扫描方法及扫描仪。 [0001] The present invention relates to three-dimensional scanning technology, and more particularly to a three-dimensional scanning method and a scanner.
背景技术 Background technique
[0002] 近年来出现的手持激光三维扫描仪、 激光三维轮廓传感器等三维测量仪器的原 理均是采用激光和摄像头的组合根据三角测量法获得物体表面三维数据, 这种 测量原理的应用越来越广泛, 已然成为高精度三维测量领域的主要测量方法之 一, 被广泛应用在机械、 汽车、 航空、 雕塑、 医疗等行业。 [0002] The principle of three-dimensional measuring instruments such as handheld laser three-dimensional scanners and laser three-dimensional contour sensors that have appeared in recent years is to obtain three-dimensional data of the surface of an object according to the triangulation method by using a combination of a laser and a camera. Widely, it has become one of the main measurement methods in the field of high-precision 3D measurement, and is widely used in machinery, automotive, aviation, sculpture, medical and other industries.
[0003] 这种基于激光和摄像头的三维测量方法中激光波段常见的有 405nm的紫色激光 、 450nm的蓝色激光、 532nm的绿色激光、 650nm的红色激光等, 不同波段的激 光对三维扫描效果的影响也并不一样。 比如红色激光的散斑现象比较明显从而 影响扫描的精度, 但红色激光比较稳定且对人眼相对安全; 相比之下, 蓝色激 光的散斑现象并不明显, 摄像头识别的精度较高, 从而可以获得很好的扫描结 果, 但蓝色激光对人眼有伤害, 需要佩戴护目镜, 限制了其三维扫描的应用场 合。 因此, 如何选择合适波段的激光器同吋满足不同三维扫描场合的需求是一 件很棘手的事情。 [0003] This laser-based and camera-based three-dimensional measurement method commonly used in the laser band is a 405 nm purple laser, a 450 nm blue laser, a 532 nm green laser, a 650 nm red laser, etc. The impact is not the same. For example, the speckle phenomenon of the red laser is relatively obvious and affects the accuracy of the scanning, but the red laser is relatively stable and relatively safe to the human eye; in contrast, the speckle phenomenon of the blue laser is not obvious, and the accuracy of the camera recognition is high. This results in good scanning results, but the blue laser is harmful to the human eye and requires the use of goggles, which limits its three-dimensional scanning applications. Therefore, how to choose the right wavelength of the laser to meet the needs of different three-dimensional scanning occasions is a very difficult thing.
技术问题 technical problem
[0004] 为了克服已有手持激光三维扫描仪的仅含有单一波长、 适用性较差、 成本较高 的不足, 本发明提供了一种具有多个不同波长、 适用性良好、 增加单台扫描仪 的复用性、 提高性价比的含有多个不同波长激光器的三维扫描方法及扫描仪。 问题的解决方案 [0004] In order to overcome the shortcomings of the existing handheld laser three-dimensional scanner, which only contain a single wavelength, poor applicability, and high cost, the present invention provides a single scanner with multiple different wavelengths, good applicability, and good applicability. Reusability, cost-effective 3D scanning method and scanner with multiple different wavelength lasers. Problem solution
技术解决方案 Technical solution
[0005] 本发明解决其技术问题所采用的技术方案是: [0005] The technical solution adopted by the present invention to solve the technical problem thereof is:
[0006] 一种含有多个不同波长激光器的三维扫描方法, 实现所述三维扫描方法的扫描 仪包括位置固定的一个摄像头与至少两个激光投影器, 所述的至少两个激光投 影器对应至少两种不同波长, 激光投影器所投射的光幕的空间位置与摄像头的
位置关系均标定已知; 所述三维扫描方法如下: [0006] A three-dimensional scanning method comprising a plurality of lasers of different wavelengths, wherein the scanner implementing the three-dimensional scanning method comprises a camera fixed in position and at least two laser projectors, wherein the at least two laser projectors correspond to at least Two different wavelengths, the spatial position of the light curtain projected by the laser projector and the camera's The positional relationship is nominally known; the three-dimensional scanning method is as follows:
[0007] 根据摄像头拍摄的投射到被扫描物体表面的激光轮廓线的 2D图案识别获取高光 中心二维线条, 再根据三角法原理计算得出空间三维点云数据。 [0007] According to the 2D pattern of the laser contour projected by the camera to the surface of the scanned object, the two-dimensional line of the highlight center is acquired, and the spatial three-dimensional point cloud data is calculated according to the trigonometric principle.
[0008] 进一步, 利用一个额外的位置关系已知的摄像头与原先的摄像头组成双目立体 相机来捕捉视野中的特征点来获得相对位置的变化信息, 再利用摄像头捕捉前 后帧吋的位置变化信息将扫描仪连续帧获得三维轮廓线点云数据拼接在一个坐 标系下, 获得被扫描物体完整的表面三维轮廓点云数据, 实现连续扫描。 [0008] Further, using a camera with a known positional relationship and the original camera to form a binocular stereo camera to capture feature points in the field of view to obtain relative position change information, and then use the camera to capture position change information of the frame before and after the frame. The three-dimensional contour point cloud data of the scanner is obtained in a continuous coordinate frame to obtain a complete surface three-dimensional contour point cloud data of the scanned object, thereby realizing continuous scanning.
[0009] 或者是: 利用带位置信号的流水线或直线滑台、 带角度信号的旋转平台上放置 被扫描物体而直接得到扫描仪与被扫描物体相对位置的变化信息, 再利用摄像 头捕捉前后帧吋的位置变化信息将扫描仪连续帧获得三维轮廓线点云数据拼接 在一个坐标系下, 获得被扫描物体完整的表面三维轮廓点云数据, 实现连续扫 描。 [0009] Alternatively: using a pipeline with a position signal or a linear slide, a rotating platform with an angle signal to directly display the change information of the relative position of the scanner and the scanned object, and then use the camera to capture the front and rear frames. The position change information is obtained by splicing the three-dimensional contour point cloud data in a continuous frame of the scanner in a coordinate system, and obtaining the complete surface three-dimensional contour point cloud data of the scanned object to realize continuous scanning.
[0010] 再进一步, 所述三维扫描方法包括以下步骤: [0010] Further, the three-dimensional scanning method includes the following steps:
[0011] 1) 事先标定摄像头分别在不同波长的相机内参和畸变系数; [0011] 1) pre-calibrating the camera and the distortion coefficient in the camera of different wavelengths;
[0012] 2) 事先分别标定至少两个激光投影器所投射的光面与摄像头之间的空间位置 [0012] 2) separately calibrating the spatial position between the light surface projected by the at least two laser projectors and the camera
[0013] 3) 扫描前, 根据现场的精度和扫描面幅的需求选择对应波段激光投影器进行 扫描, 根据设定选择对应波长下的摄像头标定内参及畸变系数并输出给 2D图像 激光轮廓线提取器和 3D构造器; 根据设定选择对应波长的激光器与摄像头的位 置参数并输出给 3D构造器; [0013] 3) Before scanning, select the corresponding band laser projector to scan according to the accuracy of the scene and the scanning surface requirement, select the camera calibration internal reference and distortion coefficient corresponding to the wavelength according to the setting and output to the 2D image laser contour line extraction. And a 3D constructor; selecting a positional parameter of the laser and the camera corresponding to the wavelength according to the setting and outputting to the 3D constructor;
[0014] 4) 扫描吋, 摄像头将捕捉的物体表面激光轮廓图像输入到 2D图像激光轮廓线 提取器中, 2D图像激光轮廓线提取器根据所选择的当前波段的摄像头内参和畸 变系数对所述二维图像进行畸变矫正, 并根据像素灰度差异提取矫正图像中线 条轮廓的连通区域, 再根据所述连通区域内的灰度重心计算获得亚像素级的高 光中心二维线条集合; 得到的二维线条集合被输出到 3D构造器中, 根据所选择 的当前波段的摄像头内参、 畸变系数和选择的当前工作激光与摄像头的位置标 定参数, 通过三角法原理得到三维轮廓点云数据并输出。 [0014] 4) scanning 吋, the camera inputs the captured surface contour laser contour image into the 2D image laser contour extractor, and the 2D image laser contour extractor according to the selected intra-camera internal reference and distortion coefficient The two-dimensional image is corrected for distortion, and the connected region of the line contour in the corrected image is extracted according to the difference of the pixel gray scale, and the two-dimensional line set of the sub-pixel-level highlight center is obtained according to the gray center of gravity in the connected region; The dimensional line set is output to the 3D constructor. According to the selected camera internal parameters, the distortion coefficient and the selected current working laser and the camera position calibration parameters, the three-dimensional contour point cloud data is obtained and output by the trigonometric principle.
[0015] 所述步骤 1) 中, 摄像头的标定方法采用张正友标定法获得摄像头的焦距、 中
心偏移量以及径向畸变和切向畸变系数。 [0015] In the step 1), the calibration method of the camera uses the Zhang Zhengyou calibration method to obtain the focal length of the camera, Heart offset and radial distortion and tangential distortion coefficients.
[0016] 所述步骤 2) 中, 激光投影器所投射的光面与摄像头之间的空间位置的具体标 定方法利用表面具有已知特征的平板作为标定板, 摄像头拍摄投射到标定板上 的线状激光获得一幅二维的激光线图像, 再利用仿射变换原理将二维图像中的 标定板"拉伸"为三维坐标中真实的尺寸, 同吋得到摄像头坐标系下的三维激光轮 廓线; 将扫描仪相对于标定板变换多个距离便得到多条摄像头坐标系下三维激 光轮廓线, 将这些三维轮廓线的点云拟合出的摄像头坐标系下的平面方程即为 该激光器所投射的光面与摄像头之间的空间位置标定参数。 [0016] In the step 2), the specific calibration method of the spatial position between the light surface projected by the laser projector and the camera utilizes a flat plate having a known feature on the surface as a calibration plate, and the camera captures the line projected onto the calibration plate. The laser obtains a two-dimensional laser line image, and then uses the principle of affine transformation to "stretch" the calibration plate in the two-dimensional image into the true size in the three-dimensional coordinates, and obtain the three-dimensional laser contour in the camera coordinate system. Converting the scanner to a plurality of distances relative to the calibration plate to obtain a three-dimensional laser contour line in a plurality of camera coordinate systems, and the plane equation in the camera coordinate system fitting the point cloud of the three-dimensional contour line is projected by the laser The position of the spatial position between the glossy surface and the camera is calibrated.
[0017] 一种含有多个不同波长激光器的三维扫描仪, 所述扫描仪包括至少两个激光投 影器、 至少一个用于拍摄投射到被检测物体表面激光图案的摄像头和一个连接 摄像头进行图像识别及三维重建的计算处理单元; 所述的至少两个激光投影器 对应至少两种不同波长, 激光投影器所投射的光幕的空间位置与摄像头的位置 关系均标定已知, 所述摄像头的输出端与所述计算处理单元连接, 所述的计算 处理单元包括 2D图像激光轮廓线提取器、 3D构造器、 用于选择标定摄像头在选 定波长的内参和畸变系数的第一波段切换判断器和用于选择其中一个激光投影 器所投影的光面与摄像头之间的空间位置的第二波段切换判断器、 所述摄像头 的输出端与所述 2D图像激光轮廓线提取器连接, 所述 2D图像激光轮廓线提取器 与所述 3D构造器, 所述第一波段切换判断器分别与所述 2D图像激光轮廓线提取 器、 3D构造器连接, 所述第二波段切换判断器分别与所述 3D构造器连接。 [0017] A three-dimensional scanner comprising a plurality of lasers of different wavelengths, the scanner comprising at least two laser projectors, at least one camera for capturing a laser pattern projected onto a surface of the object to be inspected, and a connected camera for image recognition And a three-dimensional reconstruction computing processing unit; the at least two laser projectors correspond to at least two different wavelengths, and the spatial position of the light curtain projected by the laser projector and the positional relationship of the camera are both calibrated, the output of the camera The terminal is coupled to the calculation processing unit, the calculation processing unit includes a 2D image laser contour extractor, a 3D constructor, a first band switching determiner for selecting an internal parameter and a distortion coefficient of the calibration camera at a selected wavelength, and a second band switching determiner for selecting a spatial position between a light surface projected by one of the laser projectors and the camera, the output end of the camera being connected to the 2D image laser contour extractor, the 2D image a laser contour extractor and the 3D constructor, the first band switching judgment Respectively the 2D image contour extractor laser, 3D structure is connected, said second band switching determiner connected with the 3D builder.
[0018] 进一步, 所述激光投影器和摄像头的触发端均与用于选择性触发所述相同波长 的一只或者多只激光投影器与摄像头同步工作的同步触发单元连接。 [0018] Further, the laser projector and the trigger end of the camera are both connected to a synchronous trigger unit for selectively triggering one or more laser projectors of the same wavelength to operate synchronously with the camera.
[0019] 再进一步, 所述摄像头上安装多带通滤光片, 所述的滤光片的带通波段与所述 的至少两个激光投影器的至少两种波长对应。 Further, a multi-band pass filter is mounted on the camera, and a band pass band of the filter corresponds to at least two wavelengths of the at least two laser projectors.
[0020] 更进一步, 至少两个不同波长的激光投影器包括蓝色波段的激光投影器和红色 波段的激光投影器。 [0020] Further, the laser projectors of at least two different wavelengths include a laser projector of a blue band and a laser projector of a red band.
[0021] 本发明的技术构思为: 将波段较短的激光和波段较长的激光同吋安装在一台扫 描仪中, 由于不同波段的光线通过两种介质的折射率存在差异, 固定焦距和光 圈的摄像头对不同波段光线的焦点不同, 拍摄反射较短波段光线的被摄物体的
焦点比反射波长较长光线的被摄物体的焦点更靠近摄像头。 以红色和蓝色两种 波段为例, 为得到正确的对焦, 蓝色物体要比红色物体更靠近摄像头, 而在摄 像头分辨率不变的情况下, 拍摄更近的物体意味着将更小的局部投影在相同面 积的感光元器件上, 即拍摄的蓝色物体的幅面较小, 但分辨率较高, 而拍摄的 红色物体的幅面较大, 但分辨率较低。 另外, 由于激光是单色光, 其照到物体 表面反射吋会出现干涉出现象, 摄像头捕捉到的被摄物体表面的激光轮廓线上 便会出现不均匀分布的颗粒状光点, 即为激光散斑。 波段较短的激光的散斑现 象要比波段较长的激光弱, 摄像头捕捉到的被摄物体表面的激光轮廓线也就更 为锐利, 更有利于获得表面的细节。 [0021] The technical idea of the present invention is: installing a laser with a shorter wavelength band and a laser with a longer wavelength band in a scanner, because the refractive indices of different wavelengths of the two media are different, the fixed focal length and The aperture's camera has different focus points for different wavelengths of light, and captures the subject that reflects light in the shorter band. The focus is closer to the camera than the focus of the subject that reflects longer wavelengths of light. Taking the red and blue bands as an example, in order to get the correct focus, the blue object is closer to the camera than the red object, and when the camera resolution is the same, shooting closer objects means smaller. Partial projection is on the same area of the photosensitive component, that is, the blue object is smaller in size, but the resolution is higher, and the red object is larger in size, but the resolution is lower. In addition, since the laser is a monochromatic light, it will appear as an interference image when it is reflected on the surface of the object, and a non-uniformly distributed particle spot will appear on the laser contour of the surface of the object captured by the camera, that is, the laser Speckle. The speckle phenomenon of a shorter-wavelength laser is weaker than that of a longer-band laser, and the laser contour of the surface of the object captured by the camera is sharper, which is more favorable for obtaining surface details.
发明的有益效果 Advantageous effects of the invention
有益效果 Beneficial effect
[0022] 本发明的有益效果主要表现在: 与传统只含有的单一波长激光的三维扫描仪相 比, 既能应用在高精度测量场合, 又可以在普通的三维扫描场合高效安全的使 用, 可以大大增加单台扫描仪的复用性, 提高其性价比。 [0022] The beneficial effects of the present invention are mainly manifested in: Compared with a conventional single-wavelength laser-only three-dimensional scanner, it can be applied to both high-precision measurement occasions and efficient and safe use in ordinary three-dimensional scanning occasions. Greatly increase the reusability of a single scanner and increase its cost performance.
对附图的简要说明 Brief description of the drawing
附图说明 DRAWINGS
[0023] 图 1是含有多个不同波长激光器的三维扫描仪的原理图。 1 is a schematic diagram of a three-dimensional scanner containing a plurality of lasers of different wavelengths.
[0024] 图 2是同步触发单元的内部工作原理示意图。 2 is a schematic diagram of an internal working principle of a synchronous trigger unit.
[0025] 图 3是计算处理单元的原理图。 [0025] FIG. 3 is a schematic diagram of a computational processing unit.
实施该发明的最佳实施例 BEST MODE FOR CARRYING OUT THE INVENTION
本发明的最佳实施方式 BEST MODE FOR CARRYING OUT THE INVENTION
[0026] 下面结合附图对本发明作进一步描述。 The present invention is further described below in conjunction with the accompanying drawings.
[0027] 实施例 1 Embodiment 1
[0028] 参照图 1〜图 3, 一种含有多个不同波长激光器的三维扫描方法, 实现所述三维 扫描方法的扫描仪包括位置固定的一个摄像头与至少两个激光投影器, 所述的 至少两个激光投影器对应至少两种不同波长, 激光投影器所投射的光幕的空间 位置与摄像头的位置关系均标定已知; 所述三维扫描方法如下:
[0029] 根据摄像头拍摄的投射到被扫描物体表面的激光轮廓线的 2D图案识别获取高光 中心二维线条, 再根据三角法原理计算得出空间三维点云数据。 [0028] Referring to FIG. 1 to FIG. 3, a three-dimensional scanning method including a plurality of lasers of different wavelengths, the scanner implementing the three-dimensional scanning method includes a camera fixed in position and at least two laser projectors, at least The two laser projectors correspond to at least two different wavelengths, and the spatial position of the light curtain projected by the laser projector and the positional relationship of the camera are both calibrated; the three-dimensional scanning method is as follows: [0029] The 2D line of the highlight center is acquired according to the 2D pattern of the laser contour projected by the camera to the surface of the scanned object, and the spatial 3D point cloud data is calculated according to the trigonometric principle.
[0030] 进一步, 利用一个额外的位置关系已知的摄像头与原先的摄像头组成双目立体 相机来捕捉视野中的特征点来获得相对位置的变化信息, 再利用摄像头捕捉前 后帧吋的位置变化信息将扫描仪连续帧获得三维轮廓线点云数据拼接在一个坐 标系下, 获得被扫描物体完整的表面三维轮廓点云数据, 实现连续扫描。 [0030] Further, using a camera with a known positional relationship and the original camera to form a binocular stereo camera to capture feature points in the field of view to obtain relative position change information, and then using the camera to capture position change information of the frame before and after the frame The three-dimensional contour point cloud data of the scanner is obtained in a continuous coordinate frame to obtain a complete surface three-dimensional contour point cloud data of the scanned object, thereby realizing continuous scanning.
[0031] 或者是: 利用带位置信号的流水线或直线滑台、 带角度信号的旋转平台上放置 被扫描物体而直接得到扫描仪与被扫描物体相对位置的变化信息, 再利用摄像 头捕捉前后帧吋的位置变化信息将扫描仪连续帧获得三维轮廓线点云数据拼接 在一个坐标系下, 获得被扫描物体完整的表面三维轮廓点云数据, 实现连续扫 描。 [0031] Alternatively: using a pipeline with a position signal or a linear slide, a rotating platform with an angle signal to directly display the change information of the relative position of the scanner and the scanned object, and then use the camera to capture the front and rear frames. The position change information is obtained by splicing the three-dimensional contour point cloud data in a continuous frame of the scanner in a coordinate system, and obtaining the complete surface three-dimensional contour point cloud data of the scanned object to realize continuous scanning.
[0032] 再进一步, 所述三维扫描方法包括以下步骤: [0032] Further, the three-dimensional scanning method includes the following steps:
[0033] 1) 事先标定摄像头分别在不同波长的相机内参和畸变系数; [0033] 1) calibrating the camera and the distortion coefficient of the camera at different wavelengths in advance;
[0034] 2) 事先分别标定至少两个激光投影器所投射的光面与摄像头之间的空间位置 [0034] 2) separately calibrating the spatial position between the light surface projected by the at least two laser projectors and the camera
[0035] 3) 扫描前, 根据现场的精度和扫描面幅的需求选择对应波段激光投影器进行 扫描, 根据设定选择对应波长下的摄像头标定内参及畸变系数并输出给 2D图像 激光轮廓线提取器和 3D构造器; 根据设定选择对应波长的激光器与摄像头的位 置参数并输出给 3D构造器; [0035] 3) Before scanning, select the corresponding band laser projector to scan according to the accuracy of the scene and the requirements of the scanning surface, select the internal calibration and distortion coefficient of the camera under the corresponding wavelength according to the setting and output to the 2D image laser contour extraction. And a 3D constructor; selecting a positional parameter of the laser and the camera corresponding to the wavelength according to the setting and outputting to the 3D constructor;
[0036] 4) 扫描吋, 摄像头将捕捉的物体表面激光轮廓图像输入到 2D图像激光轮廓线 提取器中, 2D图像激光轮廓线提取器根据所选择的当前波段的摄像头内参和畸 变系数对所述二维图像进行畸变矫正, 并根据像素灰度差异提取矫正图像中线 条轮廓的连通区域, 再根据所述连通区域内的灰度重心计算获得亚像素级的高 光中心二维线条集合; 得到的二维线条集合被输出到 3D构造器中, 根据所选择 的当前波段的摄像头内参、 畸变系数和选择的当前工作激光与摄像头的位置标 定参数, 通过三角法原理得到三维轮廓点云数据并输出。 [0036] 4) scanning 吋, the camera inputs the captured laser surface image of the object surface into the 2D image laser contour extractor, and the 2D image laser contour extractor according to the selected camera internal parameter and distortion coefficient of the current band The two-dimensional image is corrected for distortion, and the connected region of the line contour in the corrected image is extracted according to the difference of the pixel gray scale, and the two-dimensional line set of the sub-pixel-level highlight center is obtained according to the gray center of gravity in the connected region; The dimensional line set is output to the 3D constructor. According to the selected camera internal parameters, the distortion coefficient and the selected current working laser and the camera position calibration parameters, the three-dimensional contour point cloud data is obtained and output by the trigonometric principle.
[0037] 所述步骤 1) 中, 摄像头的标定方法采用张正友标定法获得摄像头的焦距、 中 心偏移量以及径向畸变和切向畸变系数。
[0038] 所述步骤 2) 中, 激光投影器所投射的光面与摄像头之间的空间位置的具体标 定方法利用表面具有已知特征的平板作为标定板, 摄像头拍摄投射到标定板上 的线状激光获得一幅二维的激光线图像, 再利用仿射变换原理将二维图像中的 标定板"拉伸"为三维坐标中真实的尺寸, 同吋得到摄像头坐标系下的三维激光轮 廓线; 将扫描仪相对于标定板变换多个距离便得到多条摄像头坐标系下三维激 光轮廓线, 将这些三维轮廓线的点云拟合出的摄像头坐标系下的平面方程即为 该激光器所投射的光面与摄像头之间的空间位置标定参数。 [0037] In the step 1), the calibration method of the camera uses the Zhang Zhengyou calibration method to obtain the focal length, the center offset, and the radial distortion and the tangential distortion coefficient of the camera. [0038] In the step 2), the specific calibration method of the spatial position between the light surface projected by the laser projector and the camera utilizes a flat plate having a known feature on the surface as a calibration plate, and the camera captures the line projected onto the calibration plate. The laser obtains a two-dimensional laser line image, and then uses the principle of affine transformation to "stretch" the calibration plate in the two-dimensional image into the true size in the three-dimensional coordinates, and obtain the three-dimensional laser contour in the camera coordinate system. Converting the scanner to a plurality of distances relative to the calibration plate to obtain a three-dimensional laser contour line in a plurality of camera coordinate systems, and the plane equation in the camera coordinate system fitting the point cloud of the three-dimensional contour line is projected by the laser The position of the spatial position between the glossy surface and the camera is calibrated.
[0039] 以一个摄像头与红色波段和蓝色波段两个的线状激光投影器为例来具体阐述本 方案获得物体表面三维轮廓数据的实现原理。 如图 1所示, 波段 1激光投影器为 红色线状激光器, 波段 2激光投影器为蓝色线状激光器; 同步触发单元同吋连接 一个摄像头的外触发接口以及两个激光投影器的驱动控制接口并对摄像头和当 前工作波段的激光投影器进行同步触发; 摄像头实吋捕捉的图像发送给计算处 理单元进行立体视觉三维重建计算并输出最终的三维点云。 具体实现方式如图 3 所示, 步骤如下: [0039] Taking a linear laser projector with two cameras and two red and blue bands as an example, the implementation principle of obtaining three-dimensional contour data of the surface of the object is specifically described. As shown in Fig. 1, the band 1 laser projector is a red linear laser, the band 2 laser projector is a blue linear laser; the synchronous trigger unit is connected to the external trigger interface of one camera and the driving control of two laser projectors. The interface and the laser projector of the current working band are synchronously triggered; the image captured by the camera is sent to the calculation processing unit for stereoscopic three-dimensional reconstruction calculation and the final three-dimensional point cloud is output. The specific implementation is shown in Figure 3. The steps are as follows:
[0040] 步骤 1.事先标定摄像头分别在波长 1和波长 2 (波长 1和波长 2分别为 1号激光器 和 2号激光器的波长) 的相机内参和畸变系数, 并保存在系统的计算处理单元中 。 摄像头的标定方法可以采用目前广泛采用的张正友标定法获得摄像头的焦距 、 中心偏移量以及径向畸变和切向畸变系数。 [0040] Step 1. Pre-calibrate the camera internal parameters and distortion coefficients of the camera at wavelength 1 and wavelength 2 (wavelength 1 and wavelength 2 are the wavelengths of laser No. 1 and laser No. 2, respectively), and save them in the calculation processing unit of the system. . The camera calibration method can obtain the focal length, center offset, and radial distortion and tangential distortion coefficient of the camera using the widely used Zhang Zhengyou calibration method.
[0041] 步骤 2.事先分别标定 1号激光器和 2号激光器所投射的光面与摄像头之间的空间 位置, 并将标定好的 1号及 2号激光标定参数保存在系统的计算处理单元中。 激 光投影器所投射的光面与摄像头之间的空间位置的具体标定方法可以优选利用 表面具有已知特征的平板作为标定板, 摄像头拍摄投射到标定板上的线状激光 获得一幅二维的激光线图像, 再利用仿射变换原理将二维图像中的标定板"拉伸" 为三维坐标中真实的尺寸, 同吋得到摄像头坐标系下的三维激光轮廓线。 将扫 描仪相对于标定板变换多个距离便可得到多条摄像头坐标系下三维激光轮廓线 , 将这些三维轮廓线的点云拟合出的摄像头坐标系下的平面方程即为该激光器 所投射的光面与摄像头之间的空间位置标定参数。 [0041] Step 2. Priorly separately calibrate the spatial position between the light surface projected by the No. 1 laser and the No. 2 laser and the camera, and save the calibration laser calibration parameters No. 1 and No. 2 in the calculation processing unit of the system. . The specific calibration method of the spatial position between the light surface projected by the laser projector and the camera may preferably use a flat plate having a known feature on the surface as a calibration plate, and the camera captures a linear laser projected onto the calibration plate to obtain a two-dimensional image. The laser line image is then "stretched" into the true size of the three-dimensional coordinates by using the principle of affine transformation, and the three-dimensional laser contour line in the camera coordinate system is obtained. The three-dimensional laser contour line in multiple camera coordinate systems can be obtained by transforming the scanner with a plurality of distances relative to the calibration plate, and the plane equation in the camera coordinate system fitting the point cloud of these three-dimensional contour lines is projected by the laser. The position of the spatial position between the glossy surface and the camera is calibrated.
[0042] 步骤 3.扫描前, 根据现场的精度和扫描面幅的需求选择红色波段或者蓝光波段
进行扫描, 并记录在波段切换判断器中。 第一波段切换判断器根据设定选择对 应波长下的摄像头标定内参及畸变系数并输出给 2D图像激光轮廓线提取器和 3D 构造器; 第二波段切换判断器根据设定选择对应波长的激光器与摄像头的位置 参数并输出给 3D构造器。 [0042] Step 3. Before scanning, select the red band or the blue band according to the accuracy of the scene and the demand of the scanning surface. The scan is performed and recorded in the band switching judger. The first band switching determiner selects the camera calibration internal reference and the distortion coefficient at the corresponding wavelength according to the setting and outputs the same to the 2D image laser contour extractor and the 3D constructor; the second band switching determiner selects the laser of the corresponding wavelength according to the setting. The position parameters of the camera are output to the 3D constructor.
[0043] 步骤 4. [0043] Step 4.
扫描吋, 摄像头将捕捉的物体表面激光轮廓图像输入到计算处理单元的 2D图像 激光轮廓线提取器中, 2D图像激光轮廓线提取器根据第一波段切换判断器所选 择的当前波段的摄像头内参和畸变系数对所述二维图像进行畸变矫正, 并根据 像素灰度差异提取矫正图像中线条轮廓的连通区域, 再根据所述连通区域内的 灰度重心计算获得亚像素级的高光中心二维线条集合。 得到的二维线条集合被 输出到 3D构造器中, 根据第一波段切换判断器所选择的当前波段的摄像头内参 、 畸变系数和第二波段切换判断器选择的当前工作激光与摄像头的位置标定参 数, 通过三角法原理得到三维轮廓点云数据并输出。 After scanning, the camera inputs the captured laser contour image of the object surface into the 2D image laser contour extractor of the calculation processing unit, and the 2D image laser contour extractor switches the intra-camera reference of the current band selected by the first band according to the first band. Distortion coefficient corrects the two-dimensional image, and extracts a connected region of the line contour in the corrected image according to the pixel gray difference, and then calculates a sub-pixel-level highlight center two-dimensional line according to the gray center of gravity in the connected region set. The obtained two-dimensional line set is output to the 3D constructor, according to the camera internal parameter, the distortion coefficient of the current band selected by the first band switching determiner, and the position calibration parameter of the current working laser and the camera selected by the second band switching determiner. The three-dimensional contour point cloud data is obtained by the trigonometric principle and output.
[0044] 实施例 2 Embodiment 2
[0045] 参照图 1〜图 3, 一种含有多个不同波长激光器的三维扫描仪, 所述扫描仪包括 至少两个激光投影器、 至少一个用于拍摄投射到被检测物体表面激光图案的摄 像头和一个连接摄像头进行图像识别及三维重建的计算处理单元; 所述的至少 两个激光投影器对应至少两种不同波长, 激光投影器所投射的光幕的空间位置 与摄像头的位置关系均标定已知, 所述摄像头的输出端与所述计算处理单元连 接, 所述的计算处理单元包括 2D图像激光轮廓线提取器、 3D构造器、 用于选择 标定摄像头在选定波长的内参和畸变系数的第一波段切换判断器和用于选择其 中一个激光投影器所投影的光面与摄像头之间的空间位置的第二波段切换判断 器、 所述摄像头的输出端与所述 2D图像激光轮廓线提取器连接, 所述 2D图像激 光轮廓线提取器与所述 3D构造器, 所述第一波段切换判断器分别与所述 2D图像 激光轮廓线提取器、 3D构造器连接, 所述第二波段切换判断器分别与所述 3D构 造器连接。 1 to 3, a three-dimensional scanner including a plurality of lasers of different wavelengths, the scanner comprising at least two laser projectors, at least one camera for photographing a laser pattern projected onto a surface of the object to be inspected And a computing processing unit for connecting the camera for image recognition and three-dimensional reconstruction; the at least two laser projectors correspond to at least two different wavelengths, and the spatial position of the light curtain projected by the laser projector and the positional relationship of the camera are both calibrated. The output end of the camera is connected to the calculation processing unit, and the calculation processing unit includes a 2D image laser contour extractor, a 3D constructor, and an internal parameter and a distortion coefficient for selecting a calibration camera at a selected wavelength. a first band switching determiner and a second band switching determiner for selecting a spatial position between the light surface projected by the one of the laser projectors and the camera, the output end of the camera, and the 2D image laser contour extraction Connected, the 2D image laser contour extractor and the 3D constructor, the A band switching judging device is respectively connected to the 2D image laser contour extractor and the 3D constructor, and the second band switching judging device is respectively connected to the 3D fabric.
[0046] 进一步, 所述激光投影器和摄像头的触发端均与用于选择性触发所述相同波长 的一只或者多只激光投影器与摄像头同步工作的同步触发单元连接。
[0047] 再进一步, 所述摄像头上安装多带通滤光片, 所述的滤光片的带通波段与所述 的至少两个激光投影器的至少两种波长对应。 [0046] Further, the laser projector and the trigger end of the camera are both connected to a synchronous trigger unit for selectively triggering one or more laser projectors of the same wavelength to operate synchronously with the camera. Further, a multi-band pass filter is mounted on the camera, and a band pass band of the filter corresponds to at least two wavelengths of the at least two laser projectors.
[0048] 更进一步, 至少两个不同波长的激光投影器包括蓝色波段的激光投影器和红色 波段的激光投影器。 [0048] Further, the laser projectors of at least two different wavelengths include a laser projector of a blue band and a laser projector of a red band.
[0049] 以配备红蓝两种波段线状激光投影器的三维扫描仪为例来对本发明的系统及原 理进行阐述。 本发明的工作原理如图 1所示, 波段 1激光投影器为红色线状激光 器, 波段 2激光投影器为蓝色线状激光器; 同步触发单元同吋连接一个或两个摄 像头的外触发接口以及两个激光投影器的驱动接口并对摄像头及一个当前工作 波段的激光投影器进行同步触发; 摄像头实吋捕捉的图像发送给计算处理单元 进行立体视觉三维重建计算并输出最终的三维点云。 [0049] The system and principle of the present invention will be described by taking a three-dimensional scanner equipped with a red-blue two-band linear laser projector as an example. The working principle of the present invention is shown in FIG. 1. The band 1 laser projector is a red linear laser, the band 2 laser projector is a blue linear laser, and the synchronous trigger unit is connected to an external trigger interface of one or two cameras. The driving interface of the two laser projectors is synchronously triggered by the camera and a laser projector of the current working band; the image captured by the camera is sent to the calculation processing unit for stereoscopic three-dimensional reconstruction calculation and the final three-dimensional point cloud is output.
[0050] 所述的同步触发单元内部可以由微控制单元 MCU控制工作节拍, 并将同步控 制信号通过隔离器件 OC输出到功率器件 MOS来最终控制激光投影器 LASER1/LA SER2和摄像头 CAMERA的同步工作。 MCU的固件根据用户的选择来确定在某一 吋刻是同步触发波段 1红光的 LASERl和 CAMERAl (及 CAMERA2) 同步工作还 是波段 2蓝光的 LASER2和 CAMERAl (及 CAMERA2) 同步工作。 [0050] The synchronous trigger unit may internally control the working beat by the micro control unit MCU, and output the synchronous control signal to the power device MOS through the isolation device OC to finally control the synchronous operation of the laser projector LASER1/LA SER2 and the camera CAMERA. . The firmware of the MCU is determined according to the user's choice to synchronize the trigger band at a certain moment. LASER1 and CAMERAl (and CAMERA2) of the red light are synchronized or LASER2 and CAMERAl (and CAMERA2) of the band 2 are synchronized.
[0051] 当然, 如果进行连续扫描, 则 MCU根据设定的帧率来循环同步触发激光和摄 像头, 摄像头连续将捕捉的图片输入计算处理单元进行三维立体视觉三维重建 计算, 最后持续输出三维点云数据。
[0051] Of course, if continuous scanning is performed, the MCU cyclically triggers the laser and the camera according to the set frame rate, and the camera continuously inputs the captured image into the calculation processing unit for three-dimensional stereoscopic three-dimensional reconstruction calculation, and finally continuously outputs the three-dimensional point cloud. data.