Skip to content

arunkumararavindhakshan05-sudo/Moving_object_detection_using_colour

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

🎨 Colour-Based Moving Object Tracker using OpenCV

Python OpenCV Status

A real-time colour-based object tracking system using Python and OpenCV. The system identifies and tracks a specific coloured object in a live webcam feed using HSV colour masking — no machine learning required.


📸 Demo

[Live Webcam Feed]
  → Frame converted to HSV colour space
  → Colour mask applied (e.g., red/blue/green object)
  → Matching object highlighted with bounding box
  → Tracked in real-time as object moves

⚙️ How It Works

  1. HSV Conversion — Each frame is converted from BGR to HSV colour space for better colour isolation
  2. Colour Masking — A predefined HSV range is applied to isolate the target colour
  3. Noise Reduction — Morphological operations (erosion + dilation) clean up the mask
  4. Contour Detection — Finds the largest matching contour (the tracked object)
  5. Bounding Box — Draws a rectangle around the detected coloured object

🛠️ Tech Stack

Tool Purpose
Python 3.x Core programming language
OpenCV HSV masking, contour detection, real-time video

📦 Installation

# Clone the repository
git clone https://github.com/arunkumararavindhakshan05-sudo/Moving_object_detection_using_colour.git
cd Moving_object_detection_using_colour

# Install dependencies
pip install opencv-python numpy

▶️ Usage

python colour_tracker.py

💡 To track a different colour, update the HSV range values in the script for your target colour.

Controls:

  • Press Q — Quit the camera feed

📁 Project Structure

Moving_object_detection_using_colour/
│
├── colour_tracker.py   # Main tracking script
└── README.md

🔮 Future Improvements

  • Add UI slider to adjust HSV range dynamically
  • Support multiple colour tracking simultaneously
  • Log object path/trajectory on screen
  • Export tracking coordinates to CSV

👤 Author

Arunkumar Aravindhakshan 🔗 LinkedIn | GitHub

About

track object with colour

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages