[go: up one dir, main page]

100% found this document useful (1 vote)
326 views34 pages

Filtering in The Frequency Domain

1. Any periodic or finite function can be represented as a sum of sines and cosines multiplied by coefficients, known as a Fourier series or Fourier transform. 2. Filtering in the frequency domain involves taking the Fourier transform of an image, multiplying it by a filter function, and taking the inverse Fourier transform. Common filters include low-pass, high-pass, and Laplacian filters. 3. Low-pass filters attenuate high frequencies, smoothing an image. High-pass filters do the opposite, sharpening edges. Laplacian filters detect edges by applying a second derivative filter.

Uploaded by

K.R.Raguram
Copyright
© Attribution Non-Commercial (BY-NC)
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
100% found this document useful (1 vote)
326 views34 pages

Filtering in The Frequency Domain

1. Any periodic or finite function can be represented as a sum of sines and cosines multiplied by coefficients, known as a Fourier series or Fourier transform. 2. Filtering in the frequency domain involves taking the Fourier transform of an image, multiplying it by a filter function, and taking the inverse Fourier transform. Common filters include low-pass, high-pass, and Laplacian filters. 3. Low-pass filters attenuate high frequencies, smoothing an image. High-pass filters do the opposite, sharpening edges. Laplacian filters detect edges by applying a second derivative filter.

Uploaded by

K.R.Raguram
Copyright
© Attribution Non-Commercial (BY-NC)
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/ 34

FILTERING IN THE FREQUENCY

DOMAIN
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
coefficients.
This sum is called a Fourier
series.
Fourier Series
A function that is not periodic but
the area under its curve is finite
can be expressed as the integral of
sines and/or cosines multiplied by
a weighing function. The
formulation in this case is Fourier
transform.
Fourier Transform
g t k t h t
M
k t m h m
m
M
( ) ( ) * ( ) ( ) ( ) = =
=

1
0
1
h(t)
g(t) k(t)
g(t) = k(t)*h(t)
G(f) = K(f)H(f)
-1
1
t
h(t)
1
2
3
t
k(t)
1 2 3
* is a convolution operator and not multiplication
Convolution
Correlation
Types of filtering
Low pass Filtering
Ideal low-pass filter and
Butterworth low-pass filter
Gaussian Low Pass Filter
High-pass Filtering
Ideal high-pass filter
Butterworth high-pass filter
Gaussian high-pass filter
Laplacian Filtering
Homomorphic filtering
1. Multiply the input image by (-1)
x+y
to center the transform
2. Compute F(u,v), the DFT of the image from (1)
3. Multiply F(u,v) by a filter function H(u,v)
4. Compute the inverse DFT of the result in (3)
5. Obtain the real part of the result in (4)
6. Multiply the result in (5) by (-1)
x+y

Basic Filtering in the Frequency Domain
function Normalized_DFT = Img_DFT(img)
img=double(img); % So mathematical operations can be conducted on
% the image pixels.
[R,C]=size(img);
for r = 1:R % To phase shift the image so the DFT will be
for c=1:C % centered on the display monitor
phased_img(r,c)=(img(r,c))*(-1)^((r-1)+(c-1));
end
end
fourier_img = fft2(phased_img); %Discrete Fourier Transform
mag_fourier_img = abs(fourier_img ); % Magnitude of DFT
Log_mag_fourier_img = log10(mag_fourier_img +1);
Max = max(max(Log_mag_fourier_img ));
Normalized_DFT = (Log_ mag_fourier_img )*(255/Max);
imshow(uint8(Normalized_DFT))
Basic Filtering in the Frequency Domain using
Matlab
Filtering out the DC Frequency Component

=
=
1
) 2 / , 2 / ( ) , ( if 0
) , (
N M v u
v u H
otherwise
Notch Filter
Filtering out the DC Frequency Component
Low Pass Filter
attenuate high
frequencies while
passing low
frequencies.
High Pass Filter
attenuate low
frequencies while
passing high
frequencies.
Low-pass and High-pass Filters
Circular symmetry
Gaussian Low-pass and High-pass Filters
| |
2 / 1
2 2
0
0
) 2 / ( ) 2 / ( ) , (
) , ( if 0
) , ( if 1
) , (
N v M u v u D
D v u D
D v u D
v u H
+ =

>
s
=
Smoothing Frequency Domain, Ideal Low-pass
Filters
(

=
=

=
u v
T
M
u
N
v
T
P v u F
v u F P
/ ) , ( 100
) , (
1
0
1
0
2
o
Total Power
The remained percentage
power after filtration
Smoothing Frequency Domain, Ideal Low-pass
Filters
f
c
=5
o = 92%
f
c
=15
o = 94.6%
f
c
=30
o = 96.4%
f
c
=80
o = 98%
f
c
=230
o = 99.5%
Smoothing Frequency Domain, Ideal Low-pass
Filters
| |
n
D v u D
v u H
2
0
/ ) , ( 1
1
) , (
+
=
Smoothing Frequency Domain, Butterworth
Low-pass Filters
Smoothing Frequency Domain, Butterworth
Low-pass Filters
Radii= 5
Radii= 15
Radii= 30
Radii= 80
Radii= 230
Butterworth Low-pass
Filter: n=2
Smoothing Frequency Domain, Butterworth
Low-pass Filters
2
0
2
2 / ) , (
) , (
D v u D
e v u H

=
Smoothing Frequency Domain, Gaussian Low-
pass Filters
Smoothing Frequency Domain, Gaussian Low-
pass Filters
Original
image
Result of filtering
with Gaussian filter
with cutoff radius 5
Result of filtering
with Gaussian filter
with cutoff radius 30
Result of filtering
with Gaussian filter
with cutoff radius
230
Result of filtering
with Gaussian
filter with cutoff
radius 85
Result of filtering
with Gaussian
filter with cutoff
radius 15
Smoothing Frequency Domain, Gaussian Low-
pass Filters
Smoothing Frequency Domain, Gaussian Low-
pass Filters
Smoothing Frequency Domain, Gaussian Low-
pass Filters
H
hp
(u,v) = 1 - H
lp
(u,v)
Sharpening Frequency Domain Filters
Sharpening Frequency Domain Filters

>
s
=
) , ( if 1
) , ( if 0
) , (
0
0
D v u D
D v u D
v u H
Sharpening Frequency Domain, Ideal High-
pass Filters
| |
n
v u D D
v u H
2
0
) , ( / 1
1
) , (
+
=
Sharpening Frequency Domain, Butterworth
High-pass Filters
2
0
2
2 / ) , (
1 ) , (
D v u D
e v u H

=
Sharpening Frequency Domain, Gaussian
High-pass Filters
The Laplacian in the Frequency Domain
) ( ) , (
2 2
v u v u H + =
2 2
( , ) ( / 2) ( / 2) H u v u M v N ( = +

The FT of n-order differential of a function f(x) is
( ) / ( ) ( )
n n n
d f x dx ju F u ( =

2 2
2 2 2 2 2
2 2
( , ) ( , )
[ ( , )] [ ] ( ) ( , ) ( ) ( , ) ( ) ( , )
f x y f x y
f x y ju F u v jv F u v u v F u v
x y
c c
V = + = + = +
c c
For a two-dimensional function f(x,y), it can be shown that
So, Laplacian can be implemented in the frequency domain by using the filter
Shift the center to (M/2, N/2) and obtain
We have the following Fourier transform pairs
2 2 2
( , ) ( / 2) ( / 2) ( , ) f x y u M v N F u v ( V +

The plot of Laplacian in frequency and spatial domain
Laplacian in
the frequency
domain
2-D image of
Laplacian in the
frequency domain
Inverse DFT
of Laplacian
in the
frequency
domain
Zoomed
section of the
image on the
left compared
to spatial filter
Homomorphic Filtering
Homomorphic filtering is a method in which the illumination
and reflectance components can be filtered individually
Homomorphic Filtering
References

1. Digital Image Processing by Rafael C. Gonzalez
& Richard E. Woods, (2002)
Thank you

You might also like