Image Enhancement in The Frequency Domain: Spring 2006, Jen-Chang Liu
Image Enhancement in The Frequency Domain: Spring 2006, Jen-Chang Liu
Frequency Domain
f3 w3
f4 w4
Periodic function f
How to measure weights?
Assume f1 , f2 , f3 , f4 are known
f (t ) w1 f1 (t ) w2 f 2 (t ) w3 f 3 (t ) w4 f 4 (t )
How to measure w1 , w2 , w3 , w4 ?
min 2
[ f (t ) ( w f
1 1 (t ) w f
2 2 (t ) w f
3 3 (t ) w f
4 4 (t ))] dt
( f w f w f w f w f
2 2
1 1
2 2
2 2
2 2
3 3
2 2
4 4
2
w1
=> w1
ff 1
f , f1 Recall in linear
algebra: projection
f
2 2
1 f1
Weight = Projection magnitude
Represent input f(x) with another basis
functions
Functional space
Vector space
v f
projection
(1,0) f1
Summary 1
A function f can be written as sum of f1 , f2 ,
f3 , …
f (t ) wi f i (t )
i
f , fi
Weight (magnitude) wi 2
fi
Summary 1: sine, cosine bases
Let f1 , f2 , f3 , … carry frequency information
Let them be sines and cosines
if n k 1
n, k:integers
cos( nt ) cos( kt) dt 2 if n k 0
0 otherwise
if n k 1
sin( nt ) sin( kt)dt 0 otherwise
sin( nt ) cos(kt)dt 0
for all integers n, k
f (t ) a0 ak cos( kt) bk sin( kt)
k 1
f 相關係數
f1
Correlation with different phase
(cont.)
Weight calculation f , f1
w1 2
f1
f 相關係數?
f1
Deal with phase: method 1
For example, expand f(t) over the cos(wt)
basis function
Consider different phases cos( wt )
Corr ( ) f (t ) cos( wt )dt
Corr()
0 0 2
Problem: weight(w, )
Deal with phase: method 2
Complex exponential as basis j 1
j
e cos(t ) j sin( t )
jt
sin 1
real
With frequency w: cos
e jwt
cos( wt ) j sin( wt )
Advantage:
Derive magnitude and phase simultaneously
Deal with phase 2: example
Input f (t ) cos(t )
w cos(t ), e jt
2
cos(t )e jt
dt
0
2 2
cos(t ) cos( )e dt sin( t ) sin( )e jt dt
jt
0 0
2 2
cos( ) cos(t ) cos(t )dt sin( ) j sin( t ) sin( t )dt
0 0
j
cos( ) j sin( ) e phase
magnitude
Fourier series with phase
For f (t ), 0 t 2 (Assume periodic outside)
f (t ) wk e jkt
wk (cos kt j sin kt)
k 0 k 0
DC
頻率k=1 k=2 k=3
Outline
Introduction to the Fourier Transform and
Frequency Domain
Magnitude of frequencies
Phase of frequencies
Fourier transform and DFT
Filtering in the frequency domain
Smoothing Frequency Domain Filters
Sharpening Frequency Domain Filters
Homomorphic Filtering
Implementation of Fourier transform
Fourier transform
Functions that are not periodic can be
expressed as the integral of sines and/or
cosines multiplied by a weighting functions
Frequency up to infinity
Perfect reconstruction
Functions -- Fourier transform
x u
y F
v
Future development
1950, fast Fourier transform (FFT)
Revolution in the signal processing
Discrete Fourier transform (DFT)
For digital computation
1-D Discrete Fourier Transform
f(x), x=0,1,…,M-1 . discrete function
F(u), u=0,1,…,M-1. DFT of f(x)
Inverse transform:
M 1 j 2
u
F (u)e
x
f ( x) M
u 0
F(u) frequency
u
Fourier
transform
Physical analogy
Mathematical frequency splitting
Fourier transform
Physical device
Galss prism 三稜鏡
Split light into frequency components
F(u) Complex quantity?
imaginary
Polar coordinate
F (u) R(u) jI (u) m
real
j ( u )
F (u) e
I (u )
(u ) tan [ 1
] phase
R (u )
P(u ) F (u ) R (u ) I (u )
2 2 2
Power spectrum
Some notes about sampling in
time and frequency axis
Time index
f ( x) f ( x0 xx) x 0,1,..., M 1
[ x0 , x0 x , ...., x0 (M 1)x]
Frequency index
F (u ) F (uu ) u 0,1,..., M 1
Also follow reciprocal property
u 1
x
Extend to 2-D DFT from 1-D
2-D: x-axis then y-axis
M 1 N 1 j 2 (
u
x
v
F (u, v)e
y)
f ( x, y ) M M
u 0 v 0
N 1 M 1 j 2 (
u
x
v
1
f ( x, y ) e
y)
F (u , v) M M
MN y 0 x 0
Complex Quantities to Real
Quantities
Useful representation
F (u, v) [ R (u, v) I (u, v)]
2 2 1/ 2
magnitude
I (u, v)
(u, v) tan [ 1
] phase
R(u , v)
Power spectrum
P(u, v) F (u, v) R (u, v) I (u, v)
2 2 2
DFT: example
log(F)
Properties in the frequency
domain
Fourier transform works globally
No direct relationship between a specific
components in an image and frequencies
Intuition about frequency
Frequency content
artifacts