How to detect edges in binary image?

I have obtained the image below after applying thresholding. The white areas inside the boundaries represent the defective part. I only want these defective parts on the image, like the ones inside the blue boxes. The approach in my mind is to use any edge detection algorithm and then subtract that image from the original one so that only defective parts remain on the image. I have used many edge detection algorithms, but I failed to obtain the desired result. How to extract boundaries or edges from the given image. Or is there any better way to solve this problem?

 Respuesta aceptada

Image Analyst
Image Analyst el 18 de Jul. de 2021

1 voto

Surely that is not your original image? The image you posted looks like an edge detection image. To get big clusters of white pixels, I'd first try an opening with imopen() to get rid of the thin grid lines. Then I'd try imclose() to try to merge the concentrated areas into more of solid blobs. Then I'd use bwareafilt() to try to extract only blobs of a known size.

2 comentarios

Umama Nasir
Umama Nasir el 18 de Jul. de 2021
Thanks! This is really helpful.
Image Analyst
Image Analyst el 18 de Jul. de 2021
You're welcome. Thanks for accepting the answer. You're not, by chance, doing damage assessment (like after an earthquake) are you? If so, check out papers on that:
For example, papers there show how to identify damaged buildings from aerial/satellit photos.

Iniciar sesión para comentar.

Más respuestas (0)

Productos

Versión

R2019a

Etiquetas

Preguntada:

el 18 de Jul. de 2021

Comentada:

el 18 de Jul. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by