In trichromatic images the image
is processed for each color independently. In the process, we first count
the number of pixels corresponding to each
of the 256 intensity levels for each color, R, G and B. Then, for each
color, we calculated the transform function values,, for each intensity
level, where the
transformation function is:
n: number of total pixels
Afterwards, we mapped
values
from [0,1] range to the range of [0,255] using the formula :
As a final step, we replaced each
value in the image with its corresponding value.
Histograms of the original and equalized
images are in this page.
If we were to process graylevel images,
we needn't to repeat the procedure three times; we would apply the algorithm
just once.