calculate the percentage of B&W image
11 ビュー (過去 30 日間)
古いコメントを表示
I have a black and white image, how do I calculate the percentage of the white area over the black area?
0 件のコメント
回答 (2 件)
Nithin Banka
2018 年 6 月 29 日
If 'BW' is your binary threshold image,
pix = size(BW);
no_of_pix = pix(1)*pix(2);
no_of_white_pix = sum(sum(BW==1));
percent_of_white_pix = no_of_white_pix*100/no_of_pix; %This gives the percentage of white in the image.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Denoising and Compression についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!