Search

CN-116109671-B - Traffic vehicle tracking method based on video frame skipping processing

CN116109671BCN 116109671 BCN116109671 BCN 116109671BCN-116109671-B

Abstract

The invention provides a traffic vehicle tracking method based on video frame skipping processing, which uses DeepSort algorithm, introduces a cascade matcher, improves the phenomenon of ID-Switch caused by only one time of matching in Sort algorithm, simultaneously considers distance measurement and appearance measurement among vehicles, adds a gating matrix to limit the possible abnormal value of a certain measurement, if cascade matching fails, does not delete a certain track or target immediately, but continues to perform IOU-Dis matching, introduces Euclidean distance in IOU-Dis matching, obviously increases vehicle displacement under the frame skipping condition, and can prevent single IOU distance from being mismatched, set the maximum life cycle of the track, cope with the condition of target shielding, and the target can be matched back to the original track within the maximum life cycle, thereby reducing the phenomenon of ID-Switch. The invention has the advantage of tracking a large displacement target.

Inventors

  • ZHANG WEIBIN
  • DU MINJIE
  • WU PEIYUAN
  • WANG WEI

Assignees

  • 南京理工大学

Dates

Publication Date
20260512
Application Date
20230120

Claims (9)

  1. 1. The traffic vehicle tracking method based on video frame skipping processing is characterized by improving a matching mechanism, performing matching optimization by utilizing the characteristic that traffic flow has directivity, and performing vehicle tracking by means of a Kalman filtering algorithm and a Hungary matching algorithm, and comprises the following steps of: step one, road video is obtained through road end monitoring, the running direction of a vehicle flow is determined, and frame skipping processing is carried out; acquiring a target detection frame of the vehicle in each frame of the video through a target detection algorithm, wherein the target detection frame comprises position and size information, and inputting the target detection frame into a cascade matcher; Step three, utilizing a cascade matcher to carry out primary matching on each input target detection frame and each prediction frame of each track in a cascade matching track library, wherein the cascade matching track library is empty when the first frame is matched, the matching is successfully skipped to step five, and step four is carried out when the matching is failed; Step four, performing secondary matching on the input target detection frames and the IOU-Dis track library, namely performing IOU-Dis matching, judging a target state according to the type of matching failure if the IOU-Dis matching fails, judging whether track sets are added according to the target state, and jumping to step two if the frame matching is finished, and jumping to step five if the IOU-Dis matching is successful, wherein the secondary matching requires calculating the IOU distance and the Euclidean distance between each target detection frame and each track prediction frame in the IOU-Dis track library, weighting the two as cost matrixes, performing calculation through a Hungary matching algorithm, and outputting the pairing situation of each target frame, and the cost matrix is calculated in the following way: ; Wherein the method comprises the steps of , Respectively represent the first to be calculated Target detection frame and IOU-Dis track library A prediction box of the individual tracks is provided, The euclidean distance is represented as, Representing the distance of the IOU, The set weight parameter is a value between 0 and 1; Step five, carrying out Kalman filtering update on a prediction frame of each track in the successfully matched IOU-Dis track library to obtain updated target position and speed information, then confirming the marking information of the target, and storing the updated result track of the Kalman filtering into a track set; Step six, carrying out Kalman filtering prediction on each track in the track set, predicting a position frame of each track at the next moment, and storing the position frame in the track; and step seven, carrying out mark checking on the Kalman filtering prediction result generated in the step six, if the mark is in a confirmation state, jumping to the step three for continuous tracking, and if the mark is in an unacknowledged state, jumping to the step four for continuous tracking.
  2. 2. The traffic vehicle tracking method based on video frame skipping according to claim 1, wherein in the first step, the road video is a plan view of an intersection, including all lanes in one direction, the driving direction of the traffic flow is a vertical direction of a photographed image, and the frame skipping refers to discarding part of frames in the video flow and tracking only by using the rest of frames.
  3. 3. The method for tracking traffic vehicles based on video frame skipping according to claim 1, wherein in the second step, the target detection algorithm selects YOLOv a 4 recognition algorithm.
  4. 4. The traffic vehicle tracking method based on video frame skipping processing according to claim 1, wherein in the third step, the cascade matcher adopts a cyclic matching strategy, and the specific matching process is as follows: Step 3-1, performing distance measurement calculation and appearance measurement calculation on input data, namely the position of a target detection frame and the size of the target detection frame output by a target detection algorithm, performing primary matching distance measurement by using a mahalanobis distance, wherein the appearance measurement refers to appearance feature comparison among targets, namely performing appearance feature extraction on an area in the detection frame by using a Re-ID Re-identification algorithm, and calculating a cosine distance on the appearance features; Step 3-2, calculating a cost matrix, wherein the cost matrix is used for Hungary matching calculation and comprises information of distance measurement and appearance measurement, and weighting is carried out, and the cost matrix is calculated according to the following formula: ; Wherein the method comprises the steps of , Respectively represent the first to be calculated The target detection frame and the first in the cascade matching track library A prediction box of the individual tracks is provided, Representing objects And (3) with The mahalanobis distance between the two, Representing objects And (3) with The cosine distance between the two, The set weight parameter is a value between 0 and 1; Step 3-3, calculating a threshold matrix, wherein the threshold matrix is used for limiting the range of metric values, the threshold matrix is a matrix with only 0 and 1 numerical values, and if the value in the cost matrix corresponds to 0 in the threshold matrix, two targets are considered to be unable to be matched, and the threshold matrix calculation method is as follows: ; indicating the legitimacy of the mahalanobis distance, The validity of the cosine distance is represented, and only two values of 0 and 1 are used; And 3-4, performing Hungary matching, namely performing Hungary matching under the limit of the threshold matrix calculated in the step 3-3 through the cost matrix calculated in the step 3-2.
  5. 5. The traffic vehicle tracking method based on video frame skipping processing according to claim 1, wherein in the fourth step, as for the result of the IOU-Dis matching failure, that is, the target and the track are not successfully matched, the following two cases are specifically: 1) If the track is not matched, namely a certain track prediction frame cannot be matched with any detection frame, at the moment, checking the marking state of the track, if the marking is marked as confirmation, continuing to judge the life cycle, if the life of the current track is smaller than the set life cycle, storing the track into a track set, and if the life of the current track is larger than the life cycle, directly discarding the track; 2) If the targets are not matched, i.e. a certain target cannot be matched with any track prediction frame, a new track is considered to be possibly generated, the target is added into the track set as a new track, and the unconfirmed state is marked.
  6. 6. The traffic vehicle tracking method based on video frame skipping processing according to claim 1, wherein in the step five, the kalman filtering updating process inputs a successfully matched target, and data including the position and the size of a target detection frame and a noise value are needed, and mark confirmation is performed after updating, namely, the track of three continuous frames is successfully matched, namely, the track is marked as a confirmation state, and otherwise, the track is marked as unacknowledged.
  7. 7. The traffic vehicle tracking method based on video frame skipping processing according to claim 1, wherein in the sixth step, the kalman filtering prediction process inputs the positions, the widths and the speeds of all the target detection frames included in one track, so as to predict the target detection frame at the next moment of the current track.
  8. 8. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing a video frame skip processing based traffic vehicle tracking method as claimed in any one of claims 1 to 7 when the computer program is executed.
  9. 9. A computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a video frame skip processing based traffic vehicle tracking based on the traffic vehicle tracking method of any of claims 1-7.

Description

Traffic vehicle tracking method based on video frame skipping processing Technical Field The invention relates to a target tracking and traffic parameter extraction technology, in particular to a traffic vehicle tracking method based on video frame skipping processing. Background In traffic management, traffic flow parameters are indispensable analysis data. Traffic flow parameter extraction using intersection surveillance video necessitates tracking of vehicles. Single-target tracking and multi-target tracking can be distinguished according to the number of tracking tasks. In the context of traffic flow computation, a multi-objective tracking algorithm must be used. Multi-target processing can be further divided into on-line tracking and off-line tracking from the processing perspective. On-line tracking is to process video in frame order, only the current frame image is used for tracking, while off-line tracking can store and use historical frame information and even future frame information to optimize the whole video, but is often limited in practical application due to speed problems. Modeling of multi-target tracking is complex due to uncertainty in road conditions. The multi-target needs to realize the association of the same target between two frames and also needs to process the situations of frequent shielding, missed detection and false detection of the identifier, higher target similarity and the like. In particular, the edge computing device is a computing unit which is very easy to deploy to the intersection, and directly computes traffic flow parameters. While edge devices are small and easy to deploy, their limited computing power can make processing multiple paths of video data very slow. Conventional tracking algorithms often have respective limitations, such as ID hopping, slower algorithm speed, single matching policy, and the like. Feature extraction based on deep learning can be more accurate in matching. In addition, in an edge device with extremely limited computational effort, the performance requirements are very high. Conventional tracking algorithms fail to meet such requirements. Disclosure of Invention The invention aims to provide a traffic vehicle tracking method based on video frame skipping processing. The technical scheme for realizing the aim of the invention is that the traffic vehicle tracking method based on video frame skip processing improves a matching mechanism, performs matching optimization by utilizing the characteristic that traffic flow has directivity, performs vehicle tracking by means of a Kalman filtering algorithm and a Hungary matching algorithm, and comprises the following steps: step one, road video is obtained through road end monitoring, the running direction of a vehicle flow is determined, and frame skipping processing is carried out; acquiring a target detection frame of the vehicle in each frame of the video through a target detection algorithm, wherein the target detection frame comprises position and size information, and inputting the target detection frame into a cascade matcher; Step three, utilizing a cascade matcher to carry out primary matching on each input target detection frame and each prediction frame of each track in a cascade matching track library, wherein the cascade matching track library is empty when the first frame is matched, the matching is successfully skipped to step five, and step four is carried out when the matching is failed; Step four, performing secondary matching on the input target detection frame and the IOU-Dis track library, namely performing IOU-Dis matching, judging a target state according to the type of matching failure if the IOU-Dis matching fails, judging whether to join a track set or not according to the target state, and jumping to step two if the matching of the IOU-Dis is successful; Step five, carrying out Kalman filtering update on a prediction frame of each track in the successfully matched IOU-Dis track library to obtain updated target position and speed information, then confirming the marking information of the target, and storing the updated result track of the Kalman filtering into a track set; Step six, carrying out Kalman filtering prediction on each track in the track set, predicting a position frame of each track at the next moment, and storing the position frame in the track; and step seven, carrying out mark checking on the Kalman filtering prediction result generated in the step six, if the mark is in a confirmation state, jumping to the step three for continuous tracking, and if the mark is in an unacknowledged state, jumping to the step four for continuous tracking. In the first step, the road video is a plan view of the intersection, including all lanes in one direction, the driving direction of the traffic is the vertical direction of the photographed image, and the frame skipping processing means discarding part of the frames in the video stream and performing tracking processing