Ranging method and system
Patent Information
- Application Number
- CN202311390221.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-24
- Publication Date
- 2026-08-21
- Estimated Expiration
- 2043-10-24
AI Technical Summary
[0006]鉴于上述问题,本发明的目的在于提供一种测距方法及系统,能够解决现有DTOF技术中在量程范围大和测量精度高情况下需要大量存储资源,从而导致占用芯片大部分的面积的问题
[0020]本申请中将原本应该在较高精度下存储的多个预设数据箱内的测距数据,合并存储在较低精度的一个实际数据箱中,从而实现将较大数量的预设数据箱内的测距数据存储在较小数量的实际数据箱中,使得存储测距数据所需的存储条目的数量减少,不仅可以节省存储空间,还可以降低硬件要求,提高测量速度,提高对被测目标物体的测量效率。
Smart Images

Figure CN117310728B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of ranging technology, and more specifically, to ranging methods and systems. Background Technology
[0002] Direct time of flight (DTOF) technology is a distance sensing technology based on the principle of time-of-flight measurement. Compared with other time-of-flight measurement technologies, it has advantages such as wide ranging range, high accuracy, low cost, and good anti-interference ability, and is widely used in fields such as human-computer interaction, smart homes, autonomous driving, and robotics.
[0003] The components used in DTOF include at least a laser, a detector, and a time-to-digital converter (TDC). The detector's photosensitive element is typically a single-photon avalanche diode (SPAD). The laser emits short pulses of light that illuminate the object being measured; a portion of the laser light is reflected and received by the detector. The TDC records the times of emission and reception of the light pulses, calculates the round-trip time t of the light in the air, and then determines the distance to the object, s = c * t / 2, where c is the speed of light.
[0004] DTOF (Direct Time-of-Flight) obtains ranging data by repeatedly measuring the flight time of light pulses. This data is then statistically plotted into a histogram. By identifying peak values in the histogram, the horizontal axis of the peak value is determined as the photon flight time reflecting the distance to the target object, thus calculating the target object's distance. The storage space required for the ranging data depends on the number and width of the bars in the histogram. The measurement accuracy of the Time-of-Flight Distance (TDC) determines the number and width of the bars in the histogram. Higher TDC measurement accuracy results in smaller time / distance widths represented by each bar in the histogram, leading to more bars within the same measurement range and consequently, more storage entries required.
[0005] Existing DTOF systems require a large amount of storage resources to achieve a wide measurement range and high measurement accuracy, which results in them occupying most of the chip area. Summary of the Invention
[0006] In view of the above problems, the purpose of this invention is to provide a ranging method and system that can solve the problem that existing DTOF technology requires a large amount of storage resources when the range is large and the measurement accuracy is high, thus occupying most of the chip area.
[0007] According to a first aspect of the present invention, a ranging method is provided, comprising: acquiring a mapping relationship between the serial numbers of a plurality of actual data boxes and the serial numbers of a preset data box, wherein each actual data box maps to at least one preset data box; acquiring ranging data, allocating storage space for the actual data boxes and storing the ranging data; determining a target data box and the serial number of the target data box based on the data distribution of the ranging data in the plurality of actual data boxes; determining a target value of the preset data box corresponding to the target data box according to a preset algorithm based on the mapping relationship between the serial numbers of the actual data boxes and the serial numbers of the preset data boxes; and determining the distance of the target being measured based on the target value of the preset data box and the width of the preset data box.
[0008] In some alternative schemes, the number of preset data boxes mapped to each actual data box is the same.
[0009] In some alternative schemes, the number of preset data boxes mapped to at least some of the actual data boxes is different.
[0010] In some alternative schemes, as the serial number of the actual data box increases, the number of preset data boxes mapped to the actual data box gradually increases.
[0011] In some alternative schemes, the difference in the number of preset data boxes mapped to any two adjacent actual data boxes is the same.
[0012] In some alternative schemes, the number of preset data boxes mapped to the actual data boxes increases in a stepwise manner as the serial number of the actual data boxes increases.
[0013] In some optional schemes, determining the target value of the preset data box corresponding to the target data box according to the preset algorithm includes: taking any one of the serial numbers of the preset data boxes mapped by the target data box as the target value.
[0014] In some optional solutions, determining the target value of the preset data box corresponding to the target data box according to the preset algorithm includes: taking the last index of the preset data box number mapped by the target data box as the target value.
[0015] In some optional schemes, determining the target value of the preset data box corresponding to the target data box according to a preset algorithm includes: taking the median value of the sequence number of the preset data box mapped by the target data box as the target value.
[0016] In some optional schemes, determining the target value of the preset data box corresponding to the target data box according to a preset algorithm includes: taking the average value of the serial numbers of the preset data boxes mapped to the target data box as the target value.
[0017] In some optional schemes, the mapping relationship between the serial numbers of multiple actual data boxes and the serial numbers of preset data boxes includes at least a first mapping relationship and a second mapping relationship. The same actual data box is mapped to the same number of preset data boxes under the first mapping relationship and the second mapping relationship, and the serial number part of the mapped preset data boxes is the same.
[0018] In some alternative schemes, based on the first mapping relationship and the second mapping relationship, a first storage space and a second storage space are allocated to the actual data boxes respectively; the ranging data is stored in the first storage space and the second storage space respectively; the ranging data in each actual data box under the first storage space and the second storage space are compared to determine the sequence number of the target data box under the first mapping relationship or the second mapping relationship.
[0019] According to another aspect of the present invention, a ranging system is provided, comprising a laser, a detector, a time-to-digital converter, a processor, and a memory, wherein the processor is used in the ranging method described above. Beneficial effects:
[0020] In this application, the ranging data that should have been stored in multiple preset data boxes at a higher precision is merged and stored in a single actual data box at a lower precision. This allows the ranging data from a larger number of preset data boxes to be stored in a smaller number of actual data boxes, reducing the number of storage entries required to store the ranging data. This not only saves storage space but also reduces hardware requirements, increases measurement speed, and improves the measurement efficiency of the target object.
[0021] Furthermore, as the sequence number of the actual data box increases, the number of preset data boxes mapped to the actual data box gradually increases, which can be applied to ranging needs at different distances. When the target object is close to the ranging device, the sequence number of the actual data box corresponding to the target data box and the preset data boxes nearby is smaller. The smaller the sequence number of the actual data box, the fewer the number of preset data boxes it maps to, resulting in higher ranging accuracy at close range and improving the accuracy of close-range ranging. When the target object is far from the ranging device, the sequence number of the actual data box corresponding to the target data box is larger. The larger the sequence number of the actual data box, the more preset data boxes it maps to, resulting in lower ranging accuracy at long distance and obtaining relatively coarse distance information, but saving storage space.
[0022] Furthermore, as the sequence number of the actual data box increases, the number of preset data boxes mapped to the actual data box gradually increases, enabling distance measurement of moving target objects. When the target object is far from the ranging device, the sequence number of the actual data box corresponding to the target data box and its nearby preset data boxes is larger. A larger sequence number of the actual data box corresponds to a larger number of preset data boxes, allowing the distance measurement data of distant target objects to be stored in a smaller number of actual data boxes, and obtaining a relatively accurate distance at a faster measurement speed. As the target object moves closer to the ranging device, the sequence number of the actual data box corresponding to the target data box is smaller. A smaller sequence number of the actual data box corresponds to a smaller number of preset data boxes, allowing for a more accurate distance at a slower measurement speed, and enabling dynamic adjustment of measurement accuracy. In other words, this embodiment of the invention is suitable for ranging moving targets. When the target object is far away, coarse accuracy is used; when it is close, fine accuracy is used, achieving a balance between ranging accuracy, ranging speed, and storage space.
[0023] Furthermore, using the median or average value of the sequence number of the preset data box mapped to the target data box as the target value for distance calculation can reduce distance measurement error and improve the accuracy of measurement data.
[0024] Furthermore, the mapping relationship between the serial numbers of multiple actual data boxes and the serial numbers of preset data boxes includes at least a first mapping relationship and a second mapping relationship. The same actual data box maps to the same number of preset data boxes under the first mapping relationship and the second mapping relationship, and the serial numbers of the mapped preset data boxes are the same. Thus, the same actual data box can be mapped to multiple preset data boxes with two or more serial number sequences. Then, by comparing the distance measurement data of each actual data box under the two or more mapping relationships, the serial number sequence of the preset data box mapped by the actual data box with the most distance measurement data is found, thereby determining the preset data box that more accurately reflects the distance of the measured target object and improving the measurement accuracy. Attached Figure Description
[0025] The above and other objects, features and advantages of the present invention will become more apparent from the following description of embodiments of the invention with reference to the accompanying drawings, in which:
[0026] Figure 1 A flowchart illustrating the ranging method provided in an embodiment of the present invention is shown;
[0027] Figure 2 This illustrates the statistical histogram under uniform mapping provided in an embodiment of the present invention;
[0028] Figure 3 This illustrates a statistical histogram under non-uniform mapping provided in an embodiment of the present invention.
[0029] Figure 4 This diagram shows a flowchart of another ranging method provided by an embodiment of the present invention;
[0030] Figure 5 This diagram illustrates the structure of the ranging system provided in an embodiment of the present invention.
[0031] Figure 6 This illustrates a statistical histogram under another uniform mapping provided by an embodiment of the present invention. Detailed Implementation
[0032] Various embodiments of the invention will now be described in more detail with reference to the accompanying drawings. In the various drawings, the same elements are indicated by the same or similar reference numerals. For clarity, the various parts in the drawings are not drawn to scale.
[0033] The specific embodiments of the present invention will be described in further detail below with reference to the accompanying drawings and examples.
[0034] DTOF (Direct Time-of-Flight) obtains ranging data by repeatedly measuring the flight time of light pulses and then statistically plots this data into a histogram. The horizontal axis of the histogram represents the photon flight time, and the vertical axis represents the photon count. By finding the peak value in the histogram, the horizontal axis of the peak value is determined as the photon flight time reflecting the distance to the target object, thus calculating the distance to the target object. The storage space required for the ranging data is related to the number and width of the bars (bins) in the histogram. Generally, one bar corresponds to one storage entry to store the photon flight time count value falling within that bar. The more bars there are, the more storage entries are required, and the larger the storage space required. The measurement accuracy of TDC (Time-of-Flight Measurement) determines the number and width of the bars in the histogram. The higher the measurement accuracy of TDC, the smaller the time / distance width represented by each bar in the histogram. For the same measurement range, the more bars there are, the more storage entries are required.
[0035] Therefore, under the requirements of multi-point measurement and large range, the existing technology has high requirements for storage resources, that is, it requires a large storage space, which increases the area occupied by storage resources on the chip and is not conducive to the high integration of the chip.
[0036] To address the aforementioned problems, this application provides a distance measurement method and system.
[0037] Figure 1 A flowchart illustrating the ranging method provided in an embodiment of the present invention is shown. Figure 1 As shown, the ranging method includes the following steps.
[0038] Step S110: Obtain the mapping relationship between the serial numbers of multiple actual data boxes and the serial numbers of preset data boxes, wherein each actual data box is mapped to at least one preset data box;
[0039] Step S120: Obtain ranging data, allocate storage space for the actual data box, and store the ranging data;
[0040] Step S130: Determine the target data box and its sequence number based on the data distribution of the ranging data within the multiple actual data boxes;
[0041] Step S140: Based on the mapping relationship between the serial number of the actual data box and the serial number of the preset data box, determine the target value of the preset data box corresponding to the target data box according to the preset algorithm;
[0042] Step S150: Determine the distance to the target being measured based on the target value of the preset data box and the width of the preset data box.
[0043] The ranging method provided in this invention merges ranging data that should originally be stored in multiple preset data boxes at a higher precision into a single actual data box at a lower precision. This allows the ranging data from a larger number of preset data boxes to be stored in a smaller number of actual data boxes, reducing the number of storage entries required to store the ranging data. This not only saves storage space but also reduces hardware requirements, increases measurement speed, and improves the measurement efficiency of the target object.
[0044] In this embodiment, a direct photon time-of-flight ranging method is used. The ranging data refers to statistical data on photon flight times. This statistical data can be presented in the form of a dataset or in the form of a photon time-of-flight statistical histogram. The following embodiment uses the presentation of ranging data in the form of a photon time-of-flight statistical histogram as an example for illustration, but this does not imply a limitation on the presentation format of the ranging data. Other presentation formats of the ranging data should also be within the protection scope of this application.
[0045] In this embodiment, the "data box" in the actual data box and the preset data box can be understood as the "time box" in the photon time-of-flight statistical histogram in the art. Essentially, it is a unit of measurement used in the histogram to divide storage space for storing ranging data. The "actual data box" refers to the actual storage space unit used to store ranging data during the ranging process, while the "preset data box" refers to the unit that divides the storage space according to the expected accuracy or the inherent highest accuracy of the TDC. The ranging accuracy corresponding to the "preset data box" is higher than that corresponding to the "actual data box." Furthermore, the "preset data box" does not actually store ranging data; it is only used to form a mapping relationship with the "actual data box." The "actual data box" can determine the corresponding "preset data box" through this mapping relationship, thus allowing the distance to the target object to be calculated at the ranging accuracy (higher accuracy) of the "preset data box" without requiring additional storage space to store the higher-precision ranging data.
[0046] In this embodiment, the peak value in the histogram and its corresponding actual data bin are the target data bins, used to characterize the target ranging data. Through the mapping relationship between the sequence number of the actual data bin and the sequence number of the preset data bin, the target value of the corresponding preset data bin within the actual data bin is obtained according to a preset algorithm, and then the distance to the measured target is calculated based on this target value. It should be noted that since there is a one-to-one correspondence between the photon flight time t and the distance s from the measured target object to the ranging device, i.e., s = c * t / 2, where c is the speed of light, the "data bin" can be either the time bin in the statistical histogram or a distance bin, yielding the same statistical result.
[0047] In this embodiment, multiple preset data bins are merged into multiple actual data bins, and a storage entry is assigned to each actual data bin. This storage entry stores the sum of photon counts from the corresponding preset data bins. In other words, the number of storage entries required for ranging data is equal to the number of actual data bins, which is less than the number of preset data bins. This saves storage space, increases measurement speed, and improves the efficiency of measuring the target object. Furthermore, the target value at the preset data bin precision is obtained through the mapping relationship between the target data bin number and the preset data bin number. The distance to the target object calculated from the target value and the width of the preset data bins is even more accurate.
[0048] Step S110: Obtain the mapping relationship between the serial numbers of multiple actual data boxes and the serial numbers of preset data boxes.
[0049] In this embodiment, the mapping relationship between the serial numbers of multiple actual data boxes and the serial numbers of preset data boxes includes uniform mapping and non-uniform mapping.
[0050] When the mapping between the sequence numbers of multiple actual data bins and the sequence numbers of preset data bins is uniform, each actual data bin (Bin) maps to the same number of preset data bins. That is, each actual data bin (Bin) maps to the same number of preset data bins, meaning the time / distance length represented by each actual data bin (Bin) is the same. The sequence numbers of the preset data bins mapped within each actual data bin (Bin) are consecutive. Uniform mapping saves storage space, and the method for calculating the target value is relatively simple. See also... Figure 2 The mapping relationship between the sequence number of the actual data bin and the sequence number of the preset data bin is as follows: I—(1,2,3); II—(4,5,6); III—(7,8,9); IV—(10,11,12); V—(13,14,15). Each actual data bin is mapped to 3 preset data bins.
[0051] When the mapping relationship between the serial numbers of multiple actual data boxes and the serial numbers of preset data boxes is non-uniform, at least some of the actual data box bins are mapped to different numbers of preset data box bins. That is, different actual data box bins can map to different numbers of preset data box bins, meaning at least two actual data box bins represent different time / distance lengths. The serial numbers of the preset data box bins within each actual data box bin are consecutive. Non-uniform mapping can adapt to ranging requirements at different distances. If the target object is close to the measuring device, the actual data box bin with the smaller serial number can be mapped to fewer preset data box bins, while the remaining actual data box bins can be mapped to more preset data box bins, thus improving the measurement accuracy at close range. If the target object is far from the measuring device, the actual data box bin with the larger serial number can be mapped to fewer preset data box bins, while the remaining actual data box bins can be mapped to more preset data box bins, thereby improving the measurement accuracy at long range.
[0052] See Figure 3 Each actual data bin is mapped to a different number of preset data bins, meaning that the time length / distance length represented by each actual data bin is different.
[0053] In a preferred embodiment, as the serial number of the actual data box increases, the number of preset data boxes mapped by the actual data box gradually increases.
[0054] In this embodiment, as the sequence number of the actual data bin increases, the number of preset data bins mapped to the actual data bin gradually increases. That is, for every increase of 1 in the sequence number of the actual data bin, the number of preset data bins mapped to the actual data bin also increases by 1 or other fixed value, such as 2, 3, 4, 5, etc., meaning that the difference in the number of preset data bins mapped to any two adjacent actual data bins is the same.
[0055] The ranging method provided in this invention can be applied to ranging needs at different distances. When the target object is close to the ranging device, the actual data box corresponding to the target data box and the nearby preset data boxes has a smaller sequence number. The smaller the sequence number of the actual data box, the fewer preset data boxes it maps to, resulting in higher ranging accuracy at close range and improved ranging accuracy at close range. When the target object is far from the ranging device, the actual data box corresponding to the target data box has a larger sequence number. The larger the sequence number of the actual data box, the more preset data boxes it maps to, resulting in lower ranging accuracy at long distance and obtaining relatively coarse distance information, but saving storage space.
[0056] In a preferred embodiment, the number of preset data boxes mapped by the actual data boxes increases in a stepwise manner as the serial number of the actual data boxes increases.
[0057] In this embodiment, as the sequence number of the actual data bin increases, the number of preset data bins mapped to the actual data bin increases in a stepwise manner. That is, for every increase of 2 or other fixed values in the sequence number of the actual data bin, such as 3, 4, 5, ..., the number of preset data bins mapped to the actual data bin also increases by 1 or other fixed values, such as 2, 3, 4, 5, ... For example, the number of preset data bins mapped to actual data bins Bin1 and Bin2 is 2 each, the number of preset data bins mapped to actual data bins Bin3 and Bin4 is 3 each, the number of preset data bins mapped to actual data bins Bin5 and Bin6 is 4 each, ... Alternatively, the number of preset data bins mapped to actual data bins Bin1 to Bin5 is 3 each, the number of preset data bins mapped to actual data bins Bin6 to Bin10 is 5 each, the number of preset data bins mapped to actual data bins Bin11 to Bin15 is 7 each, and so on...
[0058] The ranging method provided in this invention can measure the distance to a moving target object. When the target object is far from the ranging device, the actual data box corresponding to the target data box and its nearby preset data boxes has a larger sequence number. The larger the sequence number of the actual data box, the more preset data boxes it maps to. This allows the ranging data of a distant target object to be stored in a smaller number of actual data boxes, obtaining a relatively accurate distance at a faster measurement speed. As the target object moves closer to the ranging device, the actual data box corresponding to the target data box has a smaller sequence number. The smaller the sequence number of the actual data box, the fewer preset data boxes it maps to. This allows for a more accurate distance to be obtained at a slower measurement speed, enabling dynamic adjustment of measurement accuracy. In other words, this invention is suitable for ranging moving targets. When the target object is far away, coarse accuracy is used; when it is close, fine accuracy is used, achieving a balance between ranging accuracy, ranging speed, and storage space.
[0059] Step S120: Obtain ranging data, allocate storage space for the actual data box, and store the ranging data.
[0060] In this embodiment, photon time-of-flight data is collected to obtain ranging data. The storage space is divided according to the actual data boxes, and each actual data box is assigned a storage entry. Each storage entry stores the ranging data (photon count value) in the corresponding actual data box.
[0061] Step S130: Determine the target data box and its sequence number based on the data distribution of the ranging data within the multiple actual data boxes.
[0062] In this embodiment, the distribution of ranging data within the multiple actual data boxes can be understood as the photon count value within each actual data box. Peak lookup is performed based on the photon count value within each actual data box to obtain the target data box and its sequence number.
[0063] Step S140: Based on the mapping relationship between the serial number of the actual data box and the serial number of the preset data box, determine the target value of the preset data box corresponding to the target data box according to the preset algorithm.
[0064] In this embodiment, any one of the serial numbers of the preset data boxes mapped to the target data box is used as the target value.
[0065] If the actual data bins (Bin) and preset data bins (bin) are uniformly mapped, meaning each actual data bin (Bin) maps to m preset data bins (bin), and the target data bin (Bin) has an index of n, then the preset data bins mapped to the target data bin (Bin) have indices of (n-1)*m+1, (n-1)*m+2, ..., n*m. According to the preset algorithm, any one of these indices (n-1)*m+1, (n-1)*m+2, ..., n*m is determined as the target value k. The method for calculating the target value k is simple. Assuming the preset precision or inherent precision of the TDC is a, i.e., the width of the preset data bin (bin) is a, then the target distance is k*a. For example, if each actual data bin maps to 3 preset data bins, and the target data bin (Bin) has an index n = 3, then the target value k is any one of 7, 8, or 9.
[0066] If the mapping between the actual data bins (Bin) and the preset data bins (Bin) is non-uniform, meaning that at least some actual data bins (Bin) are mapped to different numbers of preset data bins (Bin), assume that the first actual data bin (Bin) maps to m1 bins (i.e., the preset data bins mapped to by the first actual data bin (Bin) have indices 1, 2, 3, ..., m1), the second actual data bin (Bin) maps to m2 bins (Bin) has indices m1+1, m1+2, ..., m1+m2), the third actual data bin (Bin) maps to m3 bins (Bin) has indices (m1+m2+1, m1+m2+2, ..., m1+m2+m3)...; if the index of the target data bin (Bin) is n, its mapping to m... n There are several bins, and the sequence number of the preset bin mapped to the target bin is (m1+m2+…+m…). n-1 +1, m1+m2+…+m n-1 +2, ..., m1+m2+...+m n-1 +m n -1, m1+m2+…+m n-1 +m n Then the sequence number m1+m2+…+m n-1 +1, m1+m2+…+m n-1 +2, ..., m1+m2+...+m n-1 +m n -1, m1+m2+…+m n-1 +m n Any one of the serial numbers is determined as the target value k of the preset data box mapped to the target data box.
[0067] For example, the actual number of bins is 5, m1=3, m2=4, m3=5, m4=6, m5=7. The first actual bin, Bin1, maps to 3 preset bins (i.e., the preset bin numbers mapped to Bin1 are 1, 2, 3), the second actual bin, Bin2, maps to 4 preset bins (i.e., the preset bin numbers mapped to Bin2 are 4, 5, 6, 7), the third actual bin, Bin3, maps to 5 preset bins (i.e., the preset bin numbers mapped to Bin3 are (8, 9, 10, 11, 12), and the fourth actual bin, Bin4, maps to 6 preset bins (i.e., the preset bin numbers mapped to Bin4 are (13, 14, 15, 16, 17, 18, 19 ... 15, 16, 17, 18), the fifth actual data box Bin5 maps to 7 preset data boxes (i.e., the sequence numbers of the preset data boxes bin mapped by the fifth actual data box Bin5 are (19, 20, 21, 22, 23, 24, 25). If the sequence number of the target data box Bin is 4, then the sequence number of the preset data box bin mapped by the target data box is (3+4+5+1, 3+4+5+2, 3+4+5+3, ..., 3+4+5+6), that is, the sequence number of the preset data box bin mapped by the target data box is (13, 14, 15, 16, 17, 18). Any one of the sequence numbers (13, 14, 15, 16, 17, 18) is determined as the target value k of the preset data box mapped by the target data box, that is, k is any one of 13, 14, 15, 16, 17, 18.
[0068] For example, the actual number of bins is 5, m1=3, m2=3, m3=5, m4=5, m5=7. The first actual bin, Bin1, maps to 3 preset bins (i.e., the sequence number of the preset bins mapped to the first actual bin, Bin1, is (1,2,3). The second actual bin, Bin2, maps to 3 preset bins (i.e., the sequence number of the preset bins mapped to the second actual bin, Bin2, is (4,5,6). The third actual bin, Bin3, maps to 5 preset bins (i.e., the sequence number of the preset bins mapped to the third actual bin, Bin3, is (7,8,9,10,11). The fourth actual bin, Bin4, maps to 5 preset bins (i.e., the sequence number of the preset bins mapped to the fourth actual bin, Bin4, is (12,10,11,12,13,13,14,13,14,15,16,16,17,16,17,16,17,16,17,17,18 ... 13, 14, 15, 16), the fifth actual data box Bin5 maps to 7 preset data boxes (that is, the sequence number of the preset data box bin mapped by the fifth actual data box Bin5 is (17, 18, 19, 20, 21, 22, 23). If the sequence number of the target data box Bin is 4, then the sequence number of the preset data box bin mapped by the target data box is (3+3+5+1, 3+3+5+2, 3+3+5+3, 3+3+5+4, 3+3+5+5), that is, the sequence number of the preset data box bin mapped by the target data box is (12, 13, 14, 15, 16). Any one of the sequence numbers (12, 13, 14, 15, 16) is determined as the target value k of the preset data box mapped by the target data box, that is, k is any one of 12, 13, 14, 15, 16.
[0069] In this embodiment, according to the preset algorithm, the last index of the preset data box number mapped to the target data box can be used as the target value k.
[0070] If each actual data bin (Bin) is mapped to m preset data bins (bin), and the target data bin (Bin) has an index of n, then the target value k = n * m. For example, if each actual data bin is mapped to 3 preset data bins, and the target data bin (Bin) has an index of n = 3, then the target value k = 3 * 3 = 9.
[0071] If the mapping between the actual data bins (Bin) and the preset data bins (Bin) is non-uniform, meaning that at least some actual data bins (Bin) are mapped to different numbers of preset data bins (Bin), assume that the first actual data bin (Bin) maps to m1 bins (i.e., the preset data bins mapped to by the first actual data bin (Bin) have indices 1, 2, 3, ..., m1), the second actual data bin (Bin) maps to m2 bins (Bin) has indices m1+1, m1+2, ..., m1+m2), the third actual data bin (Bin) maps to m3 bins (Bin) has indices (m1+m2+1, m1+m2+2, ..., m1+m2+m3)...; if the index of the target data bin (Bin) is n, its mapping to m... n There are several bins, and the sequence number of the preset bin mapped to the target bin is (m1+m2+…+m…). n-1 +1, m1+m2+…+m n-1 +2, ..., m1+m2+...+m n-1 +m n -1, m1+m2+…+m n-1 +m n If the objective value is k = m1 + m2 + ... + m n .
[0072] For example, the actual number of data bins is 5, m1=3, m2=4, m3=5, m4=6, m5=7. The first actual data bin, Bin1, maps to 3 preset data bins (i.e., the preset data bin numbers mapped to the first actual data bin, Bin1, are 1, 2, 3). The second actual data bin, Bin2, maps to 4 preset data bins (i.e., the preset data bin numbers mapped to the second actual data bin, Bin2, are 4, 5, 6, 7). The third actual data bin, Bin3, maps to 5 preset data bins (i.e., the preset data bin numbers mapped to the third actual data bin, Bin3, are (8, 9, 10, 11, 12). The fourth actual data bin, Bin4, maps to 6 preset data bins. The sequence numbers of the preset data bins mapped to the fourth actual data bin (Bin4) are (13, 14, 15, 16, 17, 18). The sequence numbers of the preset data bins mapped to the fifth actual data bin (Bin5) are (19, 20, 21, 22, 23, 24, 25). If the sequence number of the target data bin is 4, then the sequence numbers of the preset data bins mapped to the target data bin are (3+4+5+1, 3+4+5+2, 3+4+5+3, ..., 3+4+5+6), which means the sequence numbers of the preset data bins mapped to the target data bin are (13, 14, 15, 16, 17, 18). Therefore, k = 18.
[0073] For example, the actual number of data bins is 5, m1=3, m2=3, m3=5, m4=5, m5=7. The first actual data bin Bin1 maps to 3 preset data bins (i.e., the sequence number of the preset data bins mapped to the first actual data bin Bin1 is (1,2,3), the second actual data bin Bin2 maps to 3 preset data bins (i.e., the sequence number of the preset data bins mapped to the second actual data bin Bin2 is (4,5,6), the third actual data bin Bin3 maps to 5 preset data bins (i.e., the sequence number of the preset data bins mapped to the third actual data bin Bin3 is (7,8,9,10,11), and the fourth actual data bin Bin4 maps to 5 preset data bins. The sequence numbers of the preset data bins mapped to the fourth actual data bin (Bin4) are (12, 13, 14, 15, 16). The sequence numbers of the preset data bins mapped to the fifth actual data bin (Bin5) are (17, 18, 19, 20, 21, 22, 23). If the sequence number of the target data bin is 4, then the sequence numbers of the preset data bins mapped to the target data bin are (3+3+5+1, 3+3+5+2, 3+3+5+3, 3+3+5+4, 3+3+5+5), which means the sequence numbers of the preset data bins mapped to the target data bin are (12, 13, 14, 15, 16). Therefore, k = 16.
[0074] In this embodiment, according to the preset algorithm, the median value of the sequence number of the preset data box mapped to the target data box can also be used as the target value to reduce measurement error and improve measurement accuracy.
[0075] If each actual data bin (Bin) is mapped to m preset data bins (bin), the index of the target data bin (Bin) is n, and the indexes of the preset data bins mapped to the target data bin (Bin) are (n-1)*m+1, (n-1)*m+2, ..., n*m-1, n*m, then the target value k is the median of the indexes of the preset data bins mapped to the target data bin, that is, the median of (n-1)*m+1, (n-1)*m+2, ..., n*m-1, n*m.
[0076] For example, each actual data box is mapped to 3 preset data boxes. If the index of the target data box Bin is n=3, then the index of the preset data box mapped to the target data box Bin is (7,8,9), and k=8.
[0077] If the mapping between the actual data bins (Bin) and the preset data bins (Bin) is non-uniform, meaning that at least some actual data bins (Bin) are mapped to different numbers of preset data bins (Bin), assume that the first actual data bin (Bin) maps to m1 bins (i.e., the preset data bins mapped to by the first actual data bin (Bin) have indices 1, 2, 3, ..., m1), the second actual data bin (Bin) maps to m2 bins (Bin) has indices m1+1, m1+2, ..., m1+m2), the third actual data bin (Bin) maps to m3 bins (Bin) has indices (m1+m2+1, m1+m2+2, ..., m1+m2+m3)...; if the index of the target data bin (Bin) is n, its mapping to m... n There are several bins, and the sequence number of the preset bin mapped to the target bin is (m1+m2+…+m…). n-1 +1, m1+m2+…+m n-1 +2, ..., m1+m2+...+m n-1 +m n -1, m1+m2+…+m n-1 +m n If the objective value is k = m1 + m2 + ... + m n .
[0078] For example, the actual number of bins is 5, m1=3, m2=4, m3=5, m4=6, m5=7. The first actual bin, Bin1, maps to 3 preset bins (i.e., the preset bin numbers mapped to the first actual bin, Bin1, are 1, 2, 3). The second actual bin, Bin2, maps to 4 preset bins (i.e., the preset bin numbers mapped to the second actual bin, Bin2, are 4, 5, 6, 7). The third actual bin, Bin3, maps to 5 preset bins (i.e., the preset bin numbers mapped to the third actual bin, Bin3, are (8, 9, 10, 11, 12). The fourth actual bin, Bin4, maps to 6 preset bins (i.e.,...). The sequence numbers of the preset data bins mapped to the fourth actual data bin (Bin4) are (13, 14, 15, 16, 17, 18). The sequence numbers of the preset data bins mapped to the fifth actual data bin (Bin5) are (19, 20, 21, 22, 23, 24, 25). If the sequence number of the target data bin is 4, then the sequence numbers of the preset data bins mapped to the target data bin are (3+4+5+1, 3+4+5+2, 3+4+5+3, ..., 3+4+5+6), that is, the sequence numbers of the preset data bins mapped to the target data bin are (13, 14, 15, 16, 17, 18). Therefore, k = 15 or 16.
[0079] For example, the actual number of data bins is 5, m1=3, m2=3, m3=5, m4=5, m5=7. The first actual data bin Bin1 maps to 3 preset data bins (i.e., the sequence number of the preset data bins mapped to the first actual data bin Bin1 is (1,2,3), the second actual data bin Bin2 maps to 3 preset data bins (i.e., the sequence number of the preset data bins mapped to the second actual data bin Bin2 is (4,5,6), the third actual data bin Bin3 maps to 5 preset data bins (i.e., the sequence number of the preset data bins mapped to the third actual data bin Bin3 is (7,8,9,10,11), and the fourth actual data bin Bin4 maps to 5 preset data bins. The sequence numbers of the preset data bins mapped to the fourth actual data bin (Bin4) are (12, 13, 14, 15, 16). The sequence numbers of the preset data bins mapped to the fifth actual data bin (Bin5) are (17, 18, 19, 20, 21, 22, 23). If the sequence number of the target data bin is 4, then the sequence numbers of the preset data bins mapped to the target data bin are (3+3+5+1, 3+3+5+2, 3+3+5+3, 3+3+5+4, 3+3+5+5), which means the sequence numbers of the preset data bins mapped to the target data bin are (12, 13, 14, 15, 16). Therefore, k = 14.
[0080] In this embodiment, according to the preset algorithm, the average value of the serial number of the preset data box mapped to the target data box can also be used as the target value, which can improve the accuracy of the measurement.
[0081] If each actual data bin (Bin) maps to m preset data bins (bin), and the target data bin (Bin) has an index of n, and the preset data bins mapped to the target data bin (Bin) have indices of (n-1)*m+1, (n-1)*m+2, ..., n*m-1, n*m, then the target value k is the median of the preset data bin indices mapped to the target data bin, which is the average of (n-1)*m+1, (n-1)*m+2, ..., n*m-1, n*m. Therefore, the target value k = [(n-1)*m+1 + ... + n*m] / m. For example, if each actual data bin maps to 3 preset data bins, and the target data bin (Bin) has an index n = 3, then the preset data bins mapped to the target data bin (Bin) have indices of (7, 8, 9), and k = (7 + 8 + 9) / 3 = 8.
[0082] If the mapping between the actual data bins (Bin) and the preset data bins (Bin) is non-uniform, meaning that at least some actual data bins (Bin) are mapped to different numbers of preset data bins (Bin), assume that the first actual data bin (Bin) maps to m1 bins (i.e., the preset data bins mapped to by the first actual data bin (Bin) have indices 1, 2, 3, ..., m1), the second actual data bin (Bin) maps to m2 bins (Bin) has indices m1+1, m1+2, ..., m1+m2), the third actual data bin (Bin) maps to m3 bins (Bin) has indices (m1+m2+1, m1+m2+2, ..., m1+m2+m3)...; if the index of the target data bin (Bin) is n, its mapping to m... n There are several bins, and the sequence number of the preset bin mapped to the target bin is (m1+m2+…+m…). n-1 +1, m1+m2+…+m n-1 +2, ..., m1+m2+...+m n-1 +m n -1, m1+m2+…+m n-1 +m n If the objective value is k = m1 + m2 + ... + m n .
[0083] For example, the actual number of bins is 5, m1=3, m2=4, m3=5, m4=6, m5=7. The first actual bin, Bin1, maps to 3 preset bins (i.e., the preset bin numbers mapped to the first actual bin, Bin1, are 1, 2, 3). The second actual bin, Bin2, maps to 4 preset bins (i.e., the preset bin numbers mapped to the second actual bin, Bin2, are 4, 5, 6, 7). The third actual bin, Bin3, maps to 5 preset bins (i.e., the preset bin numbers mapped to the third actual bin, Bin3, are (8, 9, 10, 11, 12). The fourth actual bin, Bin4, maps to 6 preset bins (i.e.,...). The sequence numbers of the preset data bins mapped to the fourth actual data bin (Bin4) are (13, 14, 15, 16, 17, 18). The sequence numbers of the preset data bins mapped to the fifth actual data bin (Bin5) are (19, 20, 21, 22, 23, 24, 25). If the sequence number of the target data bin is 4, then the sequence numbers of the preset data bins mapped to the target data bin are (3+4+5+1, 3+4+5+2, 3+4+5+3, ..., 3+4+5+6), that is, the sequence numbers of the preset data bins mapped to the target data bin are (13, 14, 15, 16, 17, 18), then k = 15.5.
[0084] For example, the actual number of data bins is 5, m1=3, m2=3, m3=5, m4=5, m5=7. The first actual data bin Bin1 maps to 3 preset data bins (i.e., the sequence number of the preset data bins mapped to the first actual data bin Bin1 is (1,2,3), the second actual data bin Bin2 maps to 3 preset data bins (i.e., the sequence number of the preset data bins mapped to the second actual data bin Bin2 is (4,5,6), the third actual data bin Bin3 maps to 5 preset data bins (i.e., the sequence number of the preset data bins mapped to the third actual data bin Bin3 is (7,8,9,10,11), and the fourth actual data bin Bin4 maps to 5 preset data bins. The sequence numbers of the preset data bins mapped to the fourth actual data bin (Bin4) are (12, 13, 14, 15, 16). The sequence numbers of the preset data bins mapped to the fifth actual data bin (Bin5) are (17, 18, 19, 20, 21, 22, 23). If the sequence number of the target data bin is 4, then the sequence numbers of the preset data bins mapped to the target data bin are (3+3+5+1, 3+3+5+2, 3+3+5+3, 3+3+5+4, 3+3+5+5), which means the sequence numbers of the preset data bins mapped to the target data bin are (12, 13, 14, 15, 16). Therefore, k = 14.
[0085] The following is a detailed explanation with reference to the illustrations.
[0086] See Figure 3 The target data bin has the sequence number IV, and its mapped preset data bin has the sequence number (7, 8, 9, 10). If the preset algorithm is any one of the preset data bin sequence numbers mapped to the target data bin, then the target value k = 7, 8, 9, or 10; if the preset algorithm is the last one of the preset data bin sequence numbers mapped to the target data bin, then k = 10; if the preset algorithm is the median value of the preset data bin sequence numbers mapped to the target data bin, then k = 8 or 9; if the preset algorithm is the average value of the preset data bin sequence numbers mapped to the target data bin, then k = 8.5.
[0087] Figure 4 This diagram illustrates a flow chart of another ranging method provided by an embodiment of the present invention.
[0088] In some embodiments, there are multiple mapping relationships between the serial numbers of multiple actual data boxes and the serial numbers of preset data boxes. Specifically:
[0089] In step S110, the mapping relationship between the serial numbers of multiple actual data boxes and the serial numbers of preset data boxes includes at least a first mapping relationship and a second mapping relationship. Under both the first and second mapping relationships, the same number of preset data boxes are mapped to the same actual data box, and the serial numbers of the mapped preset data boxes are also the same. For example, see... Figure 6 Under the first mapping relationship, the mapping relationship between the sequence number of the actual data bin and the sequence number of the preset data bin is as follows: I—(1,2,3); II—(4,5,6); III—(7,8,9); IV—(10,11,12); V—(13,14,15); Under the second mapping relationship, the mapping relationship between the sequence number of the actual data bin and the sequence number of the preset data bin is as follows: I—(2,3,4); II—(5,6,7); III—(8,9,10); IV—(11,12,13); V—(14,15,1).
[0090] In this embodiment, the sequence numbers of the preset data boxes mapped to by the same actual data box under the first mapping relationship and the second mapping relationship are the same. The sequence numbers of the preset data boxes mapped to by the last actual data box will be discontinuous. It should be noted that, in order to make the sequence numbers of the preset data boxes mapped to by each actual data box under the two mapping relationships different, in the second mapping relationship, the first actual data box is not mapped to the first preset data box, but the first actual data box starts mapping from the second (or the third, the fourth, etc.) preset data box. In this case, the number of the last few preset data boxes mapped by the last actual data box under the second mapping relationship will be less than the number of the last few preset data boxes mapped by the last actual data box under the first mapping relationship. Therefore, in order to make the number of preset data boxes mapped to by the same actual data box the same under the two mapping relationships, the first (or the first and the second, etc.) preset data boxes not mapped by the first actual data box under the second mapping relationship can be added to the mapping library of the last actual data box, so that the number of preset data boxes mapped by each actual data box is the same under the two mapping relationships, thereby allowing comparison of the photon count values of each actual data box under the two mapping relationships.
[0091] The mapping relationship between the serial numbers of multiple actual data boxes and the serial numbers of preset data boxes includes at least a first mapping relationship and a second mapping relationship. The same actual data box maps to the same number of preset data boxes under the first mapping relationship and the second mapping relationship, and the serial numbers of the mapped preset data boxes are the same. Thus, the same actual data box can be associated with multiple preset data boxes with two or more serial number sequences. Then, by comparing the distance measurement data of each actual data box under the two or more mapping relationships, the serial number sequence of the preset data box mapped by the actual data box with the most distance measurement data is found. This determines the preset data box that more accurately reflects the distance of the measured target object and improves the measurement accuracy.
[0092] In step S120, based on the first mapping relationship and the second mapping relationship, a first storage space and a second storage space are allocated to the actual data box respectively;
[0093] Under the two mapping relationships, storage space is allocated for the ranging data. For example, the ranging data of the first mapping relationship is allocated to the first storage space, and the ranging data of the second mapping relationship is allocated to the second storage space.
[0094] In step S130, the ranging data (i.e., photon count value) of the target data box in the first storage space is compared with the ranging data (i.e., photon count value) of the target data box in the second storage space, so that the target data box with larger ranging data (i.e., larger photon count value) is determined as the final target data box, and the sequence number of the final target data box is obtained at the same time.
[0095] For example, see Figure 6 Under the first mapping relationship (corresponding to the first storage space), the actual data box Bin2 is the target data box with a photon count of 580. The preset data boxes mapped to Bin2 are bin4, bin5, and bin6. Under the second mapping relationship (corresponding to the second storage space), the actual data box Bin3 is the target data box with a photon count of 600. The preset data boxes mapped to Bin3 are bin5, bin6, and bin7. By comparing the photon count values in the target data boxes under the two mapping relationships, Bin3 under the second mapping relationship is determined to be the target data box. The k value is determined through its mapped bin5, bin6, and bin7, thereby determining more accurate distance information and achieving deviation correction of the ranging data.
[0096] In step S140, based on the mapping relationship between the sequence number of the final target data box and the sequence number of the preset data box, the target value of the preset data box corresponding to the final target data box is determined according to a preset algorithm. This can obtain more accurate ranging data, reduce dynamic ranging errors, and improve measurement accuracy.
[0097] The ranging method provided in this invention sets multiple different mapping relationships between the serial numbers of multiple actual data boxes and the serial numbers of preset data boxes, thereby adjusting the time length / distance length corresponding to each actual data box. Then, the target data box is determined by comparing the ranging data in each actual data box. For the measured target object with rapidly changing distance, dynamic ranging error can be reduced and measurement accuracy can be improved.
[0098] Figure 5 A schematic diagram of a DTOF ranging system is shown. Figure 5 As shown, the DTOF ranging system includes a laser 101, a detector 102, a time-to-digital converter 103, a processor 104, and a memory 105.
[0099] In this system, laser 101 generates a laser signal. Detector 102 receives the laser signal reflected back from the target object and generates an electrical signal upon receiving the laser signal. Time-to-digital converter 103 receives the electrical signal generated by the detector and determines the flight data of the laser signal, wherein the flight data is the time required for the laser signal to travel from laser 101 to the target object and be reflected back to detector 102. Processor 104 executes the ranging method provided in the above embodiment and processes the data. Memory 105 stores the flight data.
[0100] As described above, these embodiments of the present invention do not exhaustively cover all details, nor do they limit the invention to the specific embodiments described. Clearly, many modifications and variations can be made based on the above description. This specification selects and specifically describes these embodiments to better explain the principles and practical applications of the invention, thereby enabling those skilled in the art to effectively utilize the invention and its modifications. The invention is limited only by the claims and their full scope and equivalents.
Claims
1. A distance measurement method, characterized in that, include: Obtain the mapping relationship between the serial numbers of multiple actual data boxes and the serial numbers of preset data boxes, wherein each actual data box is mapped to at least one preset data box; Acquire ranging data, allocate storage space for the actual data box, and store the ranging data. The target data box and its sequence number are determined based on the data distribution of the ranging data within the multiple actual data boxes. Based on the mapping relationship between the serial number of the actual data box and the serial number of the preset data box, the target value of the preset data box corresponding to the target data box is determined according to the preset algorithm; The distance to the target being measured is determined based on the target value of the preset data box and the width of the preset data box.
2. The ranging method according to claim 1, characterized in that, Each actual data box maps to the same number of preset data boxes.
3. The ranging method according to claim 1, characterized in that, At least some of the actual data boxes are mapped to different numbers of preset data boxes.
4. The ranging method according to claim 1, characterized in that, As the serial number of the actual data box increases, the number of preset data boxes mapped to the actual data box gradually increases.
5. The ranging method according to claim 4, characterized in that, The difference in the number of preset data boxes mapped to any two adjacent actual data boxes is the same.
6. The ranging method according to claim 4, characterized in that, The number of preset data boxes mapped to the actual data boxes increases in a stepwise manner as the serial number of the actual data boxes increases.
7. The ranging method according to claim 1, characterized in that, The target value of the preset data box corresponding to the target data box is determined according to the preset algorithm, including: Use any one of the serial numbers of the preset data boxes mapped to the target data box as the target value.
8. The ranging method according to claim 1, characterized in that, The step of determining the target value of the preset data box corresponding to the target data box according to the preset algorithm includes: Use the last index of the preset data box that the target data box is mapped to as the target value.
9. The ranging method according to claim 1, characterized in that, The target value of the preset data box corresponding to the target data box is determined according to the preset algorithm, including: The median value of the sequence number of the preset data box mapped to the target data box is used as the target value.
10. The ranging method according to claim 1, characterized in that, The target value of the preset data box corresponding to the target data box is determined according to the preset algorithm, including: The target value is the average of the serial numbers of the preset data boxes mapped to the target data box.
11. The ranging method according to claim 1, characterized in that, The mapping relationship between the serial numbers of multiple actual data boxes and the serial numbers of preset data boxes includes at least a first mapping relationship and a second mapping relationship. Under the first mapping relationship and the second mapping relationship, the same number of preset data boxes are mapped to the same actual data box, and the serial number part of the mapped preset data boxes is the same.
12. The ranging method according to claim 11, characterized in that, Based on the first mapping relationship and the second mapping relationship, a first storage space and a second storage space are allocated to the actual data box, respectively. The ranging data is stored in the first storage space and the second storage space, respectively. By comparing the ranging data in each actual data box under the first storage space and the second storage space, the sequence number of the target data box under the first mapping relationship or the second mapping relationship is determined.
13. A ranging system, characterized in that, It includes a laser, a detector, a time-to-digital converter, a processor, and a memory, wherein the processor is used to perform the ranging method as described in any one of claims 1-12.
Citation Information
Patent Citations
Data sampling and processing method of ToF histogram, ToF distance measuring device and storage medium
CN117538887A