Professional Documents
Culture Documents
UPDATED ImageProcessing3-ImageEnhancement(HistogramProcessing) (2)
UPDATED ImageProcessing3-ImageEnhancement(HistogramProcessing) (2)
UPDATED ImageProcessing3-ImageEnhancement(HistogramProcessing) (2)
Image Enhancement
(Histogram Processing)
Image Histograms
The histogram of an image shows us the distribution of grey
levels in the image
Massively useful in image processing, especially in
segmentation
Frequencies
Grey Levels
Theory of Histogram
Theory of Histogram
Theory of Histogram
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
Histogram Examples
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
their histograms
Notice the relationships
between the images and
their histograms
Note that the high contrast
image has the most
evenly spaced histogram
Contrast Stretching
We can fix images that have poor contrast by applying a
pretty simple contrast specification
The interesting part is how do we decide on this
transformation function?
Histogram Equalisation
Spreading out the frequencies in an image (or equalising the
image) is a simple way to improve dark or washed out
images
The formula for histogram
equalisation is given where
r :
k input intensity sk T (rk )
s : processed intensity k
pr ( r j )
k
k: the intensity range
(e.g 0.0 – 1.0) j 1
n : the frequency of intensity j
j
k nj
n: the sum of all frequencies
j 1 n
Example
19
No. of pixels
6
2 3 3 2
5
4 2 4 3 4
3 2 3 5 3
2
2 4 2 4
1
Gray level
4x4 image
0 1 2 3 4 5 6 7 8 9
Gray scale = [0,9]
histogram
Example
Gray
0 1 2 3 4 5 6 7 8 9
Level(j)
No. of
0 0 6 5 4 1 0 0 0 0
pixels
k
n
j 0
j 0 0 6 11 15 16 16 16 16 16
k nj 6 11 15 16 16 16 16 16
s 0 0 / / / / / / / /
j 0 n 16 16 16 16 16 16 16 16
No. of pixels 4 2 4 3
6
3 2 3 5
3 6 6 3 5
2 4 2 4
8 3 8 6 4
6 3 6 9 3
2
3 8 3 8
1
Output image
0 1 2 3 4 5 6 7 8 9
Gray scale = [0,9] Gray level
Histogram equalization
Image Enhancement by Point Processing
Histogram Equalization Example
Intensity 0 1 2 3 4 5 6 7
Number of pixels 10 20 12 8 0 0 0 0
p (0) 10 / 50 0.2
p (1) 20 / 50 0.4
p (2) 12 / 50 0.24
p (3) 8 / 50 0.16
p (r ) 0 / 50 0, r 4,5, 6, 7
r
T (r ) round 7 p (i )
i 0
T (0) round 7 * p(0) round 7 *0.2 1
T (1) round 7 * p(0) p(1) round 7 *0.6 4
T (2) round 7 * p(0) p(1) p(2) round 7 *0.84 6
T (3) round 7 * p(0) p(1) p(2) p(3) 7
T (r ) 7, r 4,5, 6, 7
Intensity 0 1 2 3 4 5 6 7
Number of pixels 0 10 0 0 20 0 12 8
22
Book example
Note
24
Equalisation Examples
1
Equalisation Transformation Functions
The functions used to equalise the images in the previous
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
example
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
Equalisation Examples
2
Equalisation Transformation Functions
The functions used to equalise the images in the previous
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
example
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
4
3
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
4
3
Equalisation Transformation Functions
The functions used to equalise the images in the previous
Images taken from Gonzalez & Woods, Digital Image Processing (2002)
examples
Summary
We have looked at:
Different kinds of image enhancement
Histograms
Histogram equalisation