Trajectory splicing method, trajectory splicing device and electronic equipment
Patent Information
- Application Number
- CN202111234518.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-22
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2041-10-22
Smart Images

Figure CN116012405B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of information processing technology, and in particular relates to a trajectory stitching method, trajectory stitching device, electronic device and computer-readable storage medium. Background Technology
[0002] Because the detection range of trajectory detectors is limited, multiple trajectory detectors are often required to form a network to detect the trajectory of each target along the entire road segment. However, the detection operation performed by trajectory detectors inevitably has a certain degree of error, which means that when different trajectory detectors track the continuous movement of the same target, the obtained trajectories cannot be perfectly matched. Summary of the Invention
[0003] This application provides a trajectory stitching method, trajectory stitching device, electronic device, and computer-readable storage medium, which can stitch together the trajectories of the same target generated on different road segments.
[0004] Firstly, this application provides a trajectory stitching method, including:
[0005] Acquire the first trajectory detected by the first trajectory detector and the second trajectory detected by the second trajectory detector;
[0006] The detection results are obtained by detecting whether there is an overlap between the trajectory region corresponding to the first trajectory and the trajectory region corresponding to the second trajectory.
[0007] Based on the above detection results, select the corresponding trajectory judgment method to determine whether the first trajectory and the second trajectory are generated by the same target.
[0008] If it is determined that the first trajectory and the second trajectory are generated by the same target, then the first trajectory and the second trajectory are spliced together.
[0009] Secondly, this application provides a trajectory stitching device, comprising:
[0010] The acquisition module is used to acquire the first trajectory detected by the first trajectory detector and the second trajectory detected by the second trajectory detector;
[0011] The detection module is used to detect whether there is an overlapping area between the trajectory area corresponding to the first trajectory and the trajectory area corresponding to the second trajectory, and to obtain the detection result;
[0012] The judgment module is used to select the corresponding trajectory judgment method based on the above detection results to determine whether the first trajectory and the second trajectory are generated by the same target.
[0013] The stitching module is used to stitch the first trajectory and the second trajectory together if it is determined that the first trajectory and the second trajectory are generated by the same target.
[0014] Thirdly, this application provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the method described in the first aspect.
[0015] Fourthly, this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method described in the first aspect above.
[0016] Fifthly, this application provides a computer program product comprising a computer program that, when executed by one or more processors, implements the steps of the method described in the first aspect.
[0017] The beneficial effects of this application compared to the prior art are as follows: After acquiring the first trajectory detected by the first trajectory detector and the second trajectory detected by the second trajectory detector, the system first detects whether there is an overlapping area between the trajectory area corresponding to the first trajectory and the trajectory area corresponding to the second trajectory, obtaining the detection result. Then, based on the detection result, a corresponding trajectory judgment method can be selected to determine whether the first trajectory and the second trajectory are generated by the same target. Once it is determined that the first trajectory and the second trajectory are generated by the same target, the first trajectory and the second trajectory are spliced together. This application divides the application scenarios of the two trajectories to be judged into two main categories: one is where the trajectory areas corresponding to the two trajectories overlap, and the other is where the trajectory areas corresponding to the two trajectories do not overlap. Based on the actual detection results, it determines which type the two trajectories to be judged belong to. Thus, a corresponding trajectory judgment method can be selected to judge whether the two trajectories are generated based on the same target, which can more accurately determine the trajectory generated by the same target on different road segments. Furthermore, through the final trajectory splicing operation, the continuity of the trajectory generated by the same target on different road segments can be guaranteed, avoiding trajectory interruption. It is understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant descriptions in the first aspect mentioned above, and will not be repeated here. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is a schematic diagram illustrating the implementation process of the trajectory stitching method provided in the embodiments of this application;
[0020] Figure 2 These are example diagrams showing overlapping and non-overlapping areas of the road segments covered by the radar provided in this application embodiment;
[0021] Figure 3 This is an example diagram of the trajectory points and detection time of the first and second trajectories in the overlapping area provided in the embodiments of this application;
[0022] Figure 4 This is an example diagram of trajectory correction provided in the embodiments of this application;
[0023] Figure 5 This is a structural block diagram of the trajectory stitching device provided in the embodiments of this application;
[0024] Figure 6 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0025] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0026] To illustrate the technical solution proposed in this application, specific embodiments are described below.
[0027] The trajectory stitching method proposed in this application embodiment is described below using a vehicle as an example. It is understood that when applying the trajectory stitching method proposed in this application embodiment, the target can also be other objects, such as pedestrians, animals, or means of transportation other than vehicles. This application embodiment does not limit the type of target.
[0028] Please see Figure 1 The implementation process of this trajectory stitching method is detailed below:
[0029] Step 101: Obtain the first trajectory detected by the first trajectory detector and the second trajectory detected by the second trajectory detector.
[0030] In this embodiment, the first trajectory detector and the second trajectory detector specifically refer to adjacent or nearby trajectory detectors on the road. As an example only, the trajectory detector can be a radar sensor; or it can be other sensors capable of detecting vehicle trajectories. The type of trajectory detector is not limited here. It is understood that all trajectory detectors can request time synchronization from the same device (e.g., a server), thereby achieving time synchronization of all trajectory detectors and ensuring consistency of detection time.
[0031] Each trajectory detector can perform multi-target detection within its detection range, thereby detecting the polar coordinates of each vehicle at each detection time. Then, the trajectory detector can transform the polar coordinates of each vehicle at each detection time to the regional coordinate system established within its detection range, thus obtaining the trajectory of each vehicle within its detection range. Finally, the trajectory detector can either transform the trajectory to the world coordinate system to obtain the final trajectory of each vehicle and send it to the electronic device; or, the trajectory detector can send the trajectories of each vehicle within its detection range to the electronic device, which then transforms the trajectory to the world coordinate system to obtain the final trajectory of each vehicle. It can be understood that both the first and second trajectories can be obtained by the corresponding trajectory detectors using the above methods.
[0032] For ease of understanding, the following description uses the example of the second trajectory detector being located downstream of the road and the first trajectory detector being located upstream of the road to illustrate the various steps of the embodiments of this application. That is, when a vehicle travels on the road in the direction prescribed by the road, the first trajectory detector will first detect the vehicle's trajectory on the upstream section of the road (i.e., the vehicle will first enter the detection range of the first trajectory detector), and then the second trajectory detector will detect the vehicle's trajectory on the downstream section of the road (i.e., the vehicle will later enter the detection range of the second trajectory detector). Of course, in actual application scenarios, the second trajectory detector can also be located upstream of the road and the first trajectory detector can be located downstream of the road; this is not limited here.
[0033] Step 102: Detect whether there is an overlapping area between the trajectory area corresponding to the first trajectory and the trajectory area corresponding to the second trajectory, and obtain the detection result.
[0034] In this embodiment, the trajectory area corresponding to the first trajectory can be equated to the road segment range covered by the first trajectory detector (i.e., the detection range of the first trajectory detector), and the trajectory area corresponding to the second trajectory can be equated to the road segment range covered by the second trajectory detector (i.e., the detection range of the second trajectory detector). That is, this step can be considered to detect whether the road segment range covered by the first trajectory detector overlaps with the road segment range covered by the second trajectory detector. Please refer to [link to relevant documentation]. Figure 2 Taking radar as an example of a trajectory detector, Figure 2 Examples of overlapping and non-overlapping areas covered by radar are given.
[0035] In some embodiments, the electronic device can detect the existence of an overlapping region based on the trajectory point in the first trajectory that is closest to the second trajectory detector (usually also the last trajectory point in the first trajectory, i.e., the trajectory point with the latest detection time in the first trajectory) and the trajectory point in the second trajectory that is closest to the first trajectory detector (usually also the first trajectory point in the second trajectory, i.e., the trajectory point with the earliest detection time in the second trajectory), specifically:
[0036] From the perspective of distance to the second track detector, if the distance between the last track point in the first track and the second track detector is less than the distance between the first track point in the second track and the second track detector; that is, the last track point in the first track is closer to the second track detector than the first track point in the second track, then an overlapping area is considered to exist.
[0037] Conversely, from the perspective of distance from the first trajectory detector, if the distance between the first trajectory point in the second trajectory and the first trajectory detector is less than the distance between the last trajectory point in the first trajectory and the first trajectory detector; that is, the last trajectory point in the first trajectory is farther from the first trajectory detector than the first trajectory point in the second trajectory, then an overlapping area is considered to exist.
[0038] Alternatively, the detection ranges of the first and second radar detectors can be measured in advance. Based on the measurement results, it can be known in advance whether the two will overlap, and if they do overlap, the overlapping area can be determined in advance.
[0039] Step 103: Based on the above detection results, select the corresponding trajectory judgment method to determine whether the first trajectory and the second trajectory are generated by the same target.
[0040] In this embodiment, two trajectory determination methods are proposed to determine whether there is an overlapping region. Therefore, based on the detection result of the overlapping region in step 102, the corresponding trajectory determination method can be selected to determine whether the first trajectory and the second trajectory are generated by the same vehicle.
[0041] In one application scenario, for cases where there is no overlapping area, that is, if the detection result indicates that there is no overlapping area, it can be determined whether the first trajectory and the second trajectory are generated by the same vehicle based on the position of the first trajectory in the trajectory area corresponding to the first trajectory and the position of the second trajectory in the trajectory area corresponding to the second trajectory.
[0042] In one possible scenario, the first trajectory detector detects only one vehicle, and after that vehicle enters the road segment covered by the second trajectory detector, the second trajectory detector also detects only one vehicle. In this case where only one vehicle is detected, regardless of the deviation between the first and second trajectories, they directly correspond to the same vehicle.
[0043] In another possible scenario, the first trajectory detector detects multiple vehicles traveling side-by-side and can determine the relative position of each vehicle corresponding to a first trajectory within these vehicles. After these vehicles enter the road segment covered by the second trajectory detector, the second trajectory detector will also detect multiple vehicles traveling side-by-side and can determine the relative position of each vehicle corresponding to a second trajectory within these vehicles. By default, in areas not covered by either of these trajectory detectors, if vehicles do not change lanes during their journey (i.e., their relative positions do not change), then the first and second trajectories with the same relative position can be directly identified as trajectories generated by the same vehicle.
[0044] As an example, suppose the first trajectory detector detects the first trajectory of three vehicles traveling side by side, and their corresponding positions on the road are the left lane, the middle lane, and the right lane, respectively; and suppose the second trajectory detector subsequently detects the second trajectory of the three vehicles traveling side by side, and their corresponding positions on the road are the left lane, the middle lane, and the right lane, respectively. Then it is confirmed that the first and second trajectories in the left lane are generated by the same vehicle, the first and second trajectories in the middle lane are generated by the same vehicle, and the first and second trajectories in the right lane are generated by the same vehicle. This is how the determination of whether the first and second trajectories are generated by the same vehicle is achieved.
[0045] In another application scenario, for cases with overlapping areas, that is, if the detection results indicate the existence of overlapping areas, the distance between the first and second trajectories within the overlapping area can be used to determine whether the first and second trajectories were generated by the same vehicle. It can be assumed that when the distance between the trajectories is sufficiently small, the first and second trajectories are relatively close, and can be preliminarily confirmed as being generated by the same vehicle.
[0046] Specifically, the distance between these trajectories is calculated as follows:
[0047] A1. Calculate the number of probe data frames corresponding to the overlapping area.
[0048] Since the time of the first and second trajectory detectors is synchronized, meaning they will perform detection operations at the same detection time, the number of detection data frames can be regarded as the number of times the first and second trajectory detectors perform detection operations in the overlapping area. The detection operation performed by the two at the same detection time is considered as one detection operation; that is, at the same detection time, the detection operation is counted only once, and the result of the count is the number of detection data frames.
[0049] Specifically, the detection data frame can be calculated as follows: obtain the detection time of the first trajectory point in the overlapping area of the first trajectory, denoted as the first detection time t. a ; Obtain the detection time of the last trajectory point in the overlapping region of the first trajectory, and denote it as the second detection time t'. a ; Obtain the detection time of the first trajectory point in the overlapping region of the second trajectory, denoted as the third detection time t. b ; Obtain the detection time of the last trajectory point of the second trajectory in the overlapping region, denoted as the fourth detection time t'. b Based on the first detection time, the second detection time, the third detection time, the fourth detection time, and the preset detection interval τ, the number of detection data frames p can be calculated. Specifically, the formula for calculating the number of detection data frames p is as follows:
[0050]
[0051] Please see Figure 3 , Figure 3 Examples of trajectory points and their detection times in the overlapping region of the first and second trajectories are given. Solid circles represent the trajectory points of the first trajectory; solid squares represent the trajectory points of the second trajectory. Figure 3 We can deduce that the first detection time is t1, the second detection time is t4, the third detection time is t2, and the fourth detection time is t5. Substituting these values into the formula for calculating the number of detection data frames, we can obtain t. ab Let t1, t a’b’ If it is t5, then based on Figure 3 Number of obtained detection data frames
[0052] A2. Based on the number of detection data frames, the coordinates of the trajectory points of the first trajectory that are not null within the overlapping area, and the coordinates of the trajectory points of the second trajectory that are not null within the overlapping area, the distance between the trajectories is calculated.
[0053] Assume a i Let b be the coordinates of the trajectory point in the overlapping region at the i-th detection time (i.e., the i-th frame of detection data). i Let a be the coordinates of the trajectory point of the second trajectory at the i-th detection time in the overlapping region. i and b i Let be the coordinates of the corresponding trajectory points (trajectory points under the same detection time). Where 1 ≤ i ≤ p, and i is an integer. When a i or b i When the value is null, it indicates that there is no comparison point at this time, and the coordinates of the trajectory points corresponding to this detection time need to be discarded when calculating the distance. Based on this, it can be recorded that the coordinates of the corresponding trajectory points are not null values under q detection times. Specifically, the formula for calculating the distance D between trajectories is as follows:
[0054]
[0055] Still with Figure 3 For example, it can be seen that in the first detection time, there are only the coordinates of the trajectory points of the first trajectory, and in the fifth detection time, there are only the coordinates of the trajectory points of the second trajectory. These coordinates will be discarded in the calculation. Therefore, in practice, only the average distance between the corresponding trajectory points in the second, third and fourth detection times is considered as the final distance between trajectories, and the value of q is 3.
[0056] It is understandable that the coordinates of a trajectory point can include not only the coordinates of the trajectory point in the world coordinate system, but also multi-dimensional information such as the vehicle's speed at that trajectory point; this is not limited here.
[0057] A3. If the distance between the above trajectories is less than the preset distance threshold between trajectories, then the first trajectory and the second trajectory are determined to be trajectories generated by the same vehicle.
[0058] As described earlier, when the distance between the trajectories is small, the first and second trajectories can be considered to be generated by the same vehicle. To address this, the electronic device can pre-set a distance threshold between trajectories and compare the calculated distance with this threshold. If the comparison finds that the distance between the trajectories is less than the threshold, it can be determined that the first and second trajectories were generated by the same vehicle.
[0059] Step 104: If it is determined that the first trajectory and the second trajectory are trajectories generated by the same target, then the first trajectory and the second trajectory are spliced together.
[0060] In this embodiment, when the detection result in step 102 indicates that there is no overlapping area, if it is determined that the first trajectory and the second trajectory are generated by the same vehicle, the last trajectory point of the first trajectory can be directly connected to the first trajectory point of the second trajectory to achieve the splicing of the first and second trajectories. When the detection result in step 102 indicates that there is an overlapping area, if it is determined that the first trajectory and the second trajectory are generated by the same vehicle, considering that the first trajectory and the second trajectory exist simultaneously in the overlapping area, it is necessary to merge the first trajectory and the second trajectory in the overlapping area to obtain a new trajectory in the overlapping area. Then, the endpoints of the new trajectory are connected to the first trajectory and the second trajectory outside the overlapping area, respectively. Specifically, the first trajectory point of the new trajectory is connected to the last trajectory point of the first trajectory outside the overlapping area, and the last trajectory point of the new trajectory is connected to the first trajectory point of the second trajectory outside the overlapping area. This ensures that the trajectory of the same vehicle will not be interrupted.
[0061] In some embodiments, the trajectory fusion operation performed within the overlapping region may specifically include:
[0062] B1. Calculate the confidence levels of the first trajectory detector and the second trajectory detector for each group of trajectory points to be fused in the overlapping region.
[0063] For ease of explanation, the trajectory points of the first and second trajectories within the overlapping region at the same detection time can be considered as a group of trajectory points. For each group of trajectory points, the confidence levels of the first and second trajectory detectors for that group can be calculated separately. The higher the confidence level, the higher the trust in the corresponding trajectory detector. This confidence level can be understood as a concept of weight.
[0064] It is understandable that the sum of the confidence level of the first trajectory detector for a set of trajectory points and the confidence level of the second trajectory detector for the same set of trajectory points is 1. That is, assuming the confidence level of the first trajectory detector for the set of trajectory points at the i-th detection time is k... i Then the confidence level of the second trajectory detector for the trajectory point group at the i-th detection time is 1-k. i .
[0065] Specifically, assuming that the first trajectory detector and the second trajectory detector have the same distance resolution and angular resolution, the confidence level k of the first trajectory detector for the trajectory point group at the i-th detection time can be calculated as follows: iBased on the coordinates of two trajectory points in the trajectory point group, calculate the first distance x between the trajectory point group and the first trajectory detector, and the second distance y between the trajectory point group and the second trajectory detector. Then, based on the first distance x, the second distance y, the preset detector distance resolution m, and the preset detector angular resolution n, calculate the confidence level k. i Specifically, the confidence level k used is... i The calculation formula is as follows:
[0066]
[0067] Understandably, while there may be errors in the coordinates of two trajectory points within a trajectory point group, these errors are not particularly large; they are negligible compared to the distances to the two trajectory detectors. Therefore, the distance between the center point of two trajectory points in a trajectory point group and the first trajectory detector can be directly used as the first distance between the trajectory point group and the first trajectory detector, and the distance between the center point and the second trajectory detector can be used as the second distance between the trajectory point group and the second trajectory detector. This allows for the calculation of the confidence levels of the first and second trajectory detectors for the trajectory point group.
[0068] B2. Based on the confidence level and the coordinates of the two trajectory points in each trajectory point group, calculate the coordinates of the new trajectory point corresponding to each trajectory point group.
[0069] B3. Generate a new trajectory based on the coordinates of the new trajectory points corresponding to each trajectory point group.
[0070] Let the new trajectory be denoted as c, then each trajectory point c in the new trajectory c... i The coordinates can be obtained using the following coordinate fusion calculation formula:
[0071]
[0072] That is, when the second trajectory is in the overlapping region at the i-th detection time, the coordinates b of the trajectory point... i When the value is empty, the coordinates c of the corresponding new trajectory point i That is, the coordinates a of the trajectory point at the i-th detection time in the overlapping region of the first trajectory. i Conversely, when the first trajectory is in the overlapping region at the i-th detection time, the coordinates a of the trajectory point... i When the value is empty, the coordinates c of the corresponding new trajectory point i That is, the coordinates b of the trajectory point of the second trajectory at the i-th detection time in the overlapping region. i When the coordinates a of the trajectory point at the i-th detection time in the overlapping region of the first trajectory i and the coordinates b of the trajectory point at the i-th detection time in the overlapping region of the second trajectory.i When none of the values are null, the coordinates c of the corresponding new trajectory point can be calculated based on the corresponding confidence level (weight). i .
[0073] In some embodiments, trajectory correction can be performed through the following process to further eliminate errors: After the trajectory fusion of the first trajectory and the second trajectory in the overlapping area is completed, the distance between the new trajectory point on the fused new trajectory and other trajectory points detected by the trajectory detector with lower accuracy at the same detection time in the overlapping area can be calculated, wherein the trajectory detector with lower accuracy refers to the trajectory detector that is farther away from the new trajectory point among the first trajectory detector and the second trajectory detector. If calculations reveal that the less precise trajectory detector, within the overlapping area and under the same detection time, detects other trajectory points (i.e., neither the first nor the second trajectory) that are closer to the new trajectory point (which can be denoted as target trajectory points), then it's possible that a single trajectory detector made a mistake. The trajectory points detected by the less precise trajectory detector can be corrected. Specifically: if the less precise trajectory detector is the first trajectory detector, then the trajectory points detected in the first trajectory under the same detection time are changed to target trajectory points (i.e., the trajectory points in the first trajectory under the same detection time are replaced with target trajectory points); if the less precise trajectory detector is the second trajectory detector, then the trajectory points detected in the second trajectory under the same detection time are changed to target trajectory points (i.e., the trajectory points in the second trajectory under the same detection time are replaced with target trajectory points). After trajectory correction, trajectory fusion operations are performed again in the overlapping area based on the corrected trajectories.
[0074] Please see Figure 4 , Figure 4 An example of trajectory correction is given. Figure 4 In the above steps, trajectory a1 detected by the first trajectory detector and trajectory a2 detected by the second trajectory detector are considered to be trajectories generated by the same target. Therefore, the electronic device can fuse trajectories a1 and a2 within the overlapping area. Assume that at the i-th detection time in the overlapping area, the trajectory point of trajectory a1 is a1. i The trajectory point of trajectory a2 is a2 i Through trajectory fusion, the corresponding new trajectory point c was obtained. i And through trajectory point a1 i and trajectory point a2 i Based on their positions, the second trajectory detector is farther away, meaning it is less accurate for this set of trajectory points. Through detection, it was found that at the i-th detection time, the second trajectory detector detected trajectory point b in trajectory b. i Distance from the new trajectory point c iIf it's closer, then it's assumed that the second trajectory detector made a mistake, and the trajectory point b... i If it belongs to trajectory a2, then trajectory point b... i Replace trajectory point a2 i That is, at the i-th detection time, the trajectory point of trajectory a2 is b. i The trajectory point of trajectory b is a2. i Then, based on the trajectory point a1 in trajectory a1 at the i-th detection time... i Trajectory point b in trajectory a2 i The fusion yields the corresponding new trajectory point c. i '.
[0075] In some embodiments, if the number of targets detected by the first trajectory detector and the second trajectory detector is different, then when performing trajectory stitching, if the first trajectory detector detects more targets, the extra detected targets will have their trajectories disappear; if the second trajectory detector detects more targets, the extra detected targets will have their trajectories generated.
[0076] It is understood that the electronic device mentioned in the embodiments of this application may be a server, a roadside unit (RSU) or other device with information processing capabilities, and the type of electronic device is not limited here.
[0077] It is understood that for any trajectory detector (whether it is the first trajectory detector or the second trajectory detector), the trajectory detector can be deployed and installed on a side pole of the road or on a gantry of the road. Furthermore, the deployment and installation methods of different trajectory detectors can be the same (e.g., both adjacent trajectory detectors are deployed and installed on side poles, or both are deployed and installed on gantry) or different (e.g., one of two adjacent trajectory detectors is deployed and installed on a side pole, and the other is deployed and installed on a gantry). That is, in practical applications, the trajectory detectors can be deployed and installed according to the road planning situation, and the embodiments of this application do not limit the deployment and installation methods of the trajectory detectors.
[0078] As can be seen from the above, through the embodiments of this application, the application scenarios of the two trajectories to be judged are divided into two main categories: one is that the trajectory areas corresponding to the two trajectories overlap, and the other is that the trajectory areas corresponding to the two trajectories do not overlap. Based on the actual detection results, it is determined which type the two trajectories to be judged belong to. Thus, the corresponding trajectory judgment method can be selected to judge whether the two trajectories are generated based on the same target, which can more accurately know the trajectory generated by the same target in different road segments. Furthermore, through the final trajectory stitching operation, the continuity of the trajectory generated by the same target in different road segments can be guaranteed, and trajectory interruption can be avoided.
[0079] Corresponding to the trajectory stitching method provided above, this application also provides a trajectory stitching device. For example... Figure 5 As shown, the trajectory stitching device 500 includes:
[0080] The acquisition module 501 is used to acquire the first trajectory detected by the first trajectory detector and the second trajectory detected by the second trajectory detector;
[0081] The detection module 502 is used to detect whether there is an overlapping area between the trajectory area corresponding to the first trajectory and the trajectory area corresponding to the second trajectory, and to obtain the detection result;
[0082] The judgment module 503 is used to select the corresponding trajectory judgment method based on the above detection results to determine whether the first trajectory and the second trajectory are generated by the same target.
[0083] The stitching module 504 is used to stitch the first trajectory and the second trajectory together if it is determined that the first trajectory and the second trajectory are generated by the same target.
[0084] Optionally, the above-mentioned judgment module 503 includes:
[0085] The first judgment unit is used to determine whether the first trajectory and the second trajectory are generated by the same target based on the distance between the first trajectory and the second trajectory in the overlapping area if the detection result indicates the existence of the overlapping area.
[0086] The second judgment unit is used to determine whether the first trajectory and the second trajectory are trajectories generated by the same target based on the position of the first trajectory in the trajectory region corresponding to the first trajectory and the position of the second trajectory in the trajectory region corresponding to the second trajectory if the detection result indicates that there is no overlapping area.
[0087] Optionally, the detection time of the first trajectory detector and the second trajectory detector are synchronized; the first judgment unit includes:
[0088] The first calculation subunit is used to calculate the number of detection data frames corresponding to the aforementioned overlapping region;
[0089] The second calculation subunit is used to calculate the distance between the trajectories based on the number of detection data frames, the coordinates of the trajectory points of the first trajectory that are not null in the overlapping area, and the coordinates of the trajectory points of the second trajectory that are not null in the overlapping area.
[0090] A sub-unit is defined to determine that if the distance between the above trajectories is less than a preset distance threshold between trajectories, the first trajectory and the second trajectory are trajectories generated by the same target.
[0091] Optionally, the first computing subunit mentioned above includes:
[0092] The time acquisition subunit is used to acquire a first detection time, a second detection time, a third detection time, and a fourth detection time, wherein the first detection time is the detection time of the first trajectory point of the first trajectory in the overlapping region, the second detection time is the detection time of the last trajectory point of the first trajectory in the overlapping region, the third detection time is the detection time of the first trajectory point of the second trajectory in the overlapping region, and the fourth detection time is the detection time of the last trajectory point of the second trajectory in the overlapping region.
[0093] The frame count calculation subunit is used to calculate the number of detection data frames based on the first detection time, the second detection time, the third detection time, the fourth detection time and the preset detection interval duration.
[0094] Optionally, the above-mentioned splicing module 504 includes:
[0095] The trajectory fusion unit is used to fuse the first trajectory in the overlapping area and the second trajectory in the overlapping area to obtain a new trajectory when the detection result indicates the existence of the overlapping area and it is determined that the first trajectory and the second trajectory are trajectories generated by the same target.
[0096] Optionally, the trajectory fusion unit mentioned above includes:
[0097] The third calculation subunit is used to calculate the confidence of the first trajectory detector and the second trajectory detector for each trajectory point group to be fused in the overlapping area, wherein a trajectory point group includes: trajectory points of the first trajectory and the second trajectory under the same detection time.
[0098] The fourth calculation subunit is used to calculate the coordinates of the new trajectory point corresponding to each trajectory point group based on the confidence level and the coordinates of the two trajectory points in each trajectory point group.
[0099] The trajectory generation subunit is used to generate a new trajectory based on the coordinates of the new trajectory points corresponding to each trajectory point group.
[0100] Optionally, the aforementioned third calculation subunit includes:
[0101] The distance calculation subunit is used to calculate, for each group of trajectory points, a first distance between the group of trajectory points and the first trajectory detector, and a second distance between the group of trajectory points and the second trajectory detector, based on the coordinates of two trajectory points in the group of trajectory points.
[0102] The confidence calculation subunit is used to calculate the confidence of the first trajectory detector and the second trajectory detector for the trajectory point group based on the first distance, the second distance, the preset detector distance resolution and the preset detector angle resolution.
[0103] As can be seen from the above, through the embodiments of this application, the application scenarios of the two trajectories to be judged are divided into two main categories: one is that the trajectory areas corresponding to the two trajectories overlap, and the other is that the trajectory areas corresponding to the two trajectories do not overlap. Based on the actual detection results, it is determined which type the two trajectories to be judged belong to. Thus, the corresponding trajectory judgment method can be selected to judge whether the two trajectories are generated based on the same target, which can more accurately know the trajectory generated by the same target in different road segments. Furthermore, through the final trajectory stitching operation, the continuity of the trajectory generated by the same target in different road segments can be guaranteed, and trajectory interruption can be avoided.
[0104] Corresponding to the trajectory stitching method provided above, this application also provides an electronic device. Please refer to... Figure 6 The electronic device 6 in this embodiment includes: a memory 601, and one or more processors 602. Figure 6 (Only one is shown) and a computer program stored in memory 601 and executable on the processor. Memory 601 stores software programs and units. The processor 602 executes various functional applications and diagnostics by running the software programs and units stored in memory 601 to obtain resources corresponding to the aforementioned preset events. Specifically, the processor 602 performs the following steps when running the aforementioned computer program stored in memory 601:
[0105] Acquire the first trajectory detected by the first trajectory detector and the second trajectory detected by the second trajectory detector;
[0106] The detection results are obtained by detecting whether there is an overlap between the trajectory region corresponding to the first trajectory and the trajectory region corresponding to the second trajectory.
[0107] Based on the above detection results, select the corresponding trajectory judgment method to determine whether the first trajectory and the second trajectory are generated by the same target.
[0108] If it is determined that the first trajectory and the second trajectory are generated by the same target, then the first trajectory and the second trajectory are spliced together.
[0109] Assuming the above is the first possible implementation, in the second possible implementation based on the first possible implementation, the step of determining whether the first trajectory and the second trajectory are generated by the same target by selecting a corresponding trajectory determination method based on the detection result includes:
[0110] If the above detection results indicate the existence of the above overlapping area, then the distance between the first trajectory and the second trajectory in the above overlapping area is used to determine whether the first trajectory and the second trajectory are generated by the same target.
[0111] If the above detection results indicate that there is no overlapping area, then based on the position of the first trajectory in the trajectory area corresponding to the first trajectory and the position of the second trajectory in the trajectory area corresponding to the second trajectory, it is determined whether the first trajectory and the second trajectory are generated by the same target.
[0112] In a third possible implementation based on the second possible implementation described above, the detection times of the first trajectory detector and the second trajectory detector are synchronized; the determination of whether the first trajectory and the second trajectory are generated from the same target based on the distance between the first trajectory and the second trajectory in the overlapping area includes:
[0113] Calculate the number of detection data frames corresponding to the aforementioned overlapping regions;
[0114] Based on the above-mentioned number of detection data frames, the coordinates of the trajectory points of the first trajectory that are not null in the above-mentioned overlapping area, and the coordinates of the trajectory points of the second trajectory that are not null in the above-mentioned overlapping area, the distance between the above-mentioned trajectories is calculated.
[0115] If the distance between the above trajectories is less than a preset distance threshold between trajectories, then the first trajectory and the second trajectory are determined to be trajectories generated by the same target.
[0116] In the fourth possible implementation provided based on the third possible implementation described above, the calculation of the number of detection data frames corresponding to the overlapping region includes:
[0117] The first detection time, the second detection time, the third detection time, and the fourth detection time are obtained, wherein the first detection time is the detection time of the first trajectory point of the first trajectory in the overlapping area, the second detection time is the detection time of the last trajectory point of the first trajectory in the overlapping area, the third detection time is the detection time of the first trajectory point of the second trajectory in the overlapping area, and the fourth detection time is the detection time of the last trajectory point of the second trajectory in the overlapping area.
[0118] The number of detection data frames is calculated based on the first detection time, the second detection time, the third detection time, the fourth detection time, and the preset detection interval.
[0119] In a fifth possible implementation based on the first possible implementation described above, if the detection result indicates the existence of the overlapping region, then the stitching of the first trajectory and the second trajectory includes:
[0120] The first trajectory in the overlapping region is merged with the second trajectory in the overlapping region to obtain a new trajectory.
[0121] In the sixth possible implementation provided based on the fifth possible implementation described above, the fusion of the first trajectory in the overlapping region and the second trajectory in the overlapping region to obtain a new trajectory includes:
[0122] Calculate the confidence levels of the first trajectory detector and the second trajectory detector for each trajectory point group to be fused in the overlapping region, wherein a trajectory point group includes: trajectory points of the first trajectory and the second trajectory under the same detection time;
[0123] Based on the confidence level and the coordinates of the two trajectory points in each trajectory point group, calculate the coordinates of the new trajectory point corresponding to each trajectory point group;
[0124] A new trajectory is generated based on the coordinates of the new trajectory points corresponding to each trajectory point group.
[0125] In the seventh possible implementation provided based on the sixth possible implementation described above, the calculation of the confidence levels of the first trajectory detector and the second trajectory detector for each group of trajectory points to be fused in the overlapping region includes:
[0126] For each trajectory point group, based on the coordinates of two trajectory points in the trajectory point group, calculate the first distance between the trajectory point group and the first trajectory detector, and the second distance between the trajectory point group and the second trajectory detector.
[0127] Based on the first distance, the second distance, the preset detector distance resolution, and the preset detector angle resolution, the confidence levels of the first trajectory detector and the second trajectory detector for the trajectory point group are calculated.
[0128] It should be understood that, in the embodiments of this application, the processor 602 may be a central processing unit (CPU), but it may also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.
[0129] Memory 601 may include read-only memory and random access memory, and provides instructions and data to processor 602. Some or all of memory 601 may also include non-volatile random access memory. For example, memory 601 may also store device category information.
[0130] As can be seen from the above, through the embodiments of this application, the application scenarios of the two trajectories to be judged are divided into two main categories: one is that the trajectory areas corresponding to the two trajectories overlap, and the other is that the trajectory areas corresponding to the two trajectories do not overlap. Based on the actual detection results, it is determined which type the two trajectories to be judged belong to. Thus, the corresponding trajectory judgment method can be selected to judge whether the two trajectories are generated based on the same target, which can more accurately know the trajectory generated by the same target in different road segments. Furthermore, through the final trajectory stitching operation, the continuity of the trajectory generated by the same target in different road segments can be guaranteed, and trajectory interruption can be avoided.
[0131] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the above device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0132] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0133] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of external device software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0134] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the system embodiments described above are merely illustrative. For instance, the division of modules or units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between devices or units through some interfaces, and may be electrical, mechanical, or other forms.
[0135] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0136] If the integrated units described above are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing associated hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable storage medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer-readable storage device, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc. It should be noted that the contents of the aforementioned computer-readable storage media may be appropriately added to or subtracted from the contents according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable storage media may not include electrical carrier signals and telecommunication signals.
[0137] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A trajectory stitching method, characterized in that, include: The first trajectory detected by the first trajectory detector and the second trajectory detected by the second trajectory detector are obtained; wherein, the first trajectory detector and the second trajectory detector specifically refer to trajectory detectors that are adjacent or close to each other on the road; The detection results are obtained by detecting whether there is an overlapping area between the trajectory region corresponding to the first trajectory and the trajectory region corresponding to the second trajectory. Based on the detection results, select the corresponding trajectory judgment method to determine whether the first trajectory and the second trajectory are generated by the same target; If it is determined that the first trajectory and the second trajectory are generated by the same target, then the first trajectory and the second trajectory are spliced together; If the detection result indicates the existence of the overlapping region, then the step of stitching the first trajectory and the second trajectory together includes: The first trajectory in the overlapping region is merged with the second trajectory in the overlapping region to obtain a new trajectory; The step of fusing the first trajectory in the overlapping region with the second trajectory in the overlapping region to obtain a new trajectory includes: Calculating the confidence levels of the first and second trajectory detectors for each trajectory point group to be fused in the overlapping region includes: for each trajectory point group, calculating a first distance between the trajectory point group and the first trajectory detector, and a second distance between the trajectory point group and the second trajectory detector, based on the coordinates of two trajectory points in the trajectory point group; calculating the confidence levels of the first and second trajectory detectors for the trajectory point group based on the first distance, the second distance, a preset detector distance resolution, and a preset detector angle resolution; wherein, a trajectory point group includes: trajectory points of the first trajectory and the second trajectory under the same detection time; Based on the confidence level and the coordinates of the two trajectory points in each trajectory point group, calculate the coordinates of the new trajectory point corresponding to each trajectory point group; A new trajectory is generated based on the coordinates of the new trajectory points corresponding to each trajectory point group.
2. The trajectory stitching method as described in claim 1, characterized in that, The step of determining whether the first trajectory and the second trajectory are generated by the same target based on the detection result includes: If the detection result indicates the existence of the overlapping area, then the distance between the first trajectory and the second trajectory in the overlapping area is used to determine whether the first trajectory and the second trajectory are generated by the same target. If the detection result indicates that there is no overlapping area, then based on the position of the first trajectory in the trajectory region corresponding to the first trajectory and the position of the second trajectory in the trajectory region corresponding to the second trajectory, it is determined whether the first trajectory and the second trajectory are generated by the same target.
3. The trajectory stitching method as described in claim 2, characterized in that, The detection times of the first trajectory detector and the second trajectory detector are synchronized; the step of determining whether the first trajectory and the second trajectory are generated by the same target based on the distance between the first trajectory and the second trajectory in the overlapping area includes: Calculate the number of detection data frames corresponding to the overlapping region; Based on the number of detection data frames, the coordinates of the trajectory points of the first trajectory that are not null within the overlapping area, and the coordinates of the trajectory points of the second trajectory that are not null within the overlapping area, the distance between the trajectories is calculated. If the distance between the trajectories is less than a preset distance threshold between trajectories, then the first trajectory and the second trajectory are determined to be trajectories generated by the same target.
4. The trajectory stitching method as described in claim 3, characterized in that, The calculation of the number of detection data frames corresponding to the overlapping region includes: The first detection time, the second detection time, the third detection time, and the fourth detection time are obtained, wherein the first detection time is the detection time of the first trajectory point of the first trajectory in the overlapping area, the second detection time is the detection time of the last trajectory point of the first trajectory in the overlapping area, the third detection time is the detection time of the first trajectory point of the second trajectory in the overlapping area, and the fourth detection time is the detection time of the last trajectory point of the second trajectory in the overlapping area. The number of detection data frames is calculated based on the first detection time, the second detection time, the third detection time, the fourth detection time, and the preset detection interval duration.
5. A trajectory splicing device, characterized in that, include: The acquisition module is used to acquire the first trajectory detected by the first trajectory detector and the second trajectory detected by the second trajectory detector; wherein, the first trajectory detector and the second trajectory detector specifically refer to trajectory detectors that are adjacent or close to each other on the road; The detection module is used to detect whether there is an overlapping area between the trajectory area corresponding to the first trajectory and the trajectory area corresponding to the second trajectory, and to obtain the detection result; The judgment module is used to select the corresponding trajectory judgment method based on the detection result to determine whether the first trajectory and the second trajectory are generated by the same target; The stitching module is used to stitch the first trajectory and the second trajectory together if it is determined that the first trajectory and the second trajectory are generated by the same target. The splicing module includes: A trajectory fusion unit is configured to, when the detection result indicates the existence of the overlapping region and it is determined that the first trajectory and the second trajectory are trajectories generated by the same target, fuse the first trajectory in the overlapping region with the second trajectory in the overlapping region to obtain a new trajectory; The trajectory fusion unit includes: The third calculation subunit is used to calculate the confidence of the first trajectory detector and the second trajectory detector for each trajectory point group to be fused in the overlapping area, wherein a trajectory point group includes: trajectory points of the first trajectory and the second trajectory under the same detection time; The fourth calculation subunit is used to calculate the coordinates of the new trajectory point corresponding to each trajectory point group based on the confidence level and the coordinates of two trajectory points in each trajectory point group. The trajectory generation subunit is used to generate a new trajectory based on the coordinates of the new trajectory points corresponding to each trajectory point group; The third computing subunit includes: The distance calculation subunit is used to calculate, for each group of trajectory points, a first distance between the group of trajectory points and the first trajectory detector, and a second distance between the group of trajectory points and the second trajectory detector, based on the coordinates of two trajectory points in the group of trajectory points. The confidence calculation subunit is used to calculate the confidence of the first trajectory detector and the second trajectory detector for the trajectory point group based on the first distance, the second distance, the preset detector distance resolution, and the preset detector angle resolution.
6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method as described in any one of claims 1 to 4.
7. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Personnel trajectory tracking method, device and system
CN110969644A