How to count image binary
1 次查看(过去 30 天)
显示 更早的评论
Hi all
if i have binary image, how to calculate the white pixel, and black pixel?
5 个评论
Adam Danz
2019-7-31
Do you mean you want to calculate the location of a single white pixel? Or you want to determine if a given coordinate is a white pixel? Maybe a picture will help.
采纳的回答
KALYAN ACHARJYA
2019-7-31
编辑:KALYAN ACHARJYA
2019-7-31
Let's say input binary image is image_bw
result=bwareafilt(image_bw,1,'Largest');
count_w=sum(result);
fprintf('The white pixel count is: %d',count_w);
0 个评论
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!