Professional Documents
Culture Documents
Lecture 06
Lecture 06
Raquel Urtasun
TTI Chicago
Computer Vision
1 / 44
Readings
Computer Vision
2 / 44
Computer Vision
3 / 44
!"
[Source: N. Snavely]
Computer Vision
4 / 44
Computer Vision
4 / 44
Image Warping
Image filtering: change range of image
g (x) = h(f (x))
!"
%"
$"
#"
#"
%"
$"
#"
#"
[Source: R. Szeliski]
Raquel Urtasun (TTI-C)
Computer Vision
5 / 44
!"
!!"!#$%&'!
!"!"!#$(%&('!
Computer Vision
6 / 44
Inverse Warping: Each pixel at the destination is sampled from the original
image
Computer Vision
7 / 44
b
d
x
y
[Source: N. Snavely]
Computer Vision
8 / 44
Computer Vision
9 / 44
Computer Vision
9 / 44
Computer Vision
9 / 44
b
d
e
g
f
h
Computer Vision
i
k
j
l
x
y
9 / 44
b
d
e
g
f
h
i
k
j
l
x
y
Computer Vision
9 / 44
b
d
e
g
f
h
i
k
j
l
x
y
Computer Vision
9 / 44
Affine Transformations
Affine transformations are combinations of
Linear transformations, and
Translations
0
a
x
y 0 = d
w
0
b
e
0
c
x
f y
1
w
Computer Vision
10 / 44
Projective Transformations
Affine transformations and Projective
0
a
x
y 0 = d
w0
g
warps
b
e
h
c
x
f y
i
w
Computer Vision
11 / 44
2D Image Tranformations
Computer Vision
12 / 44
Computing transformations
Given a set of matches between images A and B
How can we compute the transform T from A to B?
Find transform T that best agrees with the matches
[Source: N. Snavely]
Raquel Urtasun (TTI-C)
Computer Vision
13 / 44
=
=
xi0
yi0
Computer Vision
14 / 44
=
=
xi0
yi0
n
X
i=1
Computer Vision
14 / 44
=
=
xi0
yi0
n
X
i=1
Computer Vision
14 / 44
=
=
xi0
yi0
n
X
i=1
Computer Vision
14 / 44
=
=
xi0
yi0
n
X
i=1
Computer Vision
14 / 44
=
=
xi0
yi0
n
X
i=1
Computer Vision
14 / 44
Matrix Formulation
We can also write as a matrix equation
!!""#!#
!""#$#
!!""#$#
Computer Vision
15 / 44
Affine Transformations
Computer Vision
16 / 44
Affine Transformations
Computer Vision
16 / 44
Affine Transformations
Computer Vision
16 / 44
Affine Transformations
Computer Vision
16 / 44
Affine Transformations
Computer Vision
16 / 44
Cost function
C (a, b, c, d, e, f ) =
N
X
i=1
Computer Vision
17 / 44
Cost function
C (a, b, c, d, e, f ) =
N
X
i=1
Computer Vision
17 / 44
Cost function
C (a, b, c, d, e, f ) =
N
X
i=1
Computer Vision
17 / 44
Matrix form
$""#%#
!!""#$#
!!""#%#
[Source: N. Snavely]
Raquel Urtasun (TTI-C)
Computer Vision
18 / 44
General Formulation
Computer Vision
19 / 44
General Formulation
Computer Vision
19 / 44
General Formulation
Computer Vision
20 / 44
General Formulation
X
X
X
p [
JT (xi )J(xi )]p 2pT [
JT (xi )xi )] +
||xi ||2
T
Computer Vision
21 / 44
General Formulation
X
X
X
p [
JT (xi )J(xi )]p 2pT [
JT (xi )xi )] +
||xi ||2
pT Ap 2pT b + c
Computer Vision
21 / 44
General Formulation
X
X
X
p [
JT (xi )J(xi )]p 2pT [
JT (xi )xi )] +
||xi ||2
pT Ap 2pT b + c
Computer Vision
JT (xi )xi
21 / 44
General Formulation
X
X
X
p [
JT (xi )J(xi )]p 2pT [
JT (xi )xi )] +
||xi ||2
pT Ap 2pT b + c
Computer Vision
JT (xi )xi
21 / 44
Uncertainty Weighting
The above solution assumes that all feature points are matched with same
accuracy.
If we associate a scalar variance i2 with each correspondence, we can
minimize the weighted least squares problem
X
i2 ||ri ||22
EWLS =
i
Computer Vision
22 / 44
Uncertainty Weighting
The above solution assumes that all feature points are matched with same
accuracy.
If we associate a scalar variance i2 with each correspondence, we can
minimize the weighted least squares problem
X
i2 ||ri ||22
EWLS =
i
Computer Vision
22 / 44
Uncertainty Weighting
The above solution assumes that all feature points are matched with same
accuracy.
If we associate a scalar variance i2 with each correspondence, we can
minimize the weighted least squares problem
X
i2 ||ri ||22
EWLS =
i
Computer Vision
22 / 44
Uncertainty Weighting
The above solution assumes that all feature points are matched with same
accuracy.
If we associate a scalar variance i2 with each correspondence, we can
minimize the weighted least squares problem
X
i2 ||ri ||22
EWLS =
i
Computer Vision
22 / 44
Uncertainty Weighting
The above solution assumes that all feature points are matched with same
accuracy.
If we associate a scalar variance i2 with each correspondence, we can
minimize the weighted least squares problem
X
i2 ||ri ||22
EWLS =
i
Computer Vision
22 / 44
Homographies
!#"
!"
Computer Vision
23 / 44
Homographies
!#"
!"
Computer Vision
23 / 44
Homographies
!#"
!"
Computer Vision
23 / 44
Homographies
!#"
!"
Computer Vision
23 / 44
Homographies
!#"
!"
Computer Vision
23 / 44
Homographies
!#"
!"
Computer Vision
23 / 44
h01
h11
h21
h02
xi
h12 yi
h22
1
xi0
yi0
h00 xi
h20 xi
h10 xi
h20 xi
+ h01 yi
+ h21 yi
+ h11 yi
+ h21 yi
Computer Vision
+ h02
+ h22
+ h12
+ h22
24 / 44
h01
h11
h21
h02
xi
h12 yi
h22
1
yi0
h00 xi
h20 xi
h10 xi
h20 xi
+ h01 yi
+ h21 yi
+ h11 yi
+ h21 yi
+ h02
+ h22
+ h12
+ h22
Computer Vision
24 / 44
h02
xi
h12 yi
h22
1
h01
h11
h21
yi0
h00 xi
h20 xi
h10 xi
h20 xi
+ h01 yi
+ h21 yi
+ h11 yi
+ h21 yi
+ h02
+ h22
+ h12
+ h22
yi0
Computer Vision
24 / 44
h02
xi
h12 yi
h22
1
h01
h11
h21
yi0
h00 xi
h20 xi
h10 xi
h20 xi
+ h01 yi
+ h21 yi
+ h11 yi
+ h21 yi
+ h02
+ h22
+ h12
+ h22
yi0
Computer Vision
24 / 44
yi0
Computer Vision
25 / 44
!"#$#%#
%#
!"#
Computer Vision
26 / 44
!"#$#%#
%#
!"#
Computer Vision
26 / 44
!"#$#%#
%#
!"#
Computer Vision
26 / 44
!"#$#%#
%#
!"#
Computer Vision
26 / 44
!"#$#%#
%#
!"#
Computer Vision
26 / 44
[Source: N. Snavely]
Computer Vision
27 / 44
[Source: N. Snavely]
Computer Vision
27 / 44
Robustness
!"#$%&'()
%*$%&'()
[Source: N. Snavely]
Raquel Urtasun (TTI-C)
Computer Vision
28 / 44
Simple case
Lets consider a simpler example ... linear regression
!"#$%&'()*+,)-)%+.&),#),/&0&)1-,-2#+.,0)
3&-0,)045-"&0)6,)
Computer Vision
29 / 44
Simple case
Lets consider a simpler example ... linear regression
!"#$%&'()*+,)-)%+.&),#),/&0&)1-,-2#+.,0)
3&-0,)045-"&0)6,)
Computer Vision
29 / 44
Simple case
Lets consider a simpler example ... linear regression
!"#$%&'()*+,)-)%+.&),#),/&0&)1-,-2#+.,0)
3&-0,)045-"&0)6,)
Computer Vision
29 / 44
Computer Vision
30 / 44
Computer Vision
30 / 44
Computer Vision
30 / 44
Computer Vision
30 / 44
Computer Vision
30 / 44
We want to minimize
EIRLS =
Computer Vision
31 / 44
We want to minimize
EIRLS =
When the number of outliers is very high, IRLS does not work well (will not
converge to the global optima)
Computer Vision
31 / 44
We want to minimize
EIRLS =
When the number of outliers is very high, IRLS does not work well (will not
converge to the global optima)
Computer Vision
31 / 44
Simple Idea
Given a hypothesized line, count the number of points that agree with the
line
Agree = within a small distance of the line i.e., the inliers to that line
Computer Vision
32 / 44
Simple Idea
Given a hypothesized line, count the number of points that agree with the
line
Agree = within a small distance of the line i.e., the inliers to that line
For all possible lines, select the one with the largest number of inliers
[Source: N. Snavely]
Computer Vision
32 / 44
Simple Idea
Given a hypothesized line, count the number of points that agree with the
line
Agree = within a small distance of the line i.e., the inliers to that line
For all possible lines, select the one with the largest number of inliers
[Source: N. Snavely]
Computer Vision
32 / 44
Counting Inliers
!"#$%&'()*)
[Source: N. Snavely]
Raquel Urtasun (TTI-C)
Computer Vision
33 / 44
Counting Inliers
!"#$%&'()*+)
[Source: N. Snavely]
Raquel Urtasun (TTI-C)
Computer Vision
33 / 44
Counting Inliers
!"#$%&'()*+)
Whats the problem with this approach?
Raquel Urtasun (TTI-C)
Computer Vision
33 / 44
Computer Vision
34 / 44
Computer Vision
34 / 44
Computer Vision
34 / 44
Computer Vision
34 / 44
Translations
[Source: N. Snavely]
Raquel Urtasun (TTI-C)
Computer Vision
35 / 44
!"#"$%&!"#&'(%$)&(%&*(+,-'.&$-/+%&$"%$#&'&
[Source: N. Snavely]
Raquel Urtasun (TTI-C)
Computer Vision
36 / 44
!"#"$%&'()%*"+&,'%$*&'%&+'(-),.&$)/(%&!"#!$%&&
[Source: N. Snavely]
Raquel Urtasun (TTI-C)
Computer Vision
36 / 44
!"#$"#%#&'%#()*+,)-.*%/0#&%#&'%&01&'+#%*"23'(%.4%0*,0'(+%
[Source: N. Snavely]
Raquel Urtasun (TTI-C)
Computer Vision
36 / 44
RANSAC
All the inliers will agree with each other on the translation vector; the
(hopefully small) number of outliers will (hopefully) disagree with each other
RANSAC only has guarantees if there are < 50% outliers
Computer Vision
37 / 44
RANSAC
All the inliers will agree with each other on the translation vector; the
(hopefully small) number of outliers will (hopefully) disagree with each other
RANSAC only has guarantees if there are < 50% outliers
All good matches are alike; every bad match is bad in its own way.
[Tolstoy via Alyosha Efros]
[Source: N. Snavely]
Computer Vision
37 / 44
RANSAC
All the inliers will agree with each other on the translation vector; the
(hopefully small) number of outliers will (hopefully) disagree with each other
RANSAC only has guarantees if there are < 50% outliers
All good matches are alike; every bad match is bad in its own way.
[Tolstoy via Alyosha Efros]
[Source: N. Snavely]
Computer Vision
37 / 44
Hypothesize a model
[Source: R. Raguram]
Raquel Urtasun (TTI-C)
Computer Vision
38 / 44
Hypothesize a model
[Source: R. Raguram]
Raquel Urtasun (TTI-C)
Computer Vision
38 / 44
Hypothesize a model
[Source: R. Raguram]
Raquel Urtasun (TTI-C)
Computer Vision
38 / 44
Hypothesize a model
[Source: R. Raguram]
Raquel Urtasun (TTI-C)
Computer Vision
38 / 44
Hypothesize a model
[Source: R. Raguram]
Raquel Urtasun (TTI-C)
Computer Vision
38 / 44
Hypothesize a model
[Source: R. Raguram]
Computer Vision
38 / 44
Hypothesize a model
[Source: R. Raguram]
Computer Vision
38 / 44
RANSAC
Computer Vision
39 / 44
RANSAC
Computer Vision
39 / 44
RANSAC
Computer Vision
39 / 44
RANSAC
Computer Vision
39 / 44
RANSAC
Computer Vision
39 / 44
Computer Vision
40 / 44
Computer Vision
40 / 44
Computer Vision
40 / 44
log(1 P)
log(1 p k )
Computer Vision
40 / 44
log(1 P)
log(1 p k )
The number of trials grows quickly with the number of sample points used.
Computer Vision
40 / 44
log(1 P)
log(1 p k )
The number of trials grows quickly with the number of sample points used.
Use the minimum number of sample points k possible for any given trial
Raquel Urtasun (TTI-C)
Computer Vision
40 / 44
log(1 P)
log(1 p k )
The number of trials grows quickly with the number of sample points used.
Use the minimum number of sample points k possible for any given trial
Raquel Urtasun (TTI-C)
Computer Vision
40 / 44
Computer Vision
41 / 44
Computer Vision
42 / 44
Computer Vision
42 / 44
Computer Vision
42 / 44
Computer Vision
42 / 44
Computer Vision
42 / 44
Computer Vision
42 / 44
Computer Vision
42 / 44
RANSAC as Voting
Computer Vision
43 / 44
RANSAC as Voting
Computer Vision
43 / 44
RANSAC as Voting
Computer Vision
43 / 44
Computer Vision
44 / 44