码迷,mamicode.com
首页 > 其他好文 > 详细

imshow() displays a white image for a grey image

时间:2016-12-15 20:25:16      阅读:214      评论:0      收藏:0      [点我收藏+]

标签:lan   range   matlab   splay   isp   show   class   follow   tag   

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

标签:lan   range   matlab   splay   isp   show   class   follow   tag   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!