形態(tài)學處理MATLAB函數(shù)簡介_第1頁
形態(tài)學處理MATLAB函數(shù)簡介_第2頁
形態(tài)學處理MATLAB函數(shù)簡介_第3頁
形態(tài)學處理MATLAB函數(shù)簡介_第4頁
形態(tài)學處理MATLAB函數(shù)簡介_第5頁
已閱讀5頁,還剩20頁未讀 繼續(xù)免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

圖像形態(tài)學處理函數(shù)簡介1結構元素創(chuàng)建函數(shù)strel

CreatemorphologicalstructuringelementSyntaxSE=strel(shape,parameters)DescriptionSE=strel(shape,parameters)createsastructuringelement,SE,ofthetypespecifiedbyshape.Thistablelistsallthesupportedshapes.Dependingonshape,strelcantakeadditionalparameters.Seethesyntaxdescriptionsthatfollowfordetailsaboutcreatingeachtypeofstructuringelement1結構元素創(chuàng)建函數(shù)1結構元素創(chuàng)建函數(shù)SE=strel('arbitrary',NHOOD)createsaflatstructuringelementwhereNHOODspecifiestheneighborhood.floor((size(NHOOD)+1)/2)1結構元素創(chuàng)建函數(shù)SE=strel('diamond',R)createsaflat,diamond-shapedstructuringelement,whereRspecifiesthedistancefromthestructuringelementorigintothepointsofthediamond.

1結構元素創(chuàng)建函數(shù)SE=strel('disk',R,N)createsaflat,disk-shapedstructuringelement,whereRspecifiestheradius1結構元素創(chuàng)建函數(shù)SE=strel('line',LEN,DEG)createsaflat,linearstructuringelement,whereLENspecifiesthelength,andDEGspecifiestheangle(indegrees)oftheline1結構元素創(chuàng)建函數(shù)SE=strel('pair',OFFSET)createsaflatstructuringelementcontainingtwomembers.Onememberislocatedattheorigin.Thesecondmember'slocationisspecifiedbythevectorOFFSET.2圖像腐蝕函數(shù)imerodeErodeimageSyntaxIM2=imerode(IM,SE)IM2=imerode(IM,NHOOD)IM2=imerode(IM,SE,PACKOPT,M)IM2=imerode(...,PADOPT)2圖像腐蝕函數(shù)originalBW=imread('circles.png');se=strel('disk',11);erodedBW=imerode(originalBW,se);imview(originalBW)imview(erodedBW)3圖像膨脹函數(shù)imdilateDilateimageSyntaxIM2=imdilate(IM,SE)IM2=imdilate(IM,NHOOD)IM2=imdilate(IM,SE,PACKOPT)IM2=imdilate(...,PADOPT)3圖像膨脹函數(shù)I=imread('cameraman.tif');se=strel('ball',5,5);I2=imdilate(I,se);imshow(I),title('Original')figure,imshow(I2),title('Dilated')4圖像開運算函數(shù)imopenOpenanimageSyntaxIM2=imopen(IM,SE)IM2=imopen(IM,NHOOD)5圖像閉運算函數(shù)imcloseCloseanimageSyntaxIM2=imclose(IM,SE)IM2=imclose(IM,NHOOD)6邊界消除函數(shù)imclearborder

SuppresslightstructuresconnectedtoimageborderSyntaxIM2=imclearborder(IM)IM2=imclearborder(IM,CONN)Descriptionsuppressesstructuresthatarelighterthantheirsurroundingsandthatareconnectedtotheimageborder.7圖像填充函數(shù)imfill

FillimageregionsSyntaxBW2=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)7圖像填充函數(shù)Fillintheholesofabinaryimage.BW4=im2bw(imread('coins.png'));BW5=imfill(BW4,'holes');imview(BW4),imview(BW5)7圖像填充函數(shù)Fillintheholesofanintensityimage.I=imread('tire.tif');I2=imfill(I,'holes');imview(I),imview(I2)8舉例:用圖像分割檢測細胞Step1:ReadImageStep2:DetectEntireCellStep3:FillGapsStep4:DilatetheImageStep5:FillInteriorGapsStep6:RemoveConnectedObjectsonBorderStep7:SmooththeObject8舉例:用圖像分割檢測細胞

步驟1:讀入圖像I=imread('cell.tif');figure,imshow(I)title('originalimage')8舉例:用圖像分割檢測細胞步驟2:邊緣檢測BWs=edge(I,'sobel',(graythresh(I)*.1));figureimshow(BWs)

title('binarygradientmask')8舉例:用圖像分割檢測細胞步驟3:創(chuàng)建結構元素se90=strel('line',3,90);se0=strel('line',3,0);步驟4;膨脹圖像BWsdil=imdilate(BWs,[se90se0]);figure,imshow(BWsdil)title('dilatedgradientmask')8舉例:用圖像分割檢測細胞步驟5:填充內部空洞BWdfill=imfill(BWsdil,'holes');figure,imshow(BWdfill);title('binaryimagewithfilledholes');8舉例:用圖像分割檢測細胞步驟6:消除與邊界相連的目標BWnobord=imclearborder(BWdfill,4);figure,imshow(BWnobord),title('

溫馨提示

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

評論

0/150

提交評論