freq filter
TRANSCRIPT
-
8/19/2019 Freq Filter
1/60
Course Website: http://www.comp.dit.ie/bmacnamee
Digital Image Processing
Image Enhancement:
Filtering in the Frequency Domain
http://www.comp.dit.ie/bmacnameehttp://www.comp.dit.ie/bmacnamee
-
8/19/2019 Freq Filter
2/60
-
8/19/2019 Freq Filter
3/60
2
o!
"#$he %ig Idea cont31
4otice how we get closer and closer to the
original !unction as we add more and more!requencies
$ a * e n ! r o m w w w . t ! h 5 b e r l i n . d e / 6 s c h w e n * / h o b b y / ! o u r i e r / W e l c o m e . h t m l
http://www.tfh-berlin.de/~schwenk/hobby/fourier/Welcome.htmlhttp://www.tfh-berlin.de/~schwenk/hobby/fourier/Welcome.htmlhttp://www.tfh-berlin.de/~schwenk/hobby/fourier/Welcome.htmlhttp://www.tfh-berlin.de/~schwenk/hobby/fourier/Welcome.htmlhttp://www.tfh-berlin.de/~schwenk/hobby/fourier/Welcome.htmlhttp://www.tfh-berlin.de/~schwenk/hobby/fourier/Welcome.htmlhttp://www.tfh-berlin.de/~schwenk/hobby/fourier/Welcome.htmlhttp://www.tfh-berlin.de/~schwenk/hobby/fourier/Welcome.htmlhttp://www.tfh-berlin.de/~schwenk/hobby/fourier/Welcome.htmlhttp://www.tfh-berlin.de/~schwenk/hobby/fourier/Welcome.htmlhttp://www.tfh-berlin.de/~schwenk/hobby/fourier/Welcome.htmlhttp://www.tfh-berlin.de/~schwenk/hobby/fourier/Welcome.htmlhttp://www.tfh-berlin.de/~schwenk/hobby/fourier/Welcome.htmlhttp://www.tfh-berlin.de/~schwenk/hobby/fourier/Welcome.htmlhttp://www.tfh-berlin.de/~schwenk/hobby/fourier/Welcome.htmlhttp://www.tfh-berlin.de/~schwenk/hobby/fourier/Welcome.htmlhttp://www.tfh-berlin.de/~schwenk/hobby/fourier/Welcome.htmlhttp://www.tfh-berlin.de/~schwenk/hobby/fourier/Welcome.htmlhttp://www.tfh-berlin.de/~schwenk/hobby/fourier/Welcome.htmlhttp://www.tfh-berlin.de/~schwenk/hobby/fourier/Welcome.htmlhttp://www.tfh-berlin.de/~schwenk/hobby/fourier/Welcome.htmlhttp://www.tfh-berlin.de/~schwenk/hobby/fourier/Welcome.htmlhttp://www.tfh-berlin.de/~schwenk/hobby/fourier/Welcome.htmlhttp://www.tfh-berlin.de/~schwenk/hobby/fourier/Welcome.htmlhttp://www.tfh-berlin.de/~schwenk/hobby/fourier/Welcome.htmlhttp://www.tfh-berlin.de/~schwenk/hobby/fourier/Welcome.htmlhttp://www.tfh-berlin.de/~schwenk/hobby/fourier/Welcome.htmlhttp://www.tfh-berlin.de/~schwenk/hobby/fourier/Welcome.htmlhttp://www.tfh-berlin.de/~schwenk/hobby/fourier/Welcome.htmlhttp://www.tfh-berlin.de/~schwenk/hobby/fourier/Welcome.htmlhttp://www.tfh-berlin.de/~schwenk/hobby/fourier/Welcome.htmlhttp://www.tfh-berlin.de/~schwenk/hobby/fourier/Welcome.htmlhttp://www.tfh-berlin.de/~schwenk/hobby/fourier/Welcome.htmlhttp://www.tfh-berlin.de/~schwenk/hobby/fourier/Welcome.htmlhttp://www.tfh-berlin.de/~schwenk/hobby/fourier/Welcome.htmlhttp://www.tfh-berlin.de/~schwenk/hobby/fourier/Welcome.htmlhttp://www.tfh-berlin.de/~schwenk/hobby/fourier/Welcome.htmlhttp://www.tfh-berlin.de/~schwenk/hobby/fourier/Welcome.htmlhttp://www.tfh-berlin.de/~schwenk/hobby/fourier/Welcome.htmlhttp://www.tfh-berlin.de/~schwenk/hobby/fourier/Welcome.htmlhttp://www.tfh-berlin.de/~schwenk/hobby/fourier/Welcome.htmlhttp://www.tfh-berlin.de/~schwenk/hobby/fourier/Welcome.htmlhttp://www.tfh-berlin.de/~schwenk/hobby/fourier/Welcome.htmlhttp://www.tfh-berlin.de/~schwenk/hobby/fourier/Welcome.htmlhttp://www.tfh-berlin.de/~schwenk/hobby/fourier/Welcome.htmlhttp://www.tfh-berlin.de/~schwenk/hobby/fourier/Welcome.htmlhttp://www.tfh-berlin.de/~schwenk/hobby/fourier/Welcome.htmlhttp://www.tfh-berlin.de/~schwenk/hobby/fourier/Welcome.htmlhttp://www.tfh-berlin.de/~schwenk/hobby/fourier/Welcome.htmlhttp://www.tfh-berlin.de/~schwenk/hobby/fourier/Welcome.htmlhttp://www.tfh-berlin.de/~schwenk/hobby/fourier/Welcome.htmlhttp://www.tfh-berlin.de/~schwenk/hobby/fourier/Welcome.htmlhttp://www.tfh-berlin.de/~schwenk/hobby/fourier/Welcome.html
-
8/19/2019 Freq Filter
4/60
#
o!
"#$he %ig Idea cont31
Frequencydomain signal
processing
e(ample in E(cel
-
8/19/2019 Freq Filter
5/60
"
o!
"#$he Discrete Fourier $rans!orm DF$1
$he Discrete Fourier Transform o! f(x, y) !or x &0 7 3M57 and y & 073 N57 denoted by
F(u, v), is gi8en by the equation:
!or u & 0 7 3M57 and v & 0 7 3 N57.
∑∑−
=
−
=
+−=1
0
1
0
)//(2),(),( M
x
N
y
N vy M ux je y x f vu F π
-
8/19/2019 Freq Filter
6/60
9
o!
"#DF$ - Images
$he DF$ o! a two dimensional image can be8isualised by showing the spectrum o! the
images component !requencies
I m a g e s t a * e n ! r o m +
o n , a l e , - W o o d s D i g i t a l
I m a g e P r o c e s s i n g 0 0 1
DFT
-
8/19/2019 Freq Filter
7/60
o!
"#DF$ - Images
I m a g e s t a * e n ! r o m +
o n , a l e , - W o o d s D i g i t a l
I m a g e P r o c e s s i n g 0 0 1
-
8/19/2019 Freq Filter
8/60
;
o!
"#DF$ - Images
I m a g e s t a * e n ! r o m +
o n , a l e , - W o o d s D i g i t a l I m a g e P r o c e s s i n g 0 0 1
-
8/19/2019 Freq Filter
9/60
<
o!
"#DF$ - Images cont31
I m a g e s t a * e n ! r o m +
o n , a l e , - W o o d s D i g i t a l I m a g e P r o c e s s i n g 0 0 1
DFT
=canning electron microscope
image o! an integrated circuitmagni!ied 6"00 times
Fourier spectrum o! the image
-
8/19/2019 Freq Filter
10/60
70
o!
"#DF$ - Images cont31
I m a g e s t a * e n ! r o m +
o n , a l e , - W o o d s D i g i t a l I m a g e P r o c e s s i n g 0 0 1
-
8/19/2019 Freq Filter
11/60
77
o!
"#DF$ - Images cont31
I m a g e s t a * e n ! r o m +
o n , a l e , - W o o d s D i g i t a l I m a g e P r o c e s s i n g 0 0 1
-
8/19/2019 Freq Filter
12/60
7
o!
"#$he In8erse DF$
It is really important to note that the Fouriertrans!orm is completely reversible
$he in8erse DF$ is gi8en by:
!or x & 0 7 3M57 and y & 0 7 3 N57
∑∑−
=
−
=
+=1
0
1
0
)//(2),(1),( M
u
N
v
N vy M ux jevu F MN
y x f π
-
8/19/2019 Freq Filter
13/60
72
o!
"#$he DF$ and Image Processing
$o !ilter an image in the !requency domain:7. Compute F(u,v) the DF$ o! the image
. >ultiply F(u,v) by a !ilter !unction H(u,v)
2. Compute the in8erse DF$ o! the result
I m a g e s t a * e n ! r o m +
o n , a l e , - W o o d s D i g i t a l I m a g e P r o c e s s i n g 0 0 1
-
8/19/2019 Freq Filter
14/60
7#
o!
"#=ome %asic Frequency Domain Filters
I m a g e s t a * e n ! r o m +
o n , a l e , - W o o d s D i g i t a l I m a g e P r o c e s s i n g 0 0 1
?ow Pass Filter
@igh Pass Filter
-
8/19/2019 Freq Filter
15/60
7"
o!
"#=ome %asic Frequency Domain Filters
I m a g e s t a * e n ! r o m +
o n , a l e , - W o o d s D i g i t a l I m a g e P r o c e s s i n g 0 0 1
-
8/19/2019 Freq Filter
16/60
79
o!
"#=ome %asic Frequency Domain Filters
I m a g e s t a * e n ! r o m +
o n , a l e , - W o o d s D i g i t a l I m a g e P r o c e s s i n g 0 0 1
-
8/19/2019 Freq Filter
17/60
7
o!
"#
7;
-
8/19/2019 Freq Filter
18/60
7;
o!
"#=moothing Frequency Domain Filters
=moothing is achie8ed in the !requency domainby dropping out the high !requency components
$he basic model !or !iltering is:
G(u,v) = H(u,v)F(u,v)
where F(u,v) is the Fourier trans!orm o! the
image being !iltered and H(u,v) is the !ilter
trans!orm !unction
Low pass filters ) only pass the low !requencies
drop the high ones
7
-
8/19/2019 Freq Filter
19/60
7<
o!
"#Ideal ?ow Pass Filter
=imply cut o!! all high !requency components thatare a speci!ied distance D0 !rom the origin o! the
trans!orm
changing the distance changes the beha8iour o!
the !ilter I m a g e s t a * e n ! r o m + o n , a l e , - W o o d s D i g i t a
l I m a g e P r o c e s s i n g 0 0
1
-
8/19/2019 Freq Filter
20/60
7
-
8/19/2019 Freq Filter
21/60
7
o!
"#
-
8/19/2019 Freq Filter
22/60
o!
"#Ideal ?ow Pass Filter cont31
'bo8e we show an image itAs Fourier spectrum
and a series o! ideal low pass !ilters o! radius "
7" 20 ;0 and 20 superimposed on top o! it
I m a g e s t a * e n ! r o m + o n , a l e , - W o o d s D i g i t a
l I m a g e P r o c e s s i n g 0 0
1
2
-
8/19/2019 Freq Filter
23/60
2
o!
"#Ideal ?ow Pass Filter cont31
I m a g e s t a * e n ! r o m + o n , a l e , - W o o d s D i g i t a
l I m a g e P r o c e s s i n g 0 0
1
#
-
8/19/2019 Freq Filter
24/60
#
o!
"#Ideal ?ow Pass Filter cont31
I m a g e s t a * e n ! r o m + o n , a l e , - W o o d s D i g i t a
l I m a g e P r o c e s s i n g 0 0
1
"
-
8/19/2019 Freq Filter
25/60
"
o!
"#Ideal ?ow Pass Filter cont31
I m a g e s t a * e n ! r o m + o n , a l e , - W o o d s D i g i t a
l I m a g e P r o c e s s i n g 0 0
1
Briginal
image
esult o! !ilteringwith ideal low pass
!ilter o! radius "
esult o! !iltering
with ideal low pass
!ilter o! radius 20
esult o! !iltering
with ideal low pass
!ilter o! radius 20
esult o! !iltering
with ideal low pass
!ilter o! radius ;0
esult o! !iltering
with ideal low pass
!ilter o! radius 7"
9
-
8/19/2019 Freq Filter
26/60
9
o!
"#Ideal ?ow Pass Filter cont31
I m a g e s t a * e n ! r o m + o n , a l e , - W o o d s D i g i t a
l I m a g e P r o c e s s i n g 0 0
1
esult o! !ilteringwith ideal low pass
!ilter o! radius "
-
8/19/2019 Freq Filter
27/60
;
-
8/19/2019 Freq Filter
28/60
o!
"#%utterworth ?owpass Filters
$he trans!er !unction o! a %utterworth lowpass!ilter o! order n with cuto!! !requency at distance
D0 !rom the origin is de!ined as:
I m a g e s t a * e n ! r o m
+ o n , a l e , - W o o d s D i g i t a l I m a g e P r o c e s s i n g 0 0
1
n Dvu Dvu H 20 ]/),([1
1
),( +=
-
8/19/2019 Freq Filter
29/60
o!
"#
20
% tt th ? Filt t 1
-
8/19/2019 Freq Filter
30/60
o!
"#%utterworth ?owpass Filter cont31
I m a g e s t a * e n ! r o m
+ o n , a l e , - W o o d s D i g i t a l I m a g e P r o c e s s i n g 0 0 1
Briginal
image
esult o! !ilteringwith %utterworth !ilter
o! order and cuto!!
radius "
esult o! !iltering
with %utterworth
!ilter o! order and
cuto!! radius 20
esult o! !iltering
with %utterworth !ilter
o! order and cuto!!
radius 20
esult o! !iltering with
%utterworth !ilter o!
order and cuto!!
radius ;0
esult o! !iltering with
%utterworth !ilter o!
order and cuto!!
radius 7"
27
% tt th ? Filt t 1
-
8/19/2019 Freq Filter
31/60
o!
"#%utterworth ?owpass Filter cont31
I m a g e s t a * e n ! r o m
+ o n , a l e , - W o o d s D i g i t a l I m a g e P r o c e s s i n g 0 0 1
Briginal
image
esult o! !iltering
with %utterworth !ilter
o! order and cuto!!
radius "
2
% tt th ? Filt t 1
-
8/19/2019 Freq Filter
32/60
o!
"#%utterworth ?owpass Filter cont31
I m a g e s t a * e n ! r o m
+ o n , a l e , - W o o d s D i g i t a l I m a g e P r o c e s s i n g 0 0 1
esult o! !iltering with%utterworth !ilter o!
order and cuto!!
radius 7"
22
+ i ? Filt
-
8/19/2019 Freq Filter
33/60
o!
"#+aussian ?owpass Filters
$he trans!er !unction o! a +aussian lowpass
!ilter is de!ined as:
I m a g e s t a * e n ! r o m
+ o n , a l e , - W o o d s D i g i t a l I m a g e P r o c e s s i n g 0 0 1
20
2 2/),(),(
Dvu Devu H
−=
2#
!
-
8/19/2019 Freq Filter
34/60
o!
"#
2"
! +aussian ?owpass Filters cont 1
-
8/19/2019 Freq Filter
35/60
o!
"#+aussian ?owpass Filters cont31
I m a g e s t a * e n ! r o m
+ o n , a l e , - W o o d s D i g i t a l I m a g e P r o c e s s i n g 0 0 1
Briginal
image
esult o! !ilteringwith +aussian !ilter
with cuto!! radius "
esult o! !iltering
with +aussian !ilter
with cuto!! radius 20
esult o! !iltering
with +aussian !ilter
with cuto!! radius
20
esult o! !iltering
with +aussian
!ilter with cuto!!
radius ;"
esult o! !ilteringwith +aussian
!ilter with cuto!!
radius 7"
29
o! ?owpass Filters Compared
-
8/19/2019 Freq Filter
36/60
o!
"#?owpass Filters Compared
esult o! !iltering
with ideal low pass
!ilter o! radius 7"
esult o! !iltering
with %utterworth
!ilter o! order
and cuto!! radius
7"
esult o! !iltering
with +aussian
!ilter with cuto!!
radius 7"
I m a g e s t a * e n ! r o m
+ o n , a l e , - W o o d s D i g i t
a l I m a g e P r o c e s s i n g 0 0 1
2
o! ?owpass Filtering E(amples
-
8/19/2019 Freq Filter
37/60
o!
"#?owpass Filtering E(amples
' low pass +aussian !ilter is used to connect
bro*en te(t
I m a g e s t a * e n ! r o m
+ o n , a l e , - W o o d s D i g i t a l I m a g e P r o c e s s i n g 0 0 1
2;
o! ?owpass Filtering E(amples
-
8/19/2019 Freq Filter
38/60
o!
"#?owpass Filtering E(amples
I m a g e s t a * e n ! r o m
+ o n , a l e , - W o o d s D i g i t a l I m a g e P r o c e s s i n g 0 0
1
2<
o! ?owpass Filtering E(amples cont 1
-
8/19/2019 Freq Filter
39/60
o!
"#?owpass Filtering E(amples cont31
Di!!erent lowpass +aussian !ilters used to
remo8e blemishes in a photograph
I m a g e s t a * e n ! r o m
+ o n , a l e , - W o o d s D i g i t a l I m a g e P r o c e s s i n g 0 0
1
#0
o! ?owpass Filtering E(amples cont 1
-
8/19/2019 Freq Filter
40/60
o!
"#?owpass Filtering E(amples cont31
I m a g e s t a * e n ! r o m
+ o n , a l e , - W o o d s D i g i t a l I m a g e P r o c e s s i n g 0 0
1
#7
o! ?owpass Filtering E(amples cont 1
-
8/19/2019 Freq Filter
41/60
o!
"#?owpass Filtering E(amples cont31
Briginal
image
+aussian lowpass
!ilter
Processed
image
=pectrum o!
original image
I m a g e s t a * e n ! r o m
+ o n , a l e , - W o o d s D i g i t a l I m a g e P r o c e s s i n g 0 0
1
#
o! =harpening in the Frequency Domain
-
8/19/2019 Freq Filter
42/60
o!
"#=harpening in the Frequency Domain
Edges and !ine detail in images are associated
with high !requency components
High pass filters ) only pass the high
!requencies drop the low ones
@igh pass !requencies are precisely the re8erse
o! low pass !ilters so:
H hp(u, v) = 1 – H lp(u, v)
-
8/19/2019 Freq Filter
43/60
##
o!
-
8/19/2019 Freq Filter
44/60
"#
#"
o! Ideal @igh Pass Filters cont 1
-
8/19/2019 Freq Filter
45/60
"#Ideal @igh Pass Filters cont31
esults o! ideal
high pass !iltering
with D0 & 7"
esults o! ideal
high pass !iltering
with D0 & 20
esults o! ideal
high pass !iltering
with D0 & ;0 I m a g e s t a * e n ! r o m
+ o n , a l e , - W o o d s D i g i t a l I m a g e P r o c e s s i n g 0 0
1
#9
o! %utterworth @igh Pass Filters
-
8/19/2019 Freq Filter
46/60
"#%utterworth @igh Pass Filters
$he %utterworth high pass !ilter is gi8en as:
where n is the order and D0 is the cut o!!distance as be!ore
nvu D Dvu H
2
0 )],(/[1
1),(
+=
I m a g e s t a * e n ! r o m
+ o n , a l e , - W o o d s D i g i t a l I m a g e P r o c e s s i n g 0 0
1
#
o!
-
8/19/2019 Freq Filter
47/60
"#
#;
o! %utterworth @igh Pass Filters cont31
-
8/19/2019 Freq Filter
48/60
"#%utterworth @igh Pass Filters cont31
esults o!
%utterworth
high pass
!iltering o!
order with D0 & 7"
esults o!
%utterworth
high pass
!iltering o!
order with D0 & ;0
esults o! %utterworth high pass
!iltering o! order with D0 & 20 I m a g e s t a * e n ! r o m
+ o n , a l e , - W o o d s D i g i t a l I m a g e P r o c e s s i n g 0 0 1
#<
o! +aussian @igh Pass Filters
-
8/19/2019 Freq Filter
49/60
"#+aussian @igh Pass Filters
$he +aussian high pass !ilter is gi8en as:
where D0 is the cut o!! distance as be!ore
20
2 2/),(1),(
Dvu Devu H
−−=
I m a g e s t a * e n ! r o m
+ o n , a l e , - W o o d s D i g i t a l I m a g e P r o c e s s i n g 0 0 1
"0
o!
"#
-
8/19/2019 Freq Filter
50/60
"#
"7
o!
"#+aussian @igh Pass Filters cont31
-
8/19/2019 Freq Filter
51/60
"#g 1
esults o!
+aussian
high pass
!iltering with
D0 & 7"
esults o!
+aussian
high pass
!iltering with
D0 & ;0
esults o! +aussian high pass
!iltering with D0 & 20 I m a g e s t a * e n ! r o m
+ o n , a l e , - W o o d s D i g i t a l I m a g e P r o c e s s i n g 0 0 1
"
o!
"#@ighpass Filter Comparison
-
8/19/2019 Freq Filter
52/60
"#g p p
esults o! ideal
high pass !iltering
with D0 & 7"
I m a g e s t a * e n ! r o m
+ o n , a l e , - W o o d s D i g i t a l I m a g e P r o c e s s i n g 0 0 1
"2
o!
"#@ighpass Filter Comparison
-
8/19/2019 Freq Filter
53/60
"#g p p
esults o! %utterworth
high pass !iltering o! order with D0 & 7"
I m a g e s t a * e n ! r o m
+ o n , a l e , - W o o d s D i g
i t a l I m a g e P r o c e s s i n g 0 0 1
"#
o!
"#@ighpass Filter Comparison
-
8/19/2019 Freq Filter
54/60
"#g p p
esults o! +aussianhigh pass !iltering with
D0 & 7"
I m a g e s t a * e n ! r o m
+ o n , a l e , - W o o d s D i g
i t a l I m a g e P r o c e s s i n g 0 0 1
""
o!
"#@ighpass Filter Comparison
-
8/19/2019 Freq Filter
55/60
"#g p p
esults o! ideal
high pass !iltering
with D0 & 7"
esults o! +aussian
high pass !iltering with
D0 & 7"
esults o! %utterworth
high pass !iltering o! order
with D0 & 7" I m a g e s t a * e n ! r o m
+ o n , a l e , - W o o d s D i g
i t a l I m a g e P r o c e s s i n g 0 0 1
"9
o!
"#@ighpass Filter Comparison
-
8/19/2019 Freq Filter
56/60
"#
esults o! idealhigh pass !iltering
with D0 & 7"
I m a g e s t a * e n ! r o m
+ o n , a l e , - W o o d s D i g
i t a l I m a g e P r o c e s s i n g 0 0 1
"
o!
"#@ighpass Filter Comparison
-
8/19/2019 Freq Filter
57/60
"#
esults o! %utterworthhigh pass !iltering o! order
with D0 & 7"
I m a g e s t a * e n ! r o m + o n , a l e , - W o o d s D i g
i t a l I m a g e P r o c e s s i n g 0
0 1
";
o!
"#@ighpass Filter Comparison
-
8/19/2019 Freq Filter
58/60
"#
esults o! +aussianhigh pass !iltering with
D0 & 7"
I m a g e s t a * e n ! r o m + o n , a l e , - W o o d s D i g
i t a l I m a g e P r o c e s s i n g 0
0 1
"<
o!
"#@ighpass Filtering E(ample
-
8/19/2019 Freq Filter
59/60
B r i g i n a l i m a g e
@ig
hpas
s!ilteringres
u lt
@ i g h ! r e q u e n c y
e m p h a s i s r e s u l t '
!terhis to
gram
equalisation
I m a g e s t a * e n ! r o m + o n , a l e , - W o o d s D i g
i t a l I m a g e P r o c e s s i n g 0
0 1
90
o!
"#=ummary
-
8/19/2019 Freq Filter
60/60
In this lecture we e(amined image
enhancement in the !requency domain
) $he Fourier series - the Fourier trans!orm
) Image Processing in the !requency domain
Image smoothing Image sharpening
) Fast Fourier $rans!orm
4e(t time we will begin to e(amine image
restoration using the spatial and !requency
based techniques we ha8e been loo*ing at