How to count number of objects in the image, compute their areas, and make probability distribution of the areas?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
JM
el 30 de Dic. de 2022
Editada: Image Analyst
el 31 de Dic. de 2022
Hello friends,
I just would like to know how to calculate the objects of image and do the area distribution.
Thanks so much in advance.
0 comentarios
Respuesta aceptada
Image Analyst
el 30 de Dic. de 2022
In your other question, I saw that you already have a segmented image. So in that case, you can get an area distribution like this
props = regionprops(mask, 'Area');
histogram([props.Area]);
grid on;
title('Histogram of Areas');
xlabel('Area');
ylabel('Count');
4 comentarios
Image Analyst
el 31 de Dic. de 2022
Editada: Image Analyst
el 31 de Dic. de 2022
No, that's not right. PixelValue is a list of gray levels of all the pixels in each blob. If you want to know the number of pixels in each blob, you need to ask for 'Area':
props = regionprops(mask, 'Area');
allAreas = [props.Area]
You might use bwmorph and use things like the 'bridge' option to break apart barely touching particles. You might also look at watershed. See these links:
Más respuestas (0)
Ver también
Categorías
Más información sobre Image Processing 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!