MATLAB: How to calculate the white area pixels amount

Image Processing Toolboxthanks

how to calculate the white area pixels amount?

Best Answer

Try this:
numWhitePixels = nnz(binaryImage);
Other ways
numWhitePixels = sum(binaryImage(:));
whiteArea = bwarea(binaryImage);