Counting black pixels in a binary image
9 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
fatema ali
il 15 Dic 2019
Commentato: fatema ali
il 15 Dic 2019
How can I write a code to count the black pixels and the white pixels in a binary image?
0 Commenti
Risposta accettata
Turlough Hughes
il 15 Dic 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 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Convert Image Type in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!