0% found this document useful (0 votes)
50 views28 pages

10.1 2D Alignment LLS

This document discusses using linear least squares to estimate the parameters of a transformation between two images based on feature correspondences. It explains that the transformation parameters can be estimated by minimizing the sum of squared distances between the transformed points in one image and the corresponding points in the other image. Only two correspondences are needed to estimate translation, three for Euclidean, and six for affine or projective transformations. The normal equations derived from taking the derivative of the least squares error function are solved to find the optimal transformation parameters.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views28 pages

10.1 2D Alignment LLS

This document discusses using linear least squares to estimate the parameters of a transformation between two images based on feature correspondences. It explains that the transformation parameters can be estimated by minimizing the sum of squared distances between the transformed points in one image and the corresponding points in the other image. Only two correspondences are needed to estimate translation, three for Euclidean, and six for affine or projective transformations. The normal equations derived from taking the derivative of the least squares error function are solved to find the optimal transformation parameters.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

2D Alignment: Linear Least Squares

16-385 Computer Vision (Kris Kitani)


Carnegie Mellon University
Extract features from an image …

what do we do next?
Feature matching
(object recognition, 3D reconstruction, augmented reality, image stitching)

How do we estimate the transformation?


Given a set of matched feature points
0
{xi , xi }
point in point in the
one image other image

and a transformation
0
x = f (x; p)
transformation parameters
function

Find the best estimate of

p
Model fitting
Recover the transformation

f(x,y) g(x,y)

Given f and g, how would you recover the transform T?


(user will provide correspondences)
How many do we need?
Translation

f(x,y) g(x,y)

• How many Degrees of Freedom?


• How many correspondences needed?
• What is the transformation matrix?
Euclidean

f(x,y) g(x,y)
• How many Degrees of Freedom?
• How many correspondences needed for translation+rotation?
• What is the transformation matrix?
Affine

f(x,y) g(x,y)
• How many Degrees of Freedom?
• How many correspondences needed for affine?
• What is the transformation matrix?
Projective

f(x,y) g(x,y)
• How many Degrees of Freedom?
• How many correspondences needed for projective?
• What is the transformation matrix?
Suppose we have two triangles: ABC and DEF.

What transformation will map A to D, B to E, and C to F?

How can we get the parameters?

B E

D
C

F
A
Estimate transformation parameters using

Linear least squares


Given a set of matched feature points
0
{xi , xi }
point in point in the
one image other image

and a transformation
0
x = f (x; p)
transformation parameters
function

Find the best estimate of

p
0
x2
x2
0 0
x1 x3
x1 x3

Given point correspondences


0
x2
)
f (x i ; p
x2
0 0
x1 x3
x1 x3

Given point correspondences

How can you solve for the transformation?


0
x2
)
f (x i ; p
x2
0 0
x1 x3
x1 x3

Least Squares Error


X
0 2
ELS = kf (xi ; p) xi k
i
0
x2
)
f (x i ; p
x2
0 0
x1 x3
x1 x3

Least Squares Error


X
0 2
ELS = kf (xi ; p) xi k
i

What is this? What is this?


0
x2
)
f (x i ; p
x2
0 0
x1 x3
x1 x3

Least Squares Error What is


this?

X
0 2
ELS = kf (xi ; p) xi k
i

What is this? What is this?


0
x2
)
f (x i ; p
x2
0 0
x1 x3
x1 x3
q
||x|| = x21 + x22 + · · · + x2n

Least Squares Error Euclidean


(L2) norm

X
0 2
kf (xi ; p) xi k
squared!
ELS =
i
predicted measured
location location
0
x2
)
f (x i ; p
x2
0 0
x1 x3
x1 x3

Least Squares Error


X
0 2
ELS = kf (xi ; p) xi k
i Residual
(projection error)
0
x2
)
f (x i ; p
x2
0 0
x1 x3
x1 x3

Least Squares Error


X
0 2
ELS = kf (xi ; p) xi k
i
What is the free variable?
What do we want to optimize?
0
x2
)
f (x i ; p
x2
0 0
x1 x3
x1 x3

Find parameters that minimize squared error


X
0 2
p̂ = arg min kf (xi ; p) xi k
p i
General form of linear least squares
(Warning: change of notation. x is a vector of parameters!)
X
2
ELLS = |ai x bi |
i
2
= kAx bk (matrix form)

This function is quadratic.


How do you find the root of a quadratic?
General form of linear least squares
(Warning: change of notation. x is a vector of parameters!)
X
2
ELLS = |ai x bi |
i
2
= kAx bk (matrix form)

Minimize the error:


Expand
> > > > 2
ELLS = x (A A)x 2x (A b) + kbk
Take derivative, > >
set to zero (A A)x = A b (normal equation)

> 1 >
Solve for x x = (A A) A b
For the Affine transformation x0 = f (x; p)
2 3
 0
 x
0 x p1 p2 p3 4 y 5
x = Mx 0 =
y p4 p5 p6
1
Vectorize transformation parameters
  2 3
x0 x y 1 0 0 0 p1
0 = 6 7
y
 0  0 0 0 x y 1 6 p2 7
x x y 1 0 0 0 6 p3 7
6 7
y0 0 0 0 x y 1 6 p4 7
6 7
.. .. 4 p5 5
. . p6
 0 
x x y 1 0 0 0
y0 0 0 0 x y 1

Notation in
general form b A x
Linear

least squares

estimation

only works

when the

transform function

is

?
Linear

least squares

estimation

only works

when the

transform function

is

linear!
Also

doesn’t

deal well

with

outliers

You might also like