Method for determining depth value, device, chip system, and storage medium

By using the crosstalk signal returned by the glass cover in the depth detection module to perform 0-distance point correction and histogram signal separation, the problem of inaccurate depth values caused by glass cover reflection is solved, and the measurement accuracy of the depth detection module in close-range and long-distance distance measurement scenarios is improved.

WO2025147802A1PCT designated stage expired Publication Date: 2025-07-17HONOR DEVICE CO LTD

Patent Information

Application Number
PCT/CN2024/071092
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2024-01-08
Publication Date
2025-07-17

AI Technical Summary

Technical Problem

The existing depth detection module based on the time of flight method is inaccurate in electronic equipment due to the light reflected by the glass cover plate, and especially in close range measurement scenarios, it is impossible to accurately distinguish the crosstalk signal and the target signal, which affects the auxiliary focus effect.

Method used

By using the crosstalk signal returned by the glass cover as the reference signal to perform 0 distance point correction, the interference of the crosstalk signal to the target signal is reduced, and the target signal is separated in the histogram by using the bimodal subtraction method or the preset reference signal correction method to improve the accuracy of the depth value.

Benefits of technology

It effectively reduces the interference of crosstalk signals on the target signal, improves the measurement accuracy of the depth detection module in close and long-distance ranging scenarios, and ensures the accuracy of auxiliary focus and depth information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024071092_17072025_PF_FP_ABST
    Figure CN2024071092_17072025_PF_FP_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of terminals, and provides a method for determining a depth value, a device, a chip system, and a storage medium. In a scenario where depth information is measured, on the basis of a histogram obtained by a depth detection module, it is first determined whether an object under detection is at a close distance; when said object is at a far distance, an envelope position of a crosstalk signal and an envelope position of a target signal are far away from one another on the horizontal axis in the histogram, and a depth value is obtained by subtraction between two peaks; when said object is at a close distance, since the peaks of the two signals cannot be clearly distinguished, a preset reference signal is used as a crosstalk signal actually detected within the duration of the present instance of detection, and a target signal is restored from the histogram on the basis of the preset reference signal; then, a depth value is obtained on the basis of receiving times of the preset reference signal and the target signal. The crosstalk signal returning from a glass cover plate is used as a reference signal for performing zero-distance point calibration, thus reducing the interference by the crosstalk signal on the target signal returning from the object under detection, and improving the accuracy of depth information.
Need to check novelty before this filing date? Find Prior Art

Description

Depth value determination method, device, chip system and storage medium Technical Field

[0001] The present application relates to the field of terminal technology, and in particular to a method, device, chip system and storage medium for determining a depth value. Background Art

[0002] Depth detection modules based on algorithms like time of flight (ToF) are increasingly being used in electronic devices such as mobile phones. For example, when taking photos or videos, these devices can use the depth information provided by the depth detection module to assist in focusing, achieving a wide-aperture blur effect. In some cases, the depth information provided by the depth detection module may be inaccurate, affecting the assisted focusing effect.

[0003] Summary of the Invention

[0004] The present application provides a depth value determination method, device, chip system and storage medium, which solve the technical problem of inaccurate depth values ​​measured by a depth detection module.

[0005] To achieve the above objectives, this application adopts the following technical solutions:

[0006] In a first aspect, an embodiment of the present application provides a method for determining a depth value. The method can be applied to an electronic device. A depth detection module is provided under the cover plate of the electronic device, and the depth detection module includes a transmitting end and a receiving end. The method may include: the electronic device receives a pulse signal through the receiving end, and the pulse signal includes a first crosstalk signal and a target signal, the first crosstalk signal is a signal emitted by the transmitting end and reflected back through the cover plate, and the target signal is a signal emitted by the transmitting end and reflected back through the object to be measured. Then, the electronic device determines the depth value of the object to be measured based on the reception time of the second crosstalk signal and the reception time of the target signal. The second crosstalk signal is the first crosstalk signal, or the second crosstalk signal is a preset crosstalk signal. The depth value of the object to be measured represents the distance from the electronic device to the object to be measured.

[0007] In the above scheme, the distance between the depth detection module and the cover plate is smaller than the distance between the depth detection module and the object being measured, so that the time when the depth detection module receives the crosstalk signal reflected by the cover plate is earlier than the time when the target signal reflected by the object being measured is received. If the crosstalk signal and the target signal are superimposed, the crosstalk signal will interfere with the target signal. Based on the characteristic that the crosstalk signal is received earlier, the electronic device can separate the target signal from the pulse signal, use the reception time of the crosstalk signal as the zero distance point, and correct the flight time of the target signal, so that the depth value calculated based on the corrected flight time is more accurate.

[0008] In a possible implementation, the depth detection module may be a ToF module.

[0009] In a possible implementation, the cover plate may be a glass cover plate.

[0010] In one possible implementation, before the electronic device determines the depth value of the object under test based on the reception time of the second crosstalk signal and the reception time of the target signal, the method may further include: the electronic device separating the target signal from the pulse signal based on the second crosstalk signal.

[0011] For example, the electronic device can generate a first histogram based on the pulse signal, the horizontal axis of the first histogram represents the reception time of the pulse signal, and the vertical axis of the first histogram represents the signal strength of the pulse signal; if a peak that meets the preset conditions is found within the preset peak-seeking range of the first histogram, the electronic device separates the target signal from the first histogram based on the preset crosstalk signal; or, if a peak that meets the preset conditions is not found within the preset peak-seeking range of the first histogram, the electronic device determines the first crosstalk signal and the target signal respectively in the first histogram, and the reception time of the first crosstalk signal is earlier than the reception time of the target signal. Wherein, the preset peak-seeking range is determined according to the peak position of the preset crosstalk signal. It can be understood that when the environmental parameters of the electronic device remain unchanged, the electronic device can directly determine the peak-seeking range of the first pixel based on the preset crosstalk signal, and then find the peak that meets the preset conditions in the histogram obtained by the histogram statistics module.

[0012] For another example, the electronic device can generate a first histogram based on a pulse signal, wherein the horizontal axis of the first histogram represents the reception time of the pulse signal, and the vertical axis of the first histogram represents the signal strength of the pulse signal; based on the ambient temperature of the electronic device and the voltage of the depth detection module, the electronic device adjusts the reception time of the pulse signal in the first histogram (for example, the signal envelope of the pulse signal is offset by the target adjustment amount along the first direction of the horizontal axis) to obtain a second histogram; if a peak that meets the preset conditions is found within the preset peak-seeking range of the second histogram, the electronic device separates the target signal from the second histogram based on the preset crosstalk signal; or, if a peak that meets the preset conditions is not found within the preset peak-seeking range of the second histogram, the electronic device determines the first crosstalk signal and the target signal respectively in the first histogram, and the reception time of the first crosstalk signal is earlier than the reception time of the target signal. Wherein, the preset peak-seeking range is determined according to the peak position of the preset crosstalk signal. It can be understood that while keeping the preset reference signal unchanged, the crosstalk signal and the target signal in the original histogram are offset along the horizontal axis, thereby improving the accuracy of the target signal restored from the histogram based on the preset reference signal in the close-range ranging scenario, thereby improving the accuracy of the depth value finally calculated.

[0013] For another example, the electronic device can generate a first histogram based on a pulse signal, wherein the horizontal axis of the first histogram represents the reception time of the pulse signal, and the vertical axis of the first histogram represents the signal strength of the pulse signal; based on the ambient temperature of the electronic device and the voltage of the depth detection module, the electronic device adjusts the reception time of the preset crosstalk signal (for example, the signal envelope of the preset crosstalk signal is offset by the target adjustment amount along the second direction of the horizontal axis, the first direction being opposite to the second direction); if a peak that meets the preset conditions is found within the preset peak-seeking range of the first histogram, the electronic device separates the target signal from the first histogram based on the adjusted preset crosstalk signal; or, if a peak that meets the preset conditions is not found within the preset peak-seeking range of the first histogram, the electronic device determines the first crosstalk signal and the target signal separately in the first histogram, and the reception time of the first crosstalk signal is earlier than the reception time of the target signal. Wherein, the preset peak-seeking range is determined according to the peak position of the adjusted preset crosstalk signal. It can be understood that while keeping the horizontal axis position of the signal envelope in the original histogram unchanged, the preset reference signal is offset along the horizontal axis, thereby improving the accuracy of the target signal restored from the histogram based on the preset reference signal in the close-range ranging scenario, thereby improving the accuracy of the depth value finally calculated.

[0014] It should be noted that the above-mentioned “voltage of the depth detection module” refers to the power supply voltage of the power module of the electronic device to the depth detection module.

[0015] In a possible implementation, the above-mentioned preset condition may include a first condition and a second condition:

[0016] (1) The first condition is that the signal intensity of the peak to be found is greater than the intensity of the background noise.

[0017] Background noise can include ambient light noise, dark noise from circuitry, and noise caused by stains on the glass cover. For example, if the background noise is caused by stains on the glass cover, if the background noise signal intensity caused by the stains is high and the target signal is severely attenuated, the electronic device may mistakenly identify the background noise signal as the target signal based on a confidence algorithm. To avoid this, the electronic device can eliminate the interference by determining whether the signal intensity of the detected peak is greater than the background noise intensity. For example, the electronic device can detect the background noise intensity in real time and then determine whether the signal intensity of the detected peak is greater than the background noise intensity. If the signal intensity of the peak is greater than the background noise intensity, it indicates that the peak is not a background noise peak. If the signal intensity of the peak is less than or equal to the background noise intensity, it indicates that the peak is likely a background noise peak.

[0018] (2) The second condition is that the signal strength of the peak to be found is greater than N times the signal strength of the preset reference signal.

[0019] Here, N is greater than or equal to 2. For example, N=3.

[0020] The above-mentioned signal intensity may refer to the light intensity or the number of photons counted within the detection time.

[0021] When the ambient temperature of the electronic device and the voltage of the depth detection module remain constant, the intensity of the pulse signal emitted by the depth detection module remains constant, and the relative position of the glass cover and the depth detection module is also fixed. Therefore, the intensity distribution and peak position of the crosstalk signal actually measured by the electronic device remain unchanged. However, when the distance between the electronic device and the object being measured changes, the intensity of the target signal reflected from the object changes. For example, when the distance between the electronic device and the object being measured is close, most of the light emitted by the depth detection module penetrates the glass and illuminates the object being measured. The intensity of the target signal reflected from the object is N times that of the crosstalk signal reflected from the glass cover. As the distance between the electronic device and the object being measured increases, the intensity of the target signal gradually decreases. Based on the characteristic that the intensity of the target signal decreases with propagation distance, after finding a peak, the electronic device can determine whether the signal intensity of this peak is greater than N times the preset reference signal intensity. If the signal intensity of this peak is greater than N times the preset reference signal intensity, it indicates that the target signal attenuation is low, and the current scenario may be close-range ranging. If the signal strength of the peak is less than or equal to N times the strength of the preset reference signal, it means that the attenuation degree of the target signal is high and the current scenario may be long-distance ranging.

[0022] In one possible implementation, before the electronic device adjusts the reception time of the pulse signal in the first histogram, or before the electronic device adjusts the reception time of the preset crosstalk signal, the method may further include: the electronic device obtaining the ambient temperature of the electronic device and the voltage of the depth detection module; obtaining a first time adjustment amount based on the ambient temperature of the electronic device and a temperature compensation model; obtaining a second time adjustment amount based on the voltage of the depth detection module and a voltage compensation model; and using the sum of the first time adjustment amount and the second time adjustment amount as the target adjustment amount. The temperature compensation model is generated based on a plurality of first depth values, each of which is a depth value obtained by changing the ambient temperature at a preset voltage; and the voltage compensation model is generated based on a plurality of second depth values, each of which is a depth value obtained by changing the voltage of the depth detection module at a preset temperature.

[0023] For example, the relationship of the temperature compensation model is as follows: offset=a*(temperature-init temp ) 2 +b*(temperature-init temp ).

[0024] Among them, thermal offset Represents the depth value adjustment amount. a represents the slope of the first fitting line. b represents the slope of the second fitting line. temperature represents the ambient temperature of the electronic device during this detection. init temp Represents the reference temperature, which refers to the ambient temperature of the electronic device when calibrating the data, such as init temp =25℃.

[0025] For another example, the relationship of the voltage compensation model is as follows: Vspad offset =Vspad delta *ratio tof *1000 = (|Vspad meas |-V calc )*ratio tof *1000. =(|Vspad meas |-(|Vspad1|+(bvd current -bvd1)*bvd lsb ))*ratio tof *1000

[0026] Among them, Vspad offset Represents the depth value adjustment amount. delta Represents the difference between the voltage value of the depth detection module during this detection and the voltage value recorded during the calibration data. meas Represents the voltage of the depth detection module during this detection, in mV. Vspad1 represents the voltage value recorded during the calibration data, in mV. bvd current Represents the gear position during this detection. bvd1 represents the gear position recorded during the calibration data. lsb Represents the voltage value changed when switching a single gear, in mv. tof Represents the slope of the voltage fitting line.

[0027] In one possible implementation, the method may further include: when the signal strength of the peak found does not meet the preset conditions, the electronic device stores a set of data, and the set of data may include: the ambient temperature of the electronic device, the voltage of the depth detection module, and the signal parameters of the first crosstalk signal; when the multiple sets of data stored in the electronic device meet the update conditions, the electronic device updates the temperature compensation model or the voltage compensation model.

[0028] In the above solution, the temperature and voltage compensation models are preconfigured before the electronic device leaves the factory. Since they are generated based on a small number of depth detection modules, they can only reflect some common characteristics across these modules. Due to the individual differences between depth detection modules, the depth compensation values ​​calculated using these models may contain certain errors. Because the envelope positions of the crosstalk signal and the target signal are far apart on the horizontal axis in long-distance ranging scenarios, and the peaks of the two signals can be distinguished, the electronic device can separate the crosstalk signal from the histogram of the long-distance ranging scenario during use. Based on the crosstalk signal and the ambient temperature and voltage corresponding to the crosstalk signal, the temperature and voltage compensation models are continuously optimized, resulting in more accurate depth adjustment values ​​derived from these models.

[0029] In one possible implementation, if the second crosstalk signal is the first crosstalk signal, the electronic device determines the depth value of the object under test based on the reception time of the second crosstalk signal and the reception time of the target signal, which may include: the electronic device subtracts the reception time of the first crosstalk signal from the reception time of the target signal to obtain a first flight time; and determines the depth value of the object under test based on the first flight time. It can be understood that when the object under test is in a long-distance ranging range, the envelope position of the crosstalk signal and the envelope position of the target signal are far apart on the horizontal axis, and the peaks of the two signals can be distinguished, so the depth value can be obtained by subtracting the two peaks.

[0030] In one possible implementation, if the second crosstalk signal is a preset crosstalk signal, the electronic device determines the depth value of the measured object based on the reception time of the second crosstalk signal and the reception time of the target signal, which may include: the electronic device subtracting the reception time of the preset crosstalk signal from the reception time of the target signal to obtain a second flight time; and determining the depth value of the measured object based on the second flight time. It is understood that when the measured object is within the close-range ranging range, the peaks of the two signals cannot be clearly distinguished. The CPU can regard the preset reference signal as the crosstalk signal actually measured during this detection period, and restore the target signal from the histogram based on the preset reference signal, and then obtain the depth value based on the reception time of the preset reference signal and the target signal.

[0031] In one possible implementation, the receiving end may include multiple pixels. Accordingly, the electronic device determining the depth value of the measured object based on the reception time of the second crosstalk signal and the reception time of the target signal may include: the electronic device determining the reception time of a preset reference signal corresponding to a first pixel and the reception time of the target signal corresponding to the first pixel, where the first pixel is any one of the multiple pixels; and the electronic device determining the depth value corresponding to the first pixel based on the reception time of the preset reference signal corresponding to the first pixel and the reception time of the target signal corresponding to the first pixel.

[0032] In one possible implementation, the electronic device determines the reception time of the preset reference signal corresponding to the first pixel, which may include: the electronic device determines the reception time of the preset reference signal corresponding to the first pixel based on the envelope shape of the crosstalk signal of the pixel, the intensity distribution of the preset crosstalk signal corresponding to the first pixel, and the envelope position of the preset crosstalk signal corresponding to the first pixel. The envelope shape of the crosstalk signal of the pixel, the intensity distribution of the preset crosstalk signal corresponding to the first pixel, and the envelope position of the preset crosstalk signal corresponding to the first pixel are data pre-stored in the electronic device. It can be understood that since the envelope positions of the crosstalk signals of each pixel in the calibration data are different, the peak position of the preset reference signal corresponding to each pixel in the depth map is different, and the peak search range corresponding to each pixel in the depth map is also different.

[0033] In a second aspect, the present application provides an electronic device. The electronic device includes a cover plate, and a depth detection module arranged under the cover plate. The depth detection module includes a transmitter and a receiver. The transmitter is used to transmit a pulse signal; the receiver is used to receive the pulse signal reflected by the object to be measured and the cover plate; the processor is used to call instructions so that the electronic device executes the depth value determination method provided in the first aspect and any possible implementation thereof. The processor is a main processor in the electronic device connected to the depth detection module, or the processor is a digital signal processor in the depth detection module.

[0034] In a possible implementation, the transmitting end may include a pulse laser and a light scattering element, wherein the pulse laser is used to transmit a pulse signal, and the light scattering element is used to perform scattering processing on the pulse signal.

[0035] In one possible implementation, the receiving end may include a light detection element, a pulse response filter, and a light receiver. The light detection element is used to converge the received light, the pulse response filter is used to filter the converged light, and the light receiver is used to convert the filtered light into a pulse signal.

[0036] In a possible implementation, the optical receiver is a planar array device composed of multiple single-photon avalanche diode sensors.

[0037] In one possible implementation, the subtended angle of the light beam emitted by the transmitting end is 70°, and the subtended angle of the light beam received by the receiving end is 70°. The thickness of the depth detection module along the optical axis is 2.48 mm, the distance from the top surface of the depth detection module to the bottom surface of the glass cover is 0.8 mm, and the distance from the geometric center of the transmitting end to the geometric center of the receiving end is 4 mm.

[0038] In the above scheme, the transmitter and receiver utilize area array devices, which simplify hardware design, are relatively low-cost, and can cover all locations on the measured object. Furthermore, based on the above parameters, the primary path of the crosstalk signal is ensured to reflect only once within the glass cover. It can be understood that by minimizing the distance from the geometric center of the transmitter to the geometric center of the receiver, the multipath reflection effect of the crosstalk signal can be reduced.

[0039] In a third aspect, the present application provides a computer-readable storage medium. The computer-readable storage medium includes computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the depth value determination method provided in the first aspect and any possible implementation thereof.

[0040] In a fourth aspect, the present application provides a computer program product. When the computer program product is run on a computer, the computer is caused to execute the depth value determination method provided in the first aspect and any possible implementation thereof.

[0041] In a fifth aspect, the present application provides a chip system. The chip system is applied to an electronic device. The chip system includes one or more processors, and the one or more processors are configured to invoke computer instructions to cause the electronic device to execute the method provided in the first aspect and any possible implementation thereof.

[0042] It can be understood that the beneficial effects that can be achieved by the electronic device of the second aspect, the computer-readable storage medium of the third aspect, the computer program product of the fourth aspect and the chip system of the fifth aspect provided above can be referred to the beneficial effects in the first aspect and any possible implementation thereof, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] FIG1 is a schematic diagram of a distance measurement using a ToF module provided in an embodiment of the present application;

[0044] FIG2 is a schematic diagram of another embodiment of the present application using a ToF module for ranging;

[0045] FIG3 is a schematic diagram of an array diagram of depth information obtained using a ToF module according to an embodiment of the present application;

[0046] FIG4 is a schematic diagram of a scene in which an image is captured based on an uncorrected depth value according to an embodiment of the present application;

[0047] FIG5 is a schematic diagram of a scene in which an image is captured based on a corrected depth value according to an embodiment of the present application;

[0048] FIG6 is a schematic diagram of the hardware structure of a mobile phone provided in an embodiment of the present application;

[0049] FIG7 is a schematic diagram of the hardware structure of another mobile phone provided in an embodiment of the present application;

[0050] FIG8 is a schematic diagram of the hardware structure of a ToF module provided in an embodiment of the present application;

[0051] FIG9 is a schematic diagram of the hardware structure of another ToF module provided in an embodiment of the present application;

[0052] FIG10 is a schematic structural diagram of a receiving end array device provided in an embodiment of the present application;

[0053] FIG11 is a schematic diagram of ranging based on a planar light source and a receiving end array device provided in an embodiment of the present application;

[0054] FIG12 is a schematic diagram of the working principle of a ToF module based on the dToF method provided in an embodiment of the present application;

[0055] FIG13 is a schematic diagram of a transmitting end transmitting a pulse wave and a receiving end receiving a pulse wave according to an embodiment of the present application;

[0056] FIG14 is a schematic diagram of the working principle of a single SPAD sensor provided in an embodiment of the present application;

[0057] FIG15 is a schematic diagram of the principle of a TCSPC provided in an embodiment of the present application;

[0058] FIG16 is a schematic diagram of a histogram obtained using a ToF module according to an embodiment of the present application;

[0059] FIG17 is a schematic diagram of a histogram during long-distance ranging and short-distance ranging provided by an embodiment of the present application;

[0060] FIG18 is a schematic diagram of a flow chart of a method for determining a depth value provided in an embodiment of the present application;

[0061] FIG19 is a schematic diagram of finding a peak in a histogram according to an embodiment of the present application;

[0062] FIG20 is a schematic diagram of background noise intensity provided in an embodiment of the present application;

[0063] FIG21 is a schematic diagram of a histogram at different temperatures provided in an embodiment of the present application;

[0064] FIG22 is a schematic diagram of ranging based on crosstalk signals and target signals in a long-distance ranging scenario provided by an embodiment of the present application;

[0065] FIG23 is a schematic diagram of a three-point method provided in an embodiment of the present application;

[0066] FIG24 is a schematic diagram of a close-range ranging scenario provided by an embodiment of the present application;

[0067] FIG25 is a schematic diagram of another short-range ranging scenario provided by an embodiment of the present application;

[0068] FIG26 is a schematic diagram of another short-range ranging scenario provided by an embodiment of the present application;

[0069] FIG27 is a schematic diagram of a temperature drift curve provided in an embodiment of the present application;

[0070] FIG28 is a schematic diagram of a voltage curve provided in an embodiment of the present application;

[0071] FIG29 is a flow chart of a method for optimizing a temperature compensation model and a voltage compensation model according to an embodiment of the present application;

[0072] FIG30 is a schematic diagram of two depth values ​​at different voltages provided in an embodiment of the present application;

[0073] FIG31 is a schematic structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0074] In order to make the purpose, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments.

[0075] First, the time-of-flight method involved in this application is explained.

[0076] The time of flight (ToF) method is a two-way ranging technology that mainly uses the time it takes for a pulse signal to travel back and forth between the transmitter and the receiver to measure the distance between nodes.

[0077] For example, FIG1 shows a schematic diagram of a distance measurement using a ToF module. As shown in FIG1 , the ToF module includes a transmitter and a receiver. The transmitter of the ToF module transmits a pulse signal. The pulse signal is an electromagnetic wave of a certain wavelength. The pulse signal reaches the object to be measured, is reflected by the object to be measured, and returns along the medium. The receiver of the ToF module receives the pulse signal. Then, the ToF module can estimate the distance from the ToF module to the object to be measured based on the time from the emission of the pulse signal to the reception of the pulse signal using the relationship (1). The distance from the ToF module to the object to be measured is also called the depth value. D = c*Δt / 2 (1).

[0078] Where D represents the distance between the ToF module and the object being measured, c represents the speed of light, and Δt represents the time from when the pulse signal is emitted by the transmitter to when the pulse signal is received by the receiver.

[0079] Compared to the depth map captured by a binocular camera, the depth map collected by the ToF module has relatively low pixel count and can calculate the distance between two nodes with less computing power and power consumption. Therefore, the usage rate of ToF modules in electronic devices such as mobile phones is increasing. In one scenario example, when taking photos or videos, electronic devices can use the depth value provided by the ToF module to assist focusing and achieve a large aperture blur effect. In another scenario, electronic devices can apply the depth value provided by the ToF module in virtual reality (VR) and augmented reality (AR) scenarios.

[0080] Typically, a glass cover is placed above the ToF module. The light emitted by the ToF module and the light reflected from the object being measured can penetrate the glass cover. According to the law of refraction, the relationship between the angle of incidence and the angle of refraction is: n1*sin(θ1)=n1*sin(θ2). Where n1 represents the refractive index of air, n2 represents the refractive index of glass, θ1 represents the angle of incidence, and θ2 represents the angle of refraction. The refractive index of glass is greater than that of air. When light enters a glass medium from an air medium, it is refracted. When light enters an air medium from a glass medium, it is reflected, and the angle of incidence of the reflected light is equal to that of the incident light.

[0081] For example, Figure 2 shows another schematic diagram of using a ToF module for ranging. As shown in Figure 2, a glass cover is provided between the ToF module and the object being measured. When measuring depth information, most of the light emitted by the ToF module passes through the glass cover and reaches the object being measured before being reflected back. Combined with the description in the previous paragraph, in the scenario of measuring depth information, due to the different refractive indices of air and glass, the light emitted by the ToF module is divided into two paths: in the first path, a portion of the light emitted by the transmitting end of the ToF module passes through the glass cover and reaches the object being measured, and then is reflected by the object being measured and passes through the glass cover and is reflected back, so that the receiving end of the ToF module receives the target signal. In the second path, another portion of the light emitted by the transmitting end of the ToF module is directly reflected back after reaching the glass cover, so that the receiving end of the ToF module receives a crosstalk signal. Affected by the crosstalk signal, the depth information actually measured by the ToF module based on the target signal may be biased. For example, in a close-range ranging scenario, since the object being measured is close to the ToF module, the time when the ToF module receives the crosstalk signal is very close to the time when it receives the target signal. The ToF module cannot distinguish between the target signal and the crosstalk signal, and the depth value calculated based on the flight time is inaccurate.

[0082] Exemplarily, FIG3 shows two depth information array diagrams obtained using a ToF module. Each depth information array diagram consists of m*n pixels. The larger the depth value of a pixel, the farther the distance between the object under test and the ToF module. As shown in (a) in FIG3 , when no glass cover is set between the ToF module and the object under test, the ToF module is not affected by the crosstalk signal, and the depth value of each pixel is relatively accurate. As shown in (b) in FIG3 , when a glass cover is set between the ToF module and the object under test, the glass cover reflects light, and is affected by factors such as the angle of the reflected light and the position of the ToF module. The intensity of the crosstalk signal in some areas of the depth information array diagram is strong. After the electronic device superimposes the target signal in the interference area with the crosstalk signal, the calculated depth value is smaller than the true value.

[0083] As an example of a scenario, when the depth value of the interference area in the depth information array diagram is inaccurate, the wrong depth value will affect the focus on the moving object. As shown in (a) in Figure 4, the user points the camera of mobile phone 1 toward person 1 who is serving the ball. In response to the user operation, mobile phone 1 starts to focus on the ball based on the depth value collected by the ToF module. The ball flies rapidly along the motion trajectory shown in (a) in Figure 4. At time t1, if the ball has not entered the interference area as shown in (b) in Figure 3, the depth value collected based on the ToF module is relatively accurate, and the mobile phone 1 successfully focuses on the ball, and a clear image as shown in (b) in Figure 4 is captured. At time t2, if the ball has entered the interference area as shown in (b) in Figure 3, the depth value collected based on the ToF module deviates, and the mobile phone 1 fails to focus on the ball, and a blurred image as shown in (c) in Figure 4 is captured. At time t3, if the ball is still in the interference area as shown in (b) in Figure 3, the depth value collected by the ToF module is still inaccurate, and the mobile phone 1 fails to focus on the ball, resulting in a blurred image as shown in (d) in Figure 4.

[0084] In view of the problem that the depth value measured by the ToF module is inaccurate due to the influence of light reflected from the glass cover, the present application provides a method for determining a depth value. This method can be applied to electronic devices, wherein a ToF module is provided under the glass cover of the electronic device. In a scenario where a ToF module is used to measure depth information, the electronic device can use the crosstalk signal returned by the glass cover as a reference signal to perform zero-distance point correction, thereby reducing the interference of the crosstalk signal on the target signal returned from the measured object, and improving the accuracy of the depth information measured by the ToF module.

[0085] It should be noted that, in the conventional sense, the zero distance point refers to the time when the ToF module transmits a pulse signal. However, in this application, the zero distance point refers to the time when the crosstalk signal returned through the glass cover is received. For the specific implementation of the zero distance point correction using the crosstalk signal returned by the glass cover as a reference signal, please refer to the description of the following embodiment.

[0086] In addition, the embodiments of this application are described by arranging the ToF module below the glass cover plate, and the light emitted by the ToF module penetrates the glass cover plate. This does not limit the present application. In actual implementation, the glass cover plate can be replaced with another cover plate with light-transmitting and protective functions, and the ToF module can be replaced with another depth detection module.

[0087] The above-mentioned electronic device can be a mobile phone, a personal computer (PC), a smart screen, a smart TV, a tablet computer (Pad), a wearable device, a computer with wireless transceiver function, a virtual reality (VR) device, an augmented reality (AR) device, a wireless terminal in industrial control, a wireless terminal in self-driving, a wireless terminal in remote medical surgery, a wireless terminal in a smart grid, a wireless terminal in transportation safety, a wireless terminal in a smart city or a wireless terminal in a smart home, etc., or can be other devices or apparatuses provided with a ToF module.

[0088] In some embodiments, the ToF module can be set on the back of the electronic device for scenes such as capturing images of people, shooting videos, AR modeling, and somatosensory games. When the user aligns the back of the electronic device with the object to be measured, the ToF module can measure the depth value between the electronic device and the object to be measured. In other embodiments, the ToF module can be set on the front of the electronic device for scenes such as face recognition and financial payment. When the user faces the display screen, the light signal emitted by the ToF module can be projected onto the user's face, thereby obtaining the depth information of the face.

[0089] Exemplarily, FIG5 shows a schematic diagram of a scene in which a set of images are captured based on corrected depth values.

[0090] As shown in Figure 5 (a), when shooting a fast-moving object such as a small ball, the user slides his finger upwards in the lower area of ​​the shooting preview interface. As shown in Figure 5 (b), the phone displays the "Focus Priority" option. In response to the user clicking the "Focus Priority" option, the phone displays the "Subject Priority Focus" control and the "Motion Priority Focus" control as shown in Figure 5 (c). The "Subject Priority Focus" control is used to trigger the phone to focus on subjects such as people, and the "Motion Priority Focus" control is used to trigger the phone to focus on fast-moving objects such as small balls and vehicles. For example, if the normal shooting mode is set, the subject priority focus is used by default; if the snapshot mode is set, the motion priority focus is used by default.

[0091] Take the example of a user clicking on the "Subject Priority Focus" control. As shown in (d), (e), and (f) in Figure 5, the mobile phone begins to focus on the ball frame by frame. The specific process of focusing on the ball frame by frame can be as follows: the mobile phone uses the ball as the focus object and notifies the ToF module to measure the distance. When the ToF module measures the distance, the mobile phone can use the crosstalk signal returned by the glass cover as a reference signal to perform zero-distance point correction, thereby reducing the interference of the crosstalk signal on the target signal returned from the measured object, thereby obtaining a more accurate depth information array map. Then, the mobile phone can focus on the ball frame by frame based on the depth value of the area corresponding to the ball in the depth information array map. As an example, the mobile phone can pre-set a mapping relationship table between the depth value and the motor movement distance (code), and the mapping relationship table can include multiple sets of depth values ​​and motor movement displacement. As shown in Table 1, if the depth value measured by the ToF module is x3, the camera application controls the motor to move the lens according to the displacement y3; if the depth value measured by the ToF module is x4, the camera application controls the motor to move the lens according to the displacement y4.

[0092] Table 1

[0093] For example, FIG6 shows a schematic diagram of the hardware structure of a bar phone.

[0094] As shown in Figure 6, the back cover 01 of the mobile phone has a hollowed-out area for arranging the rear camera module 02. The rear camera module 02 includes at least one rear camera 021, a flash 022, and a ToF module 023. As an example, the outer surface of the camera module 02 is provided with a single transparent substrate, such as a glass cover. The glass cover can protect the rear camera 021, the flash 022, and the ToF module 023, so that the rear camera 021, the flash 022, and the ToF module 023 are not exposed to the outside, preventing dust from entering the interior of the rear camera module 02. As another example, a transparent substrate is respectively provided on the outer surface of the rear camera 021, the flash 022, and the ToF module 023. As another example, when the outer surface of the camera module 02 is provided with a single transparent substrate, the transparent substrate can be configured according to the shape and size of the hollowed-out area. For example, when the hollowed-out area is circular, the transparent substrate is circular.

[0095] As shown in Figure 6, there is a hollowed-out area at the top of the display module for arranging the front camera module 04. The front camera module 04 includes a front camera 041 and a ToF module 042. The hollowed-out area is surrounded by the display screen 03. The display screen 03 has a pixel arrangement for displaying images. As an example, the outer surface of the display module is covered with a whole transparent substrate, such as a glass cover. The glass cover can protect the display screen 03, the front camera 041, and the ToF module 042, so that the display screen 03, the front camera 041, and the ToF module 042 do not need to be exposed to the outside.

[0096] It should be noted that Figure 6 is an example of a mobile phone with a ToF module set in the rear camera module 02 and the front camera module 04, and it does not limit the present application. As another example, the mobile phone can only be equipped with a ToF module in the rear camera module 02, and not be equipped with a ToF module in the front camera module 04.

[0097] For example, FIG7 shows a schematic diagram of the hardware structure of a foldable screen mobile phone.

[0098] The foldable phone's back cover (05) has a cutout area for mounting a rear camera module (06). This module includes at least one rear camera (061), a flash (062), and a ToF module (063). For example, the outer surface of the rear camera module (06) is formed from a single transparent substrate, such as a glass cover. A cutout area is located at the top of the display module on the outer screen, housing the front camera (07).

[0099] It should be noted that the ToF module 023 and the ToF module 042 shown in FIG. 6 and the ToF module 063 shown in FIG. 7 can all be used to implement the depth value determination method provided in this application.

[0100] The hardware principle of the ToF module provided in this application is illustrated below with reference to Figures 8 to 11.

[0101] For example, FIG8 shows a schematic diagram of the hardware structure of a ToF module.

[0102] As shown in Figure 8, the ToF module may include: a substrate 16, and a transmitter and a receiver arranged on the substrate 16. The transmitter and the receiver may be devices provided by different suppliers, or may be devices of different models provided by the same supplier. The transmitter may include: a pulsed laser 11 and a light scattering element (diffuser) 12. The receiver may include: a light detection element 13, a pulse response filter 14 and a light receiver 15. The ToF module may be arranged under the glass cover. The glass cover is a light-transmitting area with a certain light-transmitting ability. The glass cover includes a first surface 171 and a second surface 172. The first surface 171 is the side away from the ToF module, and the second surface 172 is the side close to the ToF module.

[0103] Among them, the pulse laser 11 is used to emit a pulse signal in the direction of the light scattering element 12. In the time domain, the waveform of the pulse signal can be distinguished by an oscilloscope as a sawtooth wave, a sine wave or a triangle wave, etc. As an example, the pulse laser 11 can be an initial emission source based on a vertical-cavity surface-emitting laser (VCSEL), but the divergence angle of the initial emission source is small, about 20°. In order to achieve a larger field of view coverage at the transmitting end, the present application also provides a light scattering element 12. The light scattering element 12, also known as a beam scatterer, can be rectangular or square and is arranged above the pulse laser 11 to scatter the pulse signal emitted by the pulse laser 11 to increase the divergence angle of the light beam. It can be understood that the pulse laser 11 relies on the light scattering element 12 to scatter the light beam, which can enable the light beam to cover a larger field of view area and can cover all positions of the object to be measured without gaps, which is equivalent to projecting a beam of light onto a plane. Therefore, the pulse laser 11 and the light scattering element 12 are also collectively referred to as a surface light source. Compared with the point light source composed of a traditional VCSEL and a diffractive optical element (DOE), the surface light source used in this application is simpler in hardware design, relatively low in cost, and can cover all positions of the object under test.

[0104] The light detection element 13 is an optical lens that can be used to converge the received light. The pulse response filter 14 can be used to filter the converged light, remove interference signals such as ambient light noise in non-target frequency bands, and obtain a signal in the target frequency band, which is the frequency band of the pulse signal. The light receiver 15 can be composed of a sensor array, such as a plurality of single photon avalanche diodes (SPADs), for receiving pulse signals.

[0105] To better protect components such as the pulse laser 11, light scattering element 12, light detection element 13, pulse response filter 14, and light receiver 15, a housing 18 is provided outside these components, as shown in FIG8 . Furthermore, a perforated area is provided on the side of housing 18 near the glass cover plate, allowing light from the light scattering element 12 to pass through the perforated area and the glass cover plate to reach the object being measured, and allowing light reflected from the object to pass through the glass cover plate and the perforated area to reach the light detection element 13. As an example, the upper surfaces of the light scattering element 12 and the light detection element 13 are flush with the upper surface of housing 18. As another example, the distance between the upper surface of housing 18 and the second surface 172 of the glass cover plate is less than the distance between the upper surface of the light scattering element 12 and the second surface 172 of the glass cover plate, and the distance between the upper surface of housing 18 and the second surface 172 of the glass cover plate is less than the distance between the upper surface of housing 18 and the second surface 172 of the glass cover plate.

[0106] As an example, as shown in Figure 8, the distance from the geometric center of the light scattering element 12 to the geometric center (or optical center) of the light detecting element 13 is set to 8 mm. In this case, the main path of the crosstalk signal undergoes multiple reflections within the glass cover. It can be understood that the more times the crosstalk signal reflects within the glass cover, the more dispersed the crosstalk signal beam becomes, causing the crosstalk signal to shift and expand on the histogram, thereby affecting the accuracy of using the crosstalk signal as a reference signal for zero-distance point calibration.

[0107] In theory, in order to avoid multiple reflections of crosstalk signals inside the glass cover, the distance from the geometric center of the light scattering element 12 to the geometric center of the light detection element 13 should be minimized. However, the light scattering element 12 and the light detection element 13 have a certain volume, so the distance from the geometric center of the light scattering element 12 to the geometric center of the light detection element 13 cannot be infinitely small. Based on the current state of the art, on the basis of the hardware structure shown in FIG8 , as shown in FIG9 , the present application reduces the distance from the geometric center of the light scattering element 12 to the geometric center of the light detection element 13 from 8 mm to 4 mm, sets the distance from the upper surface of the ToF module housing 18 to the second surface 172 of the glass cover to 0.8 mm, and sets the thickness of the ToF module in the optical axis direction to 2.48 mm.

[0108] As an example, based on the hardware structure of the ToF module shown in Figure 9, as shown in Figure 10, the optical receiver 15 can be a SPAD chip. The SPAD chip is a planar array device composed of multiple SPAD sensors. The SPAD chip is also called a receiving end planar array device. The receiving end planar array device is composed of m*n SPAD sensors. One SPAD sensor represents one pixel. For example, m=240, n=180. In the assisted focus scenario, the distance detected by a SPAD sensor is the distance from a point on the object to be measured to the ToF module. The greater the distance detected by a SPAD sensor, the greater the depth value of the pixel, and the farther the distance between the object to be measured and the ToF module. The smaller the distance detected by a SPAD sensor, the smaller the depth value of the pixel, and the closer the distance between the object to be measured and the ToF module.

[0109] As an example, based on the hardware structure of the ToF module shown in Figure 9, as shown in Figure 11, the surface light source emits a light beam with a rectangular cross-section. This light beam is divided into two paths: in the first path, a portion of the light beam passes through the glass cover plate 204 to reach the object being measured, is reflected by the object being measured, passes through the glass cover plate 204, and then returns to the receiving end surface array device; in the second path, another portion of the light beam returns to the receiving end surface array device after reaching the glass cover plate 204. The subtended angle of the light beam emitted by the surface light source is α, and the subtended angle of the light beam received by the receiving end surface array device is β. For example, α = β = 70°. It should be noted that the subtended angle refers to the angle of the light beam in the direction of the diagonal line of the rectangle. For example, based on the distance measurement requirements, this application sets the subtended angle α and the subtended angle β to 70°.

[0110] Optionally, when the subtended angle of the emitted light beam at the transmitting end is α = 70° (as shown in FIG11 ), the subtended angle of the received light beam at the receiving end is β = 70° (as shown in FIG11 ), the distance from the geometric center of the light scattering element 12 to the geometric center of the light detecting element 13 is 4 mm (as shown in FIG9 ), the distance from the upper surface of the ToF module housing 18 to the second surface 172 of the glass cover is 0.8 mm (as shown in FIG9 ), and the thickness of the ToF module along the optical axis is 2.48 mm (as shown in FIG9 ), the main path of the crosstalk signal can be achieved by a single reflection at the first surface 171 of the glass cover, as shown in FIG9 . Furthermore, the ranging range of the hardware structure of the ToF module shown in FIG9 is [5 cm, 5 m], which can basically meet the ranging requirements of electronic devices. It should be understood that with technological improvements, the distance from the geometric center of the light scattering element 12 to the geometric center of the light detecting element 13 can be further reduced.

[0111] In an embodiment of the present application, the ToF module as shown in Figures 9 to 11 can measure the time of flight based on the ToF method to obtain a depth value to complete the depth value determination method provided in the present application. The ToF method is divided into a direct time of flight (dToF) method and an indirect time of flight (iToF) method. Among them, the dToF method uses a pulsed light radar to directly measure the time of flight. The iToF method indirectly estimates the time of flight through phase-resolved measurement. The present application can measure the time of flight based on the dToF method, or it can use the iToF method to measure the time of flight.

[0112] The following uses the ToF module to measure flight time based on the dToF method as an example to illustrate the principle of the depth value determination method provided in this application.

[0113] For example, FIG12 shows a principle flow chart of the depth value determination method provided in the present application.

[0114] The ToF module may include a pulsed laser 11, a light scattering element 12, a light detecting element 13, a pulse response filter 14, and a light receiver 15 as shown in FIG9 . The structures of the pulsed laser 11, the light scattering element 12, the light detecting element 13, the pulse response filter 14, and the light receiver 15 can be referred to the description of the above embodiment and will not be repeated here.

[0115] As shown in Figure 12, the ToF module may also include a controller 10. The controller 10 may include a synchronous driving module 10-1, a time to digital converter (TDC) 10-2, a histogram statistics module 10-3, and a digital signal processor (DSP) 10-4. Among them, the synchronous driving module 10-1 can be used to control the clock synchronization of the transmitter and the receiver. TDC 10-2 is a circuit for measuring time, which can convert a continuous time signal into a digital signal, measure or record the time interval of the signal, and realize the digitization of time measurement. The histogram statistics module 10-3 can be used to record the number output by TDC 10-2 each time, and to obtain a frequency distribution histogram of photons changing with time by counting the number of photons in each time period. DSP 10-4 can be used to analyze the histogram and find depth information.

[0116] Specifically, the depth value determination method may include the following S101 to S105.

[0117] S101 , the pulse laser 11 emits a plurality of pulse signals in response to a control signal of the synchronous driving module 10 - 1 .

[0118] Taking depth detection at a 60Hz depth map refresh rate as an example, as shown in Figure 13, the synchronous drive module 10-1 can control the pulsed laser 11 to perform a detection every 16ms (milliseconds). Each detection lasts for 10ms, that is, the detection duration is 10ms. During each detection duration, the synchronous drive module 10-1 can control the transmitter to emit a pulse wave every 100ns, with a pulse width of approximately 1ns.

[0119] S102 , the optical receiver 15 receives a pulse signal.

[0120] The pulse signal emitted by the pulse laser 11 passes through the light scattering element 12 and the glass cover in sequence to reach the object to be measured, and then passes through the light detection element 13 and the pulse response filter 14 in sequence to reach the light receiver 15 after being reflected by the object to be measured.

[0121] In some embodiments, the optical receiver may be an area array device composed of multiple SPAD sensors.

[0122] For example, FIG14 shows a schematic diagram of the working principle of a single SPAD sensor.

[0123] SPAD sensors sense light based on the particle state of light and probabilistic statistical models.

[0124] As shown in Figure 14, the working principle of the SPAD sensor is divided into the following stages:

[0125] The first stage corresponds to state ①. Before the SPAD sensor is triggered by a photon, the bias voltage across the SPAD sensor briefly exceeds the breakdown voltage V BD , there is no current on the vertical axis, and it is in a metastable state (geiger mode), also known as Geiger mode.

[0126] The second stage corresponds to the transition from state ① to state ②. When a photon arrives, the SPAD sensor absorbs the single photon. Due to the high reverse bias field within the SPAD sensor, the few electrons generated by the photon conversion trigger an avalanche state in the SPAD sensor. For example, when the bias voltage across the SPAD sensor exceeds the voltage corresponding to the reference line shown in Figure 14, a digital signal is generated that can be captured by TDC 10-2 and recorded by TDC 10-2 as the arrival of a photon.

[0127] The third stage: corresponds to the transition from state ② to state ③. A large amount of current generated after the avalanche flows through the quench resistor, causing the bias voltage across the SPAD sensor to be lower than the breakdown voltage V BD , thus the avalanche current of the SPAD sensor is turned off and it stops working.

[0128] The fourth stage: corresponds to the transition from state ③ to state ①. The SPAD sensor is charged through the VSPAD power supply, so that the operating voltage of the SPAD sensor is greater than the breakdown voltage V BD , return to the initial state.

[0129] Typically, the time required to return from an avalanche to its initial state is called dead time, which can usually be adjusted by adjusting the quenching current. Each time a SPAD sensor captures a photon, the above steps occur, generating an electrical pulse. This pulse is then amplified and shaped by the front-end circuitry before being sent to the TDC 10-2.

[0130] It should be noted that a single photon may not necessarily trigger an avalanche; this depends on the photon detection efficiency (PDE) of the SPAD sensor. Even so, SPAD sensors are much more sensitive to photons than avalanche photodiodes (APDs).

[0131] As can be seen from the above working principle, a single SPAD sensor can only be triggered once at a time, so SPAD sensors are often in array form. Multiple photon counts can be generated at the same time or within a TDC sampling time.

[0132] In an embodiment of the present application, the dToF method is implemented based on time correlated single photon counting (TCSPC) technology.

[0133] S103, the TDC 10-2 converts the pulse signal into a digital signal.

[0134] S104, the histogram statistics module 10-3 records the number output by the TDC 10-2 each time, and counts the number of photons in each time period to obtain a histogram of the photon variation over time.

[0135] The time from when a pulse wave is emitted by the transmitter to when it is received is called the time of flight. However, when the pulse width reaches 1ns, reaching the photon level, due to the wave-particle duality of light, a single photon has wave properties, so the time it takes for the receiver to receive the photon may vary.

[0136] For example, FIG15 shows a schematic diagram of the principle of TCSPC. When the optical signal is very weak and the detection frequency is very high, some detection cycles may detect photons, while some detection cycles may not detect photons. As shown in FIG15 , the photon is regarded as a random signal event, and the signal event is mapped to a certain time period. After repeatedly measuring the photon for multiple detection cycles, the histogram statistics module 10-3 counts the number of photons in each time period to obtain a frequency distribution histogram of the photon over time. The intensity change of the optical signal can be obtained by fitting the histogram. Among them, the least significant bit of TDC is represented as LSB, and one TDC LSB is one bin. The horizontal axis of the histogram is time information, which represents the number of bins. For example, the horizontal axis coordinate range corresponding to a single SPAD sensor is 1024 bins, the ToF time is 100ns, and the time of each bin is 500ps (picoseconds). 500ps is the resolution of the TDC, the number of bins of an N-bit TDC is 2^N, and the number of TDC bits corresponding to 1024 bins is 10 bits. It can be understood that within a detection duration (such as 10ms), the photon counts triggered by the SPAD within each detection cycle (such as 100ns) are added together to obtain the photon count within that detection duration. TCSPC converts the relationship between time and light intensity into the relationship between time and photon count.

[0137] As an example, the data format of the above histogram is a 1200*64 array, where 1200 represents 1200 pixels in the depth map and 64 represents 64 bins on the horizontal axis.

[0138] S105, the DSP 10-4 calculates the corrected depth value based on the histogram obtained by the histogram statistics module 10-3. Alternatively, the DSP can transmit the histogram to the CPU of the electronic device, and the CPU calculates the corrected depth value based on the histogram.

[0139] The CPU may be a main processor of a system on chip (SOC).

[0140] It should be noted that this application does not specifically limit the execution entity for calculating the depth value. For example, the execution entity may also be a DSP or a CPU, or other software and hardware modules of the electronic device, which can be adjusted according to actual use requirements.

[0141] In theory, based on the histogram obtained by the histogram statistics module 10-3, the DSP 10-4 or the CPU can use the time corresponding to the peak point of the waveform as the flight time. Take the example of emitting a pulse wave every 100ns in a detection time (such as 10ms). If the time point of each pulse wave emission is aligned as the 0 distance point, the flight time Δt of the pulse signal can be calculated based on the number of bins between the 0 distance point and the peak on the horizontal axis. However, referring to the description of the above embodiment, due to the influence of the crosstalk signal returned by the glass cover, if the time point of each pulse wave emission is aligned as the 0 distance point, the flight time Δt calculated based on the number of bins between the 0 distance point and the peak on the horizontal axis will have a deviation, resulting in a deviation in the depth information actually measured.

[0142] In order to solve the problem of depth information deviation caused by crosstalk signals, based on the histogram obtained by the dToF method, as shown in Figure 16, the time point when the glass cover returns the crosstalk signal can be used as the 0 distance point to reduce the interference of the crosstalk signal on the target signal returned from the object under test.

[0143] As shown in Figure 16, the time when the pulse laser 11 emits the pulse signal is aligned as the 0 distance point before correction. The pulse signal emitted by the transmitter is divided into two paths: in the first path, a portion of the light will pass through the glass cover plate to reach the object to be measured, and then reflect after being reflected by the object to be measured and pass through the glass cover plate before returning to the receiving end of the ToF module. In the second path, another portion of the light will be reflected back after reaching the outer surface 171 of the glass cover plate. Since the distance between the ToF module and the glass cover plate is smaller than the distance between the ToF module and the object to be measured, the time when the ToF module receives the crosstalk signal returned through the second path is earlier than the time when the target signal returned through the first path is received. On the horizontal axis of the histogram, the reception time of the crosstalk signal is earlier than the reception time of the target signal, that is, the reception time of the crosstalk signal is closer to the 0 distance point before correction.

[0144] Taking the scenario where a user uses the rear camera module 02 shown in FIG6 to take a photo as an example, the glass cover plate provided on the outer surface of the rear camera module 02 is the closest point to the object to be measured, and the distance D between the outer surface 171 of the glass cover plate and the object to be measured can be regarded as the distance between the electronic device and the object to be measured. For example, the distance D between the first surface 171 of the glass cover plate and the object to be measured 200 can be obtained by the following relationship (2): D = D1-D2 = c*t1 / 2-c*t2 / 2 = c*Δt / 2 (2).

[0145] Where Δt = t1 - t2. Δt represents the time from the corrected zero-distance point to the receipt of the target signal. t1 represents the flight time of the target signal. t2 represents the flight time of the crosstalk signal. D represents the distance from the electronic device to the object under test 200. D1 represents the distance from the transmitter to the object under test 200. D2 represents the distance from the transmitter to the first surface 171 of the glass cover 204.

[0146] In the above scheme, the corrected zero distance point refers to the time when the receiver receives the crosstalk signal returned through the glass cover. The time when the receiver receives the target signal returned by the measured object minus the time when the receiver receives the crosstalk signal returned through the glass cover equals the corrected flight time Δt. In the embodiment of the present application, the time when the crosstalk signal is returned by the glass cover is used as the zero distance point. The interference of the crosstalk signal on the target signal can be ignored, and the flight time Δt of the target signal can be corrected, thereby making the depth value calculated based on the corrected flight time Δt more accurate.

[0147] Based on the analysis of FIG. 16 in the above embodiment, theoretically, the corrected flight time Δt can be obtained by subtracting the time it takes to receive the crosstalk signal returned through the glass cover from the time it takes to receive the target signal returned by the measured object. However, in actual implementation, the distance between the electronic device and the measured object may be relatively far or relatively close, which may cause the relative positions of the crosstalk signal and the target signal in the histogram obtained in S104 to vary.

[0148] For example, FIG17 shows a schematic diagram of a histogram during long-distance ranging and short-distance ranging.

[0149] As shown in Figure 17 (a), when the distance between the electronic device and the object being measured is relatively long, for example, 100 cm, the envelope positions of the crosstalk signal and the target signal are far apart on the horizontal axis, and the peaks of the two signals can be distinguished. In this case, the DSP can calculate the corrected flight time Δt by subtracting the peak times of the crosstalk signal and the target signal.

[0150] As shown in Figure 17 (b), when the distance between the electronic device and the object being measured is relatively close, for example, 40 cm, the envelope positions of the crosstalk signal and the target signal are relatively close on the horizontal axis, causing the envelopes of the two signals to overlap and the peaks of the two signals to be indistinguishable. If the confidence level of the crosstalk signal is high, the crosstalk signal may be mistakenly identified as the target signal. In this case, the DSP cannot directly use the method of subtracting the peak time of the crosstalk signal and the target signal to obtain the corrected flight time Δt.

[0151] In view of the different distribution patterns of the envelope positions of the crosstalk signal and the target signal in the histogram in the long-distance ranging and short-distance ranging scenarios, this application provides two methods for determining the depth value: a long-distance depth value determination method is used when the object to be measured is in the long-distance ranging range; and a short-distance depth value determination method is used when the object to be measured is in the short-distance ranging range.

[0152] Specifically, the above S105 can be implemented through S201-S206 as shown in Figure 18. The following description takes the CPU as the execution subject as an example. Of course, the execution subject can also be a DSP or other software and hardware modules.

[0153] S201 : The CPU reads calibration data of a preset reference signal (also called a preset crosstalk signal) from a memory.

[0154] The calibration data for the preset reference signal is pre-stored calibration data for the crosstalk signal reflected by the glass cover of the electronic device before the electronic device leaves the factory. This calibration data may include: the envelope shape of the crosstalk signal, the envelope position of the crosstalk signal (i.e., the horizontal axis value or horizontal axis ratio), the intensity distribution of the crosstalk signal (i.e., the vertical axis value or vertical axis ratio), etc. The envelope position of the crosstalk signal includes the peak position of the crosstalk signal.

[0155] In the whole machine production line stage of electronic manufacturing services (EMS), the test equipment can control the ToF module of the electronic device to transmit a pulse signal to the glass cover of the electronic device to calibrate the crosstalk signal of the electronic device. Due to various factors such as the differences between ToF modules, the difference between the power supply value of the electronic device to the ToF module and the power supply value used by the ToF module manufacturer, and the difference in the ambient temperature of the electronic device, the characteristics of the crosstalk signal returned by the glass cover of each electronic device may be different. These different characteristics can include: the envelope shape of the crosstalk signal, the envelope position of the crosstalk signal, the intensity distribution of the crosstalk signal, etc. It can be understood that by calibrating the relevant data of the crosstalk signal of each electronic device separately, the target signal can be accurately restored based on the calibration data of each electronic device after leaving the factory.

[0156] After the CPU obtains the histogram, the CPU can read the calibration data of the preset reference signal from the memory to correct the zero distance point of the histogram based on the preset reference signal. The method for obtaining the histogram can refer to the above S104 and will not be repeated here.

[0157] For example, the memory may be an original equipment manufacturer (OEM) memory.

[0158] Take the depth map including 1200 pixels as an example. The calibration data of the preset reference signal may include: the envelope shape of the crosstalk signal of one pixel, the intensity distribution of the crosstalk signal of 1200 pixels, and the envelope position of the crosstalk signal of 1200 pixels. The envelope shape of the crosstalk signal of one pixel determines the envelope shape of 1200 pixels. The intensity distribution of the crosstalk signal of 1200 pixels determines that the vertical axis position of 1200 pixels is fixed. The envelope position of the crosstalk signal of 1200 pixels determines that the horizontal axis position of 1200 pixels is fixed. With reference to the description of the above embodiment, the distance between the electronic device and the object under test may be relatively far or relatively close, which may cause the relative position of the crosstalk signal and the target signal in the histogram to change. For example, when the distance between the electronic device and the object being measured is relatively far, the envelope position of the crosstalk signal and the envelope position of the target signal are relatively far apart on the horizontal axis, and the peaks of the two signals can be distinguished. When the distance between the electronic device and the object being measured is relatively close, the envelope position of the crosstalk signal and the envelope position of the target signal are relatively close on the horizontal axis, causing the envelopes of the two signals to overlap and the peaks of the two signals to be indistinguishable. Because the envelope positions of the crosstalk signal and the target signal in the histogram have different distribution patterns during long-distance ranging and short-distance ranging, after the CPU reads all the calibration data at one time, the CPU can execute the following S202-S206 for each of the multiple pixels contained in the depth map to obtain the depth value of each pixel.

[0159] S202 : The CPU searches the histogram for a peak that meets a preset condition based on the peak search range of the first pixel.

[0160] The first pixel is any pixel in the depth map to be generated.

[0161] Take the depth map including 1200 pixels as an example. The calibration data may include: the envelope shape of the crosstalk signal of one pixel, the intensity distribution of the crosstalk signal of 1200 pixels, and the envelope position of the crosstalk signal of 1200 pixels. After the CPU reads the calibration data, the CPU can determine the peak position i of the preset reference signal corresponding to the first pixel based on the envelope shape of the crosstalk signal of one pixel, the intensity distribution of the crosstalk signal corresponding to the first pixel, and the envelope position of the crosstalk signal corresponding to the first pixel, thereby obtaining the peak search range of the first pixel as (im, i+n). Wherein, i represents the i-th bin on the horizontal axis, and the peak search range can be from the im-th bin to i+n bins. Both m and n are preset positive integers. Bin is a time conversion unit. For example, one bin is equal to 300ps or 500ps.

[0162] It can be understood that since the envelope positions of the crosstalk signals of the 1200 pixels in the calibration data are different, the peak position i of the preset reference signal corresponding to each pixel in the depth map is different, and the peak search range corresponding to each pixel in the depth map is also different. Take m=4 and n=9 as an example. If i=9 for pixel 1, the peak search range of pixel 1 is from the 5th bin to the 18th bin. If i=10 for pixel 2, the peak search range of pixel 2 is from the 6th bin to the 19th bin. If i=8 for pixel 3, the peak search range of pixel 3 is from the 4th bin to the 17th bin.

[0163] In some embodiments, the CPU may search for a peak within the peak-searching range of the histogram based on a light intensity comparison method, a reciprocal method, a Gaussian fitting method, or a symmetric zero-area method.

[0164] Take the light intensity comparison method as an example. As shown in (a) of Figure 19, the horizontal axis coordinate of the peak of the preset reference signal corresponding to the first pixel is i=10bin, indicating that the light intensity value in the 10th bin is the highest. The CPU can determine the peak search range of the first pixel in the histogram shown in (b) of Figure 19 based on i=10bin. As shown in (c) of Figure 19, the peak search range of the first pixel in the histogram is (6bin, 19bin), that is, the peak search range is from the 4th bin to the 19th bin. Then, the CPU can start from the 6th bin and start traversing in a manner that increases the bin value by 1 in sequence, comparing the light intensities of adjacent bins within the peak search range. If the light intensity of a bin is greater than the light intensity of the previous bin and greater than the light intensity of the next bin, the CPU determines that a peak has been found. As shown in (d) of Figure 19, the light intensity of the 11th bin is 960, the light intensity of the 12th bin is 1100, and the light intensity of the 13th bin is 750. The light intensity of the 12th bin is greater than the light intensities of the 11th and 13th bins. Therefore, the CPU determines that a peak has been found in the 12th bin. It should be noted that the CPU may find one or more peaks within the peak-finding range of the first pixel. Each time a peak is found, the CPU determines whether the peak meets the preset conditions.

[0165] In some embodiments, the aforementioned preset condition may include at least one of a first condition and a second condition.

[0166] (1) The first condition is that the signal intensity of the peak to be found is greater than the intensity of the background noise.

[0167] Background noise can include ambient light noise, dark noise from circuit components, and noise caused by stains on the glass cover. For example, if the background noise is caused by stains on the glass cover, and the intensity of the background noise signal is high, severely attenuating the target signal, the CPU may misidentify the background noise signal as the target signal based on the confidence algorithm. To avoid this, the CPU can eliminate the interference by determining whether the signal intensity of the found peak is greater than the background noise intensity.

[0168] The CPU can detect the background noise intensity in real time. For example, the background noise intensity is shown as the dotted line in Figure 20. The CPU can then determine whether the signal intensity of the peak found is greater than the intensity of the background noise. If the signal intensity of the peak is greater than the intensity of the background noise, such as being above the dotted line as shown in Figure 20, then it indicates that the peak is not a peak of background noise. If the signal intensity of the peak is less than or equal to the intensity of the background noise, such as being below the dotted line as shown in Figure 20, then it indicates that the peak is likely a peak of background noise.

[0169] It should be noted that if the CPU finds only one peak within the peak-searching range and the signal strength of this peak is less than or equal to the strength of the background noise, or if multiple peaks are found within the peak-searching range and the signal strength of each peak is less than or equal to the strength of the background noise, then it means that the peak found does not meet the first condition.

[0170] (2) The second condition is that the signal strength of the peak to be found is greater than N times the signal strength of the preset reference signal.

[0171] Here, N is greater than or equal to 2. For example, N=3.

[0172] The above-mentioned signal intensity may refer to the light intensity or the number of photons counted within the detection time.

[0173] When the ambient temperature of the electronic device and the voltage of the ToF module remain constant, the intensity of the pulse signal emitted by the ToF module is fixed, and the relative position of the glass cover and the ToF module is also fixed. Therefore, the intensity distribution and peak position of the crosstalk signal actually measured by the electronic device remain unchanged. However, when the distance between the electronic device and the object being measured changes, the intensity of the target signal reflected from the object being measured will change. For example, when the distance between the electronic device and the object being measured is close, most of the light emitted by the ToF module will penetrate the glass and illuminate the object being measured. The intensity of the target signal reflected from the object being measured is N times that of the crosstalk signal reflected from the glass cover. As the distance between the electronic device and the object being measured gradually increases, the intensity of the target signal gradually decays.

[0174] Based on the characteristic that the intensity of the target signal will attenuate with the propagation distance, after finding a peak, the electronic device can determine whether the signal intensity of this peak is greater than N times the preset reference signal. If the signal intensity of this peak is greater than N times the intensity of the preset reference signal, it means that the attenuation degree of the target signal is low, and the current scene may be short-range ranging. If the signal intensity of the peak is less than or equal to N times the intensity of the preset reference signal, it means that the attenuation degree of the target signal is high, and the current scene may be long-range ranging. Taking N=3 as an example, the light intensity of the peak found by the CPU in the 12th bin is 1100, and the light intensity of the preset reference signal is 350. The signal intensity of this peak is greater than 3 times the preset reference signal, and the current scene may be short-range ranging.

[0175] When the environmental parameters of the electronic device remain unchanged, the CPU can directly determine the peak search range of the first pixel based on the calibration data, and then search for peaks that meet the preset conditions within the histogram obtained by the histogram statistics module. However, in actual implementation, the ambient temperature of the electronic device when the calibration data was generated may be different from the ambient temperature of the electronic device during the current detection. The voltage of the ToF module when the calibration data was generated may also be different from the voltage of the ToF module during the current detection. These changes in environmental parameters may affect the accuracy of the depth value.

[0176] Taking ambient temperature as an example, FIG21 shows a schematic diagram of a histogram obtained by an electronic device at different temperatures.

[0177] As shown in Figure 21, the signal envelope shapes of the histograms when the ambient temperature is 27°C and when it is 43°C are identical. The difference between the two histograms is that when the ambient temperature of the electronic device is 27°C, the time range of the crosstalk signal and the target signal is (7 bins, 33 bins); when the ambient temperature of the electronic device is 43°C, the time range of the crosstalk signal and the target signal is (8 bins, 34 bins). In other words, as the ambient temperature of the electronic device increases, the overall signal envelope shifts one bin to the right along the horizontal axis.

[0178] For long-distance ranging scenarios: When the envelopes of the crosstalk signal and the target signal shift synchronously to the right along the horizontal axis due to ambient temperature, the difference between the crosstalk signal reception time and the target signal reception time remains unchanged. Therefore, the depth value calculated by the electronic device based on the difference between the crosstalk signal reception time and the target signal reception time also remains unchanged. In other words, in long-distance ranging scenarios, the depth value calculation is decoupled from ambient temperature jitter.

[0179] For close-range ranging scenarios: When the environmental parameters of the electronic device remain basically unchanged, the parameters such as the envelope shape of the crosstalk signal returned by the glass cover, the envelope position of the crosstalk signal, the intensity distribution of the crosstalk signal, and the peak position of the crosstalk signal also remain basically unchanged. Therefore, the electronic device can regard the preset reference signal as the actual crosstalk signal during this detection period. However, when the envelope position of the crosstalk signal overlaps with the envelope position of the target signal, and the ambient temperature of the electronic device changes, the envelope position of the crosstalk signal and the envelope of the target signal will be offset as a whole along the horizontal axis. In this way, there is a deviation between the envelope position of the actual crosstalk signal during this detection period and the position of the envelope of the preset reference signal on the horizontal axis, resulting in inaccurate restoration of the target signal from the histogram based on the preset reference signal, and thus inaccurate depth value finally calculated.

[0180] It should be noted that when the voltage of the ToF module changes, the envelope position of the crosstalk signal and the envelope position of the target signal in the histogram will also be offset as a whole. Please refer to Figure 21 for the relevant description of the overall offset of the envelope position of the crosstalk signal and the envelope position of the target signal when the ambient temperature changes. No further details will be given here.

[0181] Given that changes in the ambient temperature of electronic devices and the voltage of the ToF module may affect the accuracy of depth values, this application proposes the following two correction schemes:

[0182] In the first correction scheme, the above S202 may specifically include: after reading the calibration data, the CPU may determine the peak position i of the preset reference signal corresponding to the first pixel, and then correct the peak position i based on the ambient temperature of the electronic device and the voltage of the ToF module to obtain the peak position i'. Then, the CPU searches for a peak that meets the preset conditions within the peak search range (i'-m, i'+n) of the histogram obtained by the histogram statistics module. i' represents the i'th bin on the horizontal axis, and the peak search range may be from the i'-mth bin to the i'+nth bin. Both m and n are preset positive integers.

[0183] In the second correction scheme, the above S202 may specifically include: after reading the calibration data, the CPU may determine the peak position i of the preset reference signal corresponding to the first pixel, and then based on the ambient temperature of the electronic device and the voltage of the ToF module, correct the horizontal axis position of the histogram obtained by the histogram statistics module to obtain a corrected histogram. Then, the CPU searches for a peak that meets the preset conditions within the peak search range (im, i+n) of the corrected histogram. Wherein, i represents the i-th bin on the horizontal axis, and the peak search range can be from the im-th bin to the i+n bin. Both m and n are preset positive integers.

[0184] Regardless of whether any correction scheme is adopted or not, when the peak found in the histogram meets the preset conditions, it indicates that the current scene may be close-range ranging, and the CPU can execute the following S205-S206; when the peak found in the histogram does not meet the preset conditions, it indicates that the current scene may be long-range ranging, and the CPU can execute the following S203-S204.

[0185] S203: The CPU determines signal parameters of the crosstalk signal (also referred to as the first crosstalk signal) and signal parameters of the target signal in the histogram.

[0186] It should be noted that the histogram in S203 is the original histogram obtained by the histogram statistics module during the current detection time. The crosstalk signal and target signal are the signals actually measured during the current detection time, rather than pre-stored ones.

[0187] The signal parameters of the crosstalk signal reception time may include: the envelope shape of the crosstalk signal actually measured during the current detection duration, the envelope position of the crosstalk signal actually measured during the current detection duration, the intensity distribution of the crosstalk signal actually measured during the current detection duration, etc.

[0188] The signal parameters of the target signal may include: the envelope shape of the target signal actually measured during the current detection time, the envelope position of the target signal actually measured during the current detection time, the intensity distribution of the target signal actually measured during the current detection time, etc.

[0189] As shown in Figure 22, in a long-distance ranging scenario, the original histogram obtained by the histogram statistics module includes two signals. The time range of the first signal is (5bin, 13bin), and the time range of the second signal is (52bin, 60bin). Because the distance between the ToF module and the glass cover is smaller than the distance between the ToF module and the object being measured, the time when the ToF module receives the crosstalk signal is earlier than the time when it receives the target signal. Based on this, the CPU can determine that the first signal is the crosstalk signal and the second signal is the target signal, and obtain the signal parameters of the crosstalk signal and the signal parameters of the target signal respectively, that is, separating the crosstalk signal and the target signal from the histogram.

[0190] S204 : The CPU calculates a depth value based on the reception time of the crosstalk signal and the reception time of the target signal.

[0191] In some embodiments, the reception time of the crosstalk signal and the reception time of the target signal may be determined by any of the following methods:

[0192] In method 1, the CPU can determine the peak time of the target signal and the peak time of the crosstalk signal based on the signal parameters of the receiving time of the crosstalk signal and the signal parameters of the target signal, and then subtract the peak time of the crosstalk signal from the peak time of the target signal to obtain the flight time Δt, and then calculate the depth value based on the flight time Δt.

[0193] Exemplarily, as shown in FIG22 , the CPU can separate the crosstalk signal and the target signal from the original histogram obtained by the histogram statistics module, and respectively determine the peak time of the crosstalk signal and the peak time of the target signal, and then calculate the depth value based on the following relationship (3).

[0194] Where depth represents the depth value. Kpeak1 represents the peak time of the target signal, that is, the bin number on the horizontal axis where the peak of the target signal occurs. Kpeak2 represents the peak time of the crosstalk signal (i.e., the first reference signal), that is, the bin number on the horizontal axis where the peak of the crosstalk signal occurs. q represents the duration of each bin, for example, q = 500 ps / bin. c represents the speed of light.

[0195] In method 2, the CPU can search for the first centroid in the target signal and the second centroid in the crosstalk signal based on the centroid method; subtract the time of the second centroid from the time of the first centroid to obtain the flight time Δt; then, calculate the depth value based on the flight time Δt.

[0196] For example, the relationship of the centroid method is as follows:

[0197] Where CentroidTof represents the time of the centroid. Index represents the position of the bin on the horizontal axis. Count represents the number of photons in the bin. M represents the full pulse width. n represents the position of the pulse rising edge.

[0198] The CPU can determine the centroid time of the crosstalk signal by using equation (4) based on the histogram corresponding to the crosstalk signal shown in FIG22. The CPU can also determine the centroid time of the target signal by using equation (4) based on the histogram corresponding to the target signal shown in FIG22.

[0199] Then, the CPU can calculate the depth value based on the following relational expression (5).

[0200] Where depth represents the depth value. CentroidTof1 represents the centroid time of the target signal. CentroidTof2 represents the centroid time of the crosstalk signal. q represents the time length of each bin, for example, q = 500 ps / bin. c represents the speed of light.

[0201] In method 3, the CPU can use the three-point method to find the first peak in the fitting curve of the target signal and the second peak in the fitting curve of the crosstalk signal. The CPU can subtract the time of the second peak from the time of the first peak to obtain the flight time Δt. The depth value is calculated based on the flight time Δt.

[0202] As shown in Figure 23, the relationship between the three-point method can be as follows:

[0203] Here, δ represents the time difference between the peak time K of the histogram and the peak Kpeak of the fitting curve. Xk-1, Xk, and Xk+1 represent the light intensities corresponding to K-1, K, and K+1 on the horizontal axis of the fitting curve, respectively.

[0204] The CPU can perform fitting based on the histogram corresponding to the crosstalk signal shown in FIG22 to obtain a second fitting curve, and then search for a second peak in the second fitting curve based on equation (6). The CPU can also perform fitting based on the histogram corresponding to the target signal shown in FIG22 to obtain a first fitting curve, and then search for a first peak in the first fitting curve based on equation (6).

[0205] Then, the CPU can calculate the depth value based on the following relational expression (7).

[0206] Where depth represents the depth value. Kpeak1 represents the peak of the first fitting curve. Kpeak2 represents the peak of the second fitting curve. Ka represents the peak of the target signal's histogram. Kb represents the peak of the crosstalk signal's histogram. δ1 represents the time difference between Ka and Kpeak1. δ2 represents the time difference between Kb and Kpeak2. q represents the time length of each bin, for example, q = 500 ps / bin. c represents the speed of light.

[0207] The concept behind calculating depth values ​​in Methods 1 through 3 described above is essentially the same: a characteristic point that best characterizes the signal reception time is determined in each of the target and crosstalk signals. The time of these two characteristic points is subtracted to obtain the time of flight Δt, and the depth value is then calculated based on the time of flight Δt. It should be understood that when the distance between the electronic device and the object being measured is relatively long, the envelope positions of the crosstalk signal and the target signal are far apart on the horizontal axis, and the peaks of the two signals can be distinguished. Therefore, the time of flight Δt can be calculated by subtracting the two peaks.

[0208] S205 . The CPU separates a target signal from the histogram based on a preset reference signal corresponding to the first pixel.

[0209] Separating the target signal from the histogram comprises separating an array of target signals from the array of histograms based on signal data of a preset reference signal corresponding to the first pixel. The array of target signals includes signal parameters such as the envelope shape of the target signal, the envelope position of the target signal, and the intensity distribution of the target signal.

[0210] When the environmental parameters of the electronic device remain basically unchanged, the parameters such as the envelope shape of the crosstalk signal returned by the glass cover, the envelope position of the crosstalk signal, the intensity distribution of the crosstalk signal, and the peak position of the crosstalk signal also remain basically unchanged. When the distance between the electronic device and the object under test is relatively close, the envelope position of the crosstalk signal and the envelope position of the target signal are relatively close on the horizontal axis, so that the envelopes of the two signals overlap and the peaks of the two signals cannot be clearly distinguished. In this case, the electronic device can regard the preset reference signal corresponding to the first pixel as the crosstalk signal actually measured during this detection time, that is, the signal envelope of the histogram can be regarded as the envelope formed by the superposition of the preset reference signal and the target signal. The electronic device can restore the target signal from the histogram based on the calibration data of the preset reference signal.

[0211] With reference to the description of the above embodiment, if S202 is implemented using the first correction scheme, that is, the horizontal axis position of the preset reference signal corresponding to the first pixel is corrected, then S205 can be specifically implemented as follows: the CPU separates the target signal from the original histogram obtained by the histogram statistics module based on the signal data of the corrected preset reference signal. It can be understood that by shifting the preset reference signal along the horizontal axis while maintaining the horizontal axis position of the signal envelope in the original histogram, the accuracy of the target signal restored from the histogram based on the preset reference signal in the close-range ranging scenario is improved, thereby improving the accuracy of the ultimately calculated depth value.

[0212] With reference to the description of the above embodiment, if S202 is implemented using the second correction scheme, that is, correcting the horizontal axis position of the histogram obtained by the histogram statistics module, then S205 can be specifically implemented in the following manner: the CPU separates the target signal from the corrected histogram based on the signal data of the preset reference signal corresponding to the first pixel. It can be understood that, while keeping the preset reference signal unchanged, by offsetting the crosstalk signal and the target signal in the original histogram along the horizontal axis, the accuracy of the target signal restored from the histogram based on the preset reference signal in the close-range ranging scenario is improved, thereby improving the accuracy of the depth value finally calculated.

[0213] S206 : The CPU calculates a depth value based on a reception time of a preset reference signal corresponding to the first pixel and a reception time of a target signal.

[0214] It should be noted that the reception time of the preset reference signal and the reception time of the target signal corresponding to the first pixel can be determined by referring to any of the methods 1 to 3 in step 204 above. That is, the reception time of the preset reference signal and the reception time of the target signal corresponding to the first pixel can be the peak time of the histogram, the centroid time obtained using the centroid method, or the peak time of the fitting curve obtained using the three-point method. The detailed description of step 204 above is provided and will not be repeated here.

[0215] For example, FIG24 shows a schematic diagram of calculating a depth value without correcting the horizontal axis position of the preset reference signal and the original histogram. As shown in FIG24 (a), in the original histogram obtained by the histogram statistics module, the envelope position of the crosstalk signal and the envelope position of the target signal are relatively close on the horizontal axis, so that the envelopes of the two signals overlap and the peak of the crosstalk signal and the peak of the target signal cannot be distinguished. As shown in FIG24 (b), in the histogram of the preset reference signal corresponding to the first pixel, the position of the peak on the horizontal axis is the 7th bin. The CPU can remove the preset reference signal shown in FIG24 (b) from the histogram shown in FIG24 (a) to obtain the target signal shown in FIG24 (c), wherein the position of the peak of the target signal on the horizontal axis is the 10th bin. As shown in FIG24 (d), the CPU uses the 7th bin as the 0 distance point and calculates the depth value according to the following relationship (8).

[0216] Where depth represents the depth value, q represents the time length of each bin, for example, q = 500 ps / bin, and c represents the speed of light.

[0217] For example, Figure 25 shows a schematic diagram of calculating a depth value while correcting the horizontal axis position of a histogram. As shown in Figure 25 (a), based on the current ambient temperature and the voltage of the ToF module, the CPU shifts the original histogram obtained by the histogram statistics module to the left by 2 bins along the horizontal axis to obtain a corrected histogram. As shown in Figure 25 (b), in the preset reference signal calibrated during the entire machine production line phase of the EMS, the peak position on the horizontal axis is the 7th bin. The CPU can remove the preset reference signal shown in Figure 25 (b) from the corrected histogram shown in Figure 25 (a) to obtain the target signal shown in Figure 25 (c), where the peak position of the target signal on the horizontal axis is the 11th bin. As shown in Figure 25 (d), the CPU uses the 7th bin as the 0 distance point, calculates the flight time from the 7th bin to the 11th bin, and then calculates the depth value based on the flight time.

[0218] For example, Figure 26 shows a schematic diagram of calculating a depth value while correcting the horizontal axis position of a preset reference signal. For example, as shown in (a) of Figure 26, the horizontal axis position of the signal envelope in the original histogram obtained by the histogram statistics module remains unchanged. As shown in (b) of Figure 26, the CPU shifts the preset reference signal to the right by 2 bins along the horizontal axis based on the current ambient temperature and the voltage of the ToF module to obtain a corrected reference signal, wherein the peak of the second reference signal is located at the 9th bin on the horizontal axis. The CPU can remove the second reference signal shown in (b) of Figure 26 from the original histogram shown in (a) of Figure 26 to obtain a target signal as shown in (c) of Figure 26, wherein the peak of the target signal is located at the 13th bin on the horizontal axis. As shown in (d) of Figure 26, the CPU uses the 9th bin as the 0 distance point, calculates the flight time from the 9th bin to the 13th bin, and then calculates the depth value based on the flight time.

[0219] In view of the different distribution patterns of the envelope positions of the crosstalk signal and the target signal in the histogram during long-distance ranging and short-distance ranging, the above embodiment provides a method for determining a depth value: first, it is determined whether the object under test that reflects the target signal is at a relatively close distance; when the object under test is within the long-distance ranging range, the envelope position of the crosstalk signal and the envelope position of the target signal are far apart on the horizontal axis, and the peaks of the two signals can be distinguished, so a double-peak subtraction method can be used to obtain the depth value; when the object under test is within the short-distance ranging range, the peaks of the two signals cannot be clearly distinguished, and the CPU can regard the preset reference signal as the crosstalk signal actually measured during this detection time, and restore the target signal from the histogram based on the preset reference signal, and then obtain the depth value based on the reception time of the preset reference signal and the target signal.

[0220] With reference to the description of the above embodiment, the ambient temperature of the electronic device when calibrating the data may not be the same as the ambient temperature of the electronic device during this detection, and the voltage of the ToF module when calibrating the data may also be different from the voltage of the ToF module during this detection. Changes in these environmental parameters may affect the accuracy of the depth value. In view of the fact that changes in the ambient temperature of the electronic device and the voltage of the ToF module may affect the accuracy of the depth value, the present application provides a temperature compensation model and a voltage compensation model. Among them, the temperature compensation model is used to correct the depth value when the ambient temperature of the electronic device changes, and the voltage compensation model is used to correct the depth value when the voltage of the ToF module changes.

[0221] The following example uses the central pixel of a receiving end array device in a ToF module as an example. The ambient temperature or voltage is controlled as a single variable to obtain the offset relationship between the variable and the strain (i.e., the depth value). The temperature compensation model and voltage compensation model are then determined based on this offset relationship.

[0222] For example, the temperature compensation model is obtained as follows:

[0223] ① As shown in Figure 27, a coordinate system is established with temperature as the horizontal axis and depth as the vertical axis.

[0224] ② Within the preset temperature range, measure the depth value of the lowest temperature, then gradually increase the temperature from the lowest temperature, and measure the depth value once every preset temperature interval (such as 1°C or 2°C) until the depth value of the highest temperature is obtained. In this process, record the depth value corresponding to each temperature. Among them, the preset temperature range can be -20°C to 70°C, or it can be 0°C to 90°C as shown in Figure 27. It can be adjusted according to actual use needs and is not limited in this application.

[0225] ③ Based on the depth values ​​corresponding to each temperature recorded in ②, mark each discrete point in the coordinate system established by ①.

[0226] ④ Fit each discrete point to obtain the first fitting line.

[0227] The first fitting line is a straight line, and the corresponding vertical coordinate is the depth value on the left side, in mm.

[0228] ⑤ Obtain the offset of each discrete point from the first fitting curve in the vertical axis direction.

[0229] ⑥ Mark the offset corresponding to each discrete point in the coordinate system established by ① to obtain the second fitting line.

[0230] The ordinate corresponding to the second fitting line is the offset on the left side, in mm.

[0231] ⑦ Based on the slopes of the first fitting line and the second fitting line, the temperature compensation model equation (9) is obtained: thermal offset =a*(temperature-init temp ) 2 +b*(temperature-init temp ).

[0232] Among them, thermal offset Represents the depth value adjustment amount. a represents the slope of the first fitting line. b represents the slope of the second fitting line. temperature represents the ambient temperature of the electronic device during this detection. init tempRepresents the reference temperature, which refers to the ambient temperature of the electronic device when calibrating the data, such as init temp =25℃.

[0233] During this detection, parameters a, b and init temp The temperature parameter is preset and can be obtained in real time. In this way, based on the expression of the temperature compensation model, the electronic device can calculate the depth value adjustment amount, and then the time adjustment amount can be obtained based on the depth value adjustment amount.

[0234] Referring to the description of the above embodiment, when the ambient temperature of the electronic device during calibration differs from the ambient temperature of the electronic device during the current detection, the envelope positions of the crosstalk signal and the target signal will be offset overall on the horizontal axis. After obtaining the temperature compensation model in the above manner, the electronic device can substitute the ambient temperature of the electronic device during calibration and the ambient temperature of the electronic device during the current detection into the temperature compensation model to calculate the time adjustment. The flight time is then corrected based on the time adjustment to obtain a more accurate depth value.

[0235] Exemplarily, the voltage compensation model is obtained as follows:

[0236] ① As shown in Figure 28, establish a coordinate system with the gear position as the horizontal axis and the depth value as the vertical axis.

[0237] ② Measure the depth value at the lowest voltage level within the preset voltage range. Then, gradually increase the range from the lowest voltage level, measuring the depth value at each level until the maximum voltage level is reached. During this process, record the depth value corresponding to each level.

[0238] As an example, an electronic device can pre-set multiple voltage levels. Each time a voltage level is changed, the voltage of the ToF module increases or decreases by 10mV. Typically, the voltage of the ToF module is between levels 16 and 18. Typically, each time a level is switched, the voltage of the ToF module increases or decreases by 110mV to 130mV. For example, when switching from level 16 to level 18, the voltage of the ToF module increases by 220mV to 260mV, and the measured depth value decreases by 8mm.

[0239] ③ Based on the depth values ​​corresponding to each gear position recorded by ②, multiple discrete points are marked in the coordinate system established by ①.

[0240] ④ Fit multiple discrete points to obtain the voltage fitting line.

[0241] Based on the slope of the voltage fitting line, the voltage compensation model relationship (10) is obtained: Vspad offset =Vspad delta *ratiotof *1000 = (|Vspad meas |-V calc )*ratio tof *1000. =(|Vspad meas |-(|Vspad1|+(bvd current -bvd1)*bvd lsb ))*ratio tof *1000

[0242] Among them, Vspad offset Represents the depth value adjustment amount. delt a represents the difference between the voltage value of the ToF module during this detection and the voltage value recorded during the calibration data. meas Represents the voltage of the ToF module during this detection, in mV. Vspad1 represents the voltage value recorded during calibration data, in mV. bvd current Represents the gear position during this detection. bvd1 represents the gear position recorded during the calibration data. lsb Represents the voltage value changed when switching a single gear, in mv. tof Represents the slope of the voltage fitting line.

[0243] During this detection, the parameters Vspad1, bvd1, bvd lsb and ratio tof For the default, parameter Vspad meas and bvd current It can be obtained in real time, so based on the expression of the voltage compensation model, the electronic device can calculate the depth value adjustment amount, and then the time adjustment amount can be obtained based on the depth value adjustment amount D=c*Δt / 2.

[0244] The following provides a specific example of calculating the time adjustment amount by combining the above-mentioned temperature compensation model and voltage compensation model.

[0245] For example, during this detection, the electronic device can use a temperature sensor to collect the temperature of the current environment as the ambient temperature of the electronic device. The electronic device can also use an analog-to-digital converter (ADC) to collect the voltage value at the receiving end of the ToF module as the voltage of the ToF module.

[0246] The ambient temperature of the electronic equipment during this detection is temperature = 40°C, and the reference temperature is init temp=25°C, the slope of the first fitting line is a=0.5, and the slope of the second fitting line is b=0.01. The electronic device can substitute these values ​​into equation (9) to obtain the depth value adjustment corresponding to the ambient temperature of the electronic device:

[0247] thermal offset =0.5*(40-25) 2 -0.01*(40-25)=112.35mm.

[0248] The electronics can then offset =112.35mm, substitute Get the time adjustment corresponding to the ambient temperature of the electronic equipment: t thermal .

[0249] When the ambient temperature of the electronic device is 40°C, the voltage Vspad of the ToF module during this detection meas =18300mv, the voltage value recorded when calibrating the data is Vspad1=18000mv, the gear position during this detection is bvd current =18, the gear recorded when calibrating the data bvd1 =16, the voltage value changed when switching a single gear bvd lsb =110mv, the slope ratio of the voltage fitting line tof =-0.08mm / mv. The electronic device can substitute these values ​​into equation (10) to obtain the depth value adjustment corresponding to the voltage of the ToF module during this detection: Vspad offset =6.4mm.

[0250] The electronic device can then Vspad offset =6.4mm, substitute Get the time adjustment corresponding to the ambient temperature of the electronic equipment: t vspad .

[0251] Finally, the electronic device can obtain the total time adjustment: t thermal +t vspad .

[0252] Taking a total time adjustment of 2 bins as an example, the CPU can shift the original histogram obtained by the histogram statistics module by 2 bins to the left along the horizontal axis to obtain a corrected histogram. Alternatively, the CPU can shift the preset reference signal by 2 bins to the right along the horizontal axis to obtain a corrected reference signal.

[0253] Referring to the description of the above embodiment, if the voltage of the ToF module during calibration differs from the voltage of the ToF module during current detection, the envelope positions of the crosstalk signal and the target signal will be offset on the horizontal axis. After obtaining the time adjustment amount in the above manner, the electronic device can correct the time of flight based on the time adjustment amount, thereby correcting the depth value.

[0254] It should be noted that the above-mentioned temperature compensation model and voltage compensation model are merely exemplary descriptions and do not limit the present application. In actual implementation, other methods may be used to establish the temperature compensation model and the voltage compensation model. In addition, the electronic device may be provided with only a temperature compensation model, or only a voltage compensation model, or both a temperature compensation model and a voltage compensation model. It should be understood that when the electronic device is provided with a temperature compensation model and a voltage compensation model, the electronic device may correct the flight time based on the temperature compensation model and the voltage compensation model, respectively.

[0255] In an embodiment of the present application, the temperature compensation model and the voltage compensation model are pre-configured before the electronic device leaves the factory. Since the temperature compensation model and the voltage compensation model are generated based on a small number of ToF modules, the temperature compensation model and the voltage compensation model can only reflect some common characteristics between the ToF modules. Based on the individual differences between the ToF modules, the depth compensation value calculated according to the temperature compensation model and the voltage compensation model may have a certain error. To this end, as shown in Figure 29, the present application also provides a method for optimizing the temperature compensation model and the voltage compensation model.

[0256] For example, as shown in FIG29 , when no peak meeting the preset condition is found in the histogram in S202 (long-distance ranging scenario), the CPU may further execute the following S301 - S306 .

[0257] S301. The CPU records a set of data every first number of frames (eg, 100 frames).

[0258] Each set of data includes the current crosstalk signal parameters, the voltage change of the ToF module (referred to as the voltage change value), and the ambient temperature of the electronic device. The current crosstalk signal parameters may include the current crosstalk signal envelope shape, the current crosstalk signal envelope position, and the current crosstalk signal intensity distribution.

[0259] S302. The CPU can set multiple environmental parameter groups within a preset temperature range (-20°C, 70°C) according to a preset temperature interval (such as 2°C), and within a preset voltage change range (-130mv, 130mv) according to a preset voltage interval (such as 10mv). Each environmental parameter group corresponds to a temperature value and a voltage change value. After recording a set of data each time, the CPU can add a tag to the corresponding environmental parameter group based on the temperature value and voltage change value in each set of data, and then execute the following S303 and S304. In addition, when adding a tag to an environmental parameter group, the CPU determines whether the number of tags in this environmental parameter group is greater than the preset number of tags (such as 5). If it is greater than the preset number of tags, the CPU deletes the earliest added tag in this environmental parameter group and its corresponding set of data.

[0260] Table 2 shows the labels for each environmental parameter grouping within the preset voltage range (-130mV, 130mV) and the temperature range (20°C, 32°C). For example, the environmental parameter grouping corresponding to a temperature of 28°C and a voltage variation of -50mV has five labels, indicating that this environmental parameter grouping records five sets of data.

[0261] Table 2

[0262] S303. The CPU determines whether the environmental parameter groups corresponding to any temperature within the preset temperature range (-20° C., 70° C.) meet the following conditions 1 and 2.

[0263] Condition 1: The voltage difference between the first environmental parameter group and the second environmental parameter group is greater than or equal to the maximum voltage span value (eg, 70 mV). The first environmental parameter group and the second environmental parameter group are any two environmental parameter groups that have been tagged at the same temperature.

[0264] Condition 2: The voltage difference between the third environmental parameter group and the fourth environmental parameter group is less than or equal to the minimum voltage span value (eg, 20 mV). The third environmental parameter group and the fourth environmental parameter group are any two environmental parameter groups that have been tagged at the same temperature.

[0265] Referring to Table 2 above, at a temperature of 22°C, four environmental parameter groups have been labeled: the environmental parameter group corresponding to -120 mV, the environmental parameter group corresponding to -10 mV, the environmental parameter group corresponding to 0 mV, and the environmental parameter group corresponding to 80 mV. Since the voltage span from the environmental parameter group corresponding to -120 mV to the environmental parameter group corresponding to 80 mV is 200 mV, which is greater than the maximum voltage span of 70 mV, condition 1 is determined to be satisfied. Since the voltage span from the environmental parameter group corresponding to -10 mV to the environmental parameter group corresponding to 0 mV is 10 mV, which is less than the minimum voltage span of 20 mV, condition 2 is determined to be satisfied.

[0266] If conditions 1 and 2 are satisfied, the CPU executes S304 .

[0267] S304. The CPU sets the weights of the discrete points in each environmental parameter group at the temperature to a first weight value (such as 2), sets the weights of the discrete points of the voltage compensation model to a second weight value (such as 0.5), and fits the curve according to the least squares method to obtain a new voltage compensation model.

[0268] The second weight value is smaller than the first weight value. The discrete points of the voltage compensation model include voltage values ​​and depth values ​​determined according to the horizontal axis coordinate position of the crosstalk signal.

[0269] S305. The CPU determines whether, at any voltage change value within the preset voltage change range (-130 mv, 130 mv), each environmental parameter group corresponding to a voltage change value satisfies the following conditions 3 and 4.

[0270] Condition 3: The temperature difference between the fifth environmental parameter group and the sixth environmental parameter group is greater than or equal to the maximum temperature span value (eg, 40° C.) The fifth environmental parameter group and the sixth environmental parameter group are any two environmental parameter groups that have been labeled under a voltage change value.

[0271] Condition 4: The temperature difference between the seventh environmental parameter group and the eighth environmental parameter group is less than or equal to the minimum temperature span value (eg, 4° C.) The seventh environmental parameter group and the eighth environmental parameter group are any two environmental parameter groups that have been labeled at a voltage change value.

[0272] If conditions 3 and 4 are satisfied, the CPU executes S306 described below.

[0273] S306. The CPU sets the weights of the discrete points in each environmental parameter group under the voltage change value to the third weight value (such as 2), sets the weights of the discrete points of the temperature compensation model to the fourth weight value (such as 0.5), and fits the curve according to the least squares method to obtain a new temperature compensation model.

[0274] The second weight value is smaller than the first weight value. The discrete points of the temperature compensation model include temperature values ​​and depth values ​​determined according to the horizontal axis coordinate position of the crosstalk signal.

[0275] In the above embodiment, in the long-distance ranging scenario, the envelope position of the crosstalk signal and the envelope position of the target signal are far apart on the horizontal axis, and the peaks of the two signals can be distinguished. Therefore, the CPU can separate the crosstalk signal from the histogram of the long-distance ranging scenario during the use of the entire machine, and continuously optimize the temperature compensation model and the voltage compensation model based on the crosstalk signal and the ambient temperature and voltage corresponding to the crosstalk signal, so that the depth compensation value obtained according to the temperature compensation model and the voltage compensation model is more accurate.

[0276] Exemplarily, FIG30 is a schematic diagram of two depth values ​​at different voltages.

[0277] Assume that the actual distance between the electronic device and the object being measured is 700mm. As shown in (a) of Figure 30, after the ToF module is assembled into the electronic device, if the depth value determination method provided by the ToF module manufacturer is used, the final depth value obtained is 670mm, which is 30mm different from the actual distance. As shown in (b) of Figure 30, after the ToF module is assembled into the electronic device, if the depth value determination method provided by this application is used, the final depth value obtained is 690mm, which is 10mm different from the actual distance. It can be understood that since the voltage used by the ToF module manufacturer is somewhat different from the actual voltage of the ToF module, the depth value obtained based on the depth value determination method provided by the ToF module manufacturer is not accurate enough. However, when the depth value determination method provided by this application is used, since a temperature compensation model and a voltage compensation model are set and the temperature compensation model and the voltage compensation model are continuously optimized, a more accurate depth value can be obtained based on the temperature compensation model and the voltage compensation model.

[0278] For example, FIG31 is a schematic structural diagram of an electronic device provided in an embodiment of the present application.

[0279] As shown in FIG31 , the electronic device 400 may include a processor 410 , an internal memory 420 , a ToF module 430 , a camera 440 , a display screen 450 , an audio module 460 , a speaker 460A, a receiver 460B, a microphone 460C, an earphone jack 460D, and the like.

[0280] The processor 410 may be configured to execute the depth value determination method in the above-described embodiment. The processor 410 may include one or more processing units, for example, the processor 410 may include a central processing unit (CPU), a graphics processing unit (GPU), an application processor (AP), an image signal processor (ISP), and the like.

[0281] The internal memory 420 can be used to store computer executable program codes, which include instructions. The processor 410 executes various functional applications and data processing of the electronic device 400 by running the instructions stored in the internal memory 420. The internal memory 420 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system and an application (APP) required for at least one function, such as a camera application and a gallery application. The data storage area can store configuration files for each APP.

[0282] The ToF module 430 can be used to measure the distance between the electronic device and the object being measured, that is, the depth value. In some embodiments, the electronic device 400 can include one or more ToF modules 430.

[0283] The camera 440 can be used to move forward or backward a distance corresponding to the depth value based on the depth value obtained by the ToF module 430 to achieve shooting effects such as focusing on the near scene and blurring the distant scene. In some embodiments, the electronic device 400 can include one or more cameras 440.

[0284] The display screen 450 includes a display panel for displaying photos or videos taken by the camera 440 .

[0285] In addition, the electronic device 400 can implement audio functions such as audio through the audio module 460, the speaker 460A, the receiver 460B, the microphone 460C, the headphone jack 460D, etc.

[0286] The present application also provides a computer-readable storage medium having computer instructions stored therein. When the computer-readable storage medium is run on an electronic device, the electronic device executes the method described in the above embodiment. The computer instructions can be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another computer-readable storage medium. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that can be integrated with one or more media. The available medium can be a magnetic medium, an optical medium, or a semiconductor medium, etc.

[0287] An embodiment of the present application further provides a computer program product, which includes a computer program code. When the computer program code runs on an electronic device, the electronic device executes the methods in the above embodiments.

[0288] The present application also provides a chip system. The chip system is applied to an electronic device. The chip system includes one or more processors, which are configured to invoke computer instructions to enable the electronic device to execute the methods described in the above embodiments.

[0289] The electronic device, computer-readable storage medium, computer program product, and chip system provided in the embodiments of the present application are all used to execute the methods provided in the above embodiments. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects corresponding to the methods provided above, and will not be repeated here.

[0290] In the description of this application, " / " means or. For example, A / B can mean A or B. In the description of this application, "and / or" is simply a way to describe the association relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.

[0291] In the specification and claims of this application, the terms "first" and "second" are used to distinguish different objects or to distinguish different processing of the same object, rather than to describe a specific order of objects. For example, the terms "first operation" and "second operation" are used to distinguish different operations, rather than to describe a specific order of operations. In the embodiments of this application, "plurality" refers to two or more.

[0292] Through the description of the above implementation methods, those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the functional units in the various embodiments of the present application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.

[0293] The above content is only a specific embodiment of this application, but the scope of protection of this application is not limited to this. Any changes or replacements within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

Claims

1. A method for determining a depth value, characterized in that The method is applied to an electronic device, and a depth detection module is arranged under a cover plate of the electronic device. The depth detection module includes a transmitting end and a receiving end. The method includes: The electronic device receives a pulse signal through the receiving end. The pulse signal includes a first crosstalk signal and a target signal. The first crosstalk signal is a signal transmitted by the transmitting end and reflected back by the cover plate, and the target signal is a signal transmitted by the transmitting end and reflected back by the object to be measured. The electronic device determines a depth value of the object to be measured based on a reception time of the second crosstalk signal and a reception time of the target signal. The second crosstalk signal is the first crosstalk signal, or the second crosstalk signal is a preset crosstalk signal.

2. The method according to claim 1, wherein Before the electronic device determines the depth value of the object to be measured based on the reception time of the second crosstalk signal and the reception time of the target signal, the method further includes: The electronic device separates the target signal from the pulse signal based on the second crosstalk signal.

3. The method according to claim 2, wherein The electronic device separating the target signal from the pulse signal based on the second crosstalk signal includes: The electronic device generates a first histogram based on the pulse signal. The horizontal axis of the first histogram represents the reception time of the pulse signal, and the vertical axis of the first histogram represents the signal strength of the pulse signal. If a peak that meets a preset condition is found within a preset peak search range of the first histogram, the electronic device separates the target signal from the first histogram based on the preset crosstalk signal. If a peak that meets the preset condition is not found within the preset peak search range of the first histogram, the electronic device respectively determines the first crosstalk signal and the target signal in the first histogram. The reception time of the first crosstalk signal is earlier than the reception time of the target signal. Wherein, the preset peak search range is determined according to the peak position of the preset crosstalk signal.

4. The method according to claim 2, wherein The electronic device separating the target signal from the pulse signal based on the second crosstalk signal includes: The electronic device generates a first histogram based on the pulse signal. The horizontal axis of the first histogram represents the reception time of the pulse signal, and the vertical axis of the first histogram represents the signal strength of the pulse signal. Based on the ambient temperature of the electronic device and the voltage of the depth detection module, the electronic device adjusts the reception time of the pulse signal in the first histogram to obtain a second histogram. If a peak that meets a preset condition is found within a preset peak search range of the second histogram, the electronic device separates the target signal from the second histogram based on the preset crosstalk signal. If a peak that meets the preset condition is not found within the preset peak search range of the second histogram, the electronic device respectively determines the first crosstalk signal and the target signal in the first histogram. The reception time of the first crosstalk signal is earlier than the reception time of the target signal. Wherein, the preset peak search range is determined according to the peak position of the preset crosstalk signal.

5. The method according to claim 2, wherein The electronic device separates the target signal from the pulse signal based on the second crosstalk signal, including: The electronic device generates a first histogram based on the pulse signal, where the horizontal axis of the first histogram represents the reception time of the pulse signal, and the vertical axis of the first histogram represents the signal intensity of the pulse signal; Based on the ambient temperature of the electronic device and the voltage of the depth detection module, the electronic device adjusts the reception time of the preset crosstalk signal; If a peak that meets the preset conditions is found within the preset peak search range of the first histogram, the electronic device separates the target signal from the first histogram based on the adjusted preset crosstalk signal; If no peak that meets the preset conditions is found within the preset peak search range of the first histogram, the electronic device respectively determines the first crosstalk signal and the target signal in the first histogram, and the reception time of the first crosstalk signal is earlier than the reception time of the target signal; Wherein, the preset peak search range is determined according to the peak position of the adjusted preset crosstalk signal.

6. The method according to any one of claims 3 to 5, characterized in that The preset conditions include: The signal intensity of the found peak is greater than the intensity of the background noise; The signal intensity of the found peak is greater than N times the signal intensity of the preset crosstalk signal.

7. The method according to claim 4, characterized in that, The electronic device adjusts the reception time of the pulse signal in the first histogram, including: The electronic device offsets the signal envelope of the pulse signal along a first direction of the horizontal axis by a target adjustment amount.

8. The method according to claim 5, characterized in that The electronic device adjusts the reception time of the preset crosstalk signal, including: The electronic device offsets the signal envelope of the preset crosstalk signal along a second direction of the horizontal axis by a target adjustment amount.

9. The method according to claim 7 or 8, characterized in that The method further includes: The electronic device obtains the ambient temperature of the electronic device and the voltage of the depth detection module; The electronic device obtains a first time adjustment amount based on the ambient temperature of the electronic device and the temperature compensation model; The electronic device obtains a second time adjustment amount based on the voltage of the depth detection module and the voltage compensation model; The electronic device uses the sum of the first time adjustment amount and the second time adjustment amount as the target adjustment amount; Wherein, the temperature compensation model is generated according to a plurality of first depth values, and the plurality of first depth values are depth values obtained by changing the ambient temperature under a preset voltage; the voltage compensation model is generated according to a plurality of second depth values, and the plurality of second depth values are depth values obtained by changing the voltage of the depth detection module under a preset temperature.

10. The method according to claim 9, wherein The method further includes: In the case where the signal intensity of the found peak does not meet the preset conditions, the electronic device stores a set of data, and the set of data includes: the ambient temperature of the electronic device, the voltage of the depth detection module, and the signal parameters of the first crosstalk signal; In the case where multiple sets of data stored by the electronic device meet the update conditions, the electronic device updates the temperature compensation model or the voltage compensation model.

11. The method according to any one of claims 1 to 10, characterized in that, The second crosstalk signal is the first crosstalk signal; the electronic device determines the depth value of the object to be measured based on the reception time of the second crosstalk signal and the reception time of the target signal, including: The electronic device subtracts the reception time of the first crosstalk signal from the reception time of the target signal to obtain a first time of flight; based on the first time of flight, the depth value of the object to be measured is determined.

12. The method according to any one of claims 1 to 10, characterized in that The second crosstalk signal is a preset crosstalk signal; The electronic device determines the depth value of the object to be measured based on the reception time of the second crosstalk signal and the reception time of the target signal, including: The electronic device subtracts the reception time of the preset crosstalk signal from the reception time of the target signal to obtain a second time of flight; Based on the second time of flight, the depth value of the object to be measured is determined.

13. The method according to any one of claims 1 to 12, characterized in that The receiving end includes a plurality of pixels; The electronic device determines the depth value of the object to be measured based on the reception time of the second crosstalk signal and the reception time of the target signal, including: The electronic device determines the reception time of the preset crosstalk signal corresponding to the first pixel and the reception time of the target signal corresponding to the first pixel, where the first pixel is any one of the plurality of pixels; The electronic device determines the depth value corresponding to the first pixel based on the reception time of the preset crosstalk signal corresponding to the first pixel and the reception time of the target signal corresponding to the first pixel.

14. The method according to claim 13, characterized in that, The electronic device determines the reception time of the preset crosstalk signal corresponding to the first pixel, including: The electronic device determines the reception time of the preset crosstalk signal corresponding to the first pixel based on the envelope shape of the crosstalk signal of one pixel, the intensity distribution of the preset crosstalk signal corresponding to the first pixel, and the envelope position of the preset crosstalk signal corresponding to the first pixel; Wherein, the envelope shape of the crosstalk signal of one pixel, the intensity distribution of the preset crosstalk signal corresponding to the first pixel, and the envelope position of the preset crosstalk signal corresponding to the first pixel are data pre-stored in the electronic device.

15. An electronic device, characterized in that, The electronic device includes a cover plate and a depth detection module disposed below the cover plate; the depth detection module includes a transmitting end and a receiving end; Wherein, the transmitting end is used to transmit a pulse signal; the receiving end is used to receive the pulse signal reflected by the object to be measured and the cover plate; the processor is used to call instructions to enable the electronic device to execute the depth value determination method according to any one of claims 1 to 12; the processor is the main processor in the electronic device connected to the depth detection module, or the processor is a digital signal processor in the depth detection module.

16. The electronic device according to claim 15, characterized in that, The transmitting end includes a pulsed laser and a light scattering element, the pulsed laser is used to transmit the pulse signal, and the light scattering element is used to perform scattering processing on the pulse signal.

17. The electronic device according to claim 15, wherein The receiving end includes a light detection element, a pulse response filter, and an optical receiver. The light detection element is used to converge the received light rays. The pulse response filter is used to filter the converged light rays. The optical receiver is used to convert the filtered light rays into the pulse signal.

18. The electronic device according to claim 17, wherein The optical receiver is a planar array device composed of a plurality of single-photon avalanche diode sensors.

19. The electronic device according to any one of claims 15 to 18, characterized in that The opposite angle of the light beam emitted by the transmitting end is 70°. The opposite angle of the light beam received by the receiving end is 70°. The thickness of the depth detection module in the optical axis direction is 2.48 mm. The distance from the upper surface of the depth detection module to the lower surface of the cover plate is 0.8 mm. The distance from the geometric center of the transmitting end to the geometric center of the receiving end is 4 mm.

20. A chip system, characterized in that, The chip system is applied to an electronic device. The chip system includes one or more processors. The one or more processors are used to call computer instructions to cause the electronic device to execute the method according to any one of claims 1 to 14.

21. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program. When the computer program runs on an electronic device, it causes the electronic device to execute the depth value determination method according to any one of claims 1 to 14.

Citation Information

Patent Citations

  • Method for calibrating a time-of-flight system and time-of-flight system

    CN111133329A

  • Distance measurement method, system and device

    CN112255636A

  • Depth image correction method and device of under-screen camera module and electronic equipment

    CN114745481A

  • Crosstalk detection and compensation

    US20190235049A1

  • Optical sensor and electronic device

    US20200088875A1

Cited By

  • Optical ranging method and device

    CN121028107A