Count Object on color
6 views (last 30 days)
Show older comments
hanis nadhirah
on 7 Nov 2019
Commented: hanis nadhirah
on 9 Nov 2019
Hello , I just use threshold app to isolate object with same color. However , i try use bwlabel to count object from result but it does not count . Can you help me ? Thank you.
0 Comments
Accepted Answer
Image Analyst
on 7 Nov 2019
Call it then call bwlabel():
[BW,maskedRGBImage] = createMask(RGB);
[labeledImage, regionCount] = bwlabel(BW);
regionCount is the count of the colored objects you masked out.
5 Comments
Image Analyst
on 8 Nov 2019
Thanks for accepting the answer. You might also use bwareafilt() or bwareaopen() to remove noise while leaving the shape of the other blobs unchanged. imopen() and imclose() will change the shape of blobs, which may or may not be acceptable to you. imclose() will tend to make blobs rounder/smoother while imopen() tends to make blobs pointier.
More Answers (0)
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!