Counting black pixels in a binary image
9 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
fatema ali
am 15 Dez. 2019
Kommentiert: fatema ali
am 15 Dez. 2019
How can I write a code to count the black pixels and the white pixels in a binary image?
0 Kommentare
Akzeptierte Antwort
Turlough Hughes
am 15 Dez. 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 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Image Processing Toolbox finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!