Hi all
if i have binary image, how to calculate the white pixel, and black pixel?

5 个评论

Ha! Funny response, darova.
sorry, im newbie in matlab.
i want to calculate the white pixel in some location. i have row and colom
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.
Untitled.jpg
Hi Adam, i want to calculate no of white pixel in red circle. let say the area row is 100-130, column 110-140. Please help me

请先登录,再进行评论。

 采纳的回答

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 个)

类别

帮助中心File Exchange 中查找有关 Images 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by