How can I count the pixels in a black and white image?
2 ビュー (過去 30 日間)
古いコメントを表示
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/329177/image.jpeg)
0 件のコメント
回答 (1 件)
Image Analyst
2020 年 7 月 8 日
Try this:
numberOfPixels = numel(binaryImage)
numberOfWhitePixels = nnz(binaryImage)
numberOfBlackPixels = numberOfPixels - numberOfWhitePixels
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Audio and Video Data についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!