Counting black pixels in a binary image
9 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
fatema ali
le 15 Déc 2019
Commenté : fatema ali
le 15 Déc 2019
How can I write a code to count the black pixels and the white pixels in a binary image?
0 commentaires
Réponse acceptée
Turlough Hughes
le 15 Déc 2019
Let's say you have a binary image B. You can get the number of black pixels by:
numBlack=nnz(~B);
and the number of white pixels by:
numWhite=nnz(B);
2 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Convert Image Type dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!