In this project, we are going to build an application through which you can automatically get the name of the color by clicking on them. Colour detection is necessary to recognize objects, it is also used as a tool in various image editing and drawing apps.
- Pandas – We used this library to read the ‘colors.csv’ data file.
- Opencv – We used this library to analyze the image and return the appropriate color.
Note: Run this code in VS code or any other IDE. The program won't run if you use an online compiler. If you are unable to run the code on your personal laptop, I have attached a video at the bottom for your reference.
- Download the project folder 'DS _assignment-colordetection' which contains the following files.
- For this program to run, python must be installed on your computer along with the Pandas and Opencv libraries. You can download python from their original website. For downloading the libraries simply type the following commands in the command prompt to install each one of them.
python -m pip install pandas
python -m pip install opencv-python
- Then you can run the code. The program will open a window with a picture. Now all you have to do is click anywhere on the picture and the color of the clicked area will be displayed.
- To exit press ‘esc’ key on your laptop.
dsassignment.mp4
Dr. Siddhaling Urolagin,
PhD, Post-Doc, (Machine Learning),
dr.siddhaling@gmail.com,
www.github.com/siddhaling
www.researchreader.com