How to find the area of each of the blobs in the image and create a histogram of the number of blobs in each size range

13 visualizaciones (últimos 30 días)
Hi! I am trying to find the number of pixels in each of the blobs in the image and create a histogram that shows the number of blobs in each size range ( 0%-10% of the biggest blob size, 10%-20% of biggest blob size ... 90%-100% of the biggest blob size).
I've able to find the total number of pixels in all the blobs altogether but I am having trouble finding the number of blobs present and also the individual numbers of pixels within each blob. Would appreciate any help
Thanks!

Respuesta aceptada

Image Analyst
Image Analyst el 14 de Jun. de 2022
It does all that. Just change it to use your image instead of the demo image. Key points would be
mask = grayImage < someValue;
props = regionprops(mask, 'Area');
numBlobs = numel(props)
allAreas = [props.Area]
edges = linspace(0, max(allAreas), 11);
histogram(allAreas, edges);

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