数字图像处理-第二章

上传人:n**** 文档编号:54093771 上传时间:2018-09-07 格式:PPT 页数:45 大小:5.20MB
返回 下载 相关 举报
数字图像处理-第二章_第1页
第1页 / 共45页
数字图像处理-第二章_第2页
第2页 / 共45页
数字图像处理-第二章_第3页
第3页 / 共45页
数字图像处理-第二章_第4页
第4页 / 共45页
数字图像处理-第二章_第5页
第5页 / 共45页
点击查看更多>>
资源描述

《数字图像处理-第二章》由会员分享,可在线阅读,更多相关《数字图像处理-第二章(45页珍藏版)》请在金锄头文库上搜索。

1、chart 02 Fundamentals,2.1 Digital Image Representation数学图像的表示 2.2 Reading Images读图像 2.3 Displaying Images显示图像 2.5 Data Classes (omitted, self-study)数据的类型(略,自学) 2.6 Image Types图像的类型 2.7 Converting between Data Classes and Image Types图像类型与数据类型之间的转换 2.8 Array Indexing (omitted, self-study)数组的索引(下标)(略,自

2、学) 2.9 Some Important Standard Arrays (omitted)一些重要的标准数组(略) 2.10 M-Function Programming (omitted, self-study)M-函数编程(略,自学),An image may be defined as a two-dimensional function, f (x,y) , where x and y are spatial (plane) coordinates, and the amplitude of f at any pair of coordinates (x,y) is called

3、the intensity or gray level of the image at that point. 一幅图像被定义为一个二元(维)函数f(x,y),x和y是空间(平面)坐坐标,在坐标对(x,y)处的幅值f称为图像在该点处的亮度值或灰度等级(或灰度级)Color images are formed by a combination of individual 2-D images. For example, in the RGB color system, a color image consists of three (red, green, and blue) individua

4、l component images. 颜色图像可由单个2维图像组合而成。例如在RGB颜色系统中,颜色图像是由三个单色成份(即红、绿和蓝)的图像组成。For this reason , many of the techniques developed for monochrome images can be extended to color images by processing the three component images individually. 据此,许多针对单色图像所开发的技术,要以扩展到彩色图像上。即通过单独对三个成份图像分别处理。,2.1 Digital Image

5、Representation,实例说明,I=imread(2353.jpg); imshow(I); I1 = I;I2=I;I3 = I; I1(:,:,1) =I(:,:,1); I1(:,:,2) =0; I1(:,:,3) =0; I2(:,:,2)=I(:,:,2); I2(:,:,1)=0; I2(:,:,3)=0; I3(:,:,3)=I(:,:,3); I3(:,:,1)=0; I3(:,:,2)=0; figure;imshow(I); figure;imshow(I1); figure;imshow(I2); figure;imshow(I3);,实现代码:,An imag

6、e may be continuous with respect to the x- and y-coordinates, and also in amplitude.一幅图像关于x和y坐标可以是连续的(即位置上连接),幅值也可以是连续的(即亮度上是连续的)。Converting such an image to digital form requires that the coordinates, as well as the amplitude, be digitized. 将上述连续图像转换成数字形式,需要将坐标x、y和幅度f数字化。Digitizing the coordinate v

7、alues is called sampling; digitizing the amplitude values is called quantization. 将坐标值数字化称为采样;幅值的数字化称为量化。Thus, when x, y, and the amplitude values of f are all finite, discrete quantities, we call the image a digital image.因而,当x、y和幅度f都是有限的离散的量时,我们称图像为数字图像。,2.1 Digital Image Representation,The result

8、 of sampling and quantization is a matrix of real numbers. We use two principal ways in this book to represent digital images. 采样和量化的结果将得到一个实数矩阵。在本书中我们使用两个主要方法来表示图像。Assume that an image f(x,y) is sampled so that the resulting image has M rows and N columns. We say that the image is of size MN. The v

9、alues of the coordinates (x,y) are discrete quantities. 设图像f(x,y)是一采样后的图像,因此它有M行和N列。我们称图像的大小(或尺寸)是MN,坐标(x,y)的值是离散的量。For notational clarity and convenience, we use integer values for these discete coordinates. 为表示上的清晰和方便,我们使用整数值来表示这些离散的坐标,2.1.1 Coordinate Conventions,图 采样网格 (a) 正方形网格; (b) 正六角形网格,图2-2

10、 采样示意图,实例说明,434348,图2-3 量化示意图 (a) 量化; (b) 量化为8 bit,图2-4 不同采样点数对图像质量的影响 (a)原始图像(256256);(b)采样图像1(128128); (c) 采样图像2(6464); (d)采样图像3(3232); (e)采样图像4(1616);(f) 采样图像5(88),图2-5 不同量化级别对图像质量的影响 (a) 原始图像(256色); (b) 量化图像1(64色); (c) 量化图像2(32色); (d) 量化图像3(16色); (e) 量化图像4(4色); (f) 量化图像5(2色),一般,当限定数字图像的大小时, 为了得到

11、质量较好的图像可采用如下原则:(1) 对缓变的图像, 应该细量化, 粗采样, 以避免假轮廓。(2) 对细节丰富的图像, 应细采样, 粗量化, 以避免模糊(混叠)。对于彩色图像,是按照颜色成分红(R)、绿(G)、蓝(B)分别采样和量化的。若各种颜色成分均按8 bit量化,即每种颜色量级别是256, 则可以处理256256256=16 777 216种颜色。,In many image processing books, the image origin is defined to be at (x,y)=(0,0). The next coordinate values along the fi

12、rst row of the image are (x,y)=(0,1).许多图像处理教材中,图像原点被定义为(x,y)=(0,0).即参考起始点的坐标值定义为(0,0),位置从第0行第0列位置开始计数,沿着图像第一行的下一个坐标值是(x,y)=(0,1),即第0行第1列的位置。It is important to keep in mind that the notation (0,1) is used to signify the second sample along the first row. It does not mean that these are the actual val

13、ues of physical coordinates when the image was sampled. 需要记住的一个要点是:符号(0,1)被用于标记沿第一行的第二个采样点。当图像被采样时,(0,1)等坐标值并不代表物理坐标的真实值,它代表的仅仅是采样点的相对位置。如(i,j)坐标表示第i行第j个的采样点。,2.1.1 Coordinate Conventions,实例说明,Figure 2.1(a) shows this coordinate convention. Note that x ranges from 0 to M-1, and y from 0 to N-1 , in

14、integer increments. 下图显示坐标约定。注意x的范围是0到M-1,y的范围是N-1,按整数值递增,Figure 2.1(a),The coordinate convention used in the toolbox to denote arrays is different from the preceding paragraph in two minor ways. 工具箱中的坐标约定和前面段落中的坐标约定,在两个小的方面上有所不同。First , instead of using (x,y), the toolbox uses the notation (r,c) to

15、 indicate rows and columns. 首先工具箱使用符号 (r,c)来表示行数和列数,而不是使用(x,y)The other difference is that the origin of the coordinate system is at (r,c) = (1,1);另一个不同之处就是在工具箱的坐标系统中,坐标的原点是在(r,c) = (1,1),即第一行的第一个列位置上的采样点是从(1,1)开始计数,也就是说,第一行记为第1行,而不是第0行(别的教材将图像的第一行记为第0行),同样列亦如此。thus, r ranges from 1 to M, and c from

16、 1 to N, in integer increments. This coordinate convention is shown in Fig.2.1(b)因此,r的范围从1到M,c的范围是从1到N,按整数值递增。这一坐标约定如图2.1(b)所示,Figure 2.1(b),Representation for a digitized image function: 数字图像函数的表示,2.1.2 Image as Matrices,A digital image can be represented naturally as a MATLAB matrix: 在MATLAB的IPT中,

17、数字图像表示成一个如下的MATLAB矩阵,Images are read into the MATLAB environment using function imread , whose syntax is :使用函数imread 将图像读入到MATLAB工作环境中,其语法如下:A = imread(filename, fmt)X, map = imread(.). = imread(filename). = imread(., idx) CUR or ICOA, map, alpha = imread(.) CUR or ICO. = imread(., idx) GIF. = imread(., frames, idx) GIF. = imread(.,BackgroundColor,BG) PNGA, map, alpha = imread(.) PNG. = imread(., idx) TIFF. = imread(., PixelRegion, ROWS, COLS) TIFF,

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 电子/通信 > 综合/其它

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号