首页 > 代码库 > imshow() displays a white image for a grey image
imshow() displays a white image for a grey image
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
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。