Skip to content

YellowTrack-By-DevKay: Real-time yellow object detection and distance measurement using webcam input with HSV color filtering, dynamic calibration, auto-labeling, and snapshot saving. Ideal for tracking and measuring yellow objects in various applications.

License

Notifications You must be signed in to change notification settings

DharminJoshi/YellowTrack-By-DevKay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

YellowTrack-By-DevKay

Python OpenCV Numpy

A real-time computer vision tool that detects yellow objects from a webcam feed, calculates the distances between them using pixel-to-centimeter calibration, and visualizes everything dynamically on screen.


🎯 Features

  • 🟡 Yellow Object Detection using HSV color filtering
  • 🧠 Dynamic Calibration using two mouse clicks + real-world input
  • 📏 Distance Calculation in centimeters
  • 🔤 Auto-labeling of objects (A, B, C...)
  • 🎯 Trackbars for HSV tuning to refine detection
  • 📸 Snapshot saving (s key)
  • 🧮 Real-time FPS and Object Count overlay
  • 🖱️ Interactive mouse-based calibration
  • ♻️ Trackbar Reset & Calibration Clear via keyboard

🧰 Tech Stack

  • Language: Python 3.8+
  • Libraries: OpenCV (cv2), NumPy, Math, Time

📁 Installation

🔧 Prerequisites

Make sure you have Python 3.8+ installed. Then install the required libraries:

pip install -r requirements.txt
  1. Clone the repository:

    git clone https://github.com/DharminJoshi/YellowTrack-By-DevKay.git
  2. Navigate to the project folder:

    cd YellowTrack-By-DevKay
  3. Run the script:

    python main.py

🎮 Controls

Key Action
q / ESC Quit the program
s Save a snapshot (snapshot.png)
c Clear calibration points
r Reset HSV trackbars

🧪 Calibration Instructions

  1. In the final output window, left-click twice to select two points.
  2. You'll be asked to input the real-world distance (in centimeters) between those points.
  3. The tool will auto-update the internal pixel-to-cm scale.
  4. After calibration, all distances will be shown in cm.

🔄 Usage Flow

  1. Run the script.
  2. Tune the HSV trackbars until only yellow objects are detected.
  3. Left-click on two known points to calibrate scale.
  4. Watch labels and distances render dynamically.
  5. Press s to save the current frame.

🗂️ Folder Structure

yellowtrack-by-devkay/
├── main.py                 # Main Python script
├── requirements.txt        # Python dependencies
├── README.md               # Project documentation
├── LICENSE                 # LICENSE File
└── snapshot.png            # Saved snapshots (generated)

🔮 Future Improvements

  • Multi-color detection (red, blue, green, etc.)
  • Export data to CSV (object positions, distances)
  • Data-Logging
  • Object tracking using object IDs across frames
  • Auto-calibration via reference object
  • Web-App Integration

⚖️ License

This project is licensed under the CC BY-NC 4.0 License.
See the LICENSE file for full details.


⚠️ Disclaimer

This tool is intended for educational and personal use only.
Accuracy of distance measurement depends on proper calibration and camera positioning.

Provided "as is" — the developer assumes no liability for any misuse or consequences.


📬 Contact


Thank you for using YellowTrack-By-DevKay!

Happy yellow-tracking! haha 🎯📐📸


About

YellowTrack-By-DevKay: Real-time yellow object detection and distance measurement using webcam input with HSV color filtering, dynamic calibration, auto-labeling, and snapshot saving. Ideal for tracking and measuring yellow objects in various applications.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages