Counting black pixels in a binary image
9 ビュー (過去 30 日間)
古いコメントを表示
How can I write a code to count the black pixels and the white pixels in a binary image?
0 件のコメント
採用された回答
Turlough Hughes
2019 年 12 月 15 日
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 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Convert Image Type についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!