Академический Документы
Профессиональный Документы
Культура Документы
Image Transforms
Basis to Basis
Fourier Basis Functions
Fourier Coefficients
Fourier Transform - 1D
Fourier Transform - 2D
Efficient Data
Representation
Data can be represented in many
ways.
There is a great advantage using an
appropriate representation.
It is often appropriate to view images
as combinations of waves.
= 3
+5
+ 10
+ 23
+3
+ ...
+1
+5
+ ...
f ( x ) = F ( ) e i 2x d
New Basis
Fourier Image
Frequency Coordinate
Standard Basis:
[ a1 a2 a3 a4 ] =
a1 [ 1 0 0 0 ] + a2 [ 0 1 0 0 ] + a3 [ 0 0 1 0 ] + a4 [ 0 0 0 1 ]
Hadamard Transform:
[ 2 1 0 1] =
= 1 [ 1 1 1 1 ] + 1/2 [ 1 1 -1 -1 ] - 1/2 [ -1 1 1 -1 ] + 0 [ -1 1 -1 1 ]
= [ 1 1/2 -1/2 0 ] Hadamard
1. Basis Functions.
2. Method for finding the image given the transform coefficients.
3. Method for finding the transform coefficients given the image.
N = 16
X = [ 2 1 0 1]
New Basis:
T0 = [ 1 1 1 1 ]
standard
T1 = [ 1 1 -1 -1 ]
T2 = [ -1 1 1 -1 ]
T3 = [ -1 1 -1 1 ]
New Coefficients:
a0 = <X,T0 > =< [ 2 1 0 1 ] , [ 1 1 1 1 ] > /4 = 1
a1 = <X,T1 > =< [ 2 1 0 1 ] , [ 1 1 -1 -1 ] > /4 = 1/2
a2 = <X,T2 > =< [ 2 1 0 1 ] , [ -1 1 1 -1 ] > /4 = -1/2
a3 = <X,T3 > =< [ 2 1 0 1 ] , [ -1 1 -1 1 ] > /4 = 0
Signal:
X = [ 1 1/2 -1/2 0 ]
new
Y Frequency
Y Coordinate
X Coordinate
Fourier
Image
X Frequency
Standard Basis:
a11 a12
a21 a22
[ ]
= a11
1 0
0 0
[ ] [ ] [ ]
+ a12
0 1
0 0
0 0
+ a21
+ a22
0 0
1 0
0 1
Hadamard Transform:
2
[ ]
[ ] [ ] [ ] [ ]
[ ]
= 1
1 1
1 -1
-1 -1
-1 1
+ 1/2
- 1/2
+ 0
1 1
1 -1
1 1
1 -1
1 1/2
-1/2 0
Hadamard
1. Basis Functions.
2. Method for finding the image given the transform coefficients.
3. Method for finding the transform coefficients given the image.
Standard Basis:
] [ ] [ ] [ ] [ ]
1 0
0 0
= 2
+ 1
0 1
+ 1
0 0
0 0
+ 0
1 0
0 0
0 1
[ ] [ ]
1 0
0 0
0 1
0 0
[ ] [ ]
0 0
1 0
coefficients
0 0
0 1
Standard
Basis Elements
Hadamard Transform:
1
1/2
-1/2
] [ ]
= 1
1 1/2
-1/2 0
coefficients
[ ] [ ] [ ]
1 1
1 -1
-1 -1
-1 1
+ 1/2
- 1/2
+ 0
1 1
1 -1
1 1
1 -1
[ ] [ ]
1 1
1 1
Hadamard
1 -1
1 -1
[ ] [ ]
-1 -1
1 1
-1 1
1 -1
Hadamard
Basis Elements
size = 8x8
Black = +1 White = -1
a
B
(x)
di
i
i
f ( x) =
<f(x),Bi(x)> =
f(x) B i (x) dx
Fourier Transform
Basis Functions are sines and cosines
sin(x)
cos(2x)
sin(4x)
a sin(2x)
2a sin(2x)
-a sin(2x)
3 sin(x)
+ 1 sin(3x)
B
A+B
+ 0.8 sin(5x)
C
A+B+C
+ 0.4 sin(7x)
D
A+B+C+D
f (x) =
F ( ) e i 2 x d
F ( ) = f(x)e
x
i2 x
dx
~
F { f ( x )} = F ( )
f(x) is the inverse Fourier transform
of F():
~
F 1{F ( )} = f ( x )
F ( ) = R e
Alternatively:
F ( ) = a + ib
a tells us how much of cos with
frequency is needed.
b tells us how much of sin with
frequency is needed.
Problem in
Frequency
Space
Relatively
easy solution
Inverse
Fourier
Transform
Fourier
Transform
Original
Problem
Solution in
Frequency
Space
Difficult
solution
Solution of
Original
Problem
Examples:
The Delta Function:
Let
f ( x) = (x )
F ( ) =
i 2 x
(
x
)
e
=1
f(x)
Fourier
f ( x ) =1
F() = e
i 2 x
= ()
f(x)
Fourier
Real
Imag
Let
1 i 20 x i 20 x i 2x
F ( )= e
+e
e
dx =
2
1
= [ ( 0 )+ ( + 0 )]
2
f(x)
Fourier
Real
-0
-0
Imag
Let
0 .5
F ( ) = e
0.5
i 2x
sin ( )
dx =
= sinc ( )
f(x)
x
-0.5
0.5
Fourier
Proof:
f(x) = rect1/2(x) =
-1/2
|x| 1/2
otherwise
1/2
1/ 2
1/ 2
1
2iux 1/ 2
=
e
1/ 2
2iu
1
=
eiu eiu
[
2iu
1
=
[cos(u) i sin(u) cos(u) i sin(u)]
2iu
sin(u)
=
u
= sinc(u)
F(u)
sinc(u)
The Gaussian:
Let
f ( x) = e
x 2
F ( )=e
f(x)
x
Fourier
f(x)
ck(x)
x
k
Fourier
C1/k()
1/k
Fourier Transform - 2D
Given a continuous real function f(x,y),
its Fourier transform F(u,v) is defined as:
~
F{f (x,y)}= F(u,v) = f (x,y)e 2i(ux+vy)dxdy
Phase =
(u,v) = tg-1(b(u,v)/a(u,v))
|F(u,v)|2 =
a2(u,v) + b2(u,v)
1
u2 + v2
1
v
1/u
lines of
(real) value 1
u=0
direction of waves
v=0
direction of waves
u=-2, v=2
u=-1, v=2
u=0, v=2
u=1, v=2
u=2, v=2
u=-2, v=1
u=-1, v=1
u=0, v=1
u=1, v=1
u=2, v=1
U
u=-2, v=0
u=-1, v=0
u=0, v=0
u=1, v=0
u=2, v=0
u=-2, v=-1
u=-1, v=-1
u=0, v=-1
u=1, v=-1
u=2, v=-1
u=-2, v=-2
u=-1, v=-2
u=0, v=-2
u=1, v=-2
u=2, v=-2
2D Fourier Transform
f(x,y)
1
1/2
1/2
f(x,y) = rect(x,y) =
|F(u,v)|
F (u ) =
f ( x, y )e 2i ( ux + vy ) dxdy =
2i ( ux + vy )
e
dxdy
1 / 2 1 / 2
1/2
1 / 2 1/ 2
e 2 iux dx
1 / 2
1/2
e 2 ivy dy
1 / 2
sin( u ) sin( v )
=
= Sinc ( u , v )
u
v
Frequency Domain