This project performs real-time color detection using a webcam. It detects blue, green, and red objects in the frame, removes noise, and draws bounding boxes with labels.

- Real-time webcam capture
- HSV-based color segmentation
- Noise removal using morphological operations
- Contour detection with bounding boxes
- Supports multiple colors simultaneously
- Python
- OpenCV (
cv2) - NumPy
- Capture video from webcam
- Convert frame from BGR to HSV
- Create masks for:
- Blue
- Green
- Red (two ranges for HSV wrap-around)
- Apply noise removal:
- Morphological Opening
- Morphological Closing
- Detect contours
- Draw bounding boxes and labels on detected objects
- Display:
- Original frame
- Mask
- Result (masked output)
- Kernel:
5x5 - Operations:
- Opening (removes small noise)
- Closing (fills gaps)
pip install opencv-python numpy