Color Detection

This module contains function to evaluate the presence of different colors of an image. It uses the 16 basic colors defined in the W3C specifications.

@author: Giulio Gabrieli

colorDetection.getColorsW3C(img, plot=False)

This functions is used to get a simplified color palette (W3C siteens basic colors).

F = 255 C0 = 192 80 = 128

Parameters:
  • img (numpy.ndarray) – image to analyze in RGB
  • plot (boolean) – whether to plot or not the results
Returns:

percentage distribution of colors according to the W3C sixteens basic colors

Return type:

list of shape 16x2, where x[0] is the color name and x[1] the percentage of pixels most similar to that color in the image