Count centroids in an image
Mostra commenti meno recenti
Hey I have this binary image, with the centroids detetced but I need a way to count them so I get an output as number of characters is 7. I haven't been able to find a function or any way to do this. 

5 Commenti
Adam Danz
il 9 Nov 2019
How are you plotting the blue * ?
Adam Kelly
il 9 Nov 2019
darova
il 9 Nov 2019
Only using 2 centoids? (1 and 2)?
plot(centroids(:,1),centroids(:,2),'b*')
Matt J
il 10 Nov 2019
but I need a way to count them
Why not just
numel(s)
Adam Danz
il 10 Nov 2019
@Adam Kelly, it looks like you've got several suggestions here. Let us know if you get stuck or if you're looking for something different.
Risposte (1)
Arash Rabbani
il 10 Nov 2019
Why not simply label the binary image? and 'Num' would be the number of characters.
[Label, Num]=bwlabel(Image)
Categorie
Scopri di più su Image Segmentation in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!