加入VIP
  • 专属下载特权
  • 现金文档折扣购买
  • VIP免费专区
  • 千万文档免费下载

上传资料

关闭

关闭

关闭

封号提示

内容

首页 matlab图像处理

matlab图像处理.pdf

matlab图像处理

yichow
2009-11-18 0人阅读 举报 0 0 暂无简介

简介:本文档为《matlab图像处理pdf》,可适用于IT/计算机领域

附录MATLAB图像处理命令.applylut功能:在二进制图像中利用lookup表进行边沿操作。语法:A=applylut(BW,lut)举例lut=makelut('sum(x(:))==',)BW=imread('texttif')BW=applylut(BW,lut)imshow(BW)figure,imshow(BW)相关命令:makelut.bestblk功能:确定进行块操作的块大小。语法:siz=bestblk(mn,k)mb,nb=bestblk(mn,k)举例siz=bestblk(,)siz=相关命令:blkproc.blkproc功能:MATLAB高级应用图形及影像处理实现图像的显式块操作。语法:B=blkproc(A,mn,fun)B=blkproc(A,mn,fun,P,P,)B=blkproc(A,mn,mbordernborder,fun,)B=blkproc(A,'indexed',)举例I=imread('alumgrnstif')I=blkproc(I,,'std(x)*ones(size(x))')imshow(I)figure,imshow(I,)相关命令:colfilt,nlfilter,inline.brighten功能:增加或降低颜色映像表的亮度。语法:brighten(beta)newmap=brighten(beta)newmap=brighten(map,beta)brighten(fig,beta)相关命令:imadjust,rgbplot.bwarea功能:计算二进制图像对象的面积。语法:total=bwarea(BW)举例BW=imread('circlestif')imshow(BW)附录MATLAB图像处理命令bwarea(BW)ans=相关命令:bweuler,bwperim.bweuler.功能:计算二进制图像的欧拉数。语法:eul=bweuler(BW,n)举例BW=imread('circlestif')imshow(BW)bweuler(BW)ans=–相关命令:bwmorph,bwperim.bwfill功能:填充二进制图像的背景色。语法:BW=bwfill(BW,c,r,n)BW=bwfill(BW,n)BW,idx=bwfill()BW=bwfill(x,y,BW,xi,yi,n)x,y,BW,idx,xi,yi=bwfill()BW=bwfill(BW,'holes',n)BW,idx=bwfill(BW,'holes',n)举例MATLAB高级应用图形及影像处理BW=BW=bwfill(BW,,,)BW=I=imread('bloodtif')BW=~imbw(I)BW=bwfill(BW,'holes')imshow(BW)figure,imshow(BW)相关命令:bwselect,roifill.bwlabel功能:标注二进制图像中已连接的部分。语法:附录MATLAB图像处理命令L=bwlabel(BW,n)L,num=bwlabel(BW,n)举例BW=L=bwlabel(BW,)L=r,c=find(L==)rc=rcrc=相关命令:bweuler,bwselect.bwmorph功能:提取二进制图像的轮廓。语法:BW=bwmorph(BW,operation)BW=bwmorph(BW,operation,n)举例BW=imread('circlestif')MATLAB高级应用图形及影像处理imshow(BW)BW=bwmorph(BW,'remove')BW=bwmorph(BW,'skel',Inf)imshow(BW)figure,imshow(BW)相关命令:bweuler,bwperim,dilate,erode.bwperim功能:计算二进制图像中对象的周长。语法:BW=bwperim(BW,n)举例BW=imread('circbwtif')BW=bwperim(BW,)imshow(BW)figure,imshow(BW)附录MATLAB图像处理命令相关命令:bwarea,bweuler,bwfill.bwselect功能:在二进制图像中选择对象。语法:BW=bwselect(BW,c,r,n)BW=bwselect(BW,n)BW,idx=bwselect()举例BW=imread('texttif')c=r=BW=bwselect(BW,c,r,)imshow(BW)figure,imshow(BW)相关命令:bwfill,bwlabel,impixel,roipoly,roifill.cmpermuteMATLAB高级应用图形及影像处理功能:调整颜色映像表中的颜色。语法:Y,newmap=cmpermute(X,map)Y,newmap=cmpermute(X,map,index)举例Toorderacolormapbyluminance,use:ntsc=rgbntsc(map)dum,index=sort(ntsc(:,))Y,newmap=cmpermute(X,map,index)相关命令:randperm.cmunique功能:查找颜色映像表中特定的颜色及相应的图像。语法:Y,newmap=cmunique(X,map)Y,newmap=cmunique(RGB)Y,newmap=cmunique(I)相关命令:grayind,rgbind.colim功能:将矩阵的列重新组织到块中。语法:A=colim(B,mn,mmnn,blocktype)A=colim(B,mn,mmnn)相关命令:blkproc,colfilt,imcol,nlfilter.colfilt功能:利用列相关函数进行边沿操作。语法:B=colfilt(A,mn,blocktype,fun)B=colfilt(A,mn,blocktype,fun,P,P,)B=colfilt(A,mn,mblocknblock,blocktype,fun,)B=colfilt(A,'indexed',)附录MATLAB图像处理命令相关命令:blkproc,colim,imcol,nlfilter.colorbar功能:显示颜色条。语法:colorbar('vert')colorbar('horiz')colorbar(h)colorbarh=colorbar()举例I=imread('bloodtif')h=fspecial('log')I=filter(h,I)imshow(I,),colormap(jet()),colorbar.conv功能:进行二维卷积操作。语法:C=conv(A,B)C=conv(hcol,hrow,A)C=conv(,shape)举例A=magic()A=MATLAB高级应用图形及影像处理B=B=C=conv(A,B)C=相关命令:filter.convmtx功能:计算二维卷积矩阵。语法:T=convmtx(H,m,n)T=convmtx(H,mn)相关命令:conv.convn功能:计算n维卷积。语法:C=convn(A,B)C=convn(A,B,shape)相关命令:conv.corr功能:计算两个矩阵的二维相关系数。附录MATLAB图像处理命令语法:r=corr(A,B)相关命令:std.dct功能:进行二维离散余弦变换。语法:B=dct(A)B=dct(A,m,n)B=dct(A,mn)举例RGB=imread('autumntif')I=rgbgray(RGB)J=dct(I)imshow(log(abs(J)),),colormap(jet()),colorbarJ(abs(J)<)=K=idct(J)imshow(K)相关命令:fft,idct,ifft.dctmtx功能:MATLAB高级应用图形及影像处理计算离散余弦变换矩阵。语法:D=dctmtx(n)相关命令:dct.dilate功能:放大二进制图像。语法:BW=dilate(BW,SE)BW=dilate(BW,SE,alg)BW=dilate(BW,SE,,n)举例BW=imread('texttif')SE=ones(,)BW=dilate(BW,SE)imshow(BW)figure,imshow(BW)相关命令:bwmorph,erode.dither功能:通过抖动增加外观颜色分辨率转换图像。语法:X=dither(RGB,map)BW=dither(I)相关命令:rgbind.double附录MATLAB图像处理命令功能:转换数据为双精度型。语法:B=double(A)举例A=imread('saturntif')B=sqrt(double(A))相关命令:imdouble,imuint,uint.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,'roberts',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)MATLAB高级应用图形及影像处理BW,threshold=edge(I,'canny',)举例I=imread('ricetif')BW=edge(I,'prewitt')BW=edge(I,'canny')imshow(BW)figure,imshow(BW).erode功能:弱化二进制图像的边界。语法:BW=erode(BW,SE)BW=erode(BW,SE,alg)BW=erode(BW,SE,,n)举例BW=imread('texttif')SE=ones(,)BW=erode(BW,SE)imshow(BW)figure,imshow(BW)相关命令:bwmorph,dilate附录MATLAB图像处理命令.fft功能:进行二维快速傅里叶变换。语法:B=fft(A)B=fft(A,m,n)举例loadimdemossaturnimshow(saturn)B=fftshift(fft(saturn))imshow(log(abs(B)),),colormap(jet()),colorbar相关命令:dct,fftshift,idct,ifft.fftn功能:进行n维快速傅里叶变换。语法:B=fftn(A)B=fftn(A,siz)相关命令:fft,ifftn.fftshiftMATLAB高级应用图形及影像处理功能:把快速傅里叶变换的DC组件移到光谱中心。语法:B=fftshift(A)举例B=fftn(A)C=fftshift(B)相关命令:fft,fftn,ifftshift.filter功能:进行二维线性过滤操作。语法:B=filter(h,A)B=filter(h,A,shape)举例A=magic()A=h=fspecial('sobel')h=–––B=filter(h,A,'valid')B=–––––––––相关命令:conv,roifilt.freqspace附录MATLAB图像处理命令功能:确定二维频率响应的频率空间。语法:f,f=freqspace(n)f,f=freqspace(mn)x,y=freqspace(,'meshgrid')f=freqspace(N)f=freqspace(N,'whole')相关命令:fsamp,fwind,fwind.freqz功能:计算二维频率响应。语法:H,f,f=freqz(h,n,n)H,f,f=freqz(h,nn)H,f,f=freqz(h,f,f)H,f,f=freqz(h)=freqz(h,,dxdy)=freqz(h,,dx)freqz()举例Hd=zeros(,)Hd(:,:)=Hd(:,:)=h=fwind(Hd,bartlett())colormap(jet())freqz(h,)axis(––).fsampMATLAB高级应用图形及影像处理功能:用频率采样法设计二维FIR过滤器。语法:h=fsamp(Hd)h=fsamp(f,f,Hd,mn)举例f,f=freqspace(,'meshgrid')Hd=ones()r=sqrt(f^f^)Hd((r<)|(r>))=colormap(jet())mesh(f,f,Hd)相关命令:conv,filter,freqspace,ftrans,fwind,fwind.fspecial功能:创建预定义过滤器。语法:h=fspecial(type)h=fspecial(type,parameters)举例I=imread('saturntif')h=fspecial('unsharp',)I=filter(h,I)imshow(I)figure,imshow(I)相关命令:conv,edge,filter,fsamp,fwind,fwind.ftrans功能:通过频率转换设计二维FIR过滤器。语法:附录MATLAB图像处理命令h=ftrans(b,t)h=ftrans(b)举例colormap(jet())b=remez(,,)H,w=freqz(b,,,'whole')plot(wpi–,fftshift(abs(H)))相关命令:conv,filter,fsamp,fwind,fwind.fwind功能:用一维窗口方法设计二维FIR过滤器。语法:h=fwind(Hd,win)h=fwind(Hd,win,win)h=fwind(f,f,Hd,)举例f,f=freqspace(,'meshgrid')Hd=ones()r=sqrt(f^f^)Hd((r<)|(r>))=colormap(jet())mesh(f,f,Hd)相关命令:conv,filter,fsamp,freqspace,ftrans,fwind.fwind功能:用二维窗口方法设计二维FIR过滤器。语法:h=fwind(Hd,win)h=fwind(f,f,Hd,win)举例f,f=freqspace(,'meshgrid')Hd=ones()r=sqrt(f^f^)Hd((r<)|(r>))=colormap(jet())mesh(f,f,Hd)MATLAB高级应用图形及影像处理相关命令:conv,filter,fsamp,freqspace,ftrans,fwind.getimage功能:从坐标轴取得图像数据。语法:A=getimage(h)x,y,A=getimage(h),A,flag=getimage(h)=getimage举例imshowricetifI=getimage.grayind功能:转换灰度图像为索引图像。语法:X,map=grayind(I,n)相关命令:indgray.grayslice功能:从灰度图像创建索引图像。语法:X=grayslice(I,n)X=grayslice(I,v)举例I=imread('ngcmtif')X=grayslice(I,)imshow(I)figure,imshow(X,jet())附录MATLAB图像处理命令相关命令:grayind.histeq功能:用柱状图均等化增强对比。语法:J=histeq(I,hgram)J=histeq(I,n)J,T=histeq(I,)举例I=imread('tiretif')J=histeq(I)imshow(I)figure,imshow(J)imhist(I,)figureimhist(J,)相关命令:brighten,imadjust,imhist.hsvrgb功能:转换HSV值为RGB颜色空间。语法:rgbmap=hsvrgb(hsvmap)RGB=hsvrgb(HSV)相关命令:MATLAB高级应用图形及影像处理rgbhsv,rgbplot.idct功能:计算二维离散反余弦变换。语法:B=idct(A)B=idct(A,m,n)B=idct(A,mn)相关命令:dct,dctmtx,fft,ifft.ifft功能:计算二维快速傅里叶反变换。语法:B=ifft(A)B=ifft(A,m,n)相关命令:fft,fftshift,idct.ifftn功能:计算n维快速傅里叶反变换。语法:B=ifftn(A)B=ifftn(A,siz)相关命令:fft,fftn,ifft.simbw功能:转换图像为二进制图像。语法:BW=imbw(I,level)BW=imbw(X,map,level)BW=imbw(RGB,level)举例loadtreesBW=imbw(X,map,)imshow(X,map)附录MATLAB图像处理命令figure,imshow(BW)相关命令:indgray,rgbgray.imcol功能:重调图像块为列。语法:B=imcol(A,mn,blocktype)B=imcol(A,mn)B=imcol(A,'indexed',)相关命令:blkproc,colim,colfilt,nlfilter.imdouble功能:转换图像矩阵为双精度型。语法:I=imdouble(I)RGB=imdouble(RGB)BW=imdouble(BW)X=imdouble(X,'indexed')相关命令:double,imuint,uint.imuint功能:转换图像阵列为位无符号整型。语法:I=imuint(I)RGB=imuint(RGB)BW=imuint(BW)X=imuint(X,'indexed')MATLAB高级应用图形及影像处理相关命令:imuint,double,imdouble,uint,imapprox,uint.imuint功能:转换图像阵列为位无符号整型。语法:I=imuint(I)RGB=imuint(RGB)X=imuint(X,'indexed')相关命令:imuint,double,imdouble,uint,uint,imapprox.imadjust功能:调整图像灰度值或颜色映像表。语法:J=imadjust(I,lowhigh,bottomtop,gamma)newmap=imadjust(map,lowhigh,bottomtop,gamma)RGB=imadjust(RGB,)举例I=imread('pouttif')J=imadjust(I,,)imshow(I)figure,imshow(J)相关命令:brighten,histeq.imapprox功能:对索引图像进行近似处理。语法:Y,newmap=imapprox(X,map,n)附录MATLAB图像处理命令Y,newmap=imapprox(X,map,tol)Y=imapprox(X,map,newmap)=imapprox(,ditheroption)相关命令:cmunique,dither,rgbind.imcontour功能:创建图像数据的轮廓图。语法:imcontour(I,n)imcontour(I,v)imcontour(x,y,)imcontour(,LineSpec)C,h=imcontour()举例I=imread('ictif')imcontour(I,)相关命令:clabel,contour,LineSpec.imcrop功能:剪切图像。语法:I=imcrop(I)X=imcrop(X,map)RGB=imcrop(RGB)I=imcrop(I,rect)X=imcrop(X,map,rect)RGB=imcrop(RGB,rect)MATLAB高级应用图形及影像处理=imcrop(x,y,)A,rect=imcrop()x,y,A,rect=imcrop()举例I=imread('ictif')I=imcrop(I,)imshow(I)figure,imshow(I)相关命令:zoom.imfeature功能:计算图像区域的特征尺寸。语法:stats=imfeature(L,measurements)stats=imfeature(L,measurements,n)举例BW=imread('texttif')L=bwlabel(BW)stats=imfeature(L,'all')stats()ans=Area:Centroid:BoundingBox:MajorAxisLength:MinorAxisLength:Eccentricity:Orientation:ConvexHull:xdouble附录MATLAB图像处理命令ConvexImage:xuintConvexArea:Image:xuintFilledImage:xuintFilledArea:EulerNumber:Extrema:xdoubleEquivDiameter:Solidity:Extent:PixelList:xdouble相关命令:bwlabel.imfinfo功能:返回图形文件信息。语法:info=imfinfo(filename,fmt)info=imfinfo(filename)举例info=imfinfo('canoetif')info=Filename:'canoetif'FileModDate:'Oct::'FileSize:Format:'tif'FormatVersion:Width:Height:BitDepth:ColorType:'indexed'FormatSignature:ByteOrder:'littleendian'NewSubfileType:BitsPerSample:Compression:'PackBits'PhotometricInterpretation:'RGBPalette'MATLAB高级应用图形及影像处理StripOffsets:xdoubleSamplesPerPixel:RowsPerStrip:StripByteCounts:xdoubleXResolution:YResolution:ResolutionUnit:'Inch'Colormap:xdoublePlanarConfiguration:'Chunky'TileWidth:TileLength:TileOffsets:TileByteCounts:Orientation:FillOrder:GrayResponseUnit:MaxSampleValue:MinSampleValue:Thresholding:相关命令:imread,imwrite.imhist功能:显示图像数据的柱状图。语法:imhist(I,n)imhist(X,map)counts,x=imhist()举例I=imread('pouttif')imhist(I)附录MATLAB图像处理命令相关命令:histeq.immovie功能:创建多帧索引图的电影动画。语法:mov=immovie(X,map)举例loadmrimov=immovie(D,map)相关命令:montage.imnoise功能:增加图像的渲染效果。语法:J=imnoise(I,type)J=imnoise(I,type,parameters)举例I=imread('eighttif')J=imnoise(I,'saltpepper',)imshow(I)figure,imshow(J)相关命令:rand.impixel功能:确定像素颜色值。语法:MATLAB高级应用图形及影像处理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,)举例RGB=imread('flowerstif')c=r=pixels=impixel(RGB,c,r)pixels=相关命令:improfile,pixval.improfile功能:沿线段计算剖面图的像素值。语法:c=improfilec=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)附录MATLAB图像处理命令=improfile(,method)举例I=imread('alumgrnstif')x=y=improfile(I,x,y),gridon相关命令:impixel,pixval.imread功能:从图形文件中读取图像。语法:A=imread(filename,fmt)X,map=imread(filename,fmt)=imread(filename)=imread(,idx)(TIFFonly)=imread(,ref)(HDFonly)=imread(,’BackgroundColor’,BG)(PNGonly)A,map,alpha=imread()(PNGonly)举例X,map=imread('flowerstif',)info=imfinfo('skullhdf')X,map=imread('skullhdf',info()Reference)bg=A=imread('imagepng','BackgroundColor',bg)MATLAB高级应用图形及影像处理A,map,alpha=imread('imagepng')相关命令:imfinfo,imwrite,fread,double,uint,uint.imresize功能:改变图像大小。语法:B=imresize(A,m,method)B=imresize(A,mrowsncols,method)B=imresize(,method,n)B=imresize(,method,h).imrotate功能:旋转图像。语法:B=imrotate(A,angle,method)B=imrotate(A,angle,method,'crop')举例I=imread('ictif')J=imrotate(I,–,'bilinear','crop')imshow(I)figure,imshow(J)相关命令:imcrop,imresize.imshow功能:显示图像。语法:附录MATLAB图像处理命令imshow(I,n)imshow(I,lowhigh)imshow(BW)imshow(X,map)imshow(RGB)imshow(,displayoption)imshow(x,y,A,)imshowfilenameh=imshow()相关命令:getimage,imread,iptgetpref,iptsetpref,subimage,truesize,warp.imwrite功能:把图像写入图形文件中。语法:imwrite(A,filename,fmt)imwrite(X,map,filename,fmt)imwrite(,filename)imwrite(,Param,Val,Param,Val)举例imwrite(X,map,'flowershdf','Compression','none','WriteMode','append')相关命令:imfinfo,imread.indgray功能:把检索图像转化为灰度图像。语法:I=indgray(X,map)举例loadtreesI=indgray(X,map)imshow(X,map)figure,imshow(I)MATLAB高级应用图形及影像处理相关命令:grayind,imshow,rgbntsc.indrgb功能:转化索引图像为RGB真彩图像。语法:RGB=indrgb(X,map)相关命令:indgray,rgbind.iptgetpref功能:获取图像处理工具箱参数设置。语法:value=iptgetpref(prefname)举例value=iptgetpref('ImshowAxesVisible')value=off相关命令:imshow,iptsetpref.iptsetpref功能:设置图像处理工具箱参数。语法:iptsetpref(prefname,value)举例iptsetpref('ImshowBorder','tight')相关命令:imshow,iptgetpref,truesize.iradon附录MATLAB图像处理命令功能:进行反Radon变换。语法:I=iradon(P,theta)I=iradon(P,theta,interp,filter,d,n)I,h=iradon()举例P=phantom()R=radon(P,:)I=iradon(R,:,'nearest','Hann')imshow(P)figure,imshow(I)相关命令:radon,phantom.isbw功能:判断是否为二进制图像。语法:flag=isbw(A)相关命令:isind,isgray,isrgb.isgray功能:判断是否为灰度图像。语法:flag=isgray(A)相关命令:isbw,isind,isrgb.isindMATLAB高级应用图形及影像处理功能:判断是否为索引图像。语法:flag=isind(A)相关命令:isbw

用户评价(2)

  • 124.42.50.86 《附录 MATLAB 图像处理命令》,处理命令的总结

    2011-02-15 18:42:01

  • 218.89.177.5 对初学者来说,这是个很不错的课件。多谢分享!

    2010-02-24 05:38:14

关闭

新课改视野下建构高中语文教学实验成果报告(32KB)

抱歉,积分不足下载失败,请稍后再试!

提示

试读已结束,如需要继续阅读或者下载,敬请购买!

文档小程序码

使用微信“扫一扫”扫码寻找文档

1

打开微信

2

扫描小程序码

3

发布寻找信息

4

等待寻找结果

我知道了
评分:

/10

matlab图像处理

仅供在线阅读

VIP

在线
客服

免费
邮箱

爱问共享资料服务号

扫描关注领取更多福利