How do I count number of white cirlces in a bw image

2 views (last 30 days)
Hello
I have the following image. How do I count the Number of white regions (region fully enclosed by black pixels)? There are about 22 in this picture (counted manually). How to code it? Any help is much appreciated!!
Best Regards, Omar

Accepted Answer

Image Analyst
Image Analyst on 25 Jun 2017
Use bwlabel():
[labeledImage, numRegions] = bwlabel(binaryImage);

More Answers (0)

Categories

Find more on Image Processing Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!