Time-of-flight measurement method, storage medium and device
By grouping and accumulating the timestamp set in the time-of-flight measurement system and using a sliding window filter, histogram data is generated to determine the flight time, thus solving the problem of noise signal influence and improving measurement accuracy and signal-to-ground noise ratio (SBNR).
Patent Information
- Application Number
- CN202111600767.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-24
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2041-12-24
AI Technical Summary
In existing time-of-flight measurement systems, the influence of noise signals leads to a decrease in measurement accuracy, especially in the case of strong ambient light or distant targets, where the peak of the noise signal can easily mask the peak of the echo signal, resulting in detection errors.
By acquiring multiple timestamp sets, grouping and accumulating them, and using a sliding window of preset width to filter timestamps, histogram data is generated to determine flight time and suppress the influence of noise signals.
The signal-to-background noise ratio (SBNR) of the distance detector was improved, which enhanced the accuracy of time-of-flight measurement and reduced the probability of detection errors.
Smart Images

Figure CN116338610B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of measurement, in particular to a time of flight measurement method, storage medium and device. BACKGROUND
[0002] Time of flight (TOF) measurement system has important applications in various three-dimensional ranging and three-dimensional imaging fields, such as autonomous driving, face recognition, 3D games, and virtual reality, etc. Specifically, the time of flight measurement (TOF) technology is that a light source emits a continuous or pulsed outgoing light beam, which is reflected by a measured target and returns, and a photoelectric sensor receives the returned echo light beam, and the time difference between the emitted outgoing light beam and the received echo light beam, or the phase difference between the outgoing light beam and the echo light beam, is calculated to convert the distance of the measured target, i.e. depth information.
[0003] In the actual measurement process of time of flight, the interference of ambient light and the dark noise of the photoelectric sensor itself will cause the measurement system to generate a large amount of interference information, i.e. noise signal. Therefore, how to avoid the influence of the noise signal to improve the accuracy of time of flight ranging is a technical problem to be solved by those skilled in the art. SUMMARY
[0004] The technical problem to be solved by the embodiments of the present application is to provide a time of flight measurement method, storage medium and device, to reduce the influence of noise signal on measurement and improve the accuracy of measuring time of flight.
[0005] In a first aspect, the present application provides a time of flight measurement method, comprising:
[0006] obtaining N sets of time stamps; wherein N is an integer greater than 1, each set of time stamps includes a plurality of time stamps, and one set of time stamps corresponds to one integration period;
[0007] obtaining P groups based on the N sets of time stamps; wherein P < N, P is a positive integer, and each group includes at least two sets of time stamps;
[0008] performing accumulation processing on the sets of time stamps included in each group to obtain P first intermediate sets of time stamps;
[0009] performing screening processing on each first intermediate set of time stamps to obtain P second intermediate sets of time stamps; wherein the screening processing process includes moving a sliding window with a preset width in time length to realize screening, if the number of time stamps covered by the sliding window is less than a number threshold, the time stamps in the sliding window are filtered out; if the number of time stamps covered by the sliding window is greater than or equal to the number threshold, the time stamps in the sliding window are retained;
[0010] accumulate the P second intermediate timestamp sets to obtain a coherent timestamp set;
[0011] generate histogram data according to the coherent timestamp set;
[0012] determine a time of flight according to the histogram data.
[0013] In a second aspect, the present application provides a time of flight measurement device, comprising:
[0014] an acquisition unit configured to acquire N timestamp sets; wherein N is an integer greater than 1, each timestamp set comprises a plurality of timestamps, and one timestamp set corresponds to one integration period;
[0015] a grouping unit configured to obtain P groups based on the N timestamp sets; wherein P < N, P is a positive integer, and each group comprises at least two timestamp sets;
[0016] an accumulation unit configured to accumulate the timestamp sets included in each group to obtain P first intermediate timestamp sets;
[0017] a screening unit configured to screen each first intermediate timestamp set to obtain P second intermediate timestamp sets; wherein the screening process comprises: moving a sliding window with a preset width in time length to realize screening, if the number of timestamps covered by the sliding window is less than a number threshold, then filtering out the timestamps in the sliding window; if the number of timestamps covered by the sliding window is greater than or equal to the number threshold, then retaining the timestamps in the sliding window;
[0018] the accumulation unit is further configured to accumulate the P second intermediate timestamp sets to obtain a coherent timestamp set;
[0019] a generation unit configured to generate histogram data according to the coherent timestamp set;
[0020] a calculation unit configured to determine a time of flight according to the histogram data.
[0021] Based on the same application concept, since the principle and beneficial effects of the device for solving the problem can be referred to the above-mentioned possible method embodiments of the time of flight measurement device and the beneficial effects brought by them, the implementation of the device can be referred to the implementation of the method, and the repeated parts will not be described again.
[0022] In still another aspect of the present application, a computer readable storage medium is provided, which stores instructions, when running on a computer, causes the computer to execute the method described in the above aspects.
[0023] Yet another aspect of the present application provides a computer program product comprising instructions which, when executed on a computer, cause the computer to carry out the method of the above aspects.
[0024] In the embodiments of the present application, the embodiments of the present application can collect a plurality of timestamp sets by using a time-to-digital converter, divide the plurality of timestamp sets into a plurality of groups, and accumulate the timestamp sets in each group to obtain a first intermediate timestamp set. Further, a preset width sliding window is used to screen each first intermediate timestamp set to obtain a second intermediate timestamp set. The generation histogram data is obtained by accumulating a plurality of second intermediate timestamp sets. Thus, the time of flight can be determined according to the peak position of the histogram data count value, the count value of the timestamp corresponding to the echo signal in the histogram data is basically kept unchanged, and the count value of the timestamp corresponding to the noise signal is suppressed. This not only can improve the signal-to-background noise ratio (SBNR) of the distance detector, but also effectively improves the accuracy of measuring the time of flight of the distance detector. BRIEF DESCRIPTION OF DRAWINGS
[0025] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the background art, the drawings needed to be used in the embodiments of the present application or the background art will be described below.
[0026] Figure 1A is a structural schematic diagram of a detector in a time-of-flight measurement device provided by the embodiments of the present application;
[0027] Figure 1B is a principle schematic diagram of generating histogram data provided by the embodiments of the present application;
[0028] Figure 1C and Figure 1D is a schematic diagram of histogram data
[0029] Figure 2 is a flow schematic diagram of a time-of-flight measurement method provided by the embodiments of the present application;
[0030] Figure 3 is a schematic diagram of accumulating the timestamp sets in each group provided by the embodiments of the present application;
[0031] Figure 4 is a principle schematic diagram of screening the first intermediate timestamp set provided by the embodiments of the present application;
[0032] Figure 5 is a principle schematic diagram of accumulating each second intermediate timestamp set provided by the embodiments of the present application;
[0033] Figure 6 is the histogram data before the screening processing of the embodiments of the present application;
[0034] Figure 7 is histogram data processed by the method provided in the embodiments of the present application;
[0035] Figure 8 is a structural schematic diagram of a time-of-flight measurement device provided in the embodiments of the present application;
[0036] Figure 9 is another structural schematic diagram of a time-of-flight measurement device provided in the embodiments of the present application. DETAILED DESCRIPTION
[0037] In order to make the purposes, features and advantages of the embodiments of the present application more obvious and easy to understand, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the present application.
[0038] The following description refers to the accompanying drawings. Unless otherwise indicated, same or similar elements in different drawings are denoted by same or similar reference numerals. The implementations described in the following exemplary embodiments are not meant to represent all implementations consistent with the present application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the present application as detailed in the appended claims.
[0039] In the description of the present application, it should be understood that the terms "first", "second" and the like are used only for the purpose of description, and should not be understood as indicating or implying relative importance. The above terms can be understood in their specific meanings in the present application by those skilled in the art.
[0040] Referring to Figure 1A is a structural diagram of a time-of-flight measurement device provided in the embodiments of the present application. In the embodiments of the present application, the measurement device includes a transmitter (not shown in the figure) and a detector. The transmitter is used to emit a laser pulse. The detector can include a pixel unit, a time-to-digital converter (TDC) and a random access memory (RAM). The pixel unit can include one or more single photon avalanche diodes (SPADs).
[0041] The basic process of DTOF (direct time of flight) measurement is as follows: DTOF will emit N pulse signals and receive N echo signals within a single frame measurement time. Then, it will perform histogram statistics on the flight time of the recorded pulse signals, and the flight time with the highest frequency will be used to calculate the distance between the lidar and the target object.
[0042] Specifically, the transmitter emits a pulse signal towards the target object. The pulse signal is reflected when it encounters the target object. The pixel unit or pixel array receives the echo signal reflected by the target object and converts the echo signal into an electrical signal. The TDC records the generation time of the electrical signal (also known as the timestamp), and this generation time is used as the arrival time of the echo signal. The RAM stores the timestamp of the echo signal. The time of flight (TOF) can be obtained based on the transmission time of the pulse signal and the arrival time of the echo signal. Then, the distance to the target object can be calculated based on the constant speed of light and the time of flight.
[0043] However, in actual measurements, due to the high sensitivity of the detector, the received signal contains noise in addition to the echo signal. The noise originates from internal detector components or ambient light. The detector cannot effectively distinguish between noise and echo signals in the received signal. To reduce the impact of noise on DTOF measurement results, time-correlated single-photon counting (TCSPC) is used to measure the time of flight. The main principle is that the transmitter emits pulse signals multiple times within a time frame. Because the arrival times of the echo signals received by the detector are coherent or consistent, while the arrival times of the noise signals are random, after multiple integration cycles, the echo signal can stand out from the noise signal.
[0044] For example: see Figure 1B As shown, the time frame consists of N integration periods, where N is an integer greater than 1. The echo signals received by the detector in each integration period are represented by rectangles filled with diagonal lines, and the received noise signals are represented by rectangles filled with gray. The transmitter emits laser pulse signals at the beginning of the first to Nth integration periods. As can be seen from the figure, in addition to receiving the echo signals, the detector also receives multiple noise signals in each integration period. The positions of the echo signals remain relatively constant, while the positions of the noise signals are relatively random. Specifically, Figure 1B The timestamp information on the horizontal axis indicates the moment the TDC receives the signal. The time of flight (TOF) can be calculated based on the transmission time of the pulse signal and the arrival time generated by the echo signal. Furthermore, Figure 1BThe ordinate in the histogram corresponds to the count value (cumulative number) of the number of noise signals or echo signals received at each timestamp. It can be understood that the timestamp corresponding to the maximum count value in the histogram of the present application is the time of flight.
[0045] It can be seen that, for the current DTOF time-of-flight measurement method, the measured time of flight depends on whether the peak position of the count value in the histogram can be identified, and then the time of flight is identified. When the ambient light is weak and the target distance is small, the signal-to-background noise ratio (SBNR) is large, and the peak value of the histogram corresponding to the echo signal is easily obtained after a plurality of integration periods, as shown below. Figure 1C However, when the intensity of the ambient light is strong or the distance of the target object is large, the echo signal received by the detector becomes less as the distance increases, while the received ambient light photons remain unchanged with the change of distance, and the SBNR becomes small. The peak fluctuation of the ambient light part on the histogram caused by the random effect of the ambient light may be greater than the peak value corresponding to the echo signal, thereby causing the peak value recognition error of the rear-end circuit and resulting in detection error, as shown below. Figure 1D Moreover, the stronger the ambient light and the farther the distance of the measured target, the greater the probability that the peak value of the noise signal covers the peak value of the echo signal, thereby greatly reducing the detection accuracy.
[0046] Please refer to Figure 2 , Figure 2 is a flowchart of a time-of-flight measurement method provided by an embodiment of the present application, which includes but is not limited to the following steps:
[0047] S201, obtaining a set of N timestamps.
[0048] Each timestamp set is used to represent the photon events corresponding to one integration period, which can include noise events and echo events. Each timestamp set corresponds to an equal integration period, and the TDC records the reception time of the echo signal (the pulse signal reflected by the target object). Further, the timestamps of the pulse signals recorded in each integration period are stored in the memory, and the timestamps of the multiple echo signals recorded by the TDC in one integration period form a timestamp set. The specific process of recording the timestamps of the echo signals in the integration period can refer to the description of Figure 1A and Figure 1B , which will not be described here. The measurement device of the present application obtains N timestamp sets recorded by the TDC in N integration periods, and each timestamp set includes at least one timestamp. The number of timestamps in each timestamp set can be equal or not equal.
[0049] For example, when the timestamp set N = 4, the timestamp set corresponding to the first integration period can include two timestamps: t 11 , t 12 , the timestamp set corresponding to the second integration period can include four timestamps: t 21 , t 22 , t 23 , t 24 , the timestamp set corresponding to the third integration period can include four timestamps: t 31 , t 32 , t 33 , t 34 , and the timestamp set corresponding to the fourth integration period can include seven timestamps: t 41 , t 42 , t 43 , t 44 , t 45 , t 46 , t 47 .
[0050] It can be understood that the time interval between two adjacent timestamps in the same timestamp set is greater than or equal to the minimum time resolution of the TDC, which is determined by the hardware capability of the TDC.
[0051] S202, obtaining P groups based on the N timestamp sets.
[0052] The N integration periods can belong to the same frame, that is, the measurement device measures the N integration periods in units of frames, and accumulates the timestamps of the received echo signals in the N integration periods to finally obtain the time of flight of the target object. N is an integer greater than 1. The signal detected by the detector in the integration period can be a noise signal or a reflected echo signal generated by the pulsed signal emitted by the transmitter and reflected by the target object. The noise signal can be generated by the external environment, the internal device, or other ways. The timestamp corresponding to the noise signal is randomly distributed in the integration period, and the timestamp of the echo signal is related to the distance of the target object. When the distance remains basically unchanged in the N integration periods, the echo signal will be concentrated in a certain position of the integration period.
[0053] It can be understood that there is only one echo signal in each integration period of the embodiment of the application. The N timestamp sets are divided into P groups, P < N, P is an integer, and each group includes at least two timestamp sets. The number of timestamp sets in each group can be equal or unequal, and the at least two timestamp sets included in each group can be repeated or not repeated, which is not limited by the embodiment of the application.
[0054] Possibly, N = 10, P = 5, the number of timestamp sets of each group is equal, and the timestamp sets contained by each group are not repeated, then the 10 timestamp sets are respectively: timestamp set 1, timestamp set 2, timestamp set 3, …, timestamp set 10; the number of timestamp sets of each group is 2, group 1 contains timestamp set 1 and timestamp set 2, group 2 contains timestamp set 3 and timestamp set 4, group 3 contains timestamp set 5 and timestamp set 6, group 4 contains timestamp set 7 and timestamp set 8, and group 5 contains timestamp set 9 and timestamp set 10.
[0055] Possibly, N = 10, P = 4, the number of timestamp sets of each group is equal, and the timestamp sets contained by each group are repeated. The 10 timestamp sets are respectively: timestamp set 1, timestamp set 2, …, timestamp set 10. The number of timestamp sets of each group is 4, group 1 contains timestamp set 1, timestamp set 2, timestamp set 3 and timestamp set 4, group 2 contains timestamp set 2, timestamp set 3, timestamp set 4 and timestamp set 5, group 3 contains timestamp set 5, timestamp set 6, timestamp set 7 and timestamp set 8, and group 4 contains timestamp set 7, timestamp set 8, timestamp set 9 and timestamp set 10.
[0056] Possibly, N = 10, P = 3, the number of timestamp sets of each group is not equal, and the timestamp sets contained by each group are not repeated. The 10 timestamp sets are respectively: timestamp set 1, timestamp set 2, …, timestamp set 10; the number of timestamp sets of group 1 is 2, and group 1 contains timestamp set 1 and timestamp set 2; the number of timestamp sets of group 2 is 3, and group 2 contains timestamp set 3, timestamp set 4 and timestamp set 5; the number of timestamp sets of group 3 is 5, and group 3 contains timestamp set 6, timestamp set 7, timestamp set 8, timestamp set 9 and timestamp set 10.
[0057] Possibly, N = 10, P = 3, the number of timestamp sets of each group is not equal, and the timestamp sets contained by each group are repeated. The 10 timestamp sets are respectively: timestamp set 1, timestamp set 2, …, timestamp set 10; the number of timestamp sets of group 1 is 3, and group 1 contains timestamp set 1, timestamp set 5 and timestamp set 6; the number of timestamp sets of group 2 is 4, and group 2 contains timestamp set 1, timestamp set 2, timestamp set 3 and timestamp set 4; the number of timestamp sets of group 3 is 5, and the timestamp sets of group 3 contain timestamp set 2, timestamp set 7, timestamp set 8, timestamp set 9 and timestamp set 10.
[0058] In a possible embodiment, obtaining P groups based on N timestamp sets can include:
[0059] K groups are obtained by randomly selecting K (wherein K < N) timestamp sets from N timestamp sets for P times, wherein the number of timestamp sets in each group is K, and each group includes K different timestamp sets.
[0060] In the process of selecting K timestamp sets each time, the measuring device obtains a current time value, then performs a hash operation on the current time value to obtain a hash value, then takes the modulus of the number N of the hash value to obtain a remainder i, the value range of the remainder i is 0 ~ N-1, the remainder i is used as the serial number of the timestamp set, the timestamp set corresponding to the remainder i is used as the reference timestamp set, the reference timestamp set and the previous K-1 timestamp sets of the reference timestamp set are used as the K timestamp sets selected this time, if the number of timestamp sets before the reference timestamp set is less than K-1, the remaining number of timestamp sets are taken from the tail of the N timestamp sets. Or, the reference timestamp set and the next K-1 timestamp sets of the reference timestamp set are used as the K timestamp sets selected this time, if the number of timestamp sets after the reference timestamp set is less than K-1, the remaining number of timestamp sets are taken from the head of the N timestamp sets.
[0061] Possibly, in the current random selection process, the current time value is obtained as November 7, 2020, 13:39:00, and the hash value obtained by performing a hash operation on the current time value is 65538. Let N = 10, K = 4, and the serial numbers of timestamp set 1 ~ timestamp set 10 are 0 ~ 9 respectively. The hash value 65538 obtained by calculation is taken modulo 10 to obtain a remainder of 8, that is, the serial number of the reference timestamp set is 8, and the timestamp set with serial number 8 and the three timestamp sets with serial numbers 5 ~ 7, that is, timestamp set 6, timestamp set 7, timestamp set 8 and timestamp set 9, are used as the four timestamp sets selected this time.
[0062] Possibly, in the current random selection process, the current time value is obtained as November 7, 2020, 13:44:01, and the hash value obtained by performing a hash operation on the current time value is 62539. Let N = 10, K = 4, and the serial numbers of timestamp set 1 ~ 10 are 0 ~ 9 respectively, and the hash value 62539 is taken modulo 10 to obtain a remainder of 9. There are no three timestamp sets after the timestamp set with serial number 9, so the remaining three timestamp sets are taken from the head, then timestamp set 10, timestamp set 1, timestamp set 2 and timestamp set 3 are used as the four timestamp sets selected this time.
[0063] It should be noted that the above embodiment of randomly selecting K timestamp sets from N timestamp sets is only for illustration, and any method can be used to randomly select K timestamp sets, for example, a numerical probability algorithm, a Monte Carlo algorithm, a Las Vegas algorithm or a Shewood algorithm can be used to randomly select a specified number of timestamp sets, and the embodiment of the present application is not limited thereto.
[0064] In a possible implementation, the following rules are used to obtain P groups from N timestamp sets:
[0065] The P groups are group 1, group 2, …, and group P, and the N timestamp sets are timestamp set 1, timestamp set 2, …, and timestamp set N; P = N-K+1.
[0066] Group 1 includes timestamp set 1, timestamp set 2, …, and timestamp set K, group 2 includes timestamp set 2, timestamp set 3, …, and timestamp set K+1, …, and group N-K+1 includes timestamp set N-K+1, timestamp set N-K+2, …, and timestamp set N.
[0067] For example, N = 10 and K = 4, then P = 10-4+1 = 7, and the 10 timestamp sets are timestamp set 1, timestamp set 2, …, and timestamp set 10; the number of timestamp sets in each group is 4, group 1 includes timestamp set 1 to timestamp set 4, group 2 includes timestamp set 2 to timestamp set 5, group 3 includes timestamp set 3 to timestamp set 6, group 4 includes timestamp set 4 to timestamp set 7, group 5 includes timestamp set 5 to timestamp set 8, group 6 includes timestamp set 6 to timestamp set 9, and group 7 includes timestamp set 7 to timestamp set 10.
[0068] It can be understood that in the above embodiment, the interval between the serial numbers of the first timestamp sets of the two connected groups is 1, and the present application can set the interval to a value greater than 1 as needed, for example, group 1 includes timestamp set 1 to timestamp set 4, group 2 includes timestamp set 3 to timestamp set 6, and so on.
[0069] The above embodiment of the present application can avoid the situation that the selected timestamp sets in some groups may be the same when P > N-K+1. Therefore, the embodiment of the present application can divide the N timestamp sets into P groups, and further perform integral processing on each group of timestamp sets to implement the multi-pulse integration process of the echo signal, which not only increases the multiplexing rate of effective timestamp data, but also saves the repetitive work caused by the complete same timestamp sets selected in the groups, and effectively improves the efficiency of obtaining the time of flight.
[0070] In a possible design, the number of timestamp sets in each group is equal or close.
[0071] The timestamp quantity represents the total number of timestamps in a timestamp set. In the process of obtaining P groups based on N timestamp sets, the number of timestamps in each timestamp set is counted, and the number of timestamps in each group is as equal as possible or as close as possible. Close means that the number of timestamps in any two groups is not greater than a specified number threshold. According to the above rules, P groups are obtained from N timestamp sets, which can balance the data amount of each group and facilitate the application of parallel computing structure.
[0072] In a possible embodiment, before obtaining P groups based on N timestamp sets, the following steps are further included:
[0073] Count the number of timestamps corresponding to each of the N timestamp sets.
[0074] Arrange the N timestamp sets in descending order or ascending order according to the number of timestamps.
[0075] It can be understood that arranging the N timestamp sets in ascending order or descending order facilitates the combination of the required timestamp sets when generating P groups according to the rule that the number of timestamps is equal or close.
[0076] S203, accumulate the timestamp sets included in each group to obtain P first intermediate timestamp sets.
[0077] For each group, the integration periods of the timestamp sets in the group are equal. Before accumulating the timestamp sets in the group, the integration periods corresponding to the timestamp sets are aligned, that is, the start time of the integration periods corresponding to the timestamp sets coincide with each other and the end time of the integration periods coincide with each other. Then, the timestamp sets in the group are merged to obtain a first intermediate timestamp set. For example, a group includes timestamp set 1 and timestamp set 2, timestamp set 1 includes timestamps t0 and t1, and timestamp set 2 includes timestamps t4 and t6. Then, the two timestamp sets in the first group are accumulated to obtain a corresponding first intermediate timestamp set: t0, t1, t4, t6.
[0078] In a possible implementation, accumulating the timestamp sets included in each group to obtain P first intermediate timestamp sets can include:
[0079] Start P accumulation processing threads, and call the P accumulation processing threads to accumulate the timestamp sets included in each group in parallel to obtain P first intermediate timestamp sets.
[0080] When accumulating the timestamp sets in the P groups, the parallel mode can be used to execute the P accumulation processing threads at the same time, thereby reducing the processing time.
[0081] For example, see Figure 3 As shown, the number of timestamp sets obtained is N. The N integration periods are divided into P groups, each group containing K timestamp sets. Each timestamp set corresponds to one integration period. The number of groups is P = N - K + 1. Group 1 contains timestamp set 1 (corresponding to the 1st integration period) to timestamp set K (corresponding to the Kth integration period). The generation process of the first intermediate timestamp set 1 is as follows: The timestamp set corresponding to the 1st integration period (timestamp set 1) can include 6 timestamps. The time interval t between any two adjacent timestamps in any timestamp set is, specifically, the width of the time interval t is an integer multiple of the TDC resolution. The timestamp set corresponding to the 2nd integration period (timestamp set 2) includes 6 timestamps, ..., the timestamp set corresponding to the Kth integration period (timestamp set K) includes 6 timestamps. The start time of the 1st integration period to the Kth integration period is 0, and the end time is T0. The 1st integration period to the Kth integration period are aligned, and then the K timestamp sets in the group are accumulated to obtain the first intermediate timestamp set 1. Similarly, the timestamp set corresponding to the N-K+1th integration period is accumulated to obtain the first intermediate timestamp set P.
[0082] S204. Filter each set of first intermediate timestamps to obtain P sets of second intermediate timestamps.
[0083] The filtering process includes: using a sliding window of preset width to move over time to achieve filtering. Specifically, starting from the first intermediate timestamp set at the beginning of the time, the sliding window moves in increments equal to the width of the window. Then, the number of timestamps covered by the window each time is counted. If the number is less than a threshold, the timestamps within the current window are filtered out; if the number is greater than or equal to the threshold, the timestamps within the current window are retained. Optionally, the threshold for each group is related to the total number of timestamps in the timestamp set. For example, the total number of timestamps in the group's timestamp set is equal to the threshold, or it is the total number of timestamps in the group's timestamp set minus 1. Furthermore, if the total number of timestamps in the timestamp sets of each group is equal, then the thresholds for each group are also equal. Optionally, the width of the sliding window is also related to the number of timestamps in the group's timestamp set, and the width of the sliding window can be an integer multiple of the minimum time resolution of the TDC. For example, the width of the sliding window can be greater than or equal to K times the minimum time resolution of the TDC, where K is an integer greater than 1.
[0084] For example, see Figure 4 As shown, the minimum time resolution of TDC is 2 when the quantity threshold is 2 and the width of the sliding window is 4 times. Figure 4The first dashed box in the first intermediate timestamp set is the position of the current time window on the integration period of the first intermediate timestamp set, which can be denoted as time window 1. The number of timestamps (corresponding to echo signals) in the time window 1 is 2, which satisfies the condition of being greater than or equal to the number threshold 2. Therefore, all timestamps in the time window 1 are retained. Figure 4 The second dashed box in the first intermediate timestamp set is the position of the next time window of the sliding window, which can be denoted as time window 2. The number of timestamps covered by the time window 2 is 1, which is less than the number threshold 2. Therefore, all timestamps in the time window 2 are filtered out. After the first intermediate timestamp set is filtered by the sliding window, the second intermediate timestamp set is obtained. Figure 4
[0085] S205, accumulate the P second intermediate timestamp sets to obtain a coherent timestamp set.
[0086] The time lengths of the P second intermediate timestamp sets are aligned and equal. The coherent timestamp set obtained by accumulating the P second intermediate timestamp sets is a summary of all timestamps in the P second intermediate timestamp sets.
[0087] For example, as shown in Figure 5 , the second intermediate timestamp set 1 to the second intermediate timestamp set P are accumulated, and the specific accumulation process can refer to the accumulation process of Figure 3 . For details, refer to the description of Figure 3 . Details are not described here.
[0088] S206, generate histogram data based on the coherent timestamp set.
[0089] The count values of each timestamp in the coherent timestamp set are counted to generate histogram data. The histogram data includes two dimensions: timestamps and count values (i.e., occurrence times) of each timestamp.
[0090] For example, as shown in Figure 6 and Figure 7 , the histogram data, Figure 6 is the histogram before coherent processing. Due to the influence of noise signals, the peak value in the histogram is not prominent. Figure 7 is the histogram data obtained after coherent processing based on multi-pulse integration. As can be seen from Figure 7 , the count values other than the peak value are suppressed, and the peak value is more prominent. The time corresponding to the peak value is about 400 ns.
[0091] S207, determine the time of flight according to the histogram data.
[0092] The time stamp with the maximum count value in the histogram data is taken as a signal receiving time, and the time of flight is calculated based on the transmission time of the pulse signal and the receiving time of the echo signal, for example, the time stamp with the maximum count value in the histogram data is t1, and the transmission time of the pulse signal is t0, so that the time of flight t1-t0 can be obtained, and then the distance between the detector and the target object can be calculated according to the time of flight and the speed of light.
[0093] It can be understood that the embodiment of the application can use a time-to-digital converter to collect a plurality of timestamp sets, divide the plurality of timestamp sets into a plurality of groups, and accumulate the timestamp sets in each group to obtain a first intermediate timestamp set. Further, a preset width sliding window is used to screen each first intermediate timestamp set to obtain a second intermediate timestamp set. The histogram data is generated according to the timestamp accumulated by the plurality of second intermediate timestamp sets. Thus, the peak position of the count value of the histogram data can be used to determine the time of flight. In this way, the count value of the timestamp corresponding to the echo signal in the histogram data can remain basically unchanged, and the count value of the timestamp corresponding to the noise signal can be suppressed. Not only can the signal-to-background noise ratio (SBNR) of the distance detector be improved, but also the accuracy of measuring the time of flight of the distance detector can be effectively improved.
[0094] The above describes in detail a time-of-flight measuring device of the embodiment of the application. A time-of-flight measuring device (hereinafter referred to as device 8) of the embodiment of the application is provided below.
[0095] Figure 8 The device 3 shown can achieve Figure 2 The time-of-flight measuring device of the embodiment shown, the device 8 includes an acquisition unit 801, a grouping unit 802, an accumulation unit 803, a screening unit 804, a generation unit 805, and a calculation unit 806.
[0096] The acquisition unit 801 is configured to acquire N timestamp sets; wherein N is an integer greater than 1, each timestamp set includes a plurality of timestamps, and one timestamp set corresponds to one integration period;
[0097] The grouping unit 802 is configured to obtain P groups based on the N timestamp sets; wherein P is a positive integer, P
[0098] The accumulation unit 803 is configured to accumulate the timestamp sets included in each group to obtain P first intermediate timestamp sets;
[0099] The screening unit 804 is configured to perform screening processing on each first intermediate timestamp set to obtain P second intermediate timestamp sets; the screening processing includes: moving a sliding window with a preset width on the time length to perform screening, if the number of timestamps covered by the sliding window is less than a number threshold, the timestamps in the sliding window are filtered out; if the number of timestamps covered by the sliding window is greater than or equal to the number threshold, the timestamps in the sliding window are retained;
[0100] The accumulation unit 803 is further configured to perform accumulation processing on the P second intermediate timestamp sets to obtain a coherent timestamp set.
[0101] The generation unit 805 is configured to obtain histogram data according to the coherent timestamp set.
[0102] The calculation unit 806 is configured to determine a time of flight according to the histogram data.
[0103] In one or more embodiments, the number of timestamp sets in each group is equal, and the number threshold corresponding to each group is related to the number of timestamp sets.
[0104] In one or more embodiments, the P groups are obtained based on the N timestamp sets, including:
[0105] randomly selecting K timestamp sets from the N timestamp sets, repeating P times to obtain P groups; wherein the number of timestamp sets in each group is K, K < N, and each group includes K different timestamp sets.
[0106] In one or more embodiments, the P groups are group 1, group 2, …, and group P, and the N timestamp sets are timestamp set 1, timestamp set 2, …, and timestamp set N; P = N-K+1.
[0107] Group 1 includes timestamp set 1, timestamp set 2, …, and timestamp set K, group 2 includes timestamp set 2, timestamp set 3, …, and timestamp set K+1, …, and group N-K+1 includes timestamp set N-K+1, timestamp set N-K+2, …, and timestamp set N.
[0108] In one or more embodiments, the length of the sliding window is greater than or equal to an integer multiple of the minimum time resolution of the TDC.
[0109] In one or more embodiments, the number of timestamps in each group is equal or close.
[0110] In one or more embodiments, the accumulation processing on the timestamp sets included in each group to obtain P first intermediate timestamp sets includes:
[0111] P accumulation processing threads are started, and the P accumulation processing threads are called to accumulate the timestamp sets included in each group to obtain P first intermediate timestamp sets;
[0112] The screening processing of each first intermediate timestamp set to obtain P second intermediate timestamp sets comprises:
[0113] P screening processing threads are started, and the P screening processing threads are called to screen each first intermediate timestamp set to obtain P second intermediate timestamp sets.
[0114] In one or more embodiments, further comprising:
[0115] A sorting unit (not shown in the figure) is configured to count the number of timestamps corresponding to each of the N timestamp sets;
[0116] The N timestamp sets are arranged in descending order or ascending order according to the number of timestamps.
[0117] In one or more embodiments, the histogram data comprises a plurality of timestamps and a count value of each timestamp.
[0118] In one or more embodiments, the determination of the time of flight according to the histogram data comprises:
[0119] The timestamp with the largest count value in the histogram data is taken as the receiving time of the echo signal;
[0120] The time of flight is calculated based on the transmitting time of the pulse signal and the receiving time of the echo signal.
[0121] The method embodiments of the present application and Figures 1A-7 The method embodiments of the present application and Figures 1A-7 The method embodiments of the present application and
[0122] The device 8 can be a field-programmable gate array (FPGA), an application-specific integrated chip, a system on chip (SoC), a central processing unit (CPU), a network processor (NP), a digital signal processing circuit, a micro controller unit (MCU), and can also be a programmable logic device (PLD) or other integrated chip.
[0123] The above describes a time-of-flight measurement method according to an embodiment of the present application. A time-of-flight measurement device (hereinafter referred to as device 9) according to an embodiment of the present application is provided below.
[0124] Figure 9 A device structure diagram according to an embodiment of the present application is provided below, which is referred to as device 9. Device 9 can be integrated into a laser radar or a bearing platform according to the above embodiment, as shown in the figure. The device includes a memory 902 and a processor 901. Figure 9
[0125] Memory 902 can be an independent physical unit connected to processor 901 through a bus. Memory 902 and processor 901 can also be integrated together and implemented by hardware, etc.
[0126] Optionally, device 9 can also include a transmitter and a receiver. The transmitter is used to transmit a laser signal, and the receiver is used to receive a laser signal.
[0127] Memory 902 is used to store programs for implementing the above method embodiments or various modules of the device embodiments. Processor 901 calls the programs to perform the operations of the above method embodiments:
[0128] Obtain N timestamp sets; wherein N is an integer greater than 1, each timestamp set includes multiple timestamps, and one timestamp set corresponds to one integration period;
[0129] Obtain P groups based on the N timestamp sets; wherein P < N, P is a positive integer, and each group includes at least two timestamp sets;
[0130] Accumulate the timestamp sets included in each group to obtain P first intermediate timestamp sets;
[0131] Select each first intermediate timestamp set to obtain P second intermediate timestamp sets; wherein the selection process includes moving a sliding window with a preset width in time length to achieve selection. If the number of timestamps covered by the sliding window is less than a number threshold, the timestamps in the sliding window are filtered out. If the number of timestamps covered by the sliding window is greater than or equal to the number threshold, the timestamps in the sliding window are retained;
[0132] Accumulate the P second intermediate timestamp sets to obtain a coherent timestamp set;
[0133] Obtain histogram data according to the coherent timestamp set;
[0134] Determine the time of flight according to the histogram data.
[0135] In one or more embodiments, the number of timestamp sets in each group is equal, and the number threshold corresponding to each group is related to the number of timestamp sets.
[0136] In one or more embodiments, the processor 901 performs the grouping of the N timestamp sets into P groups based on the N timestamp sets, including:
[0137] randomly selecting K timestamp sets from the N timestamp sets, repeating P times to obtain P groups; wherein the number of timestamp sets in each group is K, K < N, and each group includes K different timestamp sets.
[0138] In one or more embodiments, the P groups are group 1, group 2, …, group P, and the N timestamp sets are timestamp set 1, timestamp set 2, …, timestamp set N; P = N-K+1.
[0139] Group 1 includes timestamp set 1, timestamp set 2, …, timestamp set K, group 2 includes timestamp set 2, timestamp set 3, …, timestamp set K+1, …, and group N-K+1 includes timestamp set N-K+1, timestamp set N-K+2, …, timestamp set N.
[0140] In one or more embodiments, the length of the sliding window is greater than or equal to an integer multiple of the minimum time resolution of the TDC.
[0141] In one or more embodiments, the number of timestamps in each group is equal or close.
[0142] In one or more embodiments, the processor 901 performs the accumulation processing of the timestamp sets included in each group to obtain P first intermediate timestamp sets, including:
[0143] starting P accumulation processing threads, and calling the P accumulation processing threads to perform accumulation processing on the timestamp sets included in each group to obtain P first intermediate timestamp sets;
[0144] In one or more embodiments, the processor 901 performs the screening processing of each first intermediate timestamp set to obtain P second intermediate timestamp sets, including:
[0145] starting P screening processing threads, and calling the P screening processing threads to perform screening processing on each first intermediate timestamp set to obtain P second intermediate timestamp sets.
[0146] In one or more embodiments, the processor 901 is further configured to perform:
[0147] counting the number of timestamps corresponding to each of the N timestamp sets;
[0148] Sort the N timestamp sets in descending or ascending order based on the number of timestamps.
[0149] In one or more embodiments, the histogram data includes multiple timestamps and count values for each timestamp.
[0150] In one or more embodiments, processor 901 performs the determination of flight time based on the histogram data, including:
[0151] The timestamp with the largest count value in the histogram data is taken as the time of reception of the echo signal;
[0152] The flight time is calculated based on the transmission time of the pulse signal and the reception time of the echo signal.
[0153] This application's embodiments and Figure 2 The embodiments are based on the same concept and bring about the same technical effects. The specific process can be referred to Figure 2 The description of the embodiments will not be repeated here.
[0154] In some or all of the flight time measurement methods described in the above embodiments, the apparatus may consist only of a processor. A memory for storing the program is located outside the apparatus, and the processor is connected to the memory via circuitry / wires to read and execute the program stored in the memory.
[0155] The processor can be a central processing unit (CPU), a network processor (NP), or a combination of a CPU and an NP.
[0156] The processor may further include hardware chips. These hardware chips may be application-specific integrated circuits (ASICs), programmable logic devices (PLDs), or combinations thereof. The PLDs may be complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), generic array logic (GALs), or any combination thereof.
[0157] The memory can include volatile memory (e.g., random-access memory (RAM)), non-volatile memory (e.g., flash memory, hard disk drive (HDD), or solid-state drive (SSD)), or combinations thereof.
[0158] In the above embodiments, the sending unit or transmitter performs the steps of sending in each of the above method embodiments, and the receiving unit or receiver performs the steps of receiving in each of the above method embodiments, and other steps are performed by other units or processors. The sending unit and the receiving unit can constitute a transceiving unit, and the receiver and the transmitter can constitute a transceiver.
[0159] The embodiments of the present application further provide a computer storage medium storing a computer program, and the computer program is used for executing the time-of-flight measurement method provided in the above embodiments.
[0160] The embodiments of the present application further provide a computer program product containing instructions, which, when executed on a computer, cause the computer to perform the time-of-flight measurement method provided in the above embodiments.
[0161] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage media, etc.) containing computer-usable program code.
[0162] The present application is described with reference to the flowcharts and / or block diagrams of the method, device (system), and computer program product according to the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of the flows and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing apparatus to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing apparatus produce the functions specified in the flowcharts and / or block diagrams one or more flows and / or blocks.
[0163] These computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture including instructions which implement the function specified in the flowchart or flowchart(s) and / or block diagram block or blocks.
[0164] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart or flowchart(s) and / or block diagram block or blocks.
Claims
1. A method of measuring time of flight, characterized by, The method comprises the following steps: acquiring N timestamp sets; wherein N is an integer greater than 1, each timestamp set comprises a plurality of timestamps, and one timestamp set corresponds to one integration period; obtaining P groups based on the N timestamp sets; wherein P is a positive integer less than N, each group comprises at least two timestamp sets; performing accumulation processing on the timestamp sets included in each group to obtain P first intermediate timestamp sets; performing screening processing on each first intermediate timestamp set to obtain P second intermediate timestamp sets; wherein the screening processing comprises: moving a sliding window with a preset width on the time length to realize screening, if the number of timestamps covered by the sliding window is less than a number threshold, filtering out the timestamps in the sliding window; if the number of timestamps covered by the sliding window is greater than or equal to the number threshold, retaining the timestamps in the sliding window; performing accumulation processing on the P second intermediate timestamp sets to obtain a coherent timestamp set; obtaining histogram data according to the coherent timestamp set; determining a time of flight according to the histogram data.
2. The method of claim 1, wherein, The number of timestamp sets in each group is equal, and the number threshold corresponding to each group is related to the number of timestamp sets.
3. The method of claim 1, wherein, The obtaining of the P groups based on the N timestamp sets comprises: randomly selecting K timestamp sets from the N timestamp sets, repeating P times to obtain the P groups; wherein the number of timestamp sets in each group is K, K is less than N, and each group comprises K different timestamp sets.
4. The method of claim 1, wherein, The P groups are group 1, group 2, …, and group P, and the N timestamp sets are timestamp set 1, timestamp set 2, …, and timestamp set N; P = N-K+1. Group 1 comprises timestamp set 1, timestamp set 2, …, and timestamp set K, group 2 comprises timestamp set 2, timestamp set 3, …, and timestamp set K+1, …, and group N-K+1 comprises timestamp set N-K+1, timestamp set N-K+2, …, and timestamp set N.
5. The method of claim 1, wherein, The length of the sliding window is greater than or equal to an integer multiple of the minimum time resolution of the TDC.
6. The method of claim 1, wherein, The number of timestamps in each group is equal or similar.
7. The method of claim 1, wherein, The accumulation processing on the timestamp sets included in each group to obtain the P first intermediate timestamp sets comprises: starting P accumulation processing threads, and calling the P accumulation processing threads to perform accumulation processing on the timestamp sets included in each group to obtain the P first intermediate timestamp sets. The screening processing on each first intermediate timestamp set to obtain the P second intermediate timestamp sets comprises: starting P screening processing threads, and calling the P screening processing threads to perform screening processing on each first intermediate timestamp set to obtain the P second intermediate timestamp sets.
8. The method according to any one of claims 1 to 7, characterized in that, Before the obtaining of the P groups based on the N timestamp sets, the method further comprises: counting the number of timestamps corresponding to each of the N timestamp sets; arranging the N timestamp sets in descending order or ascending order according to the number of timestamps.
9. The method of claim 1, wherein, The histogram data comprises a plurality of timestamps and a count value of each timestamp.
10. The method of claim 1, wherein, The determination of the time of flight according to the histogram data comprises: taking the timestamp with the largest count value in the histogram data as the receiving moment of the echo signal. The time of flight is calculated based on a time of emission of the pulse signal and a time of reception of the echo signal.
11. A time-of-flight measurement device, characterized by The method comprises the steps of: acquiring N sets of time stamps, wherein N is an integer greater than 1, each set of time stamps comprises a plurality of time stamps, and one set of time stamps corresponds to one integration period; grouping the N sets of time stamps to obtain P groups, wherein P is a positive integer less than N, each group comprises at least two sets of time stamps; accumulating the sets of time stamps included in each group to obtain P first intermediate sets of time stamps; screening each first intermediate set of time stamps to obtain P second intermediate sets of time stamps, wherein the screening process comprises: moving a sliding window with a preset width in time length to realize screening, if the number of time stamps covered by the sliding window is less than a number threshold, the time stamps in the sliding window are filtered out, if the number of time stamps covered by the sliding window is greater than or equal to the number threshold, the time stamps in the sliding window are retained; accumulating the P second intermediate sets of time stamps to obtain a set of coherent time stamps; generating histogram data according to the set of coherent time stamps; calculating the time of flight according to the histogram data.
12. A computer storage medium, characterized in that The computer storage medium stores a computer program, when the computer program runs on a computer, the computer executes the method as claimed in any one of claims 1 to 10.
13. A time-of-flight measurement device, characterized by The method comprises the steps of: a processor and a memory, the memory is used to store a computer program or instructions, and the processor is used to execute the computer program or instructions in the memory to realize the method as claimed in any one of claims 1 to 10.
Citation Information
Patent Citations
Distance measurement method, system and device
CN112255636A
Time-of-flight distance measurement method, system and equipment
CN112924981A