analisi di immagini e video (computer vision) · 2020. 7. 31. · analisi di immagini e video...
TRANSCRIPT
Analisi di Immagini e Video(Computer Vision)
Giuseppe Manco
Outline
• Image Processing avanzato• Edge detection• Fourier Transform
Crediti
• Slides adattate da vari corsi • Analisi di Immagini (F. Angiulli) – Unical• Intro to Computer Vision (J. Tompkin) – CS Brown Edu• Computer Vision (I. Gkioulekas), CS CMU Edu
Analisi di Fourier
Ogni segnale periodico è una combinazione di queste componenti
Trasformata di Fourier
Ampiezza
Frequenza angolare
VariabileFase
Sinusoide
Trasformata di Fourier
Esempio
= +? ?
= +? ?
= +? ?
Esempio
+? ?=
=
+? ?≈
=
+? ?≈
=
+? ?≈
=
+? ?≈
=
+? ?≈
Come lo possiamoesprimere
matematicamente?
=
=
Ampiezza
Frequenze
frequency
amplitude
Lo spettro delle frequenze
frequency
amplitude
Lo spettro delle frequenze
+=
frequency
amplitude
Lo spettro delle frequenze
+=
How do we plot ...
frequency
amplitude
Lo spettro delle frequenze
+=
frequency
amplitude
Lo spettro delle frequenze
+=
Dominio spaziale Dominio frequenze
1D
2D
Da 1D a 2D
?
1D
2D A cosa corrispondono itre punti?
Dominio spaziale Dominio frequenze
Da 1D a 2D
?
Dominio spaziale Dominio frequenze
Da 1D a 2D
Dominio spaziale Dominio frequenze
Da 1D a 2D
Qual è il corrispondente di questa immagine?
Esempio
Esempio
Esempio
=+ ?
Esempio
=+
?
Esempio
=+
Trasformata di Fourier
Diretta
Disc
reto
Cont
inuo
Inversa
𝐹 𝑘 = $!"
"𝑓 𝑥 𝑒!#$%&'𝑑𝑥 𝑓 𝑥 = $
!"
"𝐹 𝑘 𝑒#$%&'𝑑𝑥
𝐹 𝑘 = )&()
*!+
𝑓 𝑥 𝑒!#$%&*' 𝑓 𝑥 =
1𝑁)&()
*!+
𝐹 𝑘 𝑒#$%&*'
Trasformata di Fourier
Diretta
2D1D
Inversa
𝐹 𝑘 = )&()
*!+
𝑓 𝑥 𝑒!#$%&*' 𝑓 𝑥 =
1𝑁)&()
*!+
𝐹 𝑘 𝑒#$%&*'
𝐹 ℎ, 𝑘 = &!"#
$%&
&'"#
(%&
𝑓 𝑥, 𝑦 𝑒%)*+,!$ -
.'( 𝑓 𝑥, 𝑦 =
1𝑁𝑀&
!"#
$%&
&'"#
(%&
𝐹 ℎ, 𝑘 𝑒)*+,!$ -
.'(
ℎ = 0,1,2, … , 𝑁 − 1, 𝑘 = 0,1,2, … ,𝑀 − 1 x = 0,1,2, … , 𝑁 − 1, 𝑦 = 0,1,2, … ,𝑀 − 1
Trasformata di Fourier nel dominio reale
• Ampiezza
• Fase
𝔉 𝑓(𝑥, 𝑦) = 𝐹 ℎ, 𝑘 = 𝐹 ℎ, 𝑘 𝑒!#,(.,&)
𝐹 ℎ, 𝑘 = |R$ ℎ, 𝑘 + 𝐼$ ℎ, 𝑘 |
𝜙(ℎ, 𝑘) = tan!+𝐼 ℎ, 𝑘𝑅 ℎ, 𝑘
La trasformata di immagini
Immagine Ampiezza Fase
Applicazioni della FT
• Frequency-Domain Filtering• Teorema di convoluzione
• Conseguenza• Filtraggio come moltiplicazione di matrici• Dominio spaziale -> FT->moltiplicazione ->IFT
𝑓 𝑥, 𝑦 ∗ ℎ 𝑥, 𝑦 = 𝔉 𝑓 𝑥, 𝑦 ⋅ 𝔉 ℎ(𝑥, 𝑦)
=filter kernel
=
Esempio
Fourier transform inverse Fourier transform
120 3 Image processing
Name Signal Transform
impulse-0.5
0.0
0.5
1.0
-1.0000 -0.5000 0.0000 0.5000 1.0000
δ(x) ⇔ 1-0.5
0.0
0.5
1.0
-0.5000 0.0000 0.5000
shiftedimpulse
-0.5
0.0
0.5
1.0
-1.0000 -0.5000 0.0000 0.5000 1.0000
δ(x − u) ⇔ e−jωu
-0.5
0.0
0.5
1.0
-0.5000 0.0000 0.5000
box filter-0.5
0.0
0.5
1.0
-1.0000 -0.5000 0.0000 0.5000 1.0000
box(x/a) ⇔ asinc(aω)-0.5
0.0
0.5
1.0
-0.5000 0.0000 0.5000
tent-0.5
0.0
0.5
1.0
-1.0000 -0.5000 0.0000 0.5000 1.0000
tent(x/a) ⇔ asinc2(aω)-0.5
0.0
0.5
1.0
-0.5000 0.0000 0.5000
Gaussian-0.5
0.0
0.5
1.0
-1.0000 -0.5000 0.0000 0.5000 1.0000
G(x;σ) ⇔√
2πσ G(ω;σ−1)
-0.5
0.0
0.5
1.0
-0.5000 0.0000 0.5000
Laplacianof Gaussian
-0.5
0.0
0.5
1.0
-1.0000 -0.5000 0.0000 0.5000 1.0000
( x2
σ4 − 1σ2 )G(x; σ) ⇔ −
√2πσ ω2G(ω;σ−1)
-0.5
0.0
0.5
1.0
-0.5000 0.0000 0.5000
Gabor-0.5
0.0
0.5
1.0
-1.0000 -0.5000 0.0000 0.5000 1.0000
cos(ω0x)G(x; σ) ⇔√
2πσ G(ω ± ω0; σ−1)
-0.5
0.0
0.5
1.0
-0.5000 0.0000 0.5000
unsharpmask
-0.5
0.0
0.5
1.0
1.5
-1.0000 -0.5000 0.0000 0.5000 1.0000
(1 + γ)δ(x)− γG(x;σ) ⇔
(1 + γ)−√
2πγσ G(ω;σ−1)
-0.5
0.0
0.5
1.0
1.5
-0.5000 0.0000 0.5000
windowedsinc
-0.5
0.0
0.5
1.0
-1.0000 -0.5000 0.0000 0.5000 1.0000
rcos(x/(aW ))sinc(x/a) ⇔ (see Figure 3.29)
-0.5
0.0
0.5
1.0
-0.5000 0.0000 0.5000
Table 3.2 Some useful (continuous) Fourier transform pairs: The dashed line in the Fourier transform of theshifted impulse indicates its (linear) phase. All other transforms have zero phase (they are real-valued). Note thatthe figures are not necessarily drawn to scale but are drawn to illustrate the general shape and characteristics ofthe filter or its response. In particular, the Laplacian of Gaussian is drawn inverted because it resembles more a“Mexican hat”, as it is sometimes called.
Alcune trasformate utili