Fitting
Shared by: leHQBY
-
Stats
- views:
- 16
- posted:
- 11/26/2011
- language:
- English
- pages:
- 54
Document Sample


Computer
Vision
Fitting
Marc Pollefeys
COMP 256
Some slides and illustrations from D. Forsyth, T. Darrel,
A. Zisserman, ...
Computer Tentative class schedule
Vision
Aug 26/28 - Introduction
Sep 2/4 Cameras Radiometry
Sep 9/11 Sources & Shadows Color
Sep 16/18 Linear filters & edges (hurricane Isabel)
Sep 23/25 Pyramids & Texture Multi-View Geometry
Sep30/Oct2 Stereo Project proposals
Oct 7/9 Tracking (Welch) Optical flow
Oct 14/16 - -
Oct 21/23 Silhouettes/carving (Fall break)
Oct 28/30 - Structure from motion
Nov 4/6 Project update Proj. SfM
Nov 11/13 Camera calibration Segmentation
Nov 18/20 Fitting Prob. segm.&fit.
Nov 25/27 Matching templates (Thanksgiving)
Dec 2/4 Matching relations Range data
Dec 8 or 9? Final project
Computer
Vision Final project presentation
• Presentation and/or Demo
(your choice, but let me know)
• Short paper (Due Dec.5)
• Final presentation/demo
Monday 8, 2-5pm?
Computer
Vision Last week: Segmentation
• Group tokens into clusters that fit together
– foreground-background
– cluster on intensity, color, texture, location, …
• K-means
• graph-based
Computer
Vision Fitting
• Choose a parametric • Three main
object/some objects questions:
to represent a set of – what object
tokens represents this set
• Most interesting case of tokens best?
is when criterion is – which of several
not local objects gets which
token?
– can’t tell whether a
set of points lies on – how many objects
a line by looking are there?
only at each point
and the next. (you could read line
for object here, or
circle, or ellipse
or...)
Computer
Vision
Fitting and the Hough
Transform
• Purports to answer all • Different choices of q,
three questions d>0 give different lines
– in practice, answer • For any (x, y) there is a
isn’t usually all that one parameter family of
much help lines through this point,
• We do for lines only given by
• A line is the set of
points (x, y) such that sin q x cosq y d 0
sin q x cosq y d 0 • Each point gets to vote
for each line in the
family; if there is a line
that has lots of votes,
that should be the line
passing through the
points
Computer
Vision
tokens
votes
Computer
Vision
Mechanics of the Hough
transform
• Construct an array • How many lines?
representing q, d – count the peaks in the
• For each point, render Hough array
the curve (q, d) into • Who belongs to which
this array, adding one line?
at each cell – tag the votes
• Difficulties
– how big should the • Hardly ever satisfactory
cells be? (too big, and in practice, because
we cannot distinguish problems with noise
between quite different and cell size defeat it
lines; too small, and
noise causes lines to
be missed)
Computer
Vision
tokens votes
Computer
Vision
Computer
Vision
Computer
Vision
Computer Cascaded hough transform
Vision
Tuytelaars and Van Gool ICCV‘98
Computer
Vision
Line fitting can be max.
likelihood - but choice of
model is important
Computer
Vision Who came from which line?
• Assume we know how many lines there
are - but which lines are they?
– easy, if we know who came from which
line
• Three strategies
– Incremental line fitting
– K-means
– Probabilistic (later!)
Computer
Vision
Computer
Vision
Computer
Vision
Computer
Vision
Computer
Vision
Computer
Vision
Computer
Vision
Computer
Vision
Computer
Vision
Computer
Vision
Computer
Vision
Computer
Vision
Computer
Vision
Computer
Vision
Computer
Vision Robustness
• As we have seen, squared error can be a
source of bias in the presence of noise
points
– One fix is EM - we’ll do this shortly
– Another is an M-estimator
• Square nearby, threshold far away
– A third is RANSAC
• Search for good points
Computer
Vision
Computer
Vision
Computer
Vision
Computer
Vision
Computer
Vision M-estimators
• Generally, minimize
r x ,q ;
i
i i
where ri xi , q is the residual
Computer
Vision
Computer
Vision
Computer
Vision
Computer
Vision Too small
Computer
Vision Too large
Computer
Vision
Computer
Vision RANSAC
• Choose a small • Issues
subset uniformly at – How many times?
random • Often enough that we
• Fit to that are likely to have a
good line
• Anything that is close – How big a subset?
to result is signal; all • Smallest possible
others are noise
– What does close mean?
• Refit • Depends on the
• Do this many times problem
and choose the best – What is a good line?
• One where the number
of nearby points is so
big it is unlikely to be
all outliers
Computer
Vision
Computer
Vision Distance threshold
Choose t so probability for inlier is α (e.g. 0.95)
• Often empirically
2
• Zero-mean Gaussian noise σ then d follows
m distribution with m=codimension of model
2
(dimension+codimension=dimension space)
Codimension Model t 2
1 line,F 3.84σ2
2 H,P 5.99σ2
3 T 7.81σ2
Computer
Vision How many samples?
Choose N so that, with probability p, at least one
random sample is free from outliers. e.g. p=0.99
1 1 e
s N
1 p
N log 1 p / log 1 1 e
s
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
Computer
Vision Acceptable consensus set?
• Typically, terminate when inlier ratio reaches
expected ratio of inliers
T 1 e n
Computer
Vision
Adaptively determining
the number of samples
e is often unknown a priori, so pick worst case, e.g.
50%, and adapt if more inliers are found, e.g. 80%
would yield e=0.2
– N=∞, sample_count =0
– While N >sample_count repeat
• Choose a sample and count the number of inliers
• Set e=1-(number of inliers)/(total number of points)
• Recompute N from e
• Increment the sample_count by 1
– Terminate
N log 1 p / log 1 1 e
s
Computer
Vision RANSAC for Fundamental Matrix
Step 1. Extract features
Step 2. Compute a set of potential matches
Step 3. do
Step 3.1 select minimal sample (i.e. 7 matches) (generate
Step 3.2 compute solution(s) for F hypothesis)
Step 3.3 determine inliers (verify hypothesis)
until (#inliers,#samples)<95%
Step 4. Compute F based on all inliers
Step 5. Look for additional matches
Step 6. Refine F based on all correct matches
1 (1
# inliers 7 # samples
# matches
)
#inliers 90% 80% 70% 60% 50%
#samples 5 13 35 106 382
Computer
Vision Randomized RANSAC for Fundamental Matrix
Step 1. Extract features
Step 2. Compute a set of potential matches
Step 3. do
Step 3.1 select minimal sample (i.e. 7 matches) (generate
Step 3.2 compute solution(s) for F hypothesis)
Step 3.3 Randomize verification
3.3.1 verify if inlier (verify hypothesis)
while hypothesis is still promising
while (#inliers,#samples)<95%
Step 4. Compute F based on all inliers
Step 5. Look for additional matches
Step 6. Refine F based on all correct matches
Computer
Vision Example: robust computation
from H&Z
Interest points
(500/image)
(640x480)
#in 1-e adapt. N
6 2% 20M
10 3% 2.5M
44 16% 6,922
Putative
58 21% 2,291
correspondences (268)
73 26% 911
151 56% 43
(Best match,SSD<20,±320)
Outliers (117)
(t=1.25 pixel; 43 iterations)
Inliers (151)
Final inliers (262)
(2 MLE-inlier cycles;
d=0.23→d=0.19;
IterLev-Mar=10)
Computer
Vision More on robust estimation
• LMedS, an alternative to RANSAC
(minimize Median residual in stead of
maximizing inlier count)
• Enhancements to RANSAC
– Randomized RANSAC
– Sample ‘good’ matches more frequently
–…
• RANSAC is also somewhat robust to bugs,
sometimes it just takes a bit longer…
Computer
Vision Epipolar geometry from silhouettes
(Sinha et al. CVPR 2004?
paper due tomorrow…)
RANSAC is used to combine exploration of random
epipole locations and robustness to outliers
more on Dec. 8 …
Computer
Vision Fitting curves other than lines
• In principle, an easy • In practice, rather
generalisation hard
– The probability of – It is generally
obtaining a point, difficult to compute
given a curve, is the distance
given by a negative between a point and
exponential of a curve
distance squared
Computer
Vision
Next class:
Segmentation and Fitting using
Probabilistic Methods
Missing data: EM algorithm
Model selection
Reading: Chapter 16
Get documents about "