Frequency Domain Filtering Frequency Domain Filtering y Correspondence between Spatial and Frequency Filtering y Fourier Transform y Brief Introduction y Sampling Theory y 2‐D Discrete Fourier Transform y Convolution y Spatial Aliasing y Spatial Aliasing y Frequency domain filtering fundamentals y Applications y Image smoothing y Image sharpening y Selective filtering Selective filtering
23
Embed
Frequency domain filtering finalkmlee.gatech.edu/me6406/Frequency domain filtering (SH Foong).pdf · Frequency Domain Filtering yCorrespondence between Spatial and Frequency Filtering
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Frequency Domain FilteringFrequency Domain Filtering
Correspondence between Spatial and Frequency Filtering
Fourier TransformBrief IntroductionSampling Theoryp g y2‐D Discrete Fourier Transform
In image processing f(x y) is a digital image of size N x M
DFT: ( ) ( )0 0
, ,x y
F u v f x y e ⎝ ⎠
= =
= ∑∑ x,y=0,1,2,…,M‐1
In image processing, f(x,y) is a digital image of size N x M
Image Processing: x,y are spatial variables and u,v are ‘spatial frequency’ variables
Translation & Rotation
Periodicity
Symmetry
And….
Also known as 2‐D circular convolution
( ) ( ) ( ) ( )1 1
0 0
, , . ,M N
m n
f x y h x y f m n h x m y n− −
= =
∗ = − −∑∑0,1,2,..., 1x M= −0,1,2,..., 1y N= −
As with 1‐D case,
0 0m 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ℑ ∗ =⎡ ⎤⎣ ⎦
The latter expression is the foundation of linear filt i i th f d i
( ) ( ) ( ) ( ), , , ,f x y h x y F u v H u vℑ ∗ =⎡ ⎤⎣ ⎦
filtering in the frequency domain.
Before foraging into frequency domain filtering, lets do a quick digress into aliasing in digital imaging
What is Aliasing?High frequency components “masquerading” as lower High frequency components masquerading as lower frequencies
Temporal Aliasing
Pertains to time intervals between images in a sequencePertains to time intervals between images in a sequence
The “wagon wheel” effect
Capturing frame rate too low
Spatial AliasingSpatial Aliasing
Under‐sampling of scenes in digital images due to finite pixels
“Jaggies”
When image shrinking is achieved by row‐column deletion (reduce % b d l i h d l ) li i 50% by deleting ever other row and column), aliasing can occur
Reduce aliasing by first smoothing image before resampling
Or use interpolation during resampling (bicubic: done in photoshop)
Taking the DFT: ( ) ( ). , ( , )h x y f x y g x y∗ =Input imageFilter function Filtered image
Recall:
( ) ( ){ }. , ( , )h x y f x y G u vℑ ∗ =
( ) ( ) ( ) ( )f h F Hℑ ∗⎡ ⎤⎣ ⎦Filter TF
Recall:
We have: And finally,
( ) ( ) ( ) ( ), , , ,f x y h x y F u v H u vℑ ∗ =⎡ ⎤⎣ ⎦
( ) ( ), , ( , )F u v H u v G u v= y
( ) ( ){ }1( , ) , ,g x y F u v H u v−= ℑ
Hence, Filtering in the frequency domain requires altering the DFT of the input image and computing the IDFT to obtain the filtered/processed imagefiltered/processed image
Each term of F(u,v) contains all values of f(x,y) making f y gdirect association of component values to image properties difficult
H F( ) i i l However F(u=0,v=0) is proportional to average intensity of image
v Increasing rate of change of pixel intensities
u
F(u,v)
From ( ) ( ){ }1( , ) , ,g x y F u v H u v−= ℑ
If f is an impulse, ( )( , ) ( , ) , 1f x y x y F u vδ= ⇒ =
Then: where h(x,y) is a spatial filter( ){ } ( )1 , ,H u v h x y−ℑ =
As this filter is obtained from the response of a frequency domain filter to an impulse, h(x,y) is also called the impulse response of H(u v)impulse response of H(u,v).
And since filter contain only finite quantities , they are also called Finite Impulse Response (FIR)filters
Edges and noise contribute to the high‐frequency g gcomponents of an image’s FT
Smoothing or blurring is achieved by high‐frequency i attenuation
NF reject (or passes) frequencies in a predefined neighborhood about the center of the frequency rectangle
Constructed as products of highpass filters whose centers have been translated to the centers of the notcheshave been translated to the centers of the notches
( )1
, ( , ) ( , )Q
NR k kk
H u v H u v H u v−= ∏
where Hk(u,v) and H‐k(u,v) are HP filters centered at
1k−
(uk,vk) & (‐uk,‐vk)
Reducing unwanted patterns in gscanned newspaper images
Isolating and removing corruption caused by AC signals (vertical sinusoidal patterns)sinusoidal patterns)
Implementing filtering in frequency domaing g2‐D DFT and IDFT is computationally intensive
(MN)2 order of summations and additions
1024 x 1024 image would require ~ a trillion operations for 1 DFT1024 x 1024 image would require ~ a trillion operations for 1 DFT
Fast Fourier Transform (FFT)MNlog2(MN) operations
i ld i illi i1024 x 1024 image would require ~ 20 million operations
Filter design in frequency domainUse frequency domain for “prototyping” of filterUse frequency domain for prototyping of filter
Find equivalent spatial filter
Implement filter in spatial domain
Digital Image Processing using Matlab, R. C. g g g gGonzalez, R. E. Woods and S. Eddins, Prentice Hall, 2004
Digital Image Processing, R. C. Gonzalez and R. dE. Woods, Prentice Hall, 3rd Edition, 2008