Table of Contents
In this project I built an application through which we can automatically get the name of the color by double clicking on it. For this, I used a dataset that contains the color name and its RGB values. The method used to find the color name was to calculate the distance from each color and find the shortest one.
Procedure:
- I used a dataset of colors with their name and RGB values.
- Used Argument Parser from argparse to take image from the user in the command line
- Read the image using cv2.imread()
- Read the dataset and indexed it
- Set a mouse callback event on the image window
- Define the draw function to calculate the RGB values of the pixel that was clicked on
- Define the getColorName function to calculate the distance and return the color name
- Display the image on the window and surround the clicked pixel with a rectangle and use text to display the color name and its RGB values
This project was built entirely on Python.
LinkedIn - Puneet Arora
Twitter - @puneet_arora_14
Project Link: https://github.com/apuneet839/Color-Detector