CN117876502A - Depth calibration method, depth calibration equipment and depth calibration system - Google Patents

Depth calibration method, depth calibration equipment and depth calibration system Download PDF

Info

Publication number
CN117876502A
CN117876502A CN202410267894.4A CN202410267894A CN117876502A CN 117876502 A CN117876502 A CN 117876502A CN 202410267894 A CN202410267894 A CN 202410267894A CN 117876502 A CN117876502 A CN 117876502A
Authority
CN
China
Prior art keywords
calibration
depth
tof module
point
depth map
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
Application number
CN202410267894.4A
Other languages
Chinese (zh)
Other versions
CN117876502B (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.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
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 Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202410267894.4A priority Critical patent/CN117876502B/en
Publication of CN117876502A publication Critical patent/CN117876502A/en
Application granted granted Critical
Publication of CN117876502B publication Critical patent/CN117876502B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/80Analysis of captured images to determine intrinsic or extrinsic camera parameters, i.e. camera calibration
    • G06T7/85Stereo camera calibration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10028Range image; Depth image; 3D point clouds

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Length Measuring Devices By Optical Means (AREA)
  • Optical Radar Systems And Details Thereof (AREA)

Abstract

本申请提供一种深度标定方法、深度标定设备及深度标定系统,涉及终端技术领域。深度标定系统的移动组件用于带动ToF模组移动和旋转。ToF模组与标定板第一距离时分别以第一空间位姿和第二空间位姿采集第一深度图和第二深度图,再移动至第二距离分别以第三空间位姿和第四空间位姿采集第三深度图和第四深度图。控制器根据四张深度图及第一距离和第二距离,对ToF模组进行深度标定,完成ToF模组的内参标定。深度标定还可以再采集2张深度图计算激光偏移距离,在内参标定之前先进行激光偏移矫正。这样,在不需要单独先后执行三次标定操作的情况下,通过采集六张深度图即可完成激光偏移矫正、内参矩阵标定和偏移标定,极大地提升了标定产能和人力成本。

The present application provides a depth calibration method, a depth calibration device and a depth calibration system, which relate to the field of terminal technology. The mobile component of the depth calibration system is used to drive the ToF module to move and rotate. When the ToF module is at a first distance from the calibration plate, the first depth map and the second depth map are collected in the first spatial posture and the second spatial posture respectively, and then the third depth map and the fourth depth map are collected in the third spatial posture and the fourth spatial posture respectively when the ToF module is moved to the second distance. The controller performs depth calibration on the ToF module according to the four depth maps and the first distance and the second distance, and completes the internal parameter calibration of the ToF module. The depth calibration can also collect 2 more depth maps to calculate the laser offset distance, and perform laser offset correction before the internal parameter calibration. In this way, without the need to perform three calibration operations separately, laser offset correction, internal parameter matrix calibration and offset calibration can be completed by collecting six depth maps, which greatly improves the calibration capacity and labor costs.

Description

深度标定方法、深度标定设备及深度标定系统Depth calibration method, depth calibration equipment and depth calibration system

技术领域Technical Field

本申请实施例涉及终端技术领域,尤其涉及一种深度标定方法、深度标定设备及深度标定系统。The embodiments of the present application relate to the field of terminal technology, and in particular to a depth calibration method, a depth calibration device, and a depth calibration system.

背景技术Background technique

激光飞行时间(Time-of-Flight,ToF),是一种利用激光飞行时间来测量距离的技术。ToF可以应用于测距设备,测距设备例如深度相机。ToF模组由于镜头组装、边缘畸变等原因,可能会导致激光偏移、镜头偏移等问题,进而导致所获取的景深距离与实际距离存在误差。ToF模组需要进行标定校正,以尽量减小测量误差。Time-of-Flight (ToF) is a technology that uses the laser flight time to measure distance. ToF can be applied to distance measurement equipment, such as depth cameras. Due to lens assembly, edge distortion and other reasons, the ToF module may cause laser offset, lens offset and other problems, which may lead to errors between the acquired depth of field distance and the actual distance. The ToF module needs to be calibrated to minimize the measurement error.

现有的标定方案为:依次进行激光偏移矫正(Laser Offset)、相机校正(CameraCalibration)和偏移校正(Offset Calibration)。这三次标定操作增加设备成本、人力成本,且会限制整体生产产能(Units Per Hour,UPH)。现有标定方案包括三个顺次执行的标定步骤,耗时较大且对标定步骤之间的准确率相互影响,导致深度标定准确性较低。三个标定步骤需要准备不同的标定板,标定耗材较多且标定步骤较为繁琐。The existing calibration scheme is: laser offset correction (Laser Offset), camera calibration (CameraCalibration) and offset calibration (Offset Calibration) in sequence. These three calibration operations increase equipment costs and labor costs, and will limit the overall production capacity (Units Per Hour, UPH). The existing calibration scheme includes three calibration steps that are performed sequentially, which is time-consuming and affects the accuracy between the calibration steps, resulting in low depth calibration accuracy. Different calibration plates need to be prepared for the three calibration steps, and the calibration consumables are more and the calibration steps are more cumbersome.

发明内容Summary of the invention

本申请实施例提供一种深度标定方法、深度标定设备及深度标定系统,用于解决现有的深度相机标定方案准确性较低、步骤较为繁琐的技术问题。The embodiments of the present application provide a depth calibration method, a depth calibration device and a depth calibration system, which are used to solve the technical problems of low accuracy and complicated steps in existing depth camera calibration solutions.

为达到上述目的,本申请的实施例采用如下技术方案:To achieve the above objectives, the embodiments of the present application adopt the following technical solutions:

第一方面,提供了一种深度标定方法,用于深度标定系统标定ToF模组,ToF模组可以为电子设备的深度相机内的深度采集模组。深度标定系统包括移动组件、标定板和控制器,移动组件用于固定ToF模组,并带动ToF模组移动。ToF模组固定在移动组件后,ToF模组的激光发射面与标定板平行,这里的平行可以为绝对平行或者近似平行。在实际装配时,ToF模组的激光发射面与标定板的激光反射面处于近似平行,可以解释为这两个平面之间有较小的夹角,本申请提供的深度标定方法并不要求ToF模组的激光发射面与标定板的激光反射面处于绝对平行。In the first aspect, a depth calibration method is provided, which is used for calibrating a ToF module in a depth calibration system. The ToF module can be a depth acquisition module in a depth camera of an electronic device. The depth calibration system includes a mobile component, a calibration plate and a controller, and the mobile component is used to fix the ToF module and drive the ToF module to move. After the ToF module is fixed to the mobile component, the laser emitting surface of the ToF module is parallel to the calibration plate, and the parallelism here can be absolutely parallel or approximately parallel. During actual assembly, the laser emitting surface of the ToF module is approximately parallel to the laser reflecting surface of the calibration plate, which can be interpreted as a small angle between the two planes. The depth calibration method provided in this application does not require that the laser emitting surface of the ToF module is absolutely parallel to the laser reflecting surface of the calibration plate.

本申请提供的深度标定方法,可以主要由控制器来控制,控制移动组件带动ToF模组移动,获取ToF模组采集的深度图和相关测量数据进行计算,实现对ToF模组进行深度标定。The depth calibration method provided in the present application can be mainly controlled by a controller to control the mobile component to drive the ToF module to move, obtain the depth map and related measurement data collected by the ToF module for calculation, and realize depth calibration of the ToF module.

控制器可以控制移动组件带动ToF模组沿第一方向移动,使ToF模组的激光发射面与标定板的激光反射面之间间隔第一距离。ToF模组的激光发射面与标定板平行,第一方向垂直于标定板的激光反射面和ToF模组的激光发射面。例如在三维参考坐标系中,ToF模组的激光发射面和标定板可以平行于XY面,第一方向垂直于ToF模组的激光发射面,则可以解释为第一方向平行于Z轴。The controller can control the moving component to drive the ToF module to move along the first direction, so that the laser emitting surface of the ToF module is spaced a first distance from the laser reflecting surface of the calibration plate. The laser emitting surface of the ToF module is parallel to the calibration plate, and the first direction is perpendicular to the laser reflecting surface of the calibration plate and the laser emitting surface of the ToF module. For example, in a three-dimensional reference coordinate system, the laser emitting surface of the ToF module and the calibration plate can be parallel to the XY plane, and the first direction is perpendicular to the laser emitting surface of the ToF module, which can be interpreted as the first direction being parallel to the Z axis.

控制器控制移动组件带动ToF模组,围绕ToF模组的激光发射面的中心点平行于标定板旋转,也就是说移动组件带动ToF模组在XY平面内旋转,且旋转的过程中保持ToF模组的激光发射面的中心点的Y轴坐标保持不变。控制器控制移动组件带动ToF模组在XY平面围绕中心点旋转,使ToF模组分别处于第一空间位姿和第二空间位姿,第一空间位姿与第二空间位姿不同。例如,控制器控制移动组件带动ToF模组旋转以处于第一空间位姿时,移动组件可以再带动ToF模组在XY平面内旋转180°,这样,ToF模组所处的空间位姿由第一空间位姿变为第二空间位姿。The controller controls the moving component to drive the ToF module to rotate around the center point of the laser emission surface of the ToF module parallel to the calibration plate, that is, the moving component drives the ToF module to rotate in the XY plane, and the Y-axis coordinate of the center point of the laser emission surface of the ToF module is kept unchanged during the rotation. The controller controls the moving component to drive the ToF module to rotate around the center point in the XY plane, so that the ToF module is in a first spatial posture and a second spatial posture respectively, and the first spatial posture is different from the second spatial posture. For example, when the controller controls the moving component to drive the ToF module to rotate to be in the first spatial posture, the moving component can drive the ToF module to rotate 180° in the XY plane, so that the spatial posture of the ToF module changes from the first spatial posture to the second spatial posture.

在ToF模组的激光发射面与标定板间隔第一距离的情况下,控制器控制ToF模组处于第一空间位姿,向标定板发射激光,拍摄标定板得到第一深度图;控制器控制ToF模组处于第二空间位姿时,向标定板发射激光,拍摄标定板得到第二深度图。这样,ToF模组在距离标定板第一距离的测量点,分别以两个不同空间位姿采集得到第一深度图和第二深度图。When the laser emission surface of the ToF module is separated from the calibration plate by a first distance, the controller controls the ToF module to be in a first spatial posture, emits laser light to the calibration plate, and photographs the calibration plate to obtain a first depth map; when the controller controls the ToF module to be in a second spatial posture, it emits laser light to the calibration plate, and photographs the calibration plate to obtain a second depth map. In this way, the ToF module acquires the first depth map and the second depth map at the measurement point at the first distance from the calibration plate in two different spatial postures.

控制器控制移动组件带动ToF模组沿第一方向移动,使ToF模组的激光发射面与标定板间隔第二距离,第一距离与第二距离不同。控制器再控制移动组件带动ToF模组围绕ToF模组的激光发射面的中心点平行于标定板旋转,使ToF模组分别处于第三空间位姿和第四空间位姿,第三空间位姿和第四空间位姿不同。The controller controls the moving component to drive the ToF module to move along the first direction, so that the laser emitting surface of the ToF module is separated from the calibration plate by a second distance, and the first distance is different from the second distance. The controller then controls the moving component to drive the ToF module to rotate around the center point of the laser emitting surface of the ToF module parallel to the calibration plate, so that the ToF module is in a third spatial posture and a fourth spatial posture, respectively, and the third spatial posture and the fourth spatial posture are different.

在ToF模组的激光发射面与标定板间隔第二距离的情况下,控制器控制ToF模组在第三空间位姿拍摄标定板得到第三深度图,在第四空间位姿拍摄标定板得到第四深度图。When the laser emitting surface of the ToF module is spaced a second distance from the calibration plate, the controller controls the ToF module to photograph the calibration plate in a third spatial position to obtain a third depth map, and to photograph the calibration plate in a fourth spatial position to obtain a fourth depth map.

最后,控制器根据第一深度图、第二深度图、第三深度图和第四深度图,以及第一距离和第二距离,对ToF模组进行深度标定。例如,控制器可以根据多张深度图、第一距离和第二距离,获取各像素点对应的标定点光路距离表达公式和角度表达公式,再根据不同深度图之间由于距离相等或者空间位姿所存在的角度对应关系或者光路距离对应关系,将光路距离表达公式和角度表达公式进行换算,以计算ToF模组的各像素点相对于中心像素点的相对位移量,进而得到ToF模组的内参矩阵,再利用内参矩阵对ToF模组进行深度标定,尤其是内参标定和偏移标定。Finally, the controller performs depth calibration on the ToF module according to the first depth map, the second depth map, the third depth map, and the fourth depth map, as well as the first distance and the second distance. For example, the controller can obtain the optical path distance expression formula and the angle expression formula of the calibration point corresponding to each pixel point according to multiple depth maps, the first distance and the second distance, and then convert the optical path distance expression formula and the angle expression formula according to the angle correspondence relationship or optical path distance correspondence relationship between different depth maps due to equal distance or spatial posture, so as to calculate the relative displacement of each pixel point of the ToF module relative to the central pixel point, and then obtain the intrinsic parameter matrix of the ToF module, and then use the intrinsic parameter matrix to perform depth calibration on the ToF module, especially intrinsic parameter calibration and offset calibration.

上述深度标定方案,不需要单独布局三套标定系统并先后执行三次标定操作,极大地降低了标定成本、场地空间需求度和标定操作的繁琐程度。通过采集四张深度图即可完成深度标定任务中的内参矩阵标定和偏移标定,极大地提升了标定产能和人力成本。本申请提供的深度标定方法,要求待标定的ToF模组与标定板保持基本平行即可,通过激光实现角度测算,降低了环境构建难度和点检难度。有效避免了张正友标定法中需要采集网格标定板的精确距离参数对ToF模组分辨率的限制,在保证精度的同时可以使用更快的方式完成标定。The above-mentioned depth calibration scheme does not require the separate layout of three calibration systems and the execution of three calibration operations in succession, which greatly reduces the calibration cost, site space requirements and the complexity of calibration operations. By collecting four depth maps, the intrinsic parameter matrix calibration and offset calibration in the depth calibration task can be completed, which greatly improves the calibration capacity and labor costs. The depth calibration method provided in this application requires that the ToF module to be calibrated is basically parallel to the calibration plate, and angle measurement is achieved by laser, which reduces the difficulty of environment construction and inspection. It effectively avoids the limitation of the resolution of the ToF module by the precise distance parameters of the grid calibration plate required to be collected in Zhang Zhengyou's calibration method, and can use a faster method to complete the calibration while ensuring accuracy.

在第一方面的一种可能的实现方式中,上述第一空间位姿和第三空间位姿相同,第二空间位姿和第四空间位姿相同。其中,第一空间位姿和第二空间位姿是在ToF模组的激光发射面与标定板间隔第一距离的情况采集深度图时的不同空间位姿,第三空间位姿和第四空间位姿是在ToF模组的激光发射面与标定板间隔第二距离的情况采集深度图时的不同空间位姿。在两次采集操作时,ToF模组与标定板之间第一距离和第二距离不同。In a possible implementation of the first aspect, the first spatial pose and the third spatial pose are the same, and the second spatial pose and the fourth spatial pose are the same. The first spatial pose and the second spatial pose are different spatial poses when the depth map is collected when the laser emission surface of the ToF module is separated from the calibration plate by a first distance, and the third spatial pose and the fourth spatial pose are different spatial poses when the depth map is collected when the laser emission surface of the ToF module is separated from the calibration plate by a second distance. During the two acquisition operations, the first distance and the second distance between the ToF module and the calibration plate are different.

也就是说,第一空间位姿和第三空间位姿是ToF模组的激光发射面与标定板间隔不同距离的情况下采集的相同的空间位姿;第二空间位姿和第四空间位姿是ToF模组的激光发射面与标定板间隔不同距离的情况下采集的相同的空间位姿。这样,可以有效减少不同空间位姿导致的误差,进一步提高ToF模组进行深度标定的精确度。That is to say, the first spatial pose and the third spatial pose are the same spatial poses collected when the laser emission surface of the ToF module is at different distances from the calibration plate; the second spatial pose and the fourth spatial pose are the same spatial poses collected when the laser emission surface of the ToF module is at different distances from the calibration plate. In this way, the errors caused by different spatial poses can be effectively reduced, and the accuracy of depth calibration of the ToF module can be further improved.

在第一方面的一种可能的实现方式中,对ToF模组旋转切换空间位姿的方案作了进一步限定。具体的,ToF模组的激光发射面存在一中心点,ToF模组在旋转时,围绕该中心点并平行于标定板旋转。换句话说,将标定板的激光发射面上的中心点与ToF模组的激光发射面的中心点至于同一高度,将这两个中心点之间的连线作为中心轴,控制ToF模组绕中心轴旋转。ToF模组在旋转的过程中,ToF模组的激光发射面始终平行于标定板的激光发射面。In a possible implementation of the first aspect, the scheme for rotating and switching the spatial posture of the ToF module is further limited. Specifically, there is a center point on the laser emission surface of the ToF module, and when the ToF module rotates, it rotates around the center point and parallel to the calibration plate. In other words, the center point on the laser emission surface of the calibration plate and the center point of the laser emission surface of the ToF module are placed at the same height, and the line between the two center points is used as the center axis to control the ToF module to rotate around the center axis. During the rotation of the ToF module, the laser emission surface of the ToF module is always parallel to the laser emission surface of the calibration plate.

在ToF模组的激光发射面与标定板间隔第一距离的情况下,ToF模组处于第一空间位姿时,移动组件带动ToF模组在平行于标定板的激光发射面的前提下,旋转180°,ToF模组处于第二空间位姿。ToF模组在旋转180°的情况下,其像素点也随之旋转180°,ToF模组的全部像素点处于轴对称状态,可以根据轴对称状态下部分像素点之间的对应关系,获取角度对应关系和光路对应关系。When the laser emission surface of the ToF module is at a first distance from the calibration plate, the ToF module is in a first spatial position, and the mobile component drives the ToF module to rotate 180° on the premise of being parallel to the laser emission surface of the calibration plate, and the ToF module is in a second spatial position. When the ToF module rotates 180°, its pixels also rotate 180°, and all the pixels of the ToF module are in an axisymmetric state. According to the correspondence between some pixels in the axisymmetric state, the angle correspondence and the optical path correspondence can be obtained.

基于相同原理,在ToF模组的激光发射面与标定板间隔第二距离的情况下,ToF模组处于第三空间位姿时,移动组件带动ToF模组在平行于标定板的激光发射面的前提下,旋转180°,ToF模组处于第四空间位姿。ToF模组在旋转180°的情况下,其像素点也随之旋转180°,ToF模组的全部像素点处于轴对称状态,可以根据轴对称状态下部分像素点之间的对应关系,获取角度对应关系和光路对应关系。Based on the same principle, when the laser emission surface of the ToF module is separated from the calibration plate by the second distance, and the ToF module is in the third spatial posture, the mobile component drives the ToF module to rotate 180° on the premise of being parallel to the laser emission surface of the calibration plate, and the ToF module is in the fourth spatial posture. When the ToF module rotates 180°, its pixels also rotate 180°. All the pixels of the ToF module are in an axisymmetric state. According to the correspondence between some pixels in the axisymmetric state, the angle correspondence and the optical path correspondence can be obtained.

在第一方面的一种可能的实现方式中,对深度标定过程中ToF模组的激光发射面与标定板之间的平行条件做了进一步限定。具体的,ToF模组的激光发射面与标定板的激光反射面之间可以处于近似平行的状态。In a possible implementation of the first aspect, the parallel condition between the laser emitting surface of the ToF module and the calibration plate during the depth calibration process is further limited. Specifically, the laser emitting surface of the ToF module and the laser reflecting surface of the calibration plate can be approximately parallel.

这里所说的,ToF模组的激光发射面与标定板近似平行,具体实现方案可以为:ToF模组的激光发射面与标定板的夹角小于预设角度阈值。预设角度阈值可以设为1°-5°的角度范围,例如预设角度阈值可以为5°。这样可以降低深度标定系统搭建过程中对于标定板与ToF模组相对平行的准确度要求,简化深度标定操作。Here, the laser emitting surface of the ToF module is approximately parallel to the calibration plate. The specific implementation scheme can be: the angle between the laser emitting surface of the ToF module and the calibration plate is less than the preset angle threshold. The preset angle threshold can be set to an angle range of 1°-5°, for example, the preset angle threshold can be 5°. This can reduce the accuracy requirements for the relative parallelism of the calibration plate and the ToF module during the construction of the depth calibration system and simplify the depth calibration operation.

在第一方面的一种可能的实现方式中,新增了在对ToF模组进行内参标定之前,先进行激光偏移矫正的方案。In a possible implementation manner of the first aspect, a solution of performing laser offset correction before performing internal parameter calibration on the ToF module is newly added.

深度标定系统进行激光偏移矫正的过程可以具体包括:控制器控制移动组件带动ToF模组沿第一方向移动,使ToF模组的激光发射面与标定板间隔第三距离。这里的第三距离可以与内参标定过程中所涉及的第一距离或者第二距离相同,也可以不同。The process of laser offset correction by the depth calibration system may specifically include: the controller controls the moving component to drive the ToF module to move along the first direction, so that the laser emitting surface of the ToF module is separated from the calibration plate by a third distance. The third distance here may be the same as the first distance or the second distance involved in the internal reference calibration process, or it may be different.

控制器控制移动组件带动ToF模组平行于标定板旋转,使得ToF模组分别处于第五空间位姿和第六空间位姿,第五空间位姿和第六空间位姿为不同空间位姿。例如,ToF模组在第五空间位姿旋转180°,切换为第六空间位姿。移动组件带动ToF模组旋转的过程中,还需要围绕ToF模组的激光发射面的中心点,并且始终平行于标定板旋转。ToF模组在进行激光偏移矫正阶段时所处的第五空间位姿,可以与内参标定阶段时所处的第一空间位姿相同,以及,在进行激光偏移矫正阶段时所处的第六空间位姿,可以与内参标定阶段时所处的第二空间位姿相同。这样可以尽可能地减少深度标定过程中因为空间位姿不同所导致的误差,提高ToF模组的深度标定的精确度。The controller controls the mobile component to drive the ToF module to rotate parallel to the calibration plate, so that the ToF module is in the fifth spatial posture and the sixth spatial posture respectively, and the fifth spatial posture and the sixth spatial posture are different spatial postures. For example, the ToF module rotates 180° in the fifth spatial posture and switches to the sixth spatial posture. In the process of the mobile component driving the ToF module to rotate, it is also necessary to rotate around the center point of the laser emitting surface of the ToF module and always parallel to the calibration plate. The fifth spatial posture of the ToF module during the laser offset correction stage can be the same as the first spatial posture during the internal reference calibration stage, and the sixth spatial posture during the laser offset correction stage can be the same as the second spatial posture during the internal reference calibration stage. In this way, the error caused by different spatial postures during the depth calibration process can be minimized, and the accuracy of the depth calibration of the ToF module can be improved.

控制器控制ToF模组处于第五空间位姿时,拍摄标定板得到第五深度图,以及,ToF模组处于第六空间位姿时,拍摄标定板得到第六深度图。The controller controls the ToF module to be in a fifth spatial posture and to photograph the calibration plate to obtain a fifth depth map; and controls the ToF module to be in a sixth spatial posture and to photograph the calibration plate to obtain a sixth depth map.

之后,控制器根据第五深度图和第六深度图,对ToF模组进行激光偏移矫正。具体实现方案可以有多种,例如,控制器可以通过ToF模组处于不同空间位姿时采集的同一个标定板的两张深度图的全部像素点的深度值,对比查找出中心像素点。由于ToF模组的中心像素点与标定板的中心标定点处于同一高度,中心像素点采集的深度值相对来说误差较小。控制器可以根据中心像素点的相关数据,来对ToF模组进行激光偏移矫正。Afterwards, the controller performs laser offset correction on the ToF module based on the fifth depth map and the sixth depth map. There can be many specific implementation schemes. For example, the controller can compare the depth values of all pixels of the two depth maps of the same calibration plate collected when the ToF module is in different spatial postures to find the center pixel. Since the center pixel of the ToF module is at the same height as the center calibration point of the calibration plate, the depth value collected by the center pixel has a relatively small error. The controller can perform laser offset correction on the ToF module based on the relevant data of the center pixel.

本申请所提供的深度标定方法,通过在一个测量点采集ToF模组处于不同空间位姿的两张深度图,对ToF模组进行激光偏移矫正。操作简单且可以提高激光偏移矫正的精确度,同时也能减少激光偏移对后续内参标定的影响,提高ToF模组深度标定的整体精确度。The depth calibration method provided in this application performs laser offset correction on the ToF module by collecting two depth maps of the ToF module in different spatial positions at one measurement point. The operation is simple and can improve the accuracy of laser offset correction. At the same time, it can also reduce the impact of laser offset on subsequent internal reference calibration and improve the overall accuracy of ToF module depth calibration.

在第一方面的一种可能的实现方式中,对控制器根据第五深度图和第六深度图,对ToF模组进行激光偏移矫正的方案做了具体限定。ToF模组采集第五深度图所处的第五空间位姿,经过旋转180°切换为第六空间位姿,即ToF模组采集第六深度图所处的空间位姿。那么在旋转180°前后,ToF模组的中心像素点采集的均是标定板的中心标定点的深度值。在标定板未发生变化的前提下,ToF模组的中心像素点所采集的深度值不发生变化。In a possible implementation of the first aspect, a specific limitation is made on the scheme for the controller to perform laser offset correction on the ToF module according to the fifth depth map and the sixth depth map. The fifth spatial posture at which the ToF module collects the fifth depth map is switched to the sixth spatial posture after rotating 180°, that is, the spatial posture at which the ToF module collects the sixth depth map. Then, before and after rotating 180°, the center pixel point of the ToF module collects the depth value of the center calibration point of the calibration plate. Under the premise that the calibration plate does not change, the depth value collected by the center pixel point of the ToF module does not change.

控制器根据第五深度图和第六深度图中全部像素点的深度值,查找第五深度图相对于第六深度图,深度值未发生变化的像素点,即为中心像素点。控制器获取中心像素点的激光记录直方图,该激光记录直方图记录中心像素点对应的激光发生器发射的多组激光信号的波形图。控制器根据激光记录直方图中记录的第一个激光信号的波形图的目标时刻与激光记录直方图的统计0点时刻的差值,计算激光偏移距离。为提高矫正精确度,可以选择第一个激光信号的波形图的波峰时刻来统计与激光记录直方图的统计0点的差值。控制器根据激光偏移距离,对ToF模组进行激光偏移矫正。The controller searches for the pixel whose depth value has not changed in the fifth depth map relative to the sixth depth map based on the depth values of all the pixels in the fifth depth map and the sixth depth map, which is the center pixel. The controller obtains the laser recording histogram of the center pixel, which records the waveforms of multiple groups of laser signals emitted by the laser generator corresponding to the center pixel. The controller calculates the laser offset distance based on the difference between the target moment of the waveform of the first laser signal recorded in the laser recording histogram and the statistical 0 point moment of the laser recording histogram. To improve the correction accuracy, the peak moment of the waveform of the first laser signal can be selected to count the difference with the statistical 0 point of the laser recording histogram. The controller performs laser offset correction on the ToF module based on the laser offset distance.

深度标定系统先对ToF模组进行激光偏移矫正,再利用激光偏移矫正之后的ToF模组采集第一深度图至第四深度图,以实现内参标定,同时提高内参标定阶段的精确度。The depth calibration system first performs laser offset correction on the ToF module, and then uses the ToF module after laser offset correction to collect the first depth map to the fourth depth map to achieve internal parameter calibration, while improving the accuracy of the internal parameter calibration stage.

在第一方面的一种可能的实现方式中,进一步限定了控制器对ToF模组进行深度标定的方案。具体的,控制器根据第一深度图和第二深度图、第三深度图和第四深度图,获取ToF模组的各像素点对应的标定点光路距离表达公式和角度表达公式,再根据不同深度图之间由于距离相等或者空间位姿所存在的角度对应关系或者光路距离对应关系,将光路距离表达公式和角度表达公式进行换算,以计算ToF模组的各像素点相对于中心像素点的相对位移量,进而得到ToF模组的内参矩阵,再利用内参矩阵对ToF模组进行深度标定,尤其是内参标定和偏移标定。In a possible implementation of the first aspect, a scheme for the controller to perform depth calibration on the ToF module is further defined. Specifically, the controller obtains the optical path distance expression formula and the angle expression formula of the calibration point corresponding to each pixel of the ToF module according to the first depth map, the second depth map, the third depth map, and the fourth depth map, and then converts the optical path distance expression formula and the angle expression formula according to the angle correspondence relationship or optical path distance correspondence relationship between different depth maps due to equal distance or spatial posture, so as to calculate the relative displacement of each pixel of the ToF module relative to the center pixel, and then obtain the intrinsic parameter matrix of the ToF module, and then use the intrinsic parameter matrix to perform depth calibration on the ToF module, especially intrinsic parameter calibration and offset calibration.

在第一方面的一种可能的实现方式中,对控制器获得ToF模组的各像素点与中心像素点的相对位移量,以及各像素点对应光路与第一方向的夹角的方案作了进一步限定。In a possible implementation of the first aspect, a scheme for the controller to obtain the relative displacement of each pixel point and the central pixel point of the ToF module, and the angle between the optical path corresponding to each pixel point and the first direction is further limited.

在ToF模组的激光发射面与标定板间隔第一距离的情况下,标定板上包括第一标定点、第二标定点和第三标定点,第一标定点对应第一深度图和第二深度图的中心像素点,第二标定点和第三标定点为轴对称的两个标定点。第一标定点到第一测量点之间的第一光路与第二标定点到第一测量点之间的第二光路形成第一夹角,第一标定点到第一测量点之间的第一光路与第三标定点到第一测量点之间的第三光路形成第二夹角。控制器根据旋转前采集的第一深度图和旋转180°后采集的第二深度图,确定第一夹角等于第二夹角。根据第一夹角和第二夹角的关系表达式,计算第一夹角等于第二夹角时的多个角度换算公式,记为第一角度换算公式。When the laser emission surface of the ToF module is spaced a first distance from the calibration plate, the calibration plate includes a first calibration point, a second calibration point, and a third calibration point. The first calibration point corresponds to the central pixel point of the first depth map and the second depth map, and the second calibration point and the third calibration point are two axisymmetric calibration points. The first optical path between the first calibration point and the first measurement point forms a first angle with the second optical path between the second calibration point and the first measurement point, and the first optical path between the first calibration point and the first measurement point forms a second angle with the third optical path between the third calibration point and the first measurement point. The controller determines that the first angle is equal to the second angle based on the first depth map collected before the rotation and the second depth map collected after the rotation of 180°. According to the relationship expression between the first angle and the second angle, multiple angle conversion formulas are calculated when the first angle is equal to the second angle, which are recorded as the first angle conversion formula.

同理,在ToF模组的激光发射面与标定板间隔第二距离的情况下,标定板上包括第四标定点、第五标定点和第六标定点,第四标定点对应第三深度图和第四深度图的中心像素点,第五标定点和第六标定点为轴对称的两个标定点。第四标定点到第二测量点之间的第四光路与第五标定点到第二测量点之间的第五光路形成第三夹角,第四标定点到第二测量点之间的第四光路与第六标定点到第二测量点之间的第六光路形成第四夹角。Similarly, when the laser emission surface of the ToF module is spaced from the calibration plate by the second distance, the calibration plate includes the fourth calibration point, the fifth calibration point and the sixth calibration point, the fourth calibration point corresponds to the central pixel point of the third depth map and the fourth depth map, and the fifth calibration point and the sixth calibration point are two axisymmetric calibration points. The fourth optical path from the fourth calibration point to the second measurement point and the fifth optical path from the fifth calibration point to the second measurement point form a third angle, and the fourth optical path from the fourth calibration point to the second measurement point and the sixth optical path from the sixth calibration point to the second measurement point form a fourth angle.

控制器根据第一光路、第二光路、第三光路、第四光路、第五光路和第六光路对应的深度值,以及第一角度换算公式和第二角度换算公式,计算ToF模组的各像素点与中心像素点的相对位移量,以及各像素点对应光路与第一方向的夹角。控制器根据第三深度图和第四深度图,计算第三夹角等于第四夹角时的第二角度换算公式;其中,由于ToF模组采集第三深度图的空间位姿和采集第四深度图的空间位姿差180°,第三夹角等于第四夹角。根据第三夹角和第四夹角的关系表达式,计算第三夹角等于第四夹角时的多个角度换算公式,记为第二角度换算公式。将第一角度换算公式和第二角度换算公式带入计算内参矩阵,完成深度标定。The controller calculates the relative displacement of each pixel of the ToF module and the central pixel, as well as the angle between the optical path corresponding to each pixel and the first direction, based on the depth values corresponding to the first optical path, the second optical path, the third optical path, the fourth optical path, the fifth optical path and the sixth optical path, as well as the first angle conversion formula and the second angle conversion formula. The controller calculates the second angle conversion formula when the third angle is equal to the fourth angle based on the third depth map and the fourth depth map; wherein, since the spatial posture of the ToF module collecting the third depth map and the spatial posture of the fourth depth map are 180° different, the third angle is equal to the fourth angle. According to the relationship expression between the third angle and the fourth angle, multiple angle conversion formulas are calculated when the third angle is equal to the fourth angle, which are recorded as the second angle conversion formula. The first angle conversion formula and the second angle conversion formula are brought into the calculation of the internal parameter matrix to complete the depth calibration.

上述本申请提供的深度标定方法,通过采集六张深度图即可完成深度标定的三个标定阶段,简化了场地和整体流程,提高了深度标定的准确度。The depth calibration method provided in the present application can complete the three calibration stages of depth calibration by collecting six depth maps, thereby simplifying the site and the overall process and improving the accuracy of depth calibration.

第二方面,本申请提供一种深度标定系统,用于标定ToF模组。深度标定系统包括移动组件、标定板和控制器。In a second aspect, the present application provides a depth calibration system for calibrating a ToF module. The depth calibration system includes a moving component, a calibration board, and a controller.

控制器用于执行第一方面中任一项的深度标定方法。The controller is used to execute any depth calibration method in the first aspect.

第三方面,本申请提供一种深度标定设备,用于标定ToF模组。深度标定设备连接有移动组件,ToF模组固定在移动组件后,ToF模组的激光发射面与标定板平行。In a third aspect, the present application provides a depth calibration device for calibrating a ToF module. The depth calibration device is connected to a moving component, the ToF module is fixed to the moving component, and the laser emitting surface of the ToF module is parallel to the calibration plate.

深度标定设备包括存储器和处理器,存储器与处理器耦合;存储器存储计算机执行指令;处理器执行存储器存储的计算机执行指令,使得深度标定设备执行第一方面中任一项中控制器执行的深度标定方法。The depth calibration device includes a memory and a processor, the memory is coupled to the processor; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory, so that the depth calibration device executes the depth calibration method executed by the controller in any one of the first aspects.

第四方面,本申请提供一种计算机可读存储介质,计算机可读存储介质中存储有计算机程序,当其在计算机上运行时,使得计算机执行如第一方面中任一项的深度标定方法。In a fourth aspect, the present application provides a computer-readable storage medium, in which a computer program is stored. When the computer-readable storage medium is run on a computer, the computer executes the depth calibration method as described in any one of the first aspects.

第五方面,本申请提供一种计算机程序产品,包括计算机程序,计算机程序被处理器执行时,实现如第一方面任一项的深度标定方法。In a fifth aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the depth calibration method as described in any one of the first aspects.

其中,第二方面至第五方面中任一种设计方式所带来的技术效果可参见第一方面中不同设计方式所带来的技术效果,此处不再赘述。Among them, the technical effects brought about by any design method in the second to fifth aspects can refer to the technical effects brought about by different design methods in the first aspect, and will not be repeated here.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

图1为ToF模组进行深度数据采集的示意图;FIG1 is a schematic diagram of a ToF module performing depth data acquisition;

图2为对ToF模组进行深度标定所涉及的偏移激光矫正的示意图;FIG2 is a schematic diagram of the offset laser correction involved in depth calibration of the ToF module;

图3为对ToF模组进行深度标定所涉及的网格标定板的示意图;FIG3 is a schematic diagram of a grid calibration plate involved in depth calibration of a ToF module;

图4为对ToF模组进行深度标定所涉及的向网格标定板发射激光的示意图;FIG4 is a schematic diagram of emitting laser light to a grid calibration plate involved in depth calibration of a ToF module;

图5为对ToF模组进行深度标定所涉及的激光偏移示意图;FIG5 is a schematic diagram of laser offset involved in depth calibration of a ToF module;

图6为本申请实施例提供的深度标定方法的流程示意图;FIG6 is a schematic diagram of a flow chart of a depth calibration method provided in an embodiment of the present application;

图7为本申请实施例提供的深度标定系统的标定原理示意图;FIG7 is a schematic diagram of the calibration principle of the depth calibration system provided in an embodiment of the present application;

图8为本申请实施例提供的深度标定方法所涉及的深度图示意图;FIG8 is a schematic diagram of a depth map involved in the depth calibration method provided in an embodiment of the present application;

图9为本申请实施例提供的深度标定方法所涉及的激光记录直方图示意图;FIG9 is a schematic diagram of a laser recording histogram involved in the depth calibration method provided in an embodiment of the present application;

图10为本申请实施例提供的深度标定方法所涉及的内参标定的流程示意图;FIG10 is a schematic diagram of a flow chart of an internal parameter calibration involved in a depth calibration method provided in an embodiment of the present application;

图11为本申请实施例提供的深度标定方法所涉及的内参标定过程中拟合新平面的示意图;FIG11 is a schematic diagram of fitting a new plane in the intrinsic parameter calibration process involved in the depth calibration method provided in an embodiment of the present application;

图12为本申请实施例提供的深度标定方法所涉及的坐标变换示意图。FIG. 12 is a schematic diagram of coordinate transformation involved in the depth calibration method provided in an embodiment of the present application.

具体实施方式Detailed ways

以下结合附图对本申请的示范性实施例做出说明,其中包括本申请实施例的各种细节以助于理解,应当将它们认为仅仅是示范性的。因此,本领域普通技术人员应当认识到,可以对这里描述的实施例做出各种改变和修改,而不会背离本申请的范围和精神。同样,为了清楚和简明,以下的描述中省略了对公知功能和结构的描述。The following is a description of exemplary embodiments of the present application in conjunction with the accompanying drawings, including various details of the embodiments of the present application to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present application. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

为便于理解,先介绍本申请实施例涉及的部分技术常识。To facilitate understanding, some technical common sense involved in the embodiments of the present application is first introduced.

激光飞行时间(Time-of-Flight,ToF),是一种利用激光飞行时间来测量距离的技术。其中,dToF,即direct Time-of-Flight,是通过直接测量飞行时间来测量距离的技术。Laser Time-of-Flight (ToF) is a technology that uses the laser flight time to measure distance. Among them, dToF, or direct Time-of-Flight, is a technology that measures distance by directly measuring the flight time.

ToF的测距原理为,ToF模组在检测点向目标物发射激光,并接收从目标物表面反射回来的激光,通过探测激光的往返飞行时间,结合激光飞行速度来计算检测点与目标物表面之间的距离。The ToF ranging principle is that the ToF module emits laser to the target at the detection point and receives the laser reflected from the surface of the target. It calculates the distance between the detection point and the surface of the target by detecting the round-trip flight time of the laser and combining the laser flight speed.

ToF可以应用于测距设备(例如深度相机)。深度相机利用ToF技术,采集深度相机与取景范围内各位点的景深距离。深度相机可以利用取景范围内各位点的景深距离,以及各位点在二维图像中的二维坐标,即可得到各位点在世界坐标系中的三维空间坐标。ToF can be applied to distance measurement devices (such as depth cameras). Depth cameras use ToF technology to collect the depth distance between the depth camera and each point in the viewing range. The depth camera can use the depth distance of each point in the viewing range and the two-dimensional coordinates of each point in the two-dimensional image to obtain the three-dimensional spatial coordinates of each point in the world coordinate system.

深度相机内装配有ToF模组,如图1所示,ToF模组可以对视野范围内的目标物进行激光测距。ToF模组主要包括激光发射器、激光接收器、镜头组件和处理器。其中,激光发射器用于发射激光,激光接收器用于接收激光,镜头组件用于采集取景范围内的图像。处理器与激光发射器、激光接收器和镜头组件均耦合。The depth camera is equipped with a ToF module, as shown in Figure 1. The ToF module can perform laser ranging on targets within the field of view. The ToF module mainly includes a laser transmitter, a laser receiver, a lens assembly, and a processor. Among them, the laser transmitter is used to transmit lasers, the laser receiver is used to receive lasers, and the lens assembly is used to capture images within the field of view. The processor is coupled with the laser transmitter, laser receiver, and lens assembly.

处理器可以获取激光发射器发射激光的第一时刻,以及激光接收器接收对应激光的第二时刻,计算激光飞行时间,进而计算对应的景深距离。处理器根据镜头组件采集的图像中各像素点的景深距离,计算图像上全部像素点的深度信息。需要说明的是,ToF模组所发射和接收的激光,可以是激光脉冲。The processor can obtain the first moment when the laser transmitter emits the laser and the second moment when the laser receiver receives the corresponding laser, calculate the laser flight time, and then calculate the corresponding depth of field distance. The processor calculates the depth information of all pixels on the image based on the depth of field distance of each pixel in the image captured by the lens assembly. It should be noted that the laser emitted and received by the ToF module can be a laser pulse.

如图1所示,目标物可以为三维物体。目标物表面存在两个点D1和D2,D1和D2与ToF模组的距离不同。激光发射器向D1发射激光S1,接收激光S1’,D1与ToF模组成像平面的景深距离为d1。激光发射器向D2发射激光S2,接收激光S2’,D2与ToF模组成像平面的景深距离为d2。As shown in Figure 1, the target object can be a three-dimensional object. There are two points D1 and D2 on the surface of the target object, and the distances between D1 and D2 and the ToF module are different. The laser transmitter emits laser S1 to D1 and receives laser S1'. The depth of field distance between D1 and the imaging plane of the ToF module is d1. The laser transmitter emits laser S2 to D2 and receives laser S2'. The depth of field distance between D2 and the imaging plane of the ToF module is d2.

深度相机可以应用于图像虚化处理、虚拟现实(Virtual Reality,VR)、增强现实(Augmented Reality,AR)等图像处理或者显示场景。Depth cameras can be applied to image processing or display scenarios such as image blur processing, virtual reality (VR), and augmented reality (AR).

ToF模组由于镜头组装、边缘畸变等原因,可能会导致激光偏移、镜头偏移等问题,进而导致所获取的景深距离与实际距离存在误差。ToF模组需要进行标定校正,以尽量减小测量误差。Due to lens assembly, edge distortion and other reasons, the ToF module may cause laser offset, lens offset and other problems, which may lead to errors between the depth of field distance obtained and the actual distance. The ToF module needs to be calibrated to minimize the measurement error.

现有的标定方案为:依次进行激光偏移矫正(Laser Offset)、相机校正(CameraCalibration)和偏移校正(Offset Calibration)。这三次标定操作增加设备成本、人力成本,且会限制整体生产产能(Units Per Hour,UPH)。The existing calibration scheme is: laser offset correction (Laser Offset), camera calibration (Camera Calibration) and offset calibration (Offset Calibration) in sequence. These three calibration operations increase equipment costs, labor costs, and will limit the overall production capacity (Units Per Hour, UPH).

第一次标定操作为激光偏移矫正。The first calibration operation is laser offset correction.

在进行ToF标定时,ToF模组向标定板发射激光。在激光偏移矫正阶段,需要的标定板是反射率较高的白板。ToF模组记录激光从发射,发射到标定板后反射回到ToF模组的时间,即激光飞行时间。During ToF calibration, the ToF module emits laser light to the calibration plate. During the laser offset correction phase, the required calibration plate is a white plate with high reflectivity. The ToF module records the time it takes for the laser to be emitted, reflected from the calibration plate, and then returned to the ToF module, which is the laser flight time.

ToF模组通常会采用直方图记录激光的发射时间和接收时间,直方图能够记录的量程会覆盖少量的激光飞行时间。如图2所示,为直方图记录的激光飞行时间示意图。激光首次点亮,直方图记录首次点亮的激光的飞行时间,首次点亮的激光的飞行时间的起始时刻对应在直方图上的实际位置应为0点位置;但是,因为存在激光偏移,统计到激光首次点亮坐落在直方图上的位置为图2所示的位置a,其与实际0点(如图2所示的位置b所示)之间存在一段距离。从实际0点到直方图结束点(如图2中的c所示)之间的时段缩短,导致直方图上这一缩短后的时段实际能够覆盖的完整激光的数量减少。ToF modules usually use histograms to record the emission and reception time of the laser. The range that the histogram can record covers a small amount of laser flight time. As shown in Figure 2, this is a schematic diagram of the laser flight time recorded by the histogram. When the laser is first lit, the histogram records the flight time of the laser that is first lit. The starting moment of the flight time of the laser that is first lit corresponds to the actual position on the histogram at point 0; however, due to the laser offset, the position where the laser is first lit on the histogram is calculated to be position a as shown in Figure 2, which is a distance away from the actual point 0 (as shown in position b as shown in Figure 2). The time period from the actual point 0 to the end point of the histogram (as shown in c in Figure 2) is shortened, resulting in a reduction in the number of complete lasers that can actually be covered by this shortened time period on the histogram.

激光偏移矫正的目的是,测量实际0点位置与统计0点位置之间的偏移距离(如图2中的L所示),用偏移距离来对激光偏移进行补偿标定。这样,激光偏移矫正之后,激光首次点亮的实际0点位置(如图2中的d所示)会比较靠近直方图的0点位置,使得直方图能够尽量覆盖较多的完整激光的飞行时段。The purpose of laser offset correction is to measure the offset distance between the actual 0-point position and the statistical 0-point position (as shown in L in Figure 2), and use the offset distance to compensate and calibrate the laser offset. In this way, after laser offset correction, the actual 0-point position when the laser is first lit (as shown in d in Figure 2) will be closer to the 0-point position of the histogram, so that the histogram can cover as many complete laser flight periods as possible.

第二次标定操作为相机校正标定,第三次标定操作为偏移矫正标定。The second calibration operation is the camera correction calibration, and the third calibration operation is the offset correction calibration.

相机校正标定又叫相机内参标定,通常的相机内参标定采用的是张正友标定法及其衍生的相关通过图像信息识别空间信息的标定方法。以张正友标定法为例,采用的标定板为如图3所示的棋盘格标定板,标定板上绘制有棋盘格图像。棋盘格标定板上的网格点可以为圆点也可以为方点,不作限定。如图4所示,ToF模组从多个角度拍摄棋盘格标定板,算法识别棋盘格图像的角点中心,用于计算空间信息。再根据棋盘格标定板上所有点景深一致的原则,通过最小二乘法对相机边缘畸变进行拟合矫正,以得到与ToF模组的全部像素区域均匹配的内参矩阵。Camera correction calibration is also called camera intrinsic calibration. The usual camera intrinsic calibration uses the Zhang Zhengyou calibration method and its derived related calibration methods that identify spatial information through image information. Taking the Zhang Zhengyou calibration method as an example, the calibration board used is the checkerboard calibration board shown in Figure 3, on which a checkerboard image is drawn. The grid points on the checkerboard calibration board can be round or square, without limitation. As shown in Figure 4, the ToF module shoots the checkerboard calibration board from multiple angles, and the algorithm identifies the center of the corners of the checkerboard image for calculating spatial information. Then, based on the principle that the depth of field of all points on the checkerboard calibration board is consistent, the camera edge distortion is fitted and corrected by the least squares method to obtain an intrinsic parameter matrix that matches all pixel areas of the ToF module.

dToF是通过直接测量飞行时间换算为距离的测距方法。对于多点激光,由于视场角较大,光路比z向距离要明显更长,换算成z向距离时需要计算光路的夹角。dToF is a distance measurement method that directly measures the flight time and converts it into distance. For multi-point lasers, due to the large field of view, the optical path is significantly longer than the z-direction distance. When converting to the z-direction distance, the angle of the optical path needs to be calculated.

具体如图5所示,ToF模组对面设置一棋盘格标定板。棋盘格标定板上存在目标点A1和目标点A2,目标点A1与ToF模组所在平面之间的实际景深距离d1,与目标点A2与ToF模组所在平面之间的实际景深距离d2应该相等。而在实际测量时,ToF模组向目标点A1实际发射激光的光路为OA1,对应光路距离等于实际景深距离d1。由于边缘畸变、激光斜向发射等因素,ToF模组向目标点A2实际发射激光的光路为OA2,对应光路距离d2’,光路距离d2’并不等于实际的景深距离d2。As shown in Figure 5, a checkerboard calibration board is set opposite the ToF module. There are target points A1 and A2 on the checkerboard calibration board. The actual depth of field distance d1 between target point A1 and the plane where the ToF module is located should be equal to the actual depth of field distance d2 between target point A2 and the plane where the ToF module is located. In actual measurement, the optical path of the ToF module to emit laser to target point A1 is OA1, and the corresponding optical path distance is equal to the actual depth of field distance d1. Due to factors such as edge distortion and oblique laser emission, the optical path of the ToF module to emit laser to target point A2 is OA2, corresponding to the optical path distance d2', which is not equal to the actual depth of field distance d2.

为了进行相机校正标定,需要计算出光路OA2与光路OA1之间的夹角θ,通过实际的光路距离d2’和夹角θ,就可以计算出实际景深距离d1。In order to perform camera calibration, it is necessary to calculate the angle θ between the optical path OA2 and the optical path OA1. The actual depth of field distance d1 can be calculated through the actual optical path distance d2’ and the angle θ.

夹角θ存在的几何关系为:cosθ=d1/d2,sinθ=d3/d2。已知d1、d2和d3,就可以计算出夹角θ。在实际测量时,相机视野范围内任一目标点Ai,相机向目标点Ai发射的光路OAi的距离di’可以通过激光飞行时间和光速计算,再根据光路OAi与z向的夹角θi,即可计算实际景深距离di,作为相机测得的目标点Ai的实际景深距离。The geometric relationship of the angle θ is: cosθ=d1/d2, sinθ=d3/d2. If d1, d2 and d3 are known, the angle θ can be calculated. In actual measurement, for any target point Ai within the camera's field of view, the distance di' of the optical path OAi emitted by the camera to the target point Ai can be calculated by the laser flight time and the speed of light, and then the actual depth of field distance di can be calculated based on the angle θi between the optical path OAi and the z direction, as the actual depth of field distance of the target point Ai measured by the camera.

受限于ToF模组的分辨率,无法准确测量网格平面上的目标点之间的准确距离(如图5中所示的d3),导致计算的夹角准确度较低,也就是标定深度相机内参的准确性降低,进而导致实际测量时计算的各目标点的实际景深距离的准确性较低。另外,现有的相机标定方案为三个顺次执行的标定步骤,耗时较大且对标定步骤之间的准确率相互影响。三个标定步骤需要准备不同的标定板,标定耗材较多且标定步骤较为繁琐。Limited by the resolution of the ToF module, the exact distance between the target points on the grid plane cannot be accurately measured (such as d3 shown in Figure 5), resulting in low accuracy of the calculated angle, that is, the accuracy of the calibrated depth camera internal parameters is reduced, which in turn leads to low accuracy of the actual depth of field distance calculated for each target point during actual measurement. In addition, the existing camera calibration scheme consists of three calibration steps performed sequentially, which is time-consuming and affects the accuracy of the calibration steps. Different calibration plates need to be prepared for the three calibration steps, which requires more calibration consumables and the calibration steps are more complicated.

基于此,本申请提供一种深度标定方法,用于对ToF模组进行深度标定,待标定的ToF模组可以为深度相机内的ToF模组。也就是说,本申请实施例提供的深度标定方法可以为电子设备的深度相机进行深度标定,电子设备可以为个人计算机(Personal Computer,PC)、平板电脑、笔记本电脑、便携式计算机(如手机)、可穿戴电子设备(如智能手表)、增强现实(Augmented Reality,AR)\虚拟现实(Virtual Reality,VR)设备、车载电脑等具备深度相机的电子设备,以下实施例对该电子设备的具体形式不做特殊限制。ToF模组可以主要包括激光发射器和激光接收器。Based on this, the present application provides a depth calibration method for calibrating the depth of a ToF module, and the ToF module to be calibrated can be a ToF module in a depth camera. That is to say, the depth calibration method provided in the embodiment of the present application can be used to calibrate the depth of a depth camera of an electronic device, and the electronic device can be a personal computer (PC), a tablet computer, a laptop computer, a portable computer (such as a mobile phone), a wearable electronic device (such as a smart watch), an augmented reality (AR) device, a virtual reality (VR) device, a car computer, and other electronic devices with a depth camera. The following embodiments do not impose any special restrictions on the specific form of the electronic device. The ToF module can mainly include a laser transmitter and a laser receiver.

如图6所示,为本实施例提供的深度标定方法的流程示意图。本申请提供的深度标定方法应用于深度标定系统,如图7所示,为深度标定系统的装配示意图,图7中还示出了深度标定系统用于标定的ToF模组。深度标定系统包括:移动组件、标定板、测距组件(图7中未示出)和控制器(图7中未示出)。As shown in Figure 6, it is a schematic diagram of the process flow of the depth calibration method provided in this embodiment. The depth calibration method provided in this application is applied to the depth calibration system, as shown in Figure 7, which is an assembly schematic diagram of the depth calibration system, and Figure 7 also shows the ToF module used for calibration by the depth calibration system. The depth calibration system includes: a mobile component, a calibration plate, a ranging component (not shown in Figure 7) and a controller (not shown in Figure 7).

深度标定系统的移动组件用于移动ToF模组。在深度标定过程中,ToF模组可能存在旋转和平移两种移动模式。为实现ToF模组的旋转和平移,移动组件可以包括电机和夹紧件,夹紧件用于夹紧ToF模组,电机用于驱动夹紧件带动ToF模组进行旋转和平移。其中,ToF模组模组平移可以指沿第一方向ToF模组向标定板移动,ToF模组旋转可以是指ToF模组在垂直于第一方向的平面内旋转,或者说ToF模组在平行于标定板的平面内旋转。The moving component of the depth calibration system is used to move the ToF module. During the depth calibration process, the ToF module may have two movement modes: rotation and translation. To achieve the rotation and translation of the ToF module, the moving component may include a motor and a clamping member, the clamping member is used to clamp the ToF module, and the motor is used to drive the clamping member to drive the ToF module to rotate and translate. Among them, the translation of the ToF module can refer to the movement of the ToF module toward the calibration plate along the first direction, and the rotation of the ToF module can refer to the rotation of the ToF module in a plane perpendicular to the first direction, or the rotation of the ToF module in a plane parallel to the calibration plate.

具体的,电机可以包括驱动马达和转轴,驱动马达用于驱动转轴旋转和平移。夹紧件可以包括固定部和夹爪,固定部用于将夹爪固定到电机的转轴上,夹爪夹持ToF模组,电机的转轴通过固定部和夹爪,带动ToF模组。Specifically, the motor may include a driving motor and a rotating shaft, wherein the driving motor is used to drive the rotating shaft to rotate and translate. The clamping member may include a fixing portion and a clamping claw, wherein the fixing portion is used to fix the clamping claw to the rotating shaft of the motor, the clamping claw clamps the ToF module, and the rotating shaft of the motor drives the ToF module through the fixing portion and the clamping claw.

为便于描述深度标定系统在装配时各器件的相对位置关系,先定义一个三维参考坐标系。如图7所示,三维参考坐标系包括X轴、Y轴和Z轴,三个坐标轴相互垂直。其中,XZ平面基本平行于深度标定系统所在的标定环境的地面或者操作台平面,移动组件可以带动ToF模组在XY平面内旋转,或者带动ToF模组沿Z轴平移。其中,本申请实施例中,移动组件带动ToF模组在XY平面内旋转的过程中,ToF模组的激光发射面上各点在三维参考坐标系的X轴和Y轴的坐标变化,而各点在Z轴的坐标均保持不变。移动组件带动ToF模组沿Z轴平移的过程中,ToF模组的激光发射面上各点在三维参考坐标系的Z轴的坐标变化,而各点在X轴和Y轴的坐标均保持不变。In order to facilitate the description of the relative position relationship of each component of the depth calibration system during assembly, a three-dimensional reference coordinate system is first defined. As shown in Figure 7, the three-dimensional reference coordinate system includes an X-axis, a Y-axis, and a Z-axis, and the three coordinate axes are perpendicular to each other. Among them, the XZ plane is basically parallel to the ground or operating table plane of the calibration environment where the depth calibration system is located, and the mobile component can drive the ToF module to rotate in the XY plane, or drive the ToF module to translate along the Z axis. Among them, in an embodiment of the present application, in the process of the mobile component driving the ToF module to rotate in the XY plane, the coordinates of each point on the laser emission surface of the ToF module in the X-axis and Y-axis of the three-dimensional reference coordinate system change, while the coordinates of each point in the Z axis remain unchanged. In the process of the mobile component driving the ToF module to translate along the Z axis, the coordinates of each point on the laser emission surface of the ToF module in the Z axis of the three-dimensional reference coordinate system change, while the coordinates of each point in the X-axis and Y-axis remain unchanged.

深度标定系统的标定板用于接收和反射ToF模组发射的激光。ToF模组包括一激光发射面,ToF模组的激光发射器和激光接收器均设置于激光发射面上,将ToF模组的激光发射面所在的平面记为第一平面(如图7中所示的P1)。标定板可以为表面反射率较高的平板,标定板上不需要设置棋盘格。The calibration plate of the depth calibration system is used to receive and reflect the laser emitted by the ToF module. The ToF module includes a laser emitting surface, and the laser emitter and laser receiver of the ToF module are both arranged on the laser emitting surface. The plane where the laser emitting surface of the ToF module is located is recorded as the first plane (as shown in P1 in Figure 7). The calibration plate can be a flat plate with a high surface reflectivity, and there is no need to set a checkerboard on the calibration plate.

标定板设有一反射面,标定板的反射面用于接收ToF模组的激光发射器发射的激光,并将发光反射到ToF模组的激光接收器。将标定板的反射面所在的平面记为第二平面(如图7中所示的P2)。The calibration plate is provided with a reflective surface, and the reflective surface of the calibration plate is used to receive the laser emitted by the laser transmitter of the ToF module and reflect the light to the laser receiver of the ToF module. The plane where the reflective surface of the calibration plate is located is recorded as the second plane (P2 as shown in FIG. 7 ).

在进行标定时,可以使得ToF模组的激光发射面所在的第一平面与标定板的激光反射面所在的第二平面基本平行,且第一平面与第二平面之间存在一定距离。以及,为便于描述,还可以使得第一平面和第二平面基本平行于XY平面。需要说明的是,这里所说的两个平面之间基本平行或者近似平行,可以理解为,两个平面的夹角小于或者等于预设夹角阈值,夹角阈值可以为0°-5°,不作限定。在具体实施时,受限于测量、ToF模组的厚度等因素,平面之间可能不容易实现绝对平行,可以用倾斜度相对较小的基本平行进行后续的标定操作。后续关于平行的解释均可以参考此处关于基本平行的解释,不再赘述。When calibrating, the first plane where the laser emitting surface of the ToF module is located can be made substantially parallel to the second plane where the laser reflecting surface of the calibration plate is located, and there is a certain distance between the first plane and the second plane. And, for ease of description, the first plane and the second plane can also be made substantially parallel to the XY plane. It should be noted that the two planes mentioned here are substantially parallel or approximately parallel, which can be understood as the angle between the two planes being less than or equal to the preset angle threshold, and the angle threshold can be 0°-5°, without limitation. In the specific implementation, due to factors such as measurement and thickness of the ToF module, it may not be easy to achieve absolute parallelism between the planes, and subsequent calibration operations can be performed with relatively small inclination. Subsequent explanations about parallelism can refer to the explanation about basic parallelism here, and no further explanation is given.

深度标定系统的测距组件用于测量深度标定过程中的相关距离数据,例如,标定板的激光反射面上两点之间的距离数据等。测距组件可以包括激光测距雷达、测量尺等器件。The distance measuring component of the depth calibration system is used to measure the relevant distance data in the depth calibration process, for example, the distance data between two points on the laser reflection surface of the calibration plate, etc. The distance measuring component may include devices such as laser ranging radar and measuring ruler.

深度标定系统的控制器用于执行深度标定方法,例如控制移动组件带动ToF模组移动,根据相关数据进行相关计算,以实现对ToF模组的深度标定。控制器可以与ToF模组的激光发射器、激光接收器、移动组件、测距组件等的控制端和数据传输端连接,以实现指令交互和数据传输。The controller of the depth calibration system is used to execute the depth calibration method, such as controlling the mobile component to drive the ToF module to move, and performing relevant calculations based on relevant data to achieve depth calibration of the ToF module. The controller can be connected to the control end and data transmission end of the ToF module's laser transmitter, laser receiver, mobile component, ranging component, etc. to achieve command interaction and data transmission.

深度标定系统在进行深度标定之前,可以先将移动组件放置到操作平台上,操作平台所在平面平行于三维参考坐标系的XZ平面。移动组件的夹爪夹持ToF模组,以使得ToF模组基本平行于XY平面,移动组件的电机转轴可以通过夹爪带动ToF模组在XY平面内旋转,或者沿Z轴平移。ToF模组在旋转或者平移的过程中,ToF模组的激光发射面都保持与XY平面平行的状态。Before the depth calibration system performs depth calibration, the mobile component can be placed on the operating platform, and the plane of the operating platform is parallel to the XZ plane of the three-dimensional reference coordinate system. The clamp of the mobile component clamps the ToF module so that the ToF module is basically parallel to the XY plane. The motor shaft of the mobile component can drive the ToF module to rotate in the XY plane or translate along the Z axis through the clamp. During the rotation or translation of the ToF module, the laser emitting surface of the ToF module remains parallel to the XY plane.

标定板固定在操作平台上,标定板的激光反射面与ToF模组的激光发射面之间存在一定Z向距离,标定板的激光反射面所在的第二平面与ToF模组的激光发射板所在的第一平面基本平行。电机的转轴可以通过夹爪带动ToF模组沿Z轴平移,靠近或者远离标定板,以调整ToF模组的激光发射面与标定板的激光反射面之间的Z向距离。The calibration plate is fixed on the operating platform, and there is a certain Z-direction distance between the laser reflection surface of the calibration plate and the laser emission surface of the ToF module, and the second plane where the laser reflection surface of the calibration plate is located is substantially parallel to the first plane where the laser emission plate of the ToF module is located. The rotating shaft of the motor can drive the ToF module to translate along the Z axis through the clamping claw, approaching or moving away from the calibration plate, so as to adjust the Z-direction distance between the laser emission surface of the ToF module and the laser reflection surface of the calibration plate.

另外,在装配时,还可以控制ToF模组的中心高度与标定板的中心高度尽量保持一致,以减少中心高度不一致造成的误差,尽可能提高深度标定精度。这里所说的ToF模组的中心高度可以指ToF模组的激光发射面的中心点在XYZ坐标系内的Y轴坐标,标定板的中心高度可以指标定板的激光反射面的中心点在XYZ坐标系内的Y轴坐标。In addition, during assembly, the center height of the ToF module can be controlled to be consistent with the center height of the calibration plate as much as possible to reduce the error caused by inconsistent center heights and maximize the depth calibration accuracy. The center height of the ToF module mentioned here can refer to the Y-axis coordinate of the center point of the laser emitting surface of the ToF module in the XYZ coordinate system, and the center height of the calibration plate can refer to the Y-axis coordinate of the center point of the laser reflecting surface of the calibration plate in the XYZ coordinate system.

具体的,如图6所示,从深度标定系统中控制器的角度描述,所提供的深度标定方法主要包括以下步骤:Specifically, as shown in FIG6 , from the perspective of a controller in a depth calibration system, the provided depth calibration method mainly includes the following steps:

S601:控制器控制移动组件带动ToF模组沿第一方向移动,使ToF模组的激光发射面与标定板间隔第一距离;控制移动组件带动ToF模组围绕ToF模组的激光发射面的中心点平行于标定板旋转,使ToF模组分别处于第一空间位姿和第二空间位姿,并控制ToF模组在第一空间位姿拍摄标定板得到第一深度图,在第二空间位姿拍摄标定板得到第二深度图。S601: The controller controls the moving component to drive the ToF module to move along the first direction, so that the laser emitting surface of the ToF module is separated from the calibration plate by a first distance; controls the moving component to drive the ToF module to rotate around the center point of the laser emitting surface of the ToF module parallel to the calibration plate, so that the ToF module is in the first spatial posture and the second spatial posture respectively, and controls the ToF module to shoot the calibration plate in the first spatial posture to obtain a first depth map, and to shoot the calibration plate in the second spatial posture to obtain a second depth map.

如图7所示,移动组件带动ToF模组移动至第一测量点T1处,ToF模组的激光发射面即第一平面P1,平行于标定板的激光反射面即第二平面P2,ToF模组的激光发射面即第一平面P1与标定板的激光反射面即第二平面P2之间的Z向距离为第一距离d1。As shown in Figure 7, the moving component drives the ToF module to move to the first measuring point T1. The laser emitting surface of the ToF module, namely the first plane P1, is parallel to the laser reflecting surface of the calibration plate, namely the second plane P2. The Z-direction distance between the laser emitting surface of the ToF module, namely the first plane P1, and the laser reflecting surface of the calibration plate, namely the second plane P2, is the first distance d1.

ToF模组在第一测量点T1处,在XY平面内当前的位姿可以记为第一空间位姿。将ToF模组在XY平面内旋转一定角度,将旋转后的位姿记为第二空间位姿。第一空间位姿不同于第二空间位姿。The current position of the ToF module at the first measurement point T1 in the XY plane can be recorded as the first spatial position. The ToF module is rotated by a certain angle in the XY plane, and the rotated position is recorded as the second spatial position. The first spatial position is different from the second spatial position.

或者,控制器也可以控制移动组件带动ToF模组旋转,先将ToF模组旋转以使ToF模组处于第一空间位姿,采集第一深度图。之后再将ToF模组旋转,以使ToF模组处于第二空间位姿,采集第二深度图。Alternatively, the controller may also control the mobile component to drive the ToF module to rotate, first rotating the ToF module so that the ToF module is in a first spatial position and collecting a first depth map, and then rotating the ToF module so that the ToF module is in a second spatial position and collecting a second depth map.

移动组件在带动ToF模组在XY平面内旋转的过程中,可以控制ToF模组围绕ToF模组的激光发射面的中心点旋转。这样,ToF模组的激光发射面的中心点的Y轴高度始终与标定板的激光反射面的中心点的Y轴高度保持一致。ToF模组的激光发射面的中心点与标定板的激光反射面的中心点的Z向距离也始终保持一致,对应的,ToF模组的中心像素点采集到的标定板的中心标定点的景深距离也始终保持一致。反向推导,ToF模组在平行于标定板旋转的过程中,ToF模组的全部像素区域中,若某一像素点采集的深度值始终保持不变,则这一像素点为中心像素点,中心像素点采集的景深距离为标定板的中心标定板的景深距离。When the mobile component drives the ToF module to rotate in the XY plane, the ToF module can be controlled to rotate around the center point of the laser emitting surface of the ToF module. In this way, the Y-axis height of the center point of the laser emitting surface of the ToF module is always consistent with the Y-axis height of the center point of the laser reflecting surface of the calibration plate. The Z-direction distance between the center point of the laser emitting surface of the ToF module and the center point of the laser reflecting surface of the calibration plate is also always consistent. Correspondingly, the depth of field distance of the center calibration point of the calibration plate collected by the center pixel point of the ToF module is also always consistent. Reversely, when the ToF module rotates parallel to the calibration plate, in all pixel areas of the ToF module, if the depth value collected by a certain pixel point remains unchanged, then this pixel point is the center pixel point, and the depth of field distance collected by the center pixel point is the depth of field distance of the center calibration plate of the calibration plate.

基于此,ToF模组在第一测量点T1处,先以第一空间位姿向标定板发射激光,采集标定板对应的第一深度图。ToF模组旋转至第二空间位姿,再次向标定板发射激光,采集标定板对应的第二深度图。Based on this, the ToF module first emits laser to the calibration plate in the first spatial posture at the first measurement point T1 to collect the first depth map corresponding to the calibration plate. The ToF module rotates to the second spatial posture, emits laser to the calibration plate again, and collects the second depth map corresponding to the calibration plate.

ToF模组通常存在标准摆放姿势,ToF模组处于标准摆放姿势时,ToF模组的下表面平行于XZ平面,且ToF模组的激光发射面平行于XY平面,激光发射面的激光发射方向平行于Z轴。这里所说的平行,也可以理解为基本平行或者近似平行。The ToF module usually has a standard placement posture. When the ToF module is in the standard placement posture, the lower surface of the ToF module is parallel to the XZ plane, and the laser emitting surface of the ToF module is parallel to the XY plane, and the laser emitting direction of the laser emitting surface is parallel to the Z axis. The parallel mentioned here can also be understood as substantially parallel or approximately parallel.

在一种示例中,如图7所示,第一空间位姿可以为ToF模组处于标准摆放姿势时的第一空间位姿,第二空间位姿可以为ToF模组处于第一空间位姿时,在XY平面内旋转180°之后的位姿。ToF模组处于标准摆放姿势对应的第一空间位姿和旋转180°之后的第二空间位姿,ToF模组与标定板的相对平行状态更标准,因相对倾斜导致的测量误差就更小,ToF模组采集的标定板的景深距离更接近标定板与ToF模组的真实距离。通过尽可能减少相对位置导致的误差的方式,可以有效提高深度标定的精度。In one example, as shown in FIG. 7 , the first spatial posture may be the first spatial posture when the ToF module is in a standard placement posture, and the second spatial posture may be the posture after the ToF module is rotated 180° in the XY plane when the ToF module is in the first spatial posture corresponding to the standard placement posture and the second spatial posture after being rotated 180°. The relative parallel state between the ToF module and the calibration plate is more standard, and the measurement error caused by relative tilt is smaller. The depth of field distance of the calibration plate collected by the ToF module is closer to the actual distance between the calibration plate and the ToF module. By minimizing the error caused by relative position as much as possible, the accuracy of depth calibration can be effectively improved.

在其他示例中,在保证第一空间位姿和第二空间位姿不相同的前提下,移动模组带动ToF模组旋转所处的第一空间位姿和第二空间位姿也可以有其他实现方案,不作限定。In other examples, under the premise of ensuring that the first spatial posture and the second spatial posture are different, the first spatial posture and the second spatial posture in which the mobile module drives the ToF module to rotate may also have other implementation schemes, which are not limited.

如图8所示,为ToF模组在第一测量点T1处采集的第一深度图(如图8中的(a)所示)和第二深度图(如图8中的(b)所示)。为便于描述,图8以11*9的像素为例,且图8中仅示出了少量像素点的深度值示意,并不限定深度图的具体尺寸和深度值。As shown in Figure 8, the first depth map (as shown in (a) in Figure 8) and the second depth map (as shown in (b) in Figure 8) collected by the ToF module at the first measurement point T1. For ease of description, Figure 8 takes 11*9 pixels as an example, and Figure 8 only shows the depth values of a small number of pixels, and does not limit the specific size and depth value of the depth map.

图8中,第一深度图中存在第一像素点X1和第二像素点X2,第二深度图中存在第三像素点X3和第四像素点X4。通过对比第一深度图和第二深度图中全部像素点的深度值,若确定第一像素点X1的深度值和第三像素点X3的深度值相同,则第一像素点X1为和第三像素点X3为中心像素点。具体理由可以参见前述关于ToF模组旋转过程中仅中心像素点的深度值不变的相关解释。图8中以不同深度的颜色块指代各像素点采集的不同深度值。In Figure 8, there are a first pixel X1 and a second pixel X2 in the first depth map, and there are a third pixel X3 and a fourth pixel X4 in the second depth map. By comparing the depth values of all pixels in the first depth map and the second depth map, if it is determined that the depth value of the first pixel X1 is the same as the depth value of the third pixel X3, then the first pixel X1 and the third pixel X3 are the center pixels. For specific reasons, please refer to the aforementioned explanation about the fact that only the depth value of the center pixel remains unchanged during the rotation of the ToF module. In Figure 8, color blocks of different depths represent different depth values collected by each pixel.

对应图7和图8中的(a)所示,第一像素点X1记录的是ToF模组以第一空间位姿采集的,标定板上的第一标定点C1的深度值c1,第二像素点X2记录的是标定板上的第二标定点A1的深度值a1。As shown in (a) of FIG. 7 and FIG. 8 , the first pixel point X1 records the depth value c1 of the first calibration point C1 on the calibration plate collected by the ToF module in the first spatial posture, and the second pixel point X2 records the depth value a1 of the second calibration point A1 on the calibration plate.

对应图7和图8中的(b)所示,第三像素点X3记录的是ToF模组以第二空间位姿采集的,标定板上的第一标定点C1的深度值c1,第四像素点X4记录的是标定板上的第三标定点A1’的深度值a1’。As shown in (b) of Figure 7 and Figure 8, the third pixel point X3 records the depth value c1 of the first calibration point C1 on the calibration plate collected by the ToF module in the second spatial posture, and the fourth pixel point X4 records the depth value a1' of the third calibration point A1' on the calibration plate.

将ToF模组的中心像素点与标定板的中心标定板之间的连线作为中心轴,ToF模组绕中心轴旋转。基于旋转一致性原则,ToF模组绕中心轴旋转的过程中,中心标定板上的某一标定点与中心标定点之间的距离不变,中心标定点与中心像素点之间的Z向距离也不变,那么即使ToF模组从第一空间位姿旋转180°到第二空间位姿,这一标定点与中心像素点之间的光路与中心轴的夹角不变。The ToF module is rotated around the central axis using the line between the central pixel of the ToF module and the central calibration plate of the calibration plate as the central axis. Based on the principle of rotation consistency, during the rotation of the ToF module around the central axis, the distance between a calibration point on the central calibration plate and the central calibration point remains unchanged, and the Z-direction distance between the central calibration point and the central pixel remains unchanged. Therefore, even if the ToF module rotates 180° from the first spatial posture to the second spatial posture, the angle between the optical path between this calibration point and the central pixel and the central axis remains unchanged.

例如图7所示,第一空间位姿对应的第二标定点A1与第一测量点T1之间的光路A1T1,与第一标定点C1所在的中心轴C1T1之间的夹角∠A1T1C1,以及第二空间位姿对应的第三标定点A1’与第一测量点T1之间的光路A1’T1,与第一标定点C1所在的中心轴C1T1之间的夹角∠A1’T1C1相等,即∠A1T1C1=∠A1’T1C1。For example, as shown in Figure 7, the angle ∠A1T1C1 between the optical path A1T1 between the second calibration point A1 corresponding to the first spatial posture and the first measuring point T1 and the central axis C1T1 where the first calibration point C1 is located, and the angle ∠A1’T1C1 between the optical path A1’T1 between the third calibration point A1’ corresponding to the second spatial posture and the first measuring point T1 and the central axis C1T1 where the first calibration point C1 is located are equal, that is, ∠A1T1C1=∠A1’T1C1.

S602:控制器控制移动组件带动ToF模组沿第一方向移动,使ToF模组的激光发射面与标定板间隔第二距离;控制移动组件带动ToF模组围绕ToF模组的激光发射面的中心点平行于标定板旋转,使ToF模组分别处于第三空间位姿和第四空间位姿,并控制ToF模组在第三空间位姿拍摄标定板得到第三深度图,在第四空间位姿拍摄标定板得到第四深度图;S602: The controller controls the moving component to drive the ToF module to move along the first direction, so that the laser emitting surface of the ToF module is spaced a second distance from the calibration plate; controls the moving component to drive the ToF module to rotate around the center point of the laser emitting surface of the ToF module parallel to the calibration plate, so that the ToF module is in a third spatial posture and a fourth spatial posture, respectively, and controls the ToF module to shoot the calibration plate in the third spatial posture to obtain a third depth map, and to shoot the calibration plate in the fourth spatial posture to obtain a fourth depth map;

继续如图7所示,移动组件带动ToF模组移动至第一测量点T2处,ToF模组的激光发射面所在的第一平面P1平行于标定板的激光反射面所在的第二平面P2,ToF模组的激光发射面与标定板的激光反射面之间的Z向距离为第二距离d2。Continuing as shown in Figure 7, the moving component drives the ToF module to move to the first measuring point T2, the first plane P1 where the laser emitting surface of the ToF module is located is parallel to the second plane P2 where the laser reflecting surface of the calibration plate is located, and the Z-direction distance between the laser emitting surface of the ToF module and the laser reflecting surface of the calibration plate is the second distance d2.

ToF模组在第二测量点T2处,移动模组先带动ToF模组在XY平面内旋转,以使ToF模组处于第三空间位姿。ToF模组向标定板发射激光,采集标定板对应的第三深度图。移动模组再带动ToF模组在XY平面内旋转,以使ToF模组处于第四空间位姿。ToF模组向标定板发射激光,采集标定板对应的第四深度图。The ToF module is at the second measurement point T2, and the mobile module first drives the ToF module to rotate in the XY plane so that the ToF module is in the third spatial posture. The ToF module emits laser to the calibration plate and collects the third depth map corresponding to the calibration plate. The mobile module then drives the ToF module to rotate in the XY plane so that the ToF module is in the fourth spatial posture. The ToF module emits laser to the calibration plate and collects the fourth depth map corresponding to the calibration plate.

在一种示例中,第三空间位姿与第一空间位姿相同,第四空间位姿与第二空间位姿相同。In one example, the third spatial pose is the same as the first spatial pose, and the fourth spatial pose is the same as the second spatial pose.

对应图7和图8中的(a)所示,第一像素点记录标定板上的第四标定点C2的深度值c2,第二像素点X2记录的是标定板上的第五标定点A2的深度值a2。Corresponding to (a) in FIG. 7 and FIG. 8 , the first pixel records the depth value c2 of the fourth calibration point C2 on the calibration plate, and the second pixel X2 records the depth value a2 of the fifth calibration point A2 on the calibration plate.

对应图7和图8中的(b)所示,第三像素点X3记录的是ToF模组以第二空间位姿采集的,标定板上的第四标定点C2的深度值c2,第四像素点X4记录的是标定板上的第六标定点A2’的深度值a2’。As shown in (b) of Figure 7 and Figure 8, the third pixel point X3 records the depth value c2 of the fourth calibration point C2 on the calibration plate collected by the ToF module in the second spatial posture, and the fourth pixel point X4 records the depth value a2' of the sixth calibration point A2' on the calibration plate.

基于前述关于ToF模组旋转过程中的角度一致性原则的分析,继续如图7所示,第三空间位姿对应的第五标定点A2与第二测量点T2之间的光路A2T2,与第四标定点C2所在的中心轴C2T2之间的夹角∠A2T2C2,以及第四空间位姿对应的第六标定点A2’ 与第二测量点T2之间的光路A2’T2,与第四标定点C2所在的中心轴C2T2之间的夹角∠A2’T2C2相等,即∠A2T2C2=∠A2’T2C2。Based on the above analysis on the principle of angle consistency during the rotation of the ToF module, as shown in Figure 7, the angle ∠A2T2C2 between the optical path A2T2 between the fifth calibration point A2 corresponding to the third spatial posture and the second measuring point T2 and the central axis C2T2 where the fourth calibration point C2 is located, and the angle ∠A2’T2C2 between the optical path A2’T2 between the sixth calibration point A2’ corresponding to the fourth spatial posture and the second measuring point T2 and the central axis C2T2 where the fourth calibration point C2 is located are equal, that is, ∠A2T2C2=∠A2’T2C2.

S603:控制器根据第一深度图、第二深度图、第三深度图和第四深度图,以及第一距离和第二距离,对ToF模组进行深度标定。S603: The controller performs depth calibration on the ToF module according to the first depth map, the second depth map, the third depth map, and the fourth depth map, as well as the first distance and the second distance.

控制器控制ToF模组分别在两个不同距离的测量点以不同空间位姿采集深度图,即可得到四张深度图。其中,第一深度图和第二深度图的Z向距离相同,第三深度图和第四深度图的Z向距离相同。以及,采集第一深度图所处的第一空间位姿与采集第三深度图所处的第三空间位姿相同,采集第二深度图所处的第二空间位姿与采集第四深度图所处的第四空间位姿相同。The controller controls the ToF module to collect depth maps at two different distances and in different spatial poses, and four depth maps can be obtained. Among them, the Z-direction distances of the first depth map and the second depth map are the same, and the Z-direction distances of the third depth map and the fourth depth map are the same. In addition, the first spatial pose at which the first depth map is collected is the same as the third spatial pose at which the third depth map is collected, and the second spatial pose at which the second depth map is collected is the same as the fourth spatial pose at which the fourth depth map is collected.

控制器可以通过根据Z向距离相同的两张深度图,获取角度换算公式及像素点的相对位移量,进而通过多次计算换算得到ToF模组的内参矩阵。The controller can obtain the angle conversion formula and the relative displacement of the pixels based on two depth maps with the same Z distance, and then obtain the internal parameter matrix of the ToF module through multiple calculations and conversions.

此外,在执行S601-S603的内参标定操作之前,深度标定系统还可以对ToF模组进行激光偏移矫正。深度标定系统进行激光偏移矫正可以包括如下步骤:In addition, before performing the internal reference calibration operation of S601-S603, the depth calibration system can also perform laser offset correction on the ToF module. The depth calibration system can perform laser offset correction including the following steps:

控制器控制移动组件带动ToF模组沿第一方向移动,使ToF模组的激光发射面与标定板间隔第三距离;控制移动组件带动ToF模组围绕ToF模组的激光发射面的中心点平行于标定板旋转,使ToF模组分别处于第五空间位姿和第六空间位姿,并控制ToF模组在第五空间位姿拍摄标定板得到第五深度图,在第六空间位姿拍摄标定板得到第六深度图;The controller controls the moving component to drive the ToF module to move along the first direction, so that the laser emitting surface of the ToF module is spaced a third distance from the calibration plate; controls the moving component to drive the ToF module to rotate around the center point of the laser emitting surface of the ToF module parallel to the calibration plate, so that the ToF module is in a fifth spatial posture and a sixth spatial posture, respectively, and controls the ToF module to shoot the calibration plate in the fifth spatial posture to obtain a fifth depth map, and to shoot the calibration plate in the sixth spatial posture to obtain a sixth depth map;

控制器根据第五深度图和第六深度图,对ToF模组进行激光偏移矫正。The controller performs laser offset correction on the ToF module according to the fifth depth map and the sixth depth map.

深度标定系统对ToF模组进行激光偏移矫正的步骤,控制器控制移动组件带动ToF模组移动至第一测量点,旋转使得ToF模组分别处于第五空间位姿和第六空间位姿。ToF模组处于第五空间位姿时向标定板发射激光,采集第五深度图。ToF模组处于第六空间位姿时向标定板发射激光,采集第六深度图。控制器控制ToF模组采集第五深度图和第六深度图的具体实施过程,在此不再赘述。The depth calibration system performs laser offset correction on the ToF module. The controller controls the moving component to drive the ToF module to move to the first measurement point, and rotates the ToF module so that the ToF module is in the fifth spatial posture and the sixth spatial posture, respectively. When the ToF module is in the fifth spatial posture, the laser is emitted to the calibration plate to collect the fifth depth map. When the ToF module is in the sixth spatial posture, the laser is emitted to the calibration plate to collect the sixth depth map. The specific implementation process of the controller controlling the ToF module to collect the fifth depth map and the sixth depth map will not be repeated here.

移动组件在带动ToF模组在XY平面内旋转的过程中,可以控制ToF模组围绕ToF模组的激光发射面的中心点旋转。这样,ToF模组的激光发射面的中心点的Y轴高度始终与标定板的激光反射面的中心点的Y轴高度保持一致。ToF模组的激光发射面的中心点与标定板的激光反射面的中心点的Z向距离也始终保持一致,对应的,ToF模组的中心像素点采集到的标定板的中心标定点的景深距离也始终保持一致。反向推导,ToF模组在平行于标定板旋转的过程中,ToF模组的全部像素区域中,若某一像素点采集的深度值始终保持不变,则这一像素点为中心像素点。这样,控制器就可以获取第五深度图和第六深度图的中心像素点;其中,中心像素点为第五深度图和第六深度图中深度值相同的像素点。In the process of driving the ToF module to rotate in the XY plane, the mobile component can control the ToF module to rotate around the center point of the laser emitting surface of the ToF module. In this way, the Y-axis height of the center point of the laser emitting surface of the ToF module is always consistent with the Y-axis height of the center point of the laser reflecting surface of the calibration plate. The Z-direction distance between the center point of the laser emitting surface of the ToF module and the center point of the laser reflecting surface of the calibration plate is also always consistent. Correspondingly, the depth of field distance of the center calibration point of the calibration plate collected by the center pixel point of the ToF module is also always consistent. Reversely, when the ToF module rotates parallel to the calibration plate, if the depth value collected by a certain pixel point in all pixel areas of the ToF module remains unchanged, then this pixel point is the center pixel point. In this way, the controller can obtain the center pixel point of the fifth depth map and the sixth depth map; wherein, the center pixel point is the pixel point with the same depth value in the fifth depth map and the sixth depth map.

控制器获取中心像素点的激光记录直方图;其中,激光记录直方图包括至少两个激光信号的波形图。控制器根据激光记录直方图中记录的第一个激光信号的波形图的目标时刻与激光记录直方图的统计0点时刻的差值,计算激光偏移距离;其中,第一个激光信号的波形图的目标时刻包括波峰时刻。控制器根据激光偏移距离,对ToF模组进行激光偏移矫正。The controller obtains a laser recording histogram of a central pixel point; wherein the laser recording histogram includes waveforms of at least two laser signals. The controller calculates the laser offset distance according to the difference between the target time of the waveform of the first laser signal recorded in the laser recording histogram and the statistical 0-point time of the laser recording histogram; wherein the target time of the waveform of the first laser signal includes the peak time. The controller performs laser offset correction on the ToF module according to the laser offset distance.

在一种具体示例中,如图9的(a)所示,为控制器获取ToF模组记录的中心像素点的直方图。直方图记录的中心像素点对应的第一个激光信号波形,波峰位置距离直方图的统计0点之间的距离为Δ1,即激光偏移距离为Δ1。而中心像素点距离标定板之间实际的景深距离为d1。那么,为了对ToF模组进行激光偏移矫正,将ToF模组所获取的深度值叠加激光偏移距离,即可获取实际的景深距离,实现激光偏移矫正,矫正后如图9中的(b)所示。In a specific example, as shown in (a) of FIG9 , the controller obtains a histogram of the center pixel recorded by the ToF module. The first laser signal waveform corresponding to the center pixel recorded in the histogram has a peak position that is Δ1 away from the statistical 0 point of the histogram, that is, the laser offset distance is Δ1. The actual depth of field distance between the center pixel and the calibration plate is d1. Then, in order to perform laser offset correction on the ToF module, the depth value obtained by the ToF module is superimposed on the laser offset distance to obtain the actual depth of field distance and realize laser offset correction. The corrected value is shown in (b) of FIG9 .

如图9所示的示例,横向时间单位为bin,1bin≈500皮秒≈5*10-10秒。激光飞行速度为3*108米/秒,Δ1=22*5*10-10秒/2*3*108米/秒≈1.65米≈165厘米。As shown in the example of Figure 9, the horizontal time unit is bin, 1 bin ≈ 500 picoseconds ≈ 5* 10-10 seconds. The laser flying speed is 3* 108 m/s, Δ1 = 22*5* 10-10 seconds/2*3* 108 m/s ≈ 1.65 m ≈ 165 cm.

为进行激光偏移矫正,直方图信号波峰的位置位于d1+Δ1处,Δ1通常预留150厘米-200厘米即可,例如Δ1=165厘米。For laser offset correction, the position of the histogram signal peak is located at d1+Δ1, and Δ1 is usually reserved for 150 cm-200 cm, for example, Δ1=165 cm.

在其他示例中,不同情况下对应的时间单位的数量不同,可能为10bin或者30bin。In other examples, the number of time units corresponding to different situations is different, and may be 10 bins or 30 bins.

横向时间为10bin,Δ1=10*5*10-10秒/2*3*108米/秒≈0.75米≈75厘米。The lateral time is 10 bin, Δ1=10*5*10 -10 seconds/2*3*10 8 meters/second≈0.75 meters≈75 centimeters.

横向时间为30bin,Δ1=30*5*10-10秒/2*3*108米/秒≈2.25米≈225厘米。The lateral time is 30 bin, Δ1=30*5*10 -10 sec/2*3*10 8 m/sec≈2.25 m≈225 cm.

也就是说,在不同情况或者不同设备中,激光偏激矫正的Δ1的数值会随之调整,不作限定。That is to say, in different situations or different devices, the value of Δ1 of the laser bias correction will be adjusted accordingly without limitation.

深度标定系统根据上述步骤计算激光偏移距离,进行激光偏移矫正之后,再执行S602-S603对应的内参矩阵标定,这样可以减少激光偏移对内参矩阵标定的影响,提高ToF模组的深度标定的整体精确度。The depth calibration system calculates the laser offset distance according to the above steps, performs laser offset correction, and then executes the internal parameter matrix calibration corresponding to S602-S603. This can reduce the impact of laser offset on the internal parameter matrix calibration and improve the overall accuracy of the depth calibration of the ToF module.

在一种示例中,继续如图7和图8所示,看根据各深度图记录的深度值,实际的景深距离还可以再叠加激光偏移距离,得到更接近的景深距离。In one example, as shown in FIG. 7 and FIG. 8 , according to the depth values recorded in each depth map, the actual depth of field distance can be superimposed with the laser offset distance to obtain a closer depth of field distance.

例如,在第一测量点T1,对应于标定板上的第一标定点C1,第一深度图记录的深度值为c1,叠加偏移距离Δd,记为第一深度值c1+Δd。ToF模组旋转180°后,第二深度图记录的深度值仍为c1,叠加偏移距离Δd,仍记为第一深度值(c1+Δd)。For example, at the first measurement point T1, corresponding to the first calibration point C1 on the calibration plate, the depth value recorded in the first depth map is c1, and the offset distance Δd is superimposed, which is recorded as the first depth value c1+Δd. After the ToF module rotates 180°, the depth value recorded in the second depth map is still c1, and the offset distance Δd is superimposed, which is still recorded as the first depth value (c1+Δd).

其中,在深度图记录的深度值上叠加的偏移距离包括两个误差值,一个是激光偏移导致的误差值Δ1,另一个是内参标定阶段能够矫正的激光偏移误差值Δ2。也就是说,Δd=Δ1+Δ2。Δ1为激光偏移矫正阶段已经计算出的偏移距离,可以在激光偏移阶段矫正。Δ2为需要通过后续的内参标定计算和矫正的偏移距离。在内参矩阵确定之前,Δ2为未知参数,在内参矩阵计算后会确定Δ2的具体数值。Among them, the offset distance superimposed on the depth value recorded in the depth map includes two error values, one is the error value Δ1 caused by the laser offset, and the other is the laser offset error value Δ2 that can be corrected in the internal parameter calibration stage. In other words, Δd=Δ1+Δ2. Δ1 is the offset distance calculated in the laser offset correction stage and can be corrected in the laser offset stage. Δ2 is the offset distance that needs to be calculated and corrected through subsequent internal parameter calibration. Before the internal parameter matrix is determined, Δ2 is an unknown parameter, and the specific value of Δ2 will be determined after the internal parameter matrix is calculated.

针对激光偏移导致的偏移距离Δ1,控制器可以通过调整ToF模组的寄存器,在内参标定之前已经将激光偏移距离Δ1自动加入计算,也就是说,后续内参标定采集的深度图中的深度值c1已经自动叠加了Δ1,只需要在深度值c1上叠加Δ2,代入后续的内参标定阶段的相关计算公式,以计算出未知参数Δ2。为便于描述,后续直接以Δd代替全部偏移距离,不再详细描述针对Δ1和Δ2的区分处理操作,后续同理。For the offset distance Δ1 caused by laser offset, the controller can automatically add the laser offset distance Δ1 to the calculation before the internal calibration by adjusting the register of the ToF module. In other words, the depth value c1 in the depth map collected by the subsequent internal calibration has been automatically superimposed with Δ1. It is only necessary to superimpose Δ2 on the depth value c1 and substitute it into the relevant calculation formula of the subsequent internal calibration stage to calculate the unknown parameter Δ2. For the convenience of description, Δd is directly used to replace all offset distances in the future, and the distinguishing processing operations for Δ1 and Δ2 are no longer described in detail. The same applies to the future.

对应于标定板上的第二标定点A1,第一深度图记录的深度为a1,叠加偏移距离Δd,记为第二深度值a1+Δd。ToF模组旋转180°后,第二深度图记录的深度为a1’,叠加偏移距离Δd,记为第三深度值(a1’+Δd)。Corresponding to the second calibration point A1 on the calibration plate, the depth recorded in the first depth map is a1, and the offset distance Δd is superimposed, which is recorded as the second depth value a1+Δd. After the ToF module rotates 180°, the depth recorded in the second depth map is a1’, and the offset distance Δd is superimposed, which is recorded as the third depth value (a1’+Δd).

对应的,在第二测量点T2,对应于标定板上的第四标定点C2,第三深度图记录的深度值为c2,叠加偏移距离Δd,记为第四深度值c2+Δd。ToF模组旋转180°后,第四深度图记录的深度值仍为c2,叠加偏移距离Δd,仍记为第五深度值(c2+Δd)。Correspondingly, at the second measurement point T2, corresponding to the fourth calibration point C2 on the calibration board, the depth value recorded in the third depth map is c2, and the offset distance Δd is superimposed, which is recorded as the fourth depth value c2+Δd. After the ToF module rotates 180°, the depth value recorded in the fourth depth map is still c2, and the offset distance Δd is superimposed, which is still recorded as the fifth depth value (c2+Δd).

对应于标定板上的第二五定点A2,第三深度图记录的深度值为a2,叠加偏移距离Δd,记为第五深度值a2+Δd。ToF模组旋转180°后,第四深度图记录的深度值为a2’,叠加偏移距离Δd,记为第六深度值(a2’+Δd)。Corresponding to the 25th fixed point A2 on the calibration plate, the depth value recorded in the third depth map is a2, and the offset distance Δd is superimposed, which is recorded as the fifth depth value a2+Δd. After the ToF module rotates 180°, the depth value recorded in the fourth depth map is a2’, and the offset distance Δd is superimposed, which is recorded as the sixth depth value (a2’+Δd).

控制器根据第一深度图、第二深度图、第三深度图和第四深度图,对ToF模组进行深度标定的过程,主要是完成内参矩阵的标定和偏移矫正。在一种具体实施方式中,如图10所示,控制器执行S603的内参矩阵标定的步骤,可以主要包括:The controller performs depth calibration on the ToF module according to the first depth map, the second depth map, the third depth map and the fourth depth map, mainly completing the calibration and offset correction of the intrinsic parameter matrix. In a specific implementation, as shown in FIG10 , the controller performs the step of calibrating the intrinsic parameter matrix of S603, which may mainly include:

S1001:控制器根据第一深度图和第二深度图、第三深度图和第四深度图,获得ToF模组的各像素点与中心像素点的相对位移量,以及各像素点对应光路与第一方向的夹角;S1001: The controller obtains the relative displacement of each pixel of the ToF module and the central pixel, and the angle between the optical path corresponding to each pixel and the first direction according to the first depth map, the second depth map, the third depth map, and the fourth depth map;

具体的,控制器根据第一深度图和第二深度图,计算第一夹角等于第二夹角时的第一角度换算公式;其中,标定板上包括第一标定点、第二标定点和第三标定点,第一标定点对应第一深度图和第二深度图的中心像素点,第一标定点到第一测量点之间的第一光路与第二标定点到第一测量点之间的第二光路形成第一夹角,第一标定点到第一测量点之间的第一光路与第三标定点到第一测量点之间的第三光路形成第二夹角;Specifically, the controller calculates a first angle conversion formula when the first angle is equal to the second angle according to the first depth map and the second depth map; wherein the calibration plate includes a first calibration point, a second calibration point and a third calibration point, the first calibration point corresponds to a central pixel point of the first depth map and the second depth map, a first optical path between the first calibration point and the first measuring point and a second optical path between the second calibration point and the first measuring point form a first angle, and the first optical path between the first calibration point and the first measuring point and a third optical path between the third calibration point and the first measuring point form a second angle;

控制器根据第三深度图和第四深度图,计算第三夹角等于第四夹角时的第二角度换算公式;其中,标定板上包括第四标定点、第五标定点和第六标定点,第四标定点对应第三深度图和第四深度图的中心像素点,第四标定点到第二测量点之间的第四光路与第五标定点到第二测量点之间的第五光路形成第三夹角,第四标定点到第二测量点之间的第四光路与第六标定点到第二测量点之间的第六光路形成第四夹角;The controller calculates a second angle conversion formula when the third angle is equal to the fourth angle according to the third depth map and the fourth depth map; wherein the calibration plate includes a fourth calibration point, a fifth calibration point and a sixth calibration point, the fourth calibration point corresponds to the central pixel point of the third depth map and the fourth depth map, the fourth optical path between the fourth calibration point and the second measuring point and the fifth optical path between the fifth calibration point and the second measuring point form a third angle, and the fourth optical path between the fourth calibration point and the second measuring point and the sixth optical path between the sixth calibration point and the second measuring point form a fourth angle;

根据第一光路、第二光路、第三光路、第四光路、第五光路和第六光路对应的深度值,以及第一角度换算公式和第二角度换算公式,计算ToF模组的各像素点与中心像素点的相对位移量,以及各像素点对应光路与第一方向的夹角。According to the depth values corresponding to the first optical path, the second optical path, the third optical path, the fourth optical path, the fifth optical path and the sixth optical path, and the first angle conversion formula and the second angle conversion formula, the relative displacement of each pixel point of the ToF module and the center pixel point, and the angle between the optical path corresponding to each pixel point and the first direction are calculated.

S1002:控制器根据ToF模组的各像素点与中心像素点的相对位移量,以及各像素点对应光路与第一方向的夹角,计算ToF模组的内参矩阵;S1002: The controller calculates an internal parameter matrix of the ToF module according to a relative displacement between each pixel of the ToF module and a central pixel, and an angle between an optical path corresponding to each pixel and a first direction;

S1003:控制器根据ToF模组的内参矩阵,对ToF模组进行深度标定。S1003: The controller performs depth calibration on the ToF module according to the internal parameter matrix of the ToF module.

在一种示例中,继续参见前述图7和图8,根据第一深度图和第二深度图,确定第一标定点C1与第二标定点A1之间的夹角∠A1T1C1,以及第一标定点C1与第三标定点A1’之间的夹角∠A1’T1C1,∠A1T1C1=∠A1’T1C1。根据第三深度图和第四深度图,确定第四标定点C2与第五标定点A2之间的夹角∠A2T2C2,以及第四标定点C2与第六标定点A2’之间的夹角∠A2’2C2,∠A2T2C2=∠A2’T2C2。In one example, referring to the aforementioned Figures 7 and 8, the angle ∠A1T1C1 between the first calibration point C1 and the second calibration point A1, and the angle ∠A1’T1C1 between the first calibration point C1 and the third calibration point A1’ are determined based on the first depth map and the second depth map, and ∠A1T1C1=∠A1’T1C1. The angle ∠A2T2C2 between the fourth calibration point C2 and the fifth calibration point A2, and the angle ∠A2’2C2 between the fourth calibration point C2 and the sixth calibration point A2’ are determined based on the third depth map and the fourth depth map, and ∠A2T2C2=∠A2’T2C2.

令a0=(a2+Δd)-(a1+Δd),a0’=(a2’+Δd)-(a1’+Δd),c=(c2+Δd)-(c1+Δd)。a0和c的夹角与a0’和c的夹角一致。Let a0 = (a2 + Δd) - (a1 + Δd), a0' = (a2' + Δd) - (a1' + Δd), c = (c2 + Δd) - (c1 + Δd). The angle between a0 and c is the same as the angle between a0' and c.

前述整体方案中,计算ToF模组所采集的深度图中的第二像素点与第一像素点的相对位移量。基于类似原理,可以获取ToF模组采集的深度图中全部像素的相对位移量,主要计算过程如下:In the above overall solution, the relative displacement between the second pixel and the first pixel in the depth map collected by the ToF module is calculated. Based on a similar principle, the relative displacement of all pixels in the depth map collected by the ToF module can be obtained. The main calculation process is as follows:

设定向量:/>,以及/>向量:/>。坐标/>,/>set up Vector: /> , and/> Vector: /> . Coordinates/> ,/> .

计算可得模长:The modulus length can be calculated:

;/> ; /> .

三个点即与/>与/>共线,可以得到表达式1:Three points That is, with/> With/> Collinear, we can get expression 1:

.

上述直线中存在两个点,即,/>。将该两点坐标代入表达式1分别得到表达式2和表达式3。其中,表达式2为:There are two points in the above straight line, namely ,/> Substituting the coordinates of the two points into expression 1, we get expressions 2 and 3 respectively. Among them, expression 2 is:

;

表达式3为:Expression 3 is:

.

,上述表达式2+表达式3可以替换为:make , the above expression 2 + expression 3 can be replaced by:

.

继续令Continue Order ,

代入公式可得:Substituting into the formula we get:

.

取k为整数的解,可以得到向量的斜率k。通过模长已知/>和/>坐标,可以得到两点之间的斜率为/>Taking k as an integer solution, we can get The slope k of the vector is known by the modulus. and/> Coordinates, we can get the slope between the two points as/> .

推导过程得到的k1则代表平面与模组的夹角的正切值,反向求解可得:θ=arctan(k1)。The k1 obtained in the derivation process represents the tangent value of the angle between the plane and the module. The reverse solution is: θ=arctan(k1).

已知各像素点与中心像素点的夹角关系,通过平面方程的关系运算,可以拟合出新的平面,记为第三平面,如图11中的(a)所示的P3。图11中,第三平面为与ToF模组所在的第一平面平行的平面,OC为垂直于第三平面的光路。此时OC垂直于第三平面,原a0补偿至a3,a0‘补偿至a3’,有a3=a3’。由此可以得到图11的(b)中,第二像素点与第一像素点的空间夹角α的余弦量,即cosα=c/a3。The angle relationship between each pixel and the central pixel is known. Through the relationship operation of the plane equation, a new plane can be fitted, which is recorded as the third plane, such as P3 shown in (a) of Figure 11. In Figure 11, the third plane is a plane parallel to the first plane where the ToF module is located, and OC is the optical path perpendicular to the third plane. At this time, OC is perpendicular to the third plane, the original a0 is compensated to a3, and a0' is compensated to a3', and a3=a3'. From this, the cosine of the spatial angle α between the second pixel and the first pixel in (b) of Figure 11 can be obtained, that is, cosα=c/a3.

通过以上计算逻辑,可以同理得到所有像素点与中心像素点之间夹角的余弦量。Through the above calculation logic, the cosine of the angle between all pixels and the central pixel can be obtained in the same way.

继续如图12所示,令a线段至平面的点坐标为(ax,ay,az),其中ax应为0,az=c,空间坐标与像素坐标满足以下关系式:Continuing as shown in Figure 12, let the coordinates of the point from line segment a to the plane be (ax, ay, az), where ax should be 0, az=c, and the spatial coordinates and pixel coordinates satisfy the following relationship:

,

推导可得:ay/az=(v-cy)/fy。Derivation shows that: ay/az=(v-cy)/fy.

将ToF模组的全部像素点及其对应的深度值代入上述空间坐标转换公式中,利用最小二乘法得到最佳的内参矩阵完成内参标定。Substitute all the pixels of the ToF module and their corresponding depth values into the above spatial coordinate conversion formula, and use the least squares method to obtain the optimal intrinsic parameter matrix to complete the intrinsic parameter calibration.

ToF模组位于第二测量点T2时,ToF模组与标定板之间为第二距离d2。直方图实际得到的是a2+Δ=A2、a2‘+Δ=A2’、c2+Δ=C2’这样的深度值,根据第三步k和k1的结果,正向顺推公式,当Δ=A2-a2时,才能满足k和k1的数值,由此可以得到偏移距离Δd 。When the ToF module is located at the second measurement point T2, the distance between the ToF module and the calibration plate is the second distance d2. The actual depth values obtained from the histogram are a2+Δ=A2, a2'+Δ=A2', c2+Δ=C2'. According to the results of k and k1 in the third step, the formula is deduced forward. When Δ=A2-a2, the values of k and k1 can be satisfied, and the offset distance Δd can be obtained.

综上,本实施例提供的深度标定方案,不需要单独先后执行三次标定操作,极大地降低了机械成本和场地空间。通过采集六张深度图即可完成激光偏移矫正、内参矩阵标定和偏移标定,极大地提升了标定产能和人力成本。In summary, the depth calibration solution provided in this embodiment does not need to perform three calibration operations separately, which greatly reduces the mechanical cost and site space. Laser offset correction, intrinsic matrix calibration and offset calibration can be completed by collecting six depth maps, which greatly improves the calibration capacity and labor cost.

另外,本实施例提供的深度标定系统所执行的深度标定方法,要求待标定的ToF模组与标定板保持基本平行即可,通过激光实现角度测算,降低了环境构建难度和点检难度。中低分辨率的dtof标定无法通过张正友标定法获得比较准确的内参信息;即使使用张正友标定法,往往需要拍摄多角度多张图片,对环境搭建和UPH不友好。基于深度标定内参的方法,在保证精度的同时可以使用更快的方式完成标定。In addition, the depth calibration method performed by the depth calibration system provided in this embodiment requires that the ToF module to be calibrated is basically parallel to the calibration plate, and angle measurement is achieved through laser, which reduces the difficulty of environment construction and inspection. The low and medium resolution dtof calibration cannot obtain more accurate internal reference information through Zhang Zhengyou's calibration method; even if Zhang Zhengyou's calibration method is used, it is often necessary to take multiple pictures from multiple angles, which is not friendly to environment construction and UPH. Based on the method of depth calibration internal reference, calibration can be completed in a faster way while ensuring accuracy.

本实施例提供的深度标定方法和深度标定系统,可以极大程度地提高激光测距仪、车载激光雷达、AR/VR等设备的深度标定效率。The depth calibration method and depth calibration system provided in this embodiment can greatly improve the depth calibration efficiency of laser rangefinders, vehicle-mounted laser radars, AR/VR and other equipment.

此外,本申请提供一种深度标定系统,用于标定ToF模组。深度标定系统包括移动组件、标定板和控制器。In addition, the present application provides a depth calibration system for calibrating a ToF module. The depth calibration system includes a moving component, a calibration board, and a controller.

控制器用于执行前述实施例提供的深度标定方法。The controller is used to execute the depth calibration method provided in the above embodiment.

本申请还提供一种深度标定设备,用于标定ToF模组。深度标定设备连接有移动组件,ToF模组固定在移动组件后,ToF模组的激光发射面与标定板平行。The present application also provides a depth calibration device for calibrating a ToF module. The depth calibration device is connected to a moving component, the ToF module is fixed behind the moving component, and the laser emission surface of the ToF module is parallel to the calibration plate.

深度标定设备包括存储器和处理器,存储器与处理器耦合;存储器存储计算机执行指令;处理器执行存储器存储的计算机执行指令,使得深度标定设备执行前述实施例提供的深度标定方法。The depth calibration device includes a memory and a processor, the memory is coupled to the processor; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory, so that the depth calibration device executes the depth calibration method provided by the aforementioned embodiment.

本申请还提供一种计算机可读存储介质,计算机可读存储介质中存储有计算机程序,当其在计算机上运行时,使得计算机执行前述实施例提供的深度标定方法。The present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer-readable storage medium is run on a computer, the computer executes the depth calibration method provided in the aforementioned embodiment.

本申请还提供一种计算机程序产品,包括计算机程序,计算机程序被处理器执行时,实现如前述实施例提供的深度标定方法。The present application also provides a computer program product, including a computer program. When the computer program is executed by a processor, the depth calibration method provided in the above embodiment is implemented.

本申请实施例提供的深度标定系统、深度标定设备、计算机可读存储介质,和包含指令的计算机程序产品的具体实施方式及其所带来的技术效果,可参见前述实施例提供的深度标定方法的具体实施过程及其所带来的技术效果,此处不再赘述。The specific implementation methods of the depth calibration system, depth calibration device, computer-readable storage medium, and computer program product containing instructions provided in the embodiments of the present application and the technical effects brought about by them can be found in the specific implementation process of the depth calibration method provided in the aforementioned embodiments and the technical effects brought about by them, which will not be repeated here.

在一些实施例中,通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。In some embodiments, through the description of the above implementation methods, technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device and unit described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

在本申请实施例各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。Each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of software functional units.

集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器执行本申请各个实施例方法的全部或部分步骤。而前述的存储介质包括:快闪存储器、移动硬盘、只读存储器、随机存取存储器、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: various media that can store program codes, such as flash memory, mobile hard disk, read-only memory, random access memory, disk or optical disk.

以上,仅为本申请实施例的具体实施方式,但本申请实施例的保护范围并不局限于此,任何在本申请实施例揭露的技术范围内的变化或替换,都应涵盖在本申请实施例的保护范围之内。因此,本申请实施例的保护范围应以所述权利要求的保护范围为准。The above are only specific implementations of the embodiments of the present application, but the protection scope of the embodiments of the present application is not limited thereto, and any changes or replacements within the technical scope disclosed in the embodiments of the present application should be included in the protection scope of the embodiments of the present application. Therefore, the protection scope of the embodiments of the present application should be based on the protection scope of the claims.

Claims (12)

1.一种深度标定方法,其特征在于,用于深度标定系统标定ToF模组;所述深度标定系统包括移动组件、标定板和控制器;所述ToF模组固定在所述移动组件后,所述ToF模组的激光发射面与所述标定板平行;所述深度标定方法包括:1. A depth calibration method, characterized in that it is used for calibrating a ToF module in a depth calibration system; the depth calibration system comprises a mobile component, a calibration plate and a controller; after the ToF module is fixed to the mobile component, the laser emission surface of the ToF module is parallel to the calibration plate; the depth calibration method comprises: 所述控制器控制所述移动组件带动所述ToF模组沿第一方向移动,使所述ToF模组的激光发射面与所述标定板间隔第一距离;控制所述移动组件带动所述ToF模组围绕所述ToF模组的激光发射面的中心点平行于所述标定板旋转,使所述ToF模组分别处于第一空间位姿和第二空间位姿,并控制所述ToF模组在所述第一空间位姿拍摄所述标定板得到第一深度图,在所述第二空间位姿拍摄所述标定板得到第二深度图;The controller controls the moving component to drive the ToF module to move along a first direction, so that the laser emitting surface of the ToF module is spaced a first distance from the calibration plate; controls the moving component to drive the ToF module to rotate around the center point of the laser emitting surface of the ToF module parallel to the calibration plate, so that the ToF module is in a first spatial posture and a second spatial posture, respectively, and controls the ToF module to photograph the calibration plate in the first spatial posture to obtain a first depth map, and to photograph the calibration plate in the second spatial posture to obtain a second depth map; 所述控制器控制所述移动组件带动所述ToF模组沿所述第一方向移动,使所述ToF模组的激光发射面与所述标定板间隔第二距离;控制所述移动组件带动所述ToF模组围绕所述ToF模组的激光发射面的中心点平行于所述标定板旋转,使所述ToF模组分别处于第三空间位姿和第四空间位姿,并控制所述ToF模组在所述第三空间位姿拍摄所述标定板得到第三深度图,在所述第四空间位姿拍摄所述标定板得到第四深度图;The controller controls the moving component to drive the ToF module to move along the first direction, so that the laser emitting surface of the ToF module is spaced a second distance from the calibration plate; controls the moving component to drive the ToF module to rotate around the center point of the laser emitting surface of the ToF module parallel to the calibration plate, so that the ToF module is in a third spatial posture and a fourth spatial posture, respectively, and controls the ToF module to photograph the calibration plate in the third spatial posture to obtain a third depth map, and to photograph the calibration plate in the fourth spatial posture to obtain a fourth depth map; 所述控制器根据所述第一深度图、所述第二深度图、所述第三深度图和所述第四深度图,以及所述第一距离和所述第二距离,对所述ToF模组进行深度标定;其中,所述第一方向垂直于所述标定板,所述第一距离与所述第二距离不同;所述第一空间位姿和所述第二空间位姿不同,所述第三空间位姿和所述第四空间位姿不同。The controller performs depth calibration on the ToF module according to the first depth map, the second depth map, the third depth map and the fourth depth map, as well as the first distance and the second distance; wherein the first direction is perpendicular to the calibration plate, the first distance is different from the second distance; the first spatial posture is different from the second spatial posture, and the third spatial posture is different from the fourth spatial posture. 2.根据权利要求1所述的深度标定方法,其特征在于,所述第一空间位姿和所述第三空间位姿相同,所述第二空间位姿和所述第四空间位姿相同。2. The depth calibration method according to claim 1 is characterized in that the first spatial pose is the same as the third spatial pose, and the second spatial pose is the same as the fourth spatial pose. 3.根据权利要求1或2所述的深度标定方法,其特征在于,所述ToF模组由所述第一空间位姿,围绕所述ToF模组的激光发射面的中心点平行于所述标定板旋转180度,处于所述第二空间位姿;3. The depth calibration method according to claim 1 or 2, characterized in that the ToF module is rotated 180 degrees parallel to the calibration plate from the first spatial posture around the center point of the laser emission surface of the ToF module to the second spatial posture; 所述ToF模组由所述第三空间位姿,围绕所述ToF模组的激光发射面的中心点平行于所述标定板旋转180度,处于所述第四空间位姿。The ToF module is rotated 180 degrees from the third spatial posture around the center point of the laser emitting surface of the ToF module parallel to the calibration plate to be in the fourth spatial posture. 4.根据权利要求1或2所述的深度标定方法,其特征在于,所述ToF模组的激光发射面与所述标定板平行,包括:4. The depth calibration method according to claim 1 or 2, characterized in that the laser emission surface of the ToF module is parallel to the calibration plate, comprising: 所述ToF模组的激光发射面与所述标定板的夹角小于预设角度阈值。The angle between the laser emitting surface of the ToF module and the calibration plate is smaller than a preset angle threshold. 5.根据权利要求1所述的深度标定方法,其特征在于,所述控制所述移动组件带动所述ToF模组围绕所述ToF模组的激光发射面的中心点平行于所述标定板旋转,使所述ToF模组分别处于第一空间位姿和第二空间位姿,并控制所述ToF模组在所述第一空间位姿拍摄所述标定板得到第一深度图,在所述第二空间位姿拍摄所述标定板得到第二深度图的步骤之前,所述深度标定方法还包括:5. The depth calibration method according to claim 1 is characterized in that the controlling the moving component drives the ToF module to rotate around the center point of the laser emission surface of the ToF module parallel to the calibration plate, so that the ToF module is in a first spatial posture and a second spatial posture respectively, and the ToF module is controlled to shoot the calibration plate in the first spatial posture to obtain a first depth map. Before the step of shooting the calibration plate in the second spatial posture to obtain a second depth map, the depth calibration method further includes: 所述控制器控制所述移动组件带动所述ToF模组沿所述第一方向移动,使所述ToF模组的激光发射面与所述标定板间隔第三距离;控制所述移动组件带动所述ToF模组围绕所述ToF模组的激光发射面的中心点平行于所述标定板旋转,使所述ToF模组分别处于第五空间位姿和第六空间位姿,并控制所述ToF模组在所述第五空间位姿拍摄所述标定板得到第五深度图,在所述第六空间位姿拍摄所述标定板得到第六深度图;第五空间位姿和第六空间位姿不同;The controller controls the moving component to drive the ToF module to move along the first direction, so that the laser emitting surface of the ToF module is spaced a third distance from the calibration plate; controls the moving component to drive the ToF module to rotate around the center point of the laser emitting surface of the ToF module parallel to the calibration plate, so that the ToF module is in a fifth spatial posture and a sixth spatial posture, respectively, and controls the ToF module to photograph the calibration plate in the fifth spatial posture to obtain a fifth depth map, and to photograph the calibration plate in the sixth spatial posture to obtain a sixth depth map; the fifth spatial posture and the sixth spatial posture are different; 所述控制器根据所述第五深度图和所述第六深度图,对所述ToF模组进行激光偏移矫正。The controller performs laser offset correction on the ToF module according to the fifth depth map and the sixth depth map. 6.根据权利要求5所述的深度标定方法,其特征在于,所述控制器根据所述第五深度图和所述第六深度图,对所述ToF模组进行激光偏移矫正的步骤,包括:6. The depth calibration method according to claim 5, characterized in that the controller performs a step of performing laser offset correction on the ToF module according to the fifth depth map and the sixth depth map, comprising: 所述控制器获取所述第五深度图和所述第六深度图的中心像素点;其中,所述中心像素点为所述第五深度图和第六深度图中深度值相同的像素点;The controller obtains a central pixel point of the fifth depth map and the sixth depth map; wherein the central pixel point is a pixel point with the same depth value in the fifth depth map and the sixth depth map; 所述控制器获取所述中心像素点的激光记录直方图;其中,所述激光记录直方图包括至少两个激光信号的波形图;The controller acquires a laser recording histogram of the central pixel point; wherein the laser recording histogram includes at least two waveform diagrams of laser signals; 所述控制器根据所述激光记录直方图中记录的第一个激光信号的波形图的目标时刻与所述激光记录直方图的统计0点时刻的差值,计算激光偏移距离;其中,所述第一个激光信号的波形图的目标时刻包括波峰时刻;The controller calculates the laser offset distance according to the difference between the target time of the waveform of the first laser signal recorded in the laser recording histogram and the statistical 0 point time of the laser recording histogram; wherein the target time of the waveform of the first laser signal includes the peak time; 所述控制器根据所述激光偏移距离,对所述ToF模组进行激光偏移矫正。The controller performs laser offset correction on the ToF module according to the laser offset distance. 7.根据权利要求1、2、5或者6中任一项所述的深度标定方法,其特征在于,所述控制器根据所述第一深度图、所述第二深度图、所述第三深度图和所述第四深度图,以及所述第一距离和所述第二距离,对所述ToF模组进行深度标定的步骤,包括:7. The depth calibration method according to any one of claims 1, 2, 5 or 6, characterized in that the controller performs a step of depth calibration on the ToF module according to the first depth map, the second depth map, the third depth map and the fourth depth map, and the first distance and the second distance, comprising: 所述控制器根据所述第一深度图和所述第二深度图、所述第三深度图和所述第四深度图,获得所述ToF模组的各像素点与中心像素点的相对位移量,以及各像素点对应光路与所述第一方向的夹角;The controller obtains the relative displacement of each pixel point of the ToF module and the central pixel point, and the angle between the optical path corresponding to each pixel point and the first direction according to the first depth map, the second depth map, the third depth map, and the fourth depth map; 所述控制器根据所述ToF模组的各像素点与中心像素点的相对位移量,以及各像素点对应光路与所述第一方向的夹角,计算所述ToF模组的内参矩阵;The controller calculates the intrinsic parameter matrix of the ToF module according to the relative displacement between each pixel of the ToF module and the central pixel, and the angle between the optical path corresponding to each pixel and the first direction; 所述控制器根据所述ToF模组的内参矩阵,对所述ToF模组进行深度标定。The controller performs depth calibration on the ToF module according to the internal parameter matrix of the ToF module. 8.根据权利要求7所述的深度标定方法,其特征在于,所述控制器根据所述第一深度图和所述第二深度图、所述第三深度图和所述第四深度图,获得所述ToF模组的各像素点与中心像素点的相对位移量,以及各像素点对应光路与所述第一方向的夹角的步骤,包括:8. The depth calibration method according to claim 7, characterized in that the controller obtains the relative displacement of each pixel point and the central pixel point of the ToF module and the angle between the optical path corresponding to each pixel point and the first direction according to the first depth map, the second depth map, the third depth map and the fourth depth map, comprising: 所述控制器根据所述第一深度图和第二深度图,计算第一夹角等于第二夹角时的第一角度换算公式;其中,所述标定板上包括第一标定点、第二标定点和第三标定点,所述第一标定点对应所述第一深度图和所述第二深度图的中心像素点,所述第一标定点到第一测量点之间的第一光路与所述第二标定点到所述第一测量点之间的第二光路形成所述第一夹角,所述第一标定点到所述第一测量点之间的第一光路与所述第三标定点到所述第一测量点之间的第三光路形成所述第二夹角;The controller calculates a first angle conversion formula when the first angle is equal to the second angle according to the first depth map and the second depth map; wherein the calibration plate includes a first calibration point, a second calibration point and a third calibration point, the first calibration point corresponds to a central pixel point of the first depth map and the second depth map, a first optical path between the first calibration point and the first measuring point and a second optical path between the second calibration point and the first measuring point form the first angle, and a first optical path between the first calibration point and the first measuring point and a third optical path between the third calibration point and the first measuring point form the second angle; 所述控制器根据所述第三深度图和所述第四深度图,计算第三夹角等于第四夹角时的第二角度换算公式;其中,所述标定板上包括第四标定点、第五标定点和第六标定点,所述第四标定点对应所述第三深度图和所述第四深度图的中心像素点,所述第四标定点到第二测量点之间的第四光路与所述第五标定点到所述第二测量点之间的第五光路形成所述第三夹角,所述第四标定点到所述第二测量点之间的第四光路与所述第六标定点到所述第二测量点之间的第六光路形成所述第四夹角;The controller calculates a second angle conversion formula when the third angle is equal to the fourth angle according to the third depth map and the fourth depth map; wherein the calibration plate includes a fourth calibration point, a fifth calibration point and a sixth calibration point, the fourth calibration point corresponds to a central pixel point of the third depth map and the fourth depth map, a fourth optical path between the fourth calibration point and the second measuring point and a fifth optical path between the fifth calibration point and the second measuring point form the third angle, and a fourth optical path between the fourth calibration point and the second measuring point and a sixth optical path between the sixth calibration point and the second measuring point form the fourth angle; 根据所述第一光路、所述第二光路、所述第三光路、所述第四光路、所述第五光路和所述第六光路对应的深度值,以及所述第一角度换算公式和所述第二角度换算公式,计算所述ToF模组的各像素点与中心像素点的相对位移量,以及各像素点对应光路与所述第一方向的夹角。According to the depth values corresponding to the first optical path, the second optical path, the third optical path, the fourth optical path, the fifth optical path and the sixth optical path, and the first angle conversion formula and the second angle conversion formula, the relative displacement of each pixel point and the center pixel point of the ToF module, and the angle between the optical path corresponding to each pixel point and the first direction are calculated. 9.一种深度标定系统,其特征在于,用于标定ToF模组,所述深度标定系统包括移动组件、标定板和控制器;9. A depth calibration system, characterized in that it is used to calibrate a ToF module, and the depth calibration system includes a moving component, a calibration board and a controller; 所述控制器用于执行权利要求1-8中任一项所述的深度标定方法。The controller is used to execute the depth calibration method according to any one of claims 1 to 8. 10.一种深度标定设备,其特征在于,用于标定ToF模组,所述深度标定设备连接有移动组件,所述ToF模组固定在所述移动组件后,所述ToF模组的激光发射面与所述标定板平行;10. A depth calibration device, characterized in that it is used to calibrate a ToF module, the depth calibration device is connected to a moving component, after the ToF module is fixed to the moving component, the laser emitting surface of the ToF module is parallel to the calibration plate; 所述深度标定设备包括存储器和处理器,所述存储器与所述处理器耦合;所述存储器存储计算机执行指令;所述处理器执行所述存储器存储的计算机执行指令,使得深度标定设备执行权利要求1至8中任一项所述的深度标定方法。The depth calibration device includes a memory and a processor, the memory is coupled to the processor; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory, so that the depth calibration device performs the depth calibration method described in any one of claims 1 to 8. 11.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有计算机程序,当其在计算机上运行时,使得计算机执行如权利要求1至8中任一项所述的深度标定方法。11. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, and when the computer-readable storage medium is run on a computer, the computer is enabled to execute the depth calibration method according to any one of claims 1 to 8. 12.一种计算机程序产品,其特征在于,包括计算机程序,所述计算机程序被处理器执行时,实现如权利要求1至8中任一项所述的深度标定方法。12. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the depth calibration method according to any one of claims 1 to 8 is implemented.
CN202410267894.4A 2024-03-08 2024-03-08 Depth calibration method, depth calibration equipment and depth calibration system Active CN117876502B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410267894.4A CN117876502B (en) 2024-03-08 2024-03-08 Depth calibration method, depth calibration equipment and depth calibration system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410267894.4A CN117876502B (en) 2024-03-08 2024-03-08 Depth calibration method, depth calibration equipment and depth calibration system

Publications (2)

Publication Number Publication Date
CN117876502A true CN117876502A (en) 2024-04-12
CN117876502B CN117876502B (en) 2024-06-28

Family

ID=90594974

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410267894.4A Active CN117876502B (en) 2024-03-08 2024-03-08 Depth calibration method, depth calibration equipment and depth calibration system

Country Status (1)

Country Link
CN (1) CN117876502B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109801321A (en) * 2018-12-21 2019-05-24 杭州蓝芯科技有限公司 A kind of TOF camera depth scaling method based on programmable delay line
CN113096189A (en) * 2021-03-22 2021-07-09 西安交通大学 ITOF depth camera calibration and depth optimization method
WO2021208442A1 (en) * 2020-04-14 2021-10-21 广东博智林机器人有限公司 Three-dimensional scene reconstruction system and method, device, and storage medium
CN115423877A (en) * 2022-08-12 2022-12-02 奥比中光科技集团股份有限公司 Calibration method, calibration system, depth camera and readable storage medium
CN116758164A (en) * 2023-06-16 2023-09-15 上海大学 Analog modulated TOF camera correction method, device, system and storage medium
CN116977448A (en) * 2023-08-08 2023-10-31 光微信息科技(合肥)有限公司 Low-resolution TOF area array internal parameter calibration method, device, equipment and medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109801321A (en) * 2018-12-21 2019-05-24 杭州蓝芯科技有限公司 A kind of TOF camera depth scaling method based on programmable delay line
WO2021208442A1 (en) * 2020-04-14 2021-10-21 广东博智林机器人有限公司 Three-dimensional scene reconstruction system and method, device, and storage medium
CN113096189A (en) * 2021-03-22 2021-07-09 西安交通大学 ITOF depth camera calibration and depth optimization method
CN115423877A (en) * 2022-08-12 2022-12-02 奥比中光科技集团股份有限公司 Calibration method, calibration system, depth camera and readable storage medium
CN116758164A (en) * 2023-06-16 2023-09-15 上海大学 Analog modulated TOF camera correction method, device, system and storage medium
CN116977448A (en) * 2023-08-08 2023-10-31 光微信息科技(合肥)有限公司 Low-resolution TOF area array internal parameter calibration method, device, equipment and medium

Also Published As

Publication number Publication date
CN117876502B (en) 2024-06-28

Similar Documents

Publication Publication Date Title
JP4847872B2 (en) Calibration of surveying instrument
US6798527B2 (en) Three-dimensional shape-measuring system
CN107449374B (en) Flexible layout of vision-assisted laser galvanometer scanning system and its on-site calibration method
JP5944719B2 (en) Light distribution characteristic measuring apparatus and light distribution characteristic measuring method
US20140268178A1 (en) System and method of acquiring three dimensional coordinates using multiple coordinate measurement devices
US9418435B2 (en) Three-dimensional measurement method
US11619481B2 (en) Coordinate measuring device
CN113034612B (en) Calibration device, method and depth camera
CN108279420B (en) Laser scanning multidimensional short-distance remote sensing system and method for synchronously acquiring ground object information
US11977167B2 (en) Efficient algorithm for projecting world points to a rolling shutter image
WO2023103198A1 (en) Method and device for calculating relative extrinsic parameters of ranging system, and storage medium
CN113780349A (en) Method for acquiring training sample set, model training method and related device
CN103884334A (en) Moving target positioning method based on wide beam laser ranging and single camera
CN113465536A (en) Laser holder based on camera guide and working method thereof
CN116097306A (en) Electronic device and control method thereof
US20040036891A1 (en) Method and apparatus for calibrating laser 3D digitizing
CN117146710A (en) Dynamic projection three-dimensional reconstruction system and method based on active vision
JPH09304055A (en) Apparatus for measuring distance
CN113219441B (en) Precision verification method and device for calibration angle, equipment and storage medium
WO2021032298A1 (en) High resolution optical depth scanner
JP3941631B2 (en) Three-dimensional imaging apparatus and method
CN117876502A (en) Depth calibration method, depth calibration equipment and depth calibration system
JP2000304508A (en) Three-dimensional input device
CN117606747B (en) High-precision calibration method of laser galvanometer system
Wang et al. Distance measurement using single non-metric CCD camera

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
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: Unit 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong 518040

Patentee after: Honor Terminal Co.,Ltd.

Country or region after: China

Address before: 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong

Patentee before: Honor Device Co.,Ltd.

Country or region before: China