資源描述:
《(英文原版)matlab7.8圖像處理寶典(3-3)》由會員上傳分享,免費在線閱讀,更多相關內(nèi)容在學術論文-天天文庫。
1、imcropRemarksBecauserectisspeci?edintermsofspatialcoordinates,thewidthandheightelementsofrectdonotalwayscorrespondexactlywiththesizeoftheoutputimage.Forexample,supposerectis[20204030],usingthedefaultspatialcoordinatesystem.Theupper-leftcornerofthespe
2、ci?edrectangleisthecenterofthepixel(20,20)andthelower-rightcorneristhecenterofthepixel(50,60).Theresultingoutputimageis31-by-41,not30-by-40,becausetheoutputimageincludesallpixelsintheinputimagethatarecompletelyorpartiallyenclosedbytherectangle.Exampl
3、esI=imread('circuit.tif');I2=imcrop(I,[7568130112]);imshow(I),figure,imshow(I2)SeeAlsoimrect,zoom17-287imdilatePurposeDilateimageSyntaxIM2=imdilate(IM,SE)IM2=imdilate(IM,NHOOD)IM2=imdilate(IM,SE,PACKOPT)IM2=imdilate(...,SHAPE)DescriptionIM2=imdilate(
4、IM,SE)dilatesthegrayscale,binary,orpackedbinaryimageIM,returningthedilatedimage,IM2.TheargumentSEisastructuringelementobject,orarrayofstructuringelementobjects,returnedbythestrelfunction.IfIMislogicalandthestructuringelementis?at,imdilateperformsbina
5、rydilation;otherwise,itperformsgrayscaledilation.IfSEisanarrayofstructuringelementobjects,imdilateperformsmultipledilationsoftheinputimage,usingeachstructuringelementinSEinsuccession.IM2=imdilate(IM,NHOOD)dilatestheimageIM,whereNHOODisamatrixof0’sand
6、1’sthatspeci?esthestructuringelementneighborhood.Thisisequivalenttothesyntaximdilate(IM,strel(NHOOD)).Theimdilatefunctiondeterminesthecenterelementoftheneighborhoodbyfloor((size(NHOOD)+1)/2).IM2=imdilate(IM,SE,PACKOPT)orimdilate(IM,NHOOD,PACKOPT)spec
7、i?eswhetherIMisapackedbinaryimage.PACKOPTcanhaveeitherofthefollowingvalues.Defaultvalueisenclosedinbraces({}).ValueDescription'ispacked'IMistreatedasapackedbinaryimageasproducedbybwpack.IMmustbea2-Duint32arrayandSEmustbea?at2-Dstructuringelement.Ifth
8、evalueofPACKOPTis'ispacked',PADOPTmustbe'same'.{'notpacked'}IMistreatedasanormalarray.17-288imdilateIM2=imdilate(...,SHAPE)speci?esthesizeoftheoutputimage.SHAPEcanhaveeitherofthefollowingvalues.Defaultvalueisenclosedinbraces({}).ValueDescription{'sam