8/3/2019 Chap4IEFD [Compatibility Mode]
1/42
ImageEnhancement
inFrequencyDomainProf. D. S. Pandya
Computer Dept.U. V. Patel College of Engg.Mahesana
1
8/3/2019 Chap4IEFD [Compatibility Mode]
2/42
ImageEnhancementin
requency oma n
Ima eEnhancementinS atialDomainvs.
ImageEnhancementinFrequencyDomain
our er er es
FourierTransform
2
8/3/2019 Chap4IEFD [Compatibility Mode]
3/42
Background: Fourier SeriesBackground: Fourier Series
An eriodic si nals can beFourier series:
viewed as weighted sum
of sinusoidal signals withdifferent frequencies
Frequency Domain:view frequency as anindependent variable
(Images from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition.
8/3/2019 Chap4IEFD [Compatibility Mode]
4/42
Fourier Tr. and Frequency DomainFourier Tr. and Frequency Domain
Time, spatial FrequencyFourier Tr.
DomainSignals DomainSignalsInv Fourier Tr.
1-D, Continuous case
= dxexfuF uxj 2)()(Fourier Tr.:
= dueuFxf uxj 2)()(Inv. Fourier Tr.:
8/3/2019 Chap4IEFD [Compatibility Mode]
5/42
Fourier Tr. and Frequency Domain (cont.)Fourier Tr. and Frequency Domain (cont.)
-
=
=1
/2)(
1)(
MMuxj
exfuFFourier Tr.:
u= 0,,M-1
Inv. Fourier Tr.:
=1
/2)()(
MMuxj
euFxf
x= 0,,M-1=0u
F(u) can be written as)(
)()(uj
euFuF=or)()()( ujIuRuF +=
22uIuRuF +=
= )(
tan)(1 uI
uu
8/3/2019 Chap4IEFD [Compatibility Mode]
6/42
Example of 1Example of 1--D Fourier TransformsD Fourier Transforms
Notice that the longer
the time domain signal,The shorter its Fouriertransform
(Images from Rafael C. Gonzalez and Richard
Wood, Digital Image Processing, 2nd Edition.
8/3/2019 Chap4IEFD [Compatibility Mode]
7/42
Relation BetweenRelation Betweenx andx anduu
between samples in f(x) and let frequency resolution ube spacebetween frequencies components in F(u), we have
u = 1
Example: for a signal f(x) with sampling period 0.5 sec, 100 poin
Hz02.01
==u5.0100
apart by 0.02 Hertz or more.
8/3/2019 Chap4IEFD [Compatibility Mode]
8/42
22--Dimensional Discrete Fourier TransformDimensional Discrete Fourier Transform
2-D DFT
=
=
+=0 0
)//(2),(1
),(x y
NvyMuxjeyxfMN
vuF
u= frequency in xdirection, u= 0 ,, M-1
v= frequency in ydirection, v= 0 ,, N-1
2-D IDFT
+=1 1
)//(2),(),(
M NNvyMuxj
evuFyxf
= =u vx= 0 ,, M-1
y= 0 ,, N-1
8/3/2019 Chap4IEFD [Compatibility Mode]
9/42
22--Dimensional Discrete Fourier Transform (cont.)Dimensional Discrete Fourier Transform (cont.)
F(u,v) can be written as
),( vujevuFvuF
=orvuIvuRvuF +=
whereuI
,,, vuvuvu +=
= ),(
tan,vuR
vu
For the purpose of viewing, we usually display only the,
8/3/2019 Chap4IEFD [Compatibility Mode]
10/42
forconvenience.Itcanbevisualizedas
WhereWiskernel,WN istheNth
root
10
8/3/2019 Chap4IEFD [Compatibility Mode]
11/42
TheinverseDFTcanbewrittenas
11
8/3/2019 Chap4IEFD [Compatibility Mode]
12/42
x={1289}
So ution:N=4, ence
12
8/3/2019 Chap4IEFD [Compatibility Mode]
13/42
= ,
(t)isdefinedas
Animpulsehassiftingpropertywithrespecttointegration,
13
8/3/2019 Chap4IEFD [Compatibility Mode]
14/42
14
8/3/2019 Chap4IEFD [Compatibility Mode]
15/42
ConvolutionConvolution
Convolutionoftwofunctions
15
8/3/2019 Chap4IEFD [Compatibility Mode]
16/42
o econvo u ono wo unc ons n espatialdomainisequaltotheproductinthe
requency oma no o e wo unc ons.
Conversely,convolutioninfrequencydomainisanalogoustomultiplicationinthespatial
domain.
16
8/3/2019 Chap4IEFD [Compatibility Mode]
17/42
Example of 2Example of 2--D DFTD DFT
o ce a e onger e me oma n s gna ,
The shorter its Fourier transform (Images from Rafael C. Gonzalez and RichardWood, Digital Image Processing, 2nd Edition.
8/3/2019 Chap4IEFD [Compatibility Mode]
18/42
Example of 2Example of 2--D DFTD DFT
Notice that direction of an
object in spatial image andIts Fourier transform are
.
(Images from Rafael C. Gonzalez and RichardWood, Digital Image Processing, 2nd Edition.
8/3/2019 Chap4IEFD [Compatibility Mode]
19/42
Example of 2Example of 2--D DFTD DFT
2D DFT
Original image
8/3/2019 Chap4IEFD [Compatibility Mode]
20/42
Example of 2Example of 2--D DFTD DFT
2D DFT
Original image
8/3/2019 Chap4IEFD [Compatibility Mode]
21/42
Basic Concept of Filtering in the Frequency DomainBasic Concept of Filtering in the Frequency Domain
),(),(),(),(),(),( vuGvuHvuFyxhyxfyxg ==
We cam perform filtering process by using
Multiplication in the frequency domainis easier than convolution in the spatial
Domain.
(Images from Rafael C. Gonzalez and Richard E.Wood, Digital Image Processing, 2nd Edition.
8/3/2019 Chap4IEFD [Compatibility Mode]
22/42
Filtering in the Frequency Domain with FFT shiftFiltering in the Frequency Domain with FFT shift
F(u,v)H(u,v)
(User defined)g(x,y)
FFT shift2D IFFTX
2D FFT FFT shift
f(x,y) G(u,v)
In this case, F(u,v) and H(u,v) must have the same size anhave the zero frequency at the center.
8/3/2019 Chap4IEFD [Compatibility Mode]
23/42
Filtering in the Frequency Domain : ExampleFiltering in the Frequency Domain : Example
, ,which means that the zero frequencycomponent is removed.
Note: Zero frequency = average
intensity of an image (Images from Rafael C. Gonzalez and Richard E.Wood, Digital Image Processing, 2nd Edition.
8/3/2019 Chap4IEFD [Compatibility Mode]
24/42
Filtering in the Frequency Domain : ExampleFiltering in the Frequency Domain : Example
Lowpass Filter
Highpass Filter
(Images from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition.
8/3/2019 Chap4IEFD [Compatibility Mode]
25/42
Filter Masks and Their Fourier TransformsFilter Masks and Their Fourier Transforms
(Images from Rafael C. Gonzalez and RichardWood, Digital Image Processing, 2nd Edition.
8/3/2019 Chap4IEFD [Compatibility Mode]
26/42
Ideal Lowpass FilterIdeal Lowpass Filter
Ideal LPF Filter Transfer function
= 0),(1
),(DvuD
vuH0
,
where D(u,v) = Distance from (u,v) to the center of the mask.
Ima es from Rafael C. Gonzalez and Richard E. . .
Wood, Digital Image Processing, 2nd Edition.
8/3/2019 Chap4IEFD [Compatibility Mode]
27/42
Examples of Ideal Lowpass FiltersExamples of Ideal Lowpass Filters
Ima es from Rafael C. Gonzalez and Richard E.
Wood, Digital Image Processing, 2nd Edition.
The smaller D0, the more high frequency components are remo
8/3/2019 Chap4IEFD [Compatibility Mode]
28/42
Results of Ideal Lowpass FiltersResults of Ideal Lowpass Filters
obviously seen!
(Images from Rafael C. Gonzalez and Richard E.Wood, Digital Image Processing, 2nd Edition.
8/3/2019 Chap4IEFD [Compatibility Mode]
29/42
How ringing effect happensHow ringing effect happens
>=
0
0
),(0
,),(
DvuD
vuvuH
Surface Plot
0.8
1
Ideal Lowpass Filterwith D0= 5 0.2
0.4
0.6
0
200
20
0
-20-20Abrupt change in the amplitude
8/3/2019 Chap4IEFD [Compatibility Mode]
30/42
How ringing effect happens (cont.)How ringing effect happens (cont.)
Surface Plot
x 10-3
5
10
15
Spatial Response of IdealLow ass Filter with D = 5
20
0
-20
0
20
-20
0
Ripples that cause ringing effect
8/3/2019 Chap4IEFD [Compatibility Mode]
31/42
How ringing effect happens (cont.)How ringing effect happens (cont.)
(Images from Rafael C. Gonzalez and RichardWood, Digital Image Processing, 2nd Edition.
8/3/2019 Chap4IEFD [Compatibility Mode]
32/42
Butterworth Lowpass FilterButterworth Lowpass Filter
Transfer function
NDvuD
vuH2
/,1
1),(
+=
Where D0= Cut off frequency, N= filter order.
(Images from Rafael C. Gonzalez and Richard E.Wood, Digital Image Processing, 2n Edition.
R l f B h L FilR l f B h L Fil
8/3/2019 Chap4IEFD [Compatibility Mode]
33/42
Results of Butterworth Lowpass FiltersResults of Butterworth Lowpass Filters
There is less ringing
effect compared tothose of ideal lowpass
ers
(Images from Rafael C. Gonzalez and Richard
Wood, Digital Image Processing, 2nd Edition.
8/3/2019 Chap4IEFD [Compatibility Mode]
34/42
GaussianLowPassFilter
34
8/3/2019 Chap4IEFD [Compatibility Mode]
35/42
GaussianLowPassFilter
35
Highpass FiltersHighpass Filters
8/3/2019 Chap4IEFD [Compatibility Mode]
36/42
Highpass FiltersHighpass Filters
Hhp= 1 - Hlp
(Images from Rafael C. Gonzalez and Richard
Wood, Digital Image Processing, 2nd Edition.
8/3/2019 Chap4IEFD [Compatibility Mode]
37/42
HighPassFilters
37
d l h l
8/3/2019 Chap4IEFD [Compatibility Mode]
38/42
IdealHighPassFilter
38
h i h il
8/3/2019 Chap4IEFD [Compatibility Mode]
39/42
ButterworthHighPassFilter
39
G i Hi h P Fil
8/3/2019 Chap4IEFD [Compatibility Mode]
40/42
GaussianHighPassFilter
40
Laplacian Filter in the Frequency DomainLaplacian Filter in the Frequency Domain
8/3/2019 Chap4IEFD [Compatibility Mode]
41/42
Laplacian Filter in the Frequency DomainLaplacian Filter in the Frequency Domain
nFrom Fourier Tr. Property:)(uFju
dxn
n
Then for Laplacian operator
( ) ),(2222
2
2
2 vuFvuy
f
x
ff +
+
=
( )222 vu +We get
Image of(u2+v2)
(Images from Rafael C. Gonzalez and Richard
Wood, Digital Image Processing, 2nd Edition.Surface plot
Laplacian Filter in the Frequency Domain (cont )Laplacian Filter in the Frequency Domain (cont )
8/3/2019 Chap4IEFD [Compatibility Mode]
42/42
Laplacian Filter in the Frequency Domain (cont.)Laplacian Filter in the Frequency Domain (cont.)
Spatial response of (u2+v2) Cross section
Laplacian mask in Chapter 3