Lecture 8
Lecture 8
Local Descriptors
[Source: K. Grauman]
Sanja Fidler CSC420: Intro to Image Understanding 2 / 57
The Ideal Feature Descriptor
[Source: T. Tuytelaars]
[Source: T. Tuytelaars]
SIFT
PCA-SIFT
GLOH
HOG
SURF
DAISY
LBP
Shape Contexts
Color Histograms
SIFT TODAY
PCA-SIFT
GLOH
HOG
SURF
DAISY
LBP
Shape Contexts
Color Histograms
[AdoptedSanja
from:
Fidler F. Flores-Mangas]
CSC420: Intro to Image Understanding 10 / 57
SIFT Descriptor
4 Compute dominant orientation
[Source: S. Seitz]
Sanja Fidler CSC420: Intro to Image Understanding 15 / 57
Example
[Source: N. Snavely]
The dimensionality of SIFT is pretty high, i.e., 128D for each keypoint
Reduce the dimensionality using linear dimensionality reduction
In this case, principal component analysis (PCA)
Use 10D or so descriptor
[Source: R. Urtasun]
[Source: R. Szeliski]
Sanja Fidler CSC420: Intro to Image Understanding 18 / 57
Other Descriptors
SURF
DAISY
LBP
HOG
Shape Contexts
Color Histograms
[Source: K. Grauman]
Sanja Fidler CSC420: Intro to Image Understanding 20 / 57
Image Features:
[Source: K. Grauman]
Sanja Fidler CSC420: Intro to Image Understanding 25 / 57
Applications of Local Invariant Features
[Source: K. Grauman]
Sanja Fidler CSC420: Intro to Image Understanding 26 / 57
Wide Baseline Stereo
[Source: T. Tuytelaars]
[Source: K. Grauman]
Sanja Fidler CSC420: Intro to Image Understanding 28 / 57
Motion Tracking
template
template
template
[Source: N. Snavely]
[Source: N. Snavely]
Sanja Fidler CSC420: Intro to Image Understanding 36 / 57
All 2D Linear Transformations
Properties of linear transformations:
Origin maps to origin
Lines map to lines
Parallel lines remain parallel
Ratios are preserved
Closed under composition
0
x a b e f i j x
=
y0 c d g h k l y
[Source: N. Snavely]
Sanja Fidler CSC420: Intro to Image Understanding 36 / 57
Affine Transformations
Affine transformations are combinations of
Linear transformations, and
Translations 0
x a b x e
= +
y0 c d y f
same as:
0 x
x a b e
= y
y0 c d f
1
[Source: N. Snavely]
Sanja Fidler CSC420: Intro to Image Understanding 41 / 57
Computing the (Affine) Transformation
Given a set of matches between images I and J
How can we compute the affine transformation A from I to J?
Find transform A that best agrees with the matches
[Source: N. Snavely]
Sanja Fidler CSC420: Intro to Image Understanding 41 / 57
Computing the Affine Transformation
Let (xi , yi ) be a point on the reference (model) image, and (xi0 , yi0 ) its match
in the test image
An affine transformation A maps (xi , yi ) to (xi0 , yi0 ):
0 xi
xi a b e
= yi
yi0 c d f
1
We can rewrite this into a simple linear system:
a
b 0
xi yi 0 0 1 0 c = xi0
0 0 xi yi 0 1 d
yi
e
f
Sanja Fidler CSC420: Intro to Image Understanding 42 / 57
Computing the Affine Transformation
Let (xi , yi ) be a point on the reference (model) image, and (xi0 , yi0 ) its match
in the test image
An affine transformation A maps (xi , yi ) to (xi0 , yi0 ):
0 xi
xi a b e
= yi
yi0 c d f
1
We can rewrite this into a simple linear system:
a
b 0
xi yi 0 0 1 0 c = xi0
0 0 xi yi 0 1 d
yi
e
f
Sanja Fidler CSC420: Intro to Image Understanding 42 / 57
Computing the Affine Transformation
But we have many matches:
..
a
..
. b .
xi0
xi yi 0 0 1 0
c
=
yi0
0 0 xi yi 0 1 d
.. ..
e
. .
| {z } f | {z }
P P0
| {z }
a
[Source: N. Snavely]
[Source: N. Snavely]
!"#$%&'()
%*$%&'()
[Source: N. Snavely]
!"#$%&'()*+,)-)%+.&),#),/&0&)1-,-2#+.,0) 3&-0,)045-"&0)6,)
[Source: N. Snavely]
!"#$%&'()*+,)-)%+.&),#),/&0&)1-,-2#+.,0) 3&-0,)045-"&0)6,)
[Source: N. Snavely]
Take the minimal number of points to compute what we want. In the line
example, two points (in our affine example, three matches)
Take the minimal number of points to compute what we want. In the line
example, two points (in our affine example, three matches)
Take the minimal number of points to compute what we want. In the line
example, two points (in our affine example, three matches)
Count the number of all points that “agree” with the line: We call the
agreeing points inliers
Take the minimal number of points to compute what we want. In the line
example, two points (in our affine example, three matches)
Count the number of all points that “agree” with the line: We call the
agreeing points inliers
Take the minimal number of points to compute what we want. In the line
example, two points (in our affine example, three matches)
Count the number of all points that “agree” with the line: We call the
agreeing points inliers
Repeat this many times, remember the number of inliers for each trial
Among several trials, select the one with the largest number of inliers
Take the minimal number of points to compute what we want. In the line
example, two points (in our affine example, three matches)
Count the number of all points that “agree” with the line: We call the
agreeing points inliers
Repeat this many times, remember the number of inliers for each trial
Among several trials, select the one with the largest number of inliers
[Source: R. Raguram]
[Source: R. Raguram]
[Source: R. Raguram]
[Source: R. Raguram]
[Source: R. Raguram]
[Source: R. Raguram]
[Source: R. Raguram]
[Source: N. Snavely]
Sanja Fidler CSC420: Intro to Image Understanding 50 / 57
RAndom SAmple Consensus
!"#"$%&!"#&'(%$)&(%&*(+,-'.&$-/+%&$"%$#&'&
[Source: N. Snavely]
Sanja Fidler CSC420: Intro to Image Understanding 51 / 57
RAndom SAmple Consensus
!"#"$%&'()%*"+&,'%$*&'%&+'(-),.&$)/(%&!"#!$%&&
[Source: N. Snavely]
Sanja Fidler CSC420: Intro to Image Understanding 51 / 57
RAndom SAmple Consensus
!"#$"#%#&'%#()*+,)-.*%/0#&%#&'%&01&'+#%*"23'(%.4%0*,0'(+%
[Source: N. Snavely]
Sanja Fidler CSC420: Intro to Image Understanding 51 / 57
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
[Source: N. Snavely]
[Source: N. Snavely]
[Source: R. Urtasun]
[Source: R. Urtasun]
1 − P = (1 − p k )S
1 − P = (1 − p k )S
1 − P = (1 − p k )S
The number of trials grows quickly with the number of sample points used.
1 − P = (1 − p k )S
The number of trials grows quickly with the number of sample points used.
[Source: R. Urtasun]
Sanja Fidler CSC420: Intro to Image Understanding 54 / 57
How many rounds?
Sufficient number of trials S must be tried.
Let p be the probability that any given correspondence is valid and P be the
total probability of success after S trials.
The likelihood in one trial that all k random samples are inliers is p k
The likelihood that S such trials will all fail is
1 − P = (1 − p k )S
The number of trials grows quickly with the number of sample points used.
[Source: R. Urtasun]
Sanja Fidler CSC420: Intro to Image Understanding 54 / 57
RANSAC pros and cons
Pros
Simple and general
Applicable to many different problems