Method and device for calibrating depth of three-dimensional camera, computer device and storage medium

文档序号:1612734 发布日期:2020-01-10 浏览:17次 中文

阅读说明:本技术 校准三维相机深度的方法、装置、计算机装置及存储介质 (Method and device for calibrating depth of three-dimensional camera, computer device and storage medium ) 是由 王韵雯 于 2019-08-27 设计创作,主要内容包括:本发明提供一种校准三维相机深度的方法、装置、计算机装置及计算机可读存储介质,所述方法包括:获取三维相机与校准平面的距离为标准距离时各像素点第一相位值,得到使用第一相位值表示的第一深度图像;获取三维相机与校准平面的距离为测试距离时各像素点第二相位值,得到用第二相位值表示的第二深度图像;截取第二深度图像中平面物体图像区域像素点的相位值,删除非平面物体图像区域像素点的相位值;根据平面物体图像区域像素点的相位值和第一深度图像像素点的相位值计算非平面物体图像区域像素点的预测相位值;根据预测相位值和平面物体图像区域像素点的相位值校准三维相机拍摄图像的深度信息。通过所述方法使得三维相机的深度校准更加准确。(The invention provides a method, a device, a computer device and a computer readable storage medium for calibrating the depth of a three-dimensional camera, wherein the method comprises the following steps: acquiring a first phase value of each pixel point when the distance between the three-dimensional camera and the calibration plane is a standard distance, and acquiring a first depth image represented by the first phase value; acquiring a second phase value of each pixel point when the distance between the three-dimensional camera and the calibration plane is a test distance, and acquiring a second depth image represented by the second phase value; intercepting phase values of pixel points in the planar object image area in the second depth image, and deleting phase values of pixel points in the non-planar object image area; calculating a predicted phase value of a pixel point in a non-planar object image area according to the phase value of the pixel point in the planar object image area and the phase value of the pixel point in the first depth image; and calibrating the depth information of the image shot by the three-dimensional camera according to the predicted phase value and the phase value of the pixel point of the planar object image area. The method enables the depth calibration of the three-dimensional camera to be more accurate.)

1. A method of calibrating depth of a three-dimensional camera, the method comprising:

acquiring a first phase value of each pixel point when the distance between a three-dimensional camera to be calibrated and a calibration plane is a standard distance, and acquiring a first depth image represented by the first phase value;

acquiring a second phase value of each pixel point when the distance between the three-dimensional camera and the calibration plane is a test distance to obtain a second depth image represented by the second phase value, wherein the second depth image comprises a planar object image area and a non-planar object image area;

intercepting phase values of pixel points in the planar object image area in the second depth image, and deleting phase values of pixel points in the non-planar object image area;

calculating and outputting a predicted phase value of a pixel point of the non-planar object image area according to the phase value of the pixel point of the planar object image area and the phase value of the pixel point of the first depth image;

and calibrating the depth information of the image shot by the three-dimensional camera according to the predicted phase value of the pixel point of the non-planar object image area and the phase value of the pixel point of the planar object image area.

2. The method of calibrating depth of a three-dimensional camera according to claim 1, wherein the method of clipping phase values of pixel points of the planar object image area in the second depth image comprises:

searching a pixel range of a planar object image area corresponding to the testing distance in a preset database, marking the same pixel range as a planar object image area pixel point in a second depth image according to the pixel range, and marking a pixel point except the planar object image area pixel point in the second depth image as a non-planar object image area pixel point;

and when different testing distances are stored in the database, the range of the planar object image area in the depth image is stored.

3. The method of calibrating depth of a three-dimensional camera according to claim 1, wherein said calculating and outputting the predicted phase value of the non-planar object image area pixel point according to the phase value of the planar object image area pixel point and the phase value of the first depth image pixel point comprises:

searching a phase value of a pixel point corresponding to the pixel point position of the planar object image area in the first depth image;

subtracting the phase value of each pixel point at the corresponding position in the first depth image from the phase value of each pixel point in the planar object image area to obtain a difference phase information graph formed by the difference of the phase values;

dividing the difference phase value of each pixel point in the difference phase information graph by the phase value corresponding to the geometric center of the difference phase information graph to obtain a ratio phase information graph of the non-planar object image area, wherein the ratio phase information graph is formed by the ratio phase values of each pixel point in the non-planar object image area;

fitting the specific phase value of each pixel point in the non-planar object image area in the second depth image by adopting a preset fitting algorithm according to the specific phase value of each pixel point in the non-planar object image area;

carrying out inverse operation on the ratio phase information of the non-planar object image area to obtain a predicted phase value of the non-planar object image area;

and integrating and outputting the predicted phase value of each pixel point in the non-planar object image area and the phase value of each pixel point in the planar object image area.

4. The method of claim 3, wherein the step of fitting the specific phase value of each pixel in the image region of the non-planar object in the second depth image according to the specific phase value of each pixel in the image region of the non-planar object using a predetermined fitting algorithm comprises:

taking a pixel point at the geometric center of the ratio phase information graph as an origin coordinate, and establishing a two-dimensional space rectangular coordinate system along the horizontal direction and the vertical direction, wherein the ratio phase value of the origin of the coordinate is 1;

acquiring four groups of ratio phase value data on the horizontal and vertical coordinate axes in a non-planar object image area along the origin coordinates of the central point of the rectangular coordinate axis along the horizontal and vertical coordinate axes respectively;

respectively fitting the ratio phase values on the horizontal and vertical coordinate axes in the non-planar object image area to obtain the ratio phase values on the coordinate axes in the non-planar object image area in a non-linear fitting manner;

and respectively multiplying each point in the horizontal coordinate in the non-planar object image area with each point in the vertical coordinate in the non-planar object image area to obtain a specific phase value of the corresponding position of the non-planar object image area.

5. The method of calibrating depth of a three-dimensional camera according to claim 4, wherein the step of inverting the ratio phase information of the image region of the non-planar object to obtain the predicted phase value of the image region of the non-planar object comprises:

multiplying the ratio phase value of each pixel point in the non-planar object image area by the difference phase value of the geometric center of the difference phase information graph to obtain the difference phase value of each pixel point in the non-planar object image area;

and adding the difference phase value of each pixel point in the non-planar object image area to the pixel point phase value of the position, corresponding to the non-planar object image area, in the non-planar object image area in the first depth image to obtain the predicted phase value of each pixel point in the non-planar object image area.

6. The method of calibrating depth of a three-dimensional camera according to claim 3, wherein the method of integrating and outputting the predicted phase value of each pixel of the non-planar object image area and the phase value of each pixel of the planar object image area comprises:

and acquiring a predicted phase value of each pixel point in the non-planar object image area, correspondingly storing the predicted phase value in the second depth image according to the position of the pixel point in the non-planar object image area, wherein the calibrated second depth image comprises the phase value of the pixel point in the planar object image area and the predicted phase value of the pixel point in the non-planar object image area, and further correcting the depth by using the phase value in the calibrated second depth image.

7. An apparatus for calibrating a depth of a three-dimensional camera, the apparatus comprising:

the device comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a first phase value of each pixel point when the distance between a three-dimensional camera to be calibrated and a calibration plane is a standard distance to obtain a first depth image represented by the first phase value;

a second obtaining module, configured to obtain a second phase value of each pixel point when a distance between the three-dimensional camera and the calibration plane is a test distance, to obtain a second depth image represented by the second phase value, where the second depth image includes a planar object image area and a non-planar object image area;

the intercepting module is used for intercepting the phase value of the pixel point in the planar object image area in the second depth image and deleting the phase value of the pixel point in the non-planar object image area;

the calculation module is used for calculating and outputting a predicted phase value of the non-planar object image area pixel point according to the phase value of the planar object image area pixel point and the phase value of the first depth image pixel point;

and the calibration module is used for calibrating the depth information of the image shot by the three-dimensional camera according to the predicted phase value of the pixel point of the non-planar object image area and the phase value of the pixel point of the planar object image area.

8. The apparatus of claim 7, wherein the method of calculating and outputting the predicted phase value of the non-planar object image area pixel point according to the phase value of the planar object image area pixel point and the phase value of the first depth image pixel point comprises:

searching a phase value of a pixel point corresponding to the pixel point position of the planar object image area in the first depth image;

subtracting the phase value of each pixel point at the corresponding position in the first depth image from the phase value of each pixel point in the planar object image area to obtain a difference phase information graph formed by the difference of the phase values;

dividing the difference phase value of each pixel point in the difference phase information graph by the phase value corresponding to the geometric center of the difference phase information graph to obtain a ratio phase information graph of the non-planar object image area, wherein the ratio phase information graph is formed by the ratio phase values of each pixel point in the non-planar object image area;

fitting the specific phase value of each pixel point in the non-planar object image area in the second depth image by adopting a preset fitting algorithm according to the specific phase value of each pixel point in the non-planar object image area;

carrying out inverse operation on the ratio phase information of the non-planar object image area to obtain a predicted phase value of the non-planar object image area;

and integrating and outputting the predicted phase value of each pixel point in the non-planar object image area and the phase value of each pixel point in the planar object image area.

9. A computer device, characterized by: the computer arrangement comprises a processor for implementing the method of calibrating a depth of a three-dimensional camera according to any one of claims 1-6 when executing a computer program stored in a memory.

10. A computer-readable storage medium having stored thereon a computer program, characterized in that: the computer program, when executed by a processor, implements a method of calibrating depth of a three-dimensional camera as claimed in any one of claims 1-6.

Technical Field

The invention relates to the field of three-dimensional camera calibration, in particular to a method for calibrating the depth of a three-dimensional camera, a device for calibrating the depth of the three-dimensional camera, a computer device and a computer storage medium.

Background

The three-dimensional camera can detect the depth of field distance of a shooting space, and with the gradual development of technologies such as machine vision and automatic driving, the three-dimensional camera is adopted to carry out object recognition, behavior recognition and scene modeling more and more related applications. The three-dimensional camera obtains the distance between an object and the camera by measuring the flight time of light, and specifically obtains the exact target object distance by continuously emitting laser pulses to the object through the three-dimensional camera, receiving reflected light through a sensor and detecting the round trip time of the laser pulses. However, since the speed of the laser is very fast, it is difficult to implement the time of flight by direct photometry, and the measurement of the distance between the object and the three-dimensional camera is generally achieved by detecting the phase shift of the light wave. The existing three-dimensional camera needs to calibrate the measurement depth of the camera before leaving the factory, and the existing method is to judge whether the measurement of the three-dimensional camera on the depth information is accurate or not through phase values between each pixel point in images to be measured with different known distances and the three-dimensional camera. However, in actual calibration, due to the limitation of the size of the image to be measured, when the measurement distance exceeds the preset distance, the information of the obtained test picture may include non-planar information, for example, information of a ceiling, a ground surface, and an adjacent wall surface other than the test picture, and the obtained image information includes the non-planar information, so that the depth information obtained by the three-dimensional camera is inaccurate, and the purpose of calibrating the depth of the three-dimensional camera cannot be achieved.

Disclosure of Invention

In view of the foregoing, there is a need for a method and apparatus for calibrating a depth of a three-dimensional camera, a computer apparatus and a computer readable storage medium, which can reduce the influence of non-planar image information on a calibration result during the process of calibrating the depth of the three-dimensional camera.

A first aspect of the present application provides a method of calibrating a depth of a three-dimensional camera, the method comprising:

acquiring a first phase value of each pixel point when the distance between a three-dimensional camera to be calibrated and a calibration plane is a standard distance, and acquiring a first depth image represented by the first phase value;

acquiring a second phase value of each pixel point when the distance between the three-dimensional camera and the calibration plane is a test distance to obtain a second depth image represented by the second phase value, wherein the second depth image comprises a planar object image area and a non-planar object image area;

intercepting phase values of pixel points in the planar object image area in the second depth image, and deleting phase values of pixel points in the non-planar object image area;

calculating and outputting a predicted phase value of a pixel point of the non-planar object image area according to the phase value of the pixel point of the planar object image area and the phase value of the pixel point of the first depth image;

and calibrating the depth information of the image shot by the three-dimensional camera according to the predicted phase value of the pixel point of the non-planar object image area and the phase value of the pixel point of the planar object image area.

Preferably, the method for intercepting the phase values of the pixel points in the planar object image area in the second depth image comprises:

searching a pixel range of a planar object image area corresponding to the testing distance in a preset database, marking the same pixel range as a planar object image area pixel point in a second depth image according to the pixel range, and marking a pixel point except the planar object image area pixel point in the second depth image as a non-planar object image area pixel point;

and when different testing distances are stored in the database, the range of the planar object image area in the depth image is stored.

Preferably, the method for calculating and outputting the predicted phase value of the non-planar object image area pixel point according to the phase value of the planar object image area pixel point and the phase value of the first depth image pixel point includes:

searching a phase value of a pixel point corresponding to the pixel point position of the planar object image area in the first depth image;

subtracting the phase value of each pixel point at the corresponding position in the first depth image from the phase value of each pixel point in the planar object image area to obtain a difference phase information graph formed by the difference of the phase values;

dividing the difference phase value of each pixel point in the difference phase information graph by the phase value corresponding to the geometric center of the difference phase information graph to obtain a ratio phase information graph of the non-planar object image area, wherein the ratio phase information graph is formed by the ratio phase values of each pixel point in the non-planar object image area;

fitting the specific phase value of each pixel point in the non-planar object image area in the second depth image by adopting a preset fitting algorithm according to the specific phase value of each pixel point in the non-planar object image area;

carrying out inverse operation on the ratio phase information of the non-planar object image area to obtain a predicted phase value of the non-planar object image area;

and integrating and outputting the predicted phase value of each pixel point in the non-planar object image area and the phase value of each pixel point in the planar object image area.

Preferably, the step of fitting the ratio phase value of each pixel point in the non-planar object image region in the second depth image by using a preset fitting algorithm according to the ratio phase value of each pixel point in the non-planar object image region includes:

taking a pixel point at the geometric center of the ratio phase information graph as an origin coordinate, and establishing a two-dimensional space rectangular coordinate system along the horizontal direction and the vertical direction, wherein the ratio phase value of the origin of the coordinate is 1;

acquiring four groups of ratio phase value data on the horizontal and vertical coordinate axes in a non-planar object image area along the origin coordinates of the central point of the rectangular coordinate axis along the horizontal and vertical coordinate axes respectively;

respectively fitting the ratio phase values on the horizontal and vertical coordinate axes in the non-planar object image area to obtain the ratio phase values on the coordinate axes in the non-planar object image area in a non-linear fitting manner;

and respectively multiplying each point in the horizontal coordinate in the non-planar object image area with each point in the vertical coordinate in the non-planar object image area to obtain a specific phase value of the corresponding position of the non-planar object image area.

Preferably, the step of performing an inverse operation on the ratio phase information of the non-planar object image area to obtain a predicted phase value of the non-planar object image area includes:

multiplying the ratio phase value of each pixel point in the non-planar object image area by the difference phase value of the geometric center of the difference phase information graph to obtain the difference phase value of each pixel point in the non-planar object image area;

and adding the difference phase value of each pixel point in the non-planar object image area to the pixel point phase value of the position, corresponding to the non-planar object image area, in the non-planar object image area in the first depth image to obtain the predicted phase value of each pixel point in the non-planar object image area.

Preferably, the method for integrating and outputting the predicted phase value of each pixel point in the non-planar object image region and the phase value of each pixel point in the planar object image region includes:

and acquiring a predicted phase value of each pixel point in the non-planar object image area, correspondingly storing the predicted phase value in the second depth image according to the position of the pixel point in the non-planar object image area, wherein the calibrated second depth image comprises the phase value of the pixel point in the planar object image area and the predicted phase value of the pixel point in the non-planar object image area, and further correcting the depth by using the phase value in the calibrated second depth image.

A second aspect of the present application provides an apparatus for calibrating a depth of a three-dimensional camera, the apparatus comprising:

the device comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a first phase value of each pixel point when the distance between a three-dimensional camera to be calibrated and a calibration plane is a standard distance to obtain a first depth image represented by the first phase value;

a second obtaining module, configured to obtain a second phase value of each pixel point when a distance between the three-dimensional camera and the calibration plane is a test distance, to obtain a second depth image represented by the second phase value, where the second depth image includes a planar object image area and a non-planar object image area;

the intercepting module is used for intercepting the phase value of the pixel point in the planar object image area in the second depth image and deleting the phase value of the pixel point in the non-planar object image area;

the calculation module is used for calculating and outputting a predicted phase value of the non-planar object image area pixel point according to the phase value of the planar object image area pixel point and the phase value of the first depth image pixel point;

and the calibration module is used for calibrating the depth information of the image shot by the three-dimensional camera according to the predicted phase value of the pixel point of the non-planar object image area and the phase value of the pixel point of the planar object image area.

A third aspect of the application provides a computer arrangement comprising a processor for implementing the method of calibrating a depth of a three-dimensional camera as described above when executing a computer program stored in a memory.

A fourth aspect of the present application provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a method of calibrating depth of a three-dimensional camera as described above.

The method for calibrating the depth of the three-dimensional camera calculates the phase value of the pixel point of the image area of the non-planar object by a mathematical method according to the phase value of the image area of the non-planar object in the picture to be tested, obtains the depth information of each pixel point on the test image through the phase values of the pixel points of the image area of the non-planar object and the image area of the non-planar object, and completes the depth calibration of the three-dimensional camera by using the depth information, so that the depth calibration of the three-dimensional camera is more accurate.

Drawings

Fig. 1 is a schematic diagram of an application environment architecture of a method for calibrating a depth of a three-dimensional camera according to an embodiment of the present invention.

Fig. 2 is a schematic view of an application scenario of a method for calibrating a depth of a three-dimensional camera according to an embodiment of the present invention.

Fig. 3 is a flowchart of a method for calibrating a depth of a three-dimensional camera according to a second embodiment of the present invention.

Fig. 4 is a rectangular coordinate diagram of a ratio depth information map for calibrating the depth of a three-dimensional camera according to a second embodiment of the present invention.

Fig. 5 is a schematic structural diagram of an apparatus for calibrating a depth of a three-dimensional camera according to a third embodiment of the present invention.

Fig. 6 is a schematic diagram of a computer device according to a fourth embodiment of the present invention.

Detailed Description

In order that the above objects, features and advantages of the present invention can be more clearly understood, a detailed description of the present invention will be given below with reference to the accompanying drawings and specific embodiments. It should be noted that the embodiments and features of the embodiments of the present application may be combined with each other without conflict.

In the following description, numerous specific details are set forth to provide a thorough understanding of the present invention, and the described embodiments are merely a subset of the embodiments of the present invention, rather than a complete embodiment. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.

Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention.

23页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:雷达与组合导航系统的联合标定方法、装置、设备及介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!