Filling objects that share a border
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi,
I have a question about filling in objects that share a border with the perimeter of an image.
Consider a case such as the one shown at: http://i43.tinypic.com/2nq9ua.jpg. If I run the imfill function to fill in the holes, I don’t get the five objects that touch the border of the image filled (I have pointed out the specific areas I am talking about, in this image: http://i41.tinypic.com/5afeo4.jpg).
Is there any strategy I could follow to fill holes in those areas that are outlined using the arrows?
Thanks in advance!
1 comentario
Respuesta aceptada
Image Analyst
el 4 de Sept. de 2013
Editada: Image Analyst
el 5 de Sept. de 2013
- Binarize and Invert the image: binaryImage = grayImage <128
- Call imfill(binaryImage, 'holes')
- call regionprops(binaryImage, 'BoundingBox') asking for bounding box
- Look at the 4 sides of all the bounding boxes looking for any objects that share any bounding box side coordinate.
Give it a shot.
3 comentarios
Más respuestas (1)
Anand
el 6 de Sept. de 2013
Steve Eddins just posted about this. Here's an alternative approach:
0 comentarios
Ver también
Categorías
Más información sobre Deep Learning Toolbox en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!