Lecture 3S
Lecture 3S
Processing
Image Enhancement
Histogram Processing
Instructor Name
Dr. Abida Sharif
Material Reference
3
A Note About Grey Levels
So far when we have spoken about image grey
level values, we have said they are in the range
[0, 255]
- Where 0 is black and 255 is white
4
What Is Image Enhancement?
5
Image Enhancement Examples
6
Image Enhancement Examples (cont.…)
7
Image Enhancement Examples (cont.…)
8
Spatial & Frequency Domains
9
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 10
Histogram Examples
11
Histogram Examples (cont.…)
12
Histogram Examples (cont.…)
Histogram Examples (cont.…)
14
Histogram Examples (cont.…)
15
Histogram Examples (cont.…)
16
Histogram Examples (cont.…)
17
Histogram Examples (cont…)
18
Histogram Examples (cont.…)
19
Histogram Examples (cont.…)
20
Histogram Examples (cont.…)
A selection of images and
their histograms
Notice the relationships
between the images and
their histograms
Note that the high contrast
image has the most
evenly spaced histogram
21
Contrast Stretching
22
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 sk T (rk )
rk: input intensity k
sk: processed intensity pr ( r j )
k: the intensity range j 1
(e.g 0.0 – 1.0)
k nj
nj: the frequency of intensity j
n: the sum of all frequencies
j 1 n
23
Equalisation Transformation Function
24
Equalisation Examples
25
Equalisation Examples
26
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
27
Example
n1 n2 n3 n4 n5 n6 n7 n8
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
28
Histogram Function
n1 n2 n3 n4 n5 n6 n7 n8
h(rk ) nk
1 2 3 4 5 6 7 8
29
Histogram Function
h ( 𝑟 1) =8
n1 n2 n3 n4 n5 n6 n7 n8
1 2 3 4 5 6 7 8
30
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
It gives a measure of how likely is for a pixel to
have a certain intensity. That is, it gives the
probability of occurrence the intensity.
The sum of the normalised histogram function
over the range of all intensities is 1.
31
Normalised Histogram Function
32
Histogram Equalization
……………………………
34
Histogram Equalization
35
Summary
We have looked at:
Different kinds of image enhancement
Histograms
Histogram equalisation
Next time we will start to look at point processing
and some neighbourhood operations
36
Next Lecture
What is point processing?
Negative images
Thresholding
Logarithmic transformation
Power law transforms
Grey level slicing
Bit plane slicing
37
THANK YOU
38