0% found this document useful (0 votes)
25 views

3.3 - Frequency Domain Filtering

Uploaded by

yashbutkar8828
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)
25 views

3.3 - Frequency Domain Filtering

Uploaded by

yashbutkar8828
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/ 58

Image Enhancement

Image Enhancement:
Filtering in the Frequency Domain
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
The Big Idea

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
The Big Idea (cont…)

Notice how we get closer and closer to the original


function as we add more and more frequencies
The Big Idea (cont…)
Frequency domain
signal processing
example in Excel
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 1 N 1
F (u , v)   f ( x, y)e
x 0 y 0
 j 2 ( ux / M vy / N )

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


DFT & Images
The DFT of a two dimensional image can be
visualised by showing the spectrum of the images
component frequencies

DFT
DFT & Images
DFT & Images
DFT & Images (cont…)

DFT

Scanning electron microscope Fourier spectrum of the image


image of an integrated circuit
magnified ~2500 times
DFT & Images (cont…)
DFT & Images (cont…)
The Inverse DFT
It is really important to note that the Fourier
transform is completely reversible
The inverse DFT is given by:
M 1 N 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


The DFT and Image Processing
To filter an image in the frequency domain:
1. Compute F(u,v) the DFT of the image
2. Multiply F(u,v) by a filter function H(u,v)
3. Compute the inverse DFT of the result
Some Basic Frequency Domain Filters
Low Pass Filter

High Pass Filter


Some Basic Frequency Domain Filters
Some Basic Frequency Domain Filters
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
Ideal Low Pass Filter
Simply cut off all high frequency components that are
a specified distance D0 from the origin of the
transform

changing the distance changes the behaviour of the


filter
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
Ideal Low Pass Filter (cont…)

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
Ideal Low Pass Filter (cont…)
Ideal Low Pass Filter (cont…)
Ideal Low Pass Filter (cont…)
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
Ideal Low Pass Filter (cont…)

Result of filtering
with ideal low pass
filter of radius 5
Ideal Low Pass Filter (cont…)

Result of filtering
with ideal low pass
filter of radius 15
Butterworth Lowpass Filters
The transfer function of a Butterworth lowpass 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
Butterworth Lowpass Filter (cont…)
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
Butterworth Lowpass Filter (cont…)

Original
image

Result of filtering
with Butterworth filter
of order 2 and cutoff
radius 5
Butterworth Lowpass Filter (cont…)

Result of filtering with


Butterworth filter of
order 2 and cutoff
radius 15
Gaussian Lowpass Filters
The transfer function of a Gaussian lowpass filter is
defined as:
2 2
 D ( u ,v ) / 2 D0
H (u , v)  e
Gaussian Lowpass Filters (cont…)
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
Lowpass Filters Compared

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
Lowpass Filtering Examples
A low pass Gaussian filter is used to connect broken
text
Lowpass Filtering Examples
Lowpass Filtering Examples (cont…)
Different lowpass Gaussian filters used to remove
blemishes in a photograph
Lowpass Filtering Examples (cont…)
Lowpass Filtering Examples (cont…)

Original Gaussian lowpass


image filter

Spectrum of Processed
original image image
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)
Ideal High Pass Filters
The ideal high pass filter is given as:
0 if D(u , v)  D0
H (u , v)  
1 if D(u , v)  D0
where D0 is the cut off distance as before
Ideal High Pass Filters (cont…)

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
Butterworth High Pass Filters
The Butterworth high pass filter is given as:
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
Butterworth High Pass Filters (cont…)

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
Gaussian High Pass Filters
The Gaussian high pass filter is given as:
 D 2 ( u ,v ) / 2 D0 2
H (u , v)  1  e
where D0 is the cut off distance as before
Gaussian High Pass Filters (cont…)

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
Highpass Filter Comparison

Results of ideal
high pass filtering
with D0 = 15
Highpass Filter Comparison

Results of Butterworth
high pass filtering of order
2 with D0 = 15
Highpass Filter Comparison

Results of Gaussian
high pass filtering with
D0 = 15
Highpass Filter Comparison

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
Highpass Filter Comparison

Results of ideal
high pass filtering
with D0 = 15
Highpass Filter Comparison

Results of Butterworth
high pass filtering of order
2 with D0 = 15
Highpass Filter Comparison

Results of Gaussian
high pass filtering with
D0 = 15
After histogram
Highpass filtering result equalisation
Highpass Filtering Example Original image emphasis result
High frequency
Laplacian In The Frequency Domain

2-D image of Laplacian


frequency domain

in the frequency
Laplacian in the

domain
frequency domain
Laplacian in the
Inverse DFT of

Zoomed section of
the image on the
left compared to
spatial filter
Frequency Domain Laplacian Example

Original Laplacian
image filtered
image

Laplacian
Enhanced
image scaled
image
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!
Frequency Domain Filtering & Spatial 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
Summary
In this lecture we examined image enhancement in the
frequency domain
– The Fourier series & the Fourier transform
– Image Processing in the frequency domain
• Image smoothing
• Image sharpening
– Fast Fourier Transform
Next time we will begin to examine image restoration
using the spatial and frequency based techniques we
have been looking at

You might also like