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
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 (
skey) - ๐งฎ 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-
Clone the repository:
git clone https://github.com/DharminJoshi/YellowTrack-By-DevKay.git
-
Navigate to the project folder:
cd YellowTrack-By-DevKay -
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
- In the final output window, left-click twice to select two points.
- You'll be asked to input the real-world distance (in centimeters) between those points.
- The tool will auto-update the internal pixel-to-cm scale.
- After calibration, all distances will be shown in cm.
๐ Usage Flow
- Run the script.
- Tune the HSV trackbars until only yellow objects are detected.
- Left-click on two known points to calibrate scale.
- Watch labels and distances render dynamically.
- Press
sto 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
- Developer: Dharmin Joshi / DevKay
- Email: info.dharmin@gmail.com
- LinkedIn: linkedin.com/in/dharmin-joshi-3bab42232
- GitHub: github.com/DharminJoshi
Thank you for using YellowTrack-By-DevKay!
Happy yellow-tracking! haha ๐ฏ๐๐ธ