最新Matlab图像处理函数汇总.docx
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_1.gif)
![资源得分’ title=](/images/score_05.gif)
《最新Matlab图像处理函数汇总.docx》由会员分享,可在线阅读,更多相关《最新Matlab图像处理函数汇总.docx(25页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、精品资料Matlab图像处理函数汇总.1、图像的变换 fft2:fft2函数用于数字图像的二维傅立叶变换,如:i=imread(104_8.tif);j=fft2(i);ifft2::ifft2函数用于数字图像的二维傅立叶反变换,如:i=imread(104_8.tif);j=fft2(i);k=ifft2(j);2、模拟噪声生成函数和预定义滤波器 imnoise:用于对图像生成模拟噪声,如:i=imread(104_8.tif);j=imnoise(i,gaussian,0,0.02);%模拟高斯噪声 fspecial:用于产生预定义滤波器,如:h=fspecial(sobel);%sobe
2、l水平边缘增强滤波器h=fspecial(gaussian);%高斯低通滤波器h=fspecial(laplacian);%拉普拉斯滤波器h=fspecial(log);%高斯拉普拉斯(LoG)滤波器h=fspecial(average);%均值滤波器2、图像的增强直方图:imhist函数用于数字图像的直方图显示,如:i=imread(104_8.tif);imhist(i);直方图均化:histeq函数用于数字图像的直方图均化,如:i=imread(104_8.tif);j=histeq(i);对比度调整:imadjust函数用于数字图像的对比度调整,如:i=imread(104_8.tif
3、);j=imadjust(i,0.3,0.7,);对数变换:log函数用于数字图像的对数变换,如:i=imread(104_8.tif);j=double(i);k=log(j);基于卷积的图像滤波函数:filter2函数用于图像滤波,如:i=imread(104_8.tif);h=1,2,1;0,0,0;-1,-2,-1;j=filter2(h,i);线性滤波:利用二维卷积conv2滤波, 如:i=imread(104_8.tif);h=1,1,1;1,1,1;1,1,1;h=h/9;j=conv2(i,h);中值滤波:medfilt2函数用于图像的中值滤波,如:i=imread(104_8
4、.tif);j=medfilt2(i);锐化(1)利用Sobel算子锐化图像, 如:i=imread(104_8.tif);h=1,2,1;0,0,0;-1,-2,-1;%Sobel算子j=filter2(h,i);(2)利用拉氏算子锐化图像, 如:i=imread(104_8.tif);j=double(i);h=0,1,0;1,-4,0;0,1,0;%拉氏算子k=conv2(j,h,same);m=j-k;3、图像边缘检测sobel算子 如:i=imread(104_8.tif);j = edge(i,sobel,thresh)prewitt算子 如:i=imread(104_8.tif)
5、;j = edge(i,prewitt,thresh)roberts算子 如:i=imread(104_8.tif);j = edge(i,roberts,thresh)log算子 如:i=imread(104_8.tif);j = edge(i,log,thresh)canny算子 如:i=imread(104_8.tif);j = edge(i,canny,thresh)Zero-Cross算子 如:i=imread(104_8.tif);j = edge(i,zerocross,thresh)4、形态学图像处理膨胀:是在二值化图像中“加长”或“变粗”的操作,函数imdilate执行膨胀运
6、算,如:a=imread(104_7.tif); %输入二值图像b=0 1 0;1 1 1;0 1 0;c=imdilate(a,b);腐蚀:函数imerode执行腐蚀,如:a=imread(104_7.tif); %输入二值图像b=strel(disk,1);c=imerode(a,b);开运算:先腐蚀后膨胀称为开运算,用imopen来实现,如:a=imread(104_8.tif);b=strel(square,2);c=imopen(a,b);闭运算:先膨胀后腐蚀称为闭运算,用imclose来实现,如:a=imread(104_8.tif);b=strel(square,2);c=imc
7、lose(a,b);Matlab 图像处理相关函数命令大全一、通用函数:colorbar 显示彩色条语法:colorbar colorbar(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,low high) imshow(BW) imshow(X,map
8、) imshow(RGB) imshow(.,display_option) imshow(x,y,A,.) imshow filename h=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) subimage(
9、RGB) subimage(x,y,.) subimage(.)truesize 调整图像显示尺寸语法:truesize(fig,mrows mcols) truesize(fig)warp 将图像显示到纹理映射表面语法:warp(X,map) warp(I ,n) warp(z,.) warp(x,y,z,.) h=warp(.)zoom 缩放图像语法:zoom on zoom off zoom out zoom reset zoom zoom xon zoom yon zoom(factor) zoom(fig,option)二、图像文件I/O函数命令imfinfo 返回图形图像文件信息语
10、法:info=imfinfo(filename,fmt) info=imfinfo(filename)imread 从图像文件中读取(载入)图像语法:A=imread(filename,fmt) X,map=imread(filename,fmt) .=imread(filename) .=imread(URL,.) .=imread(.,idx) (CUR,ICO,and TIFF only) .=imread(.,frames,idx) (GIF only) .=imread(.,ref) (HDF only) .=imread(.,BackgroundColor,BG) (PNG onl
11、y) A,map,alpha =imread(.) (ICO,CUR,PNG only)imwrite 把图像写入(保存)图像文件中语法:imwrite(A,filename,fmt) imwrite(X,map,filename,fmt) imwrite(.,filename) imwite(.,Param1,Val1,Param2,Val2.)imcrop 剪切图像语法:I2=imcrop(I) X2=imcrop(X,map) RGB2=imcrop(RGB) I2=imcrop(I,rect) X2=imcrop(RGB,rect) .=imcrop(x,y,.) A,rect=imc
12、rop(.) x,y,A,rect=imcrop(.)imresize 改变图像大小语法:B=imresize(A,m,method)imrotate 旋转图像语法:B=imrotate(A,angle,method) B=imrotate(A,angle,method,crop)三、像素和统计处理函数corr2 计算两个矩形的二维相关系数语法:r=corr2(A,B)imcontour 创建图像数据的轮廓图语法:imcontour(I,n) imcontour(I,v) imcontour(x,y,.) imcontour(.,LineSpec) C,h =imcontour(.)imfea
13、ture 计算图像区域的特征尺寸语法:stats=imfeature(L,measurements) stats=imfeature(L,measurements,n)imbist 显示图像数据的柱状图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,RGB,xi,yi) P=impixel(x,y,
14、X,map,xi,yi) xi,yi,P=impixel(x,y,.)improfile 沿线段计算剖面图的像素值语法:c=improfile c=improfile(n) c=improfile(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 显示图像像素信息语法:p
15、ixval onstd2 计算矩阵元素的标准偏移语法:b=std2(A)四、图像分析函数:edge 图像边缘检测语法:BW=edge(I,sobel) BW=edge(I,sobel,thresh) BW=edge(I,sobel,thresh,direction) BW,thresh=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,ro
16、berts,thresh) BW,thresh=edge(I,roberts,.) BW=edge(I,log) BW=edge(I,log,thresh) BW=edge(I,log,thresh,sigma) BW,threshold=edge(I,log,.) BW=edge(I,zerocross,thresh,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,.)qtgetbl
17、k 获取四叉树分解的块值语法:vals,r,c=qtgetblk(I,S,dim) vals,idx=qtgetblk(I,S,dim)qtsetblk 设置四叉树分解中的块值语法:J=qtsetblk(I,S,dim,vals)五、图像增强函数histeq 用柱状图均等化增强对比语法:J=histeq(I,hgram) J=histeq(I,n) J,T=histeq(I,.) newmap=histeq(X,map,hgram) newmap=histeq(X,map)imadjust 调整图像灰度值或颜色映像表语法:J=imadjust(I,low_in ,high_in),low_ou
18、t ,high_out,gamma) newmap=imadjust(map,low_in ,high_in),low_out ,high_out,gamma) RGB2=imadjust(RGB1,.)imnoise 增强图像的渲染效果语法:J=imnoise(I,type) J=imnoise(I,type,parameters)medfilt2 进行二维中值过滤语法:B=medfilt2(A,m n) B=medfilt2(A) B=medfilt2(A,indexed,.)ordfilt2 进行二维统计顺序过滤语法:B=ordfilt2(A,order,domain) B=ordfil
19、t2(A,order,domain,S) B=ordfilt2(.,padopt)wiener2 进行二维适应性去噪过滤处理语法:J=wiener2(I,m n,noise) J,noise=wiener2(I,m n)六、线性滤波函数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 进行二维线性
20、过滤操作语法:Y=filter2(h,X) Y=filter2(h,X,shape)fspecial 创建预定义过滤器语法:h=fspecial(type) h=fspecial(type,parameters)七、线性二维滤波设计函数freqspace 确定二维频率响应的频率空间语法:f1,f2=freqspace(n) f1,f2=freqspace(m n) x1 ,y1=freqspace(.,meshgrid) f=freqspace(N) f=freqspace(N,whole)freqz2 计算二维频率响应语法:H,f1,f2=freqz2(h,n1,n2) H,fi,f2=fr
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 最新 Matlab 图像 处理 函数 汇总
![提示](https://www.taowenge.com/images/bang_tan.gif)
限制150内