ImageEnhancementin FrequencyDomain F D i
ImageEnhancementinSpatialDomainvs. g p ImageEnhancementinFrequencyDomain FourierSeries Fourier Series FourierTransform
Fourier series: Any periodic signals can be yp g viewed as weighted sum of sinusoidal signals with different frequencies Frequency Domain: view frequency as an independent variable
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
F (u ) = f ( x) =
f ( x )e
j 2ux
dx
F ( u )e
j 2ux
du
Fourier Tr. and Frequency Domain (cont.) 1 D, 1-D, Discrete case Fourier Tr.: Inv. Fourier Tr.:
1 F (u ) = M f ( x) =
M 1 u =0
M 1 x =0 =0
f ( x )e
j 2ux / M
u = 0,,M-1 x = 0,,M-1
F (u )e j 2ux / M
F (u ) = R(u ) + jI (u )
where
or
F (u ) = F (u ) e j ( u )
I (u ) (u ) = tan R( ) (u
1
F (u ) = R (u ) + I (u )
2
Notice that the longer the time domain signal, The shorter its Fourier transform
(Images from Rafael C. Gonzalez and Richard Wood, Digital Image Processing, 2nd Edition.
1 u = M Mx
Example: for a signal f(x) with sampling period 0.5 sec, 100 point we will get frequency resolution equal to
2-Dimensional Discrete Fourier Transform For an image of size MxN pixels 2-D DFT
1 F ( u, v ) = MN
M 1 N 1
x =0 y =0
f ( x, y )e j 2 ( ux / M + vy / N )
2-D IDFT
f ( x, y ) =
M 1 N 1 u =0 v =0
F (u, v )e
j 2 ( ux / M + vy / N )
x = 0 ,, M-1 y = 0 ,, N-1
2-Dimensional Discrete Fourier Transform (cont.) F(u,v) can be written as or F (u, v ) = F (u, v ) e j ( u ,v ) F ( u, v ) = R ( u, v ) + j ( u, v ) jI where
F ( u, v ) = R ( u, v ) + I ( u, v )
2
For the purpose of viewing, we usually display only the Magnitude part of F(u v) F(u,v)
Discrete Fourier Transform (cont.) DFT can be formulated as matrix operations DFTcanbeformulatedasmatrixoperations forconvenience.Itcanbevisualizedas WhereWiskernel,WN istheNth root
10
TheinverseDFTcanbewrittenas
11
Discrete Fourier Transform (cont.) Example: Apply DFT to following sequence Example:ApplyDFTtofollowingsequence x={1289} Solution:N=4,hence S l i h
12
Impulses and shifting property A unit impulse of t located at t=0 denoted as Aunitimpulseoft,locatedatt=0denotedas (t)isdefinedas
Animpulsehassiftingpropertywithrespect tointegration,
13
14
Convolution Convolutionoftwofunctions
15
Convolution FT of the con ol tion of t o f nctions in the FToftheconvolutionoftwofunctionsinthe spatialdomainisequaltotheproductinthe frequencydomainofFTofthetwofunctions. frequency domain of FT of the two functions Conversely,convolutioninfrequencydomain isanalogoustomultiplicationinthespatial domain.
16
Notice that th l N ti th t the longer th ti the time d domain signal, i i l The shorter its Fourier transform
(Images from Rafael C. Gonzalez and Richard Wood, Digital Image Processing, 2nd Edition.
Notice that direction of an object in spatial image and Its Fourier transform are orthogonal to each other other.
(Images from Rafael C. Gonzalez and Richard Wood, Digital Image Processing, 2nd Edition.
2D DFT
Original image
2D FFT Shift
2D DFT
Original image
2D FFT Shift
g ( x , y ) = f ( x , y ) h ( x , y ) F ( u, v ) H ( u, v ) = G ( u, v )
We cam perform filtering process by using
Multiplication in the frequency domain is easier than convolution in the spatial Domain.
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
FFT shift
2D IFFT
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 and have the zero frequency at the center.
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
Lowpass Filter
Highpass Filter
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
(Images from Rafael C. Gonzalez and Richard Wood, Digital Image Processing, 2nd Edition.
1 H (u, v ) = 0
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
( (Images from Rafael C. Gonzalez and Richard E. g Wood, Digital Image Processing, 2nd Edition.
The smaller D0, the more high frequency components are remov
(Images from Rafael C. Gonzalez and Richard E. Wood, Digital Image Processing, 2nd Edition.
Surface Plot
x 10
-3
15
10 5 0
20
20 -20 0 -20
(Images from Rafael C. Gonzalez and Richard Wood, Digital Image Processing, 2nd Edition.
(Images from Rafael C. Gonzalez and Richard E. d Edition. Wood, Digital Image P W d Di it l I Processing, 2nd Editi i
There is less ringing effect compared to those of ideal lowpass filters! filt !
(Images from Rafael C. Gonzalez and Richard Wood, Digital Image Processing, 2nd Edition.
GaussianLowPassFilter
34
GaussianLowPassFilter
35
Highpass Filters
Hhp = 1 - Hlp
(Images from Rafael C. Gonzalez and Richard Wood, Digital Image Processing, 2nd Edition.
HighPassFilters
37
IdealHighPassFilter
38
ButterworthHighPassFilter
39
GaussianHighPassFilter
40
Image of (u2+v2)
Surface plot
(Images from Rafael C. Gonzalez and Richard Wood, Digital Image Processing, 2nd Edition.