You are on page 1of 9

Dr.

Yoram Tal

Image Transforms

• Fourier, FFT
• Wavelets
• Radon, Hough

75

Dr. Yoram Tal

A general note on image Transforms


It is sometimes easier to a problem in a different space

Forward Transform
Source Image X

direct indirect
processing processing

Backward Transform
Output Image Y

76

38
Dr. Yoram Tal

Jean Baptiste Joseph Fourier


Fourier FFT of Fourier

Image Frequency
domain domain

n=N
Every digital signal
f ( x) = ∑F e
n=− N
n
inπx / L
may be expanded in a
sum of sine & cosine
Euler: eiθ = cos(θ) + i sin(θ) functions 77

Dr. Yoram Tal

Simple Fourier expansions


(Demo: uiFourier)
sin( x) sin(3 x) sin(5 x) sin(7 x) sin(9 x)
Square = + + + + +…
1 3 5 7 9
sin( x) sin(2 x) sin(3 x) sin(4 x) sin(5 x)
Sawtooth = + + + + +…
1 2 3 4 5
sin( x) sin(3 x) sin(5 x) sin(7 x) sin(9 x)
Triangular = + + + + +…
1 ⋅1 3⋅3 5⋅5 7⋅7 9⋅9

78

39
Dr. Yoram Tal

Fast Fourier Transform


(FFT)
The function f(x) is therefore
completely specified by the expansion
coefficients Fn

F is usually computed by an efficient


algorithm discovered by Tukey and
Cooley in 1965 - the FFT algorithm

79

Dr. Yoram Tal

FFT Demo (DMfft)


A simple rgb image compression using
fftn (multi dimensional fft)

% I = source image (rgb)


% mask = binary mask around the origin

FI = fftn(I); % fft image


MFI = fftshift(mask).*FI; % masked fft image
RI = abs(ifftn(MFI)); % reconstruction

80

40
Fourier Transform

In…nite interval Case

Z1
i!t
X(!) = x(t)e
1
Inverse
Z1
i!t
x(t)= 21 X(!)e d!
1

Continuous Case - …nite interval


1
X
in!
X(!) = xn e
n= 1
Inverse
Z
in!
xn = 21 X(!)e d!

Discrete Version (DFT)

N
X1
b =
X xn e
2 in
N = 0; 1; :::N 1
n=0
Inverse
N
X1
xn = N1 b e2
X
in
N n = 0; 1; :::N 1
=0

Note: placement of constants is arbritray. Only product of the


constants in each direction counts.

1
Properties

Separability

N
X1 NX1 2 i(n +m )
F = N12 fnm e N ; = 0; 1; :::; N 1
n=0 m=0
N
X1 2 in
= N1 Fn e N

n=0

where
N
X1 2 im
Fn = N1 Fnm e N

m=0

Translation

2 in 0
F 0
$ f ne N

2 in 0
F e N $ fn n0

1
Convolution
Continuous

R
f g(x) = f (y)g(x y)dy

Discrete
N
X1
1
f g(x) = N f (n)g(x n)
n=0

Fourier

f (x; y) g(x; y) $ F (u; v) G(u; v)

Correlation
Continuous

R
f g(x) = f (y)g(x + y)dy = f (y) g( y)

Discrete
N
X1
1
f g(x) = N f (n)g(x + n)
n=0

Fourier

f (x; y) g(x; y) $ F (u; v) G(u; v)


f (x; y)g(x; y) $ F (u; v) G(u; v)

Point Spread Function (PSF)


Response of a …lter to a point image.
Let Pmn = 1 if m = n = 0 and 0 otherwise. Then
r
X r
X
0
Pmn = Hij Pm i;n j = Hmn
i= r j= r

Since convolution is linear when we know the e¤ect of a …lter on a point


image we know it on any image.
Theorem: A linear shift-invariant operator must be a convolution operator
in space.

1
Dr. Yoram Tal

y z { | | } z ~  € ~  € ‚ { ƒ } € ~

The solution of this equation (D = 1) is given by the


Convolution Integral:

 f (x ) (t = 0)
u (x , t ) = 
î G 2 t ⊗ f (x ) ( ) (t > 0)
„

where
 x2 
Gσ (x ) =
1
⋅ exp  −  f : R2 → R
2πσ  2 
 2σ 
2
…

99

Dr. Yoram Tal

† ‡ ˆ
† ‡ ˆ ‰ Š
‰ Š Š
Š ‹
‹ Œ
Œ  Ž
 Ž 
 
 
 ‘ ’
‘ ’ 
 
 “
“ ”
” •
• Œ
Œ –
– — —
— —

˜ ™ š › œ  ž Ÿ   ¡ ¢ £ ¤ ¥ ¥ ¥ ¢ ¦ § ¡ ¨ ¦ © ª ¢ « ¬ ­ ® ¨ « ¯ ° ± ² § ¡ ¨ ¦ © ª ¢ « ¬ ³ ¦ ± ª ´ µ ¡ ¶ · ¦ ° ¸

¹ º » ¼ ½ ¾ ¿ À Á Â Ã Ä Å Å Æ Ç È É É Ê Ë Ì Í Ë Î Ï Ð Ñ Ò Ó Ô Õ Ö Ñ Ò × Ø Ô Õ Ù Ð Ñ Ú Û

100

50
Heisenberg Uncertainty Principle (band limited in physical space
and Fourier space)

R +∞ √
Normalize f(x) so that −∞ |f (x)|2 dx = 1 and limx→∞ xf (x) = 0
Let F(k) be the Fourier transform
R +∞ of f(x).
Then by Parseval’s theorem −∞ |F (k)|2 dk = 1

sZ sZ
Z ∞ ∞ ∞
0
| x(f (x)f (x)dx| ≤ |xf (x)|2 dx |f 0 (x)|2 dx by the Schwarz inequal
−∞ −∞ −∞
sZ sZ
∞ ∞
= |xf (x)|2 dx |ikF (k)|2 dk by Parseval’s equality
−∞ −∞
Z ∞ Z ∞
1 1
x(f (x)f 0 (x)dx = x [f (x)]2 |∞
−∞ − [f (x)]2
−∞ 2 −∞ 2
1 1
=0− =− by integration by parts
2 2
Hence sZ sZ
∞ ∞
2
1
|xf (x)| dx |ikF (k)|2 dk ≥
−∞ −∞ 2

So we can’t make both integrals small. If we concentrate the physical


function we spread the Fourier transform and vice versa
2
We get equality if f 0 (x) = const xf (x) or f (x) = e−αx . Hence, the
Gaussian is the most concentrated function.

You might also like