Professional Documents
Culture Documents
IT5409 Ch3 Filters 20200228 v3 Part2
IT5409 Ch3 Filters 20200228 v3 Part2
1 2
3 4
3 4
1
07/03/2021
5 6
5 6
7 8
2
07/03/2021
9 10
11 12
11 12
3
07/03/2021
Source : Eric Favier. L'analyse et le traitement des images. ENISE. Source : www.nte.montaigne.u-bordeaux.fr/SuppCours/5314/Dai/TraitImage01-02.ppt
13 14
13 14
15
15 17
4
07/03/2021
18 19
Thresholding Thresholding
• Given a grayscale image or an intermediate matrix → • Given a grayscale image or an intermediate matrix →
threshold to create a binary output. threshold to create a binary output.
Example: background subtraction
Example: intensity-based detection
- =
20 21
5
07/03/2021
Thresholding Issues
• Given a grayscale image or an intermediate matrix →
threshold to create a binary output. • What to do with “noisy” binary
outputs?
Example: color-based detection ‒ Holes
‒ Extra small fragments
22 23
• Main components
‒ Structuring element
‒ Operators:
• Basic operators: Dilation, Erosion
• Others: Opening, Closing, … Before dilation After dilation
Slide credit: Kristen Grauman
24 25
6
07/03/2021
26 27
Dilation Dilation
• Moving S on each pixel of A • As max filter
‒ check if the intersection (pixels belonging to object) is not empty
• Can be applied both on
‒ If yes, the center of B belongs to the result image
• If a pixel of S is onto object pixels (A), then the central pixel belongs to ‒ binary images
object ‒ or grayscale images
‒ Otherwise (i.e. all pixels of are background), set to background (no change)
𝑨 ⊕S
Mask /
Structuring element
Structuring element
S
chamj vào là ly
28 29
7
07/03/2021
Erosion Erosion
• We put the element S on each pixel x of A
• As min filter
‒ like convolution
• If all pixels of S are onto object pixels (A), then the central pixel belongs • Can be applied both on
to object
‒ Otherwise (i.e. a mask pixel is background), set to background
‒ binary images
‒ or grayscale images
𝑨 ⊝S
Structuring Mask /
element Structuring element
30 lt vào mi ly 31
2D example Opening
• Erode, then dilate
• Remove small objects, keep original shape
32 33
8
07/03/2021
Opening
Closing
Before closing After closing
demo: http://bigwww.epfl.ch/demo/jmorpho/start.php
34 35
36 37
9
07/03/2021
38 39
40 41
10
07/03/2021
42 43
44 45
11
07/03/2021
47
46 47
48 49
48 49
12
07/03/2021
50 51
50 51
52 53
13
07/03/2021
Coefficient
Add enough of them to get
any signal g(t) you want!
Hays Slides: Efros
55
54 55
f(x) |F(𝟂)|
signal Fourier transform
of signal Slide by Alexei A. Efros
56
56 57
14
07/03/2021
≈ + ≈ +
= =
58 59
≈ + ≈ +
= =
60 61
15
07/03/2021
≈ + =
We want to get this We want to get this function We’ll get there in the limit
function
62 63
• We’ve been showing only the amplitude A (spectre) so far: Amplitude: Phase:
I ( )
• Phase is also encoded: = tan −1
A = R( ) 2 + I ( ) 2 R( )
Slide by Steve Seitz Slide by Rober Pless
64 65
16
07/03/2021
67
66 67
Source: Václav Hlavác - Fourier transform, in 1D and in 2D Source: Václav Hlavác - Fourier transform, in 1D and in 2D
68 69
68 69
17
07/03/2021
• Inverse FFT:
Slide: Hoiem
70 71
Frequency
domain
Spatial
domain
73
72 73
18
07/03/2021
Imaginary part
74 75
74 75
76 77
19
07/03/2021
+ =
f(x,y) |F(𝟂)|
What does it mean to be at pixel x,y?
What does it mean to be more or less bright in the Fourier decomposition image?
Fourier images (spectral images – amtitude images) Slide by Steve Seitz
http://sharp.bu.edu/~slehar/fourier/fourier.html#filtering
78
78 79
Green = sine
Blue = cosine
Hays
This change of basis is the Fourier Transform Hays
80 81
80 81
20
07/03/2021
82 83
84 85
84 85
21
07/03/2021
FFT
=
Inverse FFT
87
86 87
filter
g(x,y) G(u,v)
89
88 89
22
07/03/2021
1 D(u,v) D0 D(u,v) = u2 + v2
H(u,v) =
0 D(u,v) > D0 D0 = cut off frequency
H(u,v)
H(u,v)
v 1
u 0 D0 D(u,v)
90 91
200
H(u,v) h(x,y)
150
100
D0 Ringing radius + blur
50
0
0 50 100 150 200 250
92 93
92 93
23
07/03/2021
H(u,v) H(u,v)
1
1/ e
v
u 0 D0 D(u,v)
-D2(u,v)/(2D20)
H(u,v) = e D(u,v) = u2 + v2
94 95
94 95
300 1
250
0.1 0.8
200 0.6
100 0.2
50 0 0
0 50 100 -50 0 50
0
0 50 100 150 200 250 300 Image Domain Frequency Domain
96 97
96 97
24
07/03/2021
H(u,v)
H(u,v) - Ideal Filter H(u,v)
1
0 D(u,v) D0 D(u,v) = u2 + v2 1− 1 / e
H(u,v) = v
1 D(u,v) > D0 D0 = cut off frequency
H(u,v) u 0 D0 D(u,v)
H(u,v)
v 1 -D2(u,v)/(2D20)
H(u,v) = 1 - e
u 0 D0 D(u,v)
D(u,v) = u2 + v2
98 99
98 99
−1 −1 −1
ℎ1 (3𝑥3) = −1 8 −1
−1 −1 −1
100 101
100 101
25
07/03/2021
0 D(u,v) D0 - w D(u,v) = u2 + v2
2
w
H(u,v) = 1 D0- w2 D(u,v) D0 + 2
D0 = cut off frequency
w
0 D(u,v) > D0 + 2 w = band-width
H(u,v) H(u,v)
1
v
D(u,v)
0 D0- w D0 D0+w
2 2
u
Can be obtained by multiplying the filter functions of a low-pass and
of a high-pass in the frequency domain
102 103
102 103
Brayer
104 105
26
07/03/2021
106 107
Content
• Rappel: digital image representation
• Point Processing
• Convolution and Linear filtering
• More neighborhood operators
• Image transforms
‒ Frequency domain
‒ PCA (additional reading)
• PCA
• Example of using PCA for face recognition
108
108
27