Professional Documents
Culture Documents
2008/2009
Lecture 5
Histograms
Histograms
Histogram equalisation
Histogram specification
Histograms
In the previous lectures we introduced intensity transformation
functions and linear filters as basic tools for image processing.
For each intensity level, its value is equal to the number of the pixels
with that intensity.
Example
Consider a 5x5 image with integer intensities in the range between one
and eight:
1 8 4 3 4
1 1 1 7 8
8 8 3 3 1
2 2 1 5 2
1 1 8 5 2
Example
1 8 4 3 4
1 1 1 7 8
8 8 3 3 1
2 2 1 5 2
1 1 8 5 2
1 2 3 4 5 6 7 8
Histogram function
n1 n2 n3 n4 n5 n6 n7 n8
h(rk ) nk
1 2 3 4 5 6 7 8
Histogram function
h(r1 ) 8
n1 n2 n3 n4 n5 n6 n7 n8
h(r2 ) 4
h(r3 ) 3
h(r4 ) 3
h(r5 ) 2
h(r6 ) 0
h(r7 ) 1
1 2 3 4 5 6 7 8
h(r8 ) 5
Example
Graph of the
histogram function
Original image
Example
Graph of the
histogram function
Original image
Example
Graph of the
histogram function
Original image
Example
Graph of the
histogram function
Original image
Normalised histogram function
The normalised histogram function is the histogram function divided by
the total number of the pixels of the image:
h(rk ) nk
p (rk )
n n
The sum of the normalised histogram function over the range of all
intensities is 1.
Normalised histogram function
h( r1 ) 8 p (r1 ) 8 / 25 0.32
h( r2 ) 4 p (r2 ) 4 / 25 0.16
h( r3 ) 3 p (r3 ) 3 / 25 0.12
h( r4 ) 2 p (r4 ) 3 / 25 0.08
h( r5 ) 2 p (r5 ) 2 / 25 0.08
h( r6 ) 0 p (r6 ) 0 / 25 0.00
h( r7 ) 1 p (r7 ) 1 / 25 0.04
h( r8 ) 5 p (r8 ) 5 / 25 0.20
Overview
Histograms
Histogram equalisation
Histogram specification
Histogram Equalization
That is, we add the values of the normalised histogram function from 1
to k to find where the intensity rk will be mapped.
Notice that the range of the equalised image is the interval [0,1].
Example
1 8 4 3 4
1 1 1 7 8
8 8 3 3 1
2 2 1 5 2
1 1 8 5 2
Example
Normalised Intensity transformation
histogram function function
……………………………
Example
Example
Overview
Histograms
Histogram equalisation
Histogram specification
Notation
Slides marked with this sign are particularly challenging.
0 Intensities 1
Histogram specification
The number of occurrences in a certain region corresponds to the area
below the graph of the function and inside that region.
In the normalized histogram function p, the area below the whole curve
is equal to 1.
Frequency of
occurrence
0 Intensities 1
Histogram specification
In the discrete case we used the sum of the values of the normalized
histogram function between 1 and k.
In the continuous case we use the area below the function between 0
and r r
T (r ) p( w)dw
0
Frequency of
occurrence
T (r )
0 r 1 Intensities
Histogram specification
Histogram equalization tries to make the intensity distribution uniform.
Ideal equalized
occurrence
histogram function
0 Intensities 1
Histogram specification
Instead, we can specify the function we want for the histogram.
s: specified histogram
Frequency of
occurrence
p: initial histogram
0 1 Intensities
Histogram specification
The intensity transformation function is now given by
g (r ) r
T (r )
0
p ( w)dw, g(r) s(w)dw
0
s: specified histogram
Frequency of
occurrence
p: initial histogram
g(r)
0 r 1
Intensities