首页 > 其他 > 详细

imshow() displays a white image for a grey image

时间:2016-12-15 20:23:09      阅读:278      评论:0      收藏:0      [点我收藏+]

Matlab expects images of type double to be in the 0..1 range and images that are uint8 in the 0..255 range. You can convert the range yourself (but change values in the process), do an explicit cast (and potentially loose precision) or instruct Matlab to use the minimum and maximum value found in the image matrix as the white and black value to scale to when visualising.

See the following example with an uint8 image present in Matlab:

im = imread(‘moon.tif‘);
figure; imshow(im);
figure; imshow(double(im));
figure; imshow(double(im), []);
figure; imshow(im2double(im));

use imshow(uint8(image)); on the image before displaying it.

imshow() displays a white image for a grey image

原文:http://www.cnblogs.com/xiangping/p/6184322.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!