How to i get binary number from image ?
古いコメントを表示
how to get binary number from image? what tools or function in matlab? this is example image :


回答 (1 件)
Adam
2017 年 2 月 16 日
If the image is greyscale and only has values of 0 or 'non-zero' then it is just trivially
binaryVals - logical( myImage );
If it is in true RGB and you still just want effectively black and 'non-black' (which in this case looks like it is all just white) then
binaryVals = logical( sum( myImage, 3 ) );
should work.
4 件のコメント
afif fadilah
2017 年 2 月 16 日
編集済み: afif fadilah
2017 年 2 月 16 日
Adam
2017 年 2 月 16 日
I don't understand what you mean by the 'image' below. You can see the binary values in the variable editor, but you can't plot them in an image as visible 1s and 0s like that. The image on top is a usual representation of a binary image and the code I gave you should give you the values that make up that image.
afif fadilah
2017 年 3 月 6 日
カテゴリ
ヘルプ センター および File Exchange で Images についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

