Presentation is loading. Please wait.

Presentation is loading. Please wait.

何清波 博士 副教授 中国科学技术大学 精密机械与精密仪器系 安徽合肥 电话:

Similar presentations


Presentation on theme: "何清波 博士 副教授 中国科学技术大学 精密机械与精密仪器系 安徽合肥 电话:"— Presentation transcript:

1 何清波 博士 副教授 中国科学技术大学 精密机械与精密仪器系 安徽合肥 Email:qbhe@ustc.edu.cn 电话: 3607985
中国科学技术大学研究生课程 (PI05302) 数字图像处理 何清波 博士 副教授 中国科学技术大学 精密机械与精密仪器系 安徽合肥 电话:

2 The MATLAB Image Processing Toolbox
The Image Processing Toolbox is a collection of MATLAB functions (called M-functions or M-files) that extend the capability of the MATLAB environment for the solution of digital image processing problems.

3 The MATLAB Image Processing Toolbox
Including: -Spatial image transformations -Morphological operations -Neighborhood and block operations -Linear filtering and filter design -Transforms - Image analysis and enhancement -Image registration -Deblurring -Region of interest operations

4 How do I know M-function?
Find it in Matlab Help. -by category. -by alphabetical order. Find it on the textbook.

5 Matlab 内建图像 C:\MATLAB7\toolbox\images\imdemos 皆为Matlab Help中范例的原始图像。
使用时只需直接在指令中输入文件名,即可使用。 适用于观察影像处理结果

6 Reading an image imread() 功用:将图像加载并存成array格式备用
用法:[I,map] = imread(filename); I = imread(filename); ex: I = imread ('pout.tif'); I为指向影像的变量 不指定变数,则为ans

7 Displaying an image imshow() 功用:开启一个窗口显示影像 用法: imshow(I) imshow(I,map)
Figure, imshow() 功用:开启一个新窗口显示影像 用法: figure,imshow(I)

8 Displaying an image(cont.)
imshow(I, [low, high]) imshow(I, [ ]) 功用:displays I as a grayscale intensity image, specifying the data range for I. The minimum value in I is displayed as black, and the maximum value is displayed as white. Low =100 High=200

9 Displaying an image(cont.)
Spatial domain

10 Displaying an image(cont.)
pixval : 功能:cursor on image to show pixel values 用法: imshow(I),pixval (impixelinfo in V7.8 or R2009a)

11 Displaying an image(cont.)
colorbar 功能:To display an image with a colorbar that indicates the range of intensity values. 用法: imshow(I), colorbar   ex: I = imread('pout.tif'); imshow(I) , colorbar

12 Writing an image imwrite() 功能: Write image to graphics file.
用法: imwrite(I,filename,format) ex: imwrite(I,'pout.jpg‘,’JPEG’); Note that ‘I’ should be uint8 format If not, ‘I’ should be written as uint8(I).

13 Image information Image size: size() ex: I= imread('saturn.png');
size(I) [M,N] = size(I) M=Height of image I N=Width of image I

14 Image information whos 功用:display information about an image .
ex: whos I Imfinfo( filename ) 功用: display information about image file . ex: info = imfinfo('saturn.png') Name Size Bytes Class Attributes I x uint8

15 Digital Image processing
图像二值化 g = im2bw(I, T); 功用:Convert intensity image I to binary image g using threshold T, where T must be in range [0, 1]. ex: I= imread('pout.tif'); g = im2bw(I, 0.4); imshow(g) ,colorbar

16 Digital Image processing(cont.)
彩色转灰阶 rgb2gray() 功用:将RBG彩色影像转换成gray-level影像。 ex: I= imread ('saturn.png'); g = rgb2gray(I); imshow(g), colorbar

17 Digital Image processing(cont.)
反相 imcomplement( ) 功用:The negative of an image. ex: J = imcomplement(g); imshow(J),

18 Digital Image processing(cont.)
变更影像大小 imresize(I,scale,method); 功用:To change the size of an image. interpolation Method: -'nearest‘ :Nearest-neighbor interpolation -'bilinear‘ :Bilinear (the default) -'bicubic‘ :Bicubic interpolation

19 Digital Image processing(cont.)
ex: I = imread('circuit.tif'); J = imresize(I,1.25); imshow(I) figure, imshow(J)

20 Digital Image processing(cont.)
ex: I = imread('circuit.tif'); J = imresize(I,[ ], 'bilinear'); imshow(I) figure, imshow(J)

21 Digital Image processing(cont.)
旋转影像 imrotate(I, angle); 功用:To rotate an image. ex: I = imread('pout.tif'); J = imrotate(I,35); imshow(J)

22 More Example I=imread('cameraman.tif');
Using affine transformation 1.Rotation 45 degree I=imread('cameraman.tif'); T = maketform('affine',[cosd(45) -sind(45) 0; sind(45) cosd(45) 0; 0 0 1]); tformfwd([10 20],T); I2 = imtransform(I,T); imshow(I2)

23 More Example(cont.) 2.Translation I = imread('cameraman.tif');
se = translate(strel(1), [25 25]); J = imdilate(I,se); imshow(I), title('Original') figure, imshow(J), title('Translated');

24 More Example(cont.) 3.shear I=imread('cameraman.tif');
T = maketform('affine',[1 0 0; 1 2 0; 0 0 1]); tformfwd([10 20],T); I2 = imtransform(I,T); imshow(I2)

25 结束! Note 一定要学会使用help命令 一定要适应采用M文件编程 一定要熟练掌握矩阵的操作


Download ppt "何清波 博士 副教授 中国科学技术大学 精密机械与精密仪器系 安徽合肥 电话:"

Similar presentations


Ads by Google