Skip to content

Yamini-Eshwar/Vehicle-Tracking-on-Highway-using-OpenCV-and-Euclidean-Distance

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Vehicle Tracking using OpenCV πŸš—πŸ“Ή

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.

surv1

πŸ” What this project does:

  • βœ… 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

🧠 How it works (Simple Explanation)

  1. Background Subtraction:

    • Detects moving objects by comparing the current frame with previous frames.
  2. Contour Detection:

    • Finds the shape outlines of moving objects.
  3. Bounding Boxes:

    • Puts a rectangle around each detected object.
  4. 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.

πŸ§ͺ Technologies Used

  • Python 🐍
  • OpenCV (cv2)
  • NumPy
  • Basic Math (Euclidean distance)

πŸ’» How to Run the Project

  1. Clone the repo:
    git clone https://github.com/YOUR-USERNAME/Vehicle-Tracking-OpenCV.git
    cd Vehicle-Tracking-OpenCV

About

Each object gets a unique ID and is tracked across frames on highway surveillance video.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages