How to count blobs with a given threshold in an image
3 views (last 30 days)
Show older comments
Mamuna Anwar
on 23 May 2018
Answered: Image Analyst
on 24 May 2018
Hi everyone, I need to count the number of blobs with a given threshold in an image? Can somebody please help me there.
0 Comments
Accepted Answer
Akira Agata
on 24 May 2018
One possible solution would be like this:
% Read sample image
I = imread('coins.png');
% Threshold
th = 100;
% Blobs where I > th
BW = I > th;
% Count number of blobs
s = regionprops(BW);
numBlob = numel(s);
Result:
>> numBlob
numBlob =
10
More Answers (1)
Image Analyst
on 24 May 2018
See my Image Segmentation Tutorial: https://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862&sort=downloads_desc
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!