Hi, i want to know dt how to get 0's and 1's from a binary image?

2 ビュー (過去 30 日間)
abhishek
abhishek 2014 年 3 月 31 日
コメント済み: Image Analyst 2014 年 3 月 31 日
Suppose i have a binary image and i wnt to select dt area whose binary values are 0's and 1's.
  2 件のコメント
Youssef  Khmou
Youssef Khmou 2014 年 3 月 31 日
the question is not clear, binary image is all (0,1) whats is the difference of the area dt?
Ankur Singh
Ankur Singh 2014 年 3 月 31 日
do u want to know no. of white and black pixel??
if yes,first read the binary image using imread and then u can write a logic to count 0's and 1's

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

採用された回答

Nitin
Nitin 2014 年 3 月 31 日
I = imread('img.bmp'); I_bin = im2bw(I);
% find the '0's in the image:
a = find(I_bin==0);
% find the '1's in the image:
b = find(I_bin==1);
  2 件のコメント
abhishek
abhishek 2014 年 3 月 31 日
tnx sir.
Image Analyst
Image Analyst 2014 年 3 月 31 日
I'm not sure what you're going to do, just having linear indices of where it is 1 and where it is 0 is virtually never required. You're probably heading down an inefficient path but since you didn't give the complete context, I don't know how to tell you the best way to proceed. Explain more about your application, and I'll tell you the right way to do it.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImage Processing Toolbox についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by