Sei sulla pagina 1di 31

2

Discrete Fourier Transform


Basic Properties of DFT
To compute any term of the DFT we need
all the values of the function
The spatial information of an image is lost
in a DFT
DFT contains only frequency information
Discrete Fourier Transform
The DFT values of an image corresponds
to the intensity changes of an image
The dc" component (u=v=0) corresponds
to the average gray level of an image
3
DFT of an !mage
DFT
Shifted DFT
DFT of an !mage
DFT
Shifted DFT
4
DFT of an !mage
DFT
Shifted DFT
DFT of an !mage
DFT
Shifted DFT
5
Example
!mage
Strong +-+5 degree angles
2 white oxide protrusions
Fourier Spectrum
Edges +-+5 degree
Correspond to the edges
!mage and Fourier Spectrum
6
Basic Filtering in Frequency Domain
! " # ! " # ! " # ! " # ! " $ ! " % =
Filtered !mage = !$ " # %
&
! " %

!mage = f(x,y)
F(u,v) = DFT(f(x,y))
Frequency domain filter H(u,v)
Basic Filtering in Frequency Domain
1. Nultiply the input image (-1)
x+y
to center the
transform
2. Compute F(u,v), the DFT of the image
3. Nultiply F(u,v) by a filter function H(u,v)
+. Compute the inverse DFT of the result in (3)
5. Obtain the real part of the result in (+)
6. Nultiply the result in (5) by (-1)
x+y
7
Basic Filtering in Frequency Domain
Basic Filtering in Frequency Domain
Usually H(u,v) has only real value
These filters are called Zero-phase shift
filters
8
F(0,0) dc" component


=

=
=
&
'
&
'
! " #
&
! ' " ' #
&
'
(
)
' ) *
(&
#
DFT at origin is equal to the average gray level of
the image
This is called dc" component
dc" stands for direct current"
Frequency Domain Filters:
Notch Filter
Nakes the average value of an image to zero
At the origin of the frequency spectrum make the
center value to zero
Notch filter
Hole (notch) at the origin
H(u,v) = 0 if (u,v) = (Nf2,Nf2)
H(u,v) = 1 otherwise
9
Notch Filter Effect
-Drop in overall average gray value
-Edges stand out
DFT
Low frequencies
Gray level appearance of an image over
smooth areas
High frequencies
Details
Edges
Noise
10
Filters
Low pass filters
Allows low frequencies to pass
!mage will have less sharp details
High pass filters
Allows high frequencies to pass
Less gray level variations
Low pass and High pass filters
11
Correspondence Between Filtering in Spatial
and Frequency Domain
Convolution Theorem
Convolution in spatial domain can be computed by
Computing the DFT of both signals
Nultiplication in frequency domain
Taking the !DFT of the product
! " # ! " # ! " # ( ! " # ! " $ ! " # ' ) + ' ) *
! " # ( ! " # ! " # ! " # ! " $ ! " # ' ) + ' ) *
Similarly frequency domain convolution can be computed by a
simple multiplication in the spatial domain
Gaussian Filter
Gaussian filter shape in spatial and frequency domain is the same
Spatial domain Frequency domain
) ) )
)
) ! #
)
,- ) +
o t
o t

=
) )
) *
! #
o "
,- " $

=
12
Gaussian Filter
Behavior of Gaussian filter in spatial and frequency
domain is reciprocal
H(u) has a broad profile
h(x) has a narrow profile
As the value of sigma approaches (infinity)
Frequency domain
H(u) becomes a constant function
Spatial domain
h(x) becomes an impulse function
Effect of Sigma
1fSigma = 10
1fSigma = 50
Spatial Domain Frequency Domain
13
Gaussian Filter
Since the DFT of Gaussian H(u) allows only low frequencies
Gaussian is a low pass filter
Gaussian Filter
Frequency domain
The narrower the frequency domain filter
The more it will attenuate the low frequencies
!ncreased blurring
Spatial domain
A wider filter
!ncreased blurring
14
High Pass filter
Difference of Gaussian
) )
)
) ) )
&
)
)
)
)
&
) ) ! #
) )
.- ,- ) +
o t o t
o t o t

=
)
)
) )
&
)
) * ) *
! #
o o " "
.- ,- " $

=
Spatial Domain
Frequency Domain
When A >= B and
1
>
2
High Pass filter
Difference of Gaussian
15
Circular Convolution in
Frequency Domain
Compute DFT of the image
Compute DFT of the zero-padded filter
Nultiply them in frequency domain
Compute !DFT of the product
! " # ! " # ! " # ( ! " # ! " $ ! " # ' ) + ' ) *
This method is faster for large images
Smoothing Frequency-Domain Filters
Smoothing filters are
Low pass filters
Allow low frequencies in the output
Remove the high frequency information from the
image
Types of filters
!deal
Butterworth
Gaussian
16
Basic Filtering in Frequency Domain
! " # ! " # ! " # ! " # ! " $ ! " % =
Filtered !mage = !$ " # %
&
! " %

!mage = f(x,y)
F(u,v) = DFT(f(x,y))
Frequency domain filter H(u,v)
!deal Low Pass Filter
The ideal low pass filter cuts off all high frequency components
of the Fourier Transform that are at a distance greater than D
0
H(u,v) = 1 if D(u,v) <= D
0
H(u,v) = 0 if D(u,v) > D
0
D(u,v) is the distance from the point (u,v) to the center of the
frequency rectangle.
! " # ! " # ! " # ! " # ! " $ ! " % =
!mage = f(x,y) F(u,v) = DFT(f(x,y))
Frequency domain filter H(u,v)
17
Distance Function
) * & ) )
$ ! ) * # ! ) * %# ! " # & ! ( " ! " / + =
D(u,v) is the distance from the point (u,v) to the center of
the frequency rectangle.
!deal Low Pass Filter
18
Definitions
Power of a point in frequency domain =
Absolute value of the DFT value at that
point
! " # ! " #
! " # ! " #
) )
)
! " 0 ! " 1
! " # ! " 2
+ =
=
Power Spectrum
Total power of an image is the sum of
the absolute DFT values
For u = 0, 1, 2, ., N-1
For v = 0, 1, 2, 3, ., N-1


=

=
=
&
'
&
'
! " #
&
!
(
"
3
! " 2 2
19
Percentage of Power
(

=

!
3
"
2 ! " 2 * ! " # &'' o
Power of a portion of an image enclosed in a circle of radius r
Alpha is the ratio of the power
in the enclosed circle and the
total power of an image
Power Distribution in a typical image
99.5 230
98.0 80
96.+ 30
9+.6 15
92 5
Power Radius
20
Effect of Low Pass Filter
!mage size = 500x500 pixels
Radius of 80 pixels is 80f250 = 32 of an
image
With radius of 80, one third of the image data
produces an image which is quite similar to the
original
80 pixels radius contains 98 of the image
power
This concept will be used in compression
Effect of Low Pass Filter
Blurring 8 Ringing 98 80
Blurring 8 Ringing 96.+ 30
Blurring 8 Ringing 9+.6 15
Severe Blurring 92 5
Effect Power Radius
21
Function in Frequency and Spatial Domain
!deal Low Pass Filter in
Frequency Domain
!deal Low Pass filter's
!nverse Fourier
Transform in Spatial
Domain
This causes ringing effect
Function in Frequency and Spatial Domain
!deal Low Pass filter's
!nverse Fourier
Transform in Spatial
Domain
This causes ringing effect
22
!deal Low Pass Filter
Causes
Blurring
Ringing
How to design a filter than can only do
blurring but not ringing?
Answer: Butterworth Low pass Filter
Butterworth Low Pass Filter (BLPF)
4
/ ! " /
! " $
)
'
$ * $ " # % &
&
! " #
+
=
) * & ) )
$ ! ) * # ! ) * %# ! " # & ! ( " ! " / + =
D(u,v) is the distance from the point (u,v) to the center of
the frequency rectangle.
Butterworth low pass filter (BLPF) of order `n' and cutoff
frequency at a distance D
0
from the origin, is defined as
23
Butterworth Low Pass Filter (BLPF)
H(u,v) = 0.5 when D(u,v) = D
0
Filtering Effect using BLPF of Order 2
The ringing effect is eliminated in
BLPF
Smooth transition in blurring
24
Ringing Effect
As the order of BLPF increases, ringing effect starts appearing in
the image
Gaussian Low Pass Filter (GLPF)
) )
) * ! " #
! " #
o ! " /
- ! " $

=
Gaussian Low pass filter (GLPF) is defined as:
= D
0
)
'
)
) * ! " #
! " #
/ ! " /
- ! " $

=
25
Gaussian Low Pass Filter (GLPF)
Gaussian Low Pass Filter
No Ringing
26
Examples of GLPF
Examples of GLPF
27
Examples of GLPF
Sharpening Frequency Domain Filters
Blurring
Removing high-frequency components
Sharpening
Removing low-frequency components
High-pass filtering is just the opposite of low-pass
filtering
! " # & ! " # ! " $ ! " $
56 +6
=
28
High-Pass Filters
!deal
Butterworth
Gaussian
High-Pass Filters : Frequency Domain
29
High-Pass Filters : Spatial Domain
!deal High Pass Filter
The ideal high pass filter cuts off all low frequency components
of the Fourier Transform that are at a distance less than D
0
H(u,v) = 0 if D(u,v) <= D
0
H(u,v) = 1 if D(u,v) > D
0
D(u,v) is the distance from the point (u,v) to the center of the
frequency rectangle.
! " # ! " # ! " # ! " # ! " $ ! " % =
!mage = f(x,y) F(u,v) = DFT(f(x,y))
Frequency domain filter H(u,v)
30
!deal High Pass Filter
Ringing Effect
Butterworth High Pass Filter (BHPF)
4
! " / /
! " $
)
'
!$ " # * % &
&
! " #
+
=
) * & ) )
$ ! ) * # ! ) * %# ! " # & ! ( " ! " / + =
D(u,v) is the distance from the point (u,v) to the center of
the frequency rectangle.
Butterworth high pass filter (BHPF) of order `n' and cutoff
frequency at a distance D
0
from the origin, is defined as
31
Butterworth High Pass Filter (BHPF)
Gaussian High Pass Filter (GHPF)
)
'
)
) * ! " #
& ! " #
/ ! " /
- ! " $

=
Gaussian High pass filter (GHPF) is defined as:
32
Gaussian High Pass Filter (GHPF)

Potrebbero piacerti anche