:IntroductionLecture10:MorphologyoperationHowtoremovetheislandsorholesinthebinaryimage?:Introduction•10.1Introduction•10.2Erosion&Dilation•10.3Opening&ClosingLecture10:Morphologyoperation(MM)isatheoryandtechniquefortheanalysisandprocessingofgeometricalstructures,basedonsettheory,latticetheory,topology,andrandomfunctions.MMismostcommonlyappliedtodigitalimages•BinaryMorphology•Gray-scaleMorphology10.1IntroductionThesuffix“-ology”means“studyof”,soobviously,“Morphology”isthestudyofmorphs.Morphologyoperationelement(元素)LetXbeaobject(localregion)inadigitalimage,ifpointaislocatedinX,thenaiscalledaelementofX,ora∈X。BisincludedinX(包含)LetX,Bbetwoobjectinadigitalimage.ifallelementsaiinBareincludedinX,thenBisincludedinX,orBXXaXB10.1IntroductionBasicsymbolsandconceptsImageImageBhitsX(击中)LetX,Bbetwoobjectsinadigitalimages,ifthereisanpointwhichisanelementofbothBandX,thenitiscalledthatBhitsX,orB↑X.BmissesX(击不中)LetX,Bbetwoobjectsinadigitalimages.iftheredoesn’texistsuchapointwhichisanelementofbothBandX,thenitiscalledthatBmissesX,orB∩X=Ф.WhereФisemptyset.XBXB10.1IntroductionImageImageBasicsymbolsandconceptsComplementset(补集)SetanimageX,andthesetofallpointsoutsideofXiscalledcomplementofX,markedasXc.BasicsymbolsandconceptsSymmetricSet(对称集)LetanobjectB,andinverseallelement’scoordinatesinB.Thatistochange(x,y)to(-x,-y).Allthepoints(-x,-y)makeupofanewsetnamedsymmetricsetofB,markedBv.Translation(平移)LetanobjectB,andapointa(x0,y0).TheeffecttotranslateBtoaisthatxcoordinatesofallelementinBaddx0andycoordinatesaddy0.Soallthepoints(x+x0,y+y0)makeupofanewsetcalledB’translationbasedona,markedBa.xyoBBvxyoa(x0,y0)BBaBy0x0BasicsymbolsandconceptsStructureelement(结构元素)LetX,Bbetwoimages.IftakeXasprocessedobjectandBisusedtoperformthisoperation,thenBisnamedstructureelementorkernel.Structuralelementsareusuallysomesmallerimage.结构元素通常都是一些比较小的图象。XBOriginBasicsymbolsandconcepts’sErosionbyB.Itcanbeexpressedbyequation把结构元素平移到数字图像I的a点。如果Ba包含于X,则标记点a。所有标记的点组成一个新的集合称为X被B的腐蚀。(1)Erosion(腐蚀)XerodedbyB:X⊖B=x|B+x⊂XX⊖B=𝑎|B𝑎⊂XXaBaIaBaXB(1)Erosion(腐蚀)B在X内部的原点组成的边界Steps:将B以原点为中心遍历X中各像素;如果B上的所有点都在X的范围内,则该点保留,否则将该点去掉。(1)Erosion(腐蚀)B在X内部的原点组成的边界(1)Erosion(腐蚀)111111111+ErosionStructureelementObject2Object1Example:I=imerode(A,B)(1)Erosion(腐蚀)Usingerosiontoremoveimagecomponents.(a)A486*486binaryimage(b)-(d)Imageerodedusingsquarestructureelementsofsizes11*11,15*15and45*45.腐蚀可以消除图像中小的成分结构元素越大,被腐蚀掉的图像成份越多!(2)Dilation(膨胀)XdilatedbyB:X⊕B=⋃{X+b:b∈B}DilationisthedualoperationofErosion,anditcanbedescribedby:Translateselectedstructureelementtopointa,andBacanbegotten.IfBahitsobjectX,pointaismarked.AllmarkedpointsconsistanewsetcalledX’sdilationbyB.膨胀是腐蚀的对偶操作,可描述如下:把结构元素平移到a点,可得到Ba。如果Ba击中物体X,则标记a点。所有被标记的点组成一个新的集合称作X被B的膨胀。XIBaBaXBX⊕BXBBX(2)Dilation(膨胀)Steps:将B以原点为中心遍历图像X各像素;如果B击中X(相交不等于空集),则保留该点,否则删除该点。(2)Dilation(膨胀)X⊕B:10.2Erosion&Dilation(2)Dilation(膨胀)111111111+DilationStructureelementObjectI=imdilation(A,B)(2)Dilation(膨胀)Dilationoperationcanfillingsmallgaps:Dilationareinversetranslationtoerosion?erosiondilation腐蚀使目标收缩平滑物体边界(目标变成背景)断开狭窄的连接去除细长的突出物使目标扩张平滑物体边界(背景变成目标)连接狭窄的断开去除小孔10.2Erosion&Dilation膨胀开运算定义为利用相同的结构元素先进行腐蚀然后进行膨胀。Anclosingisjustanopeningperformedinreverse.Itisdefinedsimplyasadilationfollowedbyanerosionusingthesamestructuringelementforbothoperations闭运算定义为利用相同的结构元素先进行膨胀然后进行腐蚀。(1)Opening(开运算)Opening=Erosion+DilationA∘B=A⊖B⨁BBAA⊖BA⊖B⨁B与腐蚀相似但是比腐蚀较少破坏性:Openingalsocanremovesmallbridgejustaserosioncan.Buttheresultofopeningismorelikelytokeeptheoriginalshapeoftheobjectunchanged.10.3Opening&Closing(1)Opening(开运算)平滑轮廓去除细长的部分去除小的孤岛I=imopen(A,B)Feat