简体   繁体   中英

How can I read png file as binary (0 and 1) in Matlab?

I can read a bmp file as binary ( imread('char/C.bmp') => ans=[1 1 0 0 0] ) but when it comes to png files I cannot ( imread('char/C.png') => ans=[9 7 7 7 7 2] ) .
What should I do to convert binary form?

使用im2bw将图像转换为二进制图像。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM