Borrar filtros
Borrar filtros

remove wanted portions in binary image

3 visualizaciones (últimos 30 días)
Elysi Cochin
Elysi Cochin el 30 de Nov. de 2013
Comentada: Elysi Cochin el 2 de Dic. de 2013
i wanted to extract only the white portion from the image
i get more than one region... i should get only one region.... please do reply.....

Respuesta aceptada

Image Analyst
Image Analyst el 30 de Nov. de 2013
There is a function for removing blobs smaller than a specified size. It's called bwareaopen():
cleanedBinaryImage = bwareaopen(binaryImage, 40); % Remove blobs smaller than 40.
Alternatively you can use a function I wrote to keep, or eliminate, the N largest, or smallest (whichever you specify), blobs. See attached demo in blue text below. This is more general and flexible than bwareaopen, but more complicated.
  1 comentario
Elysi Cochin
Elysi Cochin el 2 de Dic. de 2013
Editada: Elysi Cochin el 2 de Dic. de 2013
thank you so much sir for the reply... it helped me a lot.... thank u sir....

Iniciar sesión para comentar.

Más respuestas (1)

Jeremy Wurbs
Jeremy Wurbs el 30 de Nov. de 2013
If you wish to remove small regions from the binary image itself, you could start by looking at morphological operations ( help bwmorph), specifically erode and dilate.
You could also just remove the small regions from your bounding box list, or just take the largest one. I.e. only take bounding boxes where boundingBox(3)*boundingBox(4) >= minSize.

Categorías

Más información sobre Biomedical Imaging en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by