Brightness analysis¶
This module contains function to evaluate the brightness of an image. It includes a converter for sRGB to RGB, evaluation of relative luminance according to BT.709 and BT.601
@author: Giulio Gabrieli
-
brightness.
relativeLuminance_BT601
(img)¶ This function evaluates the brightness of an image by mean of Y, where Y is evaluated as:
Y = 0.587G + 0.114B + 0.299R B = mean(Y)
Parameters: img (numpy.ndarray) – image to analyze, in RGB Returns: mean brightness Return type: float
-
brightness.
relativeLuminance_BT709
(img)¶ This function evaluates the brightness of an image by mean of Y, where Y is evaluated as:
Y = 0.7152G + 0.0722B + 0.2126R B = mean(Y)
Parameters: img (numpy.ndarray) – image to analyze, in RGB Returns: mean brightness Return type: float
-
brightness.
sRGB2RGB
(img)¶ this function converts a sRGB img to linear RGB values.
It loops through each pixel, and apply a conversion to pass from sRGB to linear RGB value.
Parameters: img (numpy.ndarray) – image to analyze, in sRGB Returns: image to analyze, in RGB Rtyipe: numpy.ndarray