image = | lightnessImg (inColorImg) |
image = | lightnessImg (inColorImg,lightnessType) |
lightness computation for an input color image
The algorithm converts a color image to a grey level one according to one of the three possible types: Average, Lightness or Luminance. The default value is Average.
Assuming that is the
pixel in the channel
, we can define the three different ways to calculate the lightness.
For the Average type, the output image values are given by:
For the Lightness type, the output image values are given by:
The Luminance type can only be calculated for images with three channels and is assumed to be RGB. The output image values are given by:
Input and output images must have same size (but color size).
Here is an example of an average ligthness operation applied to a 8-bits RGB color image: