Title: Image Processing
1Image Processing
Fourier Transform 1D
- Efficient Data Representation
- Discrete Fourier Transform - 1D
- Continuous Fourier Transform - 1D
- Examples
2The Fourier Transform
Jean Baptiste Joseph Fourier
3Efficient Data Representation
- Data can be represented in many ways.
- There is a great advantage using an appropriate
representation. - Examples
- Equalizers in Stereo systems.
- Noisy points along a line
- Color space red/green/blue v.s. Hue/Brightness
4Why do we need representation in the frequency
domain?
Relatively easy solution
Problem in Frequency Space
Solution in Frequency Space
Inverse Fourier Transform
Fourier Transform
Difficult solution
Solution of Original Problem
Original Problem
5How can we enhance such an image?
6Solution Image Representation
2 1 3 5 8 7 0 3 5
2
1
3
...
5
3
23
7
...
10
7Transforms
- Basis Functions.
- Method for finding the image given the transform
coefficients. - Method for finding the transform coefficients
given the image.
Grayscale Image
Transformed Image
V Coordinates
Y Coordinate
U Coordinates
X Coordinate
8Representation in different bases
- It is possible to go back and forth between
representations
u1
v1
a
u2
v2
9The Inner Product
- Discrete vectors (real numbers)
- Discrete vectors (complex numbers)
- The vector aH denotes the conjugate
- transpose of a.
- Continuous functions
10The Fourier basis functions
Basis Functions are sines and cosines
sin(x)
cos(2x)
sin(4x)
The transform coefficients determine the
amplitude and phase
a sin(2x)
2a sin(2x)
-a sin(2x?)
11Every function equals a sum of sines and cosines
A
3 sin(x)
1 sin(3x)
B
AB
0.8 sin(5x)
C
ABC
0.4 sin(7x)
D
ABCD
12Sum of cosines only symmetric
functions Sum of sines only
antisymmetric functions
D
-D
13Fourier Coefficients
Terms are considered in pairs
Ckcos(kx) Sksin(kx) Rk sin(kx qk)
Using Complex Numbers
eikx
cos(kx) , sin(kx)
Ckcos(kx) Sksin(kx) R ei? eikx
Amplitudephase
14The 1D Continues Fourier Transform
- The Continuous Fourier Transform finds the F(?)
given the (cont.) signal f(x) -
- Bw(x)ei2pwx is a complex wave function for each
(continues) given w .
- The inverse Continuous Fourier Transform composes
a signal f(x) given F(?)
- F(?) and f(x) are continues.
15Continuous vs sampled Signals
Sampling Move from f(x) (x ? R) to f(xj)
(j? Z) by sampling at equal intervals.
f(x0), f(x0Dx), f(x02Dx), .... , f(x0n-1Dx),
Given N samples at equal intervals, we redefine
f as
f(j) f(x0jDx) j 0, 1, 2, ... , N-1
f(j) f(x0 jDx)
f(x)
f(x03Dx)
f(2)
4 3 2 1
4 3 2 1
f(3)
f(x02Dx)
f(1)
f(x0Dx)
f(x0)
f(0)
0 0.25 0.5 0.75 1.0 1.25
0 1 2 3
16- The discrete basis functions are
- For frequency k the Fourier coefficient is
17 The Discrete Fourier Transform (DFT)
k 0, 1, 2, ..., N-1
Matlab Ffft(f)
The Inverse Discrete Fourier Transform (IDFT) is
defined as
x 0, 1, 2, ..., N-1
Matlab Fifft(f)
Remark Normalization constant might be different!
18Discrete Fourier Transform - Example
f(x) 2 3 4 4
3
3
F(0) S f(x) e S f(x) 1
x0
x0
(f(0) f(1) f(2) f(3)) (2344)
13
DFT of 2 3 4 4 is 13 (-2i) -1
(-2-i)
19The Fourier Transform - Summary
- F(k) is the Fourier transform of f(x)
- f(x) is the inverse Fourier transform of F(k)
- f(x) and F(k) are a Fourier pair.
- f(x) is a representation of the signal in the
Spatial Domain and F(k) is a representation in
the Frequency Domain.
20- The Fourier transform F(k) is a function over the
complex numbers - Rk tells us how much of frequency k is needed.
- ?k tells us the shift of the Sine wave with
frequency k. - Alternatively
- ak tells us how much of cos with frequency k is
needed. - bk tells us how much of sin with frequency k is
needed.
21The Frequency Domain
f(x)
x
The signal f(x)
Rk
?k
k
k
Amplitude (spectrum) and Phase
Real
Imag
k
k
Real and Imaginary
22- Rk - is the amplitude of F(k).
- ?k - is the phase of F(k).
- Rk2F(k) F(k) - is the power spectrum of F(k)
. - If a signal f(x) has a lot of fine details Rk2
will be high for high k. - If the signal f(x) is "smooth" Rk2 will be
low for high k.
3 sin(x)
1 sin(3x)
0.8 sin(5x)
0.4 sin(7x)
23Demo
24Examples
The Delta Function
0
Fourier
R
Real
?
?
?
Imag
?
?
25The Constant Function
f(x)
x
0
Fourier
R
Real
?
?
0
0
?
Imag
?
?
26A Basis Function
f(x)
x
0
Fourier
R
Real
?
?
?0
?0
?
Imag
?
?
27The Cosine wave
f(x)
Fourier
x
R
Real
?
?
-?0
?0
-?0
?0
?
Imag
?
?
28The Sine wave
x
Fourier
R?
Real
?
?
-?0
?0
??
Imag
?/2
?0
?
?
-?0
-?/2
29The Window Function (rect)
f(x)
x
-0.5
0.5
Fourier
R?
?
30Proof
F(w)
sinc(w)
w
31The Gaussian
f(x)
x
Fourier
R?
?
32The Comb Function
f(x)
ck(x)
x
Fourier
R?
C1/k(?)
?
33Properties of The Fourier Transform
- Linearity
- Distributive (additivity)
- DC (average)
- Symmetric
- If f(x) is real then,
34Distributive
f(x)
F(?)
x
?
g(x)
G(?)
x
?
fg
F(?)G(?)
x
?
35Transformations
- Translation
- The Fourier Spectrum remains unchanged
under translation - Scaling
36Example - Translation
1D Image
real(F(u))
imag(F(u))
F(u)
1
10
10
10
0.8
5
5
8
0.6
0
0
6
0.4
-5
-5
4
0.2
-10
-10
2
0
-15
-15
0
0
50
100
0
50
100
0
50
100
0
50
100
Translated
1
10
10
10
0.8
5
5
8
0.6
0
0
6
0.4
-5
-5
4
0.2
-10
-10
2
0
-15
-15
0
0
50
100
0
50
100
0
50
100
0
50
100
10
10
10
5
5
5
Differences
0
0
0
-5
-5
-5
-10
-10
-10
-15
-15
-15
0
50
100
0
50
100
0
50
100
37Change of Scale- 1D
f(x)
F(?)
x
?
f(x)
F(?)
x
?
f(x)
F(?)
x
?
38Change of Scale
f(x)
F(?)
x
?
0.5 F(?/2)
f(2x)
x
?
f(x/2)
2 F(2?)
x
?