How can I count the number of white pixels in a binary image with MATLAB?
How can I count the number of white pixels in a b开发者_如何学Cinary image with MATLAB?
The function NNZ should do the trick, since "white" is represented as 1 and "black" as 0 in a binary image img
:
nWhite = nnz(img);
精彩评论