430 likes | 664 Views
Computer Vision. Lecture 8: Structure from Motion RANSAC Structure from motion problem Structure estimation Motion estimation Structure and motion estimation Goal : To understand the general ideas and Some of the methods. Read : Forsyth & Ponce Chapter: 12 - 13. Niels Chr Overgaard
E N D
Computer Vision • Lecture 8: Structure from Motion • RANSAC • Structure from motion problem • Structure estimation • Motion estimation • Structure and motion estimation • Goal: To understand the general ideas and • Some of the methods. Read: Forsyth & Ponce Chapter: 12 - 13 Niels Chr Overgaard 2010 TexPoint fonts used in EMF: AAA
Datorseende vt-10 Föreläsning 8 RANSAC Random sampling concensus RANSAC - is a general probabilistic method for model estimation given noisy and contaminated data. Example: Line fitting (15 noisy + 5 outliers) Theory Practice
Datorseende vt-10 Föreläsning 8 • RANSAC – algorithm (outline) • Input: • S = data points • n = samplesize • k = number of iterations • t = threshold for godness of fit • ( d = sufficientnumber of inliers (optional) ) • Loop: repeatktimes • Pick n-sample at random from S • Fitmodel to sample • Count #inliers (i.e. points in S fitting the modelwithinthresholdt) • Store sample and inliersifbetterthan the previousone. • ( Stop if #inliers > d (optional) ) • Finalization: • Fitmodel to the inliers of the best sampleobtained.
Datorseende vt-10 Föreläsning 8 Example: line fitting (again) Recall our situation: 20 points given, 5 outliers: Sample size: n = 2. Number of iterations: k>6 (we use k=7) Threshold for goodness of fit: d=0.5 (wrt. scale in figure)
Datorseende vt-10 Föreläsning 8 The first iteration:
Datorseende vt-10 Föreläsning 8 The following 6 iterations:
Datorseende vt-10 Föreläsning 8 The final line estimation: Notice: Exhaustive search for the line with most inliers requires 190 iterations!
RANSAC: How many iterations? Let w denote (#inliers)/(#data points). n = the sample size (n=2 for lines, n=4 for plane homographies) k iterations. The probability that a random n-sample is correct: The probability that k random n-sample contains at least one outlier each: Choose k so large that the fraction of failures is smaller than a given tolerance z.
RANSAC: k for p=1-z=0.99 från Hartley & Zisserman
Datorseende vt-10 Föreläsning 8 X x Kamera- centrum Bildplan
Datorseende vt-10 Föreläsning 8 • The Structure from Motion Problem • Many cameras (images) • Many scene points • Estimate all of them! • Let us see how this is done in principle
Datorseende vt-10 Föreläsning 8 3D-modell Exempel: Punkter Följda punkter Bilder
Datorseende vt-10 Föreläsning 8 3D-modell Exempel: Linjer och kägelsnitt Bilder