fundamental matrix structure from motion
play

Fundamental Matrix & Structure from Motion Instructor - Simon - PowerPoint PPT Presentation

Fundamental Matrix & Structure from Motion Instructor - Simon Lucey 16-423 - Designing Computer Vision Apps Today Transformations between images Structure from Motion The Essential Matrix The Fundamental Matrix


  1. Fundamental Matrix & Structure from Motion Instructor - Simon Lucey 16-423 - Designing Computer Vision Apps

  2. Today • Transformations between images • Structure from Motion • The Essential Matrix • The Fundamental Matrix

  3. Transformations between images • So far we have considered transformations between the image and a plane in the world • Now consider two cameras viewing the same plane • There is a homography between camera 1 and the plane and a second homography between camera 2 and the plane • It follows that the relation between the two images is also a homography

  4. Camera under pure rotation Special case is camera under pure rotation. Homography can be showed to be

  5. Camera under pure rotation Special case is camera under pure rotation. Homography can be showed to be Why is this?

  6. Panorama Example a) b) c) d)

  7. Review - Homography • Start with basic projection equation: • Combining these two matrices we get: Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

  8. Review - Homography Homogeneous: Cartesian: For short:

  9. Review - Homography Homogeneous: Cartesian: For short: How many unknowns?

  10. Homography Estimation • Re-arrange cartesian equations, • Form linear system   φ 11   0 0 0 − 1 − u 1 − v 1 y 1 u 1 y 1 v 1 y 1 φ 12   1 0 0 0 u 1 v 1 − x 1 u 1 − x 1 v 1 − x 1   φ 13       0 0 0 − 1 − u 2 − v 2 y 2 u 2 y 2 v 2 y 2   φ 21       1 0 0 0 u 2 v 2 − x 2 u 2 − x 2 v 2 − x 2   = 0 , φ 22     . . . . . . . . .     . . . . . . . . . φ 23   . . . . . . . . .       φ 31   0 0 0 − 1 − u I − v I y I u I y I v I y I       φ 32 1 0 0 0 u I v I − x I u I − x I v I − x I   φ 33 Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

  11. Homography Estimation • In MATLAB this becomes, >> [U,S,V] = svd(A); >> Phi = reshape(V(:,end),[3,3])’; • Both sides are 3x1 vectors; should be parallel, so cross product will be zero • For you to try MATLAB, >> x = [randn(2,1);1]; cross(x,4*x)

  12. Caution… • Approach only minimizes algebraic error NOT the re- projection error!!! • Need to employ non-linear optimization.

  13. Estimating Extrinsics

  14. Estimating Extrinsics • Writing out the camera equations in full • Estimate the homography from matched points • Factor out the intrinsic parameters Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

  15. Estimating Extrinsics • Find the last column using the cross product of first two columns • Make sure the determinant is 1. If it is -1, then multiply last column by -1. • Find translation scaling factor between old and new values • Finally, set Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

  16. Augmented Reality

  17. Today • Transformations between images • Structure from Motion • The Essential Matrix • The Fundamental Matrix

  18. Taken from Agarwal et al. “Building Rome in a Day”, ICCV 2009.

  19. Taken from Agarwal et al. “Building Rome in a Day”, ICCV 2009.

  20. Structure from Motion For simplicity, we’ll start with simpler problem • Just J=2 images • Known intrinsic matrix Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

  21. Epipolar lines Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

  22. Epipole Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

  23. Special configurations Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

  24. Today • Transformations between images • Structure from Motion • The Essential Matrix • The Fundamental Matrix

  25. Review - Cross Product • Cross product between two 3D vectors is defined as, on c = a ⇥ b • Operation is equivalent to the, 2 3 2 3 2 3 0 � a 3 c 1 a 2 b 1 5 = 0 � a 1 c 2 a 3 b 2 4 4 5 4 5 0 � a 2 c 3 a 1 b 3 • Can be written in short as, c = [ a ] × b

  26. Review - Cross Product • In other words, a T ( a ⇥ b ) = b T ( a ⇥ b ) = 0 .

  27. Right-hand rule • Given three orthonormal 3D vectors ( x , y , z ) • Then, z = x × y

  28. The Essential Matrix First camera: Second camera: Substituting: This is a mathematical relationship between the points in the two images, but it’s not in the most convenient form. Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

  29. The Essential Matrix Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

  30. The Essential Matrix The cross product term can be expressed as a matrix Defining: We now have the essential matrix relation Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

  31. Properties of the Essential Matrix • Rank 2: • 5 degrees of freedom • Non-linear constraints between elements Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

  32. Recovering Epipolar Lines Equation of a line: or T or Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

  33. Recovering Epipolar Lines T Equation of a line: Now consider T This has the form where So the epipolar lines are Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

  34. Recovering Epipolar Lines Every epipolar line in image 1 passes through the epipole e 1 . In other words for ALL This can only be true if e 1 is in the nullspace of E . Similarly: We find the null spaces by computing , and taking the last column of and the last row of . Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

  35. Decomposition of E Essential matrix: To recover translation and rotation use the matrix: We take the SVD and then we set Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

  36. Four Interpretations To get the different solutions, we mutliply τ by -1 and substitute

  37. Today • Transformations between images • Structure from Motion • The Essential Matrix • The Fundamental Matrix

  38. The Fundamental Matrix Song Taken from Daniel Wedge’s home page - http://danielwedge.com/fmatrix/

  39. The Fundamental Matrix Song Taken from Daniel Wedge’s home page - http://danielwedge.com/fmatrix/

  40. The Fundamental Matrix Now consider two cameras that are not normalised By a similar procedure to before, we get the relation or where Relation between essential and fundamental Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

  41. Estimation of the Fundamental Matrix

  42. Estimation of Fundamental Matrix When the fundamental matrix is correct, the epipolar line induced by a point in the first image should pass through the matching point in the second image and vice-versa. This suggests the criterion If and then Unfortunately, there is no closed form solution for this quantity. Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

  43. The 8 Point Algorithm Approach: • solve for fundamental matrix using homogeneous coordinates • closed form solution (but to wrong problem!) • Known as the 8 point algorithm Start with fundamental matrix relation Writing out in full: or Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

  44. The 8 Point Algorithm Can be written as: where Stacking together constraints from at least 8 pairs of points, we get the system of equations Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

  45. The 8 Point Algorithm Minimum direction problem of the form Find minimum of subject to . To solve, compute the SVD and then set to the last column of . Adapted from: Computer vision: models, learning and inference. Simon J.D. Prince

  46. Fitting Concerns • This procedure does not ensure that solution is rank 2. Solution: set last singular value to zero. • Can be unreliable because of numerical problems to do with the data scaling – better to re-scale the data first • Needs 8 points in general positions (cannot all be planar). • Fails if there is not sufficient translation between the views • Use this solution to start non-linear optimisation of true criterion (must ensure non-linear constraints obeyed). • There is also a 7 point algorithm.

  47. More to read… • Prince et al. • Chapter 16, Sections 1-3.

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend