I have a binary image, how can I count the balck pixels as a group??
Mostra commenti meno recenti
I process a rgb image to gray to binary and use filters to remove noise and get some specific black areas. Now I want to count the areas. How many are there? How can I do that? can anyone help me?

Risposta accettata
Più risposte (1)
Image Analyst
il 30 Ott 2016
You can get it by inverting your image and calling bwlabel:
[labeledImage, numRegions] = bwlabel(~binaryImage);
No need to call regionprops() just to get the count, though you might want to if you want to measure other things like areas.
Categorie
Scopri di più su Image Filtering in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!