0% found this document useful (0 votes)
9 views21 pages

Week 3 Part1

Histogram equalization is a technique for adjusting image intensities to enhance contrast by transforming the image's histogram. It determines a mapping that redistributes the brightness values of image pixels uniformly. The mapping is calculated from the image's histogram to produce an output image with a histogram as close to uniform as possible. Histogram matching is a similar technique that transforms an image's histogram to match a specified target histogram distribution.

Uploaded by

20161241
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views21 pages

Week 3 Part1

Histogram equalization is a technique for adjusting image intensities to enhance contrast by transforming the image's histogram. It determines a mapping that redistributes the brightness values of image pixels uniformly. The mapping is calculated from the image's histogram to produce an output image with a histogram as close to uniform as possible. Histogram matching is a similar technique that transforms an image's histogram to match a specified target histogram distribution.

Uploaded by

20161241
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 21

Histogram Equalization

– Probability density functions (PDF)


dr
p s ( s )  pr ( r )
ds
r
s  T (r )  ( L  1)  pr ( w)dw
0

ds dT (r ) d  r   ( L  1) p (r )
dr  0
  ( L  1) p ( w) dw
dr dr
r  r

1
ps ( s ) 
L 1
k k nj
sk  T (rk )  ( L  1) pr (rj ) ( L  1) , k  0,1,2,..., L  1
j 0 j 0 n
Example: histogram equalization
· Consider an 8-level 64 x 64 image with gray values (0, 1, …,
7). The normalized gray values are (0, 1/7, 2/7, …, 1). The
normalized histogram is given below:

NB: The gray values in output are also (0, 1/7, 2/7, …, 1).
# pixels Fraction of
# pixels

Gray value Normalized gray value


k
· Applying the transformation, s k  T (rk )   pin (r j ) we have
j 0
· Notice that there are only five distinct gray levels --- (1/7, 3/7,
5/7, 6/7, 1) in the output image. We will relabel them as (s0,
s1, …, s4 ).

· With this transformation, the output image will have


histogram
Histogram of output image

# pixels

Gray values

· Note that the histogram of output image is only approximately, and not exactly, uniform.
This should not be surprising, since there is no result that claims uniformity in the discrete
case.
Example Original image and its histogram
Histogram equalized image and its histogram
Histogram matching
(specification)
• Histogram matching (specification)
r
s  T (r )  ( L  1)  pr ( w)dw
0
z
G ( z )  ( L  1)  p z (t )dt  s
0

z  G 1 ( s )  G 1[T (r )]

p z (z ) is the desired PDF


Example:

· Consider an 8-level 64 x 64 previous image.

# pixels

Gray value
· It is desired to transform this image into a new image, using a transformation
Z=H(r)= G-1[T(r)], with histogram as specified below:

# pixels

Gray values
· The transformation T(r) was obtained earlier (reproduced
below):

· Now we compute the transformation G as before.


· Computer z=G-1 (s), Notice that G is not invertible.

G-1(0) = ?

G-1(1/7) = 3/7

G-1(2/7) = 4/7

G-1(3/7) = ?

G-1(4/7) = ?
G-1(5/7) = 5/7

G-1(6/7) = 6/7

G-1(1) = 1
· Combining the two transformation T and G-1 , compute z=H(r)= G-1[v=s=T(r)]
· Applying the transformation H to the original image yields an image with histogram
as below:

· Again, the actual histogram of the output image does not exactly but only
approximately matches with the specified histogram. This is because we are dealing
with discrete histograms.
Original image and its histogram

Histogram specified image and its histogram

You might also like