声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 3873|回复: 2

[图像处理] matlab 怎么样保存为位深度为1的二值图像?

[复制链接]
发表于 2007-3-3 15:01 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
在matlab中,我将0-1数据矩阵 imwrite(Key,'mimi.bmp','bmp');  保存得到的mimi.bmp为位深度为8的图像,数值为0和255,请哪位大虾能帮我解决这个问题?是用imwrite函数直接得到位深度为1的二值图像.谢谢了.
回复
分享到:

使用道具 举报

发表于 2007-3-3 15:27 | 显示全部楼层
原帖由 sxf372284 于 2007-3-3 15:01 发表
在matlab中,我将0-1数据矩阵 imwrite(Key,'mimi.bmp','bmp');  保存得到的mimi.bmp为位深度为8的图像,数值为0和255,请哪位大虾能帮我解决这个问题?是用imwrite函数直接得到位深度为1的二值图像.谢谢了.



help imwrite 就可以发现:

If the input array is of class logical, imwrite assumes the data is a binary image and writes it to the file with a bit depth of 1, if the format allows it. BMP, PNG, or TIFF formats accept binary images as input arrays.
 楼主| 发表于 2007-3-5 09:42 | 显示全部楼层
谢谢 楼上的朋友,其实我当时也看到了这句话,只是当时没有仔细去研究,现在问题已经解决了,谢谢你真的!:handshake :handshake
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-9-24 19:25 , Processed in 0.051422 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表