I am trying to find a two maximum Area of the lung in a binary image showing below. Thats mean the two Area of the biggest lung what code should I use ? thank you :)
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Sebastian Maca
el 16 de Sept. de 2021
Comentada: Sebastian Maca
el 20 de Sept. de 2021
0 comentarios
Respuesta aceptada
Harikrishnan Balachandran Nair
el 20 de Sept. de 2021
Editada: Harikrishnan Balachandran Nair
el 20 de Sept. de 2021
Hi,
From my understanding , you want to find the values of largest two areas in the image. You can use the 'regionprops' function to compute properties of connected components in the input binary image. In this case, the property parameter can be set to 'area', and the largest two areas can be found out by sorting the output returned by regionprops function in descending order. The following code can be used for the same.
stats=regionprops(bw,'area');
areasorted=sort([stats.Area],'descend');
Now, the first two values in the array 'areasorted' will give the areas of objects having the maximum two areas in the image.
Más respuestas (0)
Ver también
Categorías
Más información sobre 3-D Volumetric Image Processing en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!