Logarithmic histograms will be used to explain the idea of this
method. In the real implementation a histogram is never used. It just
helps us to understand the method. Let's explain what the logarithmic
histogram is and what its advantages are. As the
(
is used in analogy to photography) is not defined for 0, first all
values that are smaller than a certain minimum value should be set to
this minimum value, and as the size of the histogram array is limited,
the values above the maximum allowed value should be set to this
maximum value. Now, for the
values of each of the r, g, b
components, the appropriate histogram array element is increased. The
total number of histogram entries is three times the number of pixels
as each color component is entered separately in the histogram array.
Using a logarithmic instead of a linear histogram has several
advantages. A wide range of luminance values can be represented with a
relatively small array, and the contrast manipulation (introduced
later) is easier to explain.