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的更多相关文章

  1. MATLAB中imshow()和image()

    MATLAB中imshow()和image(): IMSHOW Display image in Handle Graphics figure. IMSHOW(I) displays the gray ...

  2. imshow(A,[])和imshow(A)的区别

    imshow的用法: IMSHOW Display image. IMSHOW(I,N) displays the intensity image I with N discrete levels o ...

  3. OpenCV学习笔记——imread、imwrite以及imshow

    1.imread Loads an image from a file. 从文件中读取图像. C++: Mat imread(const string& filename, int flags ...

  4. Ubuntu14 搭载vim环境查看源码

    首先是下载完整的vim74,然后编译安装.遗憾的是当编译时,没有开启图形界面. 在安装新版本的Vim之前,你需要卸载原来安装的老版本Vim,依次在终端下执行下列命令: sudo apt-get rem ...

  5. 【转】手把手教你把Vim改装成一个IDE编程环境(图文)

    手把手教你把Vim改装成一个IDE编程环境(图文) By: 吴垠 Date: 2007-09-07 Version: 0.5 Email: lazy.fox.wu#gmail.com Homepage ...

  6. javascript实现的图数据结构的广度优先 搜索(Breadth-First Search,BFS)和深度优先搜索(Depth-First Search,DFS)

    最后一例,搞得快.三天之内走了一次.. 下一步,面象对像的javascript编程. function Dictionary(){ var items = {}; this.has = functio ...

  7. vim配置及插件安装管理(超级详细)

    1 写在前面   Linux下编程一直被诟病的一点是: 没有一个好用的IDE, 但是听说Linux牛人, 黑客之类的也都不用IDE. 但是对我等从Windows平台转移过来的Coder来说, 一个好用 ...

  8. vim配置及插件安装管理(超级详细)[转]

    1 写在前面   Linux下编程一直被诟病的一点是: 没有一个好用的IDE, 但是听说Linux牛人, 黑客之类的也都不用IDE. 但是对我等从Windows平台转移过来的Coder来说, 一个好用 ...

  9. vim 高级使用技巧

    前言:逃离windows有很长时间了,特别是当今android盛行的时代,我们没有理由不选择ubuntu作为编译开发android之首选.其实操作系统只是我们使用的一个工具, windows也好lin ...

随机推荐

  1. scala getter and setter

    package exp { object Main { def main(args: Array[String]): Unit = { B.name ="Fred"; printl ...

  2. Linux安装node

    以Ubuntu为例 1.apt-get update 2.apt-get install python gcc make g++ 3.wget https://nodejs.org/dist/v4.3 ...

  3. Haskell Platform (windows)

    一.下载地址:https://www.haskell.org/platform/windows.html Haskell Platform 整合了 Glasgow Haskell Compiler,W ...

  4. python tips(持续更新)

    1. 引用上一层目录 import syssys.path.append('..')import xx 2. python json JSON是一种轻量级的数据交换格式.可以解决数据库中文存储问题,对 ...

  5. 数组操作splice

    今天,实现某个功能时需要操作数组, var  array=[1,2,3,3,4]; console.log(array);           //结果: 1,2,3,3,4 var data=arr ...

  6. selenium+python环境搭建

    1.安装python-2.7.3.msi 2.安装pywin32-216.win32-py2.7.exe 3.下selenium包,selenium-2.35.0.tar.gz,放到D:\autote ...

  7. AngularJs的UI组件ui-Bootstrap分享(十)——Model

    Model是用来创建模态窗口的,但是实际上,并没有Model指令,而只有$uibModal服务,创建模态窗口是使用$uibModal.open()方法. 创建模态窗口时,要有一个模态窗口的模板和对应的 ...

  8. sysctl.conf网络内核参数说明(转)

    下面是我的理解,可能有误,仅供参考. 要调优,三次/四次握手必须烂熟于心. client                  server(SYN_SENT)      —>  (SYN_RECV ...

  9. JavaScript判断数据类型

    JavaScript中判断数据类型的方式有三种: 1.typeof typeof 1;   //"number" typeof "abc";  //" ...

  10. css3中transition和animation的回调处理

    弱鸡最近在准备面试,网上找了一些题,发现一些基础题也完全答不好(┬_┬)看来还是要再接再励啊w(゚Д゚)w 言归正传,今天的主题是CSS3中的动画回调处理,这里动画执行完毕后触发的事件是transit ...