ebook img

On Hausdorf f Distance Measures - UMass Amherst PDF

21 Pages·2009·0.87 MB·English
by  
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview On Hausdorf f Distance Measures - UMass Amherst

On Hausdorff Distance Measures MichaelD.Shapiro MatthewB.Blaschko PalaceofDreams ComputerVisionLaboratory 120GarfieldPl. UniversityofMassachusetts Brooklyn,NY11215,USA Amherst,MA01003,USA email: [email protected] email: [email protected] UM-CS-2004-071 ABSTRACT A number of Hausdorff-based algorithms have been proposed for finding objects in images.WeevaluatedifferentmeasuresandarguethattheHausdorffAveragedistance measure outperformsother variants for model detection. This method has improved robustness properties with respect to noise. We discuss the algorithms with respect to typical classes of noise, and we illustrate their relative performances through an exampleedge-basedmatchingtask. Weshowthatthismethodproducesamaximuma posterioriestimate. Furthermore,weargueforimprovedcomputationalefficiencyby tree-likesubdivisionsofthemodelandtransformationspaces. KEYWORDS Hausdorff,ObjectRecognition,SpatiallyCoherentMatching 1 Introduction Objectdetectionoftenreliesonmetricsthatdescribethedegreeofdifferencebetween two shapes. The one-sided Hausdorff distance, h A B , in this context is a measure betweenthesetoffeaturepointsdefiningamodel,A,andthesetofpointsdefininga targetimage,B,where h A B maxmin a b a A b B and is a normof thepoints ofA andB. ImagematchingusingHausdorff-based distances has been applied to many domains including astronomy [10], face detec- tion[5][13],andwordmatching[8]. Severalvariationsofthissetmetrichavebeenproposedasalternativestothemax oftheminapproachintraditionalHausdorffmatchingthatarelesspronetooutliersin thedata. TheseincludeHausdorfffraction,Hausdorffquantile[4],SpatiallyCoherent Matching[1], and Hausdorffaverage[3]. We analyzethe formof these metrics and argueabouttheirbehaviorunderseveralclasses ofnoise. Specifically, we determine whether there are discontinuities of the measure with respect to minor perturbations ofthepointsets. WeshowanalyticallyandexperimentallythatHausdorffaveragehas superiorperformanceundertheseconditionsasin[12]. 2 A General Schema Our general schema is as follows. We have an image I and a model M. We wish to discoverif the objectrepresentedbyM occursin I, andif so where. Our concept of “where” is encapsulated in a set of transformations T which we think of as positioninga copyT M of M in I. For eachsuch position, we computea score s T M . Amongalltransformations,wepicktheone Tˆ withthe“best”score. Ifthis scoreissufficiently“good”,weannouncethatM isatpositionT inI. Otherwise,we announcethatMisnotinI. 3 Notation Letusfixnotation.OurmodelMconsistsofavectoroffeatures, M S S 1 NM AfterapplicationofatransformationT eachfeatureS acquiresaposition i x y x y T S i i T i We will drop the T subscript when this is clear from context. Strictly speaking S i itselfdoesnothaveaposition.Itacquiresoneifweimagineanidentitytransformation placingitatsomepredeterminedpositioninI.Ingeneral, neednotactontheimage plane.Forexample,ifMisathree-dimensionalmodel, mayconsistofrigidmotions followedbyprojection.Wewillbeinterestedinthecasewherethetransformationsare translationsintheplane.Then x y T S T x y S i i If welike, we mayassume thatI consists ofa similar vectorof features, butthis is not necessary. We onlyneedto enquirewhethera featureS of M is matched at a i position x y inI. WhenI andM arebothsetsofedgepixels,everyfeatureofM is matchedateveryfeatureofI. ForeachfeatureS, the matchlocus, S is theset ofpositionsat whichS is i I i i matchedinI. S x y S ismatchedat x y I i i We will drop the subscript I when there is no ambiguity and that neither I nor M is empty. WhenIandMarepointsets(forexample,pixelsfoundbyanedgedetector), S i consistsofallpointsofI. However,theremaybemorethanonetypeoffeature. For example, one type may consist of edge pixels, whereas another type may consist of pointswhere a filter exceedssome threshold. If the features S and S are bothedge i j 2 pixels, then S S . Likewise if S and S are features for the same filter i j p q then S S . However,weshouldnotexpectthat S S . Thus p q i p wemaybuilddifferentaspectsoftheobjectintoourmodelandattempttomatchthem intheimage. Wechooseadistancefunctiond x y x y intheplane. Thenthematchset 1 1 2 2 inducesadistanceforeachtranslatedfeature, d d T S min d x y x y x y S Ti i i i T i ForeachT thisgivesusavectorofdistances, d d d d T S d T S T T1 TNM 1 NM Eachd tellsushowfarthefeatureS isfromitsnearestmatchwhenMisplaced Ti i atpositionT. Eachinstanceofourschemacanbedescribedintermsofthisvector. In eachinstance,weassumeafixedmodelandimage. 4 Distance measures 4.1 One-sided Hausdorffdistance For each T, the Hausdorff score, s T , is max d . We pick Tˆ to minimize this H i Ti score.Weacceptitifs Tˆ islessthansomethresholdvalue,s . H 0 4.2 Hausdorfffraction Wefixaminimumacceptabledistancek.ForeachT,Hausdorfffractionscore,s T HF iscardinality # S d k i Ti s T HF N M WepickTˆ tomaximizes T .WeacceptTˆ ifthefractions Tˆ exceedsathreshold HF HF values . 0 4.3 Hausdorffquantile Wefixaquantileq.ForeachT,theHausdorffquantilescore,s T istheqthquantile HQ valueofdistancesind . WechooseTˆ tominimizes T andacceptTˆ ifs Tˆ is T HQ HQ lessthansomefixedvalues . 0 4.4 SpatiallyCoherent Matching TodefineSpatially CoherentMatching,we needtodefinea neighbor relationonthe featuresofM. We takethefeaturesofM tobetheverticesofagraph. Twofeatures areneighborsifthereisanedgebetweentheminthisgraph. Weareinterestedinthe casewherethefeaturesareedgepixels.Wewillconsiderpixelstobeneighborsifthey areadjacent,horizontallyorvertically. Wefixaminimumacceptabledistancek. For 3 eachT,theSpatiallyCoherentMatchingscore,s T isdefinedasfollows.Wetake SCM G T S d k . WetakeB T tobethesetofedgeswithonevertexinG T i Ti and one vertex not in G T . This counts the numberof edges on the “boundary”of G T .Wetake #G T #B T s T SCM N M We chooseTˆ tomaximizes T . WeacceptTˆ ifs Tˆ exceedssomefixed SCM SCM values . 0 4.5 HausdorffAverage ForeachT,theHausdorffaveragescore,s T is HA s T !idTi HA N M WechooseTˆ tominimizes T . WeacceptT ifs Tˆ islessthansomefixedvalue HA HA s . 0 We will want to generalize this a little bit. Given a function f, we will want to consideraHausdorfffunctionalaveragescore,s T , HA f 1 s T !f d HA f Ti N M i Note that Hausdorff average score is a special case of Hausdorff functional average scorewith f d d . Ti Ti 5 Maximum a Posteriori Estimate TheHausdorfffunctionalaveragealgorithmhas asimplejustificationas amaximum aposterioriestimate. Wefollowtheargumentof[1]inasimplifiedform. Wehavea collectionofhypothesesandmustchoosetheonewhichmaximizestheprobability p h p I h p h I p I SinceIisfixed,weseek h argmaxp h p I h h Wetakeasourhypothesisspace 0/ whereeachhypothesisT corresponds totheassertionthattheobjectmodeledbyMoccursatpositionT inI,andthehypoth- esis0/ istheassertionthattheobjectdoesnotoccurinI. Ourpriorknowledgeconsists oftheassumptionthat p 0/ "andthatallpositionsT haveequalprobabilityC .We 1 assumethatgivenapositionT,thelikelihoodofIgivenT is p I T C #e f dTi 2 i 4 Weassumethatwhentheobjectisnotthere,allimageshaveequalprobability,C .This 3 gives p h p I h 1 " C1C2#ie f dTi ifh T "C ifh 0/ 3 InorderforthepresenceoftheobjectatpositionT tobemorelikelythantheabsence oftheobject,weneed 1 " C C #e f dTi "C 1 2 3 i Sincelogarithmsaremonotonic,theargmaxofthisfunctionistheargmaxofitsloga- rithm.Takingnegativelogarithmsreversestheinequality,turnstheargmaxintoargmin, andyieldstheinequality ln 1 " lnC1 ln C2 !f dTi ln " ln C3 i The best position Tˆ is the one minimizings T , and this represents the best hy- HA f pothesisifthatvalueislessthan ln 1 " lnC ln C ln " ln C 1 2 3 s 0 N M 6 Noise and stability: Wewouldliketoinvestigatethebehaviorofthesemeasureswhenthereisnoise. We willdealwithtwoclassesofnoise,distortionandstrayfeatures,typically,straypixels. Bydistortionwemeandisturbanceofthecoordinatesofafeatureorthepointsof itsmatchset. Thus,wemayhaveM withfeatures S S andM withfeatures 1 NM S S . ThedistortioniscapturedinthefactthatforeachT,wehave x y 1 NM i i x y T S and x y x y T S . WecapturedistortionbetweenimagesI and i i i i I byassumingthatthereisafunctiongsothatforeachi S g S . I i I i Straypixelsshowupasextrafeaturesinthemodelortheimage.Thus,wemayhave M with features S S and M with features S S S S . 1 NM 1 NM NM 1 NM n Weassumethatforeach j N thereisi N sothat S S .Thusweare M M j i notthrowinginanynewtypesoffeatures,andnoneofthesehaveemptymatchsets. Straypixelsintheimageshowupasextrapointsinthematchset. Thus,wemay haveanimageIwith S andanimageI withmatchset S S X. I i I i I i i Wewouldliketoknowhowrobustourscoresarewithrespecttonoise. Arobust score should only change a small amount if we introduce a small amount of noise. Whatwewantisforthescoretobeacontinuousfunctionofnoise. Sincepositionis typicallydiscrete, we will take a less puristapproachto this. We will act as if noise canbemadearbitrarilysmall,thoughthismaynotbethecase.Whatisasmallamount ofnoise? Adistortionissmallwhenforeachpairofpoints x y and x y asabove, thedistanced x y x y issmall. Onemightchooseastricterdefinitionhere.One mightaskthatthesupportofthedistortionissmall,thatis,thatonlyasmallnumberof pairsofpointshaved x y x y 0. Wewillarguethatthisistoorestrictive. We willsaythatthesetofstraypixelsissmallwhentheyarefewinnumbercomparedto 5 thetotalnumberoffeaturesorpixelsinthematchset. Wewillrestricttostraypixels lyingafixedboundeddistancefromtheremainingpixels.Thisisanotherwayofsaying thatourimagehasafixedsizeandthestraypixelslieinthatimage. These are realistic classes of noise. If the model is derived from measurements, thesearesubjecttoinaccuracy.Ifthemodelcomesfromaphotograph,distortioncould resultfrominaccuracyofthephotographicsetup,forexample,astoangleordistanceto theobject.Thissortofdifferencecorrespondstotakingaphotograph,applyingarigid motiontotheobjectandtakingasecondphotograph. Whenthatmotionissmall,the resultingdifferencebetweenthetwophotographsisasmalldistortion. Thisdistortion extendstotheentiremodel.Thisiswhywerejectrestrictingthesupportofadistortion asarequirementforitbeingsmall. Differingedgedetectorsarelikelytodisagreeaboutexactplacementofedge,pro- ducinganothersourceofdistortion. Likewisea modelthat is the resultofextracting edgesfromanimagecaneasilyacquirestraypixels. Stability withrespectto distortioncarriesoverto stability withrespectto change oftransformationT. IfT andT areclosethensoare x y T S and x y T S , i i andthus,soared andd . T T 7 Stability results Letusfixnotation. WearegivenanimageI,andamodelM. SupposethatI andM differfromthese by distortion, and that I and M differ fromthese by stray pixels. ForeachfixedT have d d I M d d T T T1 TNM d d I M d d T T T1 TNM d d I M d d d d T T T1 TNM TNM 1 TNM n d d I M d d T T T1 TNM Toinvestigatestability,wemustobservehowthesevectorsdifferandthediffering resultsthatourscores(andhenceouralgorithms)produceasaresult. Thereareseveralsourcesofinstabilitythatapplytoallofourmethodsabove.The firstisthatevenasmallchangeinthescores Tˆ canpushitaboveorbelowthethresh- oldvalues . Thesecondisthattheoperationsargmaxandargminarediscontinuous. 0 Thatis,ifs T ands T arenearoptimalandcloseinvalue,theneithercanbepro- motedtoTˆ byasmallchangeins ,eventhoughT andT maybewidelyseparated. Third,allthesescoresarehighlysensitivetostraypixelsintheimage. Thereason hereisthattheadditionofasinglepointtoImaycaused todifferfromd byalarge T T amountinalargenumberofcoordinates.ThisoccurswhentherearemanyfeaturesS i sothat x y T S isclosertothenewpointthananyofthepointsofI. Thishappens i when T fails to match many features of I in M. Since every pixel which is not part oftheobjectisinsomesenseastraypixel,wemusthopethatthisdoesnotoccurtoo oftenforoptimalvaluesofT. However,therequirementthatwehaveasmallamountofnoisedoesplacemean- ingfulrestrictionsonthedifferencesbetweend ,d andd andwecantracetheseto T T T theirpotentialimpactonouralgorithms.Therestrictionthatwehaveasmallamountof distortionensuresthatd andd differatmostbyasmallamountineachcoordinate. T T 6 TherequirementthatwehaveasmallnumberofstraypixelsinM ensuresthat n is NM small. 7.1 One-sided Hausdorffdistance Thescores T isstablewithrespecttodistortion. Thisisbecauseasmalldistortion H resultsinsmalldifferencesinthecoordinatesofd andd ,andthusasmalldifference T T betweenmax d andmax d . i Ti i Ti One-sidedHausdorffdistanceisunstablewithrespecttostraypixelsinthemodel. ThisisbecauseasinglestraypixelS mayproduced max d . NM 1 TNM 1 i Ti 7.2 Hausdorfffraction Thescores isunstablewithrespecttodistortion.Thisisbecauseofthediscontinuity HF involvedinthresholding. Hereis asimpleexample. SupposethatM is theboundary ofasquareofsidenandIistheboundaryofasquareofsiden 2k 2.Supposethat T placesM squarelyinthecenterofI. ThenallofT MiswithinkofI. IfM isthe boundaryofasquareofsiden 2,thennoneofT M iswithinkofI.Indeed,forthe optimaltransformationTˆ onlyhalfofTˆ M iswithinkofI. Hausdorfffractionisstablewithrespecttostraypixelsinthemodel. Assumewe have matchedm pixels, so that s T m . After the addition of stray pixels, we HF NM havethescore m j with j n. Since n issmall,soisthedifferencebetweenthese NM n NM twoscores. 7.3 Hausdorffquantile ThescoreS isstablewithrespecttodistortion. Thisfollowsfromthefactthatthe HQ coordinatesofd andd arecloseandthatthequantileoperationiscontinuouswhen T T restrictedtoaspaceoffixeddimension. Hausdorff quantile is unstable with respect to stray pixels in the model. This is because the quantile operatoris discontinuouswith respect to additionaldata points. Toseethis,considerthesituationinwhichthereisalargegapinthevaluesofourdata. Suppose also that the quantile we seek is representedby the datum at the bottom of thisgap.Addinganadditionaldatapointabovethisgapcausesthequantilemeasureto jumpuptothetopofthisgap. 7.4 SpatiallyCoherent Matching Thescores T isunstablewithrespecttodistortionforthesamereasonsasHaus- SCM dorfffraction. Spatiallycoherentmatchingisstablewithrespecttostraypixels.Toseethis,apply theargumentforHausdorfffractionseparatelytoboththematchingsetG T andthe boundarysetB T . 7 7.5 Hausdorffaverage Thescores T isstablewithrespecttodistortion. Toseethisobservethatd and HA T d arecloseandtheoperationoftakingtheaverageiscontinuous. T Hausdorffaverageisstablewithrespecttostraypixelsinthemodel. Toseethis, recall that we have bounded the distance of our stray pixels. This ensures that for i N wehaved d forsomefixedboundd .Beforetheadditionofthestray M Ti max max pixels,ourscoreis !NiM1dTi N M Aftertheadditionofthestraypixels,thescoreisnow !NiM1dTi !iNMNMk 1dTi N n M Thelattersummandsarebounded,so when n is sufficientlysmall, thesescoresare NM ascloseaswelike. Thesetheoreticalresultscanbeseenexperimentallyasthepresenceorabsenceof noiseinthemeasure.Seefigures9-14andtheexplanationinsection9below. 8 Algorithmic advantages of stability All of the previous methods search for an optimum value Tˆ . The most naive implementation of this search would iterate through all values of T . For each such T, it would iterate througheach featureS of M to compute x y T S . For i i each S it must then computethe distance from x y T S to S for which it i i i woulditeratethroughthepointsof S . Thus,ifM consistsofN edgepixels, i M consistofN transformationsandI consistsofN edgepixels,thisrequiresN N N T I M T I individualdistancecomputations.Whatisworse,theimagesaretwo-dimensionaland is at least two-dimensions (and could easily be four or five dimensional). This contemplatesa computationwhich is at least n6 . Fortunately,we neednot be so naive! 8.1 Efficiencies inthe image AsHuttenlocherpointsout[4],theiterationoverthepointsofI canbedoneonceand recordedintheVoronoifunction.IfIrepresentsanimageofwidthw andheighth ,the I I Voronoifunctionisthemapfrom 0 w 1 0 h 1 whichgivesthedistancefrom I I eachpixelinthedomainofI tothenearest(actual)pixelofI. IfM has f different M typesoffeatures,thenthereare f differentmatchlociinI andweneed f different M M Voronoifunctions. 8.2 Efficiencies in For s , Huttenlocher shows that one can improve the efficiency of the search for Tˆ H by subdividing into regions. Given a region R, one picks T R (perhaps at its R 8 center)andcomputessH TR .Oneisalsoabletocomputeabound,$RsothatifT R, sH T sH TR $R. Thus, if sH TR is sufficiently bad (say sH TR s0 $R), onecanremovefromfurtherconsiderationnotonlyT ,butalltransformationsT R. R If we are seeking Tˆ and we have already computed s T , then we can reject all H R T RifsH T sH TR $R. Regionswhicharenoteliminatedfromconsideration aresubdividedandtheprocessrepeats. Theprocessendsbyeitherdiscoveringthatall transformationshavebeeneliminated(inwhichcasethereisnotransformationT with s T s )orbyfindingTˆ withs Tˆ s . H 0 H 0 Thisprocessdependsontheexistence$R.Theexistenceofthisboundisguaranteed bystabilitywithrespecttodistortion. Toseethisingeneral,chosetheregionRtobe compact. Foreachfeature,S , x y T S iscontinuouswithrespecttoT. Hence,the i i vectord iscontinuouswithrespecttoT. Finally,stabilitywithrespecttodistortion T ensuresthats T iscontinuouswithrespecttoT. ThisensuresthattransformationsT whichareclosetoT havescoress T whichareclosetos T .Inparticularthesetof R R scoress T withT Risbounded. Inpractice,ofcourse,weneednotonlytheexistenceof$R butaneffectivewayto computeit.Thisisfeasibleformanyreasonablechoicesof andR.Inthecasethats iss ,s ors , consistsoftranslations,Risarectangle,andR isitscenter,then H HQ HA T $R isonehalfthediagonalofR. Themostnaturalwaytosubdivide inthiscaseis byusingaquadtree[11]. 8.3 Efficiencies inthe model Tofurtherspeedupthecomputation,HuttenlochersuggestsquickMonteCarloelim- inationofregionsbycomputingthedistanceforrandomlychosenpointsofM. This mayfailtoeliminatearegionwhichwouldhavebeeneliminatedifthedistancewere computedforallpointsofM. However,allofitssub-regionswilleventuallybeelimi- nated. Thisworksonlyinthecaseofs . Itworksbecauses T max d . HenceT H H Ti canbeeliminatedonthebasisofasinglecoordinateofd . T We proposeanadditionalefficiencywhichappliestoanymeasurewhichhassta- bility with respectto distortion. It applies most easily to s , s ands where the H HQ HA errorboundsareonceagainthelengthsofhalf-diagonals. We require the additional assumption that each feature S of M has a position i x y S andthatforeachT, x y T S isacontinuousfunctionof x y S . (These i i i methodscanbeappliedtothreedimensionalmodelsundergoingout-of-planerotation, butwewillexposittheminthecasewhereMistwodimensional.) Supposenow,thatweimposeaquadtreeT onourmodelM.Ateachlevel ,Mis M composedinto4 regions,R R . Letc c betheircenters. Supposethat 1 4 1 4 theseregionscontainn n featuresofM.WemayreplaceourmodelMwithan 1 4 approximationM consistingofthepointsc c withmultiplicitiesn n . 1 4 1 4 Ofcoursewewillomitanypointsofmultiplicity0. Now,foragiventransformationT,wemaycomputethevector d d T c d T c d T c d T c T 1 1 4 4 9 whereeachcoordinated T c isrepeatedn times.Noweachofthesecoordinateis i i within$ ofthecorrespondingcoordinateofdT.(Here$ isthehalf-diagonalthesere- gions.)Noticealsothats ,s ands areinvariantunderpermutationofcoordinates. H HQ HA Itfollowsthatforeachofthese, s T s d $ T This observation combines with that of the previous subsection, so that if R is a regionof the subdivisionof and is a level of the subdivisionof our model, and T Rthen s T s d TR $R $ Noticethatcomputings d requiresatmost4 distancelookupsintheVoronoi T diagramratherthanthefullN ofthem. Inthecasewherewearecomputings d M H T ors d weneednotevenwriteoutmultiplecopiesofthevalued T c since HA T i wearecomputingeitherthemaxoftheseoraweightedaverageofthem. 8.4 Implementation issues Thetree-likenatureofthedecompositionof intoregionsraisesquestionsastowhat isthebestwaytosearchthistree.Introducingthelevels raisesaquestionastowhich levelisbestforqueryingagivenregionR. Weconjecturethattheoptimumstrategyis tokeep$R and$ assimilarinmagnitudeaspossibleoncetheregionsRbecomesmall enough. 9 Experimental results Forourexperimentswesynthesizeddatausing11arbitrarybackgroundswithacropped objectfromtheCOIL20dataset[9]superimposed. Wesynthesized100targetimages intotalbyrandomlychoosingaforegroundobjectandrandomlyplacingitwithinthe background. We thensampled10modelsforeachtargetincludingtheobjectknown tobeinthescene. WeusedtheresultsofmatchingthesemodelstoestimateReceiver OperatingCharacteristic(ROC)curvesforeachmeasureasin[1]. EachtargetimagewasprocessedusingtheCannyedgedetectorwithMatLabde- faultparametersforthresholdandsigma[2]. TheCOIL imageswerealso processed usingthesameedgedetectionalgorithm. Werefertotheresultsofedgedetectionon theCOILimagesasthemodelset. Detection consisted of selecting the maximum value and transform into a target for a given model of the distance measure for the Hausdorff Fraction and Spatially Coherent Matching algorithms, and of selecting the minimum value of the distance measure for the One-sided Hausdorff, Hausdorff Quantile, Hausdorff Average, and HausdorffFunctionalAveragedistancemeasures. Thetransformspacewaslimitedin these experimentsto translationin x andy by onepixel increments. In the case that thereweremultiplepointsinthetransformationspacethattiedforthebestmatch,we detected8-connectedregionsandtookthecentroidofthe largestsuchregion. In the casethatthereweremultipleregionswiththesamesize,wechoseoneatrandom.Thus 10

Description:
On Hausdorf f Distance Measures distances has been applied to man y domains including astronomy all images ha ve equal probability ,C 3. This gives
See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.