ransac robust model estimation from data contaminated by outliers ondřej chum

17
RANSAC RANSAC Robust model estimation from data contaminated by outliers Ondřej Chum

Upload: cora-green

Post on 13-Dec-2015

219 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: RANSAC Robust model estimation from data contaminated by outliers Ondřej Chum

RANSACRANSAC

Robust model estimation from data contaminated by outliers

Ondřej Chum

Page 2: RANSAC Robust model estimation from data contaminated by outliers Ondřej Chum

Fitting a Line

Least squares fit

Page 3: RANSAC Robust model estimation from data contaminated by outliers Ondřej Chum

RANSAC

• Select sample of m points at random

Page 4: RANSAC Robust model estimation from data contaminated by outliers Ondřej Chum

RANSAC

• Select sample of m points at random

• Calculate model parameters that fit the data in the sample

Page 5: RANSAC Robust model estimation from data contaminated by outliers Ondřej Chum

RANSAC

• Select sample of m points at random

• Calculate model parameters that fit the data in the sample

• Calculate error function for each data point

Page 6: RANSAC Robust model estimation from data contaminated by outliers Ondřej Chum

RANSAC

• Select sample of m points at random

• Calculate model parameters that fit the data in the sample

• Calculate error function for each data point

• Select data that support current hypothesis

Page 7: RANSAC Robust model estimation from data contaminated by outliers Ondřej Chum

RANSAC

• Select sample of m points at random

• Calculate model parameters that fit the data in the sample

• Calculate error function for each data point

• Select data that support current hypothesis

• Repeat sampling

Page 8: RANSAC Robust model estimation from data contaminated by outliers Ondřej Chum

RANSAC

• Select sample of m points at random

• Calculate model parameters that fit the data in the sample

• Calculate error function for each data point

• Select data that support current hypothesis

• Repeat sampling

Page 9: RANSAC Robust model estimation from data contaminated by outliers Ondřej Chum

How Many Samples?

On average

mean time before the success E(k) = 1 / P(good)

N … number of pointI … number of inliersm … size of the sample

P(good) =

Page 10: RANSAC Robust model estimation from data contaminated by outliers Ondřej Chum

How Many Samples?

With confidence p

Page 11: RANSAC Robust model estimation from data contaminated by outliers Ondřej Chum

How Many Samples?

With confidence p

P(good) =

P(bad) = 1 – P(good)

N … number of pointI … number of inliersm … size of the sample

P(bad k times) = (1 – P(good))k

Page 12: RANSAC Robust model estimation from data contaminated by outliers Ondřej Chum

How Many Samples?

With confidence p

P(bad k times) = (1 – P(good))k ≤ 1 - p

k log (1 – P(good)) ≤ log(1 – p)

k ≥ log(1 – p) / log (1 – P(good))

Page 13: RANSAC Robust model estimation from data contaminated by outliers Ondřej Chum

How Many Samples

I / N [%]

Siz

e of

the

sam

ple

m

Page 14: RANSAC Robust model estimation from data contaminated by outliers Ondřej Chum

RANSAC

k … number of samples drawn

N … number of data pointsI … time to compute a

single modelp … confidence in the solution (.95)

log (1- )

log(1 – p)

IN

I-1N-1

k =

Page 15: RANSAC Robust model estimation from data contaminated by outliers Ondřej Chum

RANSAC [Fischler, Bolles ’81]In: U = {xi} set of data points, |U| = N

function f computes model parameters p given a sample S from U

the cost function for a single data point x

Out: p* p*, parameters of the model maximizing the cost function

k := 0

Repeat until P{better solution exists} < (a function of C* and no. of steps k)

k := k + 1

I. Hypothesis

(1) select randomly set , sample size

(2) compute parameters

II. Verification

(3) compute cost

(4) if C* < Ck then C* := Ck, p* := pk

end

Page 16: RANSAC Robust model estimation from data contaminated by outliers Ondřej Chum

PROSAC – PROgressive SAmple Consensus

• Not all correspondences are created equally

• Some are better than others

• Sample from the best candidates first

1 2 3 4 5 … N-2 N-1 N

Sample from here

Page 17: RANSAC Robust model estimation from data contaminated by outliers Ondřej Chum

PROSAC Samples

l-1 l l+1 l+2 ……

Draw Tl samples from (1 … l) Draw Tl+1 samples from (1 … l+1)

Samples from (1 … l) that are not from (1 … l+1) contain l+1

Draw Tl+1 - Tl samples of size m-1 and add l+1