A Color Detection Python is necessary to recognize objects, it is also used as a tool in various image editing and drawing apps.Also, this Python Color Detection Using OpenCV is the process of detecting the name of any color.
It's a system where you can automatically find the color name by clicking on them. So for this, we will have a data file containing the color name and its values. Then we calculate the distance from each color and get the shortest.
The project folder contains 3 files:
- main.py : main source code of our project
- color.csv : a file that contains our dataset.
- sample_image.jpg : ample image for experimenting
step 1: Download and extract the file
step 2: create new project and move the files in to it
step 3: install opencv and pandas using pip command in your pycharm terminal
step 4: run the project by writing : python main.py -i //add the complete image path Eg. python main.py -i sample_image.jpg
Finally comes the picture you want to see. Then you can double-tap anywhere on the image to find out the color type.
Screenshot of the result