WO2022000147A1 - Depth image processing method and device - Google Patents

Depth image processing method and device Download PDF

Info

Publication number
WO2022000147A1
WO2022000147A1 PCT/CN2020/098640 CN2020098640W WO2022000147A1 WO 2022000147 A1 WO2022000147 A1 WO 2022000147A1 CN 2020098640 W CN2020098640 W CN 2020098640W WO 2022000147 A1 WO2022000147 A1 WO 2022000147A1
Authority
WO
WIPO (PCT)
Prior art keywords
matrix
depth image
pixel
depth
fitted
Prior art date
Application number
PCT/CN2020/098640
Other languages
French (fr)
Chinese (zh)
Inventor
周鸿彬
武雪飞
罗鹏飞
唐样洋
董晨
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Priority to CN202080101640.5A priority Critical patent/CN115667989A/en
Priority to PCT/CN2020/098640 priority patent/WO2022000147A1/en
Publication of WO2022000147A1 publication Critical patent/WO2022000147A1/en

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01SRADIO DIRECTION-FINDING; RADIO NAVIGATION; DETERMINING DISTANCE OR VELOCITY BY USE OF RADIO WAVES; LOCATING OR PRESENCE-DETECTING BY USE OF THE REFLECTION OR RERADIATION OF RADIO WAVES; ANALOGOUS ARRANGEMENTS USING OTHER WAVES
    • G01S17/00Systems using the reflection or reradiation of electromagnetic waves other than radio waves, e.g. lidar systems
    • G01S17/02Systems using the reflection of electromagnetic waves other than radio waves
    • G01S17/06Systems determining position data of a target
    • G01S17/08Systems determining position data of a target for measuring distance only

Definitions

  • the n initial depth images are the depth images obtained in the first situation, and the first situation includes the start-up moment of the light source of the photographing device and the photographing device.
  • the startup moments of the sensor are different moments, and the preprocessing includes mean value processing according to the n initial depth images, where n is an integer greater than 1.
  • the deep nonlinear error is a nonlinear error caused by the waveform of the optical signal not being a standard waveform (for example, not a standard sine wave, etc.), and the error amount of the nonlinear error is similar to a sine wave, which oscillates with the change of distance. Positive and negative. Therefore, in the present application, the positive and negative error amounts in the nonlinear error can cancel each other by sampling multiple times under the condition that the light source of the photographing device is started later than the sensor and performing averaging processing according to the above-mentioned n initial depth images. , which can reduce the depth nonlinear error introduced in the measurement process.
  • the above-mentioned field of view phase correction coefficient matrix is calculated and obtained according to n fitted depth images, including: the above-mentioned field of view phase correction coefficient matrix is the result of fitting a plurality of pixel values in the average pixel matrix.
  • a ratio matrix obtained by taking the ratio between the minimum value and each pixel value of the fitted average pixel matrix, where the fitted average pixel matrix is obtained by averaging the pixel matrices of the above n fitted depth images.
  • the execution subject of the depth image processing method provided by the present application may be the above-mentioned photographing device or another photographing device other than the above-mentioned photographing device, and the above-mentioned photographing device or the other photographing device stores the data of the above-mentioned FPN matrix.
  • the fixed pattern noise FPN can also be called pixel fixed noise.
  • the manufacturing process, reading order, and circuit design of each pixel are not exactly the same, so errors between different pixels will be introduced.
  • the fixed pattern noise of each pixel caused by the hardware of the photographing device can also be corrected.
  • the two characteristics of periodic oscillation and zero sum (the sum of errors in a complete cycle) of the depth nonlinear error are utilized.
  • the sum of the times of multiple delays is an integer multiple of the period of the sampling optical signal, and then the pixel matrix of the depth image obtained by these multiple delays is averaged to achieve the effect of reducing the depth nonlinear error, thereby improving the obtained field of view.
  • Accuracy of the phase correction coefficient matrix Therefore, the field of view phase correction coefficient matrix of the depth image obtained by the present application can correct the field of view phase error of each pixel value in the depth image obtained by the photographing device, thereby reducing the distortion rate of the depth image and improving the quality of the depth image.
  • the initial depth image obtained for the i-th time is the i-th initial depth image; the above-mentioned acquisition of n initial depth images includes:
  • n measurement depth images obtained by the actual measurement of the above-mentioned shooting equipment n times by the time-of-flight TOF ranging method and the i-th measurement depth image in the n measurement depth images is represented by a pixel matrix Di(x, y)';
  • the above-mentioned calculation to obtain a field of view phase correction coefficient matrix after performing mean value processing according to the above-mentioned n fitted depth images including:
  • the method further includes:
  • the field of view phase correction coefficient matrix is calculated and obtained according to n fitted depth images, the n fitted depth images are obtained by performing surface fitting on the n initial depth images respectively, and the n initial depth images are based on the shooting equipment
  • the depth image of the second object obtained by the time-of-flight TOF ranging method for n times, the start-up time of the light source at the i-th time in the n times is delayed (i-1)* ⁇ t from the start-up time of the sensor, and the value of i is
  • the initial depth image obtained for the i-th time is the i-th initial depth image
  • the i-th initial depth image is represented by a pixel matrix Di(x, y)
  • the pixel matrix Di(x, y) is the sum of each pixel value in the pixel matrix Di(x, y)' and c*[(1-i)* ⁇ t]/2
  • the Di(x, y)' is the i-th measurement
  • the pixel matrix of the obtained depth image, the c*[(1-i)* ⁇ t]/2 is the distance difference generated by the (i-1)* ⁇ t caused by the activation time of the light source being delayed from the activation time of the sensor.
  • the difference matrix is a fixed pattern noise FPN matrix.
  • Each value in the FPN matrix includes the difference between the The fixed noise for pixels with the same index for each value.
  • the n initial depth images are the depth images obtained in the first situation, and the first situation includes the start-up moment of the light source of the photographing device and the photographing device.
  • the start-up moments of are different moments, and the preprocessing includes mean value processing according to the n initial depth images, where n is an integer greater than 1.
  • the field of view phase correction coefficient matrix is calculated to obtain a field of view phase correction coefficient matrix after averaging the n fitted depth images, and the field of view phase correction coefficient matrix is used to correct the field of view phase error of the depth image obtained by the above-mentioned photographing device through the above-mentioned TOF ranging method.
  • the above-mentioned difference matrix is a fixed pattern noise FPN matrix, and each value in the FPN matrix respectively includes the depth image caused by hardware and The fixed noise for pixels with the same index for each value.
  • the present application provides a computer program product, when the computer program product is read and executed by a computer, the method described in any one of the above-mentioned second aspects will be executed.
  • the calculation of the depth value based on the measurement data obtained by the TOF ranging method may be performed in the above-mentioned photographing device 101, or the photographing device 101 may obtain these measurement data. These measurement data are then sent to other devices, such as servers in the cloud, for depth value calculation.
  • the controller 1012 can also be used for delay control, the function of which is to adjust the time difference between the activation of the light source 1011 and the sensor 1013, which can be used for various calibrations.
  • the controller 1012 can be a control circuit in an integrated chip, the principle of which is to use a resistor-capacitor RC circuit to generate a delay.
  • the controller 1012 can make the light source 1011 start later than the sensor 1013 or start earlier than the sensor 1013 through the RC circuit.
  • the controller may also be a control unit implemented by software, and the time difference between the activation of the light source 1011 and the sensor 1013 is adjusted by software logic.
  • the present application provides a depth image processing method, which can correct the field of view phase error of the depth image through the field of view phase correction coefficient matrix and/or use the FPN matrix to correct the field of view phase error of the depth image.
  • the fixed pattern noise is reduced, so that the distortion rate of the obtained depth image can be greatly reduced, and the quality of the depth image can be improved.
  • the ⁇ t may be a positive number or a negative number.
  • the activation time of the light source is delayed (i-1)* ⁇ t from the activation time of the sensor, which means that the sensor is activated earlier than the light source by (i-1)* ⁇ t; when the ⁇ t is a negative number.
  • the activation time of the light source is delayed by (i-1)* ⁇ t from the activation time of the sensor, which means that the light source is activated earlier than the sensor by (i-1)*(- ⁇ t) time.
  • the ⁇ t can be any value other than 0.
  • the light source and the sensor are the light source and the sensor in the photographing device, for example, the light source 1011 and the sensor 1013 shown in FIG. 1 .
  • the light source starts to emit light signals, that is, the start time of the light source is the first second; at the second second, the sensor begins to receive the reflected light signal, that is, the start time of the sensor is the first second. 2 seconds; at 3 seconds, the sensor begins to receive reflected light signals.
  • the sensor can start to receive the reflected light signal at the second second, but the reflected light signal has not yet transmitted to the sensor, so the sensor does not receive the reflected light signal at the second second.
  • the activation timing of the above-mentioned light sources and sensors may be controlled by a controller, and the controller may be the controller 1012 described in FIG. 1 . That is, the controller can use the resistor-capacitor RC circuit to generate a delay or use software to generate a delay, so that the light source can be started later than the sensor by (i-1)* ⁇ t.
  • the above-mentioned delay in starting the light source from the sensor means that the time when the light source starts to emit the light signal is delayed from the time when the sensor starts to receive the reflected light signal.
  • the light source starts earlier than the sensor means that the time when the light source starts to emit the light signal is earlier than the time when the sensor starts to receive the reflected light signal.
  • the i-th initial depth image finally calculated based on the i-th measurement can be represented by a pixel matrix Di(x, y).
  • the Di(x, y) is the i-th initial depth image
  • the The pixel matrix Di(x,y) is obtained by adding each pixel value in the pixel matrix Di(x,y)' and c*[(1-i)* ⁇ t]/2 respectively.
  • the pixel matrix Di(x,y) is obtained by subtracting each pixel value in the pixel matrix Di(x,y)' from c*[(i-1)* ⁇ t]/2 respectively.
  • the above-mentioned surface fitting method may be a polynomial surface fitting method of least squares or a surface fitting method using other fitting functions.
  • the approximate function type of the image can be roughly judged according to these pixel matrices.
  • drawing software or simulation software can be used to draw or simulate the scatter images corresponding to these pixel matrices.
  • the approximate function type of the scatter image according to experience.
  • the function can be used to fit the n initial depth images respectively to obtain n fitted depth images.
  • the deep nonlinear error has two characteristics: periodic oscillation and 0 and 0.
  • the above measurement sampling process from Df1(x,y) to Dfn(x,y) happens to include the complete periodic oscillation. Therefore, the n fitted depth images Df1(x,y) ⁇ Dfn(x,y) are averaged to obtain Dfa(x,y), which can cancel the nonlinear periodic oscillations and reduce the depth nonlinearity error.
  • the above-mentioned FPN matrix can also be calculated in the following manner:
  • the difference matrix S2(x, y)' may also be an FPN matrix.
  • the above-mentioned field of view phase correction coefficient matrix and FPN matrix can be obtained by training to obtain one of the matrices. For example, if you want to correct the field of view phase error in the depth image, you can train to obtain the field of view phase correction coefficient matrix; if you want to reduce the fixed pattern noise in the depth image, you can train to obtain the FPN matrix. Of course, if you want to correct the field of view phase error in the depth image and reduce the fixed pattern noise in the depth image at the same time, then both the field of view phase correction coefficient matrix and the FPN matrix can be obtained by training.
  • the initial average depth image Da(x,y)' is obtained by averaging, and then the minimum value d0' in the Da(x,y)' is extracted, and the point corresponding to the minimum value d0' can be the distance from the shooting device in the shooting object.
  • the point within the closest area of the lens For example, it may be point A in the above-mentioned FIG. 3 or a point in the area near point A.
  • the ratio matrix S1(x,y)" is The above field of view phase correction coefficient matrix.
  • a field-of-view phase correction coefficient matrix may also be used.
  • the first object may be any object photographed by the photographing device, and may be a plane object, a three-dimensional object, or a space object, and so on.
  • the first depth image may also be the first initial depth image D1(x, y) or the like in the training process described in FIG. 2 . This program does not limit the specific shooting objects.
  • the n fitted depth images are obtained by performing surface fitting on the above n initial depth images respectively, and the n initial depth images are obtained by the time-of-flight TOF ranging method n times based on the above-mentioned training shooting equipment.
  • Depth image, the second object is the plane used for the above training
  • the starting time of the light source at the i-th time in the n times is delayed (i-1)* ⁇ t from the starting time of the sensor
  • the field-of-view phase correction coefficient matrix in S502 may be the above-mentioned S1(x,y)'. Then, the field of view phase correction coefficient matrix S1(x, y)' is calculated and obtained according to the above-mentioned n fitted depth images. Specifically, the field of view phase correction coefficient matrix is each pixel value of the fitted average pixel matrix and the A ratio matrix obtained by taking the minimum value of the multiple pixel values in the fitted average pixel matrix is obtained by taking the ratio respectively. Other descriptions are the same as those for the field of view phase correction coefficient matrix S1(x, y), and are not repeated here.
  • the value of the same subscript in S1(x,y)' and the above S1(x,y) are reciprocals of each other, so the ratio matrix and the above product
  • the matrix DS(x, y) may be the same matrix, and the ratio matrix may be represented by DS(x, y), that is, the second depth image may be represented by DS(x, y).
  • obtaining the third depth image by compensating the depth value of each pixel in the second depth image by the fixed pattern noise FPN matrix is specifically: in the case that the matrix DS(x, y) is obtained by calculating the above S502, calculating the matrix DS The difference between (x, y) and the FPN matrix S2(x, y)' obtains the difference matrix Dc(x, y)" as the third depth image, and the specific calculation formula is:
  • correction unit 702 is also used for:
  • the second depth image is obtained by separately calculating the product of the pixel matrix of the first depth image and the pixel value of the same subscript in the field of view phase correction coefficient matrix.
  • the difference matrix is a fixed pattern noise FPN matrix.
  • Each value in the FPN matrix includes the difference between the The fixed noise for pixels with the same index for each value.
  • the device is a chip or a System on a Chip (SoC).
  • SoC System on a Chip
  • An embodiment of the present application further provides an apparatus, where the apparatus includes a processor and a communication interface, and the apparatus is configured to execute the method described in FIG. 5 or FIG. 6 and possible embodiments thereof.
  • first, second and other words are used to distinguish the same or similar items with basically the same function and function, and it should be understood that between “first”, “second” and “nth” There are no logical or timing dependencies, and no restrictions on the number and execution order. It will also be understood that, although the following description uses the terms first, second, etc. to describe various elements, these elements should not be limited by the terms. These terms are only used to distinguish one element from another. For example, a first image may be referred to as a second image, and, similarly, a second image may be referred to as a first image, without departing from the scope of various described examples. Both the first image and the second image may be images, and in some cases, may be separate and distinct images.
  • the size of the sequence number of each process does not mean the sequence of execution, and the execution sequence of each process should be determined by its function and internal logic, and should not be used in the embodiment of the present application. Implementation constitutes any limitation.

Abstract

Provided are a depth image processing method and a device. The method comprises: acquiring a first depth image of a first object; and supplementing and correcting a depth value of a pixel in the first depth image by means of a field-of-view phase supplementation and correction coefficient matrix to obtain a second depth image, wherein the field-of-view phase supplementation and correction coefficient matrix is a matrix that is obtained after preprocessing n initial depth images and is used for supplementing and correcting a field-of-view phase error, the n initial depth images are depth images obtained in a first case, the first case is that a starting time of a light source of a photographing device is different from a starting time of a sensor of the photographing device, preprocessing comprises mean processing performed according to the n initial depth images, and n is an integer greater than 1. By using the embodiments of the present application, the distortion rate of a depth image can be reduced.

Description

深度图像处理方法及设备Depth image processing method and device 技术领域technical field
本发明涉及图像处理技术领域,尤其涉及一种深度图像处理方法及设备。The present invention relates to the technical field of image processing, and in particular, to a depth image processing method and device.
背景技术Background technique
深度图像(depth image)是指将从图像采集器到场景中各点的垂直距离(深度)作为像素值的图像,它直接反映了景物可见表面的几何形状。深度图像的获取方法有激光雷达深度成像法、计算机立体视觉成像、坐标测量机法、莫尔条纹法、结构光法等等。深度图像是物体的三维表示形式,一般通过立体照相机或者飞行时间(time of flight,TOF)相机等获取。但是,通过TOF相机获取的深度图存在误差,这些误差的来源主要有:Depth image refers to the image with the vertical distance (depth) from the image collector to each point in the scene as the pixel value, which directly reflects the geometry of the visible surface of the scene. The acquisition methods of depth images include lidar depth imaging method, computer stereo vision imaging, coordinate measuring machine method, Moiré fringe method, structured light method and so on. A depth image is a three-dimensional representation of an object, which is generally acquired by a stereo camera or a time of flight (TOF) camera. However, there are errors in the depth map obtained by the TOF camera. The main sources of these errors are:
深度非线性误差:当主动式光源与TOF传感器的发射波不是完美的正弦波时,TOF所测得的深度值会产生非线性误差。非线性误差在不同的距离下有不同的误差值。以方波为例:其误差量类似于正弦波,随距离改变而震荡,且具备周期重复性。Depth nonlinear error: When the emission wave of the active light source and TOF sensor is not a perfect sine wave, the depth value measured by TOF will produce nonlinear error. Nonlinear errors have different error values at different distances. Take a square wave as an example: its error amount is similar to that of a sine wave, oscillating with distance changes, and has periodic repeatability.
视场相位误差:时间测距系统使用飞行时间差来计算距离,因此测得的信息实际上是图像采集器与像素点之间的直线距离,而非Z轴的深度即不是图像采集器与像素点之间的垂直距离。该视场相位误差即为该垂直距离与直线距离之间的误差。Field of view phase error: The time ranging system uses the time-of-flight difference to calculate the distance, so the measured information is actually the straight-line distance between the image collector and the pixel, not the depth of the Z axis, which is not the image collector and the pixel. vertical distance between. The field of view phase error is the error between the vertical distance and the straight-line distance.
现有技术中有利用镜头参数计算视场,再利用余弦值补正视场相位误差的技术方案,但是该方案中只对视场相位误差进行补正,没有考虑到深度非线性误差的残余,获得的深度图像失真率较高。综上所述,如何补正深度图像的视场相位误差的同时又可以消减深度非线性误差以降低深度图像的失真率是本领域技术人员急需解决的技术问题。In the prior art, there is a technical scheme of calculating the field of view using lens parameters, and then using the cosine value to correct the field of view phase error. Depth image distortion rate is high. To sum up, how to correct the FOV phase error of the depth image and at the same time reduce the depth nonlinear error to reduce the distortion rate of the depth image is a technical problem that those skilled in the art need to solve urgently.
发明内容SUMMARY OF THE INVENTION
本申请提供一种深度图像处理方法及设备,能够补正深度图像的视场相位误差的同时又可以消减深度非线性误差以降低深度图像的失真率。The present application provides a depth image processing method and device, which can correct the field of view phase error of the depth image and at the same time reduce the depth nonlinear error to reduce the distortion rate of the depth image.
第一方面,本申请提供一种深度图像处理方法,该方法包括:In a first aspect, the present application provides a depth image processing method, the method comprising:
获取第一对象的第一深度图像;并通过视场相位补正系数矩阵对该第一深度图像中像素的深度值补正获得第二深度图像,其中,该视场相位补正系数矩阵为对n个初始深度图像预处理后获得的用于补正视场相位误差的矩阵,该n个初始深度图像为在第一情况下获得的深度图像,该第一情况包括拍摄设备的光源的启动时刻与该拍摄设备的传感器的启动时刻为不同时刻,该预处理包括根据该n个初始深度图像所做的均值处理,该n为大于1的整数。Obtain the first depth image of the first object; and obtain a second depth image by correcting the depth value of the pixel in the first depth image by a field of view phase correction coefficient matrix, wherein the field of view phase correction coefficient matrix is a pair of n initial The matrix used to correct the phase error of the field of view obtained after the depth image preprocessing, the n initial depth images are the depth images obtained in the first situation, and the first situation includes the start-up moment of the light source of the photographing device and the photographing device. The startup moments of the sensor are different moments, and the preprocessing includes mean value processing according to the n initial depth images, where n is an integer greater than 1.
具体的,上述视场相位补正系数矩阵用于消减上述第一深度图像中每个像素的深度值的视场相位误差。该视场相位误差为由于视场的角度偏差导致的误差。Specifically, the above-mentioned field of view phase correction coefficient matrix is used to reduce the field of view phase error of the depth value of each pixel in the above-mentioned first depth image. The field of view phase error is an error due to the angular deviation of the field of view.
上述n个初始深度图像的大小均相同,即该n个初始深度图像的像素矩阵为n个行数相等且列数相等的矩阵。The sizes of the above n initial depth images are all the same, that is, the pixel matrices of the n initial depth images are n matrices with the same number of rows and the same number of columns.
本申请提供的深度图像处理方法的执行主体可以是上述拍摄设备或者上述拍摄设备以外的其它拍摄设备,该上述拍摄设备或者该其它拍摄设备中存储有上述视场相位补正系数 矩阵的数据。The execution subject of the depth image processing method provided by the present application may be the above-mentioned photographing device or another photographing device other than the above-mentioned photographing device, and the above-mentioned photographing device or the other photographing device stores the data of the above-mentioned field of view phase correction coefficient matrix.
需要说明的是,在本申请中,上述光源的启动时刻又可以称为光源开始发射光信号的时刻,上述传感器的启动时刻又可以称为传感器开始能够接收反射光信号的时刻。It should be noted that, in the present application, the activation time of the light source can also be referred to as the time when the light source starts to emit light signals, and the activation time of the sensor can also be referred to as the time when the sensor starts to receive reflected light signals.
深度非线性误差是由于光信号的波形不是标准波形(例如不是标准的正弦波等)导致的非线性误差,且该非线性误差的误差量类似于正弦波,随距离改变而震荡,误差量有正有负。因此,在本申请中,通过多次在拍摄设备的光源比传感器延迟启动的情况下采样以及根据上述n个初始深度图像所做的均值处理,使得非线性误差中正负的误差量可以互相抵消,从而可以减少测量过程中引入的深度非线性误差。同时基于该采样和均值处理等操作得到的视场相位补正系数矩阵可以补正深度图像中每个像素的深度值,减少了视场相位造成的误差,从而极大地降低了最终得到的深度图像的失真率,提高深度图像的质量。The deep nonlinear error is a nonlinear error caused by the waveform of the optical signal not being a standard waveform (for example, not a standard sine wave, etc.), and the error amount of the nonlinear error is similar to a sine wave, which oscillates with the change of distance. Positive and negative. Therefore, in the present application, the positive and negative error amounts in the nonlinear error can cancel each other by sampling multiple times under the condition that the light source of the photographing device is started later than the sensor and performing averaging processing according to the above-mentioned n initial depth images. , which can reduce the depth nonlinear error introduced in the measurement process. At the same time, the field of view phase correction coefficient matrix obtained based on the sampling and averaging processing can correct the depth value of each pixel in the depth image, reduce the error caused by the field of view phase, and greatly reduce the distortion of the final depth image. rate to improve the quality of the depth image.
在其中一种可能的实施方式中,上述预处理还包括曲面拟合处理,上述视场相位补正系数矩阵为根据n个拟合深度图像计算获得,该n个拟合深度图像由上述n个初始深度图像分别进行曲面拟合获得,上述n个初始深度图像为基于上述拍摄设备n次通过飞行时间TOF测距法获得的第二对象的深度图像,该n次中第i次的光源的启动时刻比传感器的启动时刻延迟(i-1)*Δt,该i的取值范围为[1,n],n*︱Δt︱=k*T,该T为该光信号的周期,该k为整数,该Δt为预设时长。In one possible implementation manner, the preprocessing further includes surface fitting processing, and the field of view phase correction coefficient matrix is calculated and obtained according to n fitted depth images, and the n fitted depth images are obtained from the n initial The depth images are respectively obtained by surface fitting, and the n initial depth images are the depth images of the second object obtained by the time-of-flight TOF ranging method n times based on the above-mentioned shooting equipment, and the start time of the i-th light source in the n times Delay (i-1)*Δt from the start time of the sensor, the value range of the i is [1, n], n*︱Δt︱=k*T, the T is the period of the optical signal, and the k is an integer , the Δt is a preset duration.
上述n*︱Δt︱=k*T表明,n次延迟的总时间量是光源发出的光信号的周期的整数倍。上述n个拟合深度图像的大小均相同,即该n个拟合深度图像的像素矩阵为n个行数相等且列数相等的矩阵。另外,该n个拟合深度图像的大小与上述n个初始深度图像的大小相同,即该n个初始深度图像的像素矩阵和该n个拟合深度图像的像素矩阵为2*n个行数相等且列数相等的矩阵。The above n*︱Δt︱=k*T indicates that the total time amount of n delays is an integer multiple of the period of the optical signal emitted by the light source. The sizes of the above n fitted depth images are all the same, that is, the pixel matrices of the n fitted depth images are n matrices with the same number of rows and the same number of columns. In addition, the size of the n fitted depth images is the same as the size of the above n initial depth images, that is, the pixel matrix of the n initial depth images and the pixel matrix of the n fitted depth images are 2*n rows. Equal matrices with equal number of columns.
可选的,上述曲面拟合的方法可以是最小二乘法的多项式曲面拟合或者其它适配函数的曲面拟合方法。Optionally, the above-mentioned surface fitting method may be a polynomial surface fitting method of least squares or a surface fitting method using other fitting functions.
需要说明的是,上述光源的启动时刻比传感器的启动时刻延迟又可以称为光源开始发射光信号的时刻比传感器开始能够接收反射光信号的时刻延迟。It should be noted that the above-mentioned activation time of the light source is delayed from the activation time of the sensor, which can also be referred to as the time when the light source starts to emit light signals is delayed from the time when the sensor starts to receive the reflected light signal.
在本申请中,利用了深度非线性误差存在周期性震荡与零和(完整周期内的误差总和为零)这两种特性,通过多次在拍摄设备的光源比传感器延迟启动的情况下采样,并且使得多次延迟的时间总和为采样光信号的周期的整数倍,然后将这多次延迟获得的深度图像的像素矩阵取平均来达到了减少深度非线性误差效果,从而提高了获得的视场相位补正系数矩阵的精确度。In the present application, the two characteristics of periodic oscillation and zero sum (the sum of errors in a complete cycle) of the depth nonlinear error are utilized. And the sum of the times of multiple delays is an integer multiple of the period of the sampling optical signal, and then the pixel matrix of the depth image obtained by these multiple delays is averaged to achieve the effect of reducing the depth nonlinear error, thereby improving the obtained field of view. Accuracy of the phase correction coefficient matrix.
在其中一种可能的实施方式中,上述第i次获得的初始深度图像为第i初始深度图像,该第i初始深度图像用像素矩阵Di(x,y)表示,该像素矩阵Di(x,y)为像素矩阵Di(x,y)’中每个像素值与c*[(1-i)*Δt]/2取和得到的,该Di(x,y)’为上述第i次测量获得的深度图像的像素矩阵,该c*[(1-i)*Δt]/2为由于光源的启动时刻比传感器的启动时刻延迟了上述(i-1)*Δt产生的距离差。In one possible implementation manner, the initial depth image obtained for the i-th time is the i-th initial depth image, and the i-th initial depth image is represented by a pixel matrix Di(x, y), and the pixel matrix Di(x, y) is the sum of each pixel value in the pixel matrix Di(x, y)' and c*[(1-i)*Δt]/2, and this Di(x, y)' is the i-th measurement above The pixel matrix of the obtained depth image, the c*[(1-i)*Δt]/2 is the distance difference caused by the above (i-1)*Δt because the activation time of the light source is delayed from the activation time of the sensor.
在本申请中,上述利用延迟时间(i-1)*Δt后将深度增加c*[(1-i)*Δt]/2的操作,是为了用时间测距的理论值的深度差量补偿延迟时间所造成的距离差,使得在取得同一个像素来自不同时间相位点之深度非线性误差量的同时也得到了初始深度图像。In this application, the above operation of increasing the depth by c*[(1-i)*Δt]/2 after the delay time (i-1)*Δt is used to compensate the depth difference of the theoretical value of time ranging The distance difference caused by the delay time makes it possible to obtain the initial depth image while obtaining the depth nonlinear error of the same pixel from different time phase points.
在其中一种可能的实施方式中,上述视场相位补正系数矩阵为根据n个拟合深度图像计算获得,包括:上述视场相位补正系数矩阵为拟合平均像素矩阵中的多个像素值的最小值分别与该拟合平均像素矩阵的各个像素值取比值得到的比值矩阵,该拟合平均像素矩阵为上述n个拟合深度图像的像素矩阵取平均获得。In one possible implementation manner, the above-mentioned field of view phase correction coefficient matrix is calculated and obtained according to n fitted depth images, including: the above-mentioned field of view phase correction coefficient matrix is the result of fitting a plurality of pixel values in the average pixel matrix. A ratio matrix obtained by taking the ratio between the minimum value and each pixel value of the fitted average pixel matrix, where the fitted average pixel matrix is obtained by averaging the pixel matrices of the above n fitted depth images.
在本申请中计算出了视场相位补正系数矩阵,从而能够补正拍摄设备通过TOF测距法获取的深度图像的视场相位误差。In this application, the field of view phase correction coefficient matrix is calculated, so that the field of view phase error of the depth image obtained by the photographing device through the TOF ranging method can be corrected.
在其中一种可能的实施方式中,上述深度图像处理方法还包括:通过固定模式噪声(fixed pattern noise,FPN)矩阵对上述第二深度图像补正获得第三深度图像,其中,该FPN矩阵中的每个值分别包括由硬件导致的上述第一深度图像中对应的像素的固定噪声。需要说明的是,本申请可以是结合上述第一方面中的方法和上述可能的实施方式中的一种或多种方法一起实现的。In one possible implementation manner, the above-mentioned depth image processing method further includes: obtaining a third depth image by compensating the above-mentioned second depth image through a fixed pattern noise (fixed pattern noise, FPN) matrix, wherein the FPN matrix Each value includes hardware-induced fixed noise for the corresponding pixel in the above-mentioned first depth image, respectively. It should be noted that the present application may be implemented in combination with the method in the first aspect and one or more methods in the possible implementation manners described above.
本申请提供的深度图像处理方法的执行主体可以是上述拍摄设备或者上述拍摄设备以外的其它拍摄设备,该上述拍摄设备或者该其它拍摄设备中存储有上述FPN矩阵的数据。具体的,固定模式噪声FPN又可以称为像素固定躁声,各像素在制做工艺、阅读顺序、电路设计上不完全相同,因此会引入不同像素间的误差。在本申请中,除了能够补正深度图像的视场相位误差之外还可以补正由于拍摄设备的硬件导致的每个像素的固定模式噪声。在其中一种可能的实施方式中,上述FPN矩阵为拟合平均像素矩阵与初始平均像素矩阵取差值得到的差值矩阵,该拟合平均像素矩阵为上述n个拟合深度图像的像素矩阵取平均获得,该初始平均像素矩阵为上述n个初始深度图像的像素矩阵取平均获得。The execution subject of the depth image processing method provided by the present application may be the above-mentioned photographing device or another photographing device other than the above-mentioned photographing device, and the above-mentioned photographing device or the other photographing device stores the data of the above-mentioned FPN matrix. Specifically, the fixed pattern noise FPN can also be called pixel fixed noise. The manufacturing process, reading order, and circuit design of each pixel are not exactly the same, so errors between different pixels will be introduced. In the present application, in addition to the field-of-view phase error of the depth image can be corrected, the fixed pattern noise of each pixel caused by the hardware of the photographing device can also be corrected. In one possible implementation manner, the above-mentioned FPN matrix is a difference value matrix obtained by taking the difference between the fitted average pixel matrix and the initial average pixel matrix, and the fitted average pixel matrix is the pixel matrix of the above-mentioned n fitted depth images Obtained by averaging, and the initial average pixel matrix is obtained by averaging the pixel matrices of the above n initial depth images.
在本申请中,通过该计算过程得到固定模式噪声矩阵,从而能够用于减少深度图像的固定模式噪声。In this application, the fixed pattern noise matrix is obtained through this calculation process, which can be used to reduce the fixed pattern noise of the depth image.
在其中一种可能的实施方式中,上述通过视场相位补正系数矩阵对上述第一深度图像补正获得第二深度图像,包括:分别计算该第一深度图像的像素矩阵与上述视场相位补正系数矩阵中相同下标的像素值的乘积得到该第二深度图像。In one possible implementation manner, the above-mentioned obtaining a second depth image by compensating the above-mentioned first depth image by using a field of view phase correction coefficient matrix includes: separately calculating the pixel matrix of the first depth image and the above-mentioned field of view phase correction coefficient. The second depth image is obtained by multiplying the pixel values of the same subscript in the matrix.
上述第一深度图像的大小可以是与该视场相位补正系数矩阵的大小相同,例如,假设该视场相位补正系数矩阵S1(x,y)的大小是1024*1024,那么该第一深度图像的像素矩阵的大小也是1024*1024。The size of the above-mentioned first depth image can be the same as the size of the field of view phase correction coefficient matrix. For example, if the size of the field of view phase correction coefficient matrix S1 (x, y) is 1024*1024, then the first depth image The size of the pixel matrix is also 1024*1024.
本申请给出了补正视场相位误差的计算过程。This application provides a calculation process for correcting the phase error of the field of view.
在其中一种可能的实施方式中,上述通过固定模式噪声FPN矩阵对上述第二深度图像补正获得第三深度图像,包括:分别计算上述第一深度图像的像素矩阵与上述视场相位补正系数矩阵中相同下标的像素值的乘积得到乘积矩阵;计算该乘积矩阵与该FPN矩阵的和得到上述第三深度图像。In one possible implementation manner, the above-mentioned obtaining a third depth image by compensating the above-mentioned second depth image by using a fixed pattern noise FPN matrix includes: calculating the pixel matrix of the above-mentioned first depth image and the above-mentioned field of view phase correction coefficient matrix respectively. The product matrix is obtained by multiplying the pixel values with the same subscript in the above-mentioned third depth image; the sum of the product matrix and the FPN matrix is calculated to obtain the above-mentioned third depth image.
上述第一深度图像的大小、FPN矩阵的大小与该视场相位补正系数矩阵的大小相同,例如,假设该视场相位补正系数矩阵的大小是1024*1024,那么该第一深度图像的像素矩阵的大小和该FPN矩阵的大小也是1024*1024。The size of the above-mentioned first depth image and the size of the FPN matrix are the same as the size of the field of view phase correction coefficient matrix. For example, assuming that the size of the field of view phase correction coefficient matrix is 1024*1024, then the pixel matrix of the first depth image The size of and the size of the FPN matrix are also 1024*1024.
本申请给出了同时补正固定模式噪声和视场相位误差的计算过程。This application presents a calculation process for simultaneously correcting fixed pattern noise and field-of-view phase error.
第二方面,本申请提供一种深度图像处理方法,该方法包括:获取n个初始深度图像,该n个初始深度图像为基于拍摄设备n次通过飞行时间TOF测距法获取到的第二对象的深 度图像,其中,上述n次中第i次的上述拍摄设备的光源的启动时刻比上述拍摄设备的传感器的启动时刻延迟(i-1)*Δt,该i的取值范围为[1,n],n*︱Δt︱=k*T,该T为该光信号的周期,该n为大于1的整数,该k为整数,该Δt为预设时长;In a second aspect, the present application provides a depth image processing method, the method comprising: acquiring n initial depth images, where the n initial depth images are a second object obtained by a time-of-flight TOF ranging method n times based on a photographing device The depth image of , wherein the start-up time of the light source of the above-mentioned photographing device for the i-th time among the above-mentioned n times is delayed (i-1)*Δt from the start-up time of the sensor of the above-mentioned photographing device, and the value range of i is [1, n], n*︱Δt︱=k*T, the T is the period of the optical signal, the n is an integer greater than 1, the k is an integer, and the Δt is a preset duration;
对上述n个初始深度图像分别进行曲面拟合得到n个拟合深度图像;Perform surface fitting on the above n initial depth images respectively to obtain n fitted depth images;
根据上述n个拟合深度图像做均值处理后计算得到视场相位补正系数矩阵,上述视场相位补正系数矩阵用于补正上述拍摄设备通过上述TOF测距法获取的深度图像的视场相位误差。The field of view phase correction coefficient matrix is calculated to obtain a field of view phase correction coefficient matrix after averaging the n fitted depth images, and the field of view phase correction coefficient matrix is used to correct the field of view phase error of the depth image obtained by the above-mentioned photographing device through the above-mentioned TOF ranging method.
上述第二对象可以是平整的平面。The above-mentioned second object may be a flat plane.
在本申请中,利用了深度非线性误差存在周期性震荡与零和(完整周期内的误差总和为零)这两种特性,通过多次在拍摄设备的光源比传感器延迟启动的情况下采样,并且使得多次延迟的时间总和为采样光信号的周期的整数倍,然后将这多次延迟获得的深度图像的像素矩阵取平均来达到了减少深度非线性误差效果,从而提高了获得的视场相位补正系数矩阵的精确度。因此,本申请获得的深度图像的视场相位补正系数矩阵,即可以补正拍摄设备获得的深度图像中每个像素值的视场相位误差,从而降低深度图像的失真率,提高深度图像的质量。In the present application, the two characteristics of periodic oscillation and zero sum (the sum of errors in a complete cycle) of the depth nonlinear error are utilized. And the sum of the times of multiple delays is an integer multiple of the period of the sampling optical signal, and then the pixel matrix of the depth image obtained by these multiple delays is averaged to achieve the effect of reducing the depth nonlinear error, thereby improving the obtained field of view. Accuracy of the phase correction coefficient matrix. Therefore, the field of view phase correction coefficient matrix of the depth image obtained by the present application can correct the field of view phase error of each pixel value in the depth image obtained by the photographing device, thereby reducing the distortion rate of the depth image and improving the quality of the depth image.
在其中一种可能的实施方式中,上述第i次获得的初始深度图像为第i初始深度图像;上述获取n个初始深度图像,包括:In one possible implementation manner, the initial depth image obtained for the i-th time is the i-th initial depth image; the above-mentioned acquisition of n initial depth images includes:
获取上述拍摄设备n次通过飞行时间TOF测距法实际测量得到的n个测量深度图像,该n个测量深度图像中的第i测量深度图像用像素矩阵Di(x,y)’表示;Obtain the n measurement depth images obtained by the actual measurement of the above-mentioned shooting equipment n times by the time-of-flight TOF ranging method, and the i-th measurement depth image in the n measurement depth images is represented by a pixel matrix Di(x, y)';
分别计算该像素矩阵Di(x,y)’中每个像素值与c*[(1-i)*Δt]/2的和得到上述第i初始深度图像Di(x,y),该c*[(1-i)*Δt]/2为由于上述光源的启动时刻比上述传感器的启动时刻延迟了上述(i-1)*Δt产生的距离差。Calculate the sum of each pixel value in the pixel matrix Di(x, y)' and c*[(1-i)*Δt]/2 to obtain the i-th initial depth image Di(x, y), the c* [(1-i)*Δt]/2 is the distance difference caused by the fact that the activation time of the light source is delayed from the activation time of the sensor by the above (i-1)*Δt.
在本申请中,上述利用延迟时间(i-1)*Δt后将深度增加c*[(1-i)*Δt]/2的操作,是为了用时间测距的理论值的深度差量补偿延迟时间所造成的距离差,使得在取得同一个像素来自不同时间相位点之深度非线性误差量的同时也得到了初始深度图像。In this application, the above operation of increasing the depth by c*[(1-i)*Δt]/2 after the delay time (i-1)*Δt is used to compensate the depth difference of the theoretical value of time ranging The distance difference caused by the delay time makes it possible to obtain the initial depth image while obtaining the depth nonlinear error of the same pixel from different time phase points.
在其中一种可能的实施方式中,上述根据上述n个拟合深度图像做均值处理后计算得到视场相位补正系数矩阵,包括:In one of the possible implementations, the above-mentioned calculation to obtain a field of view phase correction coefficient matrix after performing mean value processing according to the above-mentioned n fitted depth images, including:
将上述n个拟合深度图像的像素矩阵取平均得到拟合平均像素矩阵;Average the pixel matrices of the above n fitted depth images to obtain a fitted average pixel matrix;
提取上述拟合平均像素矩阵中的多个像素值的最小值,并计算上述最小值分别与上述拟合平均像素矩阵的各个像素值的比值得到比值矩阵,上述比值矩阵为上述视场相位补正系数矩阵。Extracting the minimum value of a plurality of pixel values in the above-mentioned fitting average pixel matrix, and calculating the ratio of the above-mentioned minimum value to each pixel value of the above-mentioned fitting average pixel matrix to obtain a ratio matrix, and the above-mentioned ratio matrix is the above-mentioned field of view phase correction coefficient matrix.
在本申请中计算出了视场相位补正系数矩阵,从而能够补正拍摄设备通过TOF测距法获取的深度图像的视场相位误差。In this application, the field of view phase correction coefficient matrix is calculated, so that the field of view phase error of the depth image obtained by the photographing device through the TOF ranging method can be corrected.
在其中一种可能的实施方式中,上述对上述n个初始深度图像分别进行曲面拟合得到n个拟合深度图像之后,还包括:In one possible implementation manner, after performing surface fitting on the n initial depth images to obtain n fitted depth images, the method further includes:
将上述n个初始深度图像的像素矩阵取平均得到初始平均像素矩阵;Average the pixel matrices of the above n initial depth images to obtain an initial average pixel matrix;
将上述n个拟合深度图像的像素矩阵取平均得到拟合平均像素矩阵;Average the pixel matrices of the above n fitted depth images to obtain a fitted average pixel matrix;
计算上述拟合平均像素矩阵与上述初始平均像素矩阵取差值得到差值矩阵,上述差值 矩阵为固定模式噪声FPN矩阵,该FPN矩阵中的每个值分别包括由硬件导致的深度图像中与所述每个值相同下标的像素的固定噪声。Calculate the difference between the above-mentioned fitted average pixel matrix and the above-mentioned initial average pixel matrix to obtain a difference matrix, the above-mentioned difference matrix is a fixed pattern noise FPN matrix, and each value in the FPN matrix respectively includes the depth image caused by hardware and The fixed noise for pixels with the same index for each value.
在本申请中,通过该计算过程得到固定模式噪声矩阵,从而能够用于减少深度图像的固定模式噪声。In this application, the fixed pattern noise matrix is obtained through this calculation process, which can be used to reduce the fixed pattern noise of the depth image.
第三方面,本申请提供一种深度图像处理设备,该设备包括:In a third aspect, the present application provides a depth image processing device, the device comprising:
获取单元,用于获取第一对象的第一深度图像;an acquisition unit for acquiring the first depth image of the first object;
补正单元,用于通过视场相位补正系数矩阵对该第一深度图像中像素的深度值补正获得第二深度图像,其中,该视场相位补正系数矩阵为对n个初始深度图像预处理后获得的用于补正视场相位误差的矩阵,该n个初始深度图像为在第一情况下获得的深度图像,该第一情况包括拍摄设备的光源的启动时刻与该拍摄设备的传感器的启动时刻为不同时刻,该预处理包括根据该n个初始深度图像所做的均值处理,该n为大于1的整数。The correction unit is used to obtain a second depth image through the correction of the depth value of the pixel in the first depth image by the field of view phase correction coefficient matrix, wherein, this field of view phase correction coefficient matrix is obtained after preprocessing to n initial depth images The matrix for compensating the phase error of the field of view, the n initial depth images are the depth images obtained under the first situation, and the first situation includes the start-up moment of the light source of the photographing device and the start-up moment of the sensor of the photographing device: At different times, the preprocessing includes mean value processing based on the n initial depth images, where n is an integer greater than 1.
在其中一种可能的实施方式中,该预处理还包括曲面拟合处理,In one of the possible implementations, the preprocessing further includes surface fitting processing,
该视场相位补正系数矩阵为根据n个拟合深度图像计算获得,该n个拟合深度图像由该n个初始深度图像分别进行曲面拟合获得,该n个初始深度图像为基于该拍摄设备n次通过飞行时间TOF测距法获得的第二对象的深度图像,该n次中第i次的该光源的启动时刻比该传感器的启动时刻延迟(i-1)*Δt,该i的取值范围为[1,n],n*︱Δt︱=k*T,该T为该光信号的周期,该k为整数,该Δt为预设时长。The field of view phase correction coefficient matrix is calculated and obtained according to n fitted depth images, the n fitted depth images are obtained by performing surface fitting on the n initial depth images respectively, and the n initial depth images are based on the shooting equipment The depth image of the second object obtained by the time-of-flight TOF ranging method for n times, the start-up time of the light source at the i-th time in the n times is delayed (i-1)*Δt from the start-up time of the sensor, and the value of i is The value range is [1, n], n*︱Δt︱=k*T, where T is the period of the optical signal, k is an integer, and Δt is a preset duration.
在其中一种可能的实施方式中,该第i次获得的初始深度图像为第i初始深度图像,该第i初始深度图像用像素矩阵Di(x,y)表示,该像素矩阵Di(x,y)为像素矩阵Di(x,y)’中每个像素值与c*[(1-i)*Δt]/2取和得到的,该Di(x,y)’为该第i次测量获得的深度图像的像素矩阵,该c*[(1-i)*Δt]/2为由于该光源的启动时刻比该传感器的启动时刻延迟了该(i-1)*Δt产生的距离差。In one possible implementation manner, the initial depth image obtained for the i-th time is the i-th initial depth image, and the i-th initial depth image is represented by a pixel matrix Di(x, y), and the pixel matrix Di(x, y) is the sum of each pixel value in the pixel matrix Di(x, y)' and c*[(1-i)*Δt]/2, and the Di(x, y)' is the i-th measurement The pixel matrix of the obtained depth image, the c*[(1-i)*Δt]/2 is the distance difference generated by the (i-1)*Δt caused by the activation time of the light source being delayed from the activation time of the sensor.
在其中一种可能的实施方式中,该视场相位补正系数矩阵为根据n个拟合深度图像计算获得,包括:In one possible implementation manner, the field of view phase correction coefficient matrix is calculated and obtained according to n fitted depth images, including:
该视场相位补正系数矩阵为拟合平均像素矩阵中的多个像素值的最小值分别与该拟合平均像素矩阵的各个像素值取比值得到的比值矩阵,该拟合平均像素矩阵为该n个拟合深度图像的像素矩阵取平均获得。The field of view phase correction coefficient matrix is a ratio matrix obtained by taking the ratio of the minimum value of a plurality of pixel values in the fitted average pixel matrix and each pixel value of the fitted average pixel matrix, and the fitted average pixel matrix is the n The pixel matrices of the fitted depth images are averaged.
在其中一种可能的实施方式中,该补正单元还用于:In one of the possible implementations, the correction unit is also used for:
通过固定模式噪声FPN矩阵对该第二深度图像补正获得第三深度图像,其中,该FPN矩阵中的每个值分别包括由硬件导致的该第一深度图像中与所述每个值相同下标的像素的固定噪声。A third depth image is obtained by compensating the second depth image through a fixed pattern noise FPN matrix, wherein each value in the FPN matrix includes a hardware-induced first depth image with the same subscript as each value. Fixed noise for pixels.
在其中一种可能的实施方式中,该FPN矩阵为拟合平均像素矩阵与初始平均像素矩阵取差值得到的差值矩阵,该拟合平均像素矩阵为该n个拟合深度图像的像素矩阵取平均获得,该初始平均像素矩阵为该n个初始深度图像的像素矩阵取平均获得。In one possible implementation manner, the FPN matrix is a difference value matrix obtained by taking the difference between the fitted average pixel matrix and the initial average pixel matrix, and the fitted average pixel matrix is the pixel matrix of the n fitted depth images Obtained by averaging, and the initial average pixel matrix is obtained by averaging pixel matrices of the n initial depth images.
在其中一种可能的实施方式中,该补正单元具体用于:In one of the possible implementations, the correction unit is specifically used for:
分别计算该第一深度图像的像素矩阵与该视场相位补正系数矩阵中相同下标的像素值的乘积得到该第二深度图像。The second depth image is obtained by separately calculating the product of the pixel matrix of the first depth image and the pixel value of the same subscript in the field of view phase correction coefficient matrix.
在其中一种可能的实施方式中,该补正单元具体用于:In one of the possible implementations, the correction unit is specifically used for:
分别计算该第一深度图像的像素矩阵与该视场相位补正系数矩阵中相同下标的像素值的乘积得到乘积矩阵;Respectively calculate the product of the pixel matrix of the first depth image and the pixel value of the same subscript in the field of view phase correction coefficient matrix to obtain the product matrix;
计算该乘积矩阵与该FPN矩阵的和得到该第三深度图像。The third depth image is obtained by calculating the sum of the product matrix and the FPN matrix.
第四方面,本申请提供一种深度图像处理设备,该设备包括:In a fourth aspect, the present application provides a depth image processing device, the device comprising:
获取单元,用于获取n个初始深度图像,该n个初始深度图像为基于拍摄设备n次通过飞行时间TOF测距法获取到的第二对象的深度图像,其中,该n次中第i次的该拍摄设备的光源的启动时刻比该拍摄设备的传感器的启动时刻延迟(i-1)*Δt,该i的取值范围为[1,n],n*︱Δt︱=k*T,该T为该光信号的周期,该n为大于1的整数,该k为整数,该Δt为预设时长;an acquisition unit, configured to acquire n initial depth images, where the n initial depth images are the depth images of the second object obtained by the time-of-flight TOF ranging method n times based on the photographing device, wherein the i-th time in the n times The start-up time of the light source of the photographing device is delayed (i-1)*Δt from the start-up time of the sensor of the photographing device, and the value range of the i is [1, n], n*︱Δt︱=k*T, The T is the period of the optical signal, the n is an integer greater than 1, the k is an integer, and the Δt is a preset duration;
曲面拟合单元,用于对该n个初始深度图像分别进行曲面拟合得到n个拟合深度图像;计算单元,用于根据该n个拟合深度图像做均值处理后计算得到视场相位补正系数矩阵,该视场相位补正系数矩阵用于补正该拍摄设备通过该TOF测距法获取的深度图像的视场相位误差。The surface fitting unit is used to perform surface fitting on the n initial depth images respectively to obtain n fitted depth images; the calculation unit is used to calculate the field of view phase correction after performing mean processing on the n fitted depth images A coefficient matrix, where the field of view phase correction coefficient matrix is used to correct the field of view phase error of the depth image obtained by the photographing device through the TOF ranging method.
在其中一种可能的实施方式中,该第i次获得的初始深度图像为第i初始深度图像;该获取单元具体用于:In one possible implementation manner, the initial depth image obtained for the i-th time is the i-th initial depth image; the obtaining unit is specifically used for:
获取该拍摄设备n次通过飞行时间TOF测距法实际测量得到的n个测量深度图像,该n个测量深度图像中的第i测量深度图像用像素矩阵Di(x,y)’表示;Obtain n measured depth images obtained by the actual measurement by the time-of-flight TOF ranging method n times by the photographing device, and the i-th measured depth image in the n measured depth images is represented by a pixel matrix Di(x, y)';
分别计算该像素矩阵Di(x,y)’中每个像素值与c*[(1-i)*Δt]/2的和得到该第i初始深度图像Di(x,y),该c*[(1-i)*Δt]/2为由于该光源的启动时刻比该传感器的启动时刻延迟了该(i-1)*Δt产生的距离差。Calculate the sum of each pixel value in the pixel matrix Di(x, y)' and c*[(1-i)*Δt]/2 to obtain the i-th initial depth image Di(x, y), the c* [(1-i)*Δt]/2 is the distance difference generated because the activation time of the light source is delayed by (i-1)*Δt from the activation time of the sensor.
在其中一种可能的实施方式中,该计算单元具体用于:In one of the possible implementations, the computing unit is specifically used for:
将该n个拟合深度图像的像素矩阵取平均得到拟合平均像素矩阵;Average the pixel matrices of the n fitted depth images to obtain a fitted average pixel matrix;
提取该拟合平均像素矩阵中的多个像素值的最小值,并计算该最小值分别与该拟合平均像素矩阵的各个像素值的比值得到比值矩阵,该比值矩阵为该视场相位补正系数矩阵。在其中一种可能的实施方式中,上述计算单元,还用于在该曲面拟合单元对该n个初始深度图像分别进行曲面拟合得到n个拟合深度图像之后,Extract the minimum value of multiple pixel values in the fitted average pixel matrix, and calculate the ratio of the minimum value to each pixel value of the fitted average pixel matrix to obtain a ratio matrix, where the ratio matrix is the phase correction coefficient of the field of view matrix. In one of the possible implementations, the above calculation unit is further configured to, after the surface fitting unit performs surface fitting on the n initial depth images respectively to obtain n fitted depth images,
将该n个初始深度图像的像素矩阵取平均得到初始平均像素矩阵;Average the pixel matrices of the n initial depth images to obtain an initial average pixel matrix;
将该n个拟合深度图像的像素矩阵取平均得到拟合平均像素矩阵;Average the pixel matrices of the n fitted depth images to obtain a fitted average pixel matrix;
计算该拟合平均像素矩阵与该初始平均像素矩阵取差值得到差值矩阵,该差值矩阵为固定模式噪声FPN矩阵,该FPN矩阵中的每个值分别包括由硬件导致的深度图像中与所述每个值相同下标的像素的固定噪声。Calculate the difference between the fitted average pixel matrix and the initial average pixel matrix to obtain a difference matrix. The difference matrix is a fixed pattern noise FPN matrix. Each value in the FPN matrix includes the difference between the The fixed noise for pixels with the same index for each value.
第五方面,本申请提供一种深度图像处理设备,该设备包括处理器、通信接口和存储器,其中,存储器、通信接口和处理器可以集成在一起,也可以通过耦合器耦合,该存储器用于存储计算机程序,该处理器用于执行该存储器中存储的计算机程序以实现如下操作:In a fifth aspect, the present application provides a deep image processing device, the device includes a processor, a communication interface and a memory, wherein the memory, the communication interface and the processor can be integrated or coupled through a coupler, the memory is used for A computer program is stored, and the processor is configured to execute the computer program stored in the memory to achieve the following operations:
获取第一对象的第一深度图像;并通过视场相位补正系数矩阵对该第一深度图像中像素的深度值补正获得第二深度图像,其中,该视场相位补正系数矩阵为对n个初始深度图像预处理后获得的用于补正视场相位误差的矩阵,该n个初始深度图像为在第一情况下获得的深度图像,该第一情况包括拍摄设备的光源的启动时刻与该拍摄设备的启动时刻为不 同时刻,该预处理包括根据该n个初始深度图像所做的均值处理,该n为大于1的整数。Obtain the first depth image of the first object; and obtain a second depth image by correcting the depth value of the pixel in the first depth image by a field of view phase correction coefficient matrix, wherein the field of view phase correction coefficient matrix is a pair of n initial The matrix used to correct the phase error of the field of view obtained after the depth image preprocessing, the n initial depth images are the depth images obtained in the first situation, and the first situation includes the start-up moment of the light source of the photographing device and the photographing device. The start-up moments of are different moments, and the preprocessing includes mean value processing according to the n initial depth images, where n is an integer greater than 1.
上述深度图像处理方法的执行主体可以是上述拍摄设备或者上述拍摄设备以外的其它拍摄设备,该上述拍摄设备或者该其它拍摄设备中存储有上述视场相位补正系数矩阵的数据。The execution subject of the above-mentioned depth image processing method may be the above-mentioned photographing device or another photographing device other than the above-mentioned photographing device, and the above-mentioned photographing device or the other photographing device stores the data of the above-mentioned field of view phase correction coefficient matrix.
在其中一种可能的实施方式中,上述预处理还包括曲面拟合处理,上述视场相位补正系数矩阵为根据n个拟合深度图像计算获得,该n个拟合深度图像由上述n个初始深度图像分别进行曲面拟合获得,上述n个初始深度图像为基于上述拍摄设备n次通过飞行时间TOF测距法获得的第二对象的深度图像,该n次中第i次的光源的启动时刻比传感器的启动时刻延迟(i-1)*Δt,该i的取值范围为[1,n],n*︱Δt︱=k*T,该T为该光信号的周期,该k为整数,该Δt为预设时长。In one possible implementation manner, the preprocessing further includes surface fitting processing, and the field of view phase correction coefficient matrix is calculated and obtained according to n fitted depth images, and the n fitted depth images are obtained from the n initial The depth images are respectively obtained by surface fitting, and the n initial depth images are the depth images of the second object obtained by the time-of-flight TOF ranging method n times based on the above-mentioned shooting equipment, and the start time of the i-th light source in the n times Delay (i-1)*Δt from the start time of the sensor, the value range of the i is [1, n], n*︱Δt︱=k*T, the T is the period of the optical signal, and the k is an integer , the Δt is a preset duration.
可选的,上述曲面拟合的方法可以是最小二乘法的多项式曲面拟合或者其它适配函数的曲面拟合方法。Optionally, the above-mentioned surface fitting method may be a polynomial surface fitting method of least squares or a surface fitting method using other fitting functions.
在其中一种可能的实施方式中,上述第i次获得的初始深度图像为第i初始深度图像,该第i初始深度图像用像素矩阵Di(x,y)表示,该像素矩阵Di(x,y)为像素矩阵Di(x,y)’中每个像素值与c*[(1-i)*Δt]/2取和得到的,该Di(x,y)’为上述第i次测量获得的深度图像的像素矩阵,该c*[(1-i)*Δt]/2为由于光源的启动时刻比传感器的启动时刻延迟了上述(i-1)*Δt产生的距离差。In one possible implementation manner, the initial depth image obtained for the i-th time is the i-th initial depth image, and the i-th initial depth image is represented by a pixel matrix Di(x, y), and the pixel matrix Di(x, y) is the sum of each pixel value in the pixel matrix Di(x, y)' and c*[(1-i)*Δt]/2, and this Di(x, y)' is the i-th measurement above The pixel matrix of the obtained depth image, the c*[(1-i)*Δt]/2 is the distance difference caused by the above (i-1)*Δt because the activation time of the light source is delayed from the activation time of the sensor.
在其中一种可能的实施方式中,上述视场相位补正系数矩阵为根据n个拟合深度图像计算获得,包括:上述视场相位补正系数矩阵为拟合平均像素矩阵中的多个像素值的最小值分别与该拟合平均像素矩阵的各个像素值取比值得到的比值矩阵,该拟合平均像素矩阵为上述n个拟合深度图像的像素矩阵取平均获得。In one possible implementation manner, the above-mentioned field of view phase correction coefficient matrix is calculated and obtained according to n fitted depth images, including: the above-mentioned field of view phase correction coefficient matrix is the result of fitting a plurality of pixel values in the average pixel matrix. A ratio matrix obtained by taking the ratio between the minimum value and each pixel value of the fitted average pixel matrix, where the fitted average pixel matrix is obtained by averaging the pixel matrices of the above n fitted depth images.
在其中一种可能的实施方式中,上述深度图像处理方法还包括:通过固定模式噪声FPN矩阵对上述第二深度图像补正获得第三深度图像,其中,该FPN矩阵中的每个值分别包括由硬件导致的上述第一深度图像中对应的像素的固定噪声。需要说明的是,本申请可以是结合上述第一方面中的方法和/或上述可能的实施方式中的方法一起实现的。In one possible implementation manner, the above-mentioned depth image processing method further includes: obtaining a third depth image by compensating the above-mentioned second depth image through a fixed pattern noise FPN matrix, wherein each value in the FPN matrix includes Fixed noise of corresponding pixels in the above-mentioned first depth image caused by hardware. It should be noted that the present application may be implemented in combination with the method in the above first aspect and/or the method in the above possible implementation manner.
在其中一种可能的实施方式中,上述FPN矩阵为拟合平均像素矩阵与初始平均像素矩阵取差值得到的差值矩阵,该拟合平均像素矩阵为上述n个拟合深度图像的像素矩阵取平均获得,该初始平均像素矩阵为上述n个初始深度图像的像素矩阵取平均获得。In one possible implementation manner, the FPN matrix is a difference value matrix obtained by taking the difference between the fitted average pixel matrix and the initial average pixel matrix, and the fitted average pixel matrix is the pixel matrix of the n fitted depth images Obtained by averaging, and the initial average pixel matrix is obtained by averaging the pixel matrices of the above n initial depth images.
在其中一种可能的实施方式中,上述通过视场相位补正系数矩阵对上述第一深度图像补正获得第二深度图像,包括:分别计算该第一深度图像的像素矩阵与上述视场相位补正系数矩阵中相同下标的像素值的乘积得到该第二深度图像。In one possible implementation manner, the above-mentioned obtaining a second depth image by compensating the above-mentioned first depth image by using a field of view phase correction coefficient matrix includes: separately calculating the pixel matrix of the first depth image and the above-mentioned field of view phase correction coefficient. The second depth image is obtained by multiplying the pixel values of the same subscript in the matrix.
在其中一种可能的实施方式中,上述通过固定模式噪声FPN矩阵对上述第二深度图像补正获得第三深度图像,包括:分别计算上述第一深度图像的像素矩阵与上述视场相位补正系数矩阵中相同下标的像素值的乘积得到乘积矩阵;计算该乘积矩阵与该FPN矩阵的和得到上述第三深度图像。In one possible implementation manner, the above-mentioned obtaining a third depth image by compensating the above-mentioned second depth image by using a fixed pattern noise FPN matrix includes: calculating the pixel matrix of the above-mentioned first depth image and the above-mentioned field of view phase correction coefficient matrix respectively. The product matrix is obtained by multiplying the pixel values with the same subscript in the above-mentioned third depth image; the sum of the product matrix and the FPN matrix is calculated to obtain the above-mentioned third depth image.
第六方面,本申请提供一种深度图像处理设备,该设备包括处理器、通信接口和存储器,其中,存储器、通信接口和处理器可以集成在一起,也可以通过耦合器耦合,该存储器用于存储计算机程序,该处理器用于执行该存储器中存储的计算机程序以实现如下操作: 获取n个初始深度图像,该n个初始深度图像为基于拍摄设备n次通过飞行时间TOF测距法获取到的第二对象的深度图像,其中,上述n次中第i次的上述拍摄设备的光源的启动时刻比上述拍摄设备的传感器的启动时刻延迟(i-1)*Δt,该i的取值范围为[1,n],n*︱Δt︱=k*T,该T为该光信号的周期,该n为大于1的整数,该k为整数,该Δt为预设时长;In a sixth aspect, the present application provides a deep image processing device, the device includes a processor, a communication interface and a memory, wherein the memory, the communication interface and the processor can be integrated together or coupled through a coupler, and the memory is used for A computer program is stored, and the processor is configured to execute the computer program stored in the memory to achieve the following operations: Acquire n initial depth images, the n initial depth images are obtained by the time-of-flight TOF ranging method n times based on the photographing device The depth image of the second object, wherein the start-up time of the light source of the imaging device at the i-th time among the above-mentioned n times is delayed by (i-1)*Δt from the start-up time of the sensor of the above-mentioned imaging device, and the value range of i is [1, n], n*︱Δt︱=k*T, where T is the period of the optical signal, n is an integer greater than 1, k is an integer, and Δt is a preset duration;
对上述n个初始深度图像分别进行曲面拟合得到n个拟合深度图像;Perform surface fitting on the above n initial depth images respectively to obtain n fitted depth images;
根据上述n个拟合深度图像做均值处理后计算得到视场相位补正系数矩阵,上述视场相位补正系数矩阵用于补正上述拍摄设备通过上述TOF测距法获取的深度图像的视场相位误差。The field of view phase correction coefficient matrix is calculated to obtain a field of view phase correction coefficient matrix after averaging the n fitted depth images, and the field of view phase correction coefficient matrix is used to correct the field of view phase error of the depth image obtained by the above-mentioned photographing device through the above-mentioned TOF ranging method.
在其中一种可能的实施方式中,上述第i次获得的初始深度图像为第i初始深度图像;上述获取n个初始深度图像,包括:In one possible implementation manner, the initial depth image obtained for the i-th time is the i-th initial depth image; the above-mentioned acquisition of n initial depth images includes:
获取上述拍摄设备n次通过飞行时间TOF测距法实际测量得到的n个测量深度图像,该n个测量深度图像中的第i测量深度图像用像素矩阵Di(x,y)’表示;Obtain the n measurement depth images obtained by the actual measurement of the above-mentioned shooting equipment n times by the time-of-flight TOF ranging method, and the i-th measurement depth image in the n measurement depth images is represented by a pixel matrix Di(x, y)';
分别计算该像素矩阵Di(x,y)’中每个像素值与c*[(1-i)*Δt]/2的和得到上述第i初始深度图像Di(x,y),该c*[(1-i)*Δt]/2为由于上述光源的启动时刻比上述传感器的启动时刻延迟了上述(i-1)*Δt产生的距离差。Calculate the sum of each pixel value in the pixel matrix Di(x, y)' and c*[(1-i)*Δt]/2 to obtain the i-th initial depth image Di(x, y), the c* [(1-i)*Δt]/2 is the distance difference caused by the fact that the activation time of the light source is delayed from the activation time of the sensor by the above (i-1)*Δt.
在其中一种可能的实施方式中,上述根据上述n个拟合深度图像做均值处理后计算得到视场相位补正系数矩阵,包括:In one of the possible implementations, the above-mentioned calculation to obtain a field of view phase correction coefficient matrix after performing mean value processing according to the above-mentioned n fitted depth images, including:
将上述n个拟合深度图像的像素矩阵取平均得到拟合平均像素矩阵;Average the pixel matrices of the above n fitted depth images to obtain a fitted average pixel matrix;
提取上述拟合平均像素矩阵中的多个像素值的最小值,并计算上述最小值分别与上述拟合平均像素矩阵的各个像素值的比值得到比值矩阵,上述比值矩阵为上述视场相位补正系数矩阵。Extracting the minimum value of a plurality of pixel values in the above-mentioned fitting average pixel matrix, and calculating the ratio of the above-mentioned minimum value to each pixel value of the above-mentioned fitting average pixel matrix to obtain a ratio matrix, and the above-mentioned ratio matrix is the above-mentioned field of view phase correction coefficient matrix.
在其中一种可能的实施方式中,上述对上述n个初始深度图像分别进行曲面拟合得到n个拟合深度图像之后,还包括:In one possible implementation manner, after performing surface fitting on the n initial depth images to obtain n fitted depth images, the method further includes:
将上述n个初始深度图像的像素矩阵取平均得到初始平均像素矩阵;Average the pixel matrices of the above n initial depth images to obtain an initial average pixel matrix;
将上述n个拟合深度图像的像素矩阵取平均得到拟合平均像素矩阵;Average the pixel matrices of the above n fitted depth images to obtain a fitted average pixel matrix;
计算上述拟合平均像素矩阵与上述初始平均像素矩阵取差值得到差值矩阵,上述差值矩阵为固定模式噪声FPN矩阵,该FPN矩阵中的每个值分别包括由硬件导致的深度图像中与所述每个值相同下标的像素的固定噪声。Calculate the difference between the above-mentioned fitted average pixel matrix and the above-mentioned initial average pixel matrix to obtain a difference matrix, the above-mentioned difference matrix is a fixed pattern noise FPN matrix, and each value in the FPN matrix respectively includes the depth image caused by hardware and The fixed noise for pixels with the same index for each value.
第七方面,本申请提供一种装置,该装置包括处理器和通信接口,该装置被配置为执行上述第一方面任意一项所述的方法。In a seventh aspect, the present application provides an apparatus comprising a processor and a communication interface, the apparatus being configured to perform the method described in any one of the above-mentioned first aspect.
在其中一种可能的实施方式中,该装置为芯片或系统芯片(System on a Chip,SoC)。第八方面,本申请提供一种装置,该装置包括处理器和通信接口,该装置被配置为执行上述第二方面任意一项所述的方法。In one of the possible implementations, the device is a chip or a System on a Chip (SoC). In an eighth aspect, the present application provides an apparatus, the apparatus comprising a processor and a communication interface, the apparatus being configured to perform the method described in any one of the second aspect above.
在其中一种可能的实施方式中,该装置为芯片或系统芯片SoC。In one of the possible implementations, the device is a chip or a system-on-a-chip SoC.
第九方面,本申请提供一种计算机可读存储介质,该计算机可读存储介质存储有计算机程序,该计算机程序被处理器执行以实现上述第一方面任意一项所述的方法。In a ninth aspect, the present application provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement the method described in any one of the above-mentioned first aspect.
第十方面,本申请提供一种计算机可读存储介质,该计算机可读存储介质存储有计算机程序,该计算机程序被处理器执行以实现上述第二方面任意一项所述的方法。In a tenth aspect, the present application provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and the computer program is executed by a processor to implement the method described in any one of the foregoing second aspects.
第十一方面,本申请提供一种计算机程序产品,当该计算机程序产品被计算机读取并执行时,上述第一方面任意一项所述的方法将被执行。In an eleventh aspect, the present application provides a computer program product, when the computer program product is read and executed by a computer, the method described in any one of the above-mentioned first aspect will be executed.
第十二方面,本申请提供一种计算机程序产品,当该计算机程序产品被计算机读取并执行时,上述第二方面任意一项所述的方法将被执行。In a twelfth aspect, the present application provides a computer program product, when the computer program product is read and executed by a computer, the method described in any one of the above-mentioned second aspects will be executed.
第十三方面,本申请提供一种计算机程序,当该计算机程序在计算机上执行时,将会使该计算机实现上述第一方面任意一项所述的方法。In a thirteenth aspect, the present application provides a computer program, which, when executed on a computer, enables the computer to implement the method described in any one of the above-mentioned first aspect.
第十四方面,本申请提供一种计算机程序,当该计算机程序在计算机上执行时,将会使该计算机实现上述第二方面任意一项所述的方法。In a fourteenth aspect, the present application provides a computer program, which, when executed on a computer, enables the computer to implement the method described in any one of the above-mentioned second aspects.
综上所述,深度非线性误差是由于光信号的波形不是标准波形(例如不是标准的正弦波等)导致的非线性误差,且该非线性误差的误差量类似于正弦波,随距离改变而震荡,误差量有正有负。因此,在本申请中,通过多次在拍摄设备的光源比传感器延迟启动的情况下采样以及根据上述n个初始深度图像所做的均值处理,使得非线性误差中正负的误差量可以互相抵消,从而可以减少测量过程中引入的深度非线性误差。同时基于该采样和均值处理等操作得到的视场相位补正系数矩阵可以补正深度图像中每个像素的深度值,减少了视场相位造成的误差,从而极大地降低了最终得到的深度图像的失真率,提高深度图像的质量。To sum up, the deep nonlinear error is a nonlinear error caused by the waveform of the optical signal not being a standard waveform (for example, not a standard sine wave, etc.), and the error amount of the nonlinear error is similar to a sine wave, which varies with the distance. Oscillation, the amount of error is positive and negative. Therefore, in the present application, the positive and negative error amounts in the nonlinear error can be canceled each other by sampling multiple times when the light source of the photographing device is started later than the sensor and performing the averaging process according to the above-mentioned n initial depth images. , which can reduce the depth nonlinear error introduced in the measurement process. At the same time, the field of view phase correction coefficient matrix obtained based on the sampling and averaging processing can correct the depth value of each pixel in the depth image, reduce the error caused by the field of view phase, and greatly reduce the distortion of the final depth image. rate to improve the quality of the depth image.
附图说明Description of drawings
图1所示为本申请实施例提供的一种深度图像处理方法适用的场景示意图;FIG. 1 shows a schematic diagram of a scene to which a depth image processing method provided by an embodiment of the present application is applicable;
图2所示为本申请实施例提供的一种深度图像补正量的训练流程示意图;FIG. 2 shows a schematic diagram of a training flow of a depth image correction amount provided by an embodiment of the present application;
图3所示为本申请实施例提供的一种拍摄场景示意图;FIG. 3 shows a schematic diagram of a shooting scene provided by an embodiment of the present application;
图4所示为本申请实施例提供的一种深度非线性误差的示意图;FIG. 4 shows a schematic diagram of a depth nonlinear error provided by an embodiment of the present application;
图5所示为本申请实施例提供的一种深度图像处理方法的流程示意图;FIG. 5 shows a schematic flowchart of a depth image processing method according to an embodiment of the present application;
图6为本方案实施例提供的另一种深度图像处理方法的流程示意图;FIG. 6 is a schematic flowchart of another depth image processing method provided by the embodiment of this solution;
图7为本方案实施例提供的拍摄设备的逻辑结构示意图;FIG. 7 is a schematic diagram of the logical structure of the photographing device provided by the embodiment of this solution;
图8为本方案实施例提供的计算设备的逻辑结构示意图;FIG. 8 is a schematic diagram of a logical structure of a computing device provided by an embodiment of this solution;
图9为本方案实施例提供的拍摄设备的硬件结构示意图;FIG. 9 is a schematic diagram of the hardware structure of the photographing device provided by the embodiment of this solution;
图10为本方案实施例提供的计算设备的硬件结构示意图。FIG. 10 is a schematic diagram of a hardware structure of a computing device according to an embodiment of this solution.
具体实施方式detailed description
下面结合附图对本申请的实施例进行描述。The embodiments of the present application will be described below with reference to the accompanying drawings.
图1所示为本申请实施例提供的一种深度图像处理方法适用的一种场景示意图。该场景包括拍摄设备101和拍摄对象102。拍摄设备101中包括光源1011、控制器1012、传感器1013和处理器1014。其中,光源1011、控制器1012、传感器1013和处理器1014之间可以互相通过线路和/或接口连接。FIG. 1 is a schematic diagram of a scene to which a depth image processing method provided by an embodiment of the present application is applicable. The scene includes a photographing device 101 and a photographing subject 102 . The photographing device 101 includes a light source 1011 , a controller 1012 , a sensor 1013 and a processor 1014 . The light source 1011 , the controller 1012 , the sensor 1013 and the processor 1014 may be connected to each other through lines and/or interfaces.
拍摄设备101用于通过时间测距法对拍摄对象102进行摄像获取该拍摄对象102的深度图像。时间测距法可以包括例如飞行时间(time of flight,TOF)测距法和激光雷达测距 法等。The photographing device 101 is used for photographing the photographing object 102 by using the temporal ranging method to obtain a depth image of the photographing object 102 . Time ranging methods may include, for example, time of flight (TOF) ranging methods, lidar ranging methods, and the like.
以TOF测距法为例介绍获取深度图像的过程。具体的,拍摄设备101中的控制器1012可以向光源1011和传感器1013发送启动信号启动光源1011和传感器1013。然后,光源1011向拍摄对象102发射光信号,光信号到达拍摄对象102之后反射回来,拍摄设备101通过传感器1013接收反射回来的反射光信号。然后,拍摄设备101可以通过接收的反射光信号和发送的光信号之间的相位差计算出光信号在拍摄设备101与拍摄对象102的任意一点之间传输的时间差t 1j,该j的取值范围为[1,m],该m为拍摄设备101向该拍摄对象102采样的点数,对应到拍摄对象102的深度图像,那么该m该深度图像的像素矩阵中的像素个数。根据该时间差t 1j和光信号的传播速度c计算出拍摄设备101与该任意一点之间的距离D1 j:D1 j=c*t 1j/2。其中,t 1j=φ j/(2πf),f为光信号的频率,φ j=arctan[(Q 3j-Q 1j)/(Q 0j-Q 2j)],Q 0、Q 1、Q 2和Q 3分别为传感器以0度、90度、180度和270度的时间域相位差曝光所获取的4张影像,Q 0j、Q 1j、Q 2j和Q 3j分别为Q 0、Q 1、Q 2和Q 3这四张影像中与该任意一点对应的像素点的像素值。 Taking the TOF ranging method as an example, the process of acquiring depth images is introduced. Specifically, the controller 1012 in the photographing device 101 may send an activation signal to the light source 1011 and the sensor 1013 to activate the light source 1011 and the sensor 1013 . Then, the light source 1011 transmits a light signal to the photographing object 102 , and the light signal reaches the photographing object 102 and is reflected back, and the photographing device 101 receives the reflected light signal through the sensor 1013 . Then, the photographing device 101 can calculate the time difference t 1j that the optical signal transmits between the photographing device 101 and any point of the photographing object 102 through the phase difference between the received reflected light signal and the transmitted optical signal, and the value range of j is [1, m], where m is the number of points sampled by the photographing device 101 to the photographing object 102 , corresponding to the depth image of the photographing object 102 , then the m is the number of pixels in the pixel matrix of the depth image. The distance D1 j between the photographing device 101 and the arbitrary point is calculated from the time difference t 1j and the propagation speed c of the optical signal: D1 j =c*t 1j /2. where t 1jj /(2πf), f is the frequency of the optical signal, φ j =arctan[(Q 3j -Q 1j )/(Q 0j -Q 2j )], Q 0 , Q 1 , Q 2 and Q 3 is the 4 images acquired by the sensor with the time domain phase difference exposure of 0, 90, 180 and 270 degrees, respectively, Q 0j , Q 1j , Q 2j and Q 3j are Q 0 , Q 1 , Q 2 and Q 3 are the pixel values of these four pixels in the image corresponding to any point.
或者,拍摄设备101也可以记录发射光信号的时刻和记录接收到反射光信号的时刻,计算该两个时刻的差即可计算出光信号在拍摄设备101与拍摄对象102的任意一点之间传输的时间差t 2j,然后,再根据该时间差t 2j和光信号的传播速度c计算出拍摄设备101与该任意一点之间的距离D 2j:D 2j=c*t 2j/2。 Alternatively, the photographing device 101 can also record the moment when the light signal is emitted and the moment when the reflected light signal is received, and by calculating the difference between the two times, the optical signal transmitted between the photographing device 101 and any point of the photographing object 102 can be calculated. time difference t 2j , and then, according to the time difference t 2j and the propagation speed c of the optical signal, the distance D 2j between the photographing device 101 and the arbitrary point is calculated: D 2j =c*t 2j /2.
通过这两种方式中的任一种方式,拍摄设备101可以获取到拍摄对象102的深度图像中每一个像素点的深度值,该深度值即为拍摄设备101与该像素点对应的拍摄对象102中的某一点之间的距离的值,也可以称为该像素点的像素值。获取该深度图像的每一个像素点的像素值之后即可得到该深度图像的像素矩阵,对于设备来说,该像素矩阵即为该拍摄对象102的深度图像。In either of these two ways, the photographing device 101 can obtain the depth value of each pixel in the depth image of the photographing object 102 , and the depth value is the photographing object 102 corresponding to the pixel by the photographing device 101 . The value of the distance between a certain point in , can also be called the pixel value of the pixel point. After acquiring the pixel value of each pixel of the depth image, the pixel matrix of the depth image can be obtained. For the device, the pixel matrix is the depth image of the photographing object 102 .
需要说明的是,上述两种获取深度图像的方式中,根据TOF测距法测量得到的测量数据进行的深度值的计算可以在上述拍摄设备101中执行,也可以是拍摄设备101得到这些测量数据之后将这些测量数据发送给其它设备例如云端的服务器等来进行深度值的计算。另外,控制器1012还可以用于延迟控制,其功能为调整光源1011与传感器1013之间的启动的时间差,可用于各种校准。该控制器1012可以是集成芯片中的控制电路,其原理为利用电阻电容RC电路产生延迟,例如,控制器1012可以通过RC电路使得光源1011比传感器1013延迟启动或者提前启动。或者,该控制器也可以是通过软件来实现的控制单元,通过软件逻辑来调整光源1011与传感器1013之间的启动的时间差。It should be noted that, in the above two methods of acquiring depth images, the calculation of the depth value based on the measurement data obtained by the TOF ranging method may be performed in the above-mentioned photographing device 101, or the photographing device 101 may obtain these measurement data. These measurement data are then sent to other devices, such as servers in the cloud, for depth value calculation. In addition, the controller 1012 can also be used for delay control, the function of which is to adjust the time difference between the activation of the light source 1011 and the sensor 1013, which can be used for various calibrations. The controller 1012 can be a control circuit in an integrated chip, the principle of which is to use a resistor-capacitor RC circuit to generate a delay. For example, the controller 1012 can make the light source 1011 start later than the sensor 1013 or start earlier than the sensor 1013 through the RC circuit. Alternatively, the controller may also be a control unit implemented by software, and the time difference between the activation of the light source 1011 and the sensor 1013 is adjusted by software logic.
需要说明的是,在本申请中,光源1011的启动指的是光源1011开始向拍摄对象102发射光信号,传感器1013的启动指的是传感器1013开始能够接收拍摄对象102反射回来的光信号。而光源1011比传感器1013延迟启动指的是光源1011开始发射光信号的时刻比传感器1013开始能够接收反射光信号的时刻延迟。光源1011比传感器1013提前启动指的是光源1011开始发射光信号的时刻比传感器1013开始能够接收反射光信号的时刻提前。激光雷达测距法可以通过激光扫描的方式得到场景的三维信息。其基本原理是按照一定时间间隔向空间发射激光,并记录各个扫描点的信号从激光雷达到被测场景中的物体(例如拍摄对象102),随后又经过物体反射回到激光雷达的相隔时间,据此推算出物体表面与激 光雷达之间的距离,从而可以得到被测场景中的物体的深度图像。It should be noted that, in this application, the activation of the light source 1011 means that the light source 1011 starts to emit light signals to the photographed object 102 , and the activation of the sensor 1013 means that the sensor 1013 begins to receive the light signal reflected by the photographed object 102 . The light source 1011 starts later than the sensor 1013 means that the time when the light source 1011 starts to emit the light signal is delayed than the time when the sensor 1013 starts to receive the reflected light signal. The light source 1011 starts earlier than the sensor 1013 means that the time when the light source 1011 starts to emit light signals is earlier than the time when the sensor 1013 starts to receive the reflected light signals. The LiDAR ranging method can obtain the three-dimensional information of the scene by means of laser scanning. The basic principle is to emit laser light into space according to a certain time interval, and record the signal of each scanning point from the lidar to the object in the measured scene (for example, the object 102), and then pass the time interval when the object reflects back to the lidar, Based on this, the distance between the surface of the object and the lidar can be calculated, so that the depth image of the object in the measured scene can be obtained.
拍摄设备101可以是各种类型的相机、手机、平板、电脑、各种类型的摄像头以及激光雷达等等。光源1011可以是发光二极管(light emitting diode,LED)或激光器等,激光器可以包括垂直腔面发射激光器(vertical-cavity surface-emitting laser,VCSEL)或激光二极管等。控制器1012可以是控制电路或者控制芯片等。传感器1013可以是由感光元件组成的光感传感器或者图像传感器或者说影像传感器等。The photographing device 101 may be various types of cameras, mobile phones, tablets, computers, various types of cameras, lidars, and the like. The light source 1011 may be a light emitting diode (LED) or a laser or the like, and the laser may include a vertical-cavity surface-emitting laser (VCSEL) or a laser diode or the like. The controller 1012 may be a control circuit or a control chip or the like. The sensor 1013 may be a photosensitive sensor or an image sensor or an image sensor or the like composed of photosensitive elements.
处理器1014可以包括一个或多个处理器,例如,处理器1014可以包括一个或多个中央处理器(central processing unit,CPU)和一个或多个图形处理器(graphics processing unit,GPU)。当处理器1014包括多个处理器时,这多个处理器可以集成在同一块芯片上,也可以各自为独立的芯片。The processor 1014 may include one or more processors, for example, the processor 1014 may include one or more central processing units (CPUs) and one or more graphics processing units (GPUs). When the processor 1014 includes multiple processors, the multiple processors may be integrated on the same chip, or may be independent chips.
在本申请实施例中,CPU可以用于控制上述控制器1012、光源1011和传感器1013完成上述时间测距法的实现,从而获取到测量的数据。GPU可以用于根据这些测量的数据进行计算获得深度图像。这些计算可以包括获取视场相位补正系数矩阵的计算、获取FPN矩阵的计算、补正深度图像的像素值的视场相位误差的计算以及消减深度图像的像素值的固定模式噪声的计算中的一项或多项。这些具体的计算过程可以参见下面的描述,此处暂不详述。In this embodiment of the present application, the CPU may be used to control the above-mentioned controller 1012 , the light source 1011 and the sensor 1013 to implement the above-mentioned time ranging method, thereby acquiring the measured data. The GPU can be used to perform calculations based on these measured data to obtain depth images. These calculations may include one of a calculation of acquiring a field-of-view phase correction coefficient matrix, a calculation of acquiring an FPN matrix, a calculation of correcting a field-of-view phase error of pixel values of a depth image, and a calculation of reducing fixed pattern noise of pixel values of a depth image or more. These specific calculation processes can be found in the following description, which will not be described in detail here.
当然,在另一种可能的实施方式中,处理器1014可以包括一个或多个中央处理器CPU,上述各种计算都可以由CPU来完成。Of course, in another possible implementation, the processor 1014 may include one or more central processing units (CPUs), and the above-mentioned various calculations may be performed by the CPUs.
本申请实施例提供的一种深度图像处理方法适用的场景示意图不限于上述图1所示场景,可以应用本申请实施例提供的深度图像处理方法的场景均在本申请的保护范围之内。A schematic diagram of a scene to which the depth image processing method provided by the embodiment of the present application is applicable is not limited to the scene shown in FIG. 1 above, and the scenes to which the depth image processing method provided by the embodiment of the present application can be applied are all within the protection scope of the present application.
在具体实施例中,拍摄设备在获取拍摄对象的深度图像时,由于温度偏移造成的误差、深度非线性误差、全局时间偏移造成的误差、固定模式噪声FPN以及视场相位误差等导致获得的深度图像失真。其中,视场相位误差为由于视场的角度偏差导致的误差,固定噪声为由硬件导致的在深度图像的每一个像素中产生的固定误差。In a specific embodiment, when the photographing device acquires the depth image of the photographed object, the error caused by temperature offset, depth nonlinearity error, error caused by global time offset, fixed pattern noise FPN and field of view phase error, etc. The depth image is distorted. Among them, the phase error of the field of view is the error caused by the angular deviation of the field of view, and the fixed noise is the fixed error caused by hardware in each pixel of the depth image.
为了降低深度图像的失真率,获取高质量的深度图像,本申请提供了一种深度图像处理方法,可以通过视场相位补正系数矩阵来补正深度图像的视场相位误差和/或通过FPN矩阵来减少固定模式噪声,从而能够极大地降低获得的深度图像的失真率,提高深度图像的质量。In order to reduce the distortion rate of the depth image and obtain the high-quality depth image, the present application provides a depth image processing method, which can correct the field of view phase error of the depth image through the field of view phase correction coefficient matrix and/or use the FPN matrix to correct the field of view phase error of the depth image. The fixed pattern noise is reduced, so that the distortion rate of the obtained depth image can be greatly reduced, and the quality of the depth image can be improved.
在本申请实施例中,可以提前训练获得视场相位补正系数矩阵和/或FPN矩阵,训练获得视场相位补正系数矩阵和/或FPN矩阵是消减了深度非线性误差之后获得的,从而可以进一步降低深度图像的失真率。In the embodiment of the present application, the field of view phase correction coefficient matrix and/or the FPN matrix can be obtained by training in advance, and the field of view phase correction coefficient matrix and/or the FPN matrix obtained by training is obtained after reducing the depth nonlinear error, so that further Reduce the distortion rate of depth images.
下面首先介绍获得视场相位补正系数矩阵和FPN矩阵的训练过程。参见图2,该训练过程可以包括但不限于如下步骤:The following first introduces the training process for obtaining the field-of-view phase correction coefficient matrix and the FPN matrix. Referring to Figure 2, the training process may include but is not limited to the following steps:
S201、搭建拍摄设备和拍摄对象。S201. Build shooting equipment and shooting objects.
该训练过程中,拍摄对象可以是一个平整的平面,即以平整平面作为标定基准进行训练,可以参见图3,图3所示为训练的场景示意图。在图3中,该平面301在拍摄设备的光源302发出的光信号可到达的范围之内,这样可以保证采样到平面上的每一个点。且拍摄设备的镜头光轴与该平面301垂直。图3中所示的平面301中的A点可以是离镜头最近 的点,该A点可以是该平面301中的任意一点,不限于是该平面301的中心点。搭建好平面和拍摄设备之后,即可开始进行拍摄。In the training process, the shooting object may be a flat plane, that is, the training is performed using the flat plane as a calibration reference, as shown in FIG. 3 , which is a schematic diagram of a training scene. In FIG. 3 , the plane 301 is within the reachable range of the light signal emitted by the light source 302 of the photographing device, so that every point on the plane can be sampled. And the optical axis of the lens of the photographing device is perpendicular to the plane 301 . The point A in the plane 301 shown in FIG. 3 can be the point closest to the lens, and the point A can be any point in the plane 301, and is not limited to the center point of the plane 301. Once you have set up your plane and shooting equipment, you can start shooting.
S202、基于时间测距法测量获取拍摄对象的深度图像。S202. Measure and acquire a depth image of the photographed object based on the time ranging method.
在本申请实施例的训练过程中不管是采用TOF测距法还是激光雷达测距法或者其它测距法,需要多次测量获取拍摄对象的多个深度图像,每次测量都可以得到拍摄对象的一个深度图像。In the training process of the embodiment of the present application, whether the TOF ranging method, the lidar ranging method or other ranging methods are used, multiple measurements are required to obtain multiple depth images of the shooting object, and each measurement can obtain the shooting object's depth image. a depth image.
需要说明的是,通过多次测量得到测量数据之后,可以在拍摄设备上根据这些测量数据进行后续的各种计算,或者,也可以是拍摄设备得到这些测量数据之后将这些测量数据发送给其它设备例如云端的服务器等来进行后续的各种计算,或者,也可以是拍摄设备和该其它设备例如云端的服务器各自完成一部分的计算等。这些计算可以包括基于这些测量数据进行的深度值的计算、曲面拟合、取平均和取比值等计算,下面会介绍这些计算过程,此处暂不详述。为了便于描述,下面将执行这些计算操作的设备称为计算设备,该计算设备既可以是拍摄设备,或者,也可以是云端服务器等。It should be noted that after obtaining the measurement data through multiple measurements, various subsequent calculations can be performed on the shooting device according to the measurement data, or the shooting device can send the measurement data to other devices after obtaining the measurement data. For example, a server in the cloud performs various subsequent calculations, or, the photographing device and the other device, such as a server in the cloud, each perform a part of the calculation and the like. These calculations may include calculations of depth values, surface fitting, averaging, and ratio calculations based on these measurement data. These calculation processes will be introduced below, and will not be described in detail here. For ease of description, a device that performs these computing operations is referred to as a computing device below, and the computing device may be a photographing device or a cloud server or the like.
在具体实施例中,可以进行n次测量,该n次中第i次的光源的启动时刻比传感器的启动时刻延迟(i-1)*Δt,该i的取值范围为[1,n],n*︱Δt︱=k*T,该T为光源发出的光信号的周期,该n为大于1的整数,该k为整数,该Δt为预设时长。In a specific embodiment, n times of measurement can be performed, and the starting time of the i-th light source in the n times is delayed by (i-1)*Δt from the starting time of the sensor, and the value range of i is [1, n] , n*︱Δt︱=k*T, where T is the period of the light signal emitted by the light source, n is an integer greater than 1, k is an integer, and Δt is a preset duration.
该Δt可以是正数也可以负数。当该Δt为正数时,那么,上述光源的启动时刻比传感器的启动时刻延迟(i-1)*Δt指的是传感器比光源早启动(i-1)*Δt时长;当该Δt为负数时,那么,上述光源的启动时刻比传感器的启动时刻延迟(i-1)*Δt指的是光源比传感器早启动(i-1)*(-Δt)时长。该Δt可以是0以外的任意一个取值。该光源和传感器即为拍摄设备中的光源和传感器,例如,可以是图1中所示的光源1011和传感器1013。The Δt may be a positive number or a negative number. When the Δt is a positive number, then the activation time of the light source is delayed (i-1)*Δt from the activation time of the sensor, which means that the sensor is activated earlier than the light source by (i-1)*Δt; when the Δt is a negative number Then, the activation time of the light source is delayed by (i-1)*Δt from the activation time of the sensor, which means that the light source is activated earlier than the sensor by (i-1)*(-Δt) time. The Δt can be any value other than 0. The light source and the sensor are the light source and the sensor in the photographing device, for example, the light source 1011 and the sensor 1013 shown in FIG. 1 .
上述光源的启动时刻指的是光源开始发射光信号的时刻,具体的,光源的启动时刻可以是光源向拍摄对象例如上述图3所示的平面301发射光信号的时刻。The start-up time of the light source refers to the time when the light source starts to emit light signals. Specifically, the start-up time of the light source may be the time when the light source emits light signals to the photographed object such as the plane 301 shown in FIG. 3 .
上述传感器的启动时刻指的是传感器开始能够接收反射光信号的时刻,具体的,传感器开始能够接收反射光信号的时刻可以是传感器开始能够接收拍摄对象例如上述图3所示的平面301反射的光信号的时刻。该反射的光信号是光源发射的光信号到达拍摄对象例如上述图3所示的平面301后向拍摄设备反射回来的光信号,然后拍摄设备通过该传感器来接收该反射的光信号。The startup moment of the above-mentioned sensor refers to the moment when the sensor starts to receive the reflected light signal. Specifically, the moment when the sensor starts to receive the reflected light signal may be the moment when the sensor starts to receive the light reflected from the photographed object, such as the plane 301 shown in FIG. 3 . signal moment. The reflected light signal is the light signal emitted by the light source that reaches the photographing object such as the plane 301 shown in FIG. 3 and is reflected back to the photographing device, and then the photographing device receives the reflected light signal through the sensor.
为了便于理解上述光源的启动时刻和传感器的启动时刻,下面举例说明。示例性地,在第1秒时,光源开始发射光信号,即光源的启动时刻为该第1秒;在第2秒时,传感器开始能够接收反射光信号,即该传感器的启动时刻为该第2秒;在第3秒时,传感器开始接收到反射光信号。这里,在第2秒时传感器可以开始去接收反射光信号,但是还没有反射光信号传输到达传感器,因此第2秒时传感器没有接收到反射光信号。在第3秒时,反射光信号开始传输到达传感器,因此传感器在第3秒开始接收到反射光信号。这里只是示例性地介绍说明,至于具体的光源的启动时刻、传感器的启动时刻以及传感器开始接收到反射光信号的时刻根据实际情况确定,本方案对此不作限制。In order to facilitate the understanding of the start-up time of the light source and the start-up time of the sensor, an example is given below. Exemplarily, at the first second, the light source starts to emit light signals, that is, the start time of the light source is the first second; at the second second, the sensor begins to receive the reflected light signal, that is, the start time of the sensor is the first second. 2 seconds; at 3 seconds, the sensor begins to receive reflected light signals. Here, the sensor can start to receive the reflected light signal at the second second, but the reflected light signal has not yet transmitted to the sensor, so the sensor does not receive the reflected light signal at the second second. At the 3rd second, the reflected light signal starts to transmit to the sensor, so the sensor starts to receive the reflected light signal at the 3rd second. This is just an exemplary description. The specific start-up time of the light source, the start-up time of the sensor, and the time when the sensor starts to receive the reflected light signal are determined according to the actual situation, which is not limited in this solution.
上述n次中第i次的光源的启动时刻比传感器的启动时刻延迟(i-1)*Δt表明,对于光源的启动时刻比传感器的启动时刻延迟,每一次的测量都比前一次的测量多延迟Δt。The starting time of the i-th light source in the above n times is delayed from the starting time of the sensor by (i-1)*Δt, indicating that the starting time of the light source is delayed than the starting time of the sensor, and each measurement is more than the previous one. Delay Δt.
示例性地,假设n为4,那么:Exemplarily, assuming n is 4, then:
第1次测量时,光源的启动时刻比传感器的启动时刻延迟0,即光源和传感器同时启动,该同时启动指的是光源开始发射光信号的时刻和传感器开始能够接收反射光信号的时刻相同;In the first measurement, the start-up time of the light source is 0 delayed from the start-up time of the sensor, that is, the light source and the sensor start at the same time, which means that the time when the light source starts to emit light signals is the same as the time when the sensor starts to receive reflected light signals;
第2次测量时,光源的启动时刻比传感器的启动时刻延迟Δt;In the second measurement, the start-up time of the light source is delayed by Δt from the start-up time of the sensor;
第3次测量时,光源的启动时刻比传感器的启动时刻延迟2*Δt;In the third measurement, the start-up time of the light source is delayed by 2*Δt from the start-up time of the sensor;
第4次测量时,光源的启动时刻比传感器的启动时刻延迟3*Δt。In the fourth measurement, the activation time of the light source is delayed by 3*Δt from the activation time of the sensor.
这里只是举例说明,至于进行几次测量,n的具体取值根据实际需要确定,本方案对此不做限制。This is just an example. As for several measurements, the specific value of n is determined according to actual needs, which is not limited in this solution.
上述n*︱Δt︱=k*T表明,n次延迟的总时间量是光源发出的光信号的周期的整数倍。具体的,上述光源和传感器的启动时刻可以由控制器来控制,该控制器可以是图1中所述的控制器1012。即控制器可以利用电阻电容RC电路产生延迟或者利用软件来产生延迟,从而实现光源比传感器延迟启动(i-1)*Δt。The above n*︱Δt︱=k*T indicates that the total time amount of n delays is an integer multiple of the period of the optical signal emitted by the light source. Specifically, the activation timing of the above-mentioned light sources and sensors may be controlled by a controller, and the controller may be the controller 1012 described in FIG. 1 . That is, the controller can use the resistor-capacitor RC circuit to generate a delay or use software to generate a delay, so that the light source can be started later than the sensor by (i-1)*Δt.
上述光源比传感器延迟启动指的是光源开始发射光信号的时刻比传感器开始能够接收反射光信号的时刻延迟。光源比传感器提前启动指的是光源开始发射光信号的时刻比传感器开始能够接收反射光信号的时刻提前。The above-mentioned delay in starting the light source from the sensor means that the time when the light source starts to emit the light signal is delayed from the time when the sensor starts to receive the reflected light signal. The light source starts earlier than the sensor means that the time when the light source starts to emit the light signal is earlier than the time when the sensor starts to receive the reflected light signal.
上述进行n次测量,并设置延迟Δt使得n*︱Δt︱=k*T是为了减少深度非线性误差。当主动式光源的发射波型与传感器的激活波型不是完美的正弦波时,所测得的深度值会产生非线性误差。非线性误差在不同的距离下有不同的误差值,其误差量与深度的关系与正弦波类似,随距离改变而震荡,且具备周期重复性。如图4所示为100Mhz频率下的深度非线性误差示例,其中x轴为深度值,y轴为深度对应的非线性误差量,可观察到此非线性误差存在周期性震荡与0和(完整周期内之误差总和为0)两种特性。下面再介绍如何利用周期性震荡与0和这两个特性来消减深度非线性误差,此处暂不详述。The purpose of performing n measurements above and setting the delay Δt so that n*︱Δt︱=k*T is to reduce the deep nonlinearity error. When the emission waveform of the active light source and the activation waveform of the sensor are not perfect sine waves, the measured depth value will produce nonlinear errors. The nonlinear error has different error values at different distances. The relationship between the error amount and the depth is similar to that of a sine wave. It oscillates with the distance and has periodic repeatability. Figure 4 shows an example of the depth nonlinear error at a frequency of 100Mhz, where the x-axis is the depth value, and the y-axis is the nonlinear error corresponding to the depth. It can be observed that this nonlinear error has periodic oscillations and 0 and (complete The sum of the errors in the cycle is 0) two characteristics. Next, we will introduce how to use periodic oscillation and 0 and these two characteristics to reduce the depth nonlinear error, which will not be described in detail here.
示例性地,第1次测量时,拍摄设备中的光源和传感器同时启动,即光源启动向拍摄对象发射光信号的同时传感器也开始感应拍摄对象反射回来的光信号,然后,计算设备基于发射的光信号的信息和反射回来的光信号的信息根据上述对图1的描述中介绍的计算方法计算得到拍摄对象的深度图像的各个像素点的深度值,从而得到该拍摄对象的深度图像D1(x,y),该深度图像D1(x,y)可以称为第1初始深度图像。其中,该D1(x,y)为该第1初始深度图像的像素矩阵,对于设备来说D1(x,y)即为该第1初始深度图像。该像素矩阵D1(x,y)中每个像素值为该拍摄设备与该每一个像素点对应的拍摄对象中某一点之间的距离的值即深度值。Exemplarily, during the first measurement, the light source and the sensor in the photographing device are activated at the same time, that is, when the light source starts to emit a light signal to the photographed object, the sensor also begins to sense the light signal reflected by the photographed object, and then the computing device is based on the emitted light signal. The information of the optical signal and the information of the reflected optical signal are calculated according to the calculation method described in the above description of FIG. , y), the depth image D1(x, y) can be called the first initial depth image. Wherein, the D1(x, y) is the pixel matrix of the first initial depth image, and for the device, D1(x, y) is the first initial depth image. Each pixel value in the pixel matrix D1 (x, y) is a value of the distance between the photographing device and a certain point in the photographing object corresponding to each pixel point, that is, a depth value.
上述D1(x,y)中,x表示像素矩阵的行数,y表示像素矩阵的列数,即D1(x,y)为x行y列的像素矩阵。下面所涉及的矩阵中的x和y也是分别表示矩阵的行数和列数,在此说明,下面将不再赘述。In the above D1(x,y), x represents the number of rows of the pixel matrix, and y represents the number of columns of the pixel matrix, that is, D1(x,y) is a pixel matrix of x rows and y columns. The x and y in the matrix involved below also represent the number of rows and columns of the matrix, respectively, which are described here and will not be repeated below.
第i(i大于1时)次测量时,拍摄设备中的光源的启动时刻比传感器的启动时刻延迟(i-1)*Δt,在此情况下光源向拍摄对象发射光信号,然后传感器感应拍摄对象反射回来的光信号,计算设备基于发射的光信号的信息和反射回来的光信号的信息根据上述对图1的描述中介绍的计算方法计算得到拍摄对象的深度图像的各个像素点的深度值,从而得到该拍 摄对象的深度图像Di(x,y)’,由于该深度图像Di(x,y)’是直接根据测量的数据计算得到,因此可以称该深度图像Di(x,y)’为第i测量深度图像。其中,该Di(x,y)’为该第i测量深度图像的像素矩阵,对于设备来说Di(x,y)’即为该第i测量深度图像。该像素矩阵Di(x,y)’中每个像素值为根据测量的数据计算得到的该拍摄设备与该每一个像素点对应的拍摄对象中某一点之间的距离的值即深度值。In the i-th (when i is greater than 1) measurement, the activation time of the light source in the photographing device is delayed by (i-1)*Δt from the activation time of the sensor, in this case, the light source emits a light signal to the subject, and then the sensor senses the shooting For the optical signal reflected by the object, the computing device calculates the depth value of each pixel of the depth image of the photographed object based on the information of the transmitted optical signal and the information of the reflected optical signal according to the calculation method described in the above description of FIG. 1 . , so as to obtain the depth image Di(x,y)' of the subject. Since the depth image Di(x,y)' is directly calculated from the measured data, it can be called the depth image Di(x,y)' Measure the depth image for the ith. Wherein, the Di(x,y)' is the pixel matrix of the i-th measurement depth image, and Di(x,y)' is the i-th measurement depth image for the device. Each pixel value in the pixel matrix Di(x,y)' is a value of the distance between the shooting device and a certain point in the shooting object corresponding to each pixel point calculated according to the measured data, that is, the depth value.
但是,由于光源启动延迟了(i-1)*Δt,那么相当于传感器接收到反射光信号延迟了(i-1)*Δt,导致计算得到的光信号的传输时间增加了(i-1)*Δt,使得根据该传输时间计算得到的深度值增加了c*[(i-1)*Δt]/2,因此,第i测量深度图像中的各个像素的深度值要减去c*[(i-1)*Δt]/2才是真正的深度值,或者说加上c*[(1-i)*Δt]/2才是真正的深度值。即该c*[(1-i)*Δt]/2或者该c*[(i-1)*Δt]/2为由于光源比传感器的启动时刻延迟了(i-1)*Δt产生的距离差。However, since the start of the light source is delayed by (i-1)*Δt, it is equivalent to a delay of (i-1)*Δt when the sensor receives the reflected light signal, resulting in an increase in the transmission time of the calculated optical signal by (i-1) *Δt, so that the depth value calculated according to the transmission time increases by c*[(i-1)*Δt]/2. Therefore, the depth value of each pixel in the i-th measured depth image should be subtracted by c*[(( i-1)*Δt]/2 is the real depth value, or adding c*[(1-i)*Δt]/2 is the real depth value. That is, the c*[(1-i)*Δt]/2 or the c*[(i-1)*Δt]/2 is the distance that the light source is delayed by (i-1)*Δt from the activation time of the sensor Difference.
那么,基于第i次测量最终计算得到的第i初始深度图像可以用像素矩阵Di(x,y)来表示,对于设备来说该Di(x,y)即为该第i初始深度图像,该像素矩阵Di(x,y)为像素矩阵Di(x,y)’中的每个像素值分别与c*[(1-i)*Δt]/2相加得到。或者,该像素矩阵Di(x,y)为像素矩阵Di(x,y)’中的每个像素值分别与c*[(i-1)*Δt]/2相减得到。Then, the i-th initial depth image finally calculated based on the i-th measurement can be represented by a pixel matrix Di(x, y). For the device, the Di(x, y) is the i-th initial depth image, and the The pixel matrix Di(x,y) is obtained by adding each pixel value in the pixel matrix Di(x,y)' and c*[(1-i)*Δt]/2 respectively. Or, the pixel matrix Di(x,y) is obtained by subtracting each pixel value in the pixel matrix Di(x,y)' from c*[(i-1)*Δt]/2 respectively.
对于上述第1次测量,由于传感器和光源同时启动,没有时间延迟,那么基于测量数据得到的第1测量深度图像即为上述第1初始深度图像,无需考虑时间延迟导致的距离差。需要说明的是,根据上述步骤计算得到的n个初始深度图像D1(x,y)~Dn(x,y)的大小均相同,即该D1(x,y)~Dn(x,y)为n个行数相等且列数相等的矩阵。For the above-mentioned first measurement, since the sensor and the light source are activated at the same time and there is no time delay, the first measured depth image obtained based on the measurement data is the above-mentioned first initial depth image, and the distance difference caused by the time delay does not need to be considered. It should be noted that the sizes of the n initial depth images D1(x,y)~Dn(x,y) calculated according to the above steps are all the same, that is, the D1(x,y)~Dn(x,y) are n matrices with equal number of rows and equal number of columns.
S203、对基于上述测量获得的n个初始深度图像进行曲面拟合。S203. Perform surface fitting on the n initial depth images obtained based on the above measurement.
计算设备获得上述n个初始深度图像D1(x,y)~Dn(x,y)之后,可以对该n个初始深度图像分别作曲面拟合得到n个拟合深度图像,该n个拟合深度图像的像素矩阵可以用Df1(x,y)~Dfn(x,y)来表示,第i初始深度图像曲面拟合得到的拟合深度图像为第i拟合深度图像Df i(x,y)。对于设备来说该Df i(x,y)即为该第i拟合深度图像。After the computing device obtains the above-mentioned n initial depth images D1(x,y)˜Dn(x,y), it can perform surface fitting on the n initial depth images respectively to obtain n fitted depth images. The pixel matrix of the depth image can be represented by Df1(x,y)~Dfn(x,y), and the fitted depth image obtained by surface fitting of the i-th initial depth image is the i-th fitted depth image Df i(x,y ). For the device, the Df i(x,y) is the i-th fitting depth image.
需要说明的是,根据上述步骤计算得到的n个拟合深度图像Df1(x,y)~Dfn(x,y)的大小均相同,即该Df1(x,y)~Dfn(x,y)为n个行数相等且列数相等的矩阵。另外,该n个拟合深度图像的大小于上述n个初始深度图像的大小相同,即该D1(x,y)~Dn(x,y)和该Df1(x,y)~Dfn(x,y)为2*n个行数相等且列数相等的矩阵。It should be noted that the sizes of the n fitted depth images Df1(x,y)~Dfn(x,y) calculated according to the above steps are all the same, that is, the Df1(x,y)~Dfn(x,y) is a matrix of n equal rows and equal columns. In addition, the size of the n fitted depth images is the same as the size of the above-mentioned n initial depth images, that is, the D1(x,y)~Dn(x,y) and the Df1(x,y)~Dfn(x, y) is a 2*n matrix with the same number of rows and the same number of columns.
可选的,上述曲面拟合的方法可以是最小二乘法的多项式曲面拟合或者其它适配函数的曲面拟合方法。具体的,获取到上述n个初始深度图像的像素矩阵后,可以先根据这些像素矩阵大致判断图像的近似函数类型,例如可以先利用画图软件或者仿真软件描绘或者仿真这些像素矩阵对应的散点图像,然后根据经验判断散点图像的近似函数类型,判断出近似的函数之后可以用该函数来分别拟合该n个初始深度图像,获得n个拟合深度图像。Optionally, the above-mentioned surface fitting method may be a polynomial surface fitting method of least squares or a surface fitting method using other fitting functions. Specifically, after obtaining the pixel matrices of the above n initial depth images, the approximate function type of the image can be roughly judged according to these pixel matrices. For example, drawing software or simulation software can be used to draw or simulate the scatter images corresponding to these pixel matrices. , and then judge the approximate function type of the scatter image according to experience. After judging the approximate function, the function can be used to fit the n initial depth images respectively to obtain n fitted depth images.
示例性地,假设该n个初始深度图像可以用最小二乘法的多项式曲面拟合方法来拟合,那么,拟合的多项式可以是式(1):surface(x,y)=p 00+p 10*x+p 01*y+p 20*x^2+p 11*x*y+p 02*y^2,或者,拟合的多项式可以是式(2):surface(x,y)=p 00+p 10*x+p 01*y+p 20*x^2+p 11*x*y+p 02*y^2+p 30*x^3+p 21*x^2*y+p 12*x*y^2+p 03*y^3+p 40*x^4+p 31*x^3*y+p 22*x^2*y^2+p 13*x*y^3+p 04*y^4。其中,该surface(x,y)即为上述Df i(x,y),p为多项式的 系数。通过拟合得到的深度图像,可以根据x和y的取值计算得到任意一个像素点的深度值。 Exemplarily, it is assumed that the n initial depth images can be fitted by the least squares polynomial surface fitting method, then the fitted polynomial can be equation (1): surface(x, y)=p 00 +p 10 *x+p 01 *y+p 20 *x^2+p 11 *x*y+p 02 *y^2, or the fitted polynomial can be equation (2): surface(x,y)= p 00 +p 10 *x+p 01 *y+p 20 *x^2+p 11 *x*y+p 02 *y^2+p 30 *x^3+p 21 *x^2*y+ p 12 *x*y^2+p 03 *y^3+p 40 *x^4+p 31 *x^3*y+p 22 *x^2*y^2+p 13 *x*y^ 3+p 04 *y^4. Wherein, the surface(x, y) is the above Df i(x, y), and p is the coefficient of the polynomial. Through the depth image obtained by fitting, the depth value of any pixel can be calculated according to the values of x and y.
在式(1)中单项式的最高次数为2,因此,如采用式(1)进行曲面拟合可以称为二次多项式曲面拟合。在式(2)中单项式的最高次数为4,因此,如采用式(2)进行曲面拟合可以称为四次多项式曲面拟合。多项式中单项式的最高次数需要根据实际需要确定,若太小则得到的拟合曲面与实际曲面差别较大,若太大则会出现过拟合的现象。In formula (1), the highest degree of the monomial is 2. Therefore, if formula (1) is used for surface fitting, it can be called quadratic polynomial surface fitting. The highest degree of the monomial in equation (2) is 4, therefore, surface fitting using equation (2) can be called quartic polynomial surface fitting. The highest degree of the monomial in the polynomial needs to be determined according to the actual needs. If it is too small, the obtained fitting surface will be quite different from the actual surface. If it is too large, overfitting will occur.
这里只是示例性地介绍以多项式进行曲面拟合,在具体实施例中,还可以采用其它适配的函数进行曲面拟合,本方案对此不做限制。Here, the polynomial is used for surface fitting only exemplarily. In a specific embodiment, other adaptive functions may also be used for surface fitting, which is not limited in this solution.
S204、根据S203计算得到的n个拟合深度图像计算拟合平均像素矩阵。S204. Calculate a fitted average pixel matrix according to the n fitted depth images calculated in S203.
在获得上述n个拟合深度图像Df1(x,y)~Dfn(x,y)之后,可以将该n个拟合深度图像的像素矩阵取平均得到拟合平均深度图像。拟合平均深度图像可以用拟合平均像素矩阵Dfa(x,y)表示,对于设备来说该拟合平均像素矩阵Dfa(x,y)即为该拟合平均深度图像。具体的,可以将该n个拟合深度图像的像素矩阵Df1(x,y)~Dfn(x,y)中相同下标的像素值分别取平均获得该拟合平均像素矩阵Dfa(x,y)。示例性地,具体的计算算式可以如下:After the above-mentioned n fitted depth images Df1(x,y)˜Dfn(x,y) are obtained, the pixel matrix of the n fitted depth images may be averaged to obtain a fitted average depth image. The fitted average depth image may be represented by a fitted average pixel matrix Dfa(x,y), and for the device, the fitted average pixel matrix Dfa(x,y) is the fitted average depth image. Specifically, the pixel values of the same subscripts in the pixel matrices Df1(x,y)~Dfn(x,y) of the n fitted depth images can be averaged respectively to obtain the fitted average pixel matrix Dfa(x,y) . Exemplarily, the specific calculation formula may be as follows:
Figure PCTCN2020098640-appb-000001
Figure PCTCN2020098640-appb-000001
在本申请实施例中,相同下标指的是在矩阵中行数相同且列数相同,那么,相同下标的像素值则指的是在矩阵中行数相同且列数相同的位置上的像素值。In the embodiment of the present application, the same subscript refers to the same number of rows and the same number of columns in the matrix, then, the pixel value with the same subscript refers to the pixel value at the position with the same number of rows and the same number of columns in the matrix.
根据前面的描述可知,深度非线性误差具有周期性震荡与0和两种特性,上述从Df1(x,y)至Dfn(x,y)的测量采样过程恰巧将完整的周期震荡包含在其中,因此将该n个拟合深度图像Df1(x,y)~Dfn(x,y)取平均得到Dfa(x,y),可使非线性周期震荡互相抵消,从而消减了深度非线性误差。According to the previous description, the deep nonlinear error has two characteristics: periodic oscillation and 0 and 0. The above measurement sampling process from Df1(x,y) to Dfn(x,y) happens to include the complete periodic oscillation. Therefore, the n fitted depth images Df1(x,y)~Dfn(x,y) are averaged to obtain Dfa(x,y), which can cancel the nonlinear periodic oscillations and reduce the depth nonlinearity error.
S205、根据计算得到的拟合平均像素矩阵计算视场相位补正系数矩阵。S205: Calculate a field of view phase correction coefficient matrix according to the calculated fitted average pixel matrix.
计算得到拟合平均像素矩阵Dfa(x,y)之后,提取该Dfa(x,y)中的最小值d0,该最小值d0所对应的点可以是拍摄对象中离拍摄设备的镜头最近的区域内的点。例如,可以是上述图3中的A点或者A点附近区域内的点。然后,计算该最小值d0与该拟合平均像素矩阵Dfa(x,y)中各个像素点的比值得到比值矩阵S1(x,y)。该比值矩阵S1(x,y)即为上述视场相位补正系数矩阵。After calculating the fitted average pixel matrix Dfa(x,y), extract the minimum value d0 in the Dfa(x,y), the point corresponding to the minimum value d0 can be the area of the object closest to the lens of the shooting device point within. For example, it may be point A in the above-mentioned FIG. 3 or a point in the area near point A. Then, the ratio of the minimum value d0 to each pixel in the fitted average pixel matrix Dfa(x,y) is calculated to obtain a ratio matrix S1(x,y). The ratio matrix S1(x, y) is the above-mentioned field-of-view phase correction coefficient matrix.
由于该视场相位补正系数矩阵S1(x,y)是最小值d0与该拟合平均像素矩阵Dfa(x,y)中各个像素点的比值得到,那么,该视场相位补正系数矩阵S1(x,y)中的各个数值均小于或等于1。Since the field of view phase correction coefficient matrix S1 (x, y) is obtained from the ratio of the minimum value d0 to each pixel in the fitted average pixel matrix Dfa (x, y), then the field of view phase correction coefficient matrix S1 ( Each value in x, y) is less than or equal to 1.
S206、根据上述n个初始深度图像的像素矩阵和上述拟合平均像素矩阵计算FPN矩阵。S206: Calculate the FPN matrix according to the pixel matrices of the n initial depth images and the fitting average pixel matrix.
首先,将该n个初始深度图像的像素矩阵取平均得到初始平均深度图像,该初始平均深度图像可以用初始平均像素矩阵Da(x,y)表示,对于设备来说该初始平均像素矩阵Da(x,y)即为该初始平均深度图像。具体的,可以将该n个初始深度图像的像素矩阵D1(x,y)~Dn(x,y)中相同下标的像素值分别取平均获得该初始平均像素矩阵Da(x,y)。示例性地,具体的计算算式可以如下:First, average the pixel matrices of the n initial depth images to obtain an initial average depth image, which can be represented by an initial average pixel matrix Da(x, y). For the device, the initial average pixel matrix Da( x, y) is the initial average depth image. Specifically, the initial average pixel matrix Da(x,y) can be obtained by averaging the pixel values of the same subscripts in the pixel matrices D1(x,y)˜Dn(x,y) of the n initial depth images respectively. Exemplarily, the specific calculation formula may be as follows:
Figure PCTCN2020098640-appb-000002
Figure PCTCN2020098640-appb-000002
然后,计算上述拟合平均像素矩阵Dfa(x,y)与该初始平均像素矩阵Da(x,y)的差值得到 差值矩阵S2(x,y),具体的计算算式可以如下:Then, calculate the difference between the above-mentioned fitting average pixel matrix Dfa(x,y) and the initial average pixel matrix Da(x,y) to obtain the difference matrix S2(x,y), and the specific calculation formula can be as follows:
S2(x,y)=Dfa(x,y)-Da(x,y)。S2(x,y)=Dfa(x,y)-Da(x,y).
其中,该差值矩阵S2(x,y)即为上述FPN矩阵。The difference matrix S2(x, y) is the above-mentioned FPN matrix.
需要说明的是,上述S205和S206的执行顺序不分先后,既可以先执行S205,再执行S206,也可以先执行S206,再执行S205,或者,可以同时执行S205和S206。It should be noted that the above S205 and S206 are executed in no particular order, either S205 may be executed first, and then S206 may be executed, or S206 may be executed first, and then S205 may be executed, or S205 and S206 may be executed simultaneously.
在其中一种可能的实施方式中,上述视场相位补正系数矩阵也可以是通过如下方式计算得到:In one of the possible implementations, the above-mentioned field of view phase correction coefficient matrix may also be calculated in the following manner:
计算上述拟合平均像素矩阵Dfa(x,y)中各个像素点与上述最小值d0的比值得到比值矩阵S1(x,y)’,该比值矩阵S1(x,y)’也可以是视场相位补正系数矩阵。Calculate the ratio of each pixel point in the above-mentioned fitting average pixel matrix Dfa(x, y) to the above-mentioned minimum value d0 to obtain a ratio matrix S1(x,y)', and the ratio matrix S1(x,y)' can also be a field of view Phase correction coefficient matrix.
由于该视场相位补正系数矩阵S1(x,y)’是上述拟合平均像素矩阵Dfa(x,y)中各个像素点与上述最小值d0的比值得到,那么,该视场相位补正系数矩阵S1(x,y)’中的各个数值均大于或等于1。Since the field of view phase correction coefficient matrix S1(x,y)' is obtained from the ratio of each pixel point in the above-mentioned fitting average pixel matrix Dfa(x,y) to the above-mentioned minimum value d0, then the field of view phase correction coefficient matrix Each value in S1(x,y)' is greater than or equal to 1.
在其中一种可能的实施方式中,上述FPN矩阵也可以是通过如下方式计算得到:In one of the possible implementations, the above-mentioned FPN matrix can also be calculated in the following manner:
计算上述初始平均像素矩阵Da(x,y)与上述拟合平均像素矩阵Dfa(x,y)的差值得到差值矩阵S2(x,y)’,具体的计算算式可以如下:Calculate the difference between the above-mentioned initial average pixel matrix Da(x,y) and the above-mentioned fitted average pixel matrix Dfa(x,y) to obtain the difference matrix S2(x,y)', and the specific calculation formula can be as follows:
S2(x,y)=Da(x,y)-Dfa(x,y)S2(x,y)=Da(x,y)-Dfa(x,y)
其中,该差值矩阵S2(x,y)’也可以是FPN矩阵。Wherein, the difference matrix S2(x, y)' may also be an FPN matrix.
需要说明的是,在具体实施例中,上述视场相位补正系数矩阵和FPN矩阵,可以训练获取其中一个矩阵即可。例如,如果想补正深度图像中的视场相位误差,则训练获取视场相位补正系数矩阵即可;如果想消减深度图像中的固定模式噪声,则训练获取FPN矩阵即可。当然,若想同时补正深度图像中的视场相位误差和消减深度图像中的固定模式噪声,那么,视场相位补正系数矩阵和FPN矩阵都训练获取即可。It should be noted that, in a specific embodiment, the above-mentioned field of view phase correction coefficient matrix and FPN matrix can be obtained by training to obtain one of the matrices. For example, if you want to correct the field of view phase error in the depth image, you can train to obtain the field of view phase correction coefficient matrix; if you want to reduce the fixed pattern noise in the depth image, you can train to obtain the FPN matrix. Of course, if you want to correct the field of view phase error in the depth image and reduce the fixed pattern noise in the depth image at the same time, then both the field of view phase correction coefficient matrix and the FPN matrix can be obtained by training.
在其中一种可能的实施方式中,计算上述视场相位补正系数矩阵的时候,可以不需要对上述n个初始深度图像进行曲面拟合,而是直接将该n个初始深度图像的像素矩阵取平均得到初始平均深度图像Da(x,y)’,然后,提取该Da(x,y)’中的最小值d0’,该最小值d0’所对应的点可以是拍摄对象中离拍摄设备的镜头最近的区域内的点。例如,可以是上述图3中的A点或者A点附近区域内的点。然后,计算该最小值d0’与该初始平均像素矩阵Da(x,y)’中各个像素点的比值得到比值矩阵S1(x,y)”。该比值矩阵S1(x,y)”即为上述视场相位补正系数矩阵。或者,计算该初始平均像素矩Da(x,y)’中各个像素点与上述最小值d0’的比值得到比值矩阵S1(x,y)”’,该比值矩阵S1(x,y)”’也可以是视场相位补正系数矩阵。In one of the possible implementations, when calculating the above-mentioned field of view phase correction coefficient matrix, it is not necessary to perform surface fitting on the above-mentioned n initial depth images, but directly obtain the pixel matrix of the n initial depth images. The initial average depth image Da(x,y)' is obtained by averaging, and then the minimum value d0' in the Da(x,y)' is extracted, and the point corresponding to the minimum value d0' can be the distance from the shooting device in the shooting object. The point within the closest area of the lens. For example, it may be point A in the above-mentioned FIG. 3 or a point in the area near point A. Then, calculate the ratio of the minimum value d0' to each pixel in the initial average pixel matrix Da(x,y)' to obtain a ratio matrix S1(x,y)". The ratio matrix S1(x,y)" is The above field of view phase correction coefficient matrix. Or, calculate the ratio of each pixel point in the initial average pixel moment Da(x,y)' to the above-mentioned minimum value d0' to obtain a ratio matrix S1(x,y)"', the ratio matrix S1(x,y)"' A field-of-view phase correction coefficient matrix may also be used.
上述图2所述的训练方法中,利用了深度非线性误差存在周期性震荡与零和(完整周期内的误差总和为零)这两种特性,通过多次在拍摄设备的光源比传感器延迟启动的情况下采样,并且使得多次延迟的时间总和为采样光信号的周期的整数倍,然后将这多次延迟获得的深度图像的像素矩阵取平均来达到了减少深度非线性误差效果,从而提高了获得的视场相位补正系数矩阵的精确度。因此,本申请实施例获得的深度图像的视场相位补正系数矩阵,即可以补正拍摄设备获得的深度图像中每个像素值的视场相位误差,从而降低深度图像的失真率,提高深度图像的质量。In the training method described in Figure 2 above, the two characteristics of periodic oscillation and zero sum (the sum of errors in a complete cycle) of the depth nonlinear error are utilized. In the case of sampling, and the sum of the times of the multiple delays is an integer multiple of the period of the sampling optical signal, and then the pixel matrix of the depth image obtained by these multiple delays is averaged to reduce the depth nonlinear error effect, thereby improving the The accuracy of the obtained field-of-view phase correction coefficient matrix. Therefore, the field-of-view phase correction coefficient matrix of the depth image obtained in the embodiment of the present application can correct the field-of-view phase error of each pixel value in the depth image obtained by the photographing device, thereby reducing the distortion rate of the depth image and improving the accuracy of the depth image. quality.
上述获得视场相位补正系数矩阵和/或FPN矩阵之后,可以将该获得的矩阵的数据存储 到拍摄设备中,用于补正拍摄设备获取的深度图像中各个像素值的误差。可选的,该拍摄设备可以是与上述训练获取视场相位补正系数矩阵和FPN矩阵的拍摄设备为同一个设备;或者,该拍摄设备可以是与上述训练获取视场相位补正系数矩阵和FPN矩阵的拍摄设备为同一型号,或者硬件性能相同或者近似的拍摄设备;或该拍摄设备也可以是任意一个可以获取深度图像的设备等。After obtaining the field-of-view phase correction coefficient matrix and/or the FPN matrix, the data of the obtained matrix can be stored in the photographing device, so as to correct the error of each pixel value in the depth image obtained by the photographing device. Optionally, the photographing equipment may be the same equipment as the above-mentioned training to obtain the field of view phase correction coefficient matrix and the FPN matrix; The photographing device is of the same model, or has the same or similar hardware performance; or the photographing device can also be any device that can acquire depth images.
基于上述的介绍,下面介绍本申请实施例提供的一种深度图像处理方法,该方法包括拍摄设备基于上述视场相位补正系数矩阵和/或FPN矩阵补正深度图像的像素误差的过程。参见图5,该方法可以包括但不限于如下步骤:Based on the above introduction, the following describes a depth image processing method provided by an embodiment of the present application, the method includes a process of a photographing device correcting pixel errors of a depth image based on the above-mentioned field of view phase correction coefficient matrix and/or FPN matrix. Referring to Figure 5, the method may include but is not limited to the following steps:
S501、拍摄设备获取第一对象的第一深度图像。S501. The photographing device acquires a first depth image of a first object.
该第一对象可以是拍摄设备拍摄的任意一个对象,可以是平面物体,立体物体或者空间物体等等。或者,该第一深度图像也可以是上述图2所述的训练过程中的第1初始深度图像D1(x,y)等。本方案对具体拍摄的对象不做限制。The first object may be any object photographed by the photographing device, and may be a plane object, a three-dimensional object, or a space object, and so on. Alternatively, the first depth image may also be the first initial depth image D1(x, y) or the like in the training process described in FIG. 2 . This program does not limit the specific shooting objects.
具体的,拍摄设备中的控制器可以向光源和传感器发送同时启动的信号以同时启动该光源和传感器来测量用于计算该第一深度图像的数据。具体如何根据测量的数据计算得到该第一深度图像可以参见上述对图1的介绍中的相关描述,此处不再赘述。Specifically, the controller in the photographing device may send a signal of simultaneous activation to the light source and the sensor to activate the light source and the sensor simultaneously to measure data for calculating the first depth image. For details on how to calculate and obtain the first depth image according to the measured data, reference may be made to the relevant description in the above-mentioned introduction to FIG. 1 , which will not be repeated here.
S502、该拍摄设备通过视场相位补正系数矩阵对该第一深度图像中像素的深度值补正获得第二深度图像,其中,该视场相位补正系数矩阵为对n个初始深度图像预处理后获得的用于补正视场相位误差的矩阵,该n个初始深度图像为在第一情况下获得的深度图像,该第一情况包括拍摄设备的光源的启动时刻与该拍摄设备的传感器的启动时刻为不同时刻,该预处理包括根据该n个初始深度图像所做的均值处理,该n为大于1的整数。S502, the photographing device obtains a second depth image by correcting the depth values of the pixels in the first depth image through a field of view phase correction coefficient matrix, wherein the field of view phase correction coefficient matrix is obtained after preprocessing n initial depth images The matrix for compensating the phase error of the field of view, the n initial depth images are the depth images obtained under the first situation, and the first situation includes the start-up moment of the light source of the photographing device and the start-up moment of the sensor of the photographing device: At different times, the preprocessing includes mean value processing based on the n initial depth images, where n is an integer greater than 1.
在具体实现过程中,上述第一情况还包括拍摄设备的光源的启动时刻与该拍摄设备的传感器的启动时刻为同一时刻的情况。上述根据该n个初始深度图像所做的均值处理可以包括将该n个初始深度图像的像素矩阵中相同下标的像素值分别取平均;或者,包括先对该n个初始深度图像做曲面拟合得到n个拟合深度图像,然后将该n个拟合深度图像的像素矩阵中相同下标的像素值分别取平均。上述预处理还包括曲面拟合、取比值等处理。该均值处理、曲面拟合和比值处理等处理的具体的实现过程可以参见上述图2所述的训练过程的描述,此处不再赘述。In the specific implementation process, the above-mentioned first situation also includes the case where the start-up time of the light source of the photographing device and the start-up time of the sensor of the photographing device are the same time. The above-mentioned mean value processing according to the n initial depth images may include averaging the pixel values of the same subscripts in the pixel matrices of the n initial depth images; or, including first performing surface fitting on the n initial depth images Obtain n fitted depth images, and then average the pixel values of the same subscripts in the pixel matrix of the n fitted depth images. The above-mentioned preprocessing also includes processing such as surface fitting and ratio taking. For the specific implementation process of the mean value processing, surface fitting, ratio processing, etc., reference may be made to the description of the training process described in FIG. 2 above, which will not be repeated here.
在具体实施例中,该拍摄设备中已经存储有视场相位补正系数矩阵的数据,该视场相位补正系数矩阵可以是上述图2所述的训练过程中训练获得的视场相位补正系数矩阵S1(x,y)。上述第一深度图像的大小可以是与该视场相位补正系数矩阵S1(x,y)的大小相同,例如,假设该视场相位补正系数矩阵S1(x,y)的大小是1024*1024,那么该第一深度图像的像素矩阵的大小也是1024*1024。In a specific embodiment, the data of the field of view phase correction coefficient matrix has been stored in the photographing device, and the field of view phase correction coefficient matrix may be the field of view phase correction coefficient matrix S1 obtained by training in the training process described in FIG. 2 (x,y). The size of the above-mentioned first depth image can be the same as the size of the field of view phase correction coefficient matrix S1 (x, y), for example, assuming that the size of the field of view phase correction coefficient matrix S1 (x, y) is 1024*1024, Then the size of the pixel matrix of the first depth image is also 1024*1024.
该视场相位补正系数矩阵S1(x,y)为根据上述n个拟合深度图像计算获得,具体的,该视场相位补正系数矩阵为拟合平均像素矩阵中的多个像素值的最小值分别与该拟合平均像素矩阵的各个像素值取比值得到的比值矩阵,该拟合平均像素矩阵为上述n个拟合深度图像的像素矩阵中相同下标的像素值分别取平均获得。The field of view phase correction coefficient matrix S1(x, y) is calculated and obtained according to the above n fitting depth images. Specifically, the field of view phase correction coefficient matrix is the minimum value of a plurality of pixel values in the fitted average pixel matrix A ratio matrix obtained by taking ratios with each pixel value of the fitted average pixel matrix, where the fitted average pixel matrix is obtained by averaging pixel values with the same subscript in the pixel matrices of the n fitted depth images.
该n个拟合深度图像由上述n个初始深度图像分别进行曲面拟合获得,该n个初始深度图像为基于上述训练用的拍摄设备n次通过飞行时间TOF测距法获得的第二对象的深度 图像,该第二对象即为上述训练用的平面,该n次中第i次的该光源的启动时刻比该传感器的启动时刻延迟(i-1)*Δt,该i的取值范围为[1,n],n*︱Δt︱=k*T,该T为该光信号的周期,该k为整数,该Δt为预设时长。The n fitted depth images are obtained by performing surface fitting on the above n initial depth images respectively, and the n initial depth images are obtained by the time-of-flight TOF ranging method n times based on the above-mentioned training shooting equipment. Depth image, the second object is the plane used for the above training, the starting time of the light source at the i-th time in the n times is delayed (i-1)*Δt from the starting time of the sensor, and the value range of i is [1, n], n*︱Δt︱=k*T, where T is the period of the optical signal, k is an integer, and Δt is a preset duration.
此外,上述第i次获得的初始深度图像为第i初始深度图像,该第i初始深度图像用像素矩阵Di(x,y)表示,该像素矩阵Di(x,y)为像素矩阵Di(x,y)’中每个像素值与c*[(1-i)*Δt]/2取和得到的,该Di(x,y)’为该第i次测量获得的深度图像的像素矩阵,该c*[(1-i)*Δt]/2为由于该光源比该传感器的启动时刻延迟了该(i-1)*Δt产生的距离差。In addition, the initial depth image obtained for the i-th time is the i-th initial depth image, and the i-th initial depth image is represented by a pixel matrix Di(x, y), and the pixel matrix Di(x, y) is a pixel matrix Di(x , y)' is obtained by summing each pixel value with c*[(1-i)*Δt]/2, the Di(x, y)' is the pixel matrix of the depth image obtained by the i-th measurement, The c*[(1-i)*Δt]/2 is the distance difference generated because the light source is delayed by the (i-1)*Δt from the activation time of the sensor.
具体的训练获取该视场相位补正系数矩阵S1(x,y)的过程可以参见上述图2中对应的描述,此处不再赘述。For the specific training process for obtaining the field of view phase correction coefficient matrix S1(x, y), reference may be made to the corresponding description in FIG. 2 above, and details are not repeated here.
那么,通过视场相位补正系数矩阵对该第一深度图像中像素的深度值补正获得第二深度图像具体为:分别计算该第一深度图像的像素矩阵与该视场相位补正系数矩阵S1(x,y)中相同下标的像素值的乘积得到乘积矩阵作为该第二深度图像。该乘积矩阵可以用DS(x,y)来表示,即该第二深度图像可以用DS(x,y)来表示。Then, obtaining the second depth image by compensating the depth value of the pixels in the first depth image by the field of view phase correction coefficient matrix is specifically: respectively calculating the pixel matrix of the first depth image and the field of view phase correction coefficient matrix S1 (x , y) in the product of the pixel values with the same subscript to obtain the product matrix as the second depth image. The product matrix can be represented by DS(x, y), that is, the second depth image can be represented by DS(x, y).
两个矩阵的相同下标的元素相乘称为点乘,点乘的符号为“.*”。上述第一深度图像的像素矩阵可以用A(x,y)表示,那么,第一深度图像的像素矩阵与该视场相位补正系数矩阵S1(x,y)中相同下标的像素值的乘积得到乘积矩阵可以用如下算式表示:The multiplication of elements of the same subscript of two matrices is called dot product, and the symbol of dot product is ".*". The pixel matrix of the above-mentioned first depth image can be represented by A(x,y), then, the product of the pixel matrix of the first depth image and the pixel value of the same subscript in the field of view phase correction coefficient matrix S1(x,y) is obtained. The product matrix can be represented by the following formula:
DS(x,y)=A(x,y).*S1(x,y)。DS(x,y)=A(x,y).*S1(x,y).
在一种可能的实施方式中,S502中的视场相位补正系数矩阵可以是上述S1(x,y)’。那么,该视场相位补正系数矩阵S1(x,y)’为根据上述n个拟合深度图像计算获得,具体的,该视场相位补正系数矩阵为拟合平均像素矩阵的各个像素值与该拟合平均像素矩阵中的多个像素值的最小值分别取比值得到的比值矩阵,该拟合平均像素矩阵为上述n个拟合深度图像的像素矩阵中相同下标的像素值分别取平均获得。其它的描述与对视场相位补正系数矩阵S1(x,y)的描述相同,此处不再赘述。In a possible implementation manner, the field-of-view phase correction coefficient matrix in S502 may be the above-mentioned S1(x,y)'. Then, the field of view phase correction coefficient matrix S1(x, y)' is calculated and obtained according to the above-mentioned n fitted depth images. Specifically, the field of view phase correction coefficient matrix is each pixel value of the fitted average pixel matrix and the A ratio matrix obtained by taking the minimum value of the multiple pixel values in the fitted average pixel matrix is obtained by taking the ratio respectively. Other descriptions are the same as those for the field of view phase correction coefficient matrix S1(x, y), and are not repeated here.
那么,通过视场相位补正系数矩阵对该第一深度图像中像素的深度值补正获得第二深度图像具体为:分别计算该第一深度图像的像素矩阵与该视场相位补正系数矩阵S1(x,y)’中相同下标的像素值的比值得到比值矩阵作为该第二深度图像。基于上述图2所示的训练过程及其可能的实施方式中可知,该S1(x,y)’与上述S1(x,y)中相同下标的值互为倒数,因此该比值矩阵与上述乘积矩阵DS(x,y)可以为同一个矩阵,则该比值矩阵可以用DS(x,y)来表示,即该第二深度图像可以用DS(x,y)来表示。Then, obtaining the second depth image by compensating the depth value of the pixels in the first depth image by the field of view phase correction coefficient matrix is specifically: respectively calculating the pixel matrix of the first depth image and the field of view phase correction coefficient matrix S1 (x , y)' in the ratio of the pixel values with the same subscript to obtain a ratio matrix as the second depth image. Based on the training process shown in FIG. 2 and its possible implementations, it can be known that the value of the same subscript in S1(x,y)' and the above S1(x,y) are reciprocals of each other, so the ratio matrix and the above product The matrix DS(x, y) may be the same matrix, and the ratio matrix may be represented by DS(x, y), that is, the second depth image may be represented by DS(x, y).
在一种可能的实施方式中,S502中的视场相位补正系数矩阵可以是上述S1(x,y)”。那么,通过视场相位补正系数矩阵对该第一深度图像中像素的深度值补正获得第二深度图像具体为:分别计算该第一深度图像的像素矩阵与该视场相位补正系数矩阵S1(x,y)”中相同下标的像素值的乘积得到乘积矩阵作为该第二深度图像。该乘积矩阵可以用DS(x,y)’来表示,即该第二深度图像可以用DS(x,y)’来表示。那么该计算过程可以用如下算式表示:In a possible implementation manner, the field of view phase correction coefficient matrix in S502 may be the above-mentioned S1(x,y)". Then, the depth value of the pixel in the first depth image is corrected by the field of view phase correction coefficient matrix Obtaining the second depth image is specifically as follows: respectively calculating the product of the pixel matrix of the first depth image and the pixel value of the same subscript in the field of view phase correction coefficient matrix S1(x,y)" to obtain the product matrix as the second depth image . The product matrix can be represented by DS(x, y)', that is, the second depth image can be represented by DS(x, y)'. Then the calculation process can be expressed by the following formula:
DS(x,y)’=A(x,y).*S1(x,y)”。DS(x,y)'=A(x,y).*S1(x,y)".
在一种可能的实施方式中,S502中的视场相位补正系数矩阵可以是上述S1(x,y)”’。那么,通过视场相位补正系数矩阵对该第一深度图像中像素的深度值补正获得第二深度图像具体为:分别计算该第一深度图像的像素矩阵与该视场相位补正系数矩阵S1(x,y)”’中相同 下标的像素值的比值得到比值矩阵作为该第二深度图像。基于上述图2所示的训练过程及其可能的实施方式中可知,该S1(x,y)”’与上述S1(x,y)”中相同下标的值互为倒数,因此该比值矩阵与上述乘积矩阵DS(x,y)’可以为同一个矩阵,则该比值矩阵可以用DS(x,y)’来表示,即该第二深度图像可以用DS(x,y)’来表示。In a possible implementation manner, the field of view phase correction coefficient matrix in S502 may be the above-mentioned S1(x,y)"'. Then, the depth value of the pixel in the first depth image is obtained through the field of view phase correction coefficient matrix Correction to obtain the second depth image is specifically: respectively calculating the ratio of the pixel matrix of the first depth image and the pixel value of the same subscript in the field of view phase correction coefficient matrix S1(x,y)"' to obtain the ratio matrix as the second depth image. Based on the training process shown in FIG. 2 and its possible implementations, it can be known that the values of the same subscripts in the S1(x,y)"' and the above S1(x,y)" are reciprocals of each other, so the ratio matrix and The above product matrix DS(x, y)' may be the same matrix, and the ratio matrix may be represented by DS(x, y)', that is, the second depth image may be represented by DS(x, y)'.
在本申请实施例中,通过在训练过程中多次在拍摄设备的光源比传感器延迟启动的情况下采样以及根据上述n个初始深度图像所做的均值处理,使得非线性误差中正负的误差量可以互相抵消,从而可以减少测量过程中引入的深度非线性误差。同时基于该采样和均值处理等操作得到的视场相位补正系数矩阵可以补正深度图像中每个像素的深度值,减少了视场相位造成的误差,从而极大地降低了最终得到的深度图像的失真率,提高深度图像的质量。In the embodiment of the present application, by sampling multiple times during the training process when the light source of the photographing device is started later than the sensor, and performing the mean value processing according to the above n initial depth images, the positive and negative errors in the nonlinear error are made. The quantities can cancel each other, which can reduce the depth nonlinear error introduced in the measurement process. At the same time, the field of view phase correction coefficient matrix obtained based on the sampling and averaging processing can correct the depth value of each pixel in the depth image, reduce the error caused by the field of view phase, and greatly reduce the distortion of the final depth image. rate to improve the quality of the depth image.
在一种可能的实施方式中,参见图6,上述本申请实施例提供的一种深度图像处理方法还可以包括但不限于如下步骤:In a possible implementation manner, referring to FIG. 6 , the depth image processing method provided by the above embodiment of the present application may further include, but is not limited to, the following steps:
S503、上述拍摄设备通过固定模式噪声FPN矩阵对上述第二深度图像中每个像素的深度值补正获得第三深度图像。S503 , the above-mentioned photographing device obtains a third depth image by compensating the depth value of each pixel in the above-mentioned second depth image by using a fixed pattern noise FPN matrix.
在具体实施例中,该拍摄设备中已经存储有FPN矩阵的数据,该FPN矩阵可以是上述图2所述的训练过程中训练获得的FPN矩阵S2(x,y)。In a specific embodiment, data of the FPN matrix has been stored in the photographing device, and the FPN matrix may be the FPN matrix S2(x, y) obtained by training in the training process described in FIG. 2 above.
上述第一深度图像的大小、FPN矩阵的大小与视场相位补正系数矩阵S1(x,y)的大小相同,例如,假设该视场相位补正系数矩阵S1(x,y)的大小是1024*1024,那么该第一深度图像的像素矩阵的大小和该FPN矩阵的大小也是1024*1024。The size of the above-mentioned first depth image and the size of the FPN matrix are the same as the size of the field of view phase correction coefficient matrix S1 (x, y), for example, it is assumed that the size of the field of view phase correction coefficient matrix S1 (x, y) is 1024* 1024, then the size of the pixel matrix of the first depth image and the size of the FPN matrix are also 1024*1024.
即该FPN矩阵为上述拟合平均像素矩阵与上述初始平均像素矩阵取差值得到的差值矩阵S2(x,y),该拟合平均像素矩阵为上述n个拟合深度图像的像素矩阵中相同下标的像素值分别取平均获得,该初始平均像素矩阵为上述n个初始深度图像的像素矩阵中相同下标的像素值分别取平均获得。具体的训练获取该FPN矩阵S2(x,y)的过程可以参见上述图2中对应的描述,此处不再赘述。That is, the FPN matrix is the difference matrix S2(x, y) obtained by taking the difference between the above-mentioned fitted average pixel matrix and the above-mentioned initial average pixel matrix, and the fitted average pixel matrix is the pixel matrix of the above n fitted depth images. The pixel values of the same subscript are obtained by averaging respectively, and the initial average pixel matrix is obtained by averaging the pixel values of the same subscript in the pixel matrices of the above n initial depth images respectively. For a specific process of training to obtain the FPN matrix S2(x, y), reference may be made to the corresponding description in FIG. 2 above, which will not be repeated here.
那么,通过固定模式噪声FPN矩阵对上述第二深度图像中每个像素的深度值补正获得第三深度图像具体为:在上述S502计算得到矩阵DS(x,y)的情况下,计算该矩阵DS(x,y)与该FPN矩阵S2(x,y)的和得到和矩阵Dc(x,y)作为该第三深度图像,具体的计算算式为:Then, obtaining the third depth image by compensating the depth value of each pixel in the second depth image by the fixed pattern noise FPN matrix is specifically: in the case that the matrix DS(x, y) is obtained by calculating the above S502, calculating the matrix DS The sum of (x, y) and the FPN matrix S2 (x, y) obtains the sum matrix Dc (x, y) as the third depth image, and the specific calculation formula is:
Dc(x,y)=DS(x,y)+S2(x,y)。Dc(x,y)=DS(x,y)+S2(x,y).
或者,在上述S502计算得到矩阵DS(x,y)’的情况下,计算该矩阵DS(x,y)’与该FPN矩阵S2(x,y)的和得到和矩阵Dc(x,y)’作为该第三深度图像,具体的计算算式为:Or, in the case that the matrix DS(x, y)' is obtained by calculation in the above S502, the sum of the matrix DS(x, y)' and the FPN matrix S2(x, y) is calculated to obtain the sum matrix Dc(x, y) 'As the third depth image, the specific calculation formula is:
Dc(x,y)’=DS(x,y)’+S2(x,y)。Dc(x,y)'=DS(x,y)'+S2(x,y).
在其中一种可能的实施方式中,S503中的FPN矩阵可以是S2(x,y)’。那么,该FPN矩阵S2(x,y)’为上述初始平均像素矩阵Da(x,y)与上述拟合平均像素矩阵Dfa(x,y)取差值得到差值矩阵。其它的描述与对FPN矩阵S1(x,y)的描述相同,此处不再赘述。In one of the possible implementations, the FPN matrix in S503 may be S2(x,y)'. Then, the FPN matrix S2(x,y)' is the difference matrix obtained by taking the difference between the above-mentioned initial average pixel matrix Da(x,y) and the above-mentioned fitted average pixel matrix Dfa(x,y). Other descriptions are the same as those for the FPN matrix S1(x, y), and are not repeated here.
那么,通过固定模式噪声FPN矩阵对上述第二深度图像中每个像素的深度值补正获得第三深度图像具体为:在上述S502计算得到矩阵DS(x,y)的情况下,计算该矩阵DS(x,y)与该FPN矩阵S2(x,y)’的差得到差值矩阵Dc(x,y)”作为该第三深度图像,具体的计算算式为:Then, obtaining the third depth image by compensating the depth value of each pixel in the second depth image by the fixed pattern noise FPN matrix is specifically: in the case that the matrix DS(x, y) is obtained by calculating the above S502, calculating the matrix DS The difference between (x, y) and the FPN matrix S2(x, y)' obtains the difference matrix Dc(x, y)" as the third depth image, and the specific calculation formula is:
Dc(x,y)”=DS(x,y)-S2(x,y)’。Dc(x,y)"=DS(x,y)-S2(x,y)'.
基于上述图2所示的训练过程及其可能的实施方式中可知,该S2(x,y)’与上述S2(x,y)中相同下标的值互为相反数,因此该差值矩阵Dc(x,y)”与上述和矩阵Dc(x,y)可以为同一个矩阵。Based on the training process shown in FIG. 2 and its possible implementations, it can be known that the values of the same subscript in S2(x, y)' and the above S2(x, y) are opposite numbers to each other, so the difference matrix Dc (x,y)" and the above sum matrix Dc(x,y) can be the same matrix.
或者,在上述S502计算得到矩阵DS(x,y)’的情况下,计算该矩阵DS(x,y)’与该FPN矩阵S2(x,y)’的差得到差值矩阵Dc(x,y)”’作为该第三深度图像,具体的计算算式为:Dc(x,Or, in the case where the matrix DS(x, y)' is obtained by calculation in the above S502, the difference between the matrix DS(x, y)' and the FPN matrix S2(x, y)' is calculated to obtain the difference matrix Dc(x, y)' y)"' as the third depth image, the specific calculation formula is: Dc(x,
Dc(x,y)”’=DS(x,y)’-S2(x,y)’。Dc(x,y)"'=DS(x,y)'-S2(x,y)'.
同样的,基于上述图2所示的训练过程及其可能的实施方式中可知,该S2(x,y)’与上述S2(x,y)中相同下标的值互为相反数,因此该差值矩阵Dc(x,y)”’与上述和矩阵Dc(x,y)’可以是同一个矩阵。Similarly, based on the training process shown in FIG. 2 and its possible implementations, it can be seen that the values of the same subscript in S2(x,y)' and S2(x,y) are opposite numbers to each other, so the difference The value matrix Dc(x,y)"' and the above-mentioned sum matrix Dc(x,y)' may be the same matrix.
在本申请实施例中,除了能够补正深度图像的视场相位误差之外还可以补正由于拍摄设备的硬件导致的每个像素的固定模式噪声。In this embodiment of the present application, in addition to correcting the field-of-view phase error of the depth image, the fixed pattern noise of each pixel caused by the hardware of the photographing device can also be corrected.
上述主要对本申请实施例提供的深度图像处理方法进行了介绍。可以理解的是,各个设备为了实现上述对应的功能,其包含了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,本申请能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。The above mainly introduces the depth image processing method provided by the embodiments of the present application. It can be understood that, in order to implement the above-mentioned corresponding functions, each device includes corresponding hardware structures and/or software modules for performing each function. Those skilled in the art should easily realize that the present application can be implemented in hardware or a combination of hardware and computer software with the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein. Whether a function is performed by hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of this application.
本申请实施例可以根据上述方法示例对设备进行功能模块的划分,例如,可以对应各个功能划分各个功能模块,也可以将两个或两个以上的功能集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。需要说明的是,本申请实施例对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。In this embodiment of the present application, the device may be divided into functional modules according to the foregoing method examples. For example, each functional module may be divided corresponding to each function, or two or more functions may be integrated into one module. The above-mentioned integrated modules can be implemented in the form of hardware, and can also be implemented in the form of software function modules. It should be noted that, the division of modules in the embodiments of the present application is schematic, and is only a logical function division, and there may be other division manners in actual implementation.
在采用对应各个功能划分各个功能模块的情况下,图7示出了设备的一种可能的逻辑结构示意图,该设备可以是上述图5或图6所述方法中的拍摄设备。该拍摄设备700包括获取单元701和补正单元702。其中:In the case where each functional module is divided according to each function, FIG. 7 shows a schematic diagram of a possible logical structure of the device, and the device may be the photographing device in the method described in FIG. 5 or FIG. 6 . The photographing apparatus 700 includes an acquisition unit 701 and a correction unit 702 . in:
获取单元701,用于获取第一对象的第一深度图像;an acquisition unit 701, configured to acquire a first depth image of a first object;
补正单元702,用于通过视场相位补正系数矩阵对该第一深度图像中像素的深度值补正获得第二深度图像,其中,该视场相位补正系数矩阵为对n个初始深度图像预处理后获得的用于补正视场相位误差的矩阵,该n个初始深度图像为在第一情况下获得的深度图像,该第一情况包括拍摄设备的光源的启动时刻与该拍摄设备的传感器的启动时刻为不同时刻,该预处理包括根据该n个初始深度图像所做的均值处理,该n为大于1的整数。 Correction unit 702 is used to obtain a second depth image by correcting the depth value of the pixel in the first depth image by the field of view phase correction coefficient matrix, wherein, this field of view phase correction coefficient matrix is after preprocessing to n initial depth images. The obtained matrix for correcting the phase error of the field of view, the n initial depth images are the depth images obtained in the first situation, and the first situation includes the start-up time of the light source of the photographing device and the start-up time of the sensor of the photographing device For different moments, the preprocessing includes mean value processing based on the n initial depth images, where n is an integer greater than 1.
在一种可能的实施方式中,该补正单元702还用于:In a possible implementation, the correction unit 702 is also used for:
通过固定模式噪声FPN矩阵对该第二深度图像补正获得第三深度图像,其中,该FPN矩阵中的每个值分别包括由硬件导致的该第一深度图像中与所述每个值相同下标的像素的固定噪声。A third depth image is obtained by compensating the second depth image through a fixed pattern noise FPN matrix, wherein each value in the FPN matrix includes a hardware-induced first depth image with the same subscript as each value. Fixed noise for pixels.
在一种可能的实施方式中,该补正单元702具体用于:In a possible implementation, the correction unit 702 is specifically used for:
分别计算该第一深度图像的像素矩阵与该视场相位补正系数矩阵中相同下标的像素值的乘积得到该第二深度图像。The second depth image is obtained by separately calculating the product of the pixel matrix of the first depth image and the pixel value of the same subscript in the field of view phase correction coefficient matrix.
在一种可能的实施方式中,该补正单元702具体用于:In a possible implementation, the correction unit 702 is specifically used for:
分别计算该第一深度图像的像素矩阵与该视场相位补正系数矩阵中相同下标的像素值的乘积得到乘积矩阵;Respectively calculate the product of the pixel matrix of the first depth image and the pixel value of the same subscript in the field of view phase correction coefficient matrix to obtain the product matrix;
计算该乘积矩阵与该FPN矩阵的和得到该第三深度图像。The third depth image is obtained by calculating the sum of the product matrix and the FPN matrix.
图7所示拍摄设备700中各个单元的具体操作以及有益效果可以参见上述图5或图6及其可能的实施方式中所示方法实施例的描述,此处不再赘述。For the specific operations and beneficial effects of each unit in the photographing device 700 shown in FIG. 7 , reference may be made to the description of the method embodiments shown in FIG. 5 or FIG. 6 and its possible implementations, which will not be repeated here.
在采用对应各个功能划分各个功能模块的情况下,图8示出了设备的一种可能的逻辑结构示意图,该设备可以是上述图2所述方法中的计算设备。该计算设备800包括获取单元801、曲面拟合单元802和计算单元803。其中:In the case where each functional module is divided according to each function, FIG. 8 shows a schematic diagram of a possible logical structure of the device, and the device may be the computing device in the method described in FIG. 2 above. The computing device 800 includes an acquiring unit 801 , a surface fitting unit 802 and a computing unit 803 . in:
获取单元801,用于获取n个初始深度图像,该n个初始深度图像为基于拍摄设备n次通过飞行时间TOF测距法获取到的第二对象的深度图像,其中,该n次中第i次的该拍摄设备的光源的启动时刻比该拍摄设备的传感器的启动时刻延迟(i-1)*Δt,该i的取值范围为[1,n],n*︱Δt︱=k*T,该T为该光信号的周期,该n为大于1的整数,该k为整数,该Δt为预设时长;The obtaining unit 801 is configured to obtain n initial depth images, where the n initial depth images are the depth images of the second object obtained by the time-of-flight TOF ranging method n times based on the photographing device, wherein the ith in the n times The starting time of the light source of the photographing device is delayed by (i-1)*Δt from the starting time of the sensor of the photographing device, and the value range of the i is [1, n], n*︱Δt︱=k*T , the T is the period of the optical signal, the n is an integer greater than 1, the k is an integer, and the Δt is a preset duration;
曲面拟合单元802,用于对该n个初始深度图像分别进行曲面拟合得到n个拟合深度图像;a curved surface fitting unit 802, configured to perform curved surface fitting on the n initial depth images respectively to obtain n fitted depth images;
计算单元803,用于根据该n个拟合深度图像做均值处理后计算得到视场相位补正系数矩阵,该视场相位补正系数矩阵用于补正该拍摄设备通过该TOF测距法获取的深度图像的视场相位误差。 Calculation unit 803 is used to calculate and obtain the field of view phase correction coefficient matrix after doing mean value processing according to the n fitting depth images, and this field of view phase correction coefficient matrix is used to correct the depth image that this shooting device obtains by this TOF ranging method field of view phase error.
在其中一种可能的实施方式中,该第i次获得的初始深度图像为第i初始深度图像;该获取单元801具体用于:In one possible implementation manner, the initial depth image obtained for the i-th time is the i-th initial depth image; the obtaining unit 801 is specifically used for:
获取该拍摄设备n次通过飞行时间TOF测距法实际测量得到的n个测量深度图像,该n个测量深度图像中的第i测量深度图像用像素矩阵Di(x,y)’表示;Obtain n measured depth images obtained by the actual measurement by the time-of-flight TOF ranging method n times by the photographing device, and the i-th measured depth image in the n measured depth images is represented by a pixel matrix Di(x, y)';
分别计算该像素矩阵Di(x,y)’中每个像素值与c*[(1-i)*Δt]/2的和得到该第i初始深度图像Di(x,y),该c*[(1-i)*Δt]/2为由于该光源的启动时刻比该传感器的启动时刻延迟了该(i-1)*Δt产生的距离差。Calculate the sum of each pixel value in the pixel matrix Di(x, y)' and c*[(1-i)*Δt]/2 to obtain the i-th initial depth image Di(x, y), the c* [(1-i)*Δt]/2 is the distance difference generated because the activation time of the light source is delayed by (i-1)*Δt from the activation time of the sensor.
在其中一种可能的实施方式中,该计算单元803具体用于:In one possible implementation manner, the computing unit 803 is specifically used for:
将该n个拟合深度图像的像素矩阵中相同下标的像素值分别取平均得到拟合平均像素矩阵;The pixel values of the same subscript in the pixel matrices of the n fitted depth images are averaged respectively to obtain the fitted average pixel matrix;
提取该拟合平均像素矩阵中的多个像素值的最小值,并计算该最小值分别与该拟合平均像素矩阵的各个像素值的比值得到比值矩阵,该比值矩阵为该视场相位补正系数矩阵。Extract the minimum value of multiple pixel values in the fitted average pixel matrix, and calculate the ratio of the minimum value to each pixel value of the fitted average pixel matrix to obtain a ratio matrix, where the ratio matrix is the phase correction coefficient of the field of view matrix.
在其中一种可能的实施方式中,上述计算单元803,还用于在该曲面拟合单元802对该n个初始深度图像分别进行曲面拟合得到n个拟合深度图像之后,In one of the possible implementations, the above calculation unit 803 is further configured to, after the curved surface fitting unit 802 respectively performs surface fitting on the n initial depth images to obtain n fitted depth images,
将该n个初始深度图像的像素矩阵中相同下标的像素值分别取平均得到初始平均像素矩阵;The pixel values of the same subscript in the pixel matrix of the n initial depth images are averaged respectively to obtain the initial average pixel matrix;
将该n个拟合深度图像的像素矩阵中相同下标的像素值分别取平均得到拟合平均像素矩阵;The pixel values of the same subscript in the pixel matrices of the n fitted depth images are averaged respectively to obtain the fitted average pixel matrix;
计算该拟合平均像素矩阵与该初始平均像素矩阵取差值得到差值矩阵,该差值矩阵为固定模式噪声FPN矩阵,该FPN矩阵中的每个值分别包括由硬件导致的深度图像中与所述每个值相同下标的像素的固定噪声。Calculate the difference between the fitted average pixel matrix and the initial average pixel matrix to obtain a difference matrix. The difference matrix is a fixed pattern noise FPN matrix. Each value in the FPN matrix includes the difference between the The fixed noise for pixels with the same index for each value.
图8所示计算设备800中各个单元的具体操作以及有益效果可以参见上述图2及其可能的实施方式中所示方法实施例的描述,此处不再赘述。For the specific operations and beneficial effects of each unit in the computing device 800 shown in FIG. 8 , reference may be made to the description of the method embodiments shown in FIG. 2 and its possible implementations, which are not repeated here.
图9所示为本申请提供的设备的一种可能的硬件结构示意图,该设备可以是上述图5或图6所述方法中的拍摄设备。该拍摄设备900包括:处理器901、存储器902和通信接口903。处理器901、通信接口903以及存储器902可以相互连接或者通过总线904相互连接。FIG. 9 shows a schematic diagram of a possible hardware structure of the device provided by the present application, and the device may be the photographing device in the method described in FIG. 5 or FIG. 6 above. The photographing device 900 includes: a processor 901 , a memory 902 and a communication interface 903 . The processor 901 , the communication interface 903 , and the memory 902 may be connected to each other or to each other through a bus 904 .
示例性的,存储器902用于存储拍摄设备900的计算机程序和数据,存储器902可以包括但不限于是随机存储记忆体(random access memory,RAM)、只读存储器(read-only memory,ROM)、可擦除可编程只读存储器(erasable programmable read only memory,EPROM)或便携式只读存储器(compact disc read-only memory,CD-ROM)等。在实现图7所示实施例的情况下,且图7实施例中所描述的各单元为通过软件实现的情况下,执行图7中的获取单元701和补正单元702的功能所需的软件或程序代码存储在存储器902中。Exemplarily, the memory 902 is used to store computer programs and data of the photographing device 900, and the memory 902 may include, but is not limited to, random access memory (RAM), read-only memory (ROM), Erasable programmable read only memory (EPROM) or portable read-only memory (compact disc read-only memory, CD-ROM), etc. In the case where the embodiment shown in FIG. 7 is implemented, and each unit described in the embodiment in FIG. 7 is implemented by software, the software required to execute the functions of the acquisition unit 701 and the correction unit 702 in FIG. 7 or Program codes are stored in memory 902 .
通信接口903用于支持拍摄设备900进行通信,例如接收或发送数据或信号等。The communication interface 903 is used to support the photographing device 900 to communicate, such as receiving or sending data or signals.
示例性的,处理器901可以是中央处理器单元、图形处理器GPU、通用处理器、数字信号处理器、专用集成电路、现场可编程门阵列或者其他可编程逻辑器件、晶体管逻辑器件、硬件部件或者其任意组合。处理器也可以是实现计算功能的组合,例如包含一个或多个微处理器组合,数字信号处理器和微处理器的组合等等。处理器901可以用于读取上述存储器902中存储的程序,执行上述图5或图6以及可能的实施方式所述的方法中拍摄设备所做的操作。Illustratively, the processor 901 may be a central processing unit, a graphics processing unit (GPU), a general-purpose processor, a digital signal processor, an application specific integrated circuit, a field programmable gate array, or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. A processor may also be a combination that performs computing functions, such as a combination comprising one or more microprocessors, a combination of a digital signal processor and a microprocessor, and the like. The processor 901 may be configured to read the program stored in the above-mentioned memory 902, and execute the operations performed by the photographing device in the method described in the above-mentioned FIG. 5 or FIG. 6 and possible embodiments.
图10所示为本申请提供的设备的一种可能的硬件结构示意图,该设备可以是上述图2所述方法中的计算设备。该计算设备1000包括:处理器1001、存储器1002和通信接口1003。处理器1001、通信接口1003以及存储器1002可以相互连接或者通过总线1004相互连接。FIG. 10 is a schematic diagram showing a possible hardware structure of the device provided by the present application, and the device may be the computing device in the method described in FIG. 2 above. The computing device 1000 includes: a processor 1001 , a memory 1002 and a communication interface 1003 . The processor 1001 , the communication interface 1003 , and the memory 1002 may be connected to each other or to each other through a bus 1004 .
示例性的,存储器1002用于存储计算设备1000的计算机程序和数据,存储器1002可以包括但不限于是随机存储记忆体(random access memory,RAM)、只读存储器(read-only memory,ROM)、可擦除可编程只读存储器(erasable programmable read only memory,EPROM)或便携式只读存储器(compact disc read-only memory,CD-ROM)等。在实现图8所示实施例的情况下,且图8实施例中所描述的各单元为通过软件实现的情况下,执行图8中的获取单元801、曲面拟合单元802和计算单元803的功能所需的软件或程序代码可以存储在存储器1002中。Exemplarily, the memory 1002 is used to store computer programs and data of the computing device 1000. The memory 1002 may include, but is not limited to, random access memory (RAM), read-only memory (ROM), Erasable programmable read only memory (EPROM) or portable read-only memory (compact disc read-only memory, CD-ROM), etc. When the embodiment shown in FIG. 8 is implemented, and each unit described in the embodiment of FIG. 8 is implemented by software, the acquisition unit 801 , the surface fitting unit 802 and the calculation unit 803 in FIG. 8 are executed. Software or program code required for the function may be stored in memory 1002 .
通信接口1003用于支持计算设备1000进行通信,例如接收或发送数据或信号等。The communication interface 1003 is used to support the computing device 1000 to communicate, such as to receive or transmit data or signals, and the like.
示例性的,处理器1001可以是中央处理器单元、图形处理器GPU、通用处理器、数字信号处理器、专用集成电路、现场可编程门阵列或者其他可编程逻辑器件、晶体管逻辑器件、硬件部件或者其任意组合。处理器也可以是实现计算功能的组合,例如包含一个或 多个微处理器组合,数字信号处理器和微处理器的组合等等。处理器1001可以用于读取上述存储器1002中存储的程序,执行上述图2以及可能的实施方式所述的方法中计算设备所做的操作。Illustratively, the processor 1001 may be a central processing unit, a graphics processing unit (GPU), a general-purpose processor, a digital signal processor, an application specific integrated circuit, a field programmable gate array, or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. A processor may also be a combination that performs computing functions, such as a combination comprising one or more microprocessors, a combination of a digital signal processor and a microprocessor, and the like. The processor 1001 may be configured to read the program stored in the above-mentioned memory 1002, and execute the operations performed by the computing device in the above-mentioned methods described in FIG. 2 and possible embodiments.
本申请实施例还提供一种装置,该装置包括处理器和通信接口,该装置被配置为执行上述图2及其可能的实施例所述的方法。An embodiment of the present application further provides an apparatus, the apparatus includes a processor and a communication interface, and the apparatus is configured to execute the method described in FIG. 2 and its possible embodiments above.
在其中一种可能的实施方式中,该装置为芯片或系统芯片(System on a Chip,SoC)。本申请实施例还提供一种装置,该装置包括处理器和通信接口,该装置被配置为执行上述图5或图6及其可能的实施例所述的方法。In one of the possible implementations, the device is a chip or a System on a Chip (SoC). An embodiment of the present application further provides an apparatus, where the apparatus includes a processor and a communication interface, and the apparatus is configured to execute the method described in FIG. 5 or FIG. 6 and possible embodiments thereof.
在其中一种可能的实施方式中,该装置为芯片或系统芯片SoC。In one of the possible implementations, the device is a chip or a system-on-a-chip SoC.
本申请实施例还提供一种计算机可读存储介质,该计算机可读存储介质存储有计算机程序,该计算机程序被处理器执行以实现上述图2及其可能的实施例所述的方法。Embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and the computer program is executed by a processor to implement the method described in FIG. 2 and its possible embodiments.
本申请实施例还提供一种计算机可读存储介质,该计算机可读存储介质存储有计算机程序,该计算机程序被处理器执行以实现上述图5或图6及其可能的实施例所述的方法。Embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and the computer program is executed by a processor to implement the method described in FIG. 5 or FIG. 6 and possible embodiments thereof. .
本申请实施例还提供一种计算机程序产品,当该计算机程序产品被计算机读取并执行时,上述图2及其可能的实施例所述的方法将被执行。The embodiment of the present application also provides a computer program product, when the computer program product is read and executed by a computer, the method described in the above FIG. 2 and its possible embodiments will be executed.
本申请实施例还提供一种计算机程序产品,当该计算机程序产品被计算机读取并执行时,上述图5或图6及其可能的实施例所述的方法将被执行。The embodiment of the present application also provides a computer program product, when the computer program product is read and executed by a computer, the method described in the above-mentioned FIG. 5 or FIG. 6 and its possible embodiments will be executed.
本申请实施例还提供一种计算机程序,当该计算机程序在计算机上执行时,将会使该计算机实现上述图2及其可能的实施例所述的方法。The embodiments of the present application also provide a computer program, which, when executed on a computer, enables the computer to implement the method described in FIG. 2 and its possible embodiments above.
本申请实施例还提供一种计算机程序,当该计算机程序在计算机上执行时,将会使该计算机实现上述图5或图6及其可能的实施例所述的方法。Embodiments of the present application further provide a computer program, which, when executed on a computer, enables the computer to implement the method described in FIG. 5 or FIG. 6 and possible embodiments thereof.
综上所述,深度非线性误差是由于光信号的波形不是标准波形(例如不是标准的正弦波等)导致的非线性误差,且该非线性误差的误差量类似于正弦波,随距离改变而震荡,误差量有正有负。因此,在本申请中,通过多次在拍摄设备的光源比传感器延迟启动的情况下采样以及根据上述n个初始深度图像所做的均值处理,使得非线性误差中正负的误差量可以互相抵消,从而可以减少测量过程中引入的深度非线性误差。同时基于该采样和均值处理等操作得到的视场相位补正系数矩阵可以补正深度图像中每个像素的深度值,减少了视场相位造成的误差,从而极大地降低了最终得到的深度图像的失真率,提高深度图像的质量。To sum up, the deep nonlinear error is a nonlinear error caused by the waveform of the optical signal not being a standard waveform (for example, not a standard sine wave, etc.), and the error amount of the nonlinear error is similar to a sine wave, which varies with the distance. Oscillation, the amount of error is positive and negative. Therefore, in the present application, the positive and negative error amounts in the nonlinear error can cancel each other by sampling multiple times under the condition that the light source of the photographing device is started later than the sensor and performing averaging processing according to the above-mentioned n initial depth images. , which can reduce the depth nonlinear error introduced in the measurement process. At the same time, the field of view phase correction coefficient matrix obtained based on the sampling and averaging processing can correct the depth value of each pixel in the depth image, reduce the error caused by the field of view phase, and greatly reduce the distortion of the final depth image. rate to improve the quality of the depth image.
本申请中术语“第一”“第二”等字样用于对作用和功能基本相同的相同项或相似项进行区分,应理解,“第一”、“第二”、“第n”之间不具有逻辑或时序上的依赖关系,也不对数量和执行顺序进行限定。还应理解,尽管以下描述使用术语第一、第二等来描述各种元素,但这些元素不应受术语的限制。这些术语只是用于将一元素与另一元素区别分开。例如,在不脱离各种所述示例的范围的情况下,第一图像可以被称为第二图像,并且类似地,第二图像可以被称为第一图像。第一图像和第二图像都可以是图像,并且在某些情况下,可以是单独且不同的图像。In this application, the terms "first", "second" and other words are used to distinguish the same or similar items with basically the same function and function, and it should be understood that between "first", "second" and "nth" There are no logical or timing dependencies, and no restrictions on the number and execution order. It will also be understood that, although the following description uses the terms first, second, etc. to describe various elements, these elements should not be limited by the terms. These terms are only used to distinguish one element from another. For example, a first image may be referred to as a second image, and, similarly, a second image may be referred to as a first image, without departing from the scope of various described examples. Both the first image and the second image may be images, and in some cases, may be separate and distinct images.
还应理解,在本申请的各个实施例中,各个过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程 构成任何限定。It should also be understood that, in each embodiment of the present application, the size of the sequence number of each process does not mean the sequence of execution, and the execution sequence of each process should be determined by its function and internal logic, and should not be used in the embodiment of the present application. Implementation constitutes any limitation.
还应理解,术语“包括”(也称“includes”、“including”、“comprises”和/或“comprising”)当在本说明书中使用时指定存在所陈述的特征、整数、步骤、操作、元素、和/或部件,但是并不排除存在或添加一个或多个其他特征、整数、步骤、操作、元素、部件、和/或其分组。It will also be understood that the term "includes" (also referred to as "includes", "including", "comprises" and/or "comprising") when used in this specification designates the presence of stated features, integers, steps, operations, elements , and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groupings thereof.
还应理解,说明书通篇中提到的“一个实施例”、“一实施例”、“一种可能的实现方式”意味着与实施例或实现方式有关的特定特征、结构或特性包括在本申请的至少一个实施例中。因此,在整个说明书各处出现的“在一个实施例中”或“在一实施例中”、“一种可能的实现方式”未必一定指相同的实施例。此外,这些特定的特征、结构或特性可以任意适合的方式结合在一个或多个实施例中。It should also be understood that references throughout the specification to "one embodiment," "an embodiment," and "one possible implementation" mean that a particular feature, structure, or characteristic associated with the embodiment or implementation is included herein. in at least one embodiment of the application. Thus, appearances of "in one embodiment" or "in an embodiment" or "one possible implementation" in various places throughout this specification are not necessarily necessarily referring to the same embodiment. Furthermore, the particular features, structures or characteristics may be combined in any suitable manner in one or more embodiments.
最后应说明的是:以上各实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述各实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, but not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: The technical solutions described in the foregoing embodiments can still be modified, or some or all of the technical features thereof can be equivalently replaced; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the technical solutions of the embodiments of the present application. Scope.

Claims (28)

  1. 一种深度图像处理方法,其特征在于,所述方法包括:A depth image processing method, characterized in that the method comprises:
    获取第一对象的第一深度图像;obtaining a first depth image of the first object;
    通过视场相位补正系数矩阵对所述第一深度图像中像素的深度值补正获得第二深度图像,其中,所述视场相位补正系数矩阵为对n个初始深度图像预处理后获得的用于补正视场相位误差的矩阵,所述n个初始深度图像为在第一情况下获得的深度图像,所述第一情况为拍摄设备的光源的启动时刻与所述拍摄设备的传感器的启动时刻为不同时刻,所述预处理包括根据所述n个初始深度图像所做的均值处理,所述n为大于1的整数。A second depth image is obtained by correcting the depth values of the pixels in the first depth image through a field of view phase correction coefficient matrix, wherein the field of view phase correction coefficient matrix is obtained after preprocessing the n initial depth images for The matrix for correcting the phase error of the field of view, the n initial depth images are the depth images obtained in the first situation, and the first situation is that the start-up time of the light source of the photographing device and the start-up time of the sensor of the photographing device are: At different times, the preprocessing includes mean value processing performed according to the n initial depth images, where n is an integer greater than 1.
  2. 根据权利要求1所述的方法,其特征在于,所述预处理还包括曲面拟合处理,The method according to claim 1, wherein the preprocessing further comprises surface fitting processing,
    所述视场相位补正系数矩阵为根据n个拟合深度图像计算获得,所述n个拟合深度图像由所述n个初始深度图像分别进行曲面拟合获得,所述n个初始深度图像为基于所述拍摄设备n次通过飞行时间TOF测距法获得的第二对象的深度图像,所述n次中第i次的所述光源的启动时刻比所述传感器的启动时刻延迟(i-1)*Δt,所述i的取值范围为[1,n],n*︱Δt︱=k*T,所述T为所述光信号的周期,所述k为整数,所述Δt为预设时长。The field of view phase correction coefficient matrix is calculated and obtained according to n fitted depth images, and the n fitted depth images are obtained by performing surface fitting on the n initial depth images respectively, and the n initial depth images are: Based on the depth images of the second object obtained by the photographing device n times by the time-of-flight TOF ranging method, the start-up time of the light source at the i-th time in the n times is delayed from the start-up time of the sensor by (i-1 )*Δt, the value range of the i is [1, n], n*︱Δt︱=k*T, the T is the period of the optical signal, the k is an integer, and the Δt is the pre- Set the duration.
  3. 根据权利要求2所述的方法,其特征在于,所述第i次获得的初始深度图像为第i初始深度图像,所述第i初始深度图像用像素矩阵Di(x,y)表示,所述像素矩阵Di(x,y)为像素矩阵Di(x,y)’中每个像素值与c*[(1-i)*Δt]/2取和得到的,所述Di(x,y)’为所述第i次测量获得的深度图像的像素矩阵,所述c*[(1-i)*Δt]/2为由于所述光源的启动时刻比所述传感器的启动时刻延迟了所述(i-1)*Δt产生的距离差。The method according to claim 2, wherein the initial depth image obtained for the i-th time is the i-th initial depth image, and the i-th initial depth image is represented by a pixel matrix Di(x, y). The pixel matrix Di(x, y) is obtained by summing each pixel value in the pixel matrix Di(x, y)' and c*[(1-i)*Δt]/2, the Di(x, y) ' is the pixel matrix of the depth image obtained by the i-th measurement, and the c*[(1-i)*Δt]/2 is because the start-up time of the light source is delayed from the start-up time of the sensor (i-1)*Δt produces distance difference.
  4. 根据权利要求2或3所述的方法,其特征在于,所述视场相位补正系数矩阵为根据n个拟合深度图像计算获得,包括:The method according to claim 2 or 3, wherein the field of view phase correction coefficient matrix is calculated and obtained according to n fitted depth images, comprising:
    所述视场相位补正系数矩阵为拟合平均像素矩阵的多个像素值中的最小值分别与所述拟合平均像素矩阵的各个像素值取比值得到的比值矩阵,所述拟合平均像素矩阵为所述n个拟合深度图像的像素矩阵取平均获得。The field of view phase correction coefficient matrix is a ratio matrix obtained by taking the ratio between the minimum value of the multiple pixel values of the fitted average pixel matrix and each pixel value of the fitted average pixel matrix, and the fitted average pixel matrix Obtained by averaging the pixel matrices of the n fitted depth images.
  5. 根据权利要求2至4任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 2 to 4, wherein the method further comprises:
    通过固定模式噪声FPN矩阵对所述第二深度图像补正获得第三深度图像,其中,所述FPN矩阵中的每个值分别包括由硬件导致的所述第一深度图像中与所述每个值相同下标的像素的固定噪声。A third depth image is obtained by compensating the second depth image through a fixed pattern noise FPN matrix, wherein each value in the FPN matrix includes the difference between each value in the first depth image caused by hardware and the Fixed noise for pixels of the same subscript.
  6. 根据权利要求5所述的方法,其特征在于,所述FPN矩阵为拟合平均像素矩阵与初始平均像素矩阵取差值得到的差值矩阵,所述拟合平均像素矩阵为所述n个拟合深度图像的像素矩阵取平均获得,所述初始平均像素矩阵为所述n个初始深度图像的像素矩阵取平均获得。The method according to claim 5, wherein the FPN matrix is a difference matrix obtained by taking a difference between a fitted average pixel matrix and an initial average pixel matrix, and the fitted average pixel matrix is the n fitted average pixel matrix. The pixel matrix of the combined depth image is obtained by averaging, and the initial average pixel matrix is obtained by averaging the pixel matrices of the n initial depth images.
  7. 根据权利要求1至6任一项所述的方法,其特征在于,所述通过视场相位补正系数矩阵对所述第一深度图像补正获得第二深度图像,包括:The method according to any one of claims 1 to 6, wherein the obtaining the second depth image by compensating the first depth image through a field of view phase correction coefficient matrix comprises:
    分别计算所述第一深度图像的像素矩阵与所述视场相位补正系数矩阵中相同下标的像素值的乘积得到所述第二深度图像。The second depth image is obtained by separately calculating the product of the pixel matrix of the first depth image and the pixel value of the same subscript in the field of view phase correction coefficient matrix.
  8. 根据权利要求5或6所述的方法,其特征在于,所述通过固定模式噪声FPN矩阵对所述第二深度图像补正获得第三深度图像,包括:The method according to claim 5 or 6, wherein the obtaining a third depth image by compensating the second depth image through a fixed pattern noise FPN matrix, comprising:
    分别计算所述第一深度图像的像素矩阵与所述视场相位补正系数矩阵中相同下标的像素值的乘积得到乘积矩阵;Respectively calculate the product of the pixel matrix of the first depth image and the pixel value of the same subscript in the field of view phase correction coefficient matrix to obtain a product matrix;
    计算所述乘积矩阵与所述FPN矩阵的和得到所述第三深度图像。The third depth image is obtained by calculating the sum of the product matrix and the FPN matrix.
  9. 一种深度图像处理方法,其特征在于,所述方法包括:A depth image processing method, characterized in that the method comprises:
    获取n个初始深度图像,所述n个初始深度图像为基于拍摄设备n次通过飞行时间TOF测距法获取到的第二对象的深度图像,其中,所述n次中第i次的所述拍摄设备的光源的启动时刻比所述拍摄设备的传感器的启动时刻延迟(i-1)*Δt,所述i的取值范围为[1,n],n*︱Δt︱=k*T,所述T为所述光信号的周期,所述n为大于1的整数,所述k为整数,所述Δt为预设时长;Acquire n initial depth images, where the n initial depth images are the depth images of the second object obtained by the time-of-flight TOF ranging method n times based on the photographing device, wherein the i-th in the n times The starting time of the light source of the photographing device is delayed by (i-1)*Δt from the starting time of the sensor of the photographing device, and the value range of the i is [1, n], n*︱Δt︱=k*T, The T is the period of the optical signal, the n is an integer greater than 1, the k is an integer, and the Δt is a preset duration;
    对所述n个初始深度图像分别进行曲面拟合得到n个拟合深度图像;performing surface fitting on the n initial depth images respectively to obtain n fitted depth images;
    根据所述n个拟合深度图像做均值处理后计算得到视场相位补正系数矩阵,所述视场相位补正系数矩阵用于补正所述拍摄设备通过所述TOF测距法获取的深度图像的视场相位误差。The field of view phase correction coefficient matrix is calculated and obtained after averaging processing according to the n fitted depth images, and the field of view phase correction coefficient matrix is used to correct the visual field of the depth image obtained by the photographing device through the TOF ranging method. Field phase error.
  10. 根据权利要求9所述的方法,其特征在于,所述第i次获得的初始深度图像为第i初始深度图像;所述获取n个初始深度图像,包括:The method according to claim 9, wherein the initial depth image obtained for the i-th time is the i-th initial depth image; and the acquiring n initial depth images comprises:
    获取所述拍摄设备n次通过飞行时间TOF测距法实际测量得到的n个测量深度图像,所述n个测量深度图像中的第i测量深度图像用像素矩阵Di(x,y)’表示;Acquire n measured depth images obtained by the actual measurement by the time-of-flight TOF ranging method of the shooting device n times, and the i-th measured depth image in the n measured depth images is represented by a pixel matrix Di(x, y)';
    分别计算所述像素矩阵Di(x,y)’中每个像素值与c*[(1-i)*Δt]/2的和得到所述第i初始深度图像Di(x,y),所述c*[(1-i)*Δt]/2为由于所述光源的启动时刻比所述传感器的启动时刻延迟了所述(i-1)*Δt产生的距离差。Calculate the sum of each pixel value in the pixel matrix Di(x, y)' and c*[(1-i)*Δt]/2 to obtain the i-th initial depth image Di(x, y), so The c*[(1-i)*Δt]/2 is the distance difference generated because the activation time of the light source is delayed by the (i-1)*Δt from the activation time of the sensor.
  11. 根据权利要求9或10所述的方法,其特征在于,所述根据所述n个拟合深度图像做均值处理后计算得到视场相位补正系数矩阵,包括:The method according to claim 9 or 10, wherein the calculation to obtain a field of view phase correction coefficient matrix after performing mean value processing on the n fitted depth images, comprising:
    将所述n个拟合深度图像的像素矩阵取平均得到拟合平均像素矩阵;averaging the pixel matrices of the n fitted depth images to obtain a fitted average pixel matrix;
    提取所述拟合平均像素矩阵中的多个像素值的最小值,并计算所述最小值分别与所述拟合平均像素矩阵的各个像素值的比值得到比值矩阵,所述比值矩阵为所述视场相位补正系数矩阵。Extracting the minimum value of a plurality of pixel values in the fitting average pixel matrix, and calculating the ratio of the minimum value to each pixel value of the fitting average pixel matrix to obtain a ratio matrix, where the ratio matrix is the Field of view phase correction coefficient matrix.
  12. 根据权利要求9至11任一项所述的方法,其特征在于,所述对所述n个初始深度图像分别进行曲面拟合得到n个拟合深度图像之后,还包括:The method according to any one of claims 9 to 11, wherein after performing surface fitting on the n initial depth images to obtain n fitted depth images, the method further comprises:
    将所述n个初始深度图像的像素矩阵取平均得到初始平均像素矩阵;averaging the pixel matrices of the n initial depth images to obtain an initial average pixel matrix;
    将所述n个拟合深度图像的像素矩阵取平均得到拟合平均像素矩阵;averaging the pixel matrices of the n fitted depth images to obtain a fitted average pixel matrix;
    计算所述拟合平均像素矩阵与所述初始平均像素矩阵取差值得到差值矩阵,所述差值矩阵为固定模式噪声FPN矩阵,所述FPN矩阵中的每个值分别包括由硬件导致的深度图像中与所述每个值相同下标的像素的固定噪声。Calculate the difference between the fitted average pixel matrix and the initial average pixel matrix to obtain a difference matrix, the difference matrix is a fixed pattern noise FPN matrix, and each value in the FPN matrix includes Fixed noise for pixels in the depth image with the same subscript as each value.
  13. 一种深度图像处理设备,其特征在于,所述设备包括:A depth image processing device, characterized in that the device includes:
    获取单元,用于获取第一对象的第一深度图像;an acquisition unit for acquiring the first depth image of the first object;
    补正单元,用于通过视场相位补正系数矩阵对所述第一深度图像中像素的深度值补正获得第二深度图像,其中,所述视场相位补正系数矩阵为对n个初始深度图像预处理后获得的用于补正视场相位误差的矩阵,所述n个初始深度图像为在第一情况下获得的深度图像,所述第一情况为拍摄设备的光源的启动时刻与所述拍摄设备的传感器的启动时刻为不同时刻,所述预处理包括根据所述n个初始深度图像所做的均值处理,所述n为大于1的整数。The correction unit is used to obtain a second depth image by correcting the depth value of the pixel in the first depth image by the field of view phase correction coefficient matrix, wherein the field of view phase correction coefficient matrix is to preprocess the n initial depth images The matrix used to correct the phase error of the field of view obtained later, the n initial depth images are the depth images obtained in the first case, and the first case is the start-up moment of the light source of the shooting device and the shooting device. The startup moments of the sensor are different moments, and the preprocessing includes mean value processing performed according to the n initial depth images, where n is an integer greater than 1.
  14. 根据权利要求13所述的设备,其特征在于,所述预处理还包括曲面拟合处理,The device according to claim 13, wherein the preprocessing further comprises surface fitting processing,
    所述视场相位补正系数矩阵为根据n个拟合深度图像计算获得,所述n个拟合深度图像由所述n个初始深度图像分别进行曲面拟合获得,所述n个初始深度图像为基于所述拍摄设备n次通过飞行时间TOF测距法获得的第二对象的深度图像,所述n次中第i次的所述光源的启动时刻比所述传感器的启动时刻延迟(i-1)*Δt,所述i的取值范围为[1,n],n*︱Δt︱=k*T,所述T为所述光信号的周期,所述k为整数,所述Δt为预设时长。The field of view phase correction coefficient matrix is calculated and obtained according to n fitted depth images, and the n fitted depth images are obtained by performing surface fitting on the n initial depth images respectively, and the n initial depth images are: Based on the depth images of the second object obtained by the photographing device n times by the time-of-flight TOF ranging method, the start-up time of the light source at the i-th time in the n times is delayed from the start-up time of the sensor by (i-1 )*Δt, the value range of the i is [1, n], n*︱Δt︱=k*T, the T is the period of the optical signal, the k is an integer, and the Δt is the pre- Set the duration.
  15. 根据权利要求14所述的设备,其特征在于,所述第i次获得的初始深度图像为第i初始深度图像,所述第i初始深度图像用像素矩阵Di(x,y)表示,所述像素矩阵Di(x,y)为像素矩阵Di(x,y)’中每个像素值与c*[(1-i)*Δt]/2取和得到的,所述Di(x,y)’为所述第i次测量获得的深度图像的像素矩阵,所述c*[(1-i)*Δt]/2为由于所述光源的启动时刻比所述传感器的启动时刻延迟了所述(i-1)*Δt产生的距离差。The device according to claim 14, wherein the initial depth image obtained for the i-th time is the i-th initial depth image, and the i-th initial depth image is represented by a pixel matrix Di(x, y), and the The pixel matrix Di(x, y) is obtained by summing each pixel value in the pixel matrix Di(x, y)' and c*[(1-i)*Δt]/2, the Di(x, y) ' is the pixel matrix of the depth image obtained by the i-th measurement, and the c*[(1-i)*Δt]/2 is because the start-up time of the light source is delayed from the start-up time of the sensor (i-1)*Δt produces distance difference.
  16. 根据权利要求14或15所述的设备,其特征在于,所述视场相位补正系数矩阵为根据n个拟合深度图像计算获得,包括:The device according to claim 14 or 15, wherein the field of view phase correction coefficient matrix is calculated and obtained according to n fitted depth images, comprising:
    所述视场相位补正系数矩阵为拟合平均像素矩阵中的多个像素值的最小值分别与所述拟合平均像素矩阵的各个像素值取比值得到的比值矩阵,所述拟合平均像素矩阵为所述n个拟合深度图像的像素矩阵取平均获得。The field of view phase correction coefficient matrix is a ratio matrix obtained by taking the ratio between the minimum value of a plurality of pixel values in the fitted average pixel matrix and each pixel value of the fitted average pixel matrix, and the fitted average pixel matrix Obtained by averaging the pixel matrices of the n fitted depth images.
  17. 根据权利要求14至16任一项所述的设备,其特征在于,所述补正单元还用于:The device according to any one of claims 14 to 16, wherein the correction unit is also used for:
    通过固定模式噪声FPN矩阵对所述第二深度图像补正获得第三深度图像,其中,所述 FPN矩阵中的每个值分别包括由硬件导致的所述第一深度图像中与所述每个值相同下标的像素的固定噪声。A third depth image is obtained by compensating the second depth image through a fixed pattern noise FPN matrix, wherein each value in the FPN matrix includes the difference between each value in the first depth image caused by hardware and the Fixed noise for pixels of the same subscript.
  18. 根据权利要求17所述的设备,其特征在于,所述FPN矩阵为拟合平均像素矩阵与初始平均像素矩阵取差值得到的差值矩阵,所述拟合平均像素矩阵为所述n个拟合深度图像的像素矩阵取平均获得,所述初始平均像素矩阵为所述n个初始深度图像的像素矩阵取平均获得。The device according to claim 17, wherein the FPN matrix is a difference value matrix obtained by taking a difference between a fitted average pixel matrix and an initial average pixel matrix, and the fitted average pixel matrix is the n fitted average pixel matrix. The pixel matrix of the combined depth image is obtained by averaging, and the initial average pixel matrix is obtained by averaging the pixel matrices of the n initial depth images.
  19. 根据权利要求13至18任一项所述的设备,其特征在于,所述补正单元具体用于:The device according to any one of claims 13 to 18, wherein the correction unit is specifically used for:
    分别计算所述第一深度图像的像素矩阵与所述视场相位补正系数矩阵中相同下标的像素值的乘积得到所述第二深度图像。The second depth image is obtained by separately calculating the product of the pixel matrix of the first depth image and the pixel value of the same subscript in the field of view phase correction coefficient matrix.
  20. 根据权利要求17或18所述的设备,其特征在于,所述补正单元具体用于:The device according to claim 17 or 18, wherein the correction unit is specifically used for:
    分别计算所述第一深度图像的像素矩阵与所述视场相位补正系数矩阵中相同下标的像素值的乘积得到乘积矩阵;Respectively calculate the product of the pixel matrix of the first depth image and the pixel value of the same subscript in the field of view phase correction coefficient matrix to obtain a product matrix;
    计算所述乘积矩阵与所述FPN矩阵的和得到所述第三深度图像。The third depth image is obtained by calculating the sum of the product matrix and the FPN matrix.
  21. 一种深度图像处理设备,其特征在于,所述设备包括:A depth image processing device, characterized in that the device includes:
    获取单元,用于获取n个初始深度图像,所述n个初始深度图像为基于拍摄设备n次通过飞行时间TOF测距法获取到的第二对象的深度图像,其中,所述n次中第i次的所述拍摄设备的光源的启动时刻比所述拍摄设备的传感器的启动时刻延迟(i-1)*Δt,所述i的取值范围为[1,n],n*︱Δt︱=k*T,所述T为所述光信号的周期,所述n为大于1的整数,所述k为整数,所述Δt为预设时长;an acquisition unit, configured to acquire n initial depth images, where the n initial depth images are the depth images of the second object obtained by the time-of-flight TOF ranging method n times based on the photographing device, wherein the nth The activation time of the light source of the photographing device for i times is delayed by (i-1)*Δt from the activation time of the sensor of the photographing device, and the value range of i is [1, n], n*︱Δt︱ =k*T, the T is the period of the optical signal, the n is an integer greater than 1, the k is an integer, and the Δt is a preset duration;
    曲面拟合单元,用于对所述n个初始深度图像分别进行曲面拟合得到n个拟合深度图像;a surface fitting unit, configured to perform surface fitting on the n initial depth images respectively to obtain n fitted depth images;
    计算单元,用于根据所述n个拟合深度图像做均值处理后计算得到视场相位补正系数矩阵,所述视场相位补正系数矩阵用于补正所述拍摄设备通过所述TOF测距法获取的深度图像的视场相位误差。The calculation unit is used to calculate and obtain the field of view phase correction coefficient matrix after performing mean value processing according to the n fitting depth images, and the field of view phase correction coefficient matrix is used to correct that the shooting equipment is obtained by the TOF ranging method The field of view phase error of the depth image.
  22. 根据权利要求21所述的设备,其特征在于,所述第i次获得的初始深度图像为第i初始深度图像;所述获取单元具体用于:The device according to claim 21, wherein the initial depth image obtained for the i-th time is the i-th initial depth image; and the obtaining unit is specifically used for:
    获取所述拍摄设备n次通过飞行时间TOF测距法实际测量得到的n个测量深度图像,所述n个测量深度图像中的第i测量深度图像用像素矩阵Di(x,y)’表示;Acquire n measured depth images obtained by the actual measurement by the time-of-flight TOF ranging method of the shooting device n times, and the i-th measured depth image in the n measured depth images is represented by a pixel matrix Di(x, y)';
    分别计算所述像素矩阵Di(x,y)’中每个像素值与c*[(1-i)*Δt]/2的和得到所述第i初始深度图像Di(x,y),所述c*[(1-i)*Δt]/2为由于所述光源的启动时刻比所述传感器的启动时刻延迟了所述(i-1)*Δt产生的距离差。Calculate the sum of each pixel value in the pixel matrix Di(x, y)' and c*[(1-i)*Δt]/2 to obtain the i-th initial depth image Di(x, y), so The c*[(1-i)*Δt]/2 is the distance difference generated because the activation time of the light source is delayed by the (i-1)*Δt from the activation time of the sensor.
  23. 根据权利要求21或22所述的设备,其特征在于,所述计算单元具体用于:The device according to claim 21 or 22, wherein the computing unit is specifically configured to:
    将所述n个拟合深度图像的像素矩阵取平均得到拟合平均像素矩阵;averaging the pixel matrices of the n fitted depth images to obtain a fitted average pixel matrix;
    提取所述拟合平均像素矩阵中的多个像素值的最小值,并计算所述最小值分别与所述拟合平均像素矩阵的各个像素值的比值得到比值矩阵,所述比值矩阵为所述视场相位补正系数矩阵。Extracting the minimum value of a plurality of pixel values in the fitting average pixel matrix, and calculating the ratio of the minimum value to each pixel value of the fitting average pixel matrix to obtain a ratio matrix, where the ratio matrix is the Field of view phase correction coefficient matrix.
  24. 根据权利要求21至23任一项所述的设备,其特征在于,所述计算单元,还用于在所述曲面拟合单元对所述n个初始深度图像分别进行曲面拟合得到n个拟合深度图像之后,将所述n个初始深度图像的像素矩阵取平均得到初始平均像素矩阵;The device according to any one of claims 21 to 23, wherein the computing unit is further configured to perform surface fitting on the n initial depth images in the curved surface fitting unit respectively to obtain n simulated images. After combining the depth images, average the pixel matrices of the n initial depth images to obtain an initial average pixel matrix;
    将所述n个拟合深度图像的像素矩阵取平均得到拟合平均像素矩阵;averaging the pixel matrices of the n fitted depth images to obtain a fitted average pixel matrix;
    计算所述拟合平均像素矩阵与所述初始平均像素矩阵取差值得到差值矩阵,所述差值矩阵为固定模式噪声FPN矩阵,所述FPN矩阵中的每个值分别包括由硬件导致的深度图像中与所述每个值相同下标的像素的固定噪声。Calculate the difference between the fitted average pixel matrix and the initial average pixel matrix to obtain a difference matrix, the difference matrix is a fixed pattern noise FPN matrix, and each value in the FPN matrix includes Fixed noise for pixels in the depth image with the same subscript as each value.
  25. 一种深度图像处理设备,其特征在于,所述设备包括处理器、通信接口和存储器,其中,所述存储器用于存储计算机程序,所述处理器用于执行所述存储器中存储的计算机程序以实现如权利要求1至8任一项所述的方法;或者,所述处理器用于执行所述存储器中存储的计算机程序以实现如权利要求9至12任一项所述的方法。A depth image processing device, characterized in that the device includes a processor, a communication interface and a memory, wherein the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory to achieve The method according to any one of claims 1 to 8; or, the processor is configured to execute a computer program stored in the memory to implement the method according to any one of claims 9 to 12.
  26. 一种装置,所述装置包括处理器和通信接口,其特征在于,所述装置被配置为执行权利要求1至8任意一项或9至12任意一项所述的方法。An apparatus comprising a processor and a communication interface, characterized in that, the apparatus is configured to perform the method of any one of claims 1 to 8 or any one of 9 to 12.
  27. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行以实现权利要求1至8任意一项或9至12任意一项所述的方法。A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program, and the computer program is executed by a processor to realize any one of claims 1 to 8 or any one of claims 9 to 12. method described.
  28. 一种计算机程序产品,其特征在于,当所述计算机程序产品被计算机读取并执行时,如权利要求1至8任意一项或9至12任意一项所述的方法将被执行。A computer program product, characterized in that, when the computer program product is read and executed by a computer, the method according to any one of claims 1 to 8 or any one of claims 9 to 12 will be executed.
PCT/CN2020/098640 2020-06-28 2020-06-28 Depth image processing method and device WO2022000147A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202080101640.5A CN115667989A (en) 2020-06-28 2020-06-28 Depth image processing method and device
PCT/CN2020/098640 WO2022000147A1 (en) 2020-06-28 2020-06-28 Depth image processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/098640 WO2022000147A1 (en) 2020-06-28 2020-06-28 Depth image processing method and device

Publications (1)

Publication Number Publication Date
WO2022000147A1 true WO2022000147A1 (en) 2022-01-06

Family

ID=79317754

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/098640 WO2022000147A1 (en) 2020-06-28 2020-06-28 Depth image processing method and device

Country Status (2)

Country Link
CN (1) CN115667989A (en)
WO (1) WO2022000147A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115311372A (en) * 2022-10-12 2022-11-08 荣耀终端有限公司 Camera error correction method and related device
CN115546306A (en) * 2022-01-30 2022-12-30 荣耀终端有限公司 Camera calibration method and device, electronic equipment and readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190086520A1 (en) * 2017-09-19 2019-03-21 Rockwell Automation Technologies, Inc. Pulsed-based time of flight methods and system
CN109991583A (en) * 2019-03-14 2019-07-09 深圳奥比中光科技有限公司 A kind of jamproof distance measurement method and depth camera
CN110456370A (en) * 2019-07-30 2019-11-15 炬佑智能科技(苏州)有限公司 Flight time sensor-based system and its distance measuring method
CN110456369A (en) * 2019-07-30 2019-11-15 炬佑智能科技(苏州)有限公司 Flight time sensor-based system and its distance measuring method
EP3594716A1 (en) * 2018-07-10 2020-01-15 Rockwell Automation Technologies, Inc. High dynamic range for sensing systems and methods

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190086520A1 (en) * 2017-09-19 2019-03-21 Rockwell Automation Technologies, Inc. Pulsed-based time of flight methods and system
EP3594716A1 (en) * 2018-07-10 2020-01-15 Rockwell Automation Technologies, Inc. High dynamic range for sensing systems and methods
CN109991583A (en) * 2019-03-14 2019-07-09 深圳奥比中光科技有限公司 A kind of jamproof distance measurement method and depth camera
CN110456370A (en) * 2019-07-30 2019-11-15 炬佑智能科技(苏州)有限公司 Flight time sensor-based system and its distance measuring method
CN110456369A (en) * 2019-07-30 2019-11-15 炬佑智能科技(苏州)有限公司 Flight time sensor-based system and its distance measuring method

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115546306A (en) * 2022-01-30 2022-12-30 荣耀终端有限公司 Camera calibration method and device, electronic equipment and readable storage medium
CN115311372A (en) * 2022-10-12 2022-11-08 荣耀终端有限公司 Camera error correction method and related device
CN115311372B (en) * 2022-10-12 2023-04-07 荣耀终端有限公司 Camera error correction method and related device

Also Published As

Publication number Publication date
CN115667989A (en) 2023-01-31

Similar Documents

Publication Publication Date Title
WO2022000147A1 (en) Depth image processing method and device
CN102346250B (en) Time-of-flight imager
US20180278910A1 (en) Correction of multipath interference in time of flight camera depth imaging measurements
CN110996082B (en) Projection adjusting method and device, projector and readable storage medium
WO2019011027A1 (en) Image calibration method and device applied to three-dimensional camera
CN110163898B (en) Depth information registration method, device, system, equipment and storage medium
CN112085801B (en) Calibration method for fusion of three-dimensional point cloud and two-dimensional image based on neural network
WO2020119467A1 (en) High-precision dense depth image generation method and device
US20160232684A1 (en) Motion compensation method and apparatus for depth images
WO2020237418A1 (en) Coordinate correction method and apparatus, and computing device and computer storage medium
CN114494388B (en) Three-dimensional image reconstruction method, device, equipment and medium in large-view-field environment
CN110675456A (en) Method and device for calibrating external parameters of multi-depth camera and storage medium
US20200326426A1 (en) Time-of-flight measurements using linear inverse function
US10209360B2 (en) Reduced phase sampling for high speed depth sensing
EP3140752A1 (en) Systems and methods for determining pupillary distance and scale
CN111028294B (en) Multi-distance calibration method and system based on depth camera
US11436756B2 (en) Calibrating a machine vision camera
US10977821B2 (en) High accuracy extrinsic calibration procedure for cameras and range sensors
WO2020248190A1 (en) Coordinate correction method and apparatus, computing device, and computer storage medium
CN115311372B (en) Camera error correction method and related device
CN112562013B (en) Multi-lens camera calibration method, device and storage medium
WO2022022136A1 (en) Depth image generation method and apparatus, reference image generation method and apparatus, electronic device, and computer readable storage medium
JP2020052897A (en) Target detection device and target detection method
CN110612429A (en) Three-dimensional image ranging system and method
CN111982071B (en) 3D scanning method and system based on TOF camera

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20943589

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20943589

Country of ref document: EP

Kind code of ref document: A1