Mult-stable Percepton Necker Cube
Spnnng dancer lluson, Nobuuk Kaahara
Fttng and Algnment Computer Vson Szelsk 6.1 James Has Acknowledgment: Man sldes from Derek Hoem, Lana Lazebnk, and Grauman&Lebe 2008 AAAI Tutoral
Project 2 due date moved to Frda
Revew Fttng: fnd the parameters of a model that best ft the data Algnment: fnd the parameters of the transformaton that best algn matched ponts
Revew: Fttng and Algnment Desgn challenges Desgn a sutable goodness of ft measure Smlart should reflect applcaton goals Encode robustness to outlers and nose Desgn an optmzaton method Avod local optma Fnd best parameters quckl
Fttng and Algnment: Methods Global optmzaton / Search for parameters Least squares ft Robust least squares Iteratve closest pont (ICP) Hpothesze and test Hough transform RANSAC
Revew: Hough Transform 1. Create a grd of parameter values 2. Each pont votes for a set of parameters, ncrementng those values n grd 3. Fnd mamum or local mama n grd
Revew: Hough transform P.V.C. Hough, Machne Analss of Bubble Chamber Pctures, Proc. Int. Conf. Hgh Energ Accelerators and Instrumentaton, 1959 Gven a set of ponts, fnd the curve or lne that eplans the data ponts best m = m + b Hough space b Slde from S. Savarese
Revew: Hough transform m b m 3 5 3 3 2 2 3 7 11 10 4 3 2 3 1 4 5 2 2 1 0 1 3 3 Slde from S. Savarese b
Hough Transform How would we fnd crcles? Of fed radus Of unknown radus Of unknown radus but wth known edge orentaton
Hough transform for crcles mage space Hough parameter space r (, ) ri (, ) (,) (, ) ri (, )
Hough transform for crcles Conceptuall equvalent procedure: for each (,,r), draw the correspondng crcle n the mage and compute ts support r Is ths more or less effcent than votng wth features?
Hough transform conclusons Good Robust to outlers: each pont votes separatel Farl effcent (much faster than trng all sets of parameters) Provdes multple good fts Bad Some senstvt to nose Bn sze trades off between nose tolerance, precson, and speed/memor Can be hard to fnd sweet spot Not sutable for more than a few parameters grd sze grows eponentall Common applcatons Lne fttng (also crcles, ellpses, etc.) Object nstance recognton (parameters are affne transform) Object categor recognton (parameters are poston/scale)
RANSAC (RANdom SAmple Consensus) : Fschler & Bolles n 81. Algorthm: 1. Sample (randoml) the number of ponts requred to ft the model 2. Solve for model parameters usng samples 3. Score b the fracton of nlers wthn a preset threshold of the model Repeat 1-3 untl the best model s found wth hgh confdence
RANSAC Lne fttng eample Algorthm: 1. Sample (randoml) the number of ponts requred to ft the model (#=2) 2. Solve for model parameters usng samples 3. Score b the fracton of nlers wthn a preset threshold of the model Repeat 1-3 untl the best model s found wth hgh confdence Illustraton b Savarese
RANSAC Lne fttng eample Algorthm: 1. Sample (randoml) the number of ponts requred to ft the model (#=2) 2. Solve for model parameters usng samples 3. Score b the fracton of nlers wthn a preset threshold of the model Repeat 1-3 untl the best model s found wth hgh confdence
RANSAC Lne fttng eample N I 6 Algorthm: 1. Sample (randoml) the number of ponts requred to ft the model (#=2) 2. Solve for model parameters usng samples 3. Score b the fracton of nlers wthn a preset threshold of the model Repeat 1-3 untl the best model s found wth hgh confdence
RANSAC Algorthm: N I 14 1. Sample (randoml) the number of ponts requred to ft the model (#=2) 2. Solve for model parameters usng samples 3. Score b the fracton of nlers wthn a preset threshold of the model Repeat 1-3 untl the best model s found wth hgh confdence
How to choose parameters? Number of samples N Choose N so that, wth probablt p, at least one random sample s free from outlers (e.g. p=0.99) (outler rato: e ) Number of sampled ponts s Mnmum number needed to ft the model Dstance threshold Choose so that a good pont wth nose s lkel (e.g., prob=0.95) wthn threshold Zero-mean Gaussan nose wth std. dev. σ: t 2 =3.84σ 2 N log 1 p/ log1 1 e s proporton of outlers e s 5% 10% 20% 25% 30% 40% 50% 2 2 3 5 6 7 11 17 3 3 4 7 9 11 19 35 4 3 5 9 13 17 34 72 5 4 6 12 17 26 57 146 6 4 7 16 24 37 97 293 7 4 8 20 33 54 163 588 8 5 9 26 44 78 272 1177 For p = 0.99 modfed from M. Pollefes
RANSAC conclusons Good Robust to outlers Applcable for larger number of objectve functon parameters than Hough transform Optmzaton parameters are easer to choose than Hough transform Bad Computatonal tme grows quckl wth fracton of outlers and number of parameters Not good for gettng multple fts Common applcatons Computng a homograph (e.g., mage sttchng) Estmatng fundamental matr (relatng two vews)
How do we ft the best algnment?
Algnment Algnment: fnd parameters of model that maps one set of ponts to another Tpcall want to solve for a global transformaton that accounts for *most* true correspondences Dffcultes Nose (tpcall 1-3 pels) Outlers (often 50%) Man-to-one matches or multple objects
Parametrc (global) warpng T p = (,) p = (, ) Transformaton T s a coordnate-changng machne: p = T(p) What does t mean that T s global? Is the same for an pont p can be descrbed b just a few numbers (parameters) For lnear transformatons, we can represent T as a matr p = Tp ' T '
Common transformatons orgnal Transformed translaton rotaton aspect affne perspectve Slde credt (net few sldes): A. Efros and/or S. Setz
Scalng Scalng a coordnate means multplng each of ts components b a scalar Unform scalng means ths scalar s the same for all components: 2
Scalng Non-unform scalng: dfferent scalars per component: X 2, Y 0.5
Scalng Scalng operaton: ' ' a b Or, n matr form: ' ' a 0 0 b scalng matr S
2-D Rotaton (, ) (, ) = cos() - sn() = sn() + cos()
2-D Rotaton Ths s eas to capture n matr form: ' ' cos sn sn cos Even though sn() and cos() are nonlnear functons of, s a lnear combnaton of and s a lnear combnaton of and What s the nverse transformaton? Rotaton b For rotaton matrces R 1 T R R
Basc 2D transformatons Translate Rotate Shear Scale 1 1 ' ' cos sn sn cos ' ' s s 0 0 ' ' 1 1 0 0 1 t t 1 f e d c b a Affne Affne s an combnaton of translaton, scale, rotaton, shear
Affne Transformatons Affne transformatons are combnatons of Lnear transformatons, and Translatons Propertes of affne transformatons: Lnes map to lnes Parallel lnes reman parallel Ratos are preserved Closed under composton 1 f e d c b a 1 1 0 0 1 ' ' f e d c b a or
Projectve Transformatons Projectve transformatons are combos of Affne transformatons, and Projectve warps Propertes of projectve transformatons: ' ' w' Lnes map to lnes Parallel lnes do not necessarl reman parallel Ratos are not preserved Closed under composton Models change of bass Projectve matr s defned up to a scale (8 DOF) a d g b e h c f w
2D mage transformatons (reference table) Szelsk 2.1
Eample: solvng for translaton A 1 A 2 A 3 B 1 B 2 B 3 Gven matched ponts n {A} and {B}, estmate the translaton of the object A A B B t t
Eample: solvng for translaton A 1 A 2 A 3 B 1 B 2 B 3 Least squares soluton A A B B t t (t, t ) 1. Wrte down objectve functon 2. Derved soluton a) Compute dervatve b) Compute soluton 3. Computatonal soluton a) Wrte n form A=b b) Solve usng pseudo-nverse or egenvalue decomposton A n B n A n B n A B A B t t 1 1 1 1 1 0 0 1 1 0 0 1
Eample: solvng for translaton A 1 A 5 B 4 A 2 A B 1 3 (t, t ) A 4 B 2 B 3 B 5 Problem: outlers RANSAC soluton 1. Sample a set of matchng ponts (1 par) 2. Solve for transformaton parameters 3. Score parameters wth number of nlers 4. Repeat steps 1-3 N tmes B B A A t t
Eample: solvng for translaton B 4 A 1 B 5 B 6 A 2 A B 1 3 (t, t ) A 4 B 2 B 3 A 5 A 6 Problem: outlers, multple objects, and/or man-to-one matches Hough transform soluton 1. Intalze a grd of parameter values 2. Each matched par casts a vote for consstent values 3. Fnd the parameters wth the most votes 4. Solve usng least squares wth nlers B B A A t t
Eample: solvng for translaton (t, t ) Problem: no ntal guesses for correspondence A A B B t t
What f ou want to algn but have no pror matched pars? Hough transform and RANSAC not applcable Important applcatons Medcal magng: match bran scans or contours Robotcs: match pont clouds
Iteratve Closest Ponts (ICP) Algorthm Goal: estmate transform between two dense sets of ponts 1. Intalze transformaton (e.g., compute dfference n means and scale) 2. Assgn each pont n {Set 1} to ts nearest neghbor n {Set 2} 3. Estmate transformaton parameters e.g., least squares or robust least squares 4. Transform the ponts n {Set 1} usng estmated parameters 5. Repeat steps 2-4 untl change s ver small
Eample: algnng boundares 1. Etract edge pels p 1.. p n and q 1.. q m 2. Compute ntal transformaton (e.g., compute translaton and scalng b center of mass, varance wthn each mage) 3. Get nearest neghbors: for each pont p fnd correspondng match() = argmn dst(p, qj) j 4. Compute transformaton T based on matches 5. Warp ponts p accordng to T 6. Repeat 3-5 untl convergence p q
Eample: solvng for translaton (t, t ) Problem: no ntal guesses for correspondence A A B B t t ICP soluton 1. Fnd nearest neghbors for each pont 2. Compute transform usng matches 3. Move ponts usng transform 4. Repeat steps 1-3 untl convergence
Algorthm Summares Least Squares Ft closed form soluton robust to nose not robust to outlers Robust Least Squares mproves robustness to outlers requres teratve optmzaton Hough transform robust to nose and outlers can ft multple models onl works for a few parameters (1-4 tpcall) RANSAC robust to nose and outlers works wth a moderate number of parameters (e.g, 1-8) Iteratve Closest Pont (ICP) For local algnment onl: does not requre ntal correspondences