Study and Comparison of Various Image Edge Detection Techniques.docx
《Study and Comparison of Various Image Edge Detection Techniques.docx》由会员分享,可在线阅读,更多相关《Study and Comparison of Various Image Edge Detection Techniques.docx(15页珍藏版)》请在冰豆网上搜索。
StudyandComparisonofVariousImageEdgeDetectionTechniques
RamanMaini&Dr.HimanshuAggarwal
StudyandComparisonofVariousImageEdgeDetectionTechniques
ABSTRACT
Edgescharacterizeboundariesandarethereforeaproblemoffundamentalimportanceinimageprocessing.ImageEdgedetectionsignificantlyreducestheamountofdataandfiltersoutuselessinformation,whilepreservingtheimportantstructuralpropertiesinanimage.Sinceedgedetectionisintheforefrontofimageprocessingforobjectdetection,itiscrucialtohaveagoodunderstandingofedgedetectionalgorithms.InthispaperthecomparativeanalysisofvariousImageEdgeDetectiontechniquesispresented.ThesoftwareisdevelopedusingMATLAB7.0.IthasbeenshownthattheCanny’sedgedetectionalgorithmperformsbetterthanalltheseoperatorsunderalmostallscenarios.EvaluationoftheimagesshowedthatundernoisyconditionsCanny,LoG(LaplacianofGaussian),Robert,Prewitt,Sobelexhibitbetterperformance,respectively.1.IthasbeenobservedthatCanny’sedgedetectionalgorithmiscomputationallymoreexpensivecomparedtoLoG(LaplacianofGaussian),Sobel,PrewittandRobert’soperator.
Keywords:
EdgeDetection,Noise,DigitalImageProcessing
1.INTRODUCTION
Edgedetectionreferstotheprocessofidentifyingandlocatingsharpdiscontinuitiesinanimage.Thediscontinuitiesareabruptchangesinpixelintensitywhichcharacterizeboundariesofobjectsinascene.Classicalmethodsofedgedetectioninvolveconvolvingtheimagewithanoperator(a2-Dfilter),whichisconstructedtobesensitivetolargegradientsintheimagewhilereturningvaluesofzeroinuniformregions.Thereareanextremelylargenumberofedgedetectionoperatorsavailable,eachdesignedtobesensitivetocertaintypesofedges.VariablesinvolvedintheselectionofanedgedetectionoperatorincludeEdgeorientation,NoiseenvironmentandEdgestructure.Thegeometryoftheoperatordeterminesacharacteristicdirectioninwhichitismostsensitivetoedges.Operatorscanbeoptimizedtolookforhorizontal,vertical,ordiagonaledges.Edgedetectionisdifficultinnoisyimages,sinceboththenoiseandtheedgescontainhigh-frequencycontent.Attemptstoreducethenoiseresultinblurredanddistortededges.Operatorsusedonnoisyimagesaretypicallylargerinscope,sotheycanaverageenoughdatatodiscountlocalizednoisypixels.Thisresultsinlessaccuratelocalizationofthedetectededges.Notalledgesinvolveastepchangeinintensity.Effectssuchasrefractionorpoorfocuscanresultinobjectswithboundariesdefinedbyagradualchangeinintensity[1].Theoperatorneedstobechosentoberesponsivetosuchagradualchangeinthosecases.So,thereareproblemsoffalseedgedetection,missingtrueedges,edgelocalization,highcomputationaltimeandproblemsduetonoiseetc.Therefore,theobjectiveistodothecomparisonofvariousedgedetectiontechniquesandanalyzetheperformanceofthevarioustechniquesindifferentconditions.
Therearemanywaystoperformedgedetection.However,themajorityofdifferentmethodsmaybegroupedintotwocategories:
GradientbasedEdgeDetection:
Thegradientmethoddetectstheedgesbylookingforthemaximumandminimuminthefirstderivativeoftheimage.
LaplacianbasedEdgeDetection:
TheLaplacianmethodsearchesforzerocrossingsinthesecondderivativeoftheimagetofindedges.Anedgehastheone-dimensionalshapeofarampandcalculatingthederivativeoftheimagecanhighlightitslocation.
Supposewehavethefollowingsignal,withanedgeshownbythejumpinintensitybelow:
Ifwetakethegradientofthissignal,wegetthefollowing:
Clearly,thederivativeshowsamaximumlocatedatthecenteroftheedgeintheoriginalsignal.Thismethodoflocatinganedgeischaracteristicofthe“gradientfilter”familyofedgedetectionfiltersandincludestheSobelmethod.Apixellocationisdeclaredanedgelocationifthevalueofthegradientexceedssomethreshold.Asmentionedbefore,edgeswillhavehigherpixelintensityvaluesthanthosesurroundingit.Soonceathresholdisset,youcancomparethegradientvaluetothethresholdvalueanddetectanedgewheneverthethresholdisexceeded[2].Furthermore,whenthefirstderivativeisatamaximum,thesecondderivativeiszero.Asaresult,anotheralternativetofindingthelocationofanedgeistolocatethezerosinthesecondderivative.ThismethodisknownastheLaplacianandthesecondderivativeofthesignalisshownbelow:
InthispaperweanalyzedanddidthevisualcomparisonofthemostcommonlyusedGradientandLaplacianbasedEdgeDetectiontechniques.Insection2theproblemdefinitionispresented.Insection3thevariousedgedetectiontechniqueshavebeenstudiedandanalyzed.Insection4thevisualcomparisonsofvariousedgedetectiontechniqueshavebeendonebydevelopingsoftwareinMATLAB7.0.Section5discussestheadvantagesanddisadvantagesofvariousedgedetectiontechniques.Section6discussestheconclusionreachedbyanalysisandvisualcomparisonofvariousedgedetectiontechniquesdevelopedusingMATLAB7.0.
2.PROBLEMDEFINITION
Thereareproblemsoffalseedgedetection,missingtrueedges,producingthinorthicklinesandproblemsduetonoiseetc.InthispaperweanalyzedanddidthevisualcomparisonofthemostcommonlyusedGradientandLaplacianbasedEdgeDetectiontechniquesforproblemsofinaccurateedgedetection,missingtrueedges,producingthinorthicklinesandproblemsduetonoiseetc.ThesoftwareisdevelopedusingMATLAB7.0.
3.EdgeDetectionTechniques
3.1SobelOperator
Theoperatorconsistsofapairof3×3convolutionkernelsasshowninFigure1.Onekernelissimplytheotherrotatedby90°.
FIGURE1:
MasksusedbySobelOperator
Thesekernelsaredesignedtorespondmaximallytoedgesrunningverticallyandhorizontallyrelativetothepixelgrid,onekernelforeachofthetwoperpendicularorientations.Thekernelscanbeappliedseparatelytotheinputimage,toproduceseparatemeasurementsofthegradientcomponentineachorientation(calltheseGxandGy).Thesecanthenbecombinedtogethertofindtheabsolutemagnitudeofthegradientateachpointandtheorientationofthatgradient[3].Thegradientmagnitudeisgivenby:
Typically,anapproximatemagnitudeiscomputedusing:
whichismuchfastertocompute.
Theangleoforientationoftheedge(relativetothepixelgrid)givingrisetothespatialgradientisgivenby:
3.2Robert’scrossoperator:
TheRobertsCrossoperatorperformsasimple,quicktocompute,2-Dspatialgradientmeasurementonanimage.Pixelvaluesateachpointintheoutputrepresenttheestimatedabsolutemagnitudeofthespatialgradientoftheinputimageatthatpoint.Theoperatorconsistsofapairof2×2convolutionkernelsasshowninFigure2.Onekernelissimplytheotherrotatedby90°[4].ThisisverysimilartotheSobeloperator.
FIGURE2:
MasksusedforRobertoperator.
Thesekernelsaredesignedtorespondmaximallytoedgesrunningat45°tothepixelgrid,onekernelforeachofthetwoperpendicularorientations.Thekernelscanbeappliedseparatelytotheinputimage,toproduceseparatemeasurementsofthegradientcomponentineachorientation(calltheseGxandGy).Thesecanthenbecombinedtogethertofindtheabsolutemagnitudeofthegradientateachpointandtheorientationofthatgradient.Thegradientmagnitudeisgivenby:
althoughtypically,anapproximatemagnitudeiscomputedusing:
whichismuchfastertocompute.
Theangleoforientationoftheedgegivingrisetothespatialgradient(relativetothepixelgridorientation)isgivenby:
3.3Prewitt’soperator:
Prewittoperator[5]issimilartotheSobeloperatorandisusedfordetectingverticalandhorizontaledgesinimages.
FIGURE3:
MasksforthePrewittgradientedgedetector
3.4LaplacianofGaussian:
TheLaplacianisa2-Disotropicmeasureofthe2ndspatialderivativeofanimage.TheLaplacianofanimagehighlightsregionsofrapidintensitychangeandisthereforeoftenusedforedgedetection.TheLaplacianisoftenappliedtoanimagethathasfirstbeensmoothedwithsomethingapproximatingaGaussianSmoothingfilterinordertoreduceitssensitivitytonoise.Theoperatornormallytakesasinglegraylevelimageasinputandproducesanothergraylevelimageasoutput.
TheLaplacianL(x,y)ofanimagewithpixelintensityvaluesI(x,y)isgivenby:
Sincetheinputimageisrepresentedasasetofdiscretepixels,wehavetofindadiscreteconvolutionkernelthatcanapproximatethesecondderivativesinthedefinitionoftheLaplacian[5].ThreecommonlyusedsmallkernelsareshowninFigure4.
FIGURE4.ThreecommonlyuseddiscreteapproximationstotheLaplacianfilter.
Becausethesekernelsareapproximatingasecondderivativemeasurementontheimage,theyareverysensitivetonoise.Tocounterthis,theimageisoftenGaussianSmoothedbeforeapplyingtheLaplacianfilter.Thispre-processingstepreducesthehighfrequencynoisecomponentspriortothedifferentiationstep.
Infact,sincetheconvolutionoperationisassociative,wecanconvolvetheGaussiansmoothingfilterwiththeLaplacianfilterfirstofall,andthenconvolvethishybridfilterwiththeimagetoachievetherequiredresult.Doingthingsthiswayhastwoadvantages:
SinceboththeGaussianandtheLaplaciankernelsareusuallymuchsmallerthantheimage,thismethodusuallyrequiresfarfewerarithmeticoperations.
TheLoG(`LaplacianofGaussian')[6]kernelcanbepre-calculatedinadvancesoonlyoneconvolutionneedstobeperformedatrun-timeontheimage.
The2-DLoGfunction[7]centered