GitHunt
DH

DharminJoshi/YellowTrack-By-DevKay

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.

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 ๐ŸŽฏ๐Ÿ“๐Ÿ“ธ


DharminJoshi/YellowTrack-By-DevKay | GitHunt