This project aims to detect and track objects in a video stream and then estimate their speed based on their movement. The project is divided into three main phases: object detection using YOLO v4, object tracking using DeepSORT, and speed calculation based on object movement between two horizontal lines in the video.
In this phase, YOLO v4, a state-of-the-art object detection algorithm, is used to identify objects of interest in each frame of the video. YOLO v4 provides bounding boxes around detected objects along with their class labels.
The object tracking phase employs DeepSORT (Deep Simple Online and Realtime Tracking) algorithm to track the detected objects across consecutive frames. DeepSORT enables accurate and real-time tracking of objects, providing their trajectories over time.
Speed is calculated by measuring the time taken for an object to traverse between two horizontal lines marked in the video. The distance between these lines is known. By analyzing the displacement of objects between frames and the time elapsed, we can calculate their speed using the formula: speed = distance / time.
- Data Preparation: Ensure that your video data is accessible and suitable for processing.
- Object Detection: Run YOLO v4 to detect objects in each frame.
- Object Tracking: Apply DeepSORT algorithm to track the detected objects across frames.
- Speed Calculation: Identify two horizontal lines in the video between which the distance is known. Measure the time taken for the object to cover this distance.
- Speed Estimation: Utilize the measured time and known distance to estimate the speed of the tracked objects.
- Python 3.x
- OpenCV
- YOLO v4 model
- DeepSORT algorithm
- Pre-trained weights for YOLO v4 and DeepSORT (or train your own models)
- Basic understanding of computer vision and deep learning concepts
- YOLO v4: Credits to the developers and contributors of YOLO v4 for their outstanding object detection model.
- DeepSORT: Credits to the developers and contributors of DeepSORT for providing a robust object tracking algorithm.
This project is for educational and research purposes only. Usage of the project for any unlawful purposes is strictly prohibited. The developers of this project are not responsible for any misuse or illegal activities conducted using this software.