フィルターのクリア

How can I count the pixels in a black and white image?

2 ビュー (過去 30 日間)
Mara Pereira
Mara Pereira 2020 年 7 月 8 日
回答済み: Image Analyst 2020 年 7 月 8 日
How can I count the pixels in a black and white image?

回答 (1 件)

Image Analyst
Image Analyst 2020 年 7 月 8 日
Try this:
numberOfPixels = numel(binaryImage)
numberOfWhitePixels = nnz(binaryImage)
numberOfBlackPixels = numberOfPixels - numberOfWhitePixels

カテゴリ

Help Center および File ExchangeAudio and Video Data についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by