简体   繁体   中英

How can I count the number of white pixels in a binary image with MATLAB?

如何用MATLAB计算二进制图像中的白色像素数?

函数NNZ应该可以解决问题,因为“white”在二进制图像img表示为1,“black”表示为0:

nWhite = nnz(img);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM