0% found this document useful (0 votes)
18 views123 pages

IPPR Lecture6-1

This lecture covers image enhancement in the frequency domain, focusing on the Fourier transform and its applications in image processing such as smoothing and sharpening. It explains the concepts of the discrete Fourier transform, lowpass filters, and various filtering techniques including ideal, Butterworth, and Gaussian filters. The lecture also highlights the importance of Fourier's work in modern engineering and provides examples of frequency domain filtering in image processing.

Uploaded by

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

IPPR Lecture6-1

This lecture covers image enhancement in the frequency domain, focusing on the Fourier transform and its applications in image processing such as smoothing and sharpening. It explains the concepts of the discrete Fourier transform, lowpass filters, and various filtering techniques including ideal, Butterworth, and Gaussian filters. The lecture also highlights the importance of Fourier's work in modern engineering and provides examples of frequency domain filtering in image processing.

Uploaded by

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

Image Processing and Pattern

Recognition (IPPR):
(Lecture 6)

Sanjeeb Prasad Panday


[email protected]
2
of
123
Contents
In this lecture we will look at image
enhancement in the frequency domain
– Jean Baptiste Joseph Fourier
– The Fourier series & the Fourier transform
– Image Processing in the frequency domain
• Image smoothing
• Image sharpening
– Fast Fourier Transform
3
of
123
Jean Baptiste Joseph Fourier
Fourier was born in Auxerre,
France in 1768
– Most famous for his work “La Théorie
Analitique de la Chaleur” published in
1822
– Translated into English in 1878: “The
Analytic Theory of Heat”
Nobody paid much attention when the work was
first published
One of the most important mathematical theories in
modern engineering
4
of
123
The Big Idea
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Any function that periodically repeats itself can be


expressed as a sum of sines and cosines of
different frequencies each multiplied by a different
coefficient – a Fourier series
5
of
123
The Big Idea (cont…)
Taken from www.tfh-berlin.de/~schwenk/hobby/fourier/Welcome.html

Notice how we get closer and closer to the


original function as we add more and more
frequencies
6
of
123
The Big Idea (cont…)
Frequency
domain signal
processing
example in Excel
7
of
123
Introduction to the Fourier Transform
8
of
123
The Fourier Transform (continued)
9
of
123
The Fourier Transform (continued)
10
of
123
The Fourier Transform (continued)
11
of
123
The Fourier Transform (continued)
12
of
123
The Fourier Transform (Example)
13
of
123
The Fourier Transform (Example)
14
of
123
The 2-D Fourier Transform
15
of
123
The 2-D Fourier Transform (Continued)
16
of
Sample 2-D function and its
123
Fourier spectrum
17
of
123
Example 2-D Fourier transform
18
of
Example 2-D functions and
123
their spectra
19
of
123
The discrete Fourier transform
20
of
Sampling a continuous
123
function
21
of
The discrete Fourier transform
123
pair
22
of
The 2-D discrete Fourier
123
transform
23
of
The 2-D discrete Fourier
123
transform (continued)
24
of
Discrete Fourier transform
123
example
25
of
Discrete Fourier transform
123
example (continued)
26
of
Discrete Fourier transform
123
example (continued)
27
of
Properties of the 2-D Fourier
123
transform
28
of
123
Separability
29
of
123
Separability (continued)
30
of
123
Translation
31
of
123
Translation (continued)
32
of
123
Matlab example
33
of
123
Matlab example (continued)
34
of
Example image and complete,
123
scaled Fourier spectrum plot
35
Example image and partial, scaled
of
123
Fourier spectrum plot (with
shifted f(x,y))
36
of
Periodicity of the Fourier
123 transform
37
of
Conjugate symmetry of the
123 Fourier transform
38
of
Implications of periodicity &
123 symmetry
39
of
123
Periodicity properties
40
of
Periodicity properties: 2-D
123 Example
41
of
123
Distributivity & Scaling
42
of
123
Average Value
43
of
123
The Laplacian
44
of
123
The Laplacian: Matlab example
45
of
123
Convolution & Correlation
46
of
123
1-D convolution example
47
of
1-D convolution example
123 (continued)
48
of
1-D convolution example
123 (continued)
49
of
123
Convolution and impulse functions
50
of
Convolution and impulse functions
123 (continued)
51
of
Convolution with an impulse
123 function
52
of
Convolution with an impulse
123 function (continued)
53
of
Convolution and the Fourier
123 transform
54
of
123
Frequency domain filtering
55
of
Lowpass frequency domain
123 filtering
56
of
123
Ideal lowpass filter (ILPF)
57
of
Ideal lowpass filter (ILPF)
123 (continued)
58
of
123
The Discrete Fourier Transform (DFT)

The Discrete Fourier Transform of f(x, y), for x =


0, 1, 2…M-1 and y = 0,1,2…N-1, denoted by
F(u, v), is given by the equation:
M 1N1
F (u , v)    f ( x, y )e  j 2 ( ux / M vy / N )

x 0 y 0

for u = 0, 1, 2…M-1 and v = 0, 1, 2…N-1.


59
of
123
DFT & Images
The DFT of a two dimensional image can be
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

visualised by showing the spectrum of the


images component frequencies

DFT
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

of
60

123
DFT & Images
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

of
61

123
DFT & Images
62
of
123
DFT & Images (cont…)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

DFT

Scanning electron microscope Fourier spectrum of the image


image of an integrated circuit
magnified ~2500 times
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

of
63

123
DFT & Images (cont…)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

of
64

123
DFT & Images (cont…)
65
of
123
The Inverse DFT
It is really important to note that the Fourier
transform is completely reversible
The inverse DFT is given by:
M 1N1
1
f ( x, y ) 
MN
  F (u, v)e
u 0 v 0
j 2 ( ux / M vy / N )

for x = 0, 1, 2…M-1 and y = 0, 1, 2…N-1


66
of
123
The DFT and Image Processing

To filter an image in the frequency domain:


Images taken from Gonzalez & Woods, Digital Image Processing (2002)

1. Multiply the input image by (-1)x+y to center the


transform.
2. Compute F(u,v) the DFT of the image
3. Multiply F(u,v) by a filter function H(u,v)
4. Compute the inverse DFT of the result in (3)
5. Obtain the real part of the result in (4)
6. Multiply the result in (5) by (-1) x+y
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

of
67

123
The DFT and Image Processing
68
of
123
Some Basic Frequency Domain Filters

Low Pass Filter


Images taken from Gonzalez & Woods, Digital Image Processing (2002)

High Pass Filter


Images taken from Gonzalez & Woods, Digital Image Processing (2002)

of
69

123
Some Basic Frequency Domain Filters
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

of
70

123
Some Basic Frequency Domain Filters
71
of
123
Smoothing Frequency Domain Filters

Smoothing is achieved in the frequency domain


by dropping out the high frequency components
The basic model for filtering is:
G(u,v) = H(u,v)F(u,v)
where F(u,v) is the Fourier transform of the
image being filtered and H(u,v) is the filter
transform function
Low pass filters – only pass the low frequencies,
drop the high ones
72
of
123
Ideal Low Pass Filter
Simply cut off all high frequency components that
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

are a specified distance D0 from the origin of the


transform

changing the distance changes the behaviour of


the filter
73
of
123
Ideal Low Pass Filter (cont…)
The transfer function for the ideal low pass filter
can be given as:

1 if D(u , v) D0
H (u , v) 
0 if D(u , v)  D0
where D(u,v) is given as:
D(u , v) [(u  M / 2) 2  (v  N / 2) 2 ]1/ 2
74
of
123
Ideal Low Pass Filter (cont…)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Above we show an image, it’s Fourier spectrum


and a series of ideal low pass filters of radius 5,
15, 30, 80 and 230 superimposed on top of it
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

of
75

123
Ideal Low Pass Filter (cont…)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

of
76

123
Ideal Low Pass Filter (cont…)
77
of
123
Ideal Low Pass Filter (cont…)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Result of filtering
Original with ideal low pass
image filter of radius 5

Result of filtering Result of filtering


with ideal low pass with ideal low pass
filter of radius 15 filter of radius 30

Result of filtering
Result of filtering
with ideal low pass
with ideal low pass
filter of radius 230
filter of radius 80
78
of
123
Ideal Low Pass Filter (cont…)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Result of filtering
with ideal low pass
filter of radius 5
79
of
123
Ideal Low Pass Filter (cont…)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Result of filtering
with ideal low pass
filter of radius 15
80
of Chapter 4
123
Image Enhancement in the
Frequency Domain
81
of
123
Butterworth Lowpass Filters
The transfer function of a Butterworth lowpass
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

filter of order n with cutoff frequency at distance


D0 from the origin is defined as:
1
H (u , v) 
1  [ D(u , v) / D0 ]2 n
82
of
123
Butterworth Lowpass Filter (cont…)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Result of filtering
Original with Butterworth filter
image of order 2 and cutoff
radius 5

Result of filtering with Result of filtering


Butterworth filter of with Butterworth
order 2 and cutoff filter of order 2 and
radius 15 cutoff radius 30

Result of filtering
Result of filtering with
with Butterworth filter
Butterworth filter of
of order 2 and cutoff
order 2 and cutoff
radius 230
radius 80
83
of
123
Butterworth Lowpass Filter (cont…)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Original
image

Result of filtering
with Butterworth filter
of order 2 and cutoff
radius 5
84
of
123
Butterworth Lowpass Filter (cont…)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Result of filtering with


Butterworth filter of
order 2 and cutoff
radius 15
85
of Chapter 4
123
Image Enhancement in the
Frequency Domain
86
of
123
Gaussian Lowpass Filters
The transfer function of a Gaussian lowpass
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

filter is defined as:


2 2
 D ( u ,v ) / 2 D0
H (u , v) e
87
of
123
Gaussian Lowpass Filters (cont…)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Result of filtering
Original with Gaussian filter
image with cutoff radius 5

Result of filtering Result of filtering


with Gaussian with Gaussian filter
filter with cutoff with cutoff radius 30
radius 15

Result of filtering Result of filtering


with Gaussian with Gaussian filter
filter with cutoff with cutoff radius
radius 85 230
88
of
123
Lowpass Filters Compared
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Result of filtering
Result of filtering
with Butterworth
with ideal low pass
filter of order 2
filter of radius 15
and cutoff radius
15

Result of filtering
with Gaussian
filter with cutoff
radius 15
89
of
123
Lowpass Filtering Examples
A low pass Gaussian filter is used to connect
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

broken text
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

of
90

123
Lowpass Filtering Examples
91
of
123
Lowpass Filtering Examples (cont…)
Different lowpass Gaussian filters used to
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

remove blemishes in a photograph


Images taken from Gonzalez & Woods, Digital Image Processing (2002)

of
92

123
Lowpass Filtering Examples (cont…)
93
of
123
Lowpass Filtering Examples (cont…)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Original Gaussian lowpass


image filter

Spectrum of Processed
original image image
94
of
123
Sharpening in the Frequency Domain

Edges and fine detail in images are associated


with high frequency components
High pass filters – only pass the high
frequencies, drop the low ones
High pass frequencies are precisely the reverse
of low pass filters, so:
Hhp(u, v) = 1 – Hlp(u, v)
95
of
123
Ideal High Pass Filters
The ideal high pass filter is given as:
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

0 if D(u , v) D0
H (u , v) 
1 if D(u , v)  D0
where D0 is the cut off distance as before
96
of
123
Ideal High Pass Filters (cont…)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Results of ideal Results of ideal Results of ideal


high pass filtering high pass filtering high pass filtering
with D0 = 15 with D0 = 30 with D0 = 80
97
of
123
Butterworth High Pass Filters
The Butterworth high pass filter is given as:
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

1
H (u , v) 
1  [ D0 / D(u , v)]2 n
where n is the order and D0 is the cut off
distance as before
98
of
123
Butterworth High Pass Filters (cont…)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Results of Results of
Butterworth Butterworth
high pass high pass
filtering of filtering of
order 2 with order 2 with
D0 = 15 D0 = 80

Results of Butterworth high pass


filtering of order 2 with D0 = 30
99
of
123
Gaussian High Pass Filters
The Gaussian high pass filter is given as:
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

 D 2 ( u ,v ) / 2 D0 2
H (u , v) 1  e
where D0 is the cut off distance as before
100
of
123
Gaussian High Pass Filters (cont…)
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Results of Results of
Gaussian Gaussian
high pass high pass
filtering with filtering with
D0 = 15 D0 = 80

Results of Gaussian high pass


filtering with D0 = 30
101
of
123
Highpass Filter Comparison
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Results of ideal
high pass filtering
with D0 = 15
102
of
123
Highpass Filter Comparison
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Results of Butterworth
high pass filtering of order
2 with D0 = 15
103
of
123
Highpass Filter Comparison
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Results of Gaussian
high pass filtering with
D0 = 15
104
of
123
Highpass Filter Comparison
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Results of ideal Results of Butterworth Results of Gaussian


high pass filtering high pass filtering of order high pass filtering with
with D0 = 15 2 with D0 = 15 D0 = 15
105
of
123
Highpass Filter Comparison
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Results of ideal
high pass filtering
with D0 = 15
106
of
123
Highpass Filter Comparison
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Results of Butterworth
high pass filtering of order
2 with D0 = 15
107
of
123
Highpass Filter Comparison
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Results of Gaussian
high pass filtering with
D0 = 15
108
of Chapter 4
123
Image Enhancement in the
Frequency Domain
109
of Chapter 4
123
Image Enhancement in the
Frequency Domain
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

of
123
110
Highpass Filter Comparison
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

of
123
111
Highpass Filter Comparison
112
of
123
Highpass Filter Comparison
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

The process consists of multiplying the composite


filter by the (centered) transform of the input
image and then taking the inverse transform of the
product. Multiplication of the real part of this result
by (-1)x+y gives us the high-boost filtered image
fhb(x,y) in the spatial domain.
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

of
123
High frequency 113
emphasis result Original image

equalisation Highpass filtering result


After histogram
Highpass Filtering Example
114
of
123
Highpass Filtering Example
115
of
123
Highpass Filtering Example
116
of
123
Highpass Filtering Example
117
of
123
Highpass Filtering Example
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

of
123
118
Laplacian In The Frequency Domain
119
of
123
Laplacian In The Frequency Domain
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

Equation (1) gives the laplacian result whereas


equation (2) and (3) gives the enhanced image
after taking the laplacian.
Images taken from Gonzalez & Woods, Digital Image Processing (2002)

of
123
Inverse DFT of 120
Laplacian in the Laplacian in the
frequency domain frequency domain

domain
in the frequency
2-D image of Laplacian
spatial filter
left compared to
the image on the
Laplacian In The Frequency Domain

Zoomed section of
121
of
123
Frequency Domain Laplacian Example

Original Laplacian
image filtered
image

Laplacian
Enhanced
image scaled
image
122
of
123
Fast Fourier Transform
The reason that Fourier based techniques have
become so popular is the development of the
Fast Fourier Transform (FFT) algorithm
Allows the Fourier transform to be carried out in
a reasonable amount of time
Reduces the amount of time required to perform
a Fourier transform by a factor of 100 – 600
times!
123
of
Frequency Domain Filtering & Spatial
123 Domain Filtering
Similar jobs can be done in the spatial and
frequency domains
Filtering in the spatial domain can be easier to
understand
Filtering in the frequency domain can be much
faster – especially for large images

You might also like