opencvpart04.pdf

Upload: tieu-bao-vi

Post on 04-Jun-2018

231 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/14/2019 openCvPart04.pdf

    1/4

    i tacepaper ismeasureds hetcpornt distance This is alsoEuclideanistance.n two dime(2D), he Eucl ideanir tancepo nts Pj and P, rsd r z=sq f t ( Ax2+Ay2 ) ,whereAx = x2 xr, and y = y, - yr.

    l nFigurein 2D3D, t's sqrt(Ax' Ay' +I showsEuclideanista

    recogn on means igurng out whoselace it is. You won't seesecurityevelrecognition rom eigenface. t workswel enough,howevef,o makea funenhancemento a hobbyist obotics

    a

    r , r s month's art ic le gives ar. : : ed expanaton f howegenface.Jor

  • 8/14/2019 openCvPart04.pdf

    2/4

    a9.aE 9. Righ! Fitthg 3- b ttrrec poht! 6 .aFd c.s. of PCA-Lcft:t ror..t points from thc3 in D onto thc lD-. ld!i? thc Polnt on! tr thrt's closast lot 9D Polnt. Sottomlt lo subsp6cqand th?Pt6 b?t\ i?an Polnts

    '4. :n this alue?-:r's define noise a5r.- .9 - other than an_'-':/ di{ference that. ' , : 's Pixelbnghtness. 'ra images reexactly. ._: .aI , and small , nci., : nfluences ausechangesn: ,' Drghtness.f eachoneol these':,: pxelscontributesvena small,_ -nt of noise,hesheer umber l:, pixels eanshe otalnoiseevel.e very lgh.Amdst all thesenoisecontnbu''!, whatevernformations uSelul- dentifyingndividualaces 5lr.imably ontributingome on or-rBtentsignal. utwith2,500 xels::r adding ome mount f noiseo-. answelhatsmall ignalshard o_r andhardero measure.very often, the information {_'resthasa muchowerdimension_i f than the numberof measure-.nts. ln thecase f an mage, ach: (el's alues a measurement ost

  • 8/14/2019 openCvPart04.pdf

    3/4

    I IILUTIFIGURE. L.tt F6c. lm.sEsior 10 p.oplc. Righi Thcfirst sh prlnclprlcomponantsvlcwrd 6r cigcnf.c6.ProiectingData Onto aSub5pa(eMeanwhile. let 'sflnish the description fdimenslonaty reductionby PCA. we're almosttherelcoing back to themap in Fgure 2, nowthat weve folnd a lDsubspace, e need away to convert 2Dpoints o 1Dpoints. heprocessor doing thal iscaled project ion. henyou projecra po nr onroa suospace,ou assrgn rthe subspace ocat ionthat 's c losest to i tsiore to separa te: oth polntsare ully

    We canextendh s idea ndeflnite-ly.Three oints ef nea plane,which sa 2D object, so a datasetwith threedatapointscan neverhavemore hantwo principal omponents, ven f itsin a 3D. or higher, oordinate ystern.In e genface,each 50 x 50fare mage s treated as one datapont ( n a 2,500 dimens nal"space')so the number f pr incpalcomponentse can indwil never emore han the numberoi face rnagesAlthough t's important o haveaconceptual nderstandingf whatprincipal omponents re, you won'tneed to know the detais of how tofind them to implement eigenface.That part has been done for youalready n OpenCV. l take youthroLrghhe API for that in nextmonth'9 r tc le.

    locat ion n the higherdimensionaspace. That sounds me5sy andcomplicated, ut i t 's nether. Toprojecta 2D map point onto the linein Figure , you'd ind the pointonthe line that's closest to that 2Dpoint.Thats ts projection.There's function n Opencv forprojectlng ointsonto a subspace,oagain. you only need a conceptualunderstanding.ou can leave healgoithmicdetailso the library.The blue t ic marks n Figureshow the subspace ocat ion ofthe three ct ies that def ined thl ine. Other 2D point5can aso beprojected nto this ine The ighthandside of Figure2 shows he prolectedlocations or Phoenix,Albuquerque,andBoston.Computing Distances Between Fa

  • 8/14/2019 openCvPart04.pdf

    4/4

    l8enfaces re nterestingo lookt 3ndgiveusgome ntuitionabouttq pnncipalcomponenlsor our]riet fhe lelthandsideof Figure! ;-ol/vsace magesor 10 People.-6e face imageSare from the,.. FaceDatabaseB (Re{erences,',: 5). lt contains images ol'xes under a range ol lighting-ro,tions. I usedsevenmagesor..:.l of these 0 PeoPleo createa'CA subspace.ft ghthand ide ot Figure3r-!:\^/she first six pdncipal ompc_..ts of this dataset, isplayedsr:enfaces. heeigenfacesftenhavr :.osily ook,bcauseheycomblne.inents from several aces.The:.ghtest and the darkestPixel5 n.'.+ eiqenfacema* the faceregions-:i co;tributed osto thatprincipal

    limitationsof EigenfaceThe principal omponentshatt{A finds are the directionsof.rate5t ariationn thedata.one of:.e assumptionsn eigenfaces that.ariabilityn the underlyingmages:crrespond5o differencesbetween.dividual aces.Thisassumptions,,nfortunately, not always valid..rgure 4 shows Iaces from twondividuals. ach ndividual'sace s

    I splayednderourdifferentightingaonditaons,The5emages re also rom theYaleFace atabase. n fact, hey'refacemagesor two of the 10PeoPleshownn Figure . Can ou ellwhichones rewhich? igenfacean'lWhenllghting s highlyva able,eigenfaceoften doesno better han random- othlr factors hat may "stretch"mage ariabilityn directionshat endto blur dentityn rcA spacencludechangesn expression,amera ngle,andhead ose.Figure shows owdatadistribu-tionsalfecteigenface'serformanceThebestcaseor eigen{aces at thetop of Figure 5. Here, rmage5from two individuals re clumpedinto tight clusters hat are wellseparatedrom one anolher- hatswhat you hope will hapPen.Themiddle aneln Figure showswhat

    youhop 4,on't appen.n thb Penel,imagestor each individualcontaana great deal ol vadability So muchso. that thdv skewedthe rcAsubspacen a way that makes rtimpossibleor eigen{aceo tell thesetwo people part.Their ace magesareplojectingonlothe 5ameplacesnthePcAsubspace.In practice, ou'llProbablyindthat the data distributionsor faceimages all somewheren betweentheseextremes. he bottom panel nFigure shows realisticistributiontor eigenface.Since the eigenvectorsaredeterminedonly by data varjability,youle limitedn whatYou ando tocontrol how eigenlacebehavesHowever, oucan ake steps o limit,or to olherwise anage,nvircnmen-tal conditionshat mightconfusetFor example, lacinghe camera tface levelwill reducevariabilityncameta ng|e,Lighting@nditions such ssidelightingrornwindowsare harderfora mobib robot to control.8ut Youmightconsiderddingntelligencentop ot face ecognitiono compensatefor that. Forexample,f Your obotknowsoughly heret'5 ocated,ndwhich direction t's fa