0% found this document useful (0 votes)
46 views

Image Enhancement in The Frequency Domain: Spring 2006, Jen-Chang Liu

The document discusses image enhancement in the frequency domain. It introduces the Fourier transform, which represents any periodic function as a sum of sines and cosines at different frequencies. The weights of these frequencies can be determined by minimizing the mean squared error between the original function and the reconstructed function. The Fourier transform extends this concept to non-periodic functions using an integral over all frequencies from 0 to infinity.

Uploaded by

Jaya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views

Image Enhancement in The Frequency Domain: Spring 2006, Jen-Chang Liu

The document discusses image enhancement in the frequency domain. It introduces the Fourier transform, which represents any periodic function as a sum of sines and cosines at different frequencies. The weights of these frequencies can be determined by minimizing the mean squared error between the original function and the reconstructed function. The Fourier transform extends this concept to non-periodic functions using an integral over all frequencies from 0 to infinity.

Uploaded by

Jaya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 39

Image Enhancement in the

Frequency Domain

Spring 2006, Jen-Chang Liu


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
Background
 1807, French math. Fourier
 Any function that periodically repeats itself can
be expressed as the sum of of sines and/or
cosines of different frequencies, each multiplied
by a different coefficient (Fourier series)
Periodic function

f(t) = f(t+T), T: period (sec.)


1/T: frequency (cycles/sec.)
Frequency Weight
f1 w1
f2 w2

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

Minimize squared error


Minimize MSE calculation
min F ( w1 , w2 , w3 , w4 )
  [ f (t )  ( w1 f1 (t ) w2 f 2 (t )  w3 f 3 (t )  w4 f 4 (t ))] dt
2

  ( 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

 2 w1 ff1  2 w1w2 f 2 f1  2 w1w3 f 3 f1  2 w1w4 f 4 f1


 2 w2 ff 2  2 w2 w3 f 3 f 2  2 w2 w4 f 4 f 2
 2 w3 ff3  2 w4 w3 f 4 f 3
 2 w4 ff 4 ) dt
Orthogonal condition 正交

 f1 and f2 are orthogonal if


f1 , f 2   f1 (t ) f 2 (t )dt  0

 f1 , f2 , f3 , f4 are orthogonal to each other


F ( w1 , w2 , w3 , w4 )
  ( f 2  w12 f12 w22 f 22  w32 f 32  w42 f 42
 2w1 ff1 - 2w2 ff 2 - 2w3 ff3 - 2w4 ff 4 ) dt
Minimization calculation
 To satisfy min F ( w1 , w2 , w3 , w4 )
  ( f 2  w12 f12 w22 f 22  w32 f 32  w42 f 42
 2w1 ff1 - 2w2 ff 2 - 2w3 ff3 - 2w4 ff 4 ) dt
F
We have  2w1  f1  2 ff1  0
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

If f1 , f2 , f3 , … are orthogonal to each other

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

=> They all satisfy orthogonal conditions


Summary 1: orthogonal
Fourier series
 For f (t ), 0  t  2 (Assume periodic outside)


f (t )  a0   ak cos( kt)  bk sin( kt)
k 1

a0 , a1, b1, a2 , b2 , a3 , b3 ,...


DC
頻率=1 頻率=2 頻率=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
相位
Correlation with different phase
Weight calculation f , f1

w1  2
f1

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

w0 , w1 , w2 , w3 ,... Complex weight

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

Operation in frequency domain


without loss of information
1-D Fourier Transform
 Fourier transform F(u) of a continuous
function f(x) is:
Inverse transform:


j 2ux j  1
f ( x)  F (u )e du


Forward Fourier transform:



F (u )  
f ( x)e  j 2ux dx
2-D Fourier Transform
 Fourier transform F(u,v) of a continuous
function f(x,y) is:
Inverse transform:
 
f ( x, y)    F (u, v)e j 2 (uxvy ) dudv
  

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

Forward discrete Fourier transform:


M 1  j 2
u
1
 f ( x)e
x
F (u )  M
M x 0
Frequency Domain 頻率域
 Where is the frequency domain?
j
Euler’s formula:
sin  1
e j  cos   j sin  
cos
M 1
1 u u
F (u ) 
M

x 0
f ( x)[cos 2
M
x  j sin 2
M
x]

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

F (u)  [ R (u)  I (u)]


2 2 1/ 2
magnitude

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  xx) x  0,1,..., M  1

[ x0 , x0  x , ...., x0  (M  1)x]

 Frequency index
F (u )  F (uu ) 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

 Rate of change of gray levels in an image


+45,-45 degree

artifacts

You might also like