You are on page 1of 19

1/21/2009

1
Chapter 2 :
Enhancement
Part 2 : Fourier Transform& Filters
Dr. Hojeij youssef
Digital image processing
1
Chapter 2 : Part 2
Fourier andimage:
Fourier transformFT
AnalogFT :
AnalogFT 1Dcase
AnalogFT 2Dcase
Digital FT:
Digital FT 1Dcase
Digital FT 2Dcase
Propertiesof DFT
DFT applications
Discretecosinetransformation(DCT)
Maskandconvolution
Dr. Hojeij youssef
2
1/21/2009
2
Fourier and image
Dr. Hojeij youssef
3
What is afrequency in an image?
Low frequencies : homogeneous, regions, blur
High frequency : Edges, sudden changeof intensity, noise
High Frequency
Lowfrequency
Rem: Thelargest energy of theany pictureis located in thelow frequencies
Fourier
T, T-1 exist
Good properties in transformdomain : using thetransformdomain is a
better way to solveproblems
Find bases : exp, sin, cos, wavelets (chooseyour family of functions)
Dr. Hojeij youssef
4
Spatial domain Transformdomain
1/21/2009
3
Fourier
Functionfunction
FT is an easy tool. It was sometimes difficult to compute, calculatethecoefficients.
Now it s easy with computers.
Gives properties of spectrum: frequencies.
Ex : If largenumber of low frequencies means smoothed signal, low varying signal.
Dr. Hojeij youssef
5
Used to filter
Systeminterpretation :
spatial domain
convolution
frequency domain
multiplication
FT : analog1D case
Let f(x) be a continuous function of a real variable x. The Fourier
transformisdefinedby:
Given F(u), f(x) can beobtained using theinverseFourier transform:
Conditions :
- f(x) continuous & integrable
- F(u) integrable
Dr. Hojeij youssef
6
1/21/2009
4
FT analog1D case
If weareconcerned with real valued functions f(x)
Dr. Hojeij youssef
7
Fourier or frequency domain
complex
Direct domain
real
-| F(u) | Fourier spectrum(magnitudefunction)
-| F(u)| Power spectrum(spectral density)
-(u) phaseangle
-u frequency
FT : example
Dr. Hojeij youssef
8
1/21/2009
5
FT analog 2D case
TheFT caneasilyextendedtoafunctionf(x,y) of 2variables:
GivenF(u,v), f(x,y) canbeobtainedusingtheinverseFourier transform:
Dr. Hojeij youssef
9
Conditions :
-f(x,y) continuous & integrable
-F(u,v) integrable
FT analog 2D Case
If weareconcerned with real valued functions f(x,y)
Dr. Hojeij youssef
10
-| F(u,v) | Fourier spectrum(magnitudefunction)
-| F(u,v)| Power spectrum(spectral density)
-(u,v) phaseangle
-u,v frequency variable
Direct domain
real
Fourier or frequency domain
complex
1/21/2009
6
FT 2D Example
Dr. Hojeij youssef
11
FT 2D Example
Dr. Hojeij youssef
12
1/21/2009
7
FT 2D Example
Dr. Hojeij youssef
13
DiscreteFourier transform(DFT)
Let f(x) isdiscretizedintoasequencebytakingN samplesxunitsapart:
If we set f(x)=f(x0+xx) where x now assumes discrete values :
0,1,2,3,,N-1
- This sequence denotes any uniformspaced samples froma corresponding
continuous
- RememberShannonstheorembeforesamplingasignal. fe>2fmax
Dr. Hojeij youssef
14
1/21/2009
8
DFT : 1D case
TheDFT is defined by :
Rem:
- the values of u=1,2,,N -1 in the DFT correspond to samples of the
continuoustransformsat values0, u, 2u, , (N-1) u
- F(u) representsF(uu)
Dr. Hojeij youssef
15
DFT : 2D case
TheDFT 2Disdefinedby:
Dr. Hojeij youssef
16
Rem:
- Thesampling is on a2D grid
- Sampling increments in spatial and frequency domain
1/21/2009
9
DFT : 2D case
Normalizationcoefficient :
Dr. Hojeij youssef
17
Properties of DFT
Most 2D DFT proprietiesarestraightforwardextendfromthe1D DFT
properties
1. Separability:
The2DFourier transformcanbeperformedasseriesof 1DDFT(complexexponential is
separable)
Rem: performthe1DDFT onyvariable(axis) firstF(x,v), andthenperformthe1D
DFT onxvariableF(u,v)
Dr. Hojeij youssef
18
1/21/2009
10
Properties of DFT
2. Scaling:
Foranyconstantsaandb:
3. Shifting:
Shiftingthefunctionf(x,y) resultsinaphaseshiftintheFT :
4. Modulation:
The complement of the previous property-multiplying by a complex exponential. ie
modulationresultsinashiftof theFT
5. Convolution:
Convolutionof twofunctioncorrespondstoamultiplicationof theirFTs
Dr. Hojeij youssef
19
)
b
v
,
a
u
( F
ab
1
) by , ax ( f
) v , u ( F e ) y y , x x ( f
) vy ux ( 2 j
0 0
0 0
+
+ +

) v v , u u ( F ) y , x ( f e
0 0
) y v x u ( 2 j
0 0

+
) v , u ( H ) v , u ( H ) v , u ( G
dy dx ) y , x ( f ) y y , x x ( h ) y , x ( h ) y , x ( f ) y , x ( g
' ' ' ' ' '
=
= - =
} }
+

+

Properties of DFT
6. Multiplication:
MultiplyingtwofunctioncorrespondstoconvolvingtheirsFts:
7. Rotation:
Usingthepolar coordinates:
Rotatinganimagef(r,) byanangle rotatestheFT F(u,v) bythesameangle
8. Averagevalue:
Tofindaveragenumber scaleof anMN imagef(x,y)
Dr. Hojeij youssef
20
) v , u ( H ) v , u ( F
) y , x ( h ) y , x ( f ) y , x ( g
-
=


sin w v & cos w u
sin r y & cos r x
= =
= =
) , w ( F ) , r ( f
0 0
+ +
0

) 0 , 0 ( F
MN
1
) y , x ( f
MN
1
) y , x ( f
1 M
1 M
1 N
1 N
= =

1/21/2009
11
Properties of DFT
Dr. Hojeij youssef
21
Properties of DFT
9. Periodicity:
Moving the zero-frequency component to the center of the array. It is useful for
visualizingaFourier transformwiththezero-frequencycomponent inthemiddleof the
spectrum.
Dr. Hojeij youssef
22
) n , m M ( f ) n , m ( f
) v N , u ( F ) v , u ( F
=
=
) n N , m ( f ) n , m ( f
) v , u M ( F ) v , u ( F
=
=
) v , u ( F ) v bN , u aM ( F = + + ) n , m ( f ) n bN , m aM ( f = + +
1/21/2009
12
Examples of DFT
Dr. Hojeij youssef
23
Examples of DFT
Dr. Hojeij youssef
24
1/21/2009
13
DFT applications
Dr. Hojeij youssef
25
Filtering:
Spacefilteringisdonebyconvolution. Inthefieldspectral (frequency), it is
donebymultiplication(hidingtheimage).
original image Image transformed
Filtered image
Image transformed
Filtered
Spectral filtering
(multiplication)
Filtering Spatial
(convolution)
DFT applications
Dr. Hojeij youssef
26
spectral
filtering
1/21/2009
14
DFT applications
Dr. Hojeij youssef
27
Information percentageof theimageincluded in thecircles (smallest to largest) :
90% 95% 98% 99% 99.5% 99.9%
DFT applications
Dr. Hojeij youssef
28
High-passfilter : Low-passfilter :
Removes the high frequencies by putting the
pixelsawayfromthecentertozero
Removes thebass frequencies by puttingthe
pixels in thecenter to zero
1/21/2009
15
DFT applications
Dr. Hojeij youssef
29
De-noisingimage:
Noisy image
Fourier spectrum
Filtered image
DFT applications
Dr. Hojeij youssef
30
Contrastmodification(Enhancement):
Original image
High-pass filtering
Imageenhanced
Filtered image
(High Pass)
Original image
Imageenhanced
Enhanced +
Equalization Histogram
1/21/2009
16
DCT isdefinedby:
DCT(Discrete Cosine transformation)
Dr. Hojeij youssef
31
Example DCT
Dr. Hojeij youssef
32
1/21/2009
17
Example DCT
Dr. Hojeij youssef
33
Example DCT
Dr. Hojeij youssef
34
1/21/2009
18
Numerical convolution
Dr. Hojeij youssef
35
Thediscreteconvolution is a tool to usefilters or linear filter travel
invariants .
Thegeneral equation of convolution, noted g(x), original function f(x)
with a function h(x) is :
f(x) is theoriginal function and g(x) is theconvoluted function (result
of convolution).
In our case, an imageis seen as amathematical function
h(x) is called convolution mask, convolution kernel, filter, kernel, ...

= - =
k
) k ( f ) k x ( h ) x ( h ) x ( f ) x ( g
Numerical convolution
Dr. Hojeij youssef
36
In practice, theconvolution of a digital imagemadeby a summons
multiplication
A convolution filter is usually a matrix (image), his sizeis not always odd
and symmetrical
3x3, 5x5, 7x7, ...
Convolution of an imagethrough afilter (kernel) 2D :

=
- =
u v
'
'
) v , u ( filter ) v j , u i ( I ) j , i ( I
) j , i ( filtre ) j , i ( I ) j , i ( I
1/21/2009
19
Numerical convolution
Dr. Hojeij youssef
37
Kernel
Image
Result of
convolution, I by
the kernel K
Numerical convolution
Dr. Hojeij youssef
38
Image
Solution : No miraclesolution
1. edges (0)
2. Mirror effect : f (-x, y) = f (x, y)
Problem: What to do with theedges of theimage?

You might also like