Target tracking based trajectory processing method, device, medium and apparatus
By filtering trajectory points and performing multiple clustering processes, the problem of inaccurate trajectory clustering in complex scenarios in existing technologies has been solved, achieving higher clustering accuracy and representativeness.
Patent Information
- Application Number
- CN202310074888.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-30
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2043-01-30
AI Technical Summary
Existing trajectory clustering methods cannot adapt to complex cross-clustering or motion trajectories with large variations in distance from the camera, resulting in inaccurate clustering results.
By acquiring the motion trajectory of each tracked target, redundant points with a distance less than a threshold between adjacent trajectory points are removed. The first clustering is performed by combining the distance between trajectory points and the difference in motion direction. The second clustering is then performed based on the proportion of trajectory points and the difference in direction, thus determining the target trajectory cluster.
It improves the accuracy of clustering results for motion trajectories, adapts to complex cross-clustering and large distance variations, and ensures the representativeness and accuracy of clustering results.
Smart Images

Figure CN116309701B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, in particular to a trajectory processing method and device based on target tracking, medium and equipment. BACKGROUND
[0002] With the development of artificial intelligence technology, more and more video analysis technologies are applied to the field of transportation, including multi-target tracking under video monitoring. A large amount of target boxes and trajectory information will be generated from the multi-target tracking result. By analyzing these trajectory information, the feasible motion trajectory in the current scene can be known, and then the traffic flow on each motion trajectory can be analyzed. In the current technical solution, in order to automatically obtain the feasible motion trajectory from a large amount of trajectory information, the trajectory clustering method is often used to achieve this. However, the commonly used trajectory clustering method only focuses on the center trajectory of the tracked target, and cannot adapt to complex cross-clustering or motion trajectory with large distance change from the camera. Therefore, how to improve the accuracy of the clustering result of the motion trajectory has become a technical problem to be solved. SUMMARY
[0003] Embodiments of the present application provide a trajectory processing method and device based on target tracking, medium and equipment, which can improve the accuracy of the clustering result of the motion trajectory to at least some extent.
[0004] Other characteristics and advantages of the present application will become apparent from the following detailed description, or will be learned by practice of the present application.
[0005] According to one aspect of an embodiment of the present application, a trajectory processing method based on target tracking is provided, which comprises:
[0006] Obtaining a first motion trajectory of each tracking target, the first motion trajectory containing a plurality of trajectory point information arranged in time sequence, the trajectory point information including the coordinates corresponding to the trajectory point and the size of the tracking target;
[0007] If the distance between two adjacent trajectory points in the same first motion trajectory is less than a first threshold value, the latter trajectory point of the two adjacent trajectory points is removed to obtain a corresponding second motion trajectory, and the first threshold value is positively correlated with the size of the tracking target corresponding to the two adjacent trajectory points;
[0008] According to the distance between the trajectory points of any two second motion trajectories and the difference between the motion directions, the second motion trajectories are subjected to first clustering processing to obtain at least one initial trajectory cluster;
[0009] The initial trajectory clusters are subjected to a second clustering process according to the distance between the trajectory points in the standard trajectories of any two of the initial trajectory clusters, the difference between the motion directions, and the proportion of the sum of the shortest distances between the trajectory points of a main standard trajectory and the trajectory points of a secondary standard trajectory to the sum of the sizes of the tracking targets corresponding to the trajectory points of the main standard trajectory, to obtain at least one target trajectory cluster, the main standard trajectory being the standard trajectory of the initial trajectory cluster containing a larger number of second motion trajectories;
[0010] The newly generated motion trajectory is compared with the standard trajectories in each of the target trajectory clusters to determine the target trajectory cluster to which the newly generated motion trajectory belongs.
[0011] According to an aspect of an embodiment of the present application, a trajectory processing device based on target tracking is provided, which comprises:
[0012] The acquisition module is configured to acquire first motion trajectories of tracking targets, the first motion trajectories containing a plurality of trajectory point information arranged in time sequence, the trajectory point information including coordinates corresponding to the trajectory points and sizes of the tracking targets;
[0013] The removal module is configured to remove a later trajectory point in two adjacent trajectory points in the same first motion trajectory if the distance between the two adjacent trajectory points is less than a first threshold value, to obtain a corresponding second motion trajectory, the first threshold value being in positive correlation with the sizes of the tracking targets corresponding to the two adjacent trajectory points;
[0014] The first clustering module is configured to perform a first clustering process on the second motion trajectories according to the distance between the trajectory points of any two of the second motion trajectories and the difference between the motion directions, to obtain at least one initial trajectory cluster;
[0015] The second clustering module is configured to perform a second clustering process on the initial trajectory clusters according to the distance between the trajectory points in the standard trajectories of any two of the initial trajectory clusters, the difference between the motion directions, and the proportion of the sum of the shortest distances between the trajectory points of a main standard trajectory and the trajectory points of a secondary standard trajectory to the sum of the sizes of the tracking targets corresponding to the trajectory points of the main standard trajectory, to obtain at least one target trajectory cluster, the main standard trajectory being the standard trajectory of the initial trajectory cluster containing a larger number of second motion trajectories;
[0016] The processing module is configured to compare a newly generated motion trajectory with the standard trajectories in each of the target trajectory clusters to determine the target trajectory cluster to which the newly generated motion trajectory belongs.
[0017] According to an aspect of some embodiments of the present application, a computer readable medium is provided, which has stored thereon a computer program. The computer program, when executed by a processor, implements the target tracking based trajectory processing method as described in the above embodiments.
[0018] According to an aspect of some embodiments of the present application, an electronic device is provided, which comprises: one or more processors; and a storage device configured to store one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the target tracking based trajectory processing method as described in the above embodiments.
[0019] According to an aspect of some embodiments of the present application, a computer program product or computer program is provided, which comprises computer instructions stored in a computer readable storage medium. A processor of a computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions, so that the computer device executes the target tracking based trajectory processing method as described in the above embodiments.
[0020] In the technical solutions provided by some embodiments of the present application, by obtaining the first motion trajectory of each tracking target, the first motion trajectory contains a plurality of trajectory point information arranged according to time sequence, the trajectory point information includes the coordinates corresponding to the trajectory point and the size of the tracking target, if the distance between the adjacent two trajectory points in the same first motion trajectory is less than a first threshold, the latter trajectory point of the adjacent two trajectory points is removed to obtain the corresponding second motion trajectory, and the second motion trajectory is subjected to first clustering processing according to the distance between the trajectory points of any two second motion trajectories and the difference degree between the motion directions, to obtain at least one initial trajectory class cluster, and the initial trajectory class cluster is subjected to second clustering processing according to the distance between the trajectory points in the standard trajectories of any two initial trajectory class clusters, the difference degree between the motion directions, and the proportion of the sum of the shortest distances between the trajectory points of the main standard trajectory and the trajectory points of the auxiliary standard trajectory to the sum of the sizes of the tracking targets corresponding to the trajectory points of the main standard trajectory, to obtain at least one target trajectory class cluster, and when a new motion trajectory is generated, it is compared with the standard trajectories in each target trajectory class cluster to determine the target trajectory class cluster to which it belongs. Thus, when clustering, the target center position, the motion direction and the target size are combined for clustering, which can adapt to motion trajectories with complex cross aggregation or large changes in distance from the camera, and improve the accuracy of the clustering results of the motion trajectories.
[0021] It should be understood that the foregoing general description and the following detailed description are only exemplary and explanatory, and cannot limit the present application. BRIEF DESCRIPTION OF DRAWINGS
[0022] The accompanying drawings, which are incorporated herein and constitute part of this specification, illustrate embodiments consistent with the application and, together with the description, further serve to explain the principles of the application. It is apparent that the drawing in the following description is only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained from these drawings without creative labor. In the drawings:
[0023] Figure 1 A flowchart of a trajectory processing method based on target tracking according to an embodiment of the present application is shown;
[0024] Figure 2 A block diagram of a trajectory processing device based on target tracking according to an embodiment of the present application is shown;
[0025] Figure 3 A structural diagram of a computer system of an electronic device suitable for implementing embodiments of the present application is shown. DETAILED DESCRIPTION
[0026] Example implementations will now be described more fully with reference to the accompanying drawings. Example implementations may, however, be implemented in many different forms and should not be construed as limited to the examples set forth herein; rather, these example implementations are provided so that this disclosure will be thorough and complete, and will fully convey the scope of example implementations to those skilled in the art.
[0027] Moreover, the described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the application. One skilled in the relevant art will recognize, however, that the
[0028] The block diagrams shown in the drawings are merely functional entities, and do not necessarily have to correspond to physically independent entities. That is, these functional entities can be implemented in software form, or in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.
[0029] The flowcharts shown in the drawings are merely exemplary illustrations, and do not necessarily include all contents and operations / steps, nor do they necessarily have to be executed in the order described. For example, some operations / steps can be further broken down, and some operations / steps can be combined or partially combined, so the actual execution order can be changed according to actual conditions.
[0030] Figure 1 A flowchart of a trajectory processing method based on target tracking according to an embodiment of the present application is shown. The method can be applied to a terminal device, which can include but is not limited to one or more of a smartphone, a tablet computer, a portable computer, and a desktop computer; it can also be applied to a server, such as a physical server or a cloud server. The following is described by way of example with the method applied to a terminal device:
[0031] Referring to Figure 1 The trajectory processing method based on target tracking includes at least steps S110 to S150, which are described in detail as follows:
[0032] In step S110, a first motion trajectory of each tracking target is obtained, the first motion trajectory containing a plurality of trajectory point information arranged in chronological order, the trajectory point information including coordinates corresponding to a trajectory point and a size of the tracking target.
[0033] The tracking target can be a target object that needs to be counted, such as a vehicle in a road monitoring scenario.
[0034] In this embodiment, the camera can obtain a monitoring video in real time in the scene in which it is located, and the monitoring video can contain a plurality of tracking targets. Based on a target tracking algorithm, the terminal device can detect the tracking targets contained in the monitoring video in real time and record the corresponding first motion trajectories. Specifically, the terminal device can frame the tracking targets in the video image and determine the center point of the tracking target (i.e., the center point of the frame) according to the position information of the annotation frame, and then arrange the center points of the same tracking target detected in chronological order to obtain the first motion trajectory corresponding to the tracking target. The first motion trajectory can contain a plurality of trajectory point information, and each trajectory point information can include coordinates corresponding to a trajectory point and a size of the tracking target. In an embodiment, the size of the tracking target can be represented by the width and height of the annotation frame corresponding to the trajectory point, and in other embodiments, other information can also be used for representation, such as the size of the tracking target occupying the video interface, etc., which is not specially limited in the present application.
[0035] In an embodiment of the present application, the lower left corner of the video image can be taken as the origin, the horizontal direction as the X-axis, and the vertical direction as the Y-axis, and the annotation frame can be represented by the horizontal length as the width and the vertical length as the height. The first motion trajectory of the nth tracking target can be represented as wherein Xi, Yi are the X, Y coordinates of the i-th tracking target frame center point of the n-th tracking target, wi, hi are the width and height of the i-th tracking target frame, respectively.
[0036] In step S120, if the distance between two adjacent track points in the same first motion trajectory is less than or equal to a first threshold, the latter track point is removed to obtain a corresponding second motion trajectory, and the first threshold is positively correlated with the size of the tracking target corresponding to the two adjacent track points.
[0037] In this embodiment, the terminal device can determine the distance between two adjacent track points according to the coordinates corresponding to the track points in the same first motion trajectory, and compare the distance with the first threshold. If the distance is less than the first threshold, it means that the distance between the two track points is too small, and the latter track point can be removed to obtain a corresponding second motion trajectory, so as to remove the redundant track points in the first motion trajectory.
[0038] The first threshold is positively correlated with the size of the tracking target corresponding to the two adjacent track points, that is, the larger the tracking target corresponding to the two adjacent track points, the larger the first threshold. Thus, when removing the redundant track points, the size of the tracking target corresponding to the track point is considered, which can effectively solve the problem that when the size of the tracking target changes greatly during the motion of the tracking target, the fixed threshold causes the distant track points to be mistakenly filtered out or the nearby redundant track points to be unable to be filtered out.
[0039] In an embodiment of the present application, the first threshold can be 1 / 8 of the sum of the radii of the bounding circles of the bounding boxes of the two adjacent track points. When the distance between the latter track point and the former track point is greater than the first threshold, the latter track point is retained, otherwise the latter track point is deleted. Assuming that the current point is the (i+1)th track point and the former track point is the ith track point, it is determined whether the following inequality holds: If it holds, the (i+1)th track point is retained, if it does not hold, the (i+1)th track point is deleted, the next track point becomes the (i+1)th track point, and the above steps are repeated until the last track point.
[0040] In an embodiment of the present application, after filtering out the redundant track points, the remaining track sequence is The track sequence is transformed to obtain a track sequence Wherein:
[0041]
[0042]
[0043]
[0044] It should be understood that, may be the projection of the displacement vector of the point on the X axis after normalization. may be the projection of the displacement vector of the point on the Y axis after normalization, may be used to represent the motion direction corresponding to the current trajectory point, may be the radius of the circumscribed circle of the bounding box corresponding to the current trajectory point, and may be used to represent the size of the tracking target corresponding to the current trajectory point.
[0045] In an embodiment of the present application, the filtered trajectory points can be interpolated to increase the trajectory points to ensure the continuity of the motion trajectory. Specifically, interpolation is performed between two adjacent trajectory points, such as between the i-th trajectory point and the i+1-th trajectory point, to increase a trajectory point:
[0046]
[0047] In step S130, the second motion trajectories are first clustered according to the distance between the trajectory points of any two second motion trajectories and the difference between the motion directions, to obtain at least one initial trajectory cluster.
[0048] In this embodiment, the terminal device can first cluster the second motion trajectories according to the distance between the trajectory points of any two second motion trajectories and the difference between the motion directions, to obtain at least one initial trajectory cluster. It should be understood that the smaller the distance between the trajectory points of the two second motion trajectories and the smaller the difference between the motion directions, the greater the possibility that the two second motion trajectories belong to the same cluster. In an example, a clustering algorithm can be used to cluster all second motion trajectories, and in other examples, a corresponding threshold can be set, and when the distance between the trajectory points and the difference between the motion directions are less than the corresponding threshold, it indicates that they belong to the same cluster, and the like.
[0049] In an embodiment of the present application, the second motion trajectories are first clustered according to the distance between the trajectory points of any two second motion trajectories and the difference between the motion directions, to obtain at least one initial trajectory cluster, including:
[0050] selecting one of the second motion trajectories as a standard trajectory of a first initial trajectory cluster, and selecting one of the remaining second motion trajectories as a target trajectory;
[0051] determining the similarity between the standard trajectory and the target trajectory according to the distance between the trajectory points and the difference between the motion directions of the standard trajectory and the target trajectory;
[0052] determining whether the standard trajectory and the target trajectory belong to the same cluster according to the similarity, and if not, taking the target trajectory as a standard trajectory of a new initial trajectory cluster.
[0053] The second motion trajectory which has not been clustered is compared with the standard trajectory of each initial trajectory cluster until each of the second motion trajectories has a corresponding initial trajectory cluster.
[0054] In this embodiment, the terminal can select one from all the second motion trajectories as the standard trajectory of a certain initial trajectory cluster, assuming that the nth second motion trajectory is:
[0055]
[0056] which becomes the standard trajectory of the mth initial trajectory cluster, and the standard trajectory of the mth initial trajectory cluster becomes:
[0057] wherein It should be noted that, may be used to represent the number of tracking targets passing through the trajectory point, because the tracking target corresponding to the standard trajectory also passes through the trajectory point, so The initial value is 1.
[0058] After determining the standard trajectory of the first initial trajectory cluster, the terminal device can select one from the remaining second motion trajectories as a target trajectory to compare with it to determine whether they belong to the same initial trajectory cluster. Specifically, the terminal device can determine the similarity between the standard trajectory and the target trajectory according to the distance between the trajectory points and the difference between the motion directions, to determine whether the standard trajectory and the target trajectory belong to the same cluster according to the similarity. For example, the first similarity can be compared with a pre-set threshold value, and if it is greater than or equal to the threshold value, it means that they belong to the same cluster, otherwise they do not belong to the same cluster.
[0059] If they do not belong to the same cluster, the selected target trajectory can be used as the standard trajectory of a new initial trajectory cluster, and then the terminal device can select another second motion trajectory which has not been clustered to compare with the standard trajectories of the determined initial trajectory clusters until each of the second motion trajectories has a corresponding initial trajectory cluster. Thus, by the above clustering method, the second motion trajectories can be quickly clustered, and the distance between the trajectory points and the difference between the motion directions in the standard trajectory and the target trajectory are fully considered in the first clustering, ensuring the accuracy of the clustering result.
[0060] In an embodiment of the present application, the similarity between the standard trajectory and the target trajectory is determined according to the distance between the trajectory points and the difference between the motion directions, comprising:
[0061] According to coordinate information corresponding to the track points of the standard track and the target track, distances between the track points of the standard track and the target track and movement directions of the track points are determined;
[0062] If the distance between the track point in the target track and the track point in the standard track closest to the track point is less than a second threshold value, and the difference between the movement directions of the two is less than a third threshold value, it is determined that the track point is on the standard track, and the second threshold value is positively correlated with the size of the tracking target corresponding to the track point of the target track;
[0063] If the distance between the track point in the standard track and the track point in the target track closest to the track point is less than a fourth threshold value, and the difference between the movement directions of the two is less than a fourth threshold value, it is determined that the track point is on the target track, and the fourth threshold value is positively correlated with the size of the tracking target corresponding to the track point of the standard track;
[0064] A first proportion of the number of track points of the target track on the standard track to the total number of track points of the target track is determined, and a second proportion of the number of track points of the standard track on the target track to the total number of track points of the standard track is determined.
[0065] The first proportion and the second proportion are added to obtain a similarity between the standard track and the target track.
[0066] In this embodiment, when the standard track of the first initial track class cluster is determined, one of the remaining second motion tracks can be selected for comparison, and the extracted second motion track is referred to as a target track:
[0067]
[0068] The determination of whether it belongs to the mth initial track class cluster is that the standard track of the mth class cluster is taken The distance between each target track point and each standard track point is calculated in turn. First, it is determined whether the distance between each target track point and the closest standard track point is less than (i.e., a second threshold value, and the second threshold value is positively correlated with the size of the tracking target, where α is a preset value, and generally takes a value of 1.2). If it is greater than, it is considered that the target track point is not on the standard track. If it is less than, the displacement directions of the two track points are further determined. whether the dot product of the two is greater than cos θ (i.e. a third threshold, where θ is a preset value, generally 60°), if greater, it is considered that the target trajectory point is on the standard trajectory, otherwise, it is considered that the trajectory point is not on the standard trajectory, and after traversing all target trajectory points, the proportion of target trajectory points on the standard trajectory to all target trajectory points is calculated and recorded as tp (i.e. a first proportion).
[0069] Then, for each standard trajectory point find the nearest target trajectory point determine whether the distance between the two is greater than (i.e. a fourth threshold), if greater, it is considered that the standard trajectory point is not on the target trajectory, otherwise, further determine the displacement direction of the two trajectory points and whether the dot product of the two is greater than cos θ (i.e. a fifth threshold), if greater, it is considered that the standard trajectory point is on the target trajectory, otherwise, it is considered that the standard trajectory point is not on the target trajectory, and after traversing all standard trajectory points, the proportion of standard trajectory points on the target trajectory to all standard trajectory points is calculated and recorded as cp (i.e. a second proportion), and finally the first similarity of the target trajectory and the standard trajectory of the mth initial trajectory class cluster is tp+cp. The similarity of the target trajectory to the standard trajectory of all existing trajectory clusters is calculated, if there is a standard trajectory that satisfies tp>a (a preset value, generally 0.6) and cp>b (a preset value, generally 0.7), it is considered that the target belongs to the initial trajectory class cluster of the standard trajectory that satisfies the condition and has the maximum first similarity.
[0070] In an embodiment of the present application, one of the second motion trajectories is selected as a standard trajectory of a first initial trajectory class cluster, and one of the remaining second motion trajectories is selected as a target trajectory, comprising:
[0071] The second motion trajectories are sorted according to the number of trajectory points they contain from the most to the least, obtaining a second motion trajectory sequence;
[0072] The first second motion trajectory in the second motion trajectory sequence is selected as the standard trajectory of the first initial trajectory class cluster, and the second second motion trajectory is selected as the target trajectory;
[0073] The second motion trajectories that have not been clustered are compared with the standard trajectories of the initial trajectory class clusters until each second motion trajectory has a corresponding initial trajectory class cluster, comprising:
[0074] The second motion trajectories that have not been clustered are compared with the standard trajectories of the initial trajectory class clusters in order from the second motion trajectory sequence until each second motion trajectory has a corresponding initial trajectory class cluster.
[0075] In this embodiment, before the first clustering processing, all the second motion trajectories can be sorted according to the number of the trajectory points contained therein from more to less to obtain a corresponding second motion trajectory sequence. The terminal device can select the first second motion trajectory as the standard trajectory of the first initial trajectory cluster, and then select the second second motion trajectory as the target trajectory from the remaining second motion trajectory sequence to perform comparison and determine whether it belongs to the first initial trajectory cluster. If not, it is taken as the standard trajectory of the second initial trajectory cluster for subsequent determination.
[0076] By analogy, the terminal device can select the second motion trajectory from the second motion trajectory sequence in order to perform comparison with the standard trajectory of the determined initial trajectory cluster, until each second motion trajectory has a corresponding initial trajectory cluster. It should be understood that the more trajectory points contained, the more information the second motion trajectory can carry, and the more representative it is. Therefore, sorting and comparison according to the order of the number of trajectory points can ensure that the standard trajectory of the determined initial trajectory cluster is more representative, and the effectiveness of the first clustering result is ensured.
[0077] In an embodiment of the present application, if the target trajectory does not belong to any existing initial trajectory cluster, a new initial trajectory cluster can be added, and the target trajectory is changed to the standard trajectory of this initial trajectory cluster, and the trajectory information thereof can be changed according to the foregoing manner.
[0078] If it is determined that the standard trajectory and the target trajectory belong to the same cluster, the trajectory point information of the trajectory point of the standard trajectory determined on the target trajectory is corrected according to the trajectory point information of the trajectory point of the target trajectory closest to the trajectory point of the standard trajectory determined on the target trajectory.
[0079] Specifically, if the target trajectory T' n belongs to the trajectory cluster of the standard trajectory C m , the standard trajectory C m needs to be updated, and the update method is to update all the standard trajectory points determined on the target trajectory , and update the standard trajectory point to using the closest target trajectory point . The update formula is:
[0080]
[0081]
[0082]
[0083]
[0084] After updating the x and y of all the standard trajectory points that need to be updated, the x and y of the standard trajectory points are updated using formulas (1) and (2) respectively and
[0085] Thus, through the correction processing, the standard trajectory can be made more representative, thereby improving the accuracy of subsequent clustering. It should be noted that the standard trajectory points in the standard trajectory are The number of tracking targets that pass through the standard trajectory point can be accurately recorded.
[0086] Based on the foregoing embodiments, in one embodiment of the application, the method further comprises:
[0087] According to the number of times that the trajectory points of the standard trajectory of each of the initial trajectory clusters are passed through by the tracking targets included in the same initial trajectory cluster and the number of motion trajectories included in the same initial trajectory cluster, the trajectory points of the standard trajectory of each of the initial trajectory clusters are filtered.
[0088] In this embodiment, after all the initial trajectory clusters and their standard trajectories are obtained when all the second motion trajectories are traversed, the standard trajectory points of all the initial trajectory clusters can be filtered. Assuming that the number of second motion trajectories included in a certain initial trajectory cluster is S m , the standard trajectory points greater than or equal to 10% in the standard trajectory can be retained, wherein 10% is only an example, and those skilled in the art can set it to other values according to prior experience, which is not specially limited in the present application.
[0089] It should be understood that the The greater the number of tracking targets that pass through the standard trajectory point, the more representative the standard trajectory point is. Therefore, through the above filtering processing, the more representative standard trajectory points in the standard trajectory are retained, so that the standard trajectory is more representative, thereby ensuring the accuracy of the subsequent second clustering result.
[0090] Please continue to refer to Figure 1 In step S140, according to the distance between the trajectory points in the standard trajectories of any two of the initial trajectory clusters, the degree of difference between the motion directions, and the proportion of the sum of the shortest distances between the trajectory points of the primary standard trajectory and the trajectory points of the secondary standard trajectory to the sum of the sizes of the tracking targets corresponding to the trajectory points of the primary standard trajectory, the initial trajectory clusters are subjected to second clustering processing to obtain at least one target trajectory cluster, and the primary standard trajectory is the standard trajectory of the initial trajectory cluster that includes a larger number of second motion trajectories.
[0091] In this embodiment, after determining the initial trajectory clusters and the corresponding standard trajectories, the terminal device can perform a second clustering process on each initial trajectory cluster to obtain at least one target trajectory cluster. Specifically, the second clustering process can be performed on all initial trajectory clusters according to the distance between the trajectory points in the standard trajectories of the two initial trajectory clusters, the difference between the motion directions, and the proportion of the sum of the shortest distances between the trajectory points of the primary standard trajectory and the trajectory points of the secondary standard trajectory to the sum of the sizes of the tracking targets corresponding to the trajectory points of the primary standard trajectory, to obtain the target trajectory clusters.
[0092] It should be noted that the primary standard trajectory is the standard trajectory of the initial trajectory cluster containing more second motion trajectories, and the secondary standard trajectory is the standard trajectory of the initial trajectory cluster containing fewer second motion trajectories. It should be understood that the standard trajectory of the initial trajectory cluster containing more second motion trajectories is more representative, and therefore, in the second clustering process, it is taken as the primary standard trajectory, which can ensure the accuracy of the second clustering result.
[0093] In an embodiment of the present application, the second clustering process on the initial trajectory clusters to obtain at least one target trajectory cluster is performed according to the distance between the trajectory points in the standard trajectories of any two initial trajectory clusters, the difference between the motion directions, and the proportion of the sum of the shortest distances between the trajectory points of the primary standard trajectory and the trajectory points of the secondary standard trajectory to the sum of the sizes of the tracking targets corresponding to the trajectory points of the primary standard trajectory, including:
[0094] According to the order from more to less of the number of motion trajectories contained in each initial trajectory cluster, the standard trajectory of the initial trajectory cluster with the largest number of motion trajectories is selected as the standard trajectory of the first target trajectory cluster;
[0095] The standard trajectory of one of the remaining initial trajectory clusters is sequentially selected for clustering with the standard trajectory of the target trajectory cluster, and whether they belong to the same target trajectory cluster is determined according to the distance between the trajectory points, the difference between the motion directions, and the proportion of the sum of the shortest distances between the trajectory points of the secondary standard trajectory and the trajectory points of the primary standard trajectory to the sum of the sizes of the tracking targets corresponding to the trajectory points of the secondary standard trajectory. If not, the standard trajectory of the initial trajectory cluster is taken as the standard trajectory of a new target trajectory cluster;
[0096] The standard trajectory of each initial trajectory cluster that has not been clustered is sequentially compared with the standard trajectory of each target trajectory cluster until each initial trajectory cluster has a corresponding target trajectory cluster.
[0097] In this embodiment, the terminal device can select the standard trajectory of the initial trajectory class cluster with the largest number of trajectories as the standard trajectory of the first target trajectory class cluster in the order of the number of trajectories contained in all initial trajectory class clusters from the most to the least.
[0098] The remaining initial trajectory class clusters are sequentially taken out, and it is sequentially determined whether they belong to the existing target trajectory class cluster. Specifically, the standard trajectory of the initial trajectory class cluster is taken out:
[0099] C m
[0100] The standard trajectory of the Pth target trajectory class cluster is taken out: The standard trajectory of the initial trajectory class cluster is taken out as the target trajectory (i.e., the secondary standard trajectory) in the foregoing embodiment, and the standard trajectory of the target trajectory class cluster is taken as the standard trajectory (i.e., the primary standard trajectory) in the foregoing embodiment. The similarity between the first proportion and the second proportion is the sum of the first proportion and the second proportion. Then, the sum of the distances between the trajectory points of each secondary standard trajectory and the trajectory points of the nearest primary standard trajectory is calculated and recorded as ds, the sum of the sizes (represented by ) of the tracking targets corresponding to the trajectory points of each secondary standard trajectory is calculated and recorded as rs, and rp = ds / rs is calculated. According to the calculation results, if the predetermined rule is met, it is indicated that the initial trajectory class cluster belongs to the target trajectory class cluster. It should be noted that the skilled person in the art can set the determination rule according to the prior experience, and the present application does not make special limitation thereto.
[0101] In one embodiment of the present application, if there is an initial trajectory class cluster whose standard trajectory meets one of the following conditions:
[0102] cp>0.6and tp>0.8
[0103] cp>0.4and tp>0.5and rp<0.25
[0104] cp>0.4and tp>0.9and rp<0.3, it is considered that the corresponding initial trajectory class cluster belongs to the target trajectory class cluster in which the standard trajectory that meets the condition and has the largest similarity is located. That is, even if the number of trajectory points of the two standard trajectories is determined to be less than that of the other, but the distance between them is closer, they can be classified into the same target trajectory class cluster, thereby ensuring the rationality of clustering.
[0105] If the initial trajectory cluster does not belong to any existing target trajectory cluster, a new target trajectory cluster can be added, and the standard trajectory of the initial trajectory cluster can be used as the standard trajectory of the new target trajectory cluster for subsequent judgment. The terminal device can compare the standard trajectories of the un-clustered initial trajectory clusters with the standard trajectories of each target trajectory cluster in descending order of the number of motion trajectories included, until each initial trajectory cluster has a corresponding target trajectory cluster.
[0106] In one embodiment of this application, if the standard trajectory C of the initial trajectory cluster... m Standard trajectory D belonging to the target trajectory cluster p If the target trajectory belongs to a certain cluster, then the standard trajectory D of that target trajectory cluster can be determined. p Update the trajectory points of the target trajectory cluster's standard trajectory that were determined to be on the standard trajectory of the initial trajectory cluster. Update by using the nearest target trajectory point. Update the standard trajectory points to in:
[0107]
[0108]
[0109]
[0110]
[0111] After updating the x and y coordinates of all the standard trajectory points that need updating, use the aforementioned formulas (1) and (2) to update them respectively. and This makes the standard trajectories of the target trajectory clusters more representative, ensuring the accuracy of subsequent clustering results.
[0112] In one embodiment of this application, after traversing all initial trajectory clusters, all target trajectory clusters and their standard trajectories can be obtained. At this point, the standard trajectory points of all target trajectory clusters can be filtered. Assume that the number of target trajectories in the target trajectory cluster is S. p Only retain the standard trajectory points For values greater than or equal to 10%, the same applies; however, this 10% is merely an illustrative example and is not a specific limitation in this application. This ensures that the retained standard trajectory points for each target trajectory cluster are more representative, thereby guaranteeing the accuracy of subsequent traffic statistics.
[0113] Please continue to refer to this. Figure 1In step S150, the newly generated motion trajectory is compared with the standard trajectory in each target trajectory cluster to determine the target trajectory cluster to which the newly generated motion trajectory belongs.
[0114] In this embodiment, the terminal device can take the obtained target trajectory cluster as the final trajectory cluster, which represents all feasible trajectory paths under the current camera. For a newly generated motion trajectory, the aforementioned steps of trajectory point filtering and trajectory point information transformation processing can be performed on the target trajectory, i.e., the corresponding motion direction and the size of the tracking target (represented by the radius of the circumscribed circle of the bounding box) are obtained, and then the processed motion trajectory is compared with the standard trajectory of each target trajectory cluster to determine the target trajectory cluster to which the motion trajectory belongs, so as to ensure the accuracy of the clustering result of the motion trajectory.
[0115] The device embodiment of the present application is described below, which can be used to execute the target tracking-based trajectory processing method in the above-mentioned embodiments of the present application. For details not disclosed in the device embodiment of the present application, please refer to the above-mentioned embodiments of the target tracking-based trajectory processing method of the present application.
[0116] Figure 2 A block diagram of a target tracking-based trajectory processing device according to one embodiment of the present application is shown.
[0117] Referring to Figure 2 The target tracking-based trajectory processing device according to one embodiment of the present application includes:
[0118] The acquisition module 210 is configured to acquire first motion trajectories of tracking targets, wherein each first motion trajectory contains a plurality of trajectory point information arranged in chronological order, and each trajectory point information includes coordinates corresponding to the trajectory point and the size of the tracking target.
[0119] The removal module 220 is configured to remove a later trajectory point in two adjacent trajectory points in the same first motion trajectory if the distance between the two adjacent trajectory points is less than or equal to a first threshold value, to obtain a corresponding second motion trajectory, and the first threshold value is positively correlated with the size of the tracking target corresponding to the two adjacent trajectory points.
[0120] The first clustering module 230 is configured to perform first clustering processing on the second motion trajectories according to the distance between the trajectory points of any two second motion trajectories and the difference between the motion directions, to obtain at least one initial trajectory cluster.
[0121] The second clustering module 240 is configured to perform second clustering processing on the initial trajectory clusters according to distances between trajectory points in the standard trajectories of any two of the initial trajectory clusters, degrees of difference between motion directions, and a proportion of a sum of shortest distances between trajectory points of a main standard trajectory and trajectory points of a secondary standard trajectory to a sum of sizes of tracking targets corresponding to the trajectory points of the main standard trajectory, to obtain at least one target trajectory cluster, the main standard trajectory being a standard trajectory of an initial trajectory cluster containing a larger number of second motion trajectories.
[0122] The processing module 250 is configured to compare the newly generated motion trajectory with the standard trajectories in each of the target trajectory clusters, and determine a target trajectory cluster to which the newly generated motion trajectory belongs.
[0123] In an embodiment of the present application, the first clustering module 230 is configured to select one of the second motion trajectories as a standard trajectory of a first initial trajectory cluster, select one of the remaining second motion trajectories as a target trajectory, determine a similarity between the standard trajectory and the target trajectory according to distances between trajectory points and degrees of difference between motion directions of the standard trajectory and the target trajectory, determine whether the standard trajectory and the target trajectory belong to a same cluster according to the similarity, if not, select the target trajectory as a standard trajectory of a new initial trajectory cluster, and compare the second motion trajectories that have not been clustered with the standard trajectories of the initial trajectory clusters until each of the second motion trajectories has a corresponding initial trajectory cluster.
[0124] In an embodiment of the present application, the first clustering module 230 is configured to determine distances between each two of the trajectory points of the standard trajectory and the target trajectory and motion directions of each of the trajectory points according to coordinate information corresponding to the trajectory points of the standard trajectory and the target trajectory, determine that a trajectory point in the target trajectory is on the standard trajectory if a distance between the trajectory point and a nearest trajectory point of the standard trajectory is less than a second threshold value and a difference between motion directions of the two trajectory points is less than a third threshold value, the second threshold value being in positive correlation with a size of a tracking target corresponding to the trajectory point of the target trajectory, determine that a trajectory point in the standard trajectory is on the target trajectory if a distance between the trajectory point and a nearest trajectory point of the target trajectory is less than a fourth threshold value and a difference between motion directions of the two trajectory points is less than a fifth threshold value, the fourth threshold value being in positive correlation with a size of a tracking target corresponding to the trajectory point of the standard trajectory, determine a first proportion of a number of the trajectory points of the target trajectory on the standard trajectory to a total number of the trajectory points of the target trajectory, and determine a second proportion of a number of the trajectory points of the standard trajectory on the target trajectory to a total number of the trajectory points of the standard trajectory, and add the first proportion and the second proportion to obtain the similarity between the standard trajectory and the target trajectory.
[0125] In an embodiment of the present application, the first clustering module 230 is configured to: sort the second motion trajectories according to the number of trajectory points contained in each of the second motion trajectories from more to less, to obtain a second motion trajectory sequence; select a first second motion trajectory from the second motion trajectory sequence as a standard trajectory of a first initial trajectory cluster, and select a second second motion trajectory as a target trajectory; and compare the second motion trajectories that have not been clustered with the standard trajectories of the initial trajectory clusters until each of the second motion trajectories has a corresponding initial trajectory cluster, including: sequentially selecting the second motion trajectories that have not been clustered from the second motion trajectory sequence, and comparing each of the selected second motion trajectories with the standard trajectories of the initial trajectory clusters until each of the second motion trajectories has a corresponding initial trajectory cluster.
[0126] In an embodiment of the present application, the first clustering module 230 is further configured to: if it is determined that the standard trajectory and the target trajectory belong to the same cluster, correct the trajectory point information of the trajectory points of the standard trajectory on the target trajectory according to the trajectory point information of the trajectory point of the target trajectory that is closest to the trajectory point of the standard trajectory on the target trajectory.
[0127] In an embodiment of the present application, the first clustering module 230 is further configured to: filter the trajectory points of the standard trajectories of the initial trajectory clusters according to the number of times that the trajectory points of the standard trajectories of the initial trajectory clusters are passed by the tracking target contained in the same initial trajectory cluster and the number of motion trajectories contained in the same initial trajectory cluster.
[0128] In an embodiment of the present application, the second clustering module 240 is configured to: select the standard trajectory of the initial trajectory cluster with the largest number as a standard trajectory of a first target trajectory cluster according to the order of the number of motion trajectories contained in each of the initial trajectory clusters from more to less; sequentially select one of the standard trajectories of the remaining initial trajectory clusters and the standard trajectory of the target trajectory cluster for clustering, and determine whether the two belong to the same target trajectory cluster according to the distance between the trajectory points, the difference between the motion directions, and the proportion of the sum of the shortest distances between the trajectory points of the secondary standard trajectory and the trajectory points of the primary standard trajectory to the sum of the sizes of the tracking targets corresponding to the trajectory points of the secondary standard trajectory, if not, the standard trajectory of the initial trajectory cluster is used as the standard trajectory of a new target trajectory cluster; and sequentially compare the standard trajectories of the initial trajectory clusters that have not been clustered with the standard trajectories of the target trajectory clusters until each of the initial trajectory clusters has a corresponding target trajectory cluster.
[0129] Figure 3 A structural schematic diagram of a computer system of an electronic device suitable for implementing an embodiment of the present application is shown.
[0130] It should be noted that Figure 3 The computer system of the electronic device shown is merely an example and should not impose any limitation on the functions and usage range of the embodiments of the present application.
[0131] As Figure 3 shown, the computer system includes a central processing unit (CPU) 301 which can perform various appropriate actions and processes in accordance with a program stored in a read-only memory (ROM) 302 or a program loaded from a storage section 308 into a random access memory (RAM) 303, such as performing the methods described in the above embodiments. In the RAM 303, various programs and data required for the operation of the system are also stored. The CPU 301, the ROM 302, and the RAM 303 are connected to each other through a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.
[0132] The following components are connected to the I / O interface 305: an input section 306 including a keyboard, a mouse, etc.; an output section 307 including a display such as a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 308 including a hard disk, etc.; and a communication section 309 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 309 performs communication processing via a network such as the Internet. A drive 310 is also connected to the I / O interface 305 as necessary. A removable recording medium 311 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc. is attached to the drive 310 as necessary, so that a computer program read out therefrom is installed in the storage section 308 as necessary.
[0133] In particular, according to the embodiments of the present application, the processes described above with reference to the flowcharts can be implemented as a computer software program. For example, the embodiments of the present application include a computer program product including a computer program carried on a computer-readable medium, the computer program containing a computer program for executing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network by the communication section 309, and / or installed from the removable recording medium 311. When the computer program is executed by the central processing unit (CPU) 301, various functions defined in the system of the present application are performed.
[0134] It should be noted that the computer-readable medium in the embodiments of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination thereof. The computer-readable storage medium may, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any combination thereof. More specific examples of the computer-readable storage medium can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (Compact Disc Read-Only Memory, CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this application, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or apparatus. In this application, the computer-readable signal medium can include a data signal carrying computer-readable computer programs in a baseband or as a part of a carrier wave. Such a propagated data signal can take on various forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination thereof. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium that can transmit, propagate or transport programs for use by or in connection with an instruction execution system, device or apparatus. The computer programs contained in the computer-readable medium can be transmitted by any suitable medium, including but not limited to wireless, wired, or the like, or any suitable combination thereof.
[0135] The flowcharts and block diagrams in the drawings illustrate the possible implementation architectures, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In the flowcharts or block diagrams, each block can represent a module, a program segment or a part of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions noted in the blocks can occur in different orders than that shown in the drawings. For example, two blocks that are shown in succession can actually be executed substantially in parallel, and sometimes in reverse order, depending on the involved functions. It should also be noted that each block in the block diagrams or flowcharts, and the combination of blocks in the block diagrams or flowcharts, can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or can be implemented by a combination of special-purpose hardware and computer instructions.
[0136] The units described in the embodiments of the present application can be implemented by software, or by hardware, or by a combination of software and hardware. The units described can also be located in a single processor. In some cases, the names of the units do not limit the units themselves.
[0137] As another aspect, the present application provides a computer readable medium, which can be included in the electronic device described in the above embodiments, or can exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to implement the method described in the above embodiments.
[0138] It should be noted that although several modules or units for performing actions are mentioned in the above detailed description, the division into the modules or units is not mandatory. In fact, according to the embodiments of the present application, features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, features and functions of one module or unit described above can be further divided into a plurality of modules or units.
[0139] From the above description of the embodiments, those skilled in the art will readily appreciate that the example embodiments described herein can be implemented by software and / or by hardware coupled with software. Accordingly, the technical solutions of the embodiments of the present application can be embodied in the form of a software product. The software product can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, or the like) or on a network, and includes a number of instructions for causing a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to perform the methods according to the embodiments of the present application.
[0140] Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the embodiments disclosed herein. The present application is intended to cover any variations, uses, or adaptations of the application following, in general, the principles of the application and including such
[0141] It should be understood that the present application is not limited to the precise construction that has been described above and illustrated in the accompanying drawings, and that various modifications and changes can be made by those skilled in the art without departing from the scope of the present application. The scope of the present application is limited only by the appended claims.
Claims
1. A trajectory processing method based on target tracking, characterized in that, The method comprises the following steps: acquiring first motion trajectories of each tracking target, the first motion trajectories comprising a plurality of trajectory point information arranged in time sequence, the trajectory point information comprising coordinates corresponding to the trajectory point and size of the tracking target; if the distance between two adjacent trajectory points in the same first motion trajectory is less than or equal to a first threshold value, the latter trajectory point is removed to obtain a corresponding second motion trajectory, the first threshold value being positively correlated with the size of the tracking target corresponding to the two adjacent trajectory points; performing first clustering processing on the second motion trajectories according to the distance between the trajectory points of any two second motion trajectories and the difference between the motion directions, to obtain at least one initial trajectory cluster, wherein the similarity between a standard trajectory and a target trajectory is determined according to the distance between the trajectory points and the difference between the motion directions of the standard trajectory and the target trajectory, specifically comprising determining the distance between the trajectory points and the difference between the motion directions of the standard trajectory and the target trajectory according to the coordinate information of the trajectory points of the standard trajectory and the target trajectory; if the distance between the trajectory point in the target trajectory and the trajectory point in the standard trajectory closest to the target trajectory is less than a second threshold value, and the difference between the motion directions of the two trajectory points is less than a third threshold value, it is determined that the trajectory point is on the standard trajectory, the second threshold value being positively correlated with the size of the tracking target corresponding to the trajectory point of the target trajectory; if the distance between the trajectory point in the standard trajectory and the trajectory point in the target trajectory closest to the standard trajectory is less than a fourth threshold value, and the difference between the motion directions of the two trajectory points is less than a fifth threshold value, it is determined that the trajectory point is on the target trajectory, the fourth threshold value being positively correlated with the size of the tracking target corresponding to the trajectory point of the standard trajectory; determining a first proportion of the number of trajectory points of the target trajectory on the standard trajectory in the total number of trajectory points of the target trajectory, and a second proportion of the number of trajectory points of the standard trajectory on the target trajectory in the total number of trajectory points of the standard trajectory; adding the first proportion and the second proportion to obtain the similarity between the standard trajectory and the target trajectory; selecting the standard trajectory of the initial trajectory cluster with the largest number as the standard trajectory of the first target trajectory cluster according to the order from more to less of the number of motion trajectories contained in each initial trajectory cluster; selecting one of the standard trajectories of the remaining initial trajectory clusters and the standard trajectory of the target trajectory cluster for clustering in turn, and determining whether they belong to the same target trajectory cluster according to the distance between the trajectory points, the difference between the motion directions, and the proportion of the sum of the shortest distances between the trajectory points of the secondary standard trajectory and the trajectory points of the primary standard trajectory to the sum of the sizes of the tracking targets corresponding to the trajectory points of the secondary standard trajectory, if not, the standard trajectory of the initial trajectory cluster is taken as the standard trajectory of a new target trajectory cluster. The standard trajectories of the initial trajectory clusters that have not been clustered are compared with the standard trajectories of each of the target trajectory clusters in turn, until each of the initial trajectory clusters has a corresponding target trajectory cluster. The main standard trajectory is the standard trajectory of the initial trajectory cluster that contains a large number of second motion trajectories. The newly generated motion trajectory is compared with the standard trajectory in each of the target trajectory clusters to determine the target trajectory cluster to which the newly generated motion trajectory belongs.
2. The method of claim 1, wherein, Based on the distance between any two trajectory points of the second motion trajectory and the degree of difference between their motion directions, the second motion trajectory is subjected to a first clustering process to obtain at least one initial trajectory cluster, including: Select one of the second motion trajectories as the standard trajectory of the first initial trajectory cluster, and select one of the remaining second motion trajectories as the target trajectory; The similarity between the standard trajectory and the target trajectory is determined based on the distance between trajectory points and the degree of difference between their directions of motion. Based on the similarity, it is determined whether the standard trajectory and the target trajectory belong to the same cluster. If not, the target trajectory is used as the standard trajectory of the new initial trajectory cluster. The second motion trajectory that has not been clustered is compared with the standard trajectory of each initial trajectory cluster until each second motion trajectory has a corresponding initial trajectory cluster.
3. The method of claim 2, wherein, Select one of the second motion trajectories as the standard trajectory of the first initial trajectory cluster, and select one of the remaining second motion trajectories as the target trajectory, including: The second motion trajectories are sorted in descending order of the number of trajectory points they contain to obtain the second motion trajectory sequence; From the second motion trajectory sequence, select the first second motion trajectory as the standard trajectory of the first initial trajectory cluster, and select the second second motion trajectory as the target trajectory; Then, the second motion trajectory that has not been clustered is compared with the standard trajectory of each initial trajectory cluster until each second motion trajectory has a corresponding initial trajectory cluster, including: From the second motion trajectory sequence, select the second motion trajectory that has not been clustered in sequence and compare it with the standard trajectory of each initial trajectory cluster until each second motion trajectory has a corresponding initial trajectory cluster.
4. The method of claim 3, wherein, The method further includes: If it is determined that the standard trajectory and the target trajectory belong to the same cluster, then the trajectory point information of the standard trajectory points determined to be on the target trajectory is corrected based on the trajectory point information of the target trajectory point that is closest to the trajectory point of the standard trajectory determined to be on the target trajectory.
5. The method of claim 3, wherein, The method further includes: Based on the number of times the trajectory points of the standard trajectory in each initial trajectory cluster are passed by the tracking target contained in the same initial trajectory cluster and the number of motion trajectories contained in the same initial trajectory cluster, the trajectory points of the standard trajectory in each initial trajectory cluster are filtered out.
6. A trajectory processing apparatus based on target tracking, characterized by, include: The acquisition module is used to acquire the first motion trajectory of each tracked target. The first motion trajectory contains several trajectory point information arranged in chronological order. The trajectory point information includes the coordinates of the trajectory point and the size of the tracked target. The removal module is used to remove the later trajectory point among the two adjacent trajectory points if the distance between two adjacent trajectory points in the same first motion trajectory is less than or equal to a first threshold, so as to obtain the corresponding second motion trajectory. The first threshold is positively correlated with the size of the tracking target corresponding to the two adjacent trajectory points. The first clustering module is used to perform a first clustering process on the second motion trajectory based on the distance between any two trajectory points of the second motion trajectory and the degree of difference between their motion directions, to obtain at least one initial trajectory cluster. Specifically, the similarity between the standard trajectory and the target trajectory is determined based on the distance between the trajectory points of the standard trajectory and the target trajectory and the degree of difference between their motion directions. This includes determining the pairwise distance between the trajectory points of the standard trajectory and the target trajectory and the motion direction of each trajectory point based on the coordinate information corresponding to the trajectory points of the standard trajectory and the target trajectory. If the distance between a trajectory point in the target trajectory and the trajectory point of the nearest standard trajectory is less than a second threshold, and the difference between their motion directions is less than a third threshold, then the trajectory point is determined to be on the standard trajectory. The second threshold is positively correlated with the size of the tracking target corresponding to the trajectory point of the target trajectory. If the distance between a trajectory point in the standard trajectory and the trajectory point of the nearest target trajectory is less than a fourth threshold, and the difference between their motion directions is less than a fifth threshold, then the trajectory point is determined to be on the target trajectory. The fourth threshold is positively correlated with the size of the tracking target corresponding to the trajectory point of the standard trajectory. Determine a first percentage of the number of trajectory points in the target trajectory that are on the standard trajectory relative to the total number of trajectory points in the target trajectory, and a second percentage of the number of trajectory points in the standard trajectory that are on the target trajectory relative to the total number of trajectory points in the standard trajectory. The similarity between the standard trajectory and the target trajectory is obtained by adding the first proportion and the second proportion. The second clustering module is used to select the standard trajectory of the initial trajectory cluster with the largest number of motion trajectories as the standard trajectory of the first target trajectory cluster, according to the order of the number of motion trajectories contained in each initial trajectory cluster from most to least. The remaining standard trajectories of the initial trajectory cluster are selected sequentially and clustered with the standard trajectory of the target trajectory cluster. Based on the distance between the trajectory points of the two, the degree of difference between the movement directions, and the proportion of the sum of the shortest distances between the trajectory points of the sub-standard trajectory and the trajectory points of the main standard trajectory to the sum of the sizes of the tracking targets corresponding to the trajectory points of the sub-standard trajectory, it is determined whether the two belong to the same target trajectory cluster. If not, the standard trajectory of the initial trajectory cluster is taken as the standard trajectory of the new target trajectory cluster. The standard trajectories of the initial trajectory clusters that have not been clustered are compared with the standard trajectories of each of the target trajectory clusters in turn, until each of the initial trajectory clusters has a corresponding target trajectory cluster. The main standard trajectory is the standard trajectory of the initial trajectory cluster that contains a large number of second motion trajectories. The processing module is used to compare the newly generated motion trajectory with the standard trajectories in each of the target trajectory clusters to determine the target trajectory cluster to which the newly generated motion trajectory belongs.
7. A computer readable medium having stored thereon a computer program, characterized in that When the computer program is executed by the processor, it implements the trajectory processing method based on target tracking as described in any one of claims 1 to 5.
8. An electronic device, comprising: include: One or more processors; A storage device for storing one or more programs, which, when executed by one or more processors, cause the one or more processors to implement the trajectory processing method based on target tracking as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Vehicle-road cooperative abnormal driving condition detection method and system, terminal equipment and medium
CN111524350A
Track space-time clustering method and system and storage device
CN112749743A