You are on page 1of 9

Histogram Specification

Dr S.Natarajan
Professor and Key Resource Person
Department of Computer Science and Engineering
PES University
natarajan@pes.edu
9945280225
Histogram Specification

desired
-1
equaliz G equalize G
e
Original Image Desired Image

Gray Level Number of Gray Level Number of


pixels pixels
0 8 0 0
1 10 1 0
2 10 2 0
3 2 3 0
4 12 4 20
5 16 5 20
6 4 6 16
7 2 7 8
Gray Level(rk) Number of PDF (ni/n) CDF (L-1)*CDF H
pixels(ni)

0 8 0.13 0.13 7*0.13= 0.91 1


1 10 0.16 0.29 7*0.29=2.03 2
2 10 0.16 0.45 7*0.45= 3.05 3
3 2 0.03 0.48 7*0.48= 3.36 3
4 12 0.18 0.66 7*0.66=4.62 5
5 16 0.25 0.91 7*0.91=6.37 6
6 4 0.06 0.97 7*0.97=6.79 7
7 2 0.03 1.00 7*1=7 7
Gray Level H( output obtained) s(Desired Output) Map

0 1 0 4
1 2 0 4
2 3 0 5
3 3 0 5
4 5 2 (20/64*7) 6
5 6 4 (40/64*7) 6
6 7 6(56/64*7) 7
7 7 7 (64/64*7) 7
Modified Image

Gray Level Number of pixels


0 0
1 0
2 0
3 0
4 18 (Map 4 4 as 0+1)
5 12 ( Map 5 5 as 2+3)
6 28 ( Map 6 6 as 4+5)
7 6 ( Map 7 7 as 6+7)
• Assume the images have N=64 X 64=4096 pixels in L=8 gray levels. The following table shows the
equalization process corresponding to the two conversion methods above:
• In the following example, the histogram of a given image is equalized. Although
the resulting histogram may not look constant, but the cumulative histogram is a
exact linear ramp indicating that the density histogram is indeed equalized. The
density histogram is not guaranteed to be a constant because the pixels of the
same gray level cannot be separated to satisfy a constant distribution.

You might also like