In this Color Detection Python Project, we can automatically get the name of the color by clicking on them.
- Firstly we have dataset that contains the color name and its values
- After selecting a perticular segment we calculate the distance from each color and find the shortest one.
Colors are made up of 3 primary colors red , green , and blue .
In computers, we define each color value within a range of 0 to 255. therefore we can define a colour in 256256256 = 16,581,375 ways !
There are approximately 16.5 million different ways to represent a color. Our task is to map each color’s values with their corresponding names in the dataset . But we don’t need to map all the values. We will be using a dataset that contains RGB values with their corresponding names.
The colors.csv file includes 865 color names along with their RGB and hex values.
OpenCV, Pandas, and numpy are the Python packages that are necessary for this project in Python. To install them, simply run this pip command in your terminal:
pip install opencv-python
pip install numpy
pip install pandas
- Color_detection.py – main source code of our project.
- Colors.csv – a file that contains our dataset.
python code.py -i 'add your image path here'
- make an API
- Embede in a big project !