MATLAB7.X圖像處理常用函數(shù)列表_第1頁
MATLAB7.X圖像處理常用函數(shù)列表_第2頁
MATLAB7.X圖像處理常用函數(shù)列表_第3頁
MATLAB7.X圖像處理常用函數(shù)列表_第4頁
MATLAB7.X圖像處理常用函數(shù)列表_第5頁
已閱讀5頁,還剩9頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)

文檔簡介

MATLAB圖像處理工具箱函數(shù)PAGE第13頁共14頁MATLAB圖像處理工具箱函數(shù)表1通用函數(shù)函數(shù)功能語法colorbar顯示顏色條colorbarcolorbar(...,'peer',axes_handle)colorbar(axes_handle)colorbar('location')colorbar(...,'PropertyName',propertyvalue)cbar_axes=colorbar(...)getimage從坐標(biāo)軸取得圖像數(shù)據(jù)A=getimage(h)[x,y,A]=getimage(h)[...,A,flag]=getimage(h)[...]=getimageimage創(chuàng)建并顯示圖像對象image(C)image(x,y,C)image(...,'PropertyName',PropertyValue,...)image('PropertyName',PropertyValue,...)Formalsyntax-PN/PVonlyhandle=image(...)imagesc按圖像顯示數(shù)據(jù)矩陣imagesc(C)imagesc(x,y,C)imagesc(...,clims)h=imagesc(...)imshow顯示圖像imshow(I,n)imshow(I,[lowhigh])imshow(BW)imshow(X,map)imshow(RGB)imshow(…,display_option)imshow(x,y,A,…)imshowfilenameh=imshow(…)imview利用圖像瀏覽器顯示圖像imview(I)imview(RGB)imview(X,map)imview(I,range)imview(filename)imview(...,'InitialMagnification',initial_mag)h=imview(...)imviewcloseallmontage在矩形框中同時顯示多幀圖像montage(I)montage(BW)montage(X,map)montage(RGB)h=montage(...)immovie創(chuàng)建多幀索引色圖像的電影動畫mov=immovie(X,map)mov=immovie(RGB)subimage在一個圖形中顯示多個圖像,結(jié)合函數(shù)subplot使用subimage(X,map)subimage(I)subimage(BW)subimage(RGB)subimage(x,y,...)h=subimage(...)truesize調(diào)整圖像顯示尺寸truesize(fig,[mrowsmcols])truesize(fig)wrap將圖像顯示到紋理映射表面warp(X,map)warp(I,n)warp(BW)warp(RGB)warp(z,...)warp(x,y,z,...)h=warp(...)zoom縮放圖像或圖形zoomonzoomoffzoomoutzoomresetzoomzoomxonzoomyonzoom(factor)zoom(fig,option)表2圖像文件I/O函數(shù)函數(shù)功能語法imfinfo返回圖像文件信息info=imfinfo(filename,fmt)info=imfinfo(filename)imread從圖像文件中讀取圖像A=imread(filename,fmt)[X,map]=imread(filename,fmt)[...]=imread(filename)[...]=imread(URL,...)[...]=imread(...,idx)(CUR,GIF,ICO,andTIFFonly)[...]=imread(...,'PixelRegion',{ROWS,COLS})(TIFFonly)[...]=imread(...,'frames',idx)(GIFonly)[...]=imread(...,ref)(HDFonly)[...]=imread(...,'BackgroundColor',BG)(PNGonly)[A,map,alpha]=imread(...)(ICO,CUR,andPNGonly)imwrite把圖像寫入圖像文件中imwrite(A,filename,fmt)imwrite(X,map,filename,fmt)imwrite(...,filename)imwrite(...,Param1,Val1,Param2,Val2...)表3空間變換函數(shù)函數(shù)功能語法findbounds為空間變換尋找輸出邊界outbounds=findbounds(TFORM,inbounds)fliptform切換空間變換結(jié)構(gòu)的輸入和輸出角色TFLIP=fliptform(T)imcrop剪切圖像I2=imcrop(I)X2=imcrop(X,map)RGB2=imcrop(RGB)I2=imcrop(I,rect)X2=imcrop(X,map,rect)RGB2=imcrop(RGB,rect)[...]=imcrop(x,y,...)[A,rect]=imcrop(...)[x,y,A,rect]=imcrop(...)imresize圖像縮放B=imresize(A,m)B=imresize(A,m,method)B=imresize(A,[mrowsncols],method)B=imresize(...,method,n)B=imresize(...,method,h)imrotate圖像旋轉(zhuǎn)B=imrotate(A,angle)B=imrotate(A,angle,method)B=imrotate(A,angle,method,bbox)interp22-D數(shù)據(jù)插值ZI=interp2(X,Y,Z,XI,YI)ZI=interp2(Z,XI,YI)ZI=interp2(Z,ntimes)ZI=interp2(X,Y,Z,XI,YI,method)imtransform對圖像進(jìn)行2-D空間變換B=imtransform(A,TFORM)B=imtransform(A,TFORM,INTERP)[B,XDATA,YDATA]=imtransform(...)[B,XDATA,YDATA]=imtransform(...,param1,val1,param2,val2,...)makeresampler生成重采樣結(jié)構(gòu)R=makeresampler(interpolant,padmethod)maketform生成幾何變換結(jié)構(gòu)T=maketform(transformtype,...)tformarray多維數(shù)組的空間變換B=tformarray(A,T,R,TDIMS_A,TDIMS_B,TSIZE_B,TMAP_B,F)tformfwd正向空間變換[X,Y]=tformfwd(T,U,V)[X1,X2,X3,...]=tformfwd(T,U1,U2,U3,...)X=tformfwd(T,U)[X1,X2,X3,...]=tformfwd(T,U)X=tformfwd(T,U1,U2,U3,...)tforminv逆向空間變換U=tforminv(X,T)表4像素和統(tǒng)計(jì)處理函數(shù)函數(shù)功能語法corr2計(jì)算兩個矩陣的2-D相關(guān)系數(shù)r=corr2(A,B)imcontour創(chuàng)建圖像的輪廓圖imcontour(I)imcontour(I,n)imcontour(I,v)imcontour(x,y,...)imcontour(...,LineSpec)[C,h]=imcontour(...)imhist顯示圖像的直方圖imhist(I,n)imhist(X,map)[counts,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沿線段計(jì)算剖面圖的像素值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)[...]=improfile(...,method)mean2求矩陣元素平均值B=mean2(A)pixval顯示圖像像素信息pixvalonpixvaloffpixvalpixval(fig,option)pixval(ax,option)pixval(H,option)regionprops得到圖像區(qū)域?qū)傩許TATS=regionprops(L,properties)std2計(jì)算矩陣元素的標(biāo)準(zhǔn)偏移b=std2(A)表5圖像分析函數(shù)函數(shù)功能語法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',...)qtdecomp執(zhí)行四叉樹分解S=qtdecomp(I)S=qtdecomp(I,threshold)S=qtdecomp(I,threshold,mindim)S=qtdecomp(I,threshold,[mindimmaxdim])S=qtdecomp(I,fun)S=qtdecomp(I,fun,P1,P2,...)qtgetblk獲取四叉樹分解中的數(shù)組塊值[vals,r,c]=qtgetblk(I,S,dim)[vals,idx]=qtgetblk(I,S,dim)qtsetblk設(shè)置四叉樹分解中的數(shù)組塊值J=qtsetblk(I,S,dim,vals)表6圖像增強(qiáng)函數(shù)函數(shù)功能語法adapthisteq執(zhí)行對比度受限的直方圖均衡J=adapthisteq(I)J=adapthisteq(I,param1,val1,param2,val2...)decorrstretch對多通道圖像應(yīng)用解卷積延拓S=decorrstretch(I)S=decorrstretch(I,TOL)histeq用直方圖均等化增強(qiáng)對比度J=histeq(I,hgram)J=histeq(I,n)[J,T]=histeq(I,...)newmap=histeq(X,map,hgram)newmap=histeq(X,map)[newmap,T]=histeq(X,...)imadjust調(diào)整圖像灰度值或顏色映射表J=imadjust(I)J=imadjust(I,[low_in;high_in],[low_out;high_out])J=imadjust(...,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進(jìn)行二維中值濾波B=medfilt2(A,[mn])B=medfilt2(A)B=medfilt2(A,'indexed',...)ordfilt2進(jìn)行二維統(tǒng)計(jì)順序?yàn)V波B=ordfilt2(A,order,domain)B=ordfilt2(A,order,domain,S)B=ordfilt2(...,padopt)stretchlim得到圖像對比度延拓的灰度上下限LOW_HIGH=stretchlim(I,TOL)LOW_HIGH=stretchlim(RGB,TOL)wiener2進(jìn)行二維適應(yīng)性去噪濾波J=wiener2(I,[mn],noise)[J,noise]=wiener2(I,[mn])表7線性濾波函數(shù)函數(shù)功能語法conv2二維卷積C=conv2(A,B)C=conv2(hcol,hrow,A)C=conv2(...,'shape')convmtx2二維矩陣卷積T=convmtx2(H,m,n)T=convmtx2(H,[mn])convnn維卷積C=convn(A,B)C=convn(A,B,'shape')filter2二維線性濾波Y=filter2(h,X)Y=filter2(h,X,shape)fspecial創(chuàng)建預(yù)定義濾波器h=fspecial(type)h=fspecial(type,parameters)imfilter多維圖像濾波B=imfilter(A,H)B=imfilter(A,H,option1,option2,...)表8線性二維濾波器設(shè)計(jì)函數(shù)函數(shù)功能語法freqspace確定二維頻率響應(yīng)的頻率空間[f1,f2]=freqspace(n)[f1,f2]=freqspace([mn])[x1,y1]=freqspace(...,'meshgrid')f=freqspace(N)f=freqspace(N,'whole')freqz2計(jì)算二維頻率響應(yīng)[H,f1,f2]=freqz2(h,n1,n2)[H,f1,f2]=freqz2(h,[n2n1])[H,f1,f2]=freqz2(h)[H,f1,f2]=freqz2(h,f1,f2)[...]=freqz2(h,...,[dxdy])[...]=freqz2(h,...,dx)freqz2(...)fsamp2用頻率采樣法設(shè)計(jì)二維FIR濾波器h=fsamp2(Hd)h=fsamp2(f1,f2,Hd,[mn])ftrans2通過頻率轉(zhuǎn)換法設(shè)計(jì)二維FIR濾波器h=ftrans2(b,t)h=ftrans2(b)fwind1用一維窗口方法設(shè)計(jì)二維FIR濾波器h=fwind1(Hd,win)h=fwind1(Hd,win1,win2)h=fwind1(f1,f2,Hd,...)fwind2用二維窗口方法設(shè)計(jì)二維FIR濾波器h=fwind2(Hd,win)h=fwind2(f1,f2,Hd,win)表9圖像變換函數(shù)函數(shù)功能語法dct2進(jìn)行二維離散余弦變換B=dct2(A)B=dct2(A,m,n)B=dct2(A,[mn])dctmtx計(jì)算離散余弦變換矩陣D=dctmtx(n)fft2進(jìn)行二維快速傅立葉變換Y=fft2(X)Y=fft2(X,m,n)fftn進(jìn)行n維快速傅立葉變換Y=fftn(X)Y=fftn(X,siz)fftshift轉(zhuǎn)換快速傅立葉變換的輸出象限Y=fftshift(X)Y=fftshift(X,dim)idct2計(jì)算二維逆離散余弦變換B=idct2(A)B=idct2(A,m,n)B=idct2(A,[mn])ifft2計(jì)算二維逆快速傅立葉變換Y=ifft2(X)Y=ifft2(X,m,n)y=ifft2(...,'nonsymmetric')y=ifft2(...,'nonsymmetric')ifftn計(jì)算n維逆快速傅立葉變換Y=ifftn(X)Y=ifftn(X,siz)y=ifftn(...,'nonsymmetric')y=ifftn(...,'nonsymmetric')iradon逆Radon變換I=iradon(R,theta)I=iradon(R,theta,interp,filter,frequency_scaling,output_size)[I,H]=iradon(...)phantom產(chǎn)生一個頭部幻影圖像P=phantom(def,n)P=phantom(E,n)[P,E]=phantom(...)radon計(jì)算Radon變換R=radon(I,theta)[R,xp]=radon(…)fanbeam計(jì)算扇形投影變換F=fanbeam(I,D)F=fanbeam(...,param1,val1,param1,val2,...)[F,sensor_positions,fan_rotation_angles]=fanbeam(...)表10邊沿和塊處理函數(shù)函數(shù)功能語法bestblk確定進(jìn)行塊操作的塊大小siz=bestblk([mn],k)[mb,nb]=bestblk([mn],k)blkproc實(shí)現(xiàn)圖像的非重疊(distinct)塊操作B=blkproc(A,[mn],fun)B=blkproc(A,[mn],fun,P1,P2,...)B=blkproc(A,[mn],[mbordernborder],fun,...)B=blkproc(A,'indexed',...)col2im將矩陣的列重新組織到塊中A=col2im(B,[mn],[mmnn],block_type)A=col2im(B,[mn],[mmnn])colfilt利用列相關(guān)函數(shù)進(jìn)行邊沿操作B=colfilt(A,[mn],block_type,fun)B=colfilt(A,[mn],block_type,fun,P1,P2,...)B=colfilt(A,[mn],[mblocknblock],block_type,fun,...)B=colfilt(A,'indexed',...)im2col重調(diào)圖像塊為列B=im2col(A,[mn],block_type)B=im2col(A,[mn])B=im2col(A,'indexed',...)nlfilter通用滑動鄰域操作B=nlfilter(A,[mn],fun)B=nlfilter(A,[mn],fun,P1,P2,...)B=nlfilter(A,'indexed',...)表11圖像形態(tài)學(xué)操作函數(shù)函數(shù)功能語法applylut在二值圖像中利用查找表進(jìn)行鄰域操作A=applylut(BW,LUT)bwarea計(jì)算二值圖像的對象面積total=bwarea(BW)bweuler計(jì)算二值圖像的歐拉數(shù)eul=bweuler(BW,n)bwhitmiss執(zhí)行二值圖像的擊中和擊不中操作BW2=bwhitmiss(BW1,SE1,SE2)BW2=bwhitmiss(BW1,INTERVAL)bwlabel標(biāo)注二值圖像中已連接的部分L=bwlabel(BW,n)[L,num]=bwlabel(BW,n)bwmorph二值圖像的通用形態(tài)學(xué)操作BW2=bwmorph(BW,operation)BW2=bwmorph(BW,operation,n)bwperim計(jì)算二值圖像中對象的周長BW2=bwperim(BW1)BW2=bwperim(BW1,CONN)bwselect在二值圖像中選擇對象BW2=bwselect(BW,c,r,n)BW2=bwselect(BW,n)[BW2,idx]=bwselect(...)BW2=bwselect(x,y,BW,xi,yi,n)[x,y,BW2,idx,xi,yi]=bwselect(...)makelut創(chuàng)建用于applylut函數(shù)的查找表lut=makelut(fun,n)lut=makelut(fun,n,P1,P2,...)bwdist距離變換D=bwdist(BW)[D,L]=bwdist(BW)[D,L]=bwdist(BW,METHOD)imbothat執(zhí)行形態(tài)學(xué)的閉包運(yùn)算IM2=imbothat(IM,SE)IM2=imbothat(IM,NHOOD)imclose圖像的閉運(yùn)算IM2=imclose(IM,SE)IM2=imclose(IM,NHOOD)imopen圖像的開運(yùn)算IM2=imopen(IM,SE)IM2=imopen(IM,NHOOD)imdilate圖像的膨脹IM2=imdilate(IM,SE)IM2=imdilate(IM,NHOOD)IM2=imdilate(IM,SE,PACKOPT)IM2=imdilate(...,PADOPT)imerode圖像的腐蝕IM2=imerode(IM,SE)IM2=imerode(IM,NHOOD)IM2=imerode(IM,SE,PACKOPT,M)IM2=imerode(...,PADOPT)imfill填充圖像區(qū)域BW2=imfill(BW,locations)BW2=imfill(BW,'holes')I2=imfill(I)BW2=imfill(BW)[BW2locations]=imfill(BW)BW2=imfill(BW,locations,CONN)BW2=imfill(BW,CONN,'holes')I2=imfill(I,CONN)imtophat用開運(yùn)算后的圖像減去原圖像IM2=imtophat(IM,SE)IM2=imtophat(IM,NHOOD)strel創(chuàng)建形態(tài)學(xué)結(jié)構(gòu)元素SE=strel(shape,parameters)表12區(qū)域處理函數(shù)函數(shù)功能語法roicolor選擇感興趣的顏色區(qū)BW=roicolor(A,low,high)BW=roicolor(A,v)roifill在圖像的任意區(qū)域中進(jìn)行平滑插補(bǔ)J=roifill(I,c,r)J=roifill(I)J=roifill(I,BW)[J,BW]=roifill(...)J=roifill(x,y,I,xi,yi)[x,y,J,BW,xi,yi]=roifill(...)roifilt2濾波特定區(qū)域J=roifilt2(h,I,BW)J=roifilt2(I,BW,fun)J=roifilt2(I,BW,fun,P1,P2,...)roipoly選擇一個感興趣的多邊形區(qū)域BW=roipoly(I,c,r)BW=roipoly(I)BW=roipoly(x,y,I,xi,yi)[BW,xi,yi]=roipoly(...)[x,y,BW,xi,yi]=roipoly(...)表13圖像代數(shù)操作函數(shù)功能語法imadd加運(yùn)算Z=imadd(X,Y)imsubtract減運(yùn)算Z=imsubtract(X,Y)immultiply乘運(yùn)算Z=immultiply(X,Y)imdivide除運(yùn)算Z=imdivide(X,Y)表14顏色空間轉(zhuǎn)換函數(shù)函數(shù)功能語法hsv2rgb轉(zhuǎn)換HSV的值為RGB顏色空間M=hsv2rgb(H)ntsc2rgb轉(zhuǎn)換NTSC的值為RGB顏色空間rgbmap=ntsc2rgb(yiqmap)RGB=ntsc2rgb(YIQ)rgb2hsv轉(zhuǎn)換RGB的值為HSV顏色空間cmap=rgb2hsv(M)rgb2ntsc轉(zhuǎn)換RGB的值為NTSC顏色空間yiqmap=rgb2ntsc(rgbmap)YIQ=rgb2ntsc(RGB)rgb2ycbcr轉(zhuǎn)換RGB的值為YCbCr顏色空間ycbcrmap=rgb2ycbcr(rgbmap)YCBCR=rgb2ycbcr(RGB)ycbcr2rgb轉(zhuǎn)換YCbCr的值為RGB顏色空間rgbmap=ycbcr2rgb(ycbcrmap)RGB=ycbcr2rgb(YCBCR)表15圖像類型和類型轉(zhuǎn)換函數(shù)函數(shù)功能語法dither通過抖動增加外觀顏色分辨率,轉(zhuǎn)換圖像X=dither(RGB,map)BW=dither(I)gray2ind轉(zhuǎn)換灰度圖像為索引色圖像[X,map]=gray2ind(I,n)[X,map]=gray2ind(BW,n)grayslice從灰度圖像為索引色圖像X=grayslice(I,n)X=grayslice(I,v)im2bw轉(zhuǎn)換圖像為二值圖像BW=im2bw(I,level)BW=im2bw(X,map,level)BW=im2bw(RGB,level)im2double轉(zhuǎn)換圖像矩陣為雙精度類型I2=im2double(I)RGB2=im2double(RGB)I=im2double(BW)X2=im2double(X,'indexed')double轉(zhuǎn)換數(shù)據(jù)為雙精度類型double(X)uint8轉(zhuǎn)換數(shù)據(jù)為8位無符號整型I=uint8(X)im2uint8轉(zhuǎn)換圖像陣列為8位為無符號整型I2=im2uint8(I)RGB2=im2uint8(RGB)I=im2uint8(BW)X2=im2uint8(X,'indexed')im2uint16轉(zhuǎn)換圖像陣列為16位為無符號整型I2=im2uint16(I)RGB2=im2uint16(RGB)I=im2uint16(BW)X2=im2uint16(X,'indexed')uint16轉(zhuǎn)換數(shù)據(jù)為16位無符號整型I=uint16(X)ind2gray轉(zhuǎn)換索引色圖像為灰度圖像I=ind2gray(X,map)ind2rgb轉(zhuǎn)換索引色圖像為RGB圖像RG

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

最新文檔

評論

0/150

提交評論