A target tracking method and device, electronic equipment and storage medium
Patent Information
- Application Number
- CN202310191076.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2022-12-31
- Filing Date
- 2023-02-22
- Publication Date
- 2026-09-25
- Estimated Expiration
- 2043-02-22
AI Technical Summary
[0004]本发明实施例提供一种目标跟踪方法,旨在解决现有目标跟踪过程中因目标被遮挡影响而产生检测框误检,造成目标跟踪准确率低的问题
[0035]本发明实施例中,通过获取多段跟踪轨迹;从所述多段跟踪轨迹中选取轨迹长度小于预设长度阈值的跟踪短轨迹;从跟踪长轨迹中筛选出与所述跟踪短轨迹存在时空交集的目标跟踪长轨迹,所述跟踪长轨迹为所述多段跟踪轨迹中轨迹长度大于所述预设长度阈值的跟踪轨迹;计算所述跟踪短轨迹的置信度以及计算所述跟踪短轨迹与所述目标跟踪长轨迹之间的轨迹交并比;根据所述跟踪短轨迹的置信度以及所述跟踪短轨迹与所述目标跟踪长轨迹之间的轨迹交并比,过滤满足预设过滤条件的跟踪短轨迹,并基于过滤后的跟踪短轨迹进行目标跟踪,得到目标跟踪结果。结合轨迹长度、轨迹置信度以及轨迹间交并比多个维度,采用柔性非极大抑制方法进行轨迹维度的目标跟踪,进而消除检测算法误检对跟踪的影响。本实施例能够有效过滤误检短轨迹,进而提高复杂遮挡情况下的跟踪准确率。
Smart Images

Figure CN118279341B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of tracking trajectory technology, and in particular to a target tracking method, apparatus, electronic device, and storage medium. Background Technology
[0002] With the development and advancement of artificial intelligence technology, tracking algorithms have been widely applied in all aspects of social life. For example, tracking algorithms are used in criminal suspect trajectory tracking systems and shopping mall store customer flow counting systems, greatly facilitating people's work and life. Existing tracking algorithms mainly follow the idea of "tracking by detection," but the effectiveness of this approach is greatly affected by the detection algorithm. If the accuracy of the detection algorithm is low, the tracking effect will inevitably be affected.
[0003] To improve the accuracy of detection algorithms and reduce false detections, multiple people in occluded situations are often processed into a single detection box, which can lead to missed targets. This inevitably affects the overall tracking performance, potentially missing some targets and causing the target boxes in different frames to sometimes show the occluded target and sometimes the occluded target, resulting in false detections and low tracking accuracy. Summary of the Invention
[0004] This invention provides a target tracking method that aims to solve the problem of low target tracking accuracy caused by false detections in bounding boxes due to target occlusion in existing target tracking processes.
[0005] In a first aspect, embodiments of the present invention provide a target tracking method, the method comprising:
[0006] Acquire multiple tracking trajectories;
[0007] Select a short tracking trajectory whose length is less than a preset length threshold from the multiple tracking trajectories;
[0008] Target long tracking trajectories that have spatiotemporal intersection with the short tracking trajectories are selected from the long tracking trajectories. The long tracking trajectories are the tracking trajectories whose trajectory length is greater than the preset length threshold among the multiple tracking trajectories.
[0009] Calculate the confidence level of the short tracking trajectory and calculate the trajectory intersection-union ratio between the short tracking trajectory and the target tracking long trajectory;
[0010] Based on the confidence level of the short tracking trajectory and the trajectory intersection-union ratio between the short tracking trajectory and the target tracking long trajectory, short tracking trajectories that meet the preset filtering conditions are filtered, and target tracking is performed based on the filtered short tracking trajectories to obtain the target tracking result.
[0011] Optionally, acquiring multiple tracking trajectories includes:
[0012] Detect the target object;
[0013] The tracking trajectory of the target object is obtained based on the dual-matching tracking algorithm.
[0014] Optionally, the dual-matching tracking algorithm includes a Kalman filter algorithm and two Hungarian matching algorithms.
[0015] Optionally, the step of filtering out the target long tracking trajectory that has a spatiotemporal intersection with the short tracking trajectory from the long tracking trajectory includes:
[0016] Determine whether the short tracking trajectory and the long tracking trajectory intersect in the same time and the same area;
[0017] If the short tracking trajectory and the long tracking trajectory intersect at the same time and in the same area, then the long tracking trajectory that intersects with the short tracking trajectory at the same time and in the same area is determined as the target long tracking trajectory.
[0018] Optionally, calculating the trajectory intersection-union ratio between the short tracking trajectory and the long target tracking trajectory includes:
[0019] Calculate the time range within which the short tracking trajectory and the long target tracking trajectory have a spatiotemporal intersection;
[0020] Calculate the intersection and intersection-union ratio (IUU) between the short tracking trajectory and the long target tracking trajectory within the time range, and determine the IUU as the trajectory IUU ratio between the short tracking trajectory and the long target tracking trajectory.
[0021] Optionally, filtering short tracking trajectories that meet preset filtering conditions based on the confidence level of the short tracking trajectory and the trajectory intersection-union ratio between the short tracking trajectory and the target long tracking trajectory includes:
[0022] The new confidence level of the tracking short trajectory is calculated based on the confidence level of the tracking short trajectory and the trajectory intersection-union ratio between the tracking short trajectory and the target tracking long trajectory;
[0023] Determine whether the new confidence level of the tracked short trajectory meets the preset filtering conditions;
[0024] If the new confidence level of the tracking short trajectory meets the preset filtering condition, then the tracking short trajectory whose new confidence level meets the preset filtering condition is cleared.
[0025] Optionally, the method further includes:
[0026] If the new confidence level of the tracked short trajectory does not meet the preset filtering condition, then the tracked short trajectory whose new confidence level does not meet the preset filtering condition is saved.
[0027] Secondly, embodiments of the present invention also provide a target tracking device, the target tracking device comprising:
[0028] The acquisition module is used to acquire multiple tracking trajectories;
[0029] The selection module is used to select short tracking trajectories whose length is less than a preset length threshold from the multiple tracking trajectories.
[0030] The filtering module is used to filter out target long tracking trajectories that have spatiotemporal intersection with the short tracking trajectories from the long tracking trajectories. The long tracking trajectories are the tracking trajectories whose trajectory length is greater than the preset length threshold among the multiple tracking trajectories.
[0031] The calculation module is used to calculate the confidence level of the short tracking trajectory and the trajectory intersection-union ratio between the short tracking trajectory and the target tracking long trajectory;
[0032] The filtering module is used to filter short tracking trajectories that meet preset filtering conditions based on the confidence level of the short tracking trajectory and the trajectory intersection-union ratio between the short tracking trajectory and the target tracking long trajectory, and to perform target tracking based on the filtered short tracking trajectories to obtain the target tracking result.
[0033] Thirdly, embodiments of the present invention provide an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps in the target tracking method provided in embodiments of the present invention.
[0034] Fourthly, embodiments of the present invention provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in the target tracking method provided in the embodiments of the invention.
[0035] In this embodiment of the invention, multiple tracking trajectories are acquired; short tracking trajectories with a length less than a preset length threshold are selected from the multiple tracking trajectories; target long tracking trajectories with spatiotemporal intersection with the short tracking trajectories are selected from the long tracking trajectories, where the long tracking trajectories are those with a length greater than the preset length threshold; the confidence level of the short tracking trajectories and the intersection-union ratio (IUR) between the short tracking trajectories and the target long tracking trajectories are calculated; based on the confidence level of the short tracking trajectories and the IUR between the short tracking trajectories and the target long tracking trajectories, short tracking trajectories that meet preset filtering conditions are filtered, and target tracking is performed based on the filtered short tracking trajectories to obtain the target tracking result. By combining multiple dimensions such as trajectory length, trajectory confidence level, and IUR, a flexible nonmaximum suppression method is used for target tracking at the trajectory level, thereby eliminating the impact of false detections by the detection algorithm on tracking. This embodiment can effectively filter falsely detected short trajectories, thereby improving the tracking accuracy under complex occlusion conditions. Attached Figure Description
[0036] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, 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 the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0037] Figure 1 This is a flowchart of a target tracking method provided in an embodiment of the present invention;
[0038] Figure 2 This is a flowchart of a dual-matching tracking algorithm provided in an embodiment of the present invention;
[0039] Figure 3 yes Figure 1 A flowchart of a method provided in step 103 of the embodiment;
[0040] Figure 4 yes Figure 1 A flowchart of a method provided in step 104 of the embodiment;
[0041] Figure 5 yes Figure 1 A flowchart of a method provided in step 105 of the embodiment;
[0042] Figure 6 This is a schematic diagram of the structure of a target tracking device provided in an embodiment of the present invention.
[0043] Figure 7 yes Figure 6 A schematic diagram of the filtering module provided in the embodiment;
[0044] Figure 8 yes Figure 6 A schematic diagram of the computing module provided in the embodiment;
[0045] Figure 9 yes Figure 6 A schematic diagram of the filtering module provided in the embodiment;
[0046] Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0047] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0048] like Figure 1 As shown, Figure 1 This is a flowchart of a target tracking method provided in an embodiment of the present invention. The target tracking method includes the following steps:
[0049] Step 101: Obtain multiple tracking trajectories.
[0050] The aforementioned multi-segment tracking trajectories refer to the tracking trajectories required for target tracking. These multi-segment tracking trajectories can be tracking trajectories for different target objects, or they can be multiple tracking trajectories for the same target object.
[0051] Specifically, step 101 can be implemented by detecting the target object and obtaining the tracking trajectory of the target object based on the dual-matching tracking algorithm, thereby obtaining multiple tracking trajectories.
[0052] The number of target objects can be multiple. The dual-matching tracking algorithm can include a Kalman filter algorithm and two Hungarian matching algorithms.
[0053] More specifically, such as Figure 2As shown, the detector performs target object detection on the current frame t, obtaining detection boxes and extracting ReID features. The detector outputs a detection box (x, y, w, h, u), where (x, y) is the center point of the detection box, w is the width of the detection box, h is the height of the detection box, and u is the confidence level of the detection box. These ReID features can include attribute features such as clothing color, height, and body shape of the target object. Based on the confidence level, the detection boxes are divided into two parts: those with a confidence level greater than or equal to a preset confidence level are designated as high-confidence detection boxes, and those with a confidence level less than the preset confidence level are designated as low-confidence detection boxes. The high-confidence detection boxes are then first associated with the tracking boxes of the previous frame t-1 based on IOU (Intersection over Union) and ReID (Re-identification) features. The first association uses Hungarian matching, and the similarity is calculated as follows:
[0054]
[0055]
[0056] in, It is the modified ReID feature cosine distance. It is the cosine distance of a typical ReID feature. It is the IOU distance, θ ReID This is a manually set ReID feature distance threshold, typically 0.25. However, this ReID feature distance threshold of 0.25 is not a limitation of the present invention; in other embodiments, the ReID feature distance threshold can be set to other values according to actual circumstances. IOU The IOU distance threshold is set manually, usually 0.5. However, the specific value of the IOU distance threshold is not limited to 0.5. In other embodiments, the IOU distance threshold can be set to other values according to the actual situation.
[0057] When the ReID feature distance between the detection box and the tracking box is less than θ ReID And the IOU distance between them is less than θ IOU season If the new ReID feature distance is 1, then the smaller of the new ReID feature distance and the IOU distance is used as the distance matrix C for Hungarian matching. The matched detection boxes and tracking boxes are then used as the tracking boxes for the current frame. Information updates for the tracking boxes in the current frame include the ReID features of the tracking boxes and the Kalman filter model parameters. After the first Hungarian matching, the Kalman filter model parameters for updating can be determined based on the matched detection boxes. These Kalman filter model parameters can include the mean and covariance. Specifically, the mean and covariance of the pixel values in the matched detection boxes can be calculated to obtain the Kalman filter model parameters for updating. These updated Kalman filter model parameters are then used to update the Kalman filter model parameters. Finally, the updated Kalman filter model parameters are used to predict the detection boxes for the next frame, thus obtaining the detection boxes for the next frame.
[0058] Unmatched tracking boxes from the first Hungarian matching process are then matched a second time with low-confidence detection boxes. This second Hungarian matching is based solely on the IOU distance as the distance matrix C. The matched detection boxes are used as the tracking boxes for the current frame, and their information is updated, along with the Kalman filter model parameters. Similarly, after the second Hungarian matching, the Kalman filter model parameters for updating can be determined based on the matched detection boxes. These parameters can include the mean and covariance. Specifically, the mean and covariance of the pixel values within the matched detection boxes are calculated to obtain the updated Kalman filter model parameters. These updated parameters are then used to update the Kalman filter model parameters, and the prediction of the next frame's detection boxes is performed to obtain the detection boxes for that frame.
[0059] The second unmatched tracking box is marked as lost. If the confidence of a detection box that fails to match twice is greater than a threshold, it is created as a new tracking box. The tracking boxes that match twice are used to predict the position of the tracking box in the current frame based on the updated Kalman model parameters, and together with the newly created tracking box, they form the tracking box for the current frame t. It should be noted that the preset confidence level in this embodiment can be a manually set value. For example, the preset confidence level can be 0.5, in which case detection boxes with a confidence level greater than 0.5 are high-confidence detection boxes, and detection boxes with a confidence level less than or equal to 0.5 are low-confidence detection boxes. Of course, the above-mentioned preset confidence level of 0.5 is not a limitation of the present invention, and in other embodiments, the above-mentioned preset confidence level can be set to other values according to the actual situation.
[0060] The dual-matching tracking algorithm is used to track the detected target object and obtain the corresponding tracking trajectory. When there are multiple target objects, multiple tracking trajectories are obtained. Of course, when the target object is occluded, there may be false detections in the tracking trajectory, which may result in multiple tracking trajectories for the same target object.
[0061] Step 102: Select a short tracking trajectory from multiple tracking trajectories whose trajectory length is less than a preset length threshold.
[0062] Wherein, the aforementioned trajectory length refers to the trajectory length of multiple tracking trajectories. The aforementioned preset length threshold is a pre-set condition used to determine whether a tracking trajectories among multiple tracking trajectories are short tracking trajectories. The preset length threshold can be set to 25. Of course, the aforementioned preset length threshold of 25 is not a limitation of the present invention, and in other embodiments, the aforementioned preset length threshold can be set to other values according to actual conditions.
[0063] Specifically, during tracking, false detection bounding boxes typically exist for a short time and have a high degree of overlap with the correct bounding boxes. However, in cases of occlusion, while the correct detection boxes of the occluded and obscured targets have a high degree of overlap, the trajectory length is not too short. After the tracking algorithm tracks a trajectory segment, it first determines the trajectory length, identifying trajectory segments with a length less than a preset length threshold, thus obtaining the short tracking trajectory. It should be noted that among multiple tracking trajectory segments, those with a length greater than or equal to the preset length threshold are defined as long tracking trajectories.
[0064] Step 103: Select target tracking long trajectories from the tracking long trajectories that have spatiotemporal intersection with the tracking short trajectories.
[0065] Among them, the long tracking trajectory is the tracking trajectory whose length is greater than a preset length threshold among multiple tracking trajectory segments. Of course, the long tracking trajectory can also be the tracking trajectory whose length is equal to the preset length threshold among multiple tracking trajectory segments.
[0066] Specifically, such as Figure 3 As shown, step 103 includes:
[0067] Step 201: Determine whether the short tracking trajectory and the long tracking trajectory intersect at the same time and in the same region;
[0068] Step 202: If the tracking short trajectory and the tracking long trajectory intersect at the same time and in the same area, then the tracking long trajectory that intersects with the tracking short trajectory at the same time and in the same area is determined as the target tracking long trajectory.
[0069] The same time can be the same moment or the same time period, and the same area can be the same area or position of the trajectory in the image.
[0070] More specifically, after selecting the short tracking trajectories, other long tracking trajectories are sequentially traversed based on these short trajectories. First, it is determined whether they existed at the same time and in the same region. If they existed simultaneously at the same time and in the same region, it indicates that the short tracking trajectory intersects with the long tracking trajectory. After all the short tracking trajectories have been determined, the long tracking trajectory that intersects with the short tracking trajectory at the same time and in the same region is identified as the target long tracking trajectory.
[0071] Step 104: Calculate the confidence level of the short tracking trajectory and the trajectory intersection-union ratio between the short tracking trajectory and the target tracking long trajectory.
[0072] The confidence score of the aforementioned short tracking trajectory can be the average confidence score of the detection confidence scores within the short tracking trajectory. For example, if the target object in the short tracking trajectory includes both a face image and a body image, then the confidence score of the short tracking trajectory can be the average confidence score of the face image and the body image. The aforementioned trajectory intersection-union ratio is the intersection-union ratio between the short tracking trajectory and the long target tracking trajectory.
[0073] Specifically, the confidence level needs to be calculated for the selected short tracking trajectories to obtain the corresponding confidence score. Furthermore, the intersection-over-union (IoU) ratio between each short tracking trajectory and each target long tracking trajectory needs to be calculated. It should be noted that when there are multiple short tracking trajectories and multiple target long tracking trajectories selected, the confidence level for each short tracking trajectory and the IoU ratio between each short tracking trajectory and each target long tracking trajectory need to be calculated separately.
[0074] In this embodiment, as Figure 4 As shown, step 104 includes:
[0075] Step 301: Calculate the time range in which the short tracking trajectory and the long target tracking trajectory intersect in space and time;
[0076] Step 302: Calculate the intersection and union ratio of the short tracking trajectory and the long target tracking trajectory within the time range, and determine the intersection and union ratio as the trajectory intersection and union ratio between the short tracking trajectory and the long target tracking trajectory.
[0077] Specifically, the aforementioned time range refers to the period during which there is a spatiotemporal intersection between the short tracking trajectory and the long target tracking trajectory. The intersection-union ratio (IUGR) is the IUGR of the trajectories within this time range. The formula for calculating the IUGR between the short tracking trajectory and the long target tracking trajectory is as follows:
[0078]
[0079] in, This represents the Interchange of Union (IOU) of the tracking boxes for the two trajectories at time t. intersection This represents a time series in which two trajectories exist simultaneously.
[0080] Step 105: Based on the confidence level of the short tracking trajectory and the trajectory intersection-union ratio between the short tracking trajectory and the target tracking long trajectory, filter the short tracking trajectories that meet the preset filtering conditions, and perform target tracking based on the filtered short tracking trajectories to obtain the target tracking result.
[0081] The above target tracking result is the target tracking trajectory. The ReID feature similarity can be calculated for two filtered short tracking trajectories from different times. If the ReID feature similarity is greater than a preset value, it can be determined that the two filtered short tracking trajectories from different times are the same target. The short tracking trajectories of the same target are then spliced together to obtain the final tracking trajectory of the target as the target tracking trajectory.
[0082] In one possible embodiment, for two filtered short tracking trajectories from different times, the earlier and later tracking short trajectories can be identified. The ReID features of the later portion of the earlier tracking short trajectory are compared with the ReID features of the earlier portion of the later tracking short trajectory. If the similarity is greater than a preset value, the two filtered short tracking trajectories from different times are determined to be tracking short trajectories of the same target. The tracking short trajectories of the same target are then concatenated to obtain the final tracking trajectory of that target as the target tracking trajectory. Specifically, the ReID features of the later K frames of the earlier tracking short trajectory can be compared with the ReID features of the earlier K frames of the later tracking short trajectory.
[0083] Specifically, such as Figure 5 As shown, step 105 includes:
[0084] Step 401: Calculate the new confidence level of the short tracking trajectory based on the confidence level of the short tracking trajectory and the trajectory intersection-union ratio between the short tracking trajectory and the target tracking long trajectory;
[0085] Step 402: Determine whether the new confidence level of the tracked short trajectory meets the preset filtering conditions;
[0086] Step 403: If the new confidence level of the tracked short trajectory meets the preset filtering conditions, then clear the tracked short trajectory whose new confidence level meets the preset filtering conditions.
[0087] The aforementioned preset filtering condition is that the new confidence level of tracking the short trajectory is less than or equal to a preset confidence threshold. The preset confidence threshold can be set according to actual needs; for example, it can be 0.4. However, setting the preset confidence threshold to 0.4 is not a limitation of the invention; in other embodiments, the preset length threshold can be set to other values according to actual circumstances. The new confidence level of tracking the short trajectory can be the confidence level of tracking the short trajectory multiplied by 1 - 10U. tracklet .
[0088] Specifically, after calculating the new confidence level of the tracked short trajectory, it needs to be compared with a preset confidence threshold. It is then determined whether the new confidence level is greater than the preset threshold (usually 0.4). If the new confidence level is less than or equal to the preset threshold, the tracked short trajectories whose new confidence level meets the preset filtering conditions are removed. This achieves the effect of eliminating false positives for short trajectories and improving tracking accuracy.
[0089] In this embodiment, if the new confidence level of the tracked short trajectory does not meet the preset filtering conditions, the tracked short trajectory whose new confidence level does not meet the preset filtering conditions is saved.
[0090] Specifically, short tracking trajectories with a new confidence level greater than a preset confidence threshold are retained, thereby ensuring that the retained short tracking trajectories are all accurate tracking trajectories and improving tracking accuracy.
[0091] After filtering out short tracking trajectories that are false detections from multiple tracking trajectories, target tracking can continue based on the accurate tracking trajectory to obtain the target tracking trajectory. This eliminates the impact of false detections by the detection algorithm on tracking, thereby improving the tracking accuracy under complex occlusion conditions.
[0092] In this embodiment of the invention, multiple tracking trajectories are acquired; short tracking trajectories with a length less than a preset length threshold are selected from the multiple tracking trajectories; target long tracking trajectories with spatiotemporal intersection with the short tracking trajectories are selected from the long tracking trajectories, where the long tracking trajectories are those with a length greater than the preset length threshold among the multiple tracking trajectories; the confidence level of the short tracking trajectories and the intersection-union ratio (IUR) between the short tracking trajectories and the target long tracking trajectories are calculated; based on the confidence level of the short tracking trajectories and the IUR between the short tracking trajectories and the target long tracking trajectories, short tracking trajectories that meet preset filtering conditions are filtered, and target tracking is performed based on the filtered short tracking trajectories to obtain the target tracking result. By combining multiple dimensions such as trajectory length, trajectory confidence level, and IUR, a flexible nonmaximum suppression method is used for target tracking at the trajectory level, thereby eliminating the impact of false detections by the detection algorithm on tracking. This embodiment can effectively filter falsely detected short trajectories, thereby improving the tracking accuracy under complex occlusion conditions.
[0093] It should be noted that the target tracking method provided in this embodiment of the invention can be applied to devices such as smartphones, computers, and servers that are capable of target tracking.
[0094] like Figure 6 As shown, the target tracking device 500 includes:
[0095] The acquisition module 501 is used to acquire multiple tracking trajectories;
[0096] The selection module 502 is used to select a short tracking trajectory whose trajectory length is less than a preset length threshold from multiple tracking trajectories;
[0097] The filtering module 503 is used to filter out target long tracking trajectories that have spatiotemporal intersection with short tracking trajectories from long tracking trajectories. Long tracking trajectories are tracking trajectories whose trajectory length is greater than a preset length threshold among multiple tracking trajectories.
[0098] The calculation module 504 is used to calculate the confidence level of the short tracking trajectory and the trajectory intersection-union ratio between the short tracking trajectory and the target tracking long trajectory;
[0099] The filtering module 505 is used to filter short tracking trajectories that meet preset filtering conditions based on the confidence level of the short tracking trajectory and the trajectory intersection-union ratio between the short tracking trajectory and the target tracking long trajectory, and to perform target tracking based on the filtered short tracking trajectories to obtain the target tracking result.
[0100] Optionally, the acquisition module 501 includes:
[0101] The detection unit is used to detect the target object;
[0102] The segmentation unit is used to obtain the tracking trajectory of the target object based on the dual-matching tracking algorithm.
[0103] Optionally, the dual-matching tracking algorithm includes the Kalman filter algorithm and the double Hungarian matching algorithm.
[0104] Optional, such as Figure 7 As shown, the filtering module 503 includes:
[0105] The first judgment unit 5031 is used to determine whether there is an intersection between the short tracking trajectory and the long tracking trajectory in the same time and the same area.
[0106] The determining unit 5032 is used to determine the long tracking trajectory that intersects with the short tracking trajectory at the same time and in the same area as the target long tracking trajectory if there is an intersection between the short tracking trajectory and the long tracking trajectory at the same time and in the same area.
[0107] Optional, such as Figure 8As shown, the calculation module 504 includes:
[0108] The first calculation unit 5041 is used to calculate the time range in which there is a spatiotemporal intersection between the short tracking trajectory and the long target tracking trajectory.
[0109] The second calculation unit 5042 is used to calculate the intersection and intersection ratio between the short tracking trajectory and the long tracking trajectory of the target within the time range, and to determine the intersection and intersection ratio as the trajectory intersection and intersection ratio between the short tracking trajectory and the long tracking trajectory of the target.
[0110] Optional, such as Figure 9 As shown, the filter module 505 includes:
[0111] The third calculation unit 5051 is used to calculate a new confidence level of the short track based on the confidence level of the short track and the intersection-union ratio of the short track and the target tracking long track.
[0112] The second judgment unit 5052 is used to determine whether the new confidence level of the tracked short trajectory meets the preset filtering conditions.
[0113] The clearing unit 5053 is used to clear the tracking short trajectory whose new confidence level meets the preset filtering conditions if the new confidence level of the tracking short trajectory meets the preset filtering conditions.
[0114] Optionally, the target tracking device 500 also includes:
[0115] The storage unit is used to save the short tracking trajectory whose new confidence level does not meet the preset filtering conditions if the new confidence level of the short tracking trajectory does not meet the preset filtering conditions.
[0116] It should be noted that the target tracking device 500 provided in this embodiment of the invention can be applied to devices such as smartphones, computers, and servers that can perform target tracking.
[0117] The target tracking device 500 provided in this embodiment of the invention can implement all the processes of the target tracking method in the above-described method embodiments, and can achieve the same beneficial effects. To avoid repetition, it will not be described again here.
[0118] See Figure 10 , Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention, such as... Figure 10 As shown, it includes: a memory 602, a processor 601, and a computer program for a target tracking method stored in the memory 602 and executable on the processor 601, wherein:
[0119] The processor 601 is used to call the computer program stored in the memory 602 and perform the following steps:
[0120] Acquire multiple tracking trajectories;
[0121] Select a short tracking trajectory whose length is less than a preset length threshold from multiple tracking trajectories;
[0122] Target long tracking trajectories that have spatiotemporal intersection with short tracking trajectories are selected from long tracking trajectories. Long tracking trajectories are those whose trajectory length is greater than a preset length threshold among multiple tracking trajectories.
[0123] Calculate the confidence score of the short tracking trajectory and the trajectory intersection-union ratio between the short tracking trajectory and the target tracking long trajectory;
[0124] Based on the confidence level of the short tracking trajectory and the intersection-union ratio between the short tracking trajectory and the target tracking long trajectory, the short tracking trajectories that meet the preset filtering conditions are filtered, and the target is tracked based on the filtered short tracking trajectories to obtain the target tracking result.
[0125] Optionally, the processor 601 performs the acquisition of multiple tracking trajectories, including:
[0126] Detect the target object;
[0127] The tracking trajectory of the target object is obtained based on the dual-matching tracking algorithm.
[0128] Optionally, the dual-matching tracking algorithm includes the Kalman filter algorithm and the double Hungarian matching algorithm.
[0129] Optionally, the processor 601 performs the following steps: filtering out target tracking long trajectories from the tracking long trajectories that have spatiotemporal intersection with the tracking short trajectories, including:
[0130] Determine whether there is an intersection between the short tracking trajectory and the long tracking trajectory in the same time and the same area;
[0131] If the short tracking trajectory and the long tracking trajectory intersect at the same time and in the same area, then the long tracking trajectory that intersects with the short tracking trajectory at the same time and in the same area is identified as the target long tracking trajectory.
[0132] Optionally, the processor 601 performs the calculation of the trajectory intersection-union ratio between the short tracking trajectory and the long target tracking trajectory, including:
[0133] Calculate the time range in which the short tracking trajectory and the long target tracking trajectory intersect in spatiotemporal time.
[0134] Calculate the intersection-over-union ratio (IoU) between the short tracking trajectory and the long tracking trajectory of the target within the time range, and determine the IoU as the trajectory IoU ratio between the short tracking trajectory and the long tracking trajectory of the target.
[0135] Optionally, the processor 601 performs filtering of short tracking trajectories that meet preset filtering conditions based on the confidence level of the short tracking trajectory and the trajectory intersection-union ratio between the short tracking trajectory and the target tracking long trajectory, including:
[0136] The new confidence level of the short tracking trajectory is calculated based on the confidence level of the short tracking trajectory and the trajectory intersection-union ratio between the short tracking trajectory and the target tracking long trajectory.
[0137] Determine whether the new confidence level of the tracked short trajectory meets the preset filtering conditions;
[0138] If the new confidence level of the tracked short trajectory meets the preset filtering conditions, then the tracked short trajectory whose new confidence level meets the preset filtering conditions is cleared.
[0139] Optionally, processor 601 may also perform the following steps:
[0140] If the new confidence level of the tracked short trajectory does not meet the preset filtering conditions, then the tracked short trajectory whose new confidence level does not meet the preset filtering conditions is saved.
[0141] It should be noted that the electronic device 600 provided in this embodiment of the invention can be applied to devices such as smartphones, computers, and servers that can perform target tracking methods.
[0142] The electronic device 600 provided in this embodiment of the invention can implement all the processes of the target tracking method in the above-described method embodiments, and can achieve the same beneficial effects. To avoid repetition, it will not be described again here.
[0143] This invention also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the various processes of the target tracking method or the application-side target tracking method provided in this invention, and achieves the same technical effect. To avoid repetition, it will not be described again here.
[0144] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0145] The above description discloses only preferred embodiments of the present invention and should not be construed as limiting the scope of the present invention. Therefore, equivalent variations made in accordance with the claims of the present invention are still within the scope of the present invention.
Claims
1. A target tracking method, characterized in that, The method includes the following steps: Acquire multiple tracking trajectories; Select a short tracking trajectory whose length is less than a preset length threshold from the multiple tracking trajectories; Target long tracking trajectories that have spatiotemporal intersection with the short tracking trajectories are selected from the long tracking trajectories. The long tracking trajectories are the tracking trajectories whose trajectory length is greater than the preset length threshold among the multiple tracking trajectories. The confidence level of the short tracking trajectory and the trajectory intersection-union ratio between the short tracking trajectory and the target long tracking trajectory are calculated. Specifically, the time range in which the short tracking trajectory and the target long tracking trajectory have a spatiotemporal intersection is calculated; the intersection-union ratio between the short tracking trajectory and the target long tracking trajectory within the time range is calculated, and the intersection-union ratio is determined as the trajectory intersection-union ratio between the short tracking trajectory and the target long tracking trajectory. Based on the confidence level of the short tracking trajectory and the intersection-union ratio (IUU) between the short tracking trajectory and the target long tracking trajectory, short tracking trajectories that meet preset filtering conditions are filtered out. Target tracking is then performed based on the filtered short tracking trajectories to obtain the target tracking result. Specifically, a new confidence level of the short tracking trajectory is calculated based on its confidence level and the IUU between the short tracking trajectory and the target long tracking trajectory; it is then determined whether the new confidence level of the short tracking trajectory meets the preset filtering conditions; if the new confidence level of the short tracking trajectory meets the preset filtering conditions, then the short tracking trajectories whose new confidence level meets the preset filtering conditions are removed.
2. The target tracking method as described in claim 1, characterized in that, The acquisition of multiple tracking trajectories includes: Detect the target object; The tracking trajectory of the target object is obtained based on the dual-matching tracking algorithm.
3. The target tracking method as described in claim 2, characterized in that, The dual-matching tracking algorithm includes the Kalman filter algorithm and two Hungarian matching algorithms.
4. The target tracking method as described in claim 1, characterized in that, The step of selecting the target long tracking trajectory from the long tracking trajectory that has a spatiotemporal intersection with the short tracking trajectory includes: Determine whether the short tracking trajectory and the long tracking trajectory intersect in the same time and the same region; If the short tracking trajectory and the long tracking trajectory intersect at the same time and in the same area, then the long tracking trajectory that intersects with the short tracking trajectory at the same time and in the same area is determined as the target long tracking trajectory.
5. The target tracking method as described in claim 1, characterized in that, The method further includes: If the new confidence level of the tracked short trajectory does not meet the preset filtering condition, then the tracked short trajectory whose new confidence level does not meet the preset filtering condition is saved.
6. A target tracking device, characterized in that, The target tracking device includes: The acquisition module is used to acquire multiple tracking trajectories; The selection module is used to select short tracking trajectories whose length is less than a preset length threshold from the multiple tracking trajectories. The filtering module is used to filter out target long tracking trajectories that have spatiotemporal intersection with the short tracking trajectories from the long tracking trajectories. The long tracking trajectories are the tracking trajectories whose trajectory length is greater than the preset length threshold among the multiple tracking trajectories. The calculation module is used to calculate the confidence level of the short tracking trajectory and the trajectory intersection-union ratio between the short tracking trajectory and the target long tracking trajectory. Specifically, it calculates the time range in which the short tracking trajectory and the target long tracking trajectory have a spatiotemporal intersection; it calculates the intersection-union ratio between the short tracking trajectory and the target long tracking trajectory within the time range, and determines the intersection-union ratio as the trajectory intersection-union ratio between the short tracking trajectory and the target long tracking trajectory. The filtering module is used to filter short tracking trajectories that meet preset filtering conditions based on the confidence level of the short tracking trajectory and the intersection-union ratio (IUU) between the short tracking trajectory and the target long tracking trajectory, and to perform target tracking based on the filtered short tracking trajectories to obtain the target tracking result. Specifically, it calculates a new confidence level for the short tracking trajectory based on the confidence level of the short tracking trajectory and the IUU between the short tracking trajectory and the target long tracking trajectory; determines whether the new confidence level of the short tracking trajectory meets the preset filtering conditions; and if the new confidence level of the short tracking trajectory meets the preset filtering conditions, it removes the short tracking trajectories whose new confidence level meets the preset filtering conditions.
7. An electronic device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the steps of the target tracking method as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the target tracking method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Data association and trajectory evaluation-based multi-target tracking method
CN107169989A
Target tracking method and device, electronic equipment and storage medium
CN113284168A