This project enables real-time detection of user-defined color objects using a webcam. Users input a color name, and the program identifies objects of that color by converting it to its HSV range, applying a mask, and detecting contours.
- Numpy: For numerical operations and array handling.
- OpenCV: For image processing and real-time object detection.
- Webcolors: For converting color names to RGB values.
- Pillow: For image manipulation and additional utilities.
- Detects objects of a user-defined color in real time.
- Highlights detected objects using contours.
- Allows customization of colors through simple name input.
- Users input the name of a color (e.g., "red", "blue").
- The program retrieves the RGB value of the color using
webcolors
. - RGB values are converted to HSV for accurate color detection.
- A mask is applied to filter the specified color range.
- Detected objects are outlined using contours.
- Python 3.6 or higher
- Libraries:
numpy
,opencv-python
,webcolors
,Pillow
Install the dependencies using:
pip install numpy opencv-python webcolors Pillow
- Clone this project
- Run the script using:
main.py
- Enter a color name when prompted.
- The program will display a video feed highlighting objects matching the specified color.