Distance measurement method, distance measurement system, electronic device, and readable storage medium
By dynamically adjusting the histogram time interval width and output power of the DToF sensor, combined with the combination mode, the problem that the DToF sensor cannot take into account both long distance and high-precision distance measurement, achieving low-cost long distance and high-precision distance measurement.
Patent Information
- Application Number
- PCT/CN2024/098747
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-02-19
- Filing Date
- 2024-06-12
- Publication Date
- 2025-08-28
AI Technical Summary
DToF sensors are difficult to take into account both long-distance and high-precision ranging at the same time, and hardware upgrades will increase costs.
By dynamically adjusting the histogram time interval width and output power of the time counting circuit, combined with different combination modes, long-distance and high-precision ranging configurations are achieved.
Without increasing hardware costs, long-distance and high-precision distance measurement of DToF sensors are achieved, reducing power consumption and signal accumulation.
Smart Images

Figure CN2024098747_28082025_PF_FP_ABST
Abstract
Description
Distance detection method, distance measurement system, electronic device and readable storage medium
[0001] Cross-references
[0002] This application refers to Chinese patent application No. 202410184112.0 filed on February 19, 2024, entitled “Distance detection method, ranging system, electronic device and readable storage medium”, which is incorporated into this application in its entirety by reference. Technical Field
[0003] The present application relates to the field of distance measurement technology, and in particular to a distance detection method, a distance measurement system, an electronic device, and a readable storage medium. Background Art
[0004] Direct Time of Flight (DToF) sensor technology is widely used in various devices due to its advantages such as large test range and strong anti-interference. The DToF sensor is based on time-correlated single photon counting technology. The time data converter (TDC) inside it records the time it takes for the light signal (photon) to fly back and forth in space, and thus calculates the distance of the target object based on the recorded time and the known speed of light. Since the size of the memory used by the TDC for time storage counting is limited by the chip area, DToF cannot simultaneously take into account long-distance and high-precision ranging, unless the DToF hardware is upgraded and the hardware storage resources are increased, but this will undoubtedly increase the hardware cost of DToF.
[0005] Summary of the Invention
[0006] In view of the above problems, various aspects of the present application provide a distance detection method, a distance measurement system, an electronic device, and a readable storage medium, so as to achieve the purpose of DToF distance measurement that can take into account both long distance and high precision without upgrading the DToF hardware.
[0007] In a first aspect, the present application provides a distance detection method applicable to an electronic device having a ranging system, wherein the ranging system includes a transmitter, a receiver, and a time counting circuit; the method includes:
[0008] Determining the number of time intervals included in the histogram corresponding to the time counting circuit;
[0009] Based on the number of time intervals, multiple time bit widths of the time counting circuit are combined to obtain multiple combination patterns; wherein the combination patterns include a correspondence between time intervals and time bit widths, and one time interval corresponds to at least one time bit width;
[0010] Dynamically adjust the time interval width of the histogram according to the multiple combination modes and the data representing the ranging requirements;
[0011] Based on the time interval detected by the time counting circuit between each optical signal emitted by the transmitting end in the current frame and reflected by the target object and received by the receiving end, the adjusted histogram is used to count and count each optical signal to form a statistical histogram;
[0012] Determine distance information corresponding to the target object detected in the current frame according to the statistical histogram.
[0013] In a second aspect, the present application provides a ranging system. The ranging system includes:
[0014] A transmitting end, used for transmitting an optical signal;
[0015] A receiving end, for receiving an optical signal;
[0016] a time counting circuit connected to the receiving end, for detecting the time interval between each optical signal being emitted by the transmitting end and being received by the receiving end, and storing the time interval of each optical signal in a storage circuit;
[0017] a storage circuit connected to the time counting circuit, and configured to perform histogram counting statistics on each optical signal according to the time interval of each optical signal;
[0018] The processing circuit is connected to the storage circuit and is used to implement the steps in the distance detection method provided by the present application.
[0019] In a third aspect, the present application provides an electronic device, which includes the ranging system provided by the present application.
[0020] In a fourth aspect, the present application provides a computer-readable storage medium having computer program instructions stored therein; when the computer program instructions are executed by a processor, the steps of the distance detection method provided in the present application are implemented.
[0021] In a fifth aspect, the present application provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the steps in the distance detection method provided by the present application can be implemented.
[0022] The technical solutions provided by various embodiments of the present application include: an electronic device having a ranging system including a transmitter, a receiver, and a time counting circuit. When distance detection is achieved through the ranging system, the number of time intervals included in the histogram corresponding to the time counting circuit is first determined; further, based on the number of time intervals, multiple time bit widths of the time counting circuit are combined to obtain multiple combination modes; each combination mode includes a correspondence between time intervals and time bit widths, with one time interval corresponding to at least one time bit width; thereafter, the time interval width of the histogram can be dynamically adjusted based on the multiple combination modes and data representing the ranging requirements, and based on the time interval between each light signal emitted by the transmitter in the current frame detected by the time counting circuit and then reflected by the target object and received by the receiver, the adjusted histogram is used to count and statistically analyze each light signal; based on the statistical histogram formed by the counting and statistics, the distance information corresponding to the target object detected in the current frame can be determined. Because the time resolution of the time counting circuit in the ranging system is related to the time interval width of the histogram, and the time resolution is related to the ranging accuracy, specifically, time resolution = the time interval width of the histogram (that is, = the number of time bit widths corresponding to the time interval * the time unit represented by one time bit width), and ranging accuracy = the time interval width of the histogram * the speed of light ÷ 2. Therefore, it can be seen that a larger time interval width indicates lower time resolution and ranging accuracy, and conversely, a smaller time interval width indicates higher time resolution and ranging accuracy. In addition, because the maximum ranging distance achievable using a histogram = the product of the time interval width and the number of time intervals in the histogram, when the number of time intervals in the histogram is fixed, a larger time interval width indicates a longer achievable ranging distance, and conversely, a smaller time interval width indicates a shorter achievable ranging distance. Based on the above content, the present application scheme dynamically adjusts the width of each time interval in the histogram during the ranging process, which can actually be understood as dynamically adjusting the time resolution of the time counting circuit in the ranging system. Through this dynamic adjustment, different ranging configurations such as long distance and high precision can be integrated through software in the entire ranging process to achieve diverse ranging without the need for hardware upgrades to the ranging system (more importantly, without the need for hardware upgrades to the storage circuit therein). The ranging cost is low and it also helps to ensure ranging accuracy to a certain extent. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0024] FIG1A is a schematic structural diagram of a DToF sensor provided by an exemplary embodiment of the present application;
[0025] FIG1B is a schematic diagram showing the principle of calculating the distance of a target object by a DToF sensor provided by an exemplary embodiment of the present application;
[0026] FIG2A shows a saturated / clipping situation of a statistical histogram provided by an exemplary embodiment of the present application;
[0027] FIG2B is a schematic diagram of a statistical histogram provided by an exemplary embodiment of the present application in a normal situation;
[0028] FIG3 is a flow chart of the distance detection method provided by the present application;
[0029] 4A to 4C are exemplary diagrams of three combinations of multiple time bit widths of a time counting circuit in a ranging system provided by the present application;
[0030] FIG5 is a schematic diagram of a ranging application scenario provided by this application;
[0031] FIG6A is a schematic structural diagram of an electronic device exemplarily provided in this application;
[0032] FIG6B is a schematic diagram of a specific form of an exemplary electronic device provided in this application. DETAILED DESCRIPTION
[0033] DToF is widely used in various devices, such as smartphones and smart cars, due to its advantages such as large ranging range, strong resistance to complex background interference, fast dynamic response calculation, and high accuracy. The ranging principle of DToF is as follows:
[0034] As shown in Figure 1A, the DToF sensor includes a transmitter Tx, a receiver Rx, a TDC circuit, and a storage circuit (also called a histogram circuit, a statistical circuit, etc.). The storage circuit is a time-correlated single photon counting (TCSPC) circuit, which is used to perform histogram counting statistics on each photon based on the time interval from the emission to the reception of each photon to form a statistical histogram. A transmitter Tx emits a light beam (e.g., visible light, infrared light, ultraviolet light, etc.). At least a portion of the photons in the transmitted light beam strikes a target object, where they are reflected to form a reflected light beam. At least a portion of the photon signals in the reflected light beam are received by a receiver Rx. Each individual photon in at least a portion of the photons strikes an avalanche photodiode (SPAD), triggering an avalanche. The SPAD outputs an avalanche signal to a time-dependent diode (TDC) circuit. The TDC circuit then detects the time interval between each photon's emission from the transmitter Tx and the triggering of the avalanche. The time interval is then sent to a storage circuit, which then performs a histogram counting operation based on the time intervals. For example, if the time interval of a detected photon falls within time bin 5 in the histogram, an increment operation is performed on time bin 5 (i.e., the length (height) of the bar corresponding to time bin 5 is increased by one), resulting in a corresponding photon count. Based on the statistical histogram formed by counting statistics, the time corresponding to the peak (the time with the highest frequency of occurrence) can be determined. Therefore, based on the time corresponding to the peak, the target time t required for the light beam to be emitted by the transmitter Tx and received by the receiver Rx can be determined. The target time t is the flight time between the emitted light beam and the reflected light beam. Therefore, based on the target time t and the known speed of light c, the distance d of the target object can be calculated, as shown in Figure 1B, that is: d = (c*t) / 2, c = 3*10 8 m / s.
[0035] The above-mentioned histogram is constructed within the storage circuit corresponding to the TDC circuit. Specifically, the storage circuit includes a memory, and the histogram is constructed within the memory. The bin depth (i.e., the number of time intervals (bins)) and the maximum count value corresponding to each bin in the histogram are determined by the storage space size of the memory. For example, the storage space of the memory is (6*10) bits, where 6 bits correspond to the bin depth. Specifically, 6 bits correspond to a bin depth of 64, and 10 bits are the maximum count value (or peak count value) for each bin. Therefore, it can be understood that when the storage space of the memory is (6*10) bits, the constructed histogram can include 64 time intervals, and the maximum count value corresponding to each time interval is 10 bits (which can be simply understood as the maximum length of the bar corresponding to each time interval). The width and number of time intervals in the histogram determine the minimum and maximum time range that can be detected, thereby affecting the ranging accuracy and maximum ranging range. Continuing with the above example, if the required ranging range is 5000mm, the ranging accuracy corresponding to each bin in the histogram is 5000 / 64=78.125mm, that is, the time interval width of each bin is the ratio of 2*78.125mm to the speed of light c (i.e. 2*78.125mm / speed of light c). Although this can measure far distances, the ranging accuracy is low; and if the ranging accuracy corresponding to the bin is required to be 25mm, that is, the time interval width of the bin is required to be the ratio of 2*25mm to the speed of light c, then the farthest ranging range that can be achieved is 25*64=1600mm, which can ensure high ranging accuracy but small ranging. From the above, it is obvious that the ranging distance and ranging accuracy that DToF can take into account are limited by the storage space size of the memory, and the storage space size of the memory is restricted by the chip area. Therefore, without upgrading the hardware of the memory chip, DToF cannot take into account both long-distance ranging and high-precision ranging.
[0036] It is understood that the symbol “*” appearing in the context of this application represents a multiplication operation.
[0037] Furthermore, the required output power of the transmitter (Tx) varies depending on the distance and reflectivity of the target object being measured. For example, when measuring distant or low-reflectivity targets, high output power is required to achieve statistically significant histogram results. This is because: a high Tx output power results in a higher energy beam, enabling greater penetration of dust, fog, and other particles, and enabling a longer illumination distance. Furthermore, the beam contains more high-energy photons. This ensures that at least some photons will not be absorbed by the target object, but will instead be reflected back. The reflected photon signals are stronger and can be received by the receiver (Rx). However, high output power also increases power consumption and temperature. Furthermore, when measuring close-range or highly reflective targets, if the output power remains high, the photon signals received by the receiver Rx will experience accumulation or saturation, as shown in Figure 2A. This will distort the ranging signal and result in large ranging errors, or even the inability to sense the signal for a certain period of time, making ranging impossible. Low output power avoids the accumulation or saturation shown in Figure 2A, resulting in a normal statistical histogram of the photon information received by the receiver Rx, as shown in Figure 2B. This shows that low output power is more conducive to measuring close-range or highly reflective targets, while also helping to reduce power consumption and temperature rise.
[0038] In summary, when using DToF to achieve ranging, the solution adopted by this application is to dynamically adjust the time resolution of the TDC to integrate different ranging configurations such as long distance and high precision, and match the appropriate output power to avoid signal accumulation or saturation caused by output power redundancy, while also helping to reduce power consumption. Among them, TDC resolution refers to the minimum time that can be distinguished, such as the interval width of each bin in the aforementioned histogram.
[0039] To make the purpose, technical solutions, and advantages of this application more clear, the technical solutions of this application will be clearly and completely described below in conjunction with the specific embodiments of this application and the corresponding drawings. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0040] In the embodiments of the present application, in order to facilitate the clear description of the technical solutions of the embodiments of the present application, words such as "first" and "second" are used to distinguish between identical items or similar items with substantially the same functions and effects. For example, the first signal generating circuit and the second signal generating circuit are merely used to distinguish different signal generating circuits and do not limit their order. Those skilled in the art will understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily mean that they are different.
[0041] It should be noted that, in this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design scheme described in this application as "exemplary" or "for example" should be interpreted as being more preferred or more advantageous than other embodiments or design schemes. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete way. In addition, "at least one" in this application refers to one or more, and "plurality" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, B exists alone, wherein A and B can be singular or plural, etc. The character " / " generally indicates that the previous and subsequent associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b and c can represent: a, b, c, a, b and c, a and b, a and c, b and c.
[0042] The following describes in detail the technical solutions provided by various embodiments of the present application in conjunction with the accompanying drawings.
[0043] Figure 3 shows a flow chart of a distance detection method provided in one embodiment of the present application. The method is performed by an electronic device having a distance measurement system. The electronic device may be, but is not limited to, a smartphone (such as a foldable screen phone or a candy bar phone), a laptop computer, a tablet computer, and an in-vehicle lidar. The distance measurement system includes a transmitter, a receiver, and a time counting circuit; further, the distance measurement system may also include a storage circuit. The time counting circuit is used to detect the time interval between each optical signal being emitted by the transmitter and received by the receiver, and to store the time interval of each optical signal in the storage circuit for histogram statistics. In a specific implementation, the distance measurement system is a DToF sensor system, and the time counting circuit is a TDC circuit in a DToF sensor as shown in Figure 1A. For a detailed description of the operating principles of each terminal and circuit in the distance measurement system, please refer to the DToF sensor described above in conjunction with Figure 1A. It should be noted that in addition to the terminals and / or circuits described above, the distance measurement system may also include other circuits, such as a processing circuit, which can control the transmitter to emit a light beam containing multiple optical signals and analyze the statistical results of the histogram to determine the corresponding detected distance information. Therefore, more specifically, the distance detection method provided in this embodiment can be executed by a processing circuit in a distance measurement system. It should be noted that the optical signal described in this embodiment can also be understood as the aforementioned photon, but different description methods are used in different embodiment scenarios.
[0044] As shown in FIG3 , the distance detection method includes the following steps:
[0045] 101. Determine the number of time intervals included in the histogram corresponding to the time counting circuit;
[0046] 102. Based on the number of time intervals, combine multiple time bit widths of the time counting circuit to obtain multiple combination patterns; wherein the combination patterns include a correspondence between time intervals and time bit widths, and one time interval corresponds to at least one time bit width;
[0047] 103. Dynamically adjust the time interval width of the histogram according to multiple combination modes and data representing ranging requirements;
[0048] 104. Based on the time intervals detected by the time counting circuit between the optical signals transmitted by the transmitting end in the current frame and reflected by the target object and received by the receiving end, count and count the optical signals using the adjusted histogram to form a statistical histogram;
[0049] 105. Determine distance information corresponding to the target object detected in the current frame according to the statistical histogram.
[0050] In the above 101, the histogram is created in the storage circuit in the ranging system, so specifically: the storage space information of the storage circuit can be obtained, and the number of time intervals included in the histogram is determined according to the storage space information of the storage circuit.
[0051] The storage circuit includes a memory, which may be, but is not limited to, a random access memory (RAM), and directly exchanges data with a processing circuit in the ranging system.
[0052] Accordingly, the storage space information of the storage circuit may refer to the storage space size of the memory in the storage circuit. The storage space size is related to the memory chip area. When the memory chip area is fixed, the storage space size of the memory is also fixed. The storage space size of the memory corresponds to the number of time intervals (bins) of the histogram and the maximum count value corresponding to each time interval. For example, the storage space size of the memory is (6*10) bits, which represents that the corresponding histogram includes 64 time intervals, and the maximum count value corresponding to each time interval is 10 bits, or in other words, the maximum length of the bar corresponding to each time interval is 10 bits.
[0053] Based on the number of time intervals included in the histogram, the multiple time bit widths of the time counting circuit can be flexibly combined to implement different ranging configurations. For example, ranging configurations such as long-distance ranging with low ranging accuracy and short-distance ranging with high ranging accuracy can be implemented. A time bit width represents a time unit. For example, the time unit represented by a time bit width can be, but is not limited to, 500 ps, 600 ps, etc., where ps represents picoseconds.
[0054] For example, the number of time intervals included in the histogram is 2 3 =8, the time bit width of the time counting circuit is 2 5 =32, and a time unit represented by a time bit width is 500ps as an example, then:
[0055] For example, referring to FIG4A , the first combination mode for realizing long-distance ranging is shown, in which every four time bit widths are combined to correspond to a time interval. In this case, the interval width of each time interval is 500 ps*4=2000 ps (or the width of the bar corresponding to each time interval is 2000 ps, that is, the time resolution of the time counting circuit is 2000 ps), and the ranging depth corresponding to each time interval is [2000 ps*(3*10 8)m / s] / 2=0.3m=300mm (that is, the ranging accuracy of the ranging sensor is 300mm). The ranging range corresponding to the histogram is 0~2400mm (300mm*8). It can be seen that in this first combination mode, the normal peak shape of the histogram can be achieved when measuring a target object at a longer distance, but the ranging accuracy is low.
[0056] For example, referring to FIG4B , the second combination mode for realizing close-range ranging is to correspond the time bit width to the time interval one by one. In this case, the interval width of each time interval is 500 ps (that is, the time resolution of the time counting circuit is 500 ps), and the ranging depth corresponding to each time interval is [500 ps*(3*10 8 )m / s] / 2=75mm (that is, the ranging accuracy of the ranging sensor is 75mm), and the ranging range corresponding to the histogram is 0~600mm (75mm*8). It can be seen that in this second combination mode, the normal peak shape of the histogram of the target object at a relatively close distance can be achieved, and the ranging accuracy is also relatively high.
[0057] For another example, referring to FIG4C , the third combination mode for realizing medium distance ranging is to combine two time bit widths into a time interval. In this case, the width of each time interval is 500 ps*2=1000 ps (i.e., the time resolution of the time counting circuit is 1000 ps), and the ranging depth corresponding to each time interval is [1000 ps*(3*10 8 )m / s] / 2=0.15m=150mm (that is, the ranging accuracy of the ranging sensor is 150mm), and the ranging range corresponding to the histogram is 0~1200mm (150mm*8).
[0058] Based on the above example content, in the above 102, the multiple combination modes include: a first combination mode and a second combination mode; the number of time widths corresponding to a time interval in the first combination mode is greater than the number of time widths corresponding to a time interval in the second combination mode. The first combination mode is shown in FIG4A, and the second combination mode is shown in FIG4B. Of course, in addition to these, other combination modes may also be included, such as a third combination mode, in which the number of time widths corresponding to a time interval in the third combination mode is greater than the number of time widths corresponding to a time interval in the second combination mode, and less than the number of time widths corresponding to a time interval in the first combination mode, as shown in FIG4C.
[0059] In combination with the data that characterizes the ranging requirements, such as the frame identifier corresponding to the light signal that the transmitter currently needs to transmit, the attribute information of the camera used in conjunction with the ranging sensor, etc., an adapted combination mode can be selected from a plurality of combination modes to adjust the time interval width of the histogram. In specific implementation, you can first select one of the first combination mode and the second combination mode to preliminarily adjust the time interval width of the histogram; then, in the subsequent detection process, combine other data information (such as the reflectivity and distance of the target object) to continue to make real-time dynamic adjustments. Based on this, in a specific implementable solution, the above 103 "dynamically adjust the time interval width of the histogram according to the plurality of combination modes and the data that characterizes the ranging requirements" can be implemented by the following steps:
[0060] 1031. Select a combination mode from the first combination mode and the second combination mode according to at least one of a frame number corresponding to the optical signal currently to be transmitted by the transmitting end and attribute information of a camera used in conjunction with the ranging sensor;
[0061] 1032. Adjust the time interval width of the histogram according to the number of time bit widths corresponding to a time interval in a selected combination mode and a time unit represented by the time bit width.
[0062] In the above 1031, the frame number indicates the frame number of the light beam emitted by the transmitter. Specifically, the light beam is emitted by a laser light source in the transmitter, and a light beam often contains multiple light signals (photons). Camera attribute information may include, but is not limited to, focal length, aperture value, and pixels. Depending on the parity of the frame number and whether the camera attribute information meets the requirements, the first or second combination mode can be selected to adjust the time interval width of the histogram.
[0063] For example, when the frame number is even, the first combination mode can be selected, that is, the combination mode for achieving long-distance ranging; conversely, when the frame number is odd, the second combination mode can be selected, that is, the combination mode for achieving short-distance and high-precision ranging, thereby integrating long-distance and high-precision ranging. Alternatively, of course, when the frame number is odd, the first combination mode can be selected; conversely, when the frame number is even, the second combination mode can be selected.
[0064] For example, if the camera used with the ranging sensor is a telephoto camera (a telephoto camera with a focal length greater than the set focal length threshold, such as a camera with a focal length greater than 50mm, primarily used to magnify distant objects), the first combination mode can be selected. If the camera is a macro camera or a main camera, the second combination mode can be selected. A macro camera is a camera with a focal length less than or equal to the set focal length threshold. The main camera generally refers to the most important camera in an electronic device's camera module, possessing the highest resolution, largest number of pixels, and largest aperture value.
[0065] Therefore, in some examples, the above step 1031 of "selecting a combination mode from the first combination mode and the second combination mode based on at least one of the frame number corresponding to the optical signal currently required to be transmitted by the transmitting end and the attribute information of the camera used in conjunction with the ranging sensor" may include:
[0066] If the frame number is an even number and / or the camera attribute information meets the preset requirements, the first combination mode is selected;
[0067] If the frame number is an odd number or the camera attribute information does not meet the preset requirements, the second combination mode is selected;
[0068] The camera attribute information meeting the preset requirements includes, but is not limited to, at least one of the following: focal length greater than a set focal length threshold, pixels less than or equal to a set pixel threshold, aperture value less than or equal to a set aperture threshold, and resolution less than or equal to a set resolution threshold. The camera attribute information not meeting the requirements includes, but is not limited to, at least one of the following: focal length less than or equal to a set focal length threshold, pixels greater than a set pixel threshold, aperture value greater than a set aperture threshold, and resolution greater than a set resolution threshold, etc.
[0069] In the above 1032 , the product value of the number of time bit widths corresponding to a time interval in a selected combination mode and a time unit represented by the time bit width can be determined first, and then the time interval width of the histogram can be adjusted to the product value.
[0070] Furthermore, after the adjustment is completed, when controlling the output power of the transmitter, the maximum ranging distance represented by the histogram can be used to follow the principle that long-distance ranging requires high output power and short-distance ranging requires low output power. This can control the light source in the transmitter to emit a light beam containing multiple optical signals at a certain output power, thereby avoiding the phenomenon of saturation of the histogram shown in Figure 2A caused by output power redundancy, and at the same time achieving the purpose of reducing power consumption. Therefore, between the above steps 103 and 104, the method provided in this embodiment can also include the following steps:
[0071] S1. Determine the maximum ranging distance represented by the adjusted histogram according to the adjusted time interval width and the number of time intervals of the histogram;
[0072] The maximum distance represented by the histogram = the time interval width of the histogram * the number of corresponding time intervals * the speed of light c ÷ 2, where the speed of light c = 3 * 10 8 m / s.
[0073] S2. If the maximum ranging distance is greater than the set distance threshold, control the transmitting end to transmit the optical signal at a first output power W1; if the maximum ranging distance is less than or equal to the set distance threshold, control the transmitting end to transmit the optical signal at a second output power W2; the second output power W2 is less than the first output power W1.
[0074] In the above 104-105, the time counting circuit can record the time t0 of each optical signal transmitted in the current frame and the time t1 when it is received by the receiving end (such as the time that causes the SPAD avalanche in the receiving end), and calculate the time difference between the time t1 and the time t0 of each optical signal, thereby determining the time interval corresponding to each optical signal, and storing the time interval corresponding to each optical signal in the storage circuit connected thereto. Through the storage circuit, based on the time interval corresponding to each optical signal, the adjusted histogram can be used to count and count each optical signal. After completing the statistics for each optical signal in the current frame, a statistical histogram can be formed. Peak search of the statistical histogram can determine the peak value, and the time corresponding to the peak value is determined as the target time. Therefore, the product of half of the target time and the speed of light c is the distance between the target object and the electronic device detected in the current frame.
[0075] Furthermore, the method may further comprise the following steps:
[0076] 106. Determine, based on the object information of the target object, whether the time interval width of the histogram and / or the output power of the transmitter need to be adjusted for the next frame detection;
[0077] 107. When necessary, select an adapted combination mode from the multiple combination modes according to the object information to adjust the time interval width of the histogram and / or reduce or increase the output power of the transmitting end;
[0078] The object information includes: distance information of the target object detected in the current frame, and reflectivity of the target object to light signals.
[0079] The reflectivity of the target object to photons can also be determined based on the histogram counting statistics of the current frame. That is, before step 106, the method can further include the following step: determining the reflectivity of the target object to the light signal based on the statistical histogram.
[0080] For example, if the statistical histogram formed ultimately determines that the total number of optical signals counted is greater than or equal to a set threshold, and the statistical histogram, as shown in FIG2A , exhibits saturation or clipping, this indicates that a large number of optical signals are reflected from the target object, i.e., the target object has a high reflectivity for the optical signals. If the statistical histogram, as shown in FIG2B , is normal, this indicates that the target object has a moderate reflectivity for the optical signals. If the statistical histogram determines that the total number of optical signals received is less than the set threshold, this indicates that the target object has a low reflectivity for the optical signals.
[0081] When the reflectivity of the target object is high or low, it may be determined that the output power of the transmitter needs to be adjusted to appropriately reduce or increase the output power.
[0082] If the distance between the currently detected target object and the ranging sensor is much smaller or much larger than the maximum ranging range represented by the histogram corresponding to the current frame, it can be determined that the time interval width of the histogram needs to be adjusted.
[0083] In order to facilitate understanding of the present application solution, a specific application scenario is given below. In the following application scenario, the number of time intervals included in the histogram corresponding to the ranging system is 8, and the number of time bit widths of the time counting circuit is 32 is taken as an example.
[0084] As shown in Figure 5 , assuming that a smartphone includes multiple cameras and a ranging system (a DToF sensor system, not shown in the figure), the ranging system is used in conjunction with a telephoto camera among the multiple cameras. Initially, the ranging configuration set for the ranging system is: for even frames, according to the first combination mode shown in Figure 4A (the four time bit widths are combined and correspond to one time interval), the interval width of each time interval in the histogram is adjusted to the product value of 4 and the time unit represented by the time bit width, such as 4*500ps=2000ps. At this time, the ranging range corresponding to the histogram is, for example, 0 to 2400mm; and the output power set for the transmitter in the ranging system is the first output power (high power). According to the above ranging configuration, the ranging sensor is controlled to perform distance detection for the 0th frame. The distance detection in frame 0 indicates that the target smartphone is 1000mm away (much less than 2400mm) and has high reflectivity (as determined by saturation in the statistical values of the third time interval in the histogram). This indicates that the distance measurement configuration needs to be adjusted for the next frame (frame 1). When determining the corresponding combination mode for the next frame, the combination mode with the smallest difference between the maximum distance measured in the histogram and the currently detected distance can be selected to adjust the width of each time interval in the histogram. For example, the maximum ranging distance represented by the histogram corresponding to the third combination mode shown in FIG4C is 1200 mm, which has the smallest difference from the above-mentioned detected distance of 1000 mm. Based on this third combination mode (i.e., the two time bit widths are combined to correspond to a time interval), for the next frame, the interval width of each time interval in the histogram can be adjusted to the product value of 2 and the time unit represented by a time bit width, such as adjusted to 2*500ps=1000ps; in addition, due to the high reflectivity of the target object, the output power of the transmitter needs to be reduced when performing the distance detection of the next frame, such that the output power of the transmitter in the next frame is the third output power, which is less than the first output power and greater than the aforementioned second output power (as shown in FIG4B ). Based on this adjusted ranging configuration, when performing the first frame of distance detection, the time resolution of the time counter circuit in the ranging sensor (such as the TDC circuit shown in Figure 1A) will be improved. Specifically, the time resolution will be increased from 2000 ps to 1000 ps. Correspondingly, the ranging accuracy will also be improved from 300 mm to 150 mm. Ranging accuracy = half the time resolution multiplied by the speed of light. In addition, the output power of the transmitter is reduced, which also reduces power consumption.
[0085] In summary, the distance detection solution provided by the present application can achieve different ranging configurations such as long distance and high precision by dynamically adjusting the time resolution of the time counting circuit in the ranging sensor without the need to upgrade the hardware of the ranging sensor. Moreover, at the same time, the transmitting end in the ranging sensor transmits the optical signal with an adapted output power, which can avoid the histogram saturation phenomenon caused by output power redundancy and help reduce power consumption.
[0086] The present application also provides a ranging system, which is a ranging system based on direct time of flight. Its structure can be seen in the system structure of the DToF sensor shown in Figure 1A. Specifically, the ranging system includes:
[0087] Transmitter Tx, used to transmit optical signals;
[0088] The receiving end Rx is used to receive the optical signal;
[0089] a time counting circuit connected to the receiving end Rx, for detecting the time interval between each optical signal being sent from the transmitting end and being received by the receiving end, and storing the time interval of each optical signal in the storage circuit;
[0090] a storage circuit connected to the time counting circuit, and configured to perform histogram counting statistics on each optical signal according to the time interval of each optical signal;
[0091] The processing circuit is connected to the storage circuit and is configured to implement the steps of the distance detection method provided in other embodiments of the present application. Furthermore, the processing circuit is also connected to the transmitter Tx and is configured to control the light source in the transmitter Tx to emit a light beam containing multiple optical signals. The time counting circuit may be a TDC circuit.
[0092] For detailed description of the functions of the above terminals / circuits, please refer to the relevant content in other embodiments of this application.
[0093] The above-mentioned ranging system is deployed on the corresponding electronic device. As shown in some example forms of electronic devices shown in Figure 6B, the electronic device can be, for example, a smartphone (such as a foldable phone, a candy bar phone), a tablet, a laptop computer, in addition to a drone, a vehicle-mounted laser radar, etc. Based on this, the present application also provides an electronic device that includes the ranging system provided in other embodiments of the present application.
[0094] For example, FIG6A is a schematic diagram of the structure of an electronic device. The ranging system may be a distance sensor included in the electronic device, more specifically, a DToF sensor. In addition, the electronic device 100 may further include: a memory 121 and a processor 110;
[0095] The memory storage 121 is used to store programs. Specifically, the memory storage 121 can be used to store computer executable program codes, and the executable program codes include instructions. The memory storage 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device (such as audio data, a phone book, etc.), etc. In addition, the memory storage 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the electronic device 100 by running instructions stored in the memory storage 121, and / or instructions stored in a memory provided in the processor.
[0096] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.
[0097] The processor can generate operation control signals based on instruction opcodes and timing signals to complete the control of instruction fetching and execution.
[0098] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.
[0099] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface.
[0100] Furthermore, in addition to the functional components described above, as shown in Figure 6A, the electronic device 100 also includes: an external memory interface 120, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.
[0101] Among them, the sensor module 180 can include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0102] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0103] Furthermore, it should be understood that the interface connection relationships between the modules illustrated in the embodiments of the present application are merely illustrative and do not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods from those in the above embodiments, or a combination of multiple interface connection methods.
[0104] Electronic device 100 implements display functionality through a GPU (Graphics Processing Unit), display screen 194, and an application processor. The GPU connects display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.
[0105] Display screen 194 is used to display images, videos, and the like. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-oLed, or a quantum dot light-emitting diode (QLED). In some embodiments, electronic device 100 may include one or N display screens 194, where N is a positive integer greater than one.
[0106] The electronic device 100 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.
[0107] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, and then passes the electrical signal to the ISP for conversion into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.
[0108] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. This allows electronic device 100 to play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, and MPEG4.
[0109] The NPU is a neural network (NN) computing processor. Drawing on the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it rapidly processes input information and can continuously self-learn. The NPU can enable intelligent cognitive applications in electronic device 100, such as image recognition, face recognition, speech recognition, and text comprehension.
[0110] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 via the external memory interface 120 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.
[0111] An embodiment of the present application further provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a computer, can implement one or more steps in any of the above methods.
[0112] The computer readable storage medium may be a non-transitory computer readable storage medium, for example, a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
[0113] Another embodiment of the present application further provides a computer program product comprising instructions, which, when executed by a computer, can implement one or more steps in any of the above methods.
[0114] Among them, the electronic device, computer-readable storage medium, and computer program product provided in this embodiment are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be repeated here.
[0115] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0116] Units described as separate components may or may not be physically separate, and components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0117] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0118] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0119] The above content is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.
Claims
1. A distance detection method, characterized in that: Applied to electronic equipment, the method includes: Obtaining the frame identifier corresponding to the optical signal currently to be transmitted; If the frame identifier is an even number, the electronic device uses the first combination mode to perform distance detection; If the frame identifier is an odd number, the electronic device uses the second combination mode to perform distance detection; The first combination mode and the second combination mode have different ranging ranges and ranging accuracies.
2. The method according to claim 1, characterized in that The output power of the optical signal transmitted by the electronic device corresponding to the first combination mode is greater than the output power of the optical signal transmitted by the electronic device corresponding to the second combination mode; Alternatively, the output power of the optical signal transmitted by the electronic device corresponding to the first combination mode is smaller than the output power of the optical signal transmitted by the electronic device corresponding to the second combination mode.
3. The method according to claim 1, characterized in that The ranging range of the first combination mode is greater than the ranging range of the second combination mode, and the ranging accuracy of the first combination mode is less than the ranging accuracy of the second combination mode; Alternatively, the ranging range of the first combination mode is smaller than the ranging range of the second combination mode, and the ranging accuracy of the first combination mode is greater than the ranging accuracy of the second combination mode.
4. The method according to any one of claims 1 to 3, characterized in that Also includes: Determining a maximum ranging distance of the electronic device according to the ranging range of the combined mode used; If the maximum ranging distance is greater than a set distance threshold, the electronic device transmits an optical signal at a first output power; If the maximum ranging distance is less than or equal to the set distance threshold, the electronic device transmits an optical signal at a second output power; wherein the second output power is less than the first output power.
5. A distance detection method, characterized in that: Applied to electronic equipment, the method includes: Acquiring attribute information of a camera used in conjunction with a ranging function of the electronic device; If the attribute information indicates that the camera is in telephoto mode, the first combination mode is used for distance detection; If the attribute information indicates that the camera is in macro mode, the second combination mode is used for distance detection; The first combination mode and the second combination mode have different ranging ranges and ranging accuracies.
6. The method according to claim 5, characterized in that The output power of the optical signal transmitted by the electronic device corresponding to the first combination mode is greater than the output power of the optical signal transmitted by the electronic device corresponding to the second combination mode; Alternatively, the output power of the optical signal transmitted by the electronic device corresponding to the first combination mode is less than the output power of the optical signal transmitted by the electronic device corresponding to the second combination mode; Wherein, the electronic device uses the emitted light signal to perform distance detection.
7. The method according to claim 5, characterized in that The ranging range of the first combination mode is greater than the ranging range of the second combination mode, and the ranging accuracy of the first combination mode is less than the ranging accuracy of the second combination mode; Alternatively, the ranging range of the first combination mode is smaller than the ranging range of the second combination mode, and the ranging accuracy of the first combination mode is greater than the ranging accuracy of the second combination mode.
8. The method according to any one of claims 5 to 7, characterized in that Determining a maximum ranging distance of the electronic device according to the ranging range of the combined mode used; If the maximum ranging distance is greater than a set distance threshold, the electronic device transmits an optical signal at a first output power; If the maximum ranging distance is less than or equal to the set distance threshold, the electronic device transmits an optical signal at a second output power; wherein the second output power is less than the first output power.
9. An electronic device, characterized in that: It comprises a distance measuring system; the distance measuring system comprises a transmitting end and a processing circuit, the transmitting end is used to transmit an optical signal, and the processing circuit is used to implement the distance detection method according to any one of claims 1 to 4 above.
10. An electronic device, characterized in that: The device comprises a camera and a distance measuring system; the camera comprises a telephoto mode and a macro mode; the distance measuring system comprises a processing circuit, and the processing circuit is used to implement the distance detection method according to any one of claims 5 to 8.
11. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a computer, the distance detection method according to any one of claims 1 to 4 or claims 5 to 8 can be implemented.
12. A computer program product, characterized in that The invention comprises a computer program, which, when executed by a processor, enables the processor to implement the distance detection method according to any one of claims 1 to 4 or claims 5 to 8.
Citation Information
Patent Citations
Laser ranging method with high accuracy and low power consumption and device thereof
CN101655563A
Video generation method, device and equipment
CN112954212A
TOF histogram dynamic range expansion method and application thereof
CN115546079A
DDoF ranging method, system and device
CN115792936A
DTOF sensor, distance measuring method, laser receiving module and distance measuring device
CN117434521A