imshow
来源:互联网 发布:手机财务记账软件 编辑:程序博客网 时间:2024/05/03 08:07
imshow
Description
- imshow(I) displays image I in a Handle Graphics® figure, where I is a grayscale, RGB (truecolor), or binary image.
For binary images, imshow displays pixels with the value 0 (zero) as black and 1 as white.
imshow optimizes figure, axes, and image object properties for image display.
- imshow(I,[low high]) displays the grayscale image I, where [low high] is a two-element vector that specifies the display range for I.
The value low (and any value less than low) displays as black and the value high (and any value greater thanhigh) displays as white.
imshow displays values in between as intermediate(中间的) shades of gray.
- imshow(I,[]) displays the grayscale image I, where [] is an empty matrix that specifies that you want imshow to scale the image based on the range of pixel values in I, using [min(I(:)) max(I(:))] as the display range.
- imshow(X,map) displays the indexed image X with the colormap map. A colormap matrix can have any number of rows, but it must have exactly 3 columns. Each row is interpreted as a color, with the first element specifying the intensity of red light, the second green, and the third blue. Color intensity can be specified on the interval 0.0 to 1.0.
- imshow(filename) displays the image stored in the graphics file specified by filename.
- imshow(___,Name,Value) displays an image, using name-value pairs to control aspects of the operation.
- himage = imshow(___) returns the handle to the image object created by imshow.
(本博客系原创,转载请注明出处:http://blog.csdn.net/xuexiyanjiusheng/article/details/46956635)
(博主cnblogs中对应文章:http://www.cnblogs.com/pfli1995/p/4658677.html)
注意:
- 为了节省存储空间,matlab为图像提供了特殊的数据类型uint8(8位无符号整数),以此方式存储的图像称作8位图像。
因此,matlab读入图像的数据是uint8,而matlab中数值一般采用double型(64位)存储和运算。所以要先将图像转为double格式的才能运算。
- 注意,imshow并不是只能显示灰度图像,如果unit8型或者double型数据是三维的,那么就会输出彩色图像。
- double型的取值为0~1之间,unit8取值0~255。如果是double类型,并且范围不是0~1,那么超过1的都被看作1,会显示为白色。
- 设 I 是一个uint8型的图像,如果直接 double(I) 再 imshow(double(I)) 的话,会输出错误的图像,有很多地方为白色,这个时候,需要先把转换为double后的图像的像素值先归一化到0~1区间,即 imshow(double(I)./255);第二种方法是,直接用 im2double ,会自动归一化到0~1,此时 imshow(im2double(I)) 即得到正确输出。 注意, im2double(I) 和 double(I)./255 是完全等价的,可以用它们分别作用后的矩阵相减,发现全为0。
- 如果想把数据从 double 型还回到 uint8 型,也有两种方法。 一是:im2uint8(I) ; 另一种是:uint8(round(I*255))。注意,博主也验证过了,这两种方法也是完全等效的。
- 另外还发现了一个函数:mat2gray, 它能够将范围在 0~255 的 uint8 或者 double 型的矩阵/图像数据转化为 0~1 的 double 型矩阵/图像数据。
读取索引图像:
Display Indexed Image
Read a sample indexed image, corn.tif, into the workspace, and then display it.
[X,map] = imread('corn.tif');imshow(X,map)
- imshow
- cv::imshow
- 【OpenCV】imshow
- opencv imshow
- imshow()函数
- Matlab imshow
- imshow(A,[])与imshow(A)不同
- MATLAB函数imshow简介
- imshow使用OpenCV
- imshow imagesc
- matlab中imshow
- imshow,imagesc,image区别
- imshow的用法
- matlab的imshow问题
- imshow的输入数据格式
- c++ imshow(img)
- matplotlib.pyplot.imshow
- imshow显示图像灰色
- 创建多线程API调用类成员函数的方式
- eclipse+webservice开发实例
- Tomcat启动闪退情况
- badboy+jMeter+jProfile软件测试工具介绍(二)
- 设计模式--代理模式
- imshow
- js语言的语法与c语言不同的地方小结
- 数论之欧几里德算法(三)
- 数值优化(Numerical Optimization)学习系列-信赖域方法
- 股票学习30(公司财务分析01)
- java开发webservice的几种方式
- 【phpcms v9】phpcms-v9系统中file文件缓存机制相关文件
- Open Source LTE 开源LTE 简介
- 在Ubuntu 14.04 64bit上安装批量图片处理器XnConvert