Borrar filtros
Borrar filtros

Layer Area in the image

1 visualización (últimos 30 días)
mustafa alnasser
mustafa alnasser el 1 de Mzo. de 2014
Comentada: Image Analyst el 3 de Mzo. de 2014
Dear All;
I have an image of three layer, I need to calculate the area of each of them , I use the regionprop to do that but I got only numbers but I need to know that for Layer 1 has x area and layer 2 has y area , so, how can I know that ?

Respuestas (1)

Image Analyst
Image Analyst el 1 de Mzo. de 2014
I'm not sure what you're asking. You said you used regionprops to get the areas. You just need to do this one layer (image) at a time and sum up the areas
thisLayersMeasurements = regionprops(labeledImage, 'Area');
allAreas = [thisLayersMeasurements.Area] % There might be multiple regions.
sumOfAllAreas = sum(allAreas);
repeat the above for each layer image.
  2 comentarios
mustafa alnasser
mustafa alnasser el 3 de Mzo. de 2014
Thank you man for your answer My question is not to find the area of each region but to give label to each one , either by text or color . For example, I have three layers on top of each other and i want to give blue color to the top one ,red for the middle and green for the bottom one , how can i do that
Image Analyst
Image Analyst el 3 de Mzo. de 2014
Use the function label2rgb().

Iniciar sesión para comentar.

Community Treasure Hunt

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

Start Hunting!

Translated by