0% found this document useful (0 votes)
28 views38 pages

Lecture 3S

This document discusses image enhancement techniques through histogram processing. It begins with an introduction to image enhancement and its goals of highlighting details, removing noise, and improving visual appeal. Next, it covers histograms and how they show the distribution of grey levels in an image. Histogram equalization is introduced as a method to improve contrast by spreading out this distribution. Examples are provided to demonstrate histograms and the effects of equalization. The document concludes by summarizing what has been covered and outlining what will be discussed in the next lecture.

Uploaded by

afshi002
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)
28 views38 pages

Lecture 3S

This document discusses image enhancement techniques through histogram processing. It begins with an introduction to image enhancement and its goals of highlighting details, removing noise, and improving visual appeal. Next, it covers histograms and how they show the distribution of grey levels in an image. Histogram equalization is introduced as a method to improve contrast by spreading out this distribution. Examples are provided to demonstrate histograms and the effects of equalization. The document concludes by summarizing what has been covered and outlining what will be discussed in the next lecture.

Uploaded by

afshi002
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/ 38

Digital Image

Processing
Image Enhancement
Histogram Processing
Instructor Name
Dr. Abida Sharif
Material Reference

Images and Material


From
Rafael C. Gonzalez and Richard E. Wood,
Digital Image Processing, 2nd Edition.& Internet Resources
2
Contents
Over the next few lectures we will look at image
enhancement techniques working in the spatial
domain:
 Recap
 Different kinds of image enhancement
 Histograms
 Histogram equalisation

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

 There is no reason why we have to use this range


- The range [0,255] stems from display technologies
 For many of the image processing operations in
this lecture grey levels are assumed to be given
in the range [0.0, 1.0]

4
What Is Image Enhancement?

Image enhancement is the process of making


images more useful
The reasons for doing this include:
 Highlighting interesting detail in images
 Removing noise from images
 Making images more visually appealing

5
Image Enhancement Examples

6
Image Enhancement Examples (cont.…)

7
Image Enhancement Examples (cont.…)

8
Spatial & Frequency Domains

There are two broad categories of image


enhancement techniques
 Spatial domain techniques
 Direct manipulation of image pixels
 Frequency domain techniques
 Manipulation of Fourier transform or
wavelet transform of an image
For the moment we will concentrate on techniques
that operate in the spatial domain

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

 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?

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

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

32
Histogram Equalization

Normalised Intensity transformation


histogram function function

p (r1 )  0.32 T (r1 )  0.32


p (r2 )  0.16 T (r2 )  0.32  0.16  0.48
p (r3 )  0.12 T (r3 )  0.32  0.16  0.12  0.60
p (r4 )  0.08 T (r4 )  0.32  0.16  0.12  0.08  0.68
p (r5 )  0.08 T (r5 ) 
p (r6 )  0.00 T (r6 ) 
p (r7 )  0.04 T (r7 ) 
p (r8 )  0.20 T (r8 ) 
33
Histogram Equalization

The 32% of the pixels have


p (r1 )  0.32 T (r1 )  0.32 intensity r1. We expect
them to cover 32% of the
p (r2 )  0.16 T (r2 )  0.48 possible intensities.
p (r3 )  0.12 T (r3 )  0.60
The 48% of the pixels have
p (r4 )  0.08 T (r4 )  0.68 intensity r2 or less. We
p (r5 )  0.08 T (r5 )  0.76 expect them to cover 48%
of the possible intensities.
p (r6 )  0.00 T (r6 )  0.76
p (r7 )  0.04 T (r7 )  0.80 The 60% of the pixels have
p (r8 )  0.20 T (r8 )  1.00 intensity r3 or less. We
expect them to cover 60%
of the possible intensities.

……………………………
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

You might also like