Azzera filtri
Azzera filtri

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

2 visualizzazioni (ultimi 30 giorni)
How can I count the pixels in a black and white image?

Risposte (1)

Image Analyst
Image Analyst il 8 Lug 2020
Try this:
numberOfPixels = numel(binaryImage)
numberOfWhitePixels = nnz(binaryImage)
numberOfBlackPixels = numberOfPixels - numberOfWhitePixels

Community Treasure Hunt

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

Start Hunting!

Translated by