Humans are able to identify basic colors easily, we can easily differentiate between red and blue, or green and yellow. But, how would a computer be able to do so?
The codes in this repository helps users to measure the distance (or identify colors) based on a sample color-image. In order to simplify the process, the source code used will loop through 960 different sample color-image, and measure the distance between the "ground truth" value and the sample color-image.
-
Install OpenCV on your machine (Windows) Kindly refer to the following documentation provided for the installation process here
-
Launch IDE of choice and run code
- The program will generate a file "colorIndexes.txt" and a folder called "960HSVimages"
- If you would like to view the color-measure distance in the browser, rename the
colorIndexes.txt
tocolorIndexes.html
- The
colorindexes_withmacro.xlsm
file is used to generate thecolorIndexes_wTable.pdf
file. This excel sheet highlights all the highest value for each row to indicate the closest resemblence of colors
You may also opt to use the values/mathematical operations from the repository for your work, in my case, i used the values for my research work to identify the colors of a vehicle.
I took the dominant color, and compared it with the list of values to determine the dominant color of this vehicle.
- https://www.compuphase.com/cmetric.htm for their low-cost estimation of LUV color distance from RGB values.