Segmentation C. Andrés Méndez 17/04/2013. Where to find the presentations? mendezguerrero.

10
Segmentation C. Andrés Méndez 17/04/2013

Transcript of Segmentation C. Andrés Méndez 17/04/2013. Where to find the presentations? mendezguerrero.

Page 1: Segmentation C. Andrés Méndez 17/04/2013. Where to find the presentations? mendezguerrero.

SegmentationC. Andrés Méndez

17/04/2013

Page 2: Segmentation C. Andrés Méndez 17/04/2013. Where to find the presentations? mendezguerrero.

Where to find the presentations?

http://profs.sci.univr.it/~mendezguerrero

Page 3: Segmentation C. Andrés Méndez 17/04/2013. Where to find the presentations? mendezguerrero.

Global Thresholding• Thresholding algorithm 

Search all the pixels f(i,j) of the image f. An image element g(i,j) of the segmented image is an object pixel if f(i,j) >=T, and is a background pixel otherwise. (MatLab>> help im2bw)

• Esercizio 1– Caricare l’immagine text.jpg e trasformarla in scala di grigi – Selezionare una stima iniziale della soglia T. (Un possibile

valore iniziale può essere il punto intermedio tra il minimo e il massimo di valori di intensità dell’immagine)

– Segmentare l’immagine usando T – Calcolare i valori di intensità medi x1 e x2 per i pixel delle

due regioni trovate al punto precedente – Calcolare la nuova T=1/2(x1+x2) – Ripetere i passi 2 e 4 finchè la differenza dei valori di T in

iterazioni consecutive non è minore di un determinato parametro T0.

Page 4: Segmentation C. Andrés Méndez 17/04/2013. Where to find the presentations? mendezguerrero.

Region Growing Segmentation

L'algoritmo di region growing segmenta un'immagine attraverso la suddivisione della stessa in regioni costituite da pixel “simili” tra loro.

1.  Si sceglie il seme di partenza. 2.  Si stabilisce una soglia th che determinerà il criterio di similarità. La soglia può essere una costante o può essere scelta in modo adattativo, ad esempio può dipendere dalla media della regione Ri a ciascun passo di iterazione. Al primo passo, la regione R1 sarà costituita solo dal seme e la soglia th dipenderà dal valore di luminanza del seme stesso. 3.  Si prendono in considerazione gli 8 pixel adiacenti al seme confrontandone il valore di luminanza con la soglia th. Se superano il criterio di similarità verranno aggiunti alla regione R. 4.  Si calcola la media dei valori di intensità della nuova regione Ri. 5.  Si considerano tutti i pixel p adiacenti ad Ri: sia Ip l'intensitµa di p corrente. 6.  Se è minore della soglia th, si aggiunge p ad Ri. 7.  Si riprende dal passo 4 finchè nessun altro pixel supera il criterio di similarità.

Page 5: Segmentation C. Andrés Méndez 17/04/2013. Where to find the presentations? mendezguerrero.

Region Growing Segmentation

• Esercizio 2• Caricare l’immagine lungs.jpg e visualizzarla • Identificare le coordinate di un seedpoint all’interno della

regione del polmone a sx • Utilizzare la funzione regiongrow per segmentare il

polmone, assegnando una soglia opportuna

Page 6: Segmentation C. Andrés Méndez 17/04/2013. Where to find the presentations? mendezguerrero.

More on Segmentation• Exercise 3• Read the tutorial of cell segmentation• http://blogs.mathworks.com/steve/2006/06/02/cell-

segmentation/

• Do all the processing with the same image, and be sure to understand each step.

• Repeat the processing methodology with different images.• In which kind of images it works better?

Page 7: Segmentation C. Andrés Méndez 17/04/2013. Where to find the presentations? mendezguerrero.

Distance transform

• bwdist, computes the distance transform.

• The distance transform of a binary image is the distance from every pixel to the nearest nonzero-valued pixel, as this example shows.

• A small binary image (left) and its distance transform (right)

Page 8: Segmentation C. Andrés Méndez 17/04/2013. Where to find the presentations? mendezguerrero.

Watershed Segmentation• Exercise 4• Load blob.tif• Calculate and view the image transform• Process the image and use watershed

segmentation to separate both circles.

Page 9: Segmentation C. Andrés Méndez 17/04/2013. Where to find the presentations? mendezguerrero.

More on Watershed

• Another example• http://stackoverflow.com/questions/6691991/watershed-algorithm-

in-matlab

Page 10: Segmentation C. Andrés Méndez 17/04/2013. Where to find the presentations? mendezguerrero.

• If you are interested in segmentation (specially medical), take a look in http://www.itk.org/

• Also, interesting• http://cmm.ensmp.fr/~beucher/

wtshed.html