【发布时间】:2013-06-24 14:04:21
【问题描述】:
我使用这些代码生成了灰度在 50 到 170 之间的 RGB 图像。
a='C:\Users\sepideh\Desktop\IP_abadpour\S45C-113050518040.jpg';
b=imread(a);
b=b+50;
b(b>170)=170;
你会看到,当我调用函数 max 和 min 时,证明灰度级在 50 到 170 之间。
max(max(max(b)))
ans =
170
min(min(min(b)))
ans =
50
然后我使用 imshow 和 imsave 函数将图像保存为名称“50to170”
c=imshow(b);
d=imsave(c);
现在我是这样读取写好的图片的:
a='C:\Users\sepideh\Desktop\IP_abadpour\50to170.jpg';
b=imread(a);
这一次当我调用 max 和 min 函数时,我看到了:
max(max(max(b)))
ans =
235
min(min(min(b)))
ans =
16
我的意思是,在使用 imshow 和 imsave 功能后,灰度级似乎发生了变化!
为什么会这样?
是因为我在使用 imsave 功能时使用的格式(.jpg)吗?
【问题讨论】:
标签: image matlab image-processing