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 vues (au cours des 30 derniers jours)
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!

Réponse acceptée

Image Analyst
Image Analyst le 14 Juin 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);

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by