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) xxii Hx i 0 h 1T x T i T xi xi, yi, wi Hx i h 2 x i 3T yh 3T x wh 2 T x h x i i i i T i 1 3T x i Hx i wih x i xih x i 2T 1T xih x i yih x i 0T T wi x i yix iT T wi x i T 0 xix iT T 1 yi x i h 2 T xix 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 wix TiT 0 T wTix i 0T wwixxi T 0 T T i i yix i xix i 1 2 1 T h yi x Ti yix i T 2 xix Ti h 0 xiTx 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 li 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 wix d alg xi , Hx i ei T T w x 0 i i algebraic distance T 2 2 T i yix h xix 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 xi , Hx i H i Symmetric transfer error Ĥ argmin H d x i , H xi d xi , 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 xi ,Hx i / 2 2 Pr x | H e i i log Pr xi | H 2 πσ 1 2 d xi , Hx i constant 2 2 2σ Maximum Likelihood Estimate: maximizes log likelihood or minimizes d xi , 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 Prxi | H i 1 2πσ 2 e d x i , x i 2 d xi ,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