RANSAC 16-385 Computer Vision (Kris Kitani) Carnegie Mellon - - PowerPoint PPT Presentation

ransac
SMART_READER_LITE
LIVE PREVIEW

RANSAC 16-385 Computer Vision (Kris Kitani) Carnegie Mellon - - PowerPoint PPT Presentation

RANSAC 16-385 Computer Vision (Kris Kitani) Carnegie Mellon University Up to now, weve assumed correct correspondences What if there are mismatches? outlier How would you find just the inliers? RANSAC RAN dom SA mple C onsensus [Fischler


slide-1
SLIDE 1

RANSAC

16-385 Computer Vision (Kris Kitani)

Carnegie Mellon University

slide-2
SLIDE 2

Up to now, we’ve assumed correct correspondences

slide-3
SLIDE 3

What if there are mismatches?

  • utlier

How would you find just the inliers?

slide-4
SLIDE 4

RANSAC

RANdom SAmple Consensus

[Fischler & Bolles in ’81]

slide-5
SLIDE 5

Algorithm:

  • 1. Sample (randomly) the number of points required to fit the model
  • 2. Solve for model parameters using samples
  • 3. Score by the fraction of inliers within a preset threshold of the model

Repeat 1-3 until the best model is found with high confidence

Fitting lines (with outliers)

slide-6
SLIDE 6

Algorithm:

  • 1. Sample (randomly) the number of points required to fit the model
  • 2. Solve for model parameters using samples
  • 3. Score by the fraction of inliers within a preset threshold of the model

Repeat 1-3 until the best model is found with high confidence

Fitting lines (with outliers)

slide-7
SLIDE 7

Algorithm:

  • 1. Sample (randomly) the number of points required to fit the model
  • 2. Solve for model parameters using samples
  • 3. Score by the fraction of inliers within a preset threshold of the model

Repeat 1-3 until the best model is found with high confidence

Fitting lines (with outliers)

slide-8
SLIDE 8

δ

6 =

I

N

Algorithm:

  • 1. Sample (randomly) the number of points required to fit the model
  • 2. Solve for model parameters using samples
  • 3. Score by the fraction of inliers within a preset threshold of the model

Repeat 1-3 until the best model is found with high confidence

Fitting lines (with outliers)

slide-9
SLIDE 9

δ

14 =

I

N

Algorithm:

  • 1. Sample (randomly) the number of points required to fit the model
  • 2. Solve for model parameters using samples
  • 3. Score by the fraction of inliers within a preset threshold of the model

Repeat 1-3 until the best model is found with high confidence

Fitting lines (with outliers)

slide-10
SLIDE 10

How to choose parameters?

  • Number of samples N

– Choose N so that, with probability p, at least one random sample is free

from outliers (e.g. p=0.99) (outlier ratio: e )

  • Number of sampled points s

– Minimum number needed to fit the model

  • Distance threshold δ

– Choose δ so that a good point with noise is likely (e.g., prob=0.95) within threshold

– Zero-mean Gaussian noise with std. dev. σ: t2=3.84σ2

proportion of outliers 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

N = log(1 − p) log ✓ 1 − (1 − e)s ◆

slide-11
SLIDE 11

Good

  • Robust to outliers
  • Applicable for larger number of parameters than Hough transform
  • Parameters are easier to choose than Hough transform

Bad

  • Computational time grows quickly with fraction of outliers and

number of parameters

  • Not good for getting multiple fits

Common applications

  • Computing a homography (e.g., image stitching)
  • Estimating fundamental matrix (relating two views)
slide-12
SLIDE 12

Given two images… find matching features (e.g., SIFT)

slide-13
SLIDE 13

Matched points will usually contain bad correspondences

good correspondence bad correspondence

how should we estimate the transform?

slide-14
SLIDE 14

LLS or DLT will find the ‘average’ transform

‘average’ transform

solution is corrupted by bad correspondences

slide-15
SLIDE 15

Use RANSAC

How many correspondences to compute translation transform?

slide-16
SLIDE 16

Need only one correspondence, to find translation model

slide-17
SLIDE 17

Pick one correspondence, count inliers

  • ne

correspondence

slide-18
SLIDE 18

Pick one correspondence, count inliers

2 inliers

slide-19
SLIDE 19

Pick one correspondence, count inliers

  • ne

correspondence

slide-20
SLIDE 20

Pick one correspondence, count inliers

5 inliers

slide-21
SLIDE 21

Pick one correspondence, count inliers

5 inliers

Pick the model with the highest number of inliers!

slide-22
SLIDE 22

Estimating homography using RANSAC

  • RANSAC loop
  • 1. Get four point correspondences (randomly)
  • 2. Compute H (DLT)
  • 3. Count inliers
  • 4. Keep if largest number of inliers
  • Recompute H using all inliers
slide-23
SLIDE 23

Estimating homography using RANSAC

  • RANSAC loop
  • 1. Get four point correspondences (randomly)
  • 2. Compute H using DLT
  • 3. Count inliers
  • 4. Keep if largest number of inliers
  • Recompute H using all inliers
slide-24
SLIDE 24

Estimating homography using RANSAC

  • RANSAC loop
  • 1. Get four point correspondences (randomly)
  • 2. Compute H using DLT
  • 3. Count inliers
  • 4. Keep if largest number of inliers
  • Recompute H using all inliers
slide-25
SLIDE 25

Estimating homography using RANSAC

  • RANSAC loop
  • 1. Get four point correspondences (randomly)
  • 2. Compute H using DLT
  • 3. Count inliers
  • 4. Keep H if largest number of inliers
  • Recompute H using all inliers
slide-26
SLIDE 26

Estimating homography using RANSAC

  • RANSAC loop
  • 1. Get four point correspondences (randomly)
  • 2. Compute H using DLT
  • 3. Count inliers
  • 4. Keep H if largest number of inliers
  • Recompute H using all inliers
slide-27
SLIDE 27

Useful for…

slide-28
SLIDE 28