Borrar filtros
Borrar filtros

MATLAB detecting the largest open space in a binary image

3 visualizaciones (últimos 30 días)
Kanthi
Kanthi el 22 de Sept. de 2014
Comentada: Kanthi el 23 de Sept. de 2014
I am trying to obtain the area of the largest open (black) space (non-contiguous) in a binary image. The actual binary image is shown in "Original_Image.png" attachment. What I am looking for is the area of the region roughly bounded by the red line in the "Original_Image_red.png". Thanks for your help.

Respuesta aceptada

Image Analyst
Image Analyst el 22 de Sept. de 2014
You didn't attach the image. But the steps are (untested)
% Call bwlabel or bwconncomp on the inverted image.
cc = bwconncomp(~binaryImage);
% Measure the area of all the blobs.
measurements = regionprops(cc, 'Area');
allAreas = [measurements.Area]
% Find the biggest area and blob number
[maxArea, indexOfBiggestBlob] = max(allAreas);
  8 comentarios
Image Analyst
Image Analyst el 23 de Sept. de 2014
Can you go ahead and mark my answer as "Accepted" then? Thanks.
Kanthi
Kanthi el 23 de Sept. de 2014
I just did. Please let me know if I need to do anything else. Again...thanks for all your help!

Iniciar sesión para comentar.

Más respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by