This project uses OpenCV and Python to detect and track moving vehicles in a video using a Euclidean Distance Tracker. It simulates a basic object tracking system where each moving object (car/bike) is assigned a unique ID and tracked frame-by-frame on a highway.
- β Detects moving vehicles in a video
- π§ Assigns a unique ID to each object
- π Tracks the object across frames using Euclidean distance
- π₯ Shows live bounding boxes and object IDs
- π§Ό Ignores noise/small movements using contour area filtering
-
Background Subtraction:
- Detects moving objects by comparing the current frame with previous frames.
-
Contour Detection:
- Finds the shape outlines of moving objects.
-
Bounding Boxes:
- Puts a rectangle around each detected object.
-
Euclidean Distance Tracker:
- Measures how far each object moved to decide if itβs the same or a new object.
- Assigns a unique ID to each object so it can be tracked.
- Python π
- OpenCV (cv2)
- NumPy
- Basic Math (Euclidean distance)
- Clone the repo:
git clone https://github.com/YOUR-USERNAME/Vehicle-Tracking-OpenCV.git cd Vehicle-Tracking-OpenCV