Image segmentation in matlab

Hello, i am trying to extract an object from an image. I want to extract the butterfly from the image. I tried using otsu thresholding and the result i get are not satisfied. I want to extract it perfectly with just the butterfly only. Anyone can provide me some guidance?

 Respuesta aceptada

Image Analyst
Image Analyst el 8 de Abr. de 2017

1 voto

The computer doesn't know that butterflies aren't supposed to have pointy triangle heads so it would be hard to get rid of that part unless you had know shape templates that you could fit to it, perhaps using the Hausdorf distance.
To get rid of the black thing on the lower left, you can try to use imclose() followed by bwareafilt(~binaryImage, 1) to extract only the largest blob. Better would be to probably start with a full color image with less noise in it.
Worst case you can use imfreehand() to "chop off" the parts you don't want. Demo attached.

3 comentarios

Image Analyst
Image Analyst el 8 de Abr. de 2017
Easy, except for the triangular head thing. Just find dark pixels that are not in the red - green range of hues. Try the HSV color segmentation demo in my File Exchange http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862&sort=downloads_desc
or else try the Color Thresholder app on the Apps tab of the tool ribbon.
Image Analyst
Image Analyst el 9 de Abr. de 2017
What happened to your original image? It's not attached anymore. Also, please attach your m-file.

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Aún no se han introducido etiquetas.

Preguntada:

el 8 de Abr. de 2017

Editada:

el 10 de Abr. de 2017

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by