A Python-based application that allows real-time color detection in images using OpenCV and a comprehensive color database. This interactive tool helps users identify precise color names and RGB values by simply double-clicking on any pixel in the image.
- Real-time color detection from images
- Interactive double-click interface
- Displays RGB values and closest matching color name
- Uses a database of 865 color names
- Simple and intuitive user interface
- Python 3.x
- OpenCV (
cv2) - NumPy
- Pandas
-
Clone this repository:
git clone https://github.com/yourusername/Color_Detection_System.git cd Color_Detection_System -
Install the required packages:
pip install opencv-python numpy pandas
-
Run the script using the following command:
python color_detection.py -i <path_to_image>
Example:
python color_detection.py -i colorpic.jpg
-
Once the image opens:
- Double-click anywhere on the image to get the color name and RGB values
- Press 'ESC' to exit the program
The system works by:
- Loading an image specified through command-line arguments
- Reading a color database containing RGB values and color names
- Calculating the minimum distance between the selected pixel's RGB values and the colors in the database
- Displaying the closest matching color name along with its RGB values
color_detection.py: Main Python script containing the color detection logiccolors.csv: Database file containing color names and their RGB valuescolorpic.jpg: Sample image for testing
Double-click anywhere on the image to detect colors
Real-time color detection with RGB values
- This project is licensed under the MIT License
- You are free to use, modify, and distribute this software with proper attribution
