You are on page 1of 10

Digital Image Processing, 2nd ed. www.imageprocessingbook.

com

Module 6
Histogram

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Histogram

p(rk) versus rk
© 2002 R. C. Gonzalez & R. E. Woods
Digital Image Processing, 2nd ed. www.imageprocessingbook.com

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Histogram Processing

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Histogram Processing

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

• In the dark image the components of the histogram are


concentrated on the low (dark) side of the gray scale.
• In case of bright image the histogram components are
biased towards the high side of the gray scale.
• The histogram of a low contrast image will be narrow
and will be centered towards the middle of the gray scale.
• The components of the histogram in the high contrast
image cover a broad range of the gray scale.
• The net effect of this will be an image that shows a great
deal of gray levels details and has high dynamic range.

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Histogram Equalization

• Histogram equalization:
• enhancement technique which produces an output (enhanced)
image that has a near uniformly distributed histogram.
– To improve the contrast of an image
– To transform an image in such a way that the transformed image has a
nearly uniform distribution of pixel values

• Suppose we have an image which is predominantly dark. Then its


histogram would be skewed towards the lower end of the grey scale and
all the image detail are compressed into the dark end of the histogram.
• If we could stretch out the grey levels at the dark end to produce a more
uniformly distributed histogram then the image would become much
clearer.

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Histogram Equalization

• In discrete version:
– The probability of occurrence of gray level rk in an image is
n
pr ( r )  k k  0,1,2,..., L  1
MN
MN : the total number of pixels in the image
nk : the number of pixels that have gray level rk
L : the total number of possible gray levels in the image

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Histogram Equalization

The transformation function is


k
( L  1) k
sk  T (rk )  ( L  1) pr (rj )   nj k  0,1,2,..., L  1
j 0 MN j 0

• The right side of this equation is known as the cumulative


histogram for the input image. This transformation is
called histogram equalization or histogram linearization.

• Thus, an output image is obtained by mapping each pixel


with level rk in the input image into a corresponding pixel
with level sk .

© 2002 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 2nd ed. www.imageprocessingbook.com

Histogram Equalization

© 2002 R. C. Gonzalez & R. E. Woods

You might also like