1 / 25

数字图像处理

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

viho
Download Presentation

数字图像处理

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

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

  3. 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 The MATLAB Image Processing Toolbox

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

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

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

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

  8. 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. Displaying an image(cont.) • Low=100 • High=200

  9. Spatial domain Displaying an image(cont.)

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

  11. 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 Displaying an image(cont.)

  12. 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). Writing an image

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

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

  15. 图像二值化 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 Digital Image processing

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

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

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

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

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

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

  22. 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) More Example

  23. 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'); More Example(cont.)

  24. 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) More Example(cont.)

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

More Related