Colorfulness analysis

Created on Mon Apr 16 11:49:45 2018

@author: giulio

colorfulness.colorfulnessHSV(img)

This function evaluates the colorfulness of a picture using the formula described in Yendrikhovskij et al., 1998. Input image is first converted to the HSV color space, then the S values are selected. Ci is evaluated with a sum of the mean S and its std, as in:

Ci = mean(Si)+ std(Si)

Parameters:img (numpy.ndarray) – image to analyze, in RGB
Returns:colorfulness index
Return type:float
colorfulness.colorfulnessRGB(img)

This function evaluates the colorfulness of a picture using Metric 3 described in Hasler & Suesstrunk, 2003. Ci is evaluated with as:

Ci =std(rgyb) + 0.3 mean(rgyb) [Equation Y] std(rgyb) = sqrt(std(rg)^2+std(yb)^2) mean(rgyb) = sqrt(mean(rg)^2+mean(yb)^2) rg = R - G yb = 0.5(R+G) - B

Parameters:img (numpy.ndarray) – image to analyze, in RGB
Returns:colorfulness index
Return type:float
colorfulness.sRGB2RGB(img)

this function converts a sRGB img to linear RGB values.

Parameters:img (numpy.ndarray) – image to analyze, in sRGB
Returns:image to analyze, in RGB
Rtyipe:numpy.ndarray