【发布时间】:2013-01-13 18:25:14
【问题描述】:
我有一个 double 的图像,我想用 unsigned int 16 位显示它,所以我这样做了:
I = im2uint16(I);
figure;imshow(I);title('Image being saved')
这表明了这一点(带有正常的噪音):
现在我想用位深度为 16 位的 .png 来编写此图像。我愿意:
imwrite(I,'image.png','BitDepth',16);
现在用 Photoshop CS5 或 Windows Photo Viwer 打开的图像看起来像这样:(噪音神奇地消失了):
有人能解释一下这种奇怪的行为吗?
如何重现此错误
在C:\test\image I used here下载:
现在运行这个脚本:
I = im2double(imread('C:\test\test_matlab.tif'));
% Add gaussian noise with variance = 0.0012
I = imnoise(I,'gaussian',0,0.0012);
figure,imshow(I);
imwrite(I,'C:\test\withNoise.tif');
比较matlab中的图和保存的文件
【问题讨论】:
-
我无法在 R2013a 上使用
I = repmat(linspace(0,1,512),512,1); I = I+randn(size(I))*0.1; I16 = im2uint16(I); imwrite(I16,'test.png','BitDepth',16)重现此问题,并在 IrfanView 或 Photoshop CS4 中打开 -
我也无法在 R2012b 上重现它。
-
可以和我们分享一下原始数据吗?
-
只是为了确保,当您使用
imshow时,您使用的是默认的 matlab 颜色图(64 色)还是 photoshop 使用的颜色图(256 色)... -
@leonbloy 在我手中,它看起来很不错。
标签: image matlab image-processing png