Parameter Estimation

advertisement
Parameter estimation
Parameter estimation
• 2D homography
Given a set of (xi,xi’), compute H (xi’=Hxi)
• 3D to 2D camera projection
Given a set of (Xi,xi), compute P (xi=PXi)
• Fundamental matrix
Given a set of (xi,xi’), compute F (xi’TFxi=0)
• Trifocal tensor
Given a set of (xi,xi’,xi”), compute T
Number of measurements required
• At least as many independent equations
as degrees of freedom required
• Example: x'  Hx
 x  h11 h12



λ  y  h21 h22
 1  h31 h32
h13   x 



h23   y 
h33   1 
2 independent equations / point
8 degrees of freedom
4x2≥8
Approximate solutions
• Minimal solution
4 points yield an exact solution for H
• More points
• No exact solution, because
measurements are inexact (“noise”)
• Search for “best” according to some cost
function
• Algebraic or geometric/statistical cost
Gold Standard algorithm
• Cost function that is optimal for
some assumptions
• Computational algorithm that
minimizes it is called “Gold
Standard” algorithm
• Other algorithms can then be
compared to it
Direct Linear Transformation
(DLT)
xxii  Hx i  0
 h 1T x 
 T i
T
xi  xi, yi, wi  Hx i   h 2 x i 
 3T 
 yh 3T x  wh 2 T x   h x i 
i
i
 i T i
1
3T

x i  Hx i  wih x i  xih x i 


2T
1T
 xih x i  yih x i 


 0T

T

 wi x i
 yix iT

T

 wi x i
T
0
xix iT
T
1



yi x i
h 
 2
T
 xix i  h   0

T
3

0  h 
Ai h  0
•
Direct Linear Transformation
(DLT)
Equations are linear in h
Ai h  0
• Only 2 out of 3 are linearly independent
(indeed, 2 eq/pt)
 0 TT
 wix TiT
  0 T  wTix i
0T
 wwixxi T
0 T
T
i
i

 yix i
xix i

 1
 2
1
T



h 
yi x Ti
yix i T  2 
 xix Ti  h   0
 xiTx i  3 
0  h 
 3
xi A
wi Aifi w0i’≠0)
(only
drop
i  ythird
i A i row
• Holds for any homogeneous
representation, e.g. (xi’,yi’,1)
Direct Linear Transformation
(DLT)
• Solving for H
 A1 
A 
 2Ah
h  0
A 3 
 or
 12x9, but rank 8
size A is 8x9
A 4 
Trivial solution is h=09T is not interesting
pick for example the one with
h 1
Direct Linear Transformation
(DLT)
• Over-determined solution
 A1 
A 
 2Ah
h  0
  
No exact solution because
 of inexact measurement
An 

i.e. “noise”
Find approximate solution
- Additional constraint needed to avoid 0, e.g.
- Ah  0 not possible, so minimize Ah
h 1
Singular Value Decomposition
A  UΣ V
T
UΣ
Σ VT X
Homogeneous least-squares
min AX subject to X  1
solution X  Vn
DLT algorithm
Objective
Given n≥4 2D to 2D point correspondences {xi↔xi’},
determine the 2D homography matrix H such that xi’=Hxi
Algorithm
(i) For each correspondence xi ↔xi’ compute Ai. Usually
only two first rows needed.
(ii) Assemble n 2x9 matrices Ai into a single 2nx9 matrix A
(iii) Obtain SVD of A. Solution for h is last column of V
(iv) Determine H from h
Solutions from lines, etc.
2D homographies from 2D lines
li  H T li
Ah  0
Minimum of 4 lines
3D Homographies (15 dof)
Minimum of 5 points or 5 planes
2D affinities (6 dof)
Minimum of 3 points or lines
Conic provides 5 constraints
Mixed configurations?
combination of points and lines ….
Cost functions
• Algebraic distance
• Geometric distance
• Reprojection error
Algebraic distance
DLT minimizes
e  Ah
ei
Ah
residual vector
partial vector for each (xi↔xi’)
algebraic error vector
 0
 wix
d alg xi , Hx i   ei  
T
T


w
x
0
 i i
algebraic distance
T
2
2
T
i
 yix 
h
 xix 
T
i
T
i
2
d alg x1 , x 2   a12  a22 where a  a1 , a2 , a3 T  x1  x 2
2
2



d
x
,
Hx
 alg i i   ei
i
2
 Ah  e
2
2
i
Not geometrically/statistically meaningfull, but given good
normalization it works fine and is very fast (use for initialization)
Geometric distance
x measured coordinates
x̂ estimated coordinates
x true coordinates
d(.,.) Euclidean distance (in image)
Error in one image: assumes points in the first image are measured perfectly
2
e.g. calibration pattern
Ĥ  argmin  d xi , Hx i 
H
i
Symmetric transfer error
Ĥ  argmin
H


 d x i , H xi  d xi , Hx i 
-1
2
2
i
Reprojection error
Ĥ, x̂ , x̂   argmin  d x , x̂   d x , x̂ 
2
i
i
H,x̂ i , x̂ i
i
i
i
2
i
i
subject to x̂i  Ĥx̂ i
Note: we are minimizing over H AND corrected correspondence pair
Reprojection error


d x, H x  d x, Hx 
-1
2
2
d x, x̂   d x, x̂
2
2
Statistical cost function and
Maximum Likelihood Estimation
• Optimal cost function related to noise model; assume in the
absence of noise , perfect match
• Assume zero-mean isotropic Gaussian noise (assume
outliers removed); x = measurement;
1
 d  x, x 2 / 2 2 
Pr x  
e
2
2 πσ
Error in one image: assume errors at each point independent
2
1
 d xi ,Hx i  / 2 2 
Pr x  | H   
e
i
i
log Pr xi | H   
2 πσ
1
2
 d xi , Hx i   constant
2
2
2σ
Maximum Likelihood Estimate: maximizes log likelihood or minimizes
 d xi , Hx i 
2
Statistical cost function and
Maximum Likelihood Estimation
• Optimal cost function related to noise model
• Assume zero-mean isotropic Gaussian noise
(assume outliers removed)
Pr x  
1
2 πσ
2
e

 d  x, x 2 / 2 2

Error in both images
Prxi | H   
i
1
2πσ
2
e
 d x i , x i 2  d

xi ,Hx i 2  / 2 2 
Maximum Likelihood Estimate minimizes:
2
2






d
x
,
x̂

d
x
,
x̂
 i i
i
i
Over both H and corrected correspondence 
identical to minimizing reprojection error
Download