shape-based visual information retrieval enver sangineto dipartimento di informatica...
TRANSCRIPT
![Page 1: Shape-based visual information retrieval Enver Sangineto Dipartimento di Informatica sangineto@di.uniroma1.it](https://reader035.vdocuments.mx/reader035/viewer/2022070312/5542eb49497959361e8b4c94/html5/thumbnails/1.jpg)
Shape-based visual information retrieval
Enver SanginetoDipartimento di Informatica
![Page 2: Shape-based visual information retrieval Enver Sangineto Dipartimento di Informatica sangineto@di.uniroma1.it](https://reader035.vdocuments.mx/reader035/viewer/2022070312/5542eb49497959361e8b4c94/html5/thumbnails/2.jpg)
Recupero di immagini attraverso la forma
• In un’immagine, più che il colore o la texture, ciò che più caratterizza un oggetto è la sua forma
• I sistemi di Content Based Image Retrieval (CBIR) che trattano la forma accettano come query: – immagini d’esempio – disegni stilizzati (sketch)– …
![Page 3: Shape-based visual information retrieval Enver Sangineto Dipartimento di Informatica sangineto@di.uniroma1.it](https://reader035.vdocuments.mx/reader035/viewer/2022070312/5542eb49497959361e8b4c94/html5/thumbnails/3.jpg)
Ese.: query by sketch
![Page 4: Shape-based visual information retrieval Enver Sangineto Dipartimento di Informatica sangineto@di.uniroma1.it](https://reader035.vdocuments.mx/reader035/viewer/2022070312/5542eb49497959361e8b4c94/html5/thumbnails/4.jpg)
Pre-processing: estrazione dei bordi
• La forma di oggetto in un’immagine può essere data da:– la sagoma (e. g., i punti interni di un’img
binaria)– I bordi (interni e/o esterni)
![Page 5: Shape-based visual information retrieval Enver Sangineto Dipartimento di Informatica sangineto@di.uniroma1.it](https://reader035.vdocuments.mx/reader035/viewer/2022070312/5542eb49497959361e8b4c94/html5/thumbnails/5.jpg)
Immagini binarie (semplice)
![Page 6: Shape-based visual information retrieval Enver Sangineto Dipartimento di Informatica sangineto@di.uniroma1.it](https://reader035.vdocuments.mx/reader035/viewer/2022070312/5542eb49497959361e8b4c94/html5/thumbnails/6.jpg)
Immagine non binaria…
![Page 7: Shape-based visual information retrieval Enver Sangineto Dipartimento di Informatica sangineto@di.uniroma1.it](https://reader035.vdocuments.mx/reader035/viewer/2022070312/5542eb49497959361e8b4c94/html5/thumbnails/7.jpg)
Estrazione dei contorni da immagini non binarie
• I contorni (bordi) interni e/o esterni di un oggetto sono normalmente contraddistinti da discontinuità luminose (transizione tra superfici diverse)
• Individuando le discontinuità (un cambiamento brusco dell’intensità di grigio dei pixel) è possibile rilevare i bordi e quindi la forma degli oggetti di un’immagine
![Page 8: Shape-based visual information retrieval Enver Sangineto Dipartimento di Informatica sangineto@di.uniroma1.it](https://reader035.vdocuments.mx/reader035/viewer/2022070312/5542eb49497959361e8b4c94/html5/thumbnails/8.jpg)
Estrazione di contorni tramite operatori differenziali
• Un’immagine I può essere vista come una funzione a due variabili I(x,y): I: R2 -> R
• (sorvoliamo per ora sulla discontinuità di I)
![Page 9: Shape-based visual information retrieval Enver Sangineto Dipartimento di Informatica sangineto@di.uniroma1.it](https://reader035.vdocuments.mx/reader035/viewer/2022070312/5542eb49497959361e8b4c94/html5/thumbnails/9.jpg)
Gradiente di un’immagine
• Il gradiente G di I nel punto (x,y) è:
• G(x,y) punta nella direzione di massima crescita di I in (x,y)
![Page 10: Shape-based visual information retrieval Enver Sangineto Dipartimento di Informatica sangineto@di.uniroma1.it](https://reader035.vdocuments.mx/reader035/viewer/2022070312/5542eb49497959361e8b4c94/html5/thumbnails/10.jpg)
Rappresentazione alternativa
• Se:
• Allora:
• dove:– r(p) è l’intensità del gradiente in p e– φ(p) è la sua direzione
![Page 11: Shape-based visual information retrieval Enver Sangineto Dipartimento di Informatica sangineto@di.uniroma1.it](https://reader035.vdocuments.mx/reader035/viewer/2022070312/5542eb49497959361e8b4c94/html5/thumbnails/11.jpg)
Interpretazione grafica del gradiente in un punto
![Page 12: Shape-based visual information retrieval Enver Sangineto Dipartimento di Informatica sangineto@di.uniroma1.it](https://reader035.vdocuments.mx/reader035/viewer/2022070312/5542eb49497959361e8b4c94/html5/thumbnails/12.jpg)
Approssimazioni del gradiente
• Il gradiente può essere calcolato utilizzando delle maschere (operatori) con cui si effettua la convoluzione con I
• In pratica, le maschere sono delle matrici di coefficienti (e.g., 3X3) con cui pesare l’intensità dei pixel nell’intorno di p in una somma pesata che dà Gx(p) e Gy(p)
![Page 13: Shape-based visual information retrieval Enver Sangineto Dipartimento di Informatica sangineto@di.uniroma1.it](https://reader035.vdocuments.mx/reader035/viewer/2022070312/5542eb49497959361e8b4c94/html5/thumbnails/13.jpg)
Operatore di Sobel
000
121
-1-2-1
Maschera per Gx
20-2
10-1
10-1
Maschera per Gy
![Page 14: Shape-based visual information retrieval Enver Sangineto Dipartimento di Informatica sangineto@di.uniroma1.it](https://reader035.vdocuments.mx/reader035/viewer/2022070312/5542eb49497959361e8b4c94/html5/thumbnails/14.jpg)
Rappresentazioni del gradiente
• Iterando il processo per tutti i pixel p di I possiamo rappresentare i valori di G(p) (o D(p)) con nuove immagini:– Ir(p) = r(p)
– IGx(p) = Gx(p)
– IGy(p) = Gy(p)
![Page 15: Shape-based visual information retrieval Enver Sangineto Dipartimento di Informatica sangineto@di.uniroma1.it](https://reader035.vdocuments.mx/reader035/viewer/2022070312/5542eb49497959361e8b4c94/html5/thumbnails/15.jpg)
Esempio 000
121
-1-2-1
Maschera per contorni verticali
20-2
10-1
10-1
Maschera per contorni orizzontali
IGx(p)
000
121
-1-2-1
20-2
10-1
10-1
000
2149
-2-6-2
100
-16
20-9
20-2
Gx=15
Gy=-13
r |Gx|+|Gy| = 28= arctg(-13/15)
IGy(p)
![Page 16: Shape-based visual information retrieval Enver Sangineto Dipartimento di Informatica sangineto@di.uniroma1.it](https://reader035.vdocuments.mx/reader035/viewer/2022070312/5542eb49497959361e8b4c94/html5/thumbnails/16.jpg)
Ir: esempio
• Ir(p) = 0 <=> in un intorno di p, I è costante
![Page 17: Shape-based visual information retrieval Enver Sangineto Dipartimento di Informatica sangineto@di.uniroma1.it](https://reader035.vdocuments.mx/reader035/viewer/2022070312/5542eb49497959361e8b4c94/html5/thumbnails/17.jpg)
Ir: esempio [2]
![Page 18: Shape-based visual information retrieval Enver Sangineto Dipartimento di Informatica sangineto@di.uniroma1.it](https://reader035.vdocuments.mx/reader035/viewer/2022070312/5542eb49497959361e8b4c94/html5/thumbnails/18.jpg)
Ir: esempio [3]
![Page 19: Shape-based visual information retrieval Enver Sangineto Dipartimento di Informatica sangineto@di.uniroma1.it](https://reader035.vdocuments.mx/reader035/viewer/2022070312/5542eb49497959361e8b4c94/html5/thumbnails/19.jpg)
Punti di “edge”
• Binarizzando opportunamente Ir è possibile ottenere una seconda immagine E, detta “edge map”
• E rappresenta i punti con gradiente più elevato in modulo, ovvero i punti di bordo (edge points) di I
![Page 20: Shape-based visual information retrieval Enver Sangineto Dipartimento di Informatica sangineto@di.uniroma1.it](https://reader035.vdocuments.mx/reader035/viewer/2022070312/5542eb49497959361e8b4c94/html5/thumbnails/20.jpg)
Esempio
![Page 21: Shape-based visual information retrieval Enver Sangineto Dipartimento di Informatica sangineto@di.uniroma1.it](https://reader035.vdocuments.mx/reader035/viewer/2022070312/5542eb49497959361e8b4c94/html5/thumbnails/21.jpg)
Esempio [2]
![Page 22: Shape-based visual information retrieval Enver Sangineto Dipartimento di Informatica sangineto@di.uniroma1.it](https://reader035.vdocuments.mx/reader035/viewer/2022070312/5542eb49497959361e8b4c94/html5/thumbnails/22.jpg)
Shape Retrieval: Principali approcci
• Approccio statistico
• Approccio tramite template matching (deformabile)
![Page 23: Shape-based visual information retrieval Enver Sangineto Dipartimento di Informatica sangineto@di.uniroma1.it](https://reader035.vdocuments.mx/reader035/viewer/2022070312/5542eb49497959361e8b4c94/html5/thumbnails/23.jpg)
Approccio statistico
• Si stabiliscono delle feature per rappresentare la forma degli oggetti tramite punti nello spazio delle feature Rn
• La distanza (e.g., Euclidea) tra punti in Rn corrisponde alla similarità percepita dall’utente
![Page 24: Shape-based visual information retrieval Enver Sangineto Dipartimento di Informatica sangineto@di.uniroma1.it](https://reader035.vdocuments.mx/reader035/viewer/2022070312/5542eb49497959361e8b4c94/html5/thumbnails/24.jpg)
Ese. di feature (semplice)
• Data la sagoma (img binaria) di un’oggetto, calcolo:– L’area,– Il perimetro,– La “compattezza” (rapporto perimetro2 /
area),– …
![Page 25: Shape-based visual information retrieval Enver Sangineto Dipartimento di Informatica sangineto@di.uniroma1.it](https://reader035.vdocuments.mx/reader035/viewer/2022070312/5542eb49497959361e8b4c94/html5/thumbnails/25.jpg)
Coefficienti di Fourier del bordo esterno
![Page 26: Shape-based visual information retrieval Enver Sangineto Dipartimento di Informatica sangineto@di.uniroma1.it](https://reader035.vdocuments.mx/reader035/viewer/2022070312/5542eb49497959361e8b4c94/html5/thumbnails/26.jpg)
Esempio
![Page 27: Shape-based visual information retrieval Enver Sangineto Dipartimento di Informatica sangineto@di.uniroma1.it](https://reader035.vdocuments.mx/reader035/viewer/2022070312/5542eb49497959361e8b4c94/html5/thumbnails/27.jpg)
Momenti digitali
• Supponiamo che S sia il risultato di una binarizzazione di I: S = {(x,y): I(x,y) < th}
• Per ogni coppia di interi non negativi (j,k), il momento digitale (j,k)-esimo di S è dato da:
• E’ facile constatare che M00(S) corrisponde all’area di S
![Page 28: Shape-based visual information retrieval Enver Sangineto Dipartimento di Informatica sangineto@di.uniroma1.it](https://reader035.vdocuments.mx/reader035/viewer/2022070312/5542eb49497959361e8b4c94/html5/thumbnails/28.jpg)
Momenti digitali [2]
![Page 29: Shape-based visual information retrieval Enver Sangineto Dipartimento di Informatica sangineto@di.uniroma1.it](https://reader035.vdocuments.mx/reader035/viewer/2022070312/5542eb49497959361e8b4c94/html5/thumbnails/29.jpg)
Vantaggi e svantaggi dell'approccio statistico
• Possibilità di indexing
• Dubbio potere discriminante (spesso le feature usate sono poco discriminanti)
• Gli oggetti devono essere completamente isolabili (problema di “segmentazione”)
![Page 30: Shape-based visual information retrieval Enver Sangineto Dipartimento di Informatica sangineto@di.uniroma1.it](https://reader035.vdocuments.mx/reader035/viewer/2022070312/5542eb49497959361e8b4c94/html5/thumbnails/30.jpg)
Template Matching Deformabile
• Gli approcci di questo filone si basano sul tentativo di far allineare lo sketch disegnato dall'utente con (una porzione de-) l'immagine attualmente analizzata dal sistema
![Page 31: Shape-based visual information retrieval Enver Sangineto Dipartimento di Informatica sangineto@di.uniroma1.it](https://reader035.vdocuments.mx/reader035/viewer/2022070312/5542eb49497959361e8b4c94/html5/thumbnails/31.jpg)
Template Matching Deformabile [2]
• L’ allineamento avviene deformando iterativamente lo sketch iniziale per adattarlo come se fosse un “elastico” ai bordi degli oggetti delle immagini in memoria
• Il processo iterativo termina:– quando si raggiunge una sovrapposizione
accettabile (successo), oppure: – quando il grado di deformazione supera un certo
valore massimo (fallimento)
![Page 32: Shape-based visual information retrieval Enver Sangineto Dipartimento di Informatica sangineto@di.uniroma1.it](https://reader035.vdocuments.mx/reader035/viewer/2022070312/5542eb49497959361e8b4c94/html5/thumbnails/32.jpg)
Esempio
immagine presa da: Del Bimbo, Pala, Visual Image Retrieval by Elastic Matching of User Sketches, IEEE PAMI 1997
![Page 33: Shape-based visual information retrieval Enver Sangineto Dipartimento di Informatica sangineto@di.uniroma1.it](https://reader035.vdocuments.mx/reader035/viewer/2022070312/5542eb49497959361e8b4c94/html5/thumbnails/33.jpg)
Esempio: Elastic Matching (Del Bimbo-Pala)
• Le immagini vengono inserite nel DB del sistema nella forma contenente solo gli edge (pre-processing)
• L'utente disegna il suo sketch usando un tool grafico e la sagoma finale viene rappresentata con una spline codificata mediante i suoi punti di controllo:
P = (p1, ..., pn), pi = (xi, yi)
![Page 34: Shape-based visual information retrieval Enver Sangineto Dipartimento di Informatica sangineto@di.uniroma1.it](https://reader035.vdocuments.mx/reader035/viewer/2022070312/5542eb49497959361e8b4c94/html5/thumbnails/34.jpg)
Elastic Matching [2]
• Se la sovrapposizione tra i pixel dello sketch e quelli dei bordi dell'immagine candidata è elevata, la procedura termina qui
• Altrimenti, i vari pi vengono “perturbati” in modo da modificare lo sketch e re-iterare la comparazione
![Page 35: Shape-based visual information retrieval Enver Sangineto Dipartimento di Informatica sangineto@di.uniroma1.it](https://reader035.vdocuments.mx/reader035/viewer/2022070312/5542eb49497959361e8b4c94/html5/thumbnails/35.jpg)
Misura di matching
• Più esattamente, la “bontà” del matching tra lo sketch P e l'immagine I è definita da:
M(P,I) = C(P,I) - D(P,I), dove:
• C() e D() sono delle funzioni, rispettivamente, del grado di sovrappozione e di deformazione dello sketch
• Il modo più semplice per ottenere C(P,I) è contando il numero di pixel dello sketch (definito da P) e dell’immagine che sono sovrapposti
![Page 36: Shape-based visual information retrieval Enver Sangineto Dipartimento di Informatica sangineto@di.uniroma1.it](https://reader035.vdocuments.mx/reader035/viewer/2022070312/5542eb49497959361e8b4c94/html5/thumbnails/36.jpg)
Misura di matching [2]
D(P,I) = S(P,I) + B(P,I),
dove: S() e B() sono funzioni del grado di tensione e di curvatura dello sketch
![Page 37: Shape-based visual information retrieval Enver Sangineto Dipartimento di Informatica sangineto@di.uniroma1.it](https://reader035.vdocuments.mx/reader035/viewer/2022070312/5542eb49497959361e8b4c94/html5/thumbnails/37.jpg)
immagine presa da: Del Bimbo, Pala, Visual Image Retrieval by Elastic Matching of User Sketches, IEEE PAMI 1997
![Page 38: Shape-based visual information retrieval Enver Sangineto Dipartimento di Informatica sangineto@di.uniroma1.it](https://reader035.vdocuments.mx/reader035/viewer/2022070312/5542eb49497959361e8b4c94/html5/thumbnails/38.jpg)
Ricerca dei massimi della funzione di matching
![Page 39: Shape-based visual information retrieval Enver Sangineto Dipartimento di Informatica sangineto@di.uniroma1.it](https://reader035.vdocuments.mx/reader035/viewer/2022070312/5542eb49497959361e8b4c94/html5/thumbnails/39.jpg)
Metodi iterativi
![Page 40: Shape-based visual information retrieval Enver Sangineto Dipartimento di Informatica sangineto@di.uniroma1.it](https://reader035.vdocuments.mx/reader035/viewer/2022070312/5542eb49497959361e8b4c94/html5/thumbnails/40.jpg)
Metodo del gradiente ascendente
![Page 41: Shape-based visual information retrieval Enver Sangineto Dipartimento di Informatica sangineto@di.uniroma1.it](https://reader035.vdocuments.mx/reader035/viewer/2022070312/5542eb49497959361e8b4c94/html5/thumbnails/41.jpg)
Elastic Matching: riassunto dell’algoritmo
• Per ogni immagine I del DB:– Proietto lo sketch fornito dall’utente su I
rappresentandolo tramite l’insieme P(0) dei punti di controllo di una spline
– Per ogni iterazione k: • Utilizzo il metodo del gradiente ascendente per calcolare
P(k+1) da P(k) • Mi fermo quando trovo un massimo locale M(P(h),I)
– Dal valore raggiunto M(P(h),I) decido se I contiene lo sketch oppure no
![Page 42: Shape-based visual information retrieval Enver Sangineto Dipartimento di Informatica sangineto@di.uniroma1.it](https://reader035.vdocuments.mx/reader035/viewer/2022070312/5542eb49497959361e8b4c94/html5/thumbnails/42.jpg)
Elastic Matching: problemi aperti
• La convergenza dipende fortemente dalla soluzione iniziale P0: – non è invariante rispetto a roto-traslazioni e
cambiamenti di scala– segmentazione manuale di tutti i possibili oggetti
di interesse nelle immagini del DB (e.g., tramite il minimo rettangolo includente), oppure
– iterazioni successive del metodo per valori diversi di P0
![Page 43: Shape-based visual information retrieval Enver Sangineto Dipartimento di Informatica sangineto@di.uniroma1.it](https://reader035.vdocuments.mx/reader035/viewer/2022070312/5542eb49497959361e8b4c94/html5/thumbnails/43.jpg)
Rettangolo Includente
immagine presa da: Del Bimbo, Pala, Visual Image Retrieval by Elastic Matching of User Sketches, IEEE PAMI 1997
![Page 44: Shape-based visual information retrieval Enver Sangineto Dipartimento di Informatica sangineto@di.uniroma1.it](https://reader035.vdocuments.mx/reader035/viewer/2022070312/5542eb49497959361e8b4c94/html5/thumbnails/44.jpg)
Template matching deformabile: vantaggi e svantaggi
• No indexing
• Maggiore tolleranza ad occlusioni e sfondi non uniformi rispetto all’approccio statistico
• Problemi di segmentazione solo parzialmente risolti…
![Page 45: Shape-based visual information retrieval Enver Sangineto Dipartimento di Informatica sangineto@di.uniroma1.it](https://reader035.vdocuments.mx/reader035/viewer/2022070312/5542eb49497959361e8b4c94/html5/thumbnails/45.jpg)
Considerazioni generali sui limiti dei sistemi content based (con
query by example)
• Tutta l’informazione che un sistema “content based” ha rispetto all’ “oggetto” cercato (e.g., una determinata forma visiva o segnale auditivo) deriva dalla query
![Page 46: Shape-based visual information retrieval Enver Sangineto Dipartimento di Informatica sangineto@di.uniroma1.it](https://reader035.vdocuments.mx/reader035/viewer/2022070312/5542eb49497959361e8b4c94/html5/thumbnails/46.jpg)
Considerazioni generali sui limiti dei sistemi query by X [2]
• Per quanto sofisticato sia il sistema di rappresentazione o di matching è difficile distinguere le variazioni di forma “lecita” da quelle non lecite (rumore, altri oggetti…)
![Page 47: Shape-based visual information retrieval Enver Sangineto Dipartimento di Informatica sangineto@di.uniroma1.it](https://reader035.vdocuments.mx/reader035/viewer/2022070312/5542eb49497959361e8b4c94/html5/thumbnails/47.jpg)
Considerazioni generali sui limiti dei sistemi query by X [3]
• Il cervello umano impara a distinguere la forma di un cavallo solo dopo averne visti diversi e in varie posizioni
• Prestazioni paragonabili per i sistemi artificiali sono probabilmente possibili solo mediante una fase di apprendimento automatico
![Page 48: Shape-based visual information retrieval Enver Sangineto Dipartimento di Informatica sangineto@di.uniroma1.it](https://reader035.vdocuments.mx/reader035/viewer/2022070312/5542eb49497959361e8b4c94/html5/thumbnails/48.jpg)
Riferimenti
• Del Bimbo, Pala, Visual Image Retrieval by Elastic Matching of User Sketches, IEEE PAMI 1997
• Long et al., Fundamentals of Content-based Image Retrieval, in: D. D. Feng, W. C. Siu, H. J. Zhang (Ed.),Multimedia Information Retrieval & Management-Technological Fundamentals and Applications, Springer-Verlag, New York(2003)
• Smeulders et al., Content-Based Image Retrieval at the End of Early Years, IEEE PAMI 2000
![Page 49: Shape-based visual information retrieval Enver Sangineto Dipartimento di Informatica sangineto@di.uniroma1.it](https://reader035.vdocuments.mx/reader035/viewer/2022070312/5542eb49497959361e8b4c94/html5/thumbnails/49.jpg)
Domande…