资源描述:
《(英文原版)matlab7.8图像处理宝典(3-3)》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、imcropRemarksBecauserectisspecifiedintermsofspatialcoordinates,thewidthandheightelementsofrectdonotalwayscorrespondexactlywiththesizeoftheoutputimage.Forexample,supposerectis[20204030],usingthedefaultspatialcoordinatesystem.Theupper-leftcornerofthespe
2、cifiedrectangleisthecenterofthepixel(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.IfIMislogicalandthestructuringelementisflat,imdilateperformsbina
5、rydilation;otherwise,itperformsgrayscaledilation.IfSEisanarrayofstructuringelementobjects,imdilateperformsmultipledilationsoftheinputimage,usingeachstructuringelementinSEinsuccession.IM2=imdilate(IM,NHOOD)dilatestheimageIM,whereNHOODisamatrixof0’sand
6、1’sthatspecifiesthestructuringelementneighborhood.Thisisequivalenttothesyntaximdilate(IM,strel(NHOOD)).Theimdilatefunctiondeterminesthecenterelementoftheneighborhoodbyfloor((size(NHOOD)+1)/2).IM2=imdilate(IM,SE,PACKOPT)orimdilate(IM,NHOOD,PACKOPT)spec
7、ifieswhetherIMisapackedbinaryimage.PACKOPTcanhaveeitherofthefollowingvalues.Defaultvalueisenclosedinbraces({}).ValueDescription'ispacked'IMistreatedasapackedbinaryimageasproducedbybwpack.IMmustbea2-Duint32arrayandSEmustbeaflat2-Dstructuringelement.Ifth
8、evalueofPACKOPTis'ispacked',PADOPTmustbe'same'.{'notpacked'}IMistreatedasanormalarray.17-288imdilateIM2=imdilate(...,SHAPE)specifiesthesizeoftheoutputimage.SHAPEcanhaveeitherofthefollowingvalues.Defaultvalueisenclosedinbraces({}).ValueDescription{'sam