How to count image binary

1 回表示 (過去 30 日間)
mohd akmal masud
mohd akmal masud 2019 年 7 月 30 日
編集済み: KALYAN ACHARJYA 2019 年 7 月 31 日
Hi all
if i have binary image, how to calculate the white pixel, and black pixel?
  5 件のコメント
Adam Danz
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.
mohd akmal masud
mohd akmal masud 2019 年 7 月 31 日
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

サインインしてコメントする。

採用された回答

KALYAN ACHARJYA
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 件)

カテゴリ

Help Center および File ExchangeImages についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by