How to i get binary number from image ?
1 次查看(过去 30 天)
显示 更早的评论
how to get binary number from image? what tools or function in matlab? this is example image :
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/160792/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/160793/image.jpeg)
0 个评论
回答(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.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Convert Image Type 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!