MATLAB图像处理工具箱函数讲课讲稿.doc
《MATLAB图像处理工具箱函数讲课讲稿.doc》由会员分享,可在线阅读,更多相关《MATLAB图像处理工具箱函数讲课讲稿.doc(34页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、MATLABMATLAB 图像图像处理工具箱函数处理工具箱函数Good is good,but better carries it.精益求精,善益求善。-表 A-1 通用函数-函数功能语法Colorbar显示颜色条colorbarcolorbar(Vert)colorbar(horiz)colorbar(h_h=colorbar()colorbar(,peer,axes_handle)Getimage从坐标轴取得图形数据A=getimage(h)x,y,A=getimage(h),A,flag=getimage(h)=getimageImshow显示图像Imshow(I,n)Imshow(I,
2、lowhigh)Imshow(BW)-Imshow(X,map)Imshow(RGB)Imshow(,display_option)Imshow(x,y,A,)ImshowfilenameH=Imshow()Montage在矩形框中同时显示多幅图像montage(I)montage(BW)montage(X,map)montage(RGB)h=montage()Immovie创建多帧索引色mov=immovie(X,map)mov=immovie(RGB)-图像的电影动画Subimage在一幅图中显示多个图像Subimage(X,map)Subimage(I)Subimage(BW)Subim
3、age(RGB)Subimage(x,y,)H=subimage()Truesize调整图像显示尺寸Truesize(fig,mrowsmcols)Truesize(fig)Warp将图Warp(X,map)-表 A-2 几何操作函数像显示到纹理映射表面Warp(I,n)Warp(z,)Warp(x,y,z,)H=warp()Zoom缩放图像ZoomonZoomoffZoomoutZoomresetzoomzoomxonzoomyonzoom(factor)zoom(fig,option)-函数功能语法Imcrop剪切图像I2=imcrop(I)X2=imcrop(X,map)RGB2=imc
4、rop(RGB)I2=imcrop(I,rect)RGB2=imcrop(RGB,rect)=imcrop(x,y,)A,rect=imcrop()x,y,A,rect=imcrop()Imresize改变图像大小B=imresize(A,m,method)Imrotate旋转图像B=imrotate(A,angel,method)B=imrotate(A,angel,method,crop)-表 A-3 图像文件 I/O 函数函数功能语法Imfinfo返回图形文件信息Info=imfinfo(filename,fmt)Info=imfinfo(filename)Imread从图形文件中读取图
5、像A=imrea(filename,fmt)X,map=imrea(filename,fmt)=imread(filename)=imread(URL,)=imread(idx)(CUR,ICO,andTIFFonly)=imread(,frames,idx)(GIFonly)=imread(,ref)(HDFonly)=imread(,backGrounColor,BG)(PNGonly)A,map,alpha=imread()(ICO,CURandPNGonly)-Imwrite把图像写入图形文件中Imwrite(A,filename,fnt)Imwrite(X,map,filename,
6、fmt)Imwrite(,filename)Imwrite(,Param1,Val1,Param2,Val2,)表 A-4 线性滤波函数函数功能语法Conv2进行二维卷积操作C=conv2(A,B)C=conv2(hcol,hrow,A)C=conv2(,shape)Convmtx2计算二维卷积矩阵T=convmtx2(H,m,n)T=convmtx2(H,m,n)Convn计算 n 维卷积C=convn(A,B)C=convn(A,B,shape)-Filter2进行二维线性过滤操作Y=filter2(h,x)Y=filter2(h,X,shape)Fspecial创建预定义过滤器H=fsp
7、ecial(type)H=fspecial(type,parameters)表 A-5 像素和统计处理函数函数功能语法Corr2计算两个矩阵的二维相关系数R=corr2(A,B)Imcontour创建图像数据的轮廓图Imcontour(I,n)Imcontour(I,v)Imcontour(x,y,)Imcontour(,lineSpec)C,h=imcontour()-Imfeature计算图像区域的特征尺寸Stats=imfeature(L,measurements)Stats=imfeature(L,measurements,n)Imhist显示图像数据的柱状图Imhist(I,n)Im
8、hist(X,map)count,X=imhist()Impixel确定像素颜色值P=impixel(I)P=impixel(X,map)P=impixel(RGB)P=impixel(I,c,r)P=impixel(X,map,C,r)P=impixel(RGB,c,r)c,r,P=impixel()P=impixel(x,y,I,xi,yi)P=impixel(x,y,X,map,xi,yi)P=impixel(x,y,RGB,xi,yi)-xi,yi,P=impixel(x,y,)Improfile沿线段计算剖面图的像素值C=improfileC=improfile(n)C=improf
9、ile(I,xi,yi)C=improfile(I,xi,yi,n)cx,cy,c=improfile()cx,cy,c,xi,yi=improfile()=improfile(x,y,I,xi,yi,)=improfile(x,y,I,xi,yi,n)=improfile(,method)Mean2计算矩阵元素的平均值B=mean2(A)Pixval显示图像像素信息PixvalonStd2计算矩阵B=std2(A)-元素的标准偏移表 A-6 图像增强函数函数功能语法Histeq用柱状图均衡化增强对比J=histeq(I,hgram)J=histeq(I,n)J,T=histeq(I,)New
10、map=histeq(X,map,hgram)Newmap=histeq(X,map)newmap,T=histeq(X,)Imadjust调整图像灰度值或J=imadjust(I,low_inhigh_in,low_outhigh_out,gamma)Newmap=imadjust(map,low_inhigh_in,low_outhigh_out,gamma)RGB2=imadjust(RGB1,)-颜色映射表Imnoise增强图像渲染效果J=imnoise(I,type)J=imnoise(I,type,parameters)Medfilt2进行二维中值过滤B=medfilt2(A,m,
11、n)B=medfilt2(A)B=medfilt2(A,indexed,)Ordfilt2进行二维统计顺B=ordfilt2(A,order,domain)B=ordfilt2(A,order,domain,S)B=ordfilt2(,padopt)-序过滤Wiener2进行二维适应性去噪过滤处理J=wiener2(I,m,n,noise)J,noise=wiener2(I,m,n)表 A-7 图像分析函数函数功能语法Edge识别强度图像中BW=edge(I,sobel)BW=edge(I,sobel,thresh)BW=edge(I,sobel,thresh,direction)BW,thr
12、esh=edge(I,sobel,)-的边界BW=edge(I,prewitt)BW=edge(I,prewitt,thresh)BW=edge(I,prewitt,thresh,direction)BW,thresh=edge(I,prewitt,)BW=edge(I,roberts)BW=edge(I,roberts,thresh)BW,thresh=edge(I,roberts,)BW=edge(I,log)BW=edge(I,log,thresh)BW=edge(I,log,thresh,sigma)BW,thresh=edge(I,log,)BW=edge(I,zerocross,t
13、hresh,h)BW,thresh=edge(I,zerocross,)BW=edge(I,canny)BW=edge(I,canny,thresh)BW=edge(I,canny,thresh,sigma)BW,threshold=edge(I,canny,)Qtgetblk获取四叉vals,r,c=qtgetblk(I,S,dim)vals,idx=qtgetblk(I,S,dim)-树中的块值Qtsetblk设置四叉树中的块值J=qtsetblk(I,S,dim,vals)表 A-8 线性二维滤波设计函数函数功能语法Frespace确定二维频率响应频率空间f1,f2=freqspace(
14、n)f1,f2=freqspace(m,n)x1,y1freqspace(,meshgrid)F=freqspace(N)F=freqspace(N,whole)-Freqz2计算二维频率响应H,f1,f2=freqz2(h,n1,n2)H,f1,f2=freqz2(h,n2,n1)H,f1,f2=freqz2(h,f1,f2)H,f1,f2=freqz2(h)=freqz2(h,dx,dy)=freqz2(h,dx)Freqz2()Fsamp2用频率采样法设计二维FIR过滤器H=fsamp2(Hd)H=fsamp2(f1,f2,Hd,m,n)Ftrans2通过频率转换设计二维FIR过滤器H=
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- MATLAB 图像 处理 工具箱 函数 讲课 讲稿
限制150内