Image segmentation

2,734 views 21 slides Aug 16, 2021
Slide 1
Slide 1 of 21
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21

About This Presentation

Image Segmentation
Types of Image Segmentation
Semantic Segmentation
Instance Segmentation
Types of Image Segmentation Techniques based on the image properties:
Threshold Method.
Edge Based Segmentation.
Region-Based Segmentation.
Clustering Based Segmentation.
Watershed Based Method.
Artificial Ne...


Slide Content

Image Segmentation
P. Kuppusamy

Content
•ImageSegmentation
•TypesofImageSegmentation
•SemanticSegmentation
•InstanceSegmentation
•TypesofImageSegmentationTechniquesbasedontheimage
properties:
•ThresholdMethod.
•EdgeBasedSegmentation.
•RegionBasedSegmentation.
•ClusteringBasedSegmentation.
•WatershedBasedMethod.
•ArtificialNeuralNetworkBasedSegmentation.

ImageSegmentation
•ImageSegmentationisfindingthegroupofpixelsthataresimilar.
•Itispartitioningtheimageintovarioussubgroups(ofpixels)calledImage
Objects.
•Assigninglabelstopixels,andthepixelswiththesamelabelfallundersingle
category.
•Itcanreducethecomplexityoftheimagetoanalysetheimagebecomessimpler.
•Usingtheselabels,Usercanspecifyboundaries,drawlines,andseparatethe
mostrequiredobjectsinanimagefromunnecessarypixelslabel.
•Algorithmdetectsaninstances,whichprovidesaboutindividualobjects,and
hencetheallthepersonshavedifferentcolors.

TypesofImageSegmentation
1.SemanticSegmentation-Inimage1,everypixelbelongstoaparticularclass
(eitherbackgroundorperson).Also,allthepixelsbelongingtoaparticular
classarerepresentedbythesamecolor(backgroundasblackandpersonas
pink).
2.InstanceSegmentation-Image2hasalsoassignedaparticularclasstoeach
pixeloftheimage.However,differentobjectsofthesameclasshavedifferent
colors(Person1asred,Person2asgreen,backgroundasblack,etc.).

WhyImageSegmentationisNeeded?
1.Identifytheobjectsfromimage.
2.Notonlyidentifying,AlsoProvidesmoreinsightinformationaboutthe
objects.
Applications
•facialrecognition-identifyinganemployeetomarkattendance
automatically.
•Medicalindustry-fasterdiagnosis,detectingdiseases,tumors,celland
tissuepatternsfromradiography,MRI,endoscopy,thermography,
ultrasonography,etc.
•Satelliteimages-identifyvariouspatterns,objects,geographicalcontours,
soilinformationetc.,whichcanbeusedforagriculture,mining,geo-sensing,
etc.
•Robotics,likeRoboticprocessautomation(RPA),self-drivingcars,etc.

TypesofImageSegmentationTechniquesbasedontheimage
properties:
Twoapproaches:
1.SimilarityDetection(RegionbasedApproach)
1.Detectingsimilarpixelsinanimagebasedonathreshold,regiongrowing,region
spreading,andregionmerging.
2.Machinelearningalgorithmslikeclusteringreliesonthisapproachofsimilarity
detectiononanunknownsetoffeatures.Itdetectssimilaritybasedonapre-defined
(known)setoffeatures.
2.DiscontinuityDetection(Boundary/EdgebasedApproach)
1.Searchesfordiscontinuity.
2.Here,edgesdetectedbasedonvariousmetricsofdiscontinuitylikeintensity,color
etc.
3.E.g.ImageSegmentationAlgorithmslikeEdgeDetection,PointDetection,Line
Detection

TypesofImageSegmentationTechniquesbasedontheimage
properties:
1.Threshold Method.
2.Edge Based Segmentation.
3.Region Based Segmentation.
4.Clustering Based Segmentation.
5.Watershed Based Method.
6.Artificial Neural Network Based Segmentation.

Threshold based Segmentation
•ThresholdvalueTisconsideredasaconstant.Butthatapproachmaybeineffective
consideringtheamountofnoiseoftheimage.So,wecaneitherkeepitconstantor
changeitdynamicallybasedontheimagepropertiestoobtainbetterresults.
•GlobalThreshold-Ifwewanttodividetheimageintotworegions(objectand
background),wedefineasinglethresholdvalue.
•LocalThreshold-Ifwehavemultipleobjectsalongwiththebackground,wemust
definemultiplethresholds.Thesethresholdsarecollectivelyknownaslocalthreshold.
Basedonthat,thresholdingisofthefollowingtypes:
1.SimpleThresholding
•Thistechniquereplacesthepixelsinanimagewitheitherblackorwhite.
•Iftheintensityofapixel(I
i,j)atposition(i,j)islessthanthethreshold(T),thenreplace
thatwithblackandifitismore,thenwereplacethatpixelwithwhite.Thisisabinary
approachtothresholding.

Threshold based Segmentation
2.Otsu’sBinarization
•Inglobalthresholding,wehadusedanarbitraryvalueforthresholdvalueandit
remainsaconstant.
•Howcanwedefineanddeterminethecorrectnessoftheselectedthreshold?A
simplerbutratherineptmethodistotrialandseetheerror.
•Takeanimagehistogramthathastwopeaks(bimodalimage),oneforthe
backgroundandonefortheforeground.
•AccordingtoOtsubinarization,forthatimage,wecanapproximatelytakea
valueinthemiddleofthosepeaksasthethresholdvalue.
•So,itautomaticallycalculatesathresholdvaluefromimagehistogramfora
bimodalimage.
•Thedisadvantageisforimagesthatarenotbimodal,theimagehistogramhas
multiplepeaks,oroneoftheclasses(peaks)presenthashighvariance.
•However,Otsu’sBinarizationiswidelyusedindocumentscans,removing
unwantedcolorsfromadocument,patternrecognitionetc.

Threshold based Segmentation
3.AdaptiveThresholding
•Aglobalvalueasthresholdvaluemaynotbegoodinalltheconditionswherean
imagehasdifferentbackgroundandforegroundlightingconditionsindifferent
actionableareas.
•Weneedanadaptiveapproachthatcanchangethethresholdforvarious
componentsoftheimage.
•Inthis,thealgorithmdividestheimageintovarioussmallerportionsand
calculatesthethresholdforthoseportionsoftheimage.
•Hence,weobtaindifferentthresholdsfordifferentregionsofthesameimage.
•Thisinturngivesusbetterresultsforimageswithvaryingillumination.
•Thealgorithmcanautomaticallycalculatethethresholdvalue.
•Thethresholdvaluecanbethemeanofneighborhoodareaoritcanbethe
weightedsumofneighborhoodvalueswhereweightsareaGaussianwindow(a
windowfunctiontodefineregions).

Edge based Segmentation
•Edgedetectionistheprocessoflocatingedgesinanimagebasedonvarious
discontinuitiesingreylevel,colour,texture,brightness,saturation,contrastetc.
•Tofurtherenhancetheresults,supplementaryprocessingstepsmustfollowto
concatenatealltheedgesintoedgechainsthatcorrespondbetterwithbordersin
theimage.
•Edgesconsistofmeaningfulfeaturesandcontainssignificantinformation.
•Itsignificantlyreducesthesizeoftheimageandfiltersoutinformationthatmay
beregardedaslessrelevant,preservingandfocusingsolelyontheimportant
structuralpropertiesofanimageforabusinessproblem.

Edge based Segmentation
Edgedetectionalgorithmsaretwocategories:
•GradientbasedmethodsandGrayHistograms.
•Basicedgedetectionoperatorslikesobeloperator,canny,Robert’svariableetc.
•Theseoperatorsaidindetectingtheedgediscontinuitiesandhencemarktheedge
boundaries.
•Theendgoalistoreachatleastapartialsegmentationusingthisprocess,wherewegroup
allthelocaledgesintoanewbinaryimagewhereonlyedgechainsthatmatchthe
requiredexistingobjectsorimagepartsarepresent.

Region based Segmentation
•Creatingsegmentsbydividingtheimageintovariouscomponentshaving
similarcharacteristics.
•Region-basedimagesegmentationtechniquesinitiallysearchforsomeseed
points–eithersmallerpartsorconsiderablybiggerchunksintheinputimage.
•Next,Eitheraddmorepixelstotheseedpointsorfurtherdiminishorshrink
theseedpointtosmallersegments,andmergewithothersmallerseedpoints.
Hence,therearetwobasictechniquesbasedonthismethod.
1.RegionGrowing
•It’sabottomtoupmethodwherebeginwithasmallersetofpixelandstart
accumulatingoriterativelymergingitbasedoncertainpre-determinedsimilarity
constraints.
•Regiongrowthalgorithmstartswithchoosinganarbitraryseedpixelinthe
imageandcompareitwithitsneighboringpixels.

Region based Segmentation
•Ifthereisamatchorsimilarityinneighboringpixels,thentheyareaddedtothe
initialseedpixel,thusincreasingthesizeoftheregion.
•Whenwereachthesaturation,thegrowthofthatregioncannotproceedfurther.
•So,thealgorithmnowchoosesanotherseedpixel,whichnecessarilydoesnot
belongtoanyregion(s)thatcurrentlyexistsandstarttheprocessagain.
•RegiongrowingmethodsoftenachieveeffectiveSegmentationthatcorresponds
welltotheobservededges.
•Butsometimes,whenthealgorithmletsaregiongrowcompletelybeforetrying
otherseeds,thatusuallybiasesthesegmentationinfavouroftheregionswhich
aresegmentedfirst.
•Tocounterthiseffect,mostofthealgorithmsbeginwiththeuserinputsof
similaritiesfirst,nosingleregionisallowedtodominateandgrowcompletely
andmultipleregionsareallowedtogrowsimultaneously.

Region based Segmentation
•Regiongrowth,alsoapixelbasedalgorithmlikethresholdingbutthemajor
differenceisthresholdingextractsalargeregionbasedoutofsimilarpixels,
fromanywhereintheimagewhereasregion-growthextractsonlytheadjacent
pixels.
•Regiongrowingtechniquesarepreferablefornoisyimages,whereitishighly
difficulttodetecttheedges.
2.RegionSplittingandMerging
•Thesplittingandmergingbasedsegmentationmethodsusetwobasictechniques
donetogetherinconjunction–regionsplittingandregionmerging–for
segmentinganimage.
•Splittinginvolvesiterativelydividinganimageintoregionshavingsimilar
characteristicsandmergingemployscombiningtheadjacentregionsthatare
somewhatsimilartoeachother.

Region based Segmentation
•Aregionsplit,unliketheregiongrowth,considerstheentireinputimageasthe
areaofbusinessinterest.
•Then,itwouldtrymatchingaknownsetofparametersorpre-definedsimilarity
constraintsandpicksupallthepixelareasmatchingthecriteria.
•Thisisadivideandconquersmethodasopposedtotheregiongrowthalgorithm.

Clustering based Segmentation
•Clusteringisdividingthepopulation(datapoints)intoanumberofgroups,suchthatdata
pointsinthesamegroupsaremoresimilartootherdatapointsinthatsamegroupthan
thoseinothergroups(clusters).
k-meansclustering
•Thekrepresentsthenumberofclusters.
1.First,randomlyselectkinitialclusters
2.Randomlyassigneachdatapointtoanyoneofthekclusters
3.Calculatethecentersoftheseclusters
4.Calculatethedistanceofallthepointsfromthecenterofeachcluster
5.Dependingonthisdistance,thepointsarereassignedtothenearestcluster
6.Calculatethecenterofthenewlyformedclusters
7.Finally,repeatsteps(4),(5)and(6)untileitherthecenteroftheclustersdoesnot
changeorwereachthesetnumberofiterations
•Thekeyadvantageofusingk-meansalgorithmisthatitissimpleandeasytounderstand.

Watershedbased Segmentation
•Watershedisaridgeapproach,alsoaregion-basedmethod,whichfollowstheconceptof
topologicalinterpretation.
•Itconsiderstheanalogyofgeographiclandscapewithridgesandvalleysforvarious
componentsofanimage.Theslopeandelevationofthetopographyaredistinctly
quantifiedbythegrayvaluesoftherespectivepixels–calledthegradientmagnitude.
•Basedonthis3DrepresentationwhichisusuallyfollowedforEarthlandscapes,the
watershedtransformdecomposesanimageintoregionsthatarecalled“catchmentbasins”.
•Foreachlocalminimum,acatchmentbasincomprisesallpixelswhosepathofsteepest
descentofgrayvaluesterminatesatthisminimum.Thealgorithmconsidersthepixelsasa
“localtopography”(elevation),ofteninitializingitselffromuser-definedmarkers.Then,
thealgorithmdefines“basins”whicharetheminimapointsandhence,basinsareflooded
fromthemarkersuntilbasinsmeetonwatershedlines.
•Thewatershedsareformedthatseparatebasinsfromeachother.Hencethepicturegets
decomposedbecausewehavepixelsassignedtoeachsuchregionorwatershed

Artificial Neural Network based Segmentation
•ANNusesAItoautomaticallyprocessandidentifythecomponentsofanimagelike
objects,faces,text,hand-writtentextetc.ConvolutionalNeuralNetworksarespecifically
usedtoidentifyandprocesshigh-definitionimagedata.
•Animageisconsideredeitherasasetofvectors(colourannotatedpolygons)oraraster(a
tableofpixelswithnumericalvaluesforcolors).Thevectororrasteristurnedintosimpler
componentsthatrepresenttheconstituentphysicalobjectsandfeaturesinanimage.

Morphological based Segmentation
•Itisforanalysingthegeometricstructureinherentwithinanimage.
•Inthis,theoutputimagepixelvaluesarebasedonsimilarpixelsofinputimage
withisneighboursandproducesanewbinaryimage.
•Thismethodisalsousedinforegroundbackgroundseparation.
•Thebaseofthemorphologicaloperationisdilation,erosion,opening,closing
expressedinlogicalAND,OR.
•Thistechniqueismainlyusedinshapeanalysisandnoiseremovalafter
thresholdinganimage.Example:watershedalgorithm.

References
•Richard Szeliski, Computer Vision: Algorithms and Applications,
Springer 2010