Beruflich Dokumente
Kultur Dokumente
Example 1
Fourier transform
basis functions
Approximating a
square wave as the
sum of sine waves
1
Fourier Transform in the
Example 2 Frequency Domain
Complex Spectra
• Euler’s formula: e j cos j sin
• In general, the components of Fourier transform are complex
1 M 1 quantities in the following form:
F (u ) f ( x )[cos 2ux / M j sin 2ux / M ]
M x 0 F(u) = R(u) + jI(u)
for u 0,1, 2,..., M 1
and can be written as
• Each term of the Fourier transform is composed
of the sum of all values of the function f(x). F(u) = |F(u)|ej(u)
– M2 summations and multiplications • The spectra is usually represented by the amplitude of a specific
frequency
– The values of f(x) are multiplied by sines and cosines • Amplitude or spectrum of Fourier transform
of various frequencies.
– The domain (values of u) over which the values of
|F(u)| = (R2(u)+I2(u))1/2
F(u) range is appropriately called the frequency
domain, because u determines the frequency of the
components of the transform.
– Each of the M terms of F(u) is called a frequency
component of the transform.
2
Periodicity of 1-D DFT 2-D Discrete Fourier Transform
M 1
1
From DFT: F (u )
M
f ( x )e
x 0
j 2ux / M
For an image of size MxN pixels
F(u) = F(u+kM) We display only in this range
2-D DFT
M 1 N 1
1
F ( u, v )
MN
f ( x, y )e
x 0 y 0
j 2 ( ux / M vy / N )
x = 0 ,…, M-1
frequency domain representation and the weights for each sine y = 0 ,…, N-1
and cosine function are known as Fourier coefficients.
3
• The term Spatial frequency is used to describe the rate of
change of pixel intensity of an image in space.
• It can be visualized using the line profile of the pixels in a row
or a column
• The profile is a plot of the intensity of the pixels in a row or a
column
• X-axis – Distance of the pixels from the origin
• Y-axis – Grey Value (0-255)
• Intensity profile is a collection of either sinusoidal signals such
as sine, cosine, and harmonic signals, or non-sinusoidal signals
such as square waves
• Intensity change can be expressed as
I = sin(ux)
u-spatial frequency
sin(ux) ranges from -1 to +1
4
Fourier Examples Discrete Fourier Transform -
Raw Image Fourier Amplitude
Magnitude
Sinusoid, DC term + side lobes
higher frequency wide spacing
Sinusoid, DC term+ side lobes Original image Fourier transform Logarithmic operator applied
lower frequency close spacing
5
Inverse Transform Phase Carries More Information
Raw
Images:
Magnitude
and
Phase:
Reconstruct
(inverse FFT)
mixing the
magnitude and
phase images
25 26
6
Low and high frequencies Low and high frequencies
The DFT matrix for n=7:
Why are the low frequencies at the four corners of the transform?
We will visualize the rows of the matrix, which give the basis of the
transform, by connecting these points with edges.
where
27 28
Visualisation of the fourth row. The visualisation of the last row. We made one full clockwise circle.
29 30
7
Low and high frequencies Low and high frequencies
High
Low
Low
Top rows Low frequencies
High frequencies
High High
36 37
8
Spectrum shift Filtering steps:
Shifted
1) Multiply the input image by (-1)x+y to center
Log enhanced the transform.
Original image log enhanced
transform
transform 2) Compute DFT F(u, v)
3) Multiply F(u,v) by a filter function H(u,v)
G(u,v) = F(u,v)H(u,v)
4) Computer the inverse DFT of G(u,v)
5) Obtain the real part of g(x,y)
6) Multiply g(x,y) with (-1)x+y
38
Why (-1)x?
(1) x (cos j sin ) x (e j ) x e jx
1 M 1 • Modulation in the space domain
M
(1) x f ( x)e j 2ux / M
x 0
F[(-1)x+yf(x, y)]= F(u-M/2,v-N/2)
M 1 2 jx ( u
M
1 M
)/M
f ( x )e 2
F (u )
M x 0 2
9
Lowpass filter
Highpass filter
Gaussian Filters
Smoothing Frequency-Domain Filters
• Frequency-Domain Filtering:
• Fourier Transform pair G(u,v) = H(u,v)F(u,v)
of Gaussian function
H (u ) Aeu / 2
2 2
h( x) 2 Ae
2 2 2 x 2
In many instances the frequency response of
• Depicted in figures are
the filter is known, but its impulse response
is unknown, or it is desired to filter a given
low-pass and high-pass spatial frequency
Gaussian filters, and
their spatial response,
as well as FIR masking Filter H(u,v)
filter approximation. – Ideal filter
– Butterworth filter
– Gaussian Filter
10
Ideal lowpass filter Ideal lowpass filter
We can also directly design filters for the frequency domain.
This filter retains the low frequencies and eliminates the high
Assume that the frequency domain has been shifted and the low frequencies.
frequencies are at the centre of the transform.
Remember that the filter H(u,v) acts on the transform F(u,v) by
Consider the filter H with values 1 near the centre of the image and component-wise multiplication H (u , v ) F (u , v )
values 0 further from the centre.
46 47
11
Note that the origin (0, 0) is at the center and not the corner of the
image .
52 53
12
Butterworth Low pass Filters Butterworth Low pass Filters
• A butterworth low pass filter (BLPF) of order n with cutoff frequency
• Softer Blurring + no Ringing at a distance D0 from the origin is given by the following transfer
function 1
H (u, v)
1 [ D(u, v) / D0 ]2 n
54 55
This is more appropriate for image smoothing than the ideal LPF,
56
since this does not introduce ringing. 57
13
Examples of Application of BLPF Butterworth Low pass Filters
• Same order but with different • To check whether a Butterworth low pass filter suffer the ringing
effect as dose the ILPF, we need to examine the pattern of its
cutoff frequencies equivalent spatial filter
– The larger the cutoff frequency,
the more details are reserved
58 59
14
Gaussian Low pass Filters Gaussian Low pass Filters
• 1D Gaussian distribution function is given
• GLPF is given by the following (centered ) transfer
by ( x x ) / 2
2 2 function
f ( x) Ae 0
( v v0 ) 2 ] / 2 2
H (u, v) e [(u u0 ) e D ( u ,v ) / 2 D0 2
2 2
15
Other Low pass filtering examples Frequency-Domain Filtering
Ideal LPF Butterworth LPF Gaussian LPF
67
16
Sharpening Frequency-Domain Filter Sharpening Frequency-Domain Filter
17
Ideal High pass Filter Butterworth High pass Filter
18
Gaussian High pass Filter Gaussian High pass Filter
• Let = D0
H (u, v) 1 e D
2
( u ,v ) / 2 D02
Approach
19
Periodic Noise Reduction by Frequency
Domain Filtering
A Butterworth bandreject
filter of order 4, with the • Band reject filters
appropriate radius and
width to enclose
– Remove or attenuate a band of frequencies.
completely the noise
impulses 1 if D(u, v) D0 W / 2
H (u, v) 0 if D0 W / 2 D(u, v) D0 W / 2
1 D(u, v) D0 W / 2
if
• D0 is the radius.
• D(u, v) is the distance from the origin, and
• W is the width of the frequency band.
82
20
Band pass filter Notch filters
• Notch filter rejects (passes) frequencies in
• Obtained form band reject filter predefined neighborhoods about a center
Hbp(u,v)=1-Hbr(u,v) frequency.
• The goal of the band pass filter is to isolate 0 if D1 (u, v) D0 or D2 (u, v) D0
the noise pattern from the original image, H (u, v)
1 otherwise
which can help simplify the analysis of where
noise, reasonably independent of image
content.
D1 (u, v) (u M / 2 u0 )2 (v N / 2 v0 )2
1/ 2
D (u, v) (u M / 2 u )
1/ 2
2 0
2
(v N / 2 v0 )2
Notch filters
Notch filters
• Butterworth notch filter
1
H (u, v) n
D02
1
1
D (u , v ) D2 (u, v)
21