|
Algorithm 1: Modified Deep SORT. |
YOLO detects the vehicles in the video frame and saves the position and ID of the detection boxes.
Kalman filtering predicts the position of the vehicles while saving the position and the ID of the predicted boxes.
In the subsequent detection and prediction process, all newly predicted frames are stored in a temporary unit.
For each newly predicted frame position, position division is performed and different thresholds are set for different position areas. Compare with the positions of all predicted boxes that have appeared, and calculate the distance between the newly appearing box and the previously appearing boxes. When the Euclidean distance to a certain box that has appeared before is shorter than the set threshold, this is considered its next position.
Update the position of the previously predicted box to the position just newly predicted and wipe the ID of the newly predicted box. Match the new predicted position with the old ID.
|