0% found this document useful (0 votes)
123 views68 pages

Chapter 4 Image Enhancement in The Frequency Domain

The document discusses image enhancement in the frequency domain. It provides background on the Fourier transform and how it can be used to express functions in the frequency domain. The discrete Fourier transform (DFT) and its inverse are described for 1D and 2D signals/images. Key aspects of the frequency domain such as the magnitude spectrum, phase spectrum, and power spectrum are defined. Common filtering approaches for image enhancement like smoothing and sharpening filters are mentioned.

Uploaded by

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

Chapter 4 Image Enhancement in The Frequency Domain

The document discusses image enhancement in the frequency domain. It provides background on the Fourier transform and how it can be used to express functions in the frequency domain. The discrete Fourier transform (DFT) and its inverse are described for 1D and 2D signals/images. Key aspects of the frequency domain such as the magnitude spectrum, phase spectrum, and power spectrum are defined. Common filtering approaches for image enhancement like smoothing and sharpening filters are mentioned.

Uploaded by

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

4.

Image Enhancement in the Frequency Domain

4. Image Enhancement in
the Frequency Domain

1
4. Image Enhancement in the Frequency Domain

Contents
 Background
 Introduction to the FT and the Frequency Domain
 Smoothing Frequency-Domain Filters
 Sharpening Frequency-Domain Filters
 Homomorphic Filtering
 Implementation

2
4. Image Enhancement in the Frequency Domain

Background
 Fourier Series
 Any function that periodically repeats itself can be expressed as
the sum of sines and / or cosines of different frequencies, each
multiplied by a different coefficient.
 Fourier Series

2nx 2nx
f ( x)  ao  
n 1
(an cos
2L
 bnsin
2L
) , ( p  2 L)

1 L
2 L  L
a0  f ( x)dx,

1 L 2nx 1 L 2nx
an   f ( x) cos( )dx, bn   f ( x) sin( )dx
L L 2L L L 2L
 complex Fourier Series

f ( x)  c e
k  
n
j 2nx / 2 L
, ( p  2 L)

1 L
cn 
2L  L
f ( x ) e  j 2nx / 2 L dx

3
4. Image Enhancement in the Frequency Domain

Background (cont’)
 Fourier Transform
 Even functions that are not periodic can be expressed as the
integral of sines and / or cosines multiplied by a weighing
function.
 proof of the 1-D FT

1 L/2
f ( x)   cn e j 2nx / L , ( p  L) cn   f ( x ) e  j 2nx / L
dx
k   L  L / 2

1 

L/2
f ( x) 
k  

L

L / 2
f ( x ) e  j 2nx / L dx   e j 2nx / L

n n 1 n 1
L  , U n  , u  un 1  un    , lim u  du
L L L L L 

 lim u   f ( x )e  j 2x ( n / L ) dx   e j 2x ( n / L )
f ( x)  
n  

 L   




f ( x )     f ( x )e  j 2ux dx   e j 2ux du
    
 
F (u)   f ( x)e  j 2ux
dx f ( x)   F (u )e j 2ux du
 
4
4. Image Enhancement in the Frequency Domain

1-D DFT and its Inverse


 The 1-D FT and its Inverse
 FT / Inverse FT

F (u)   f ( x)e  j 2ux dx


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

 The 2-D FT and its Inverse


 FT / Inverse FT
 
F (u, v)    f ( x, y)e  j 2 (uxvy ) dxdy
 
 
f ( x, y)    F (u, v)e j 2 (uxvy ) dudv
  

5
4. Image Enhancement in the Frequency Domain

1-D DFT and its Inverse (cont’)

 1-D Discrete FT
 for discrete function f ( x), x  0, 1, 2, , M  1
 DFT
M 1 
1
F (u ) 
M

x 0
f ( x )e  j 2ux / M
F (u)  

f ( x)e  j 2ux dx

for u  0, 1, 2,  , M  1

 IDFT
M 1 
f ( x)   F (u )e
u 0
j 2ux / M
f ( x)  

F (u )e j 2ux du

for x  0, 1, 2,  , M  1

6
4. Image Enhancement in the Frequency Domain

1-D DFT and its Inverse (cont’)

F (u)  F (u) e j (u )
 magnitude or spectrum of the FT


F (u)  R (u)  I (u)
2 2
1/ 2

 phase angle or phase spectrum of the FT


 I (u ) 
 (u )  tan 1

 R (u ) 
 power spectrum
P(u )  F (u )  R 2 (u )  I 2 (u ),
2

( P  V 2 / R, V  amplitude, P / 2  (V / 2 )2
 1/ 2  0.707 : cutoff frequency)
7
4. Image Enhancement in the Frequency Domain

1-D DFT and its Inverse (cont’)


 example (1)

(2)

M=1024, (1)
A=1,
K=8

(2)

(1) The height of the spectrum Doubled


(2) The number of zeros doubled

8
4. Image Enhancement in the Frequency Domain

2-D DFT and its Inverse


 for M  N image : f ( x, y )
 DFT
1 M 1 N 1
F (u, v)  
MN x 0 y 0
f ( x, y )e  j 2 (ux / M vy / N )

for u  0, 1, 2,  , M  1
v  0, 1, 2,  , N  1

 IDFT
M 1 N 1
f ( x, y )   F (u, v)e
u 0 v 0
j 2 ( ux / M  vy / N )

for x  0, 1, 2,  , M  1
y  0, 1, 2,  , N  1

9
4. Image Enhancement in the Frequency Domain

2-D DFT and its Inverse (cont’)


 magnitude or spectrum

F (u, v)  R (u, v)  I (u, v)
2 2

1/ 2

 phase angle or phase spectrum


 I (u, v) 
 (u, v)  tan 1

 R (u , v ) 
 power spectrum
P(u, v)  F (u, v)  R 2 (u, v)  I 2 (u, v)
2

10
4. Image Enhancement in the Frequency Domain

2-D DFT and its Inverse (cont’)


 dc component
1 M 1 N 1
F (0,0)  
MN x 0 y 0
f ( x, y) average of f ( x, y )

 relationships between samples in the spatial and


frequency domains
1 1
u  v 
Mx Ny
 if f ( x, y ) is real, F (u , v) is conjugate symmetric
F (u, v)  F * (u,v)
F (u, v)  F (u,v) spectrum is symmetric

11
4. Image Enhancement in the Frequency Domain

2-D DFT and its Inverse (cont’)


 common practice
multiply the input image function by (1)
x y

f ( x, y ) e j 2 (u0 x / M v0 y / N )  F (u  u0 , v  v0 )
M 1 N 1
proof) F (u, v)  1  f ( x, y )e  j 2 (ux / M vy / N )
MN x 0 y 0
M 1 N 1
1
[ f ( x, y ) e j 2  ( u 0 x / M  v0 y / N )
]
MN

x 0 y 0
f ( x, y )e j 2 (u0 x / M  v0 y / N ) e  j 2 (ux / M  vy / N )

M 1 N 1
1

MN

x 0 y 0
f ( x, y )e  j 2 (u u0 ) x / M  ( v v0 ) y / N 

 F (u  u0 , v  v0 )
 
  f ( x, y ) e j 2 (u0 x / M  v0 y / N )  F (u  u0 , v  v0 )
12
4. Image Enhancement in the Frequency Domain

2-D DFT and its Inverse (cont’)


 
 f ( x, y ) e j 2 (u0 x / M  v0 y / N )  F (u  u0 , v  v0 )

u0  M / 2, v0  N / 2 이면
 j 2 ( x / M  y / N ) 
M N
 f ( x, y )e 2 2
  F (u  M / 2, v  N / 2)
 
 
 f ( x, y )e j ( x  y )  F (u  M / 2, v  N / 2)
 f ( x, y )( 1)   F (u  M / 2, v  N / 2)
( x y )

 f ( x, y) (1) x y  F (u  M / 2, v  N / 2)

13
4. Image Enhancement in the Frequency Domain

2-D DFT and its Inverse (cont’)


 example
(a) Image of a 20 x 40 white rectangle on a black background of size 512 x 512 pixels.
(b) Centered Fourier spectrum shown after application of the log transformation.

(1) x y
f ( x, y)(1) x y  F (u  M / 2, v  N / 2) (1)

(a)
(b)
2k

k (2)
(1) center the spectrum
(2) separation of spectrum zeros

14
4. Image Enhancement in the Frequency Domain

Filtering in the Frequency Domain


 some basic properties of the frequency domain
 low frequency : slowly varying components of image
 high frequency : faster gray level changes
such as noise and edges of objects
F (u, v) high frequency

low frequency
F (0,0)

15
4. Image Enhancement in the Frequency Domain

Filtering in the Frequency Domain (cont’)


 example

(1) strong edges that run approximately at ±45˚


(2) the two white oxide protrusions

16
4. Image Enhancement in the Frequency Domain

Filtering in the Frequency Domain (cont’)


 basics of Filtering in the Frequency domain

Multiply the input image by (1)


x y
 to center the transform
 Compute F (u , v) ,the DFT of the above image
 Multiply F (u , v) by a filter function H (u , v )
 Compute the inverse DFT of the result
 Obtain the real part of the above result
Multiply (1)
x y

17
4. Image Enhancement in the Frequency Domain

Filtering in the Frequency Domain (cont’)


 basics of Filtering in the Frequency domain (cont’)

Basic steps for filtering in the frequency domain

18
4. Image Enhancement in the Frequency Domain

Filtering in the Frequency Domain (cont’)


 some basic filters and their properties (cont’)
 low pass filter : preserve low frequency component
 high pass filter : preserve high frequency component

LPF

k
HPF H (u, v)   H (u, v) ,
2
(k  filter height )

19
4. Image Enhancement in the Frequency Domain

Correspondence between Filtering in the


spatial and Frequency domains
the relationship is established by the Convolution Theorem
 discrete convolution
M 1 N 1
1
f ( x, y ) * h ( x, y ) 
MN
 f (m, n)h( x  m, y  n)
m 0 n 0
a b similar
spatial filtering : g ( x, y )    w( s, t ) f ( x  s, y  t )
s   at   b
 convolution theorem
f ( x, y ) * h( x, y )  F (u, v) H (u, v)
f ( x, y )h( x, y )  F (u, v) * H (u, v)
δ ( x, y) * h( x, y)  δ ( x, y)H (u, v)
h( x, y )  H (u, v)
20
4. Image Enhancement in the Frequency Domain

Correspondence between Filtering in the


spatial and Frequency domains (cont’)
proof)
M 1 N 1 M 1 N 1  ux vy 
 j 2   
 f ( x, y) * h( x, y)   f (m, n)h( x  m, y  n)e M N 

x 0 y 0 m 0 n 0
M 1 N 1 M 1 N 1  u ( x m) v ( y n )   um vn 
 j 2     j 2   
  f (m, n)  h( x  m, y  n)e  M N 
e M N

m 0 n 0 x 0 y 0
M 1 N 1  um vn 
 j 2   
  f (m, n)H (u, v)e M N

m 0 n 0
M 1 N 1  um vn 
 j 2   
 H (u, v)  f (m, n)e M N

m 0 n 0

 H (u, v) F (u, v)

21
4. Image Enhancement in the Frequency Domain

Correspondence between Filtering in the


spatial and Frequency domains (cont’)
M 1 N 1
proof)
 s( x, y)δ ( x, y)  s(0,0)
x 0 y 0
M 1 N 1
δ ( x, y) 
1 1 0 1
MN
δ ( x, y)e j 2 ux / M vy / N  
x 0 y 0 MN
e 
MN
M 1 N 1
1 1
δ ( x, y ) * h ( x, y ) 
MN
δ (m, n)h( x  m, y  n) 
m 0 n 0 MN
h ( x, y )

 ( x, y) * h( x, y)   1 h( x, y)  1 h( x, y)


δ
 MN  MN
 δ ( x, y)H (u, v)
proof)
h( x, y )  δ ( x, y )H (u, v) 
1 1
δ ( x, y ) * h ( x, y )  H (u, v)
MN MN
h( x, y )  H (u, v)

22
4. Image Enhancement in the Frequency Domain

Correspondence between Filtering in the


spatial and Frequency domains (cont’)
 relationship

filter in the frequency domain guide for


small filter mask
DFT
IDFT

filter in the spatial domain

 It is more computationally efficient to do the filtering in


the frequency domain
 Filtering is more intuitive in the frequency domain
 It makes more sense to filter in the spatial domain using
small filter mask

23
4. Image Enhancement in the Frequency Domain

Correspondence between Filtering in the


spatial and Frequency domains (cont’)
 example( Filters based on Gaussian functions )

H (u)  Ae u 2 / 2 2
where,  is standard deviation
2 2 2 x 2
h( x)  2 Ae

 both functions are real


 two functions behave reciprocally with respect to one
another

24
4. Image Enhancement in the Frequency Domain

Correspondence between Filtering in the


spatial and Frequency domains (cont’)
 example( cont’)

A  B, 1   2
u2 u2
 
2 12 2 2 2
H (u )  Ae  Be

2 2 12 x 2
h( x)  21 Ae
 2 2 2 2 x 2
 22 Ae

25
4. Image Enhancement in the Frequency Domain

Smoothing Frequency-Domain Filters


 high frequency-content of Fourier Transform
 edges
 sharp transition (such as noise)
 smoothing is achieved by attenuating high frequency
component

 sorts
 Ideal Lowpass Filter high

 Butterworth Filter
filter order
 Gaussian Filter low

26
4. Image Enhancement in the Frequency Domain

Ideal LowPass Filter


 ideal low pass filter
1, if D(u, v)  D0
H (u, v)   D0 : cutoff frequency
0, if D(u, v)  D0


where, D(u, v)  (u  M / 2) 2  (v  N / 2) 2 1/ 2

27
4. Image Enhancement in the Frequency Domain

Ideal LowPass Filter (cont’)


 property
 ideal
 can be implemented in a computer
 nonphysical = non-actual = non-real

 set of standard cutoff frequency


M 1 N 1
PT   P(u, v)
u 0 v 0

 
 %  100 P(u, v) / PT 
 u v 

28
4. Image Enhancement in the Frequency Domain

Ideal LowPass Filter (cont’)


 example
D0  5
  92%

D0  15 D0  30
  94.6%   96.4%

D0  80 D0  230
ringing effect
  98%   99.5%

29
4. Image Enhancement in the Frequency Domain

Ideal LowPass Filter (cont’)


M 1 N 1
1 1
 ringing effect
δ ( x, y ) * h ( x, y ) 
MN
δ (m, n)h( x  m, y  n)  MN h( x, y)
m 0 n 0

ILPF spatial filter


(a) (b)

Inverse DFT

(c) (d)

(b) * (c)

Five impulses
δ ( x , y ) * h ( x, y )
in the spatial domain
30
4. Image Enhancement in the Frequency Domain

Butterworth LowPass Filter


 Butterworth filter
1
H (u, v) 
1  D(u, v) / D0 
2n

H (u, v)  0.5 when D(u, v)  D0

31
4. Image Enhancement in the Frequency Domain

Butterworth LowPass Filter (cont’)


 example
D0  5
1
 ,
1  D(u, v) / D0 
4

(n  2)
D0  30
D0  15
(1) smooth transition

(2) No ringing effect


D0  230
D0  80

32
4. Image Enhancement in the Frequency Domain

Butterworth LowPass Filter (cont’)


 ringing effect
ringing effect ↑
D0  5 ideal low pass filter ↑

n 1 n2 n5 n  20

33
4. Image Enhancement in the Frequency Domain

Gaussian LowPass Filter


 Gaussian LowPass Filter
 D 2 ( u ,v ) / 2 2
H (u, v)  e , (  D0 )

 D 2 ( u ,v ) / 2 D0 2
H (u, v)  e

34
4. Image Enhancement in the Frequency Domain

Gaussian LowPass Filter (cont’)


 example
D0  5

D0  15 D0  30

(1) smooth transition

(2) No ringing effect


D0  230
D0  80

35
4. Image Enhancement in the Frequency Domain

Additional Examples of Lowpass Filter


 character recognition

using a GLPF
with D0  80

Although humans fill these gaps visually without difficulty,


A machine recognition system has real difficulties reading Broken characters.

36
4. Image Enhancement in the Frequency Domain

Additional Examples of Lowpass Filter (cont’)

 printing and publishing industry

using a GLPF
with D0  80

original image

using a GLPF
“cosmetic” processing
with D0  100
37
4. Image Enhancement in the Frequency Domain

Additional Examples of Lowpass Filter (cont’)

 processing satellite and aerial images

(a) (b) (c)


(a) image showing using a GLPF using a GLPF
prominent scan lines with D0  30 with D0  10

38
4. Image Enhancement in the Frequency Domain

Sharpening Frequency-Domain Filters


 sharpening = highpass filtering
 attenuates the low-frequency component

H hp (u, v)  1  H lp (u, v)

 sorts
 Ideal highpass filter
 Butterworth highpass filter
 Gaussian highpass filter

39
4. Image Enhancement in the Frequency Domain

Sharpening Frequency-Domain Filters (cont’)

ideal highpass filter

Butterworth highpass filter

Gaussian highpass filter

40
4. Image Enhancement in the Frequency Domain

Sharpening Frequency-Domain Filters (cont’)

ringing effect
spatial representations of typical ideal, Butterworth,
and Gaussian Frequency domain highpass filters

41
4. Image Enhancement in the Frequency Domain

Ideal highpass filter


 ideal highpass filter
0, if D(u, v)  D0
H (u, v)  
1, if D(u, v)  D0
D0 : cutoff frequency
D0  15 D0  30 D0  80

ringing effect
42
4. Image Enhancement in the Frequency Domain

Butterworth highpass filter


 Butterworth highpass filter
1
H (u, v) 
1  D0 / D(u, v)
2n

H (u, v)  0.5 when D(u, v)  D0


smooth transition
D0  15 D0  30 D0  80

43
4. Image Enhancement in the Frequency Domain

Gaussian highpass filter


 Gaussian highpass filter
 D 2 ( u ,v ) / 2 D0 2
H (u, v)  1  e
smooth transition
D0  15 D0  30 D0  80

44
4. Image Enhancement in the Frequency Domain

Laplacian in Frequency Domain


 implementation in the frequency domain
 df ( x)   '
   f ( x ) e  j 2ux
dx  f ( x) e  j 2ux


 (  j 2u ) 

f ( x ) e  j 2ux
dx
 dx  
 


 f ( x)e  j 2ux 

  j 2u   f ( x)  0  j 2u   f ( x)  ( j 2u )   f ( x)
 d n f ( x) 
   ( j 2u ) F (u )
n
n
 dx 
  2 f ( x, y )  2 f ( x, y) 
    ( j 2u ) 2
F (u, v )  ( j 2v ) 2
F (u, v)
 x y
2 2

 
  2 f ( x, y)  4 2 (u 2  v 2 ) F (u, v)

H (u, v)  4 2 (u 2  v 2 )

45
4. Image Enhancement in the Frequency Domain

Laplacian in Frequency Domain


 f ( x, y)  4 (u  v ) F (u, v)
2 2 2 2

H (u, v)  4 2 (u 2  v 2 )

With respect to center of frequency rectangle



H (u, v)  4 2 (u  M / 2)2  (v  N / 2)2 
H(u,v)= - 4π2D2(u,v)
Laplacian image is obtained as

46
4. Image Enhancement in the Frequency Domain

Laplacian
 Enhancement is achieved using equation
g(x,y)= f(x,y) +c
C=-1 as H(u,v) is negative

In frequency domain it is written as

{[1+4π2D2(u,v)]F(u,v)}

47
4. Image Enhancement in the Frequency Domain

Laplacian in Frequency Domain (cont’)


 Laplacian in the spatial domain

 
h( x, y)  1  4 2 (u  M / 2)2  (v  N / 2)2 

48
4. Image Enhancement in the Frequency Domain

Laplacian in Frequency Domain (cont’)


 enhanced image

 2 f ( x, y )
 2  M 2 N 2  
   4  (u  )  (v  )  F (u, v)
1

  2 2  

g ( x, y)  f ( x, y)   2 f ( x, y)
scaling
g ( x, y)
  M N  
 1 1  4 2  (u  )2  (v  )2  F (u, v)
  2 2  

49
4. Image Enhancement in the Frequency Domain

Unsharp Masking, High-Boost Filtering,


and High-Frequency Emphasis Filtering
 a processed image
 Unsharp masking f hp ( x, y )  f ( x, y )  f lp ( x, y )
 High-boost filtering f hb ( x, y )  Af ( x, y )  f lp ( x, y )
f hb ( x, y )  ( A  1) f ( x, y )  f ( x, y )  f lp ( x, y )
f hb ( x, y )  ( A  1) f ( x, y )  f hp ( x, y )
 filter in frequency-domain
 Unsharp masking H hp (u, v)  1  H lp (u, v)

 High-boost filter H hb (u, v)  ( A  1)  H hp (u, v)


 High-frequency emphasis filter
H hfe (u, v)  a  bH hp (u, v), (a  0, b  a)

50
4. Image Enhancement in the Frequency Domain

Unsharp Masking, High-Boost Filtering,


and High-Frequency Emphasis Filtering
(cont’)
 High boost filtering in the frequency domain
f hb ( x, y )  ( A  1) f ( x, y )  f hp ( x, y )

Laplacian of (a)

A=2 A=2.7

51
4. Image Enhancement in the Frequency Domain

Unsharp Masking, High-Boost Filtering,


and High-Frequency Emphasis Filtering
(cont’)
 High-frequency emphasis filtering

result of Butterworth
highpass filtering

result of performing
histogram equalization
on (c)

H hfe (u, v)  a  bH hp (u, v), (a  0, b  a)


(a  0.5, b  2.0)
52
4. Image Enhancement in the Frequency Domain

Homomorphic Filtering
 Homomorphic filtering approach
 The separation of the illumination and reflectance components
f ( x, y )  i ( x, y ) r ( x, y )
z ( x, y )  ln f ( x, y )  ln i( x, y )  ln r ( x, y )
z( x, y)  ln f ( x, y)  ln i( x, y) ln r ( x, y)
ln i( x, y)  Fi (u, v), ln r ( x, y)  Fr (u, v)
Z (u, v)  Fi (u, v)  Fr (u, v)
S (u, v)  H (u, v)Z (u, v)  H (u, v) Fi (u, v)  H (u, v) Fr (u, v)
s( x, y )  1H (u, v) Fi (u, v) 1H (u, v) Fr (u, v)
s( x, y)  i ' ( x, y)  r ' ( x, y)
i ' ( x, y )  1H (u, v) Fi (u, v), r ' ( x, y)  1H (u, v) Fr (u, v),
g ( x, y)  e s ( x, y )  ei ( x, y )  e r ( x, y )  i0 ( x, y)r0 ( x, y)
' '

i0 ( x, y)  ei ( x, y ) , r0 ( x, y)  e r ( x, y )
' '

g ( x, y)  e i ' ( x, y )
e r ' ( x, y )

53
4. Image Enhancement in the Frequency Domain

Homomorphic Filtering
 Homomorphic filtering approach

 the homomorphic filter function H(u,v) can then operate on


these components separately,
S (u, v)  H (u, v) Fi (u, v)  H (u, v) Fr (u, v)
Fi (u, v) = illumination component : low frequency
Fr (u, v) = reflectance component : high frequency
 example

 H  1,  L  1
illumination↓ a reduction of dynamic range,
reflectance↑ Increase in contrast

54
4. Image Enhancement in the Frequency Domain

Homomorphic Filtering (cont’)


 Enhancement by homomorphic filtering


H (u, v)  ( H   L ) 1  e  c ( D 2 ( u ,v ) / D02 )
  ,
L

( L  0.5,  H  2.0)

 H  1,  L  1

a reduction of dynamic range in the brightness,


an increase in contrast
55
4. Image Enhancement in the Frequency Domain

Filtering in the Frequency Domain (cont’)


 notch filters (only special frequency)

0 , if (u, v)  ( M / 2, N / 2)
H (u, v)  
1 , otherwise

 the average value of the resulting image will be zero


 make prominent edges stand out
 pixels which have negative values will be produced

56
4. Image Enhancement in the Frequency Domain

57
4. Image Enhancement in the Frequency Domain

Implementation
 some additional properties of the 2-D FT
 translation
f ( x, y ) e j 2 (u0 x / M  v0 y / N )  F (u  u0 , v  v0 )

 distributivity and scaling


 f1 ( x, y)  f 2 ( x, y)   f1 ( x, y)   f 2 ( x, y)
1
af ( x, y)  aF (u, v), f (ax, by)  F (u / a, v / b)
ab

 rotation
x  r cos  , y  r sin  , u  w cos  , v  w sin 

f ( x, y )  f (r , ), F (u, v)  F ( w,  )

f (r ,   0 )  F ( w,    0 )

58
4. Image Enhancement in the Frequency Domain

Implementation (cont’)
 some additional properties of the 2-D FT (cont’)
 periodicity and conjugate symmetry
F (u , v)  F (u  M , v)  F (u , v  N )
 F (u  M , v  N )
f ( x, y )  f ( x  M , y )  f ( x, y  N )
 f (x  M , y  N )
F (u, v)  F (u,v)

 separability
M 1
1 1 N 1
F (u, v) 
M
e
x 0
 j 2ux / M

N y 0
f ( x, y )e  j 2vy / N

M 1
1

M
 F ( x, v )e
x 0
 j 2ux / M

1 N 1
F ( x, v)   f ( x, y)e  j 2vy / N
N y 0

59
4. Image Enhancement in the Frequency Domain

Implementation (cont’)
 computing the inverse FT using a forward
transform algorithm
M 1 M 1
1
F (u ) 
M
 f ( x )e
x 0
 j 2ux / M
, f ( x)   F (u )e j 2ux / M
u 0

M 1
1 * 1
M
f ( x) 
M
F
u 0
*
(u )e  j 2ux / M

M 1 N 1
1 * 1
MN
f ( x, y ) 
MN
 F
u 0 v 0
*
(u , v)e  j 2 (ux / M ,vy / N )

60
4. Image Enhancement in the Frequency Domain

Implementation (cont’)
 more on periodicity : the need for padding
 problem : convolution of the functions

Wraparound error

61
4. Image Enhancement in the Frequency Domain

Implementation (cont’)
 more on periodicity : the need for padding (cont’)
 solution : extended or padded function
 f ( x), 0  x  A 1
f e ( x)  
0, A x P

h( x), 0  x  B 1
he ( x)  
0, B x P

P  A  B 1

62
4. Image Enhancement in the Frequency Domain

Implementation (cont’)
 more on periodicity : the need for padding (cont’)
 2-D
 f ( x, y ), 0  x  A  1 and 0  y  B  1
f e ( x, y )  
0, A x P or B  y  Q
h( x, y ), 0  x  C  1 and 0  y  D  1
he ( x, y )  
0, C xP or D  y  Q

63
4. Image Enhancement in the Frequency Domain

Implementation (cont’)
 more on periodicity : the need for padding (cont’)
 example
(a) padded lowpass filter in the spatial domain
(b) result of filtering with padding

64
4. Image Enhancement in the Frequency Domain

Implementation (cont’)
 the convolution and correlation theorems
 correlation theorems – for matching
M 1 N 1
1
f ( x, y ) * h ( x, y ) 
MN
 f (m, n)h( x  m, y  n)
m 0 n 0
M 1 N 1
1
f ( x, y )  h ( x, y ) 
MN
 f
m 0 n 0
*
(m, n)h( x  m, y  n)

f ( x, y)  h( x, y)  F * (u, v) H (u, v)
f * ( x, y)h( x, y)  F (u, v)  H (u, v)

 cross correlation
 To clarify that the images being correlated are different

 autocorrelation
 both images are identical
f ( x, y )  f ( x, y )  F (u, v) f ( x, y )  F (u, v)  F (u, v)
2 2

65
4. Image Enhancement in the Frequency Domain

Implementation (cont’)
 the convolution and correlation theorems (cont’)
 example
f ( x , y )  h ( x, y )

66
4. Image Enhancement in the Frequency Domain

Implementation (cont’)
 the Fast Fourier Transform
 successive doubling method
1 M 1 1 M 1
F (u )  
M x 0
f ( x )e  j 2ux / M

M x 0
 f ( x)WMux , (WM  e  j 2 / M )

M  2n  2 K
1 2 K 1 1  1 K 1 1 K 1 u ( 2 x 1) 
F (u )  
2 K x 0
f ( x )W ux
2K  
2  K x 0
f ( 2 x )W u(2 x)
2K  
K x 0
f ( 2 x  1)W2K 

1  1 K 1 1 K 1 
(W  W ), F (u )    f (2 x)WK   f (2 x  1)WKuxW2uK 
2ux
2K
ux
K
ux

2  K x 0 K x 0 
K 1 K 1
1 1
Feven (u )   f (2 x)WKux , Fodd (u )   f (2 x  1)WKux
K x 0 K x 0
1
 
F (u )  Feven (u )  Fodd (u )W2uK , (WMu  M  WMu , W2uM M  W2uM )
2
1

F (u  K )  Feven (u )  Fodd (u )W2uK
2

67
4. Image Enhancement in the Frequency Domain

Implementation (cont’)
 the Fast Fourier Transform (cont’)
 total computational counting

M  2n  2 K
m(n)  2m(n  1)  2n1 , (n  1)
a(n)  2a(n  1)  2n , (n  1)

1
m(n)  M log 2M ,
2
a(n)  M log 2M

M2 M
C (M )  M
 M
, (M  2n )
M log 2 log 2
computational advantage of the FFT over
2n
C ( n)  a direct implementation of the 1-D DFT
n

68

You might also like