Search

EP-4741873-A1 - DEPTH COMPENSATION METHOD FOR DIRECT TIME OF FLIGHT (DTOF) SENSOR, AND ELECTRONIC DEVICE

EP4741873A1EP 4741873 A1EP4741873 A1EP 4741873A1EP-4741873-A1

Abstract

This application is applicable to the field of computer application technologies, and provides a depth compensation method of a direct time of flight dTOF sensor and an electronic device. The method includes: in response to a trigger operation for a camera application, driving the dTOF sensor to collect raw image data; obtaining a current real drive voltage of a single-photon avalanche diode SPAD in the dTOF sensor; obtaining a current expected drive voltage of the SPAD; and performing depth compensation on the raw image data based on the real drive voltage and the expected drive voltage, to generate a target depth map. Therefore, a depth information deviation caused by a regulation error of a drive voltage of the SPAD is corrected based on a deviation between a real value and a theoretical value of the drive voltage of the SPAD, to improve accuracy of depth information collected by the dTOF sensor, thereby improving distance measurement accuracy of the dTOF sensor.

Inventors

  • LV, Jianming

Assignees

  • Honor Device Co., Ltd.

Dates

Publication Date
20260513
Application Date
20240719

Claims (12)

  1. A depth compensation method of a direct time of flight dTOF sensor, comprising: in response to a trigger operation for a camera application, driving the dTOF sensor to collect raw image data; obtaining a current real drive voltage of a single-photon avalanche diode SPAD in the dTOF sensor; obtaining a current expected drive voltage of the SPAD; and performing depth compensation on the raw image data based on the real drive voltage and the expected drive voltage, to generate a target depth map.
  2. The method according to claim 1, wherein performing depth compensation on the raw image data based on the real drive voltage and the expected drive voltage, to generate the target depth map further comprises: in a shooting process, performing focusing processing based on the target depth map.
  3. The method according to claim 1, wherein the raw image data comprises a raw histogram and metadata corresponding to the raw histogram, and performing depth compensation on the raw image data based on the real drive voltage and the expected drive voltage, to generate the target depth map further comprises: generating a raw depth map based on the raw histogram; and performing depth compensation on the raw depth map based on the real drive voltage and the expected drive voltage, to generate the target depth map.
  4. The method according to claim 1, wherein obtaining the current real drive voltage of the SPAD in the dTOF sensor comprises: sampling an output voltage of a power supply corresponding to the SPAD, to obtain the real drive voltage.
  5. The method according to claim 4, wherein sampling the output voltage of the power supply corresponding to the SPAD, to obtain the real drive voltage comprises: when obtaining a start of frame SOF interrupt sent by the dTOF sensor, creating an analog-to-digital conversion ADC read thread; performing ADC sampling on the output voltage of the power supply by using the ADC read thread, to obtain a current ADC sampled value corresponding to the output voltage of the power supply; and releasing the current ADC sampled value, and determining the real drive voltage based on the ADC sampled value.
  6. The method according to claim 1, wherein obtaining the current expected drive voltage of the SPAD comprises: performing parsing processing on the raw image data to determine a current voltage regulation level of the SPAD; obtaining reference data corresponding to the SPAD; and determining the expected drive voltage based on the voltage regulation level and the reference data.
  7. The method according to claim 6, wherein the raw image data comprises a raw histogram and metadata corresponding to the raw histogram, and performing parsing processing on the raw image data to determine the current voltage regulation level of the SPAD comprises: performing parsing processing on the metadata to determine the voltage regulation level.
  8. The method according to claim 6, wherein the reference data comprises a reference drive voltage, a reference voltage level, and a reference voltage regulation step, and determining the expected drive voltage based on the voltage regulation level and the reference data comprises: determining a current voltage regulation amplitude of the SPAD based on a difference between the voltage regulation level and the reference voltage level and the reference voltage regulation step; and determining the expected drive voltage based on the reference drive voltage and the voltage regulation amplitude.
  9. The method according to any one of claims 1 to 8, wherein performing depth compensation on the raw image data based on the real drive voltage and the expected drive voltage, to generate the target depth map comprises: determining a current drive voltage regulation error of the SPAD based on a difference between the real drive voltage and the expected drive voltage; and performing depth compensation on the raw image data based on the drive voltage regulation error to generate the target depth map.
  10. The method according to claim 9, wherein performing depth compensation on the raw image data based on the drive voltage regulation error to generate the target depth map comprises: determining, based on the drive voltage regulation error and a preset conversion ratio, a depth value error corresponding to the raw image data; and performing depth compensation on the raw image data based on the depth value error to generate the target depth map.
  11. An electronic device, comprising a memory, a processor, and a computer program that is stored in the memory and that is capable of running on the processor, wherein when the processor executes the computer program, the electronic device implements the method according to any one of claims 1 to 10.
  12. A computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by an electronic device, the method according to any one of claims 1 to 10 is implemented.

Description

This application claims priority to Chinese Patent Application No. 202311440945.0, filed with the China National Intellectual Property Administration on October 31, 2023 and entitled "DEPTH COMPENSATION METHOD OF DIRECT TIME OF FLIGHT DTOF SENSOR AND ELECTRONIC DEVICE", which is incorporated herein by reference in its entirety. TECHNICAL FIELD This application pertains to the field of terminal technologies, and in particular, relates to a depth compensation method of a direct time of flight dTOF sensor, an electronic device, and a computer-readable storage medium. BACKGROUND When a direct time of flight (direct time of flight, dTOF) sensor measures a distance, a drive voltage (that is, a VSPAD voltage) of a single-photon avalanche diode (single photon avalanche diodes, SPAD) needs to be dynamically regulated with a temperature change. The dTOF sensor regulates the VSPAD voltage based on an output current (that is, an IDAC current) of a current-type digital-to-analog converter (current-type digital-to-analog converter, IDAC), and different IDAC currents may correspond to different voltage regulation amplitudes. In related technologies, when the VSPAD voltage is regulated, due to an accuracy error of the IDAC current of the dTOF sensor or an output error of a power supply, a deviation may exist between a real value obtained after the VSPAD voltage is regulated and a theoretical value. Therefore, parameters such as a dark count rate (dark-count-rate, DCR) and photon detection efficiency (photon detection efficiency, PDE) of the dTOF sensor are affected. Consequently, a deviation is generated for depth information collected by the dTOF sensor, thereby affecting distance measurement accuracy of the dTOF sensor. SUMMARY Embodiments of this application provide a depth compensation method of a dTOF sensor, an electronic device, and a computer-readable storage medium, to resolve the following problem: When a VSPAD voltage is regulated, due to an accuracy error of an IDAC current of the dTOF sensor or an output error of a power supply, a deviation may exist between a real value obtained after the VSPAD voltage is regulated and a theoretical value, which causes a deviation of depth information collected by using the dTOF sensor, thereby affecting distance measurement accuracy of the dTOF sensor. According to a first aspect, an embodiment of this application provides a depth compensation method of a dTOF sensor, including: in response to a trigger operation for a camera application, driving the dTOF sensor to collect raw image data; obtaining a current real drive voltage of a SPAD in the dTOF sensor; obtaining a current expected drive voltage of the SPAD; and performing depth compensation on the raw image data based on the real drive voltage and the expected drive voltage, to generate a target depth map. In this way, depth compensation is performed, based on the current real drive voltage of the SPAD and the expected drive voltage, on the raw image data collected by the dTOF sensor. Therefore, a depth information deviation caused by a regulation error of a drive voltage of the SPAD is corrected based on a deviation between the real value and a theoretical value of the drive voltage of the SPAD, to improve accuracy of depth information collected by the dTOF sensor, thereby improving distance measurement accuracy of the dTOF sensor. In a possible implementation of the first aspect, after the performing depth compensation on the raw image data based on the real drive voltage and the expected drive voltage, to generate a target depth map, the method further includes: in a shooting process, performing focusing processing based on the target depth map. In this way, focusing processing is performed by using the compensated target depth map in the shooting process, to improve focusing effect during shooting and improve image shooting quality, thereby further improving user experience. Optionally, in another possible implementation of the first aspect, the raw image data includes a raw histogram and metadata corresponding to the raw histogram. Correspondingly, the performing depth compensation on the raw image data based on the real drive voltage and the expected drive voltage, to generate a target depth map includes: generating a raw depth map based on the raw histogram; andperforming depth compensation on the raw depth map based on the real drive voltage and the expected drive voltage, to generate the target depth map. In this way, the raw depth map is generated based on the raw histogram collected by the dTOF sensor, and depth compensation is performed on depth information in the raw depth map based on the deviation between the real drive voltage of the SPAD and the expected drive voltage, thereby further improving accuracy of depth compensation and further improving distance measurement accuracy of the dTOF. Optionally, in still another possible implementation of the first aspect, the obtaining a current real drive voltage