Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Introduction to Homography 2010.01.19
Coordinate System view coordinate system object coordinate system x y z world coordinate system
History P->G:  以  E  為眼點從平面 G 到平面 W 的 透視對應
Outline <ul><li>Projective   Geometry </li></ul><ul><li>Projective   Transformation </li></ul><ul><li>Estimation </li></ul...
Homo. representation (1)  <ul><li>Lines </li></ul><ul><li>This equivalence relationship is known as a  homogeneous  vector...
Homo. representation (2)  <ul><li>Points </li></ul>Homo. representation
Degree of freedom (DoF) <ul><li>Point </li></ul><ul><li>Line  </li></ul>
<ul><li>2 lines </li></ul><ul><li>Assume </li></ul>Intersection of lines (1)
Intersection of lines (2) <ul><li>Ex:   determining the intersection of the lines  x = 1   and  y = 1  </li></ul>y = 1 x = 1
Line joining points <ul><li>The line passing through two points x and x’ </li></ul><ul><li>Assume </li></ul>
Line at infinity (1) <ul><li>Consider 2 lines </li></ul><ul><li>Intersection </li></ul>
Line at infinity (2) <ul><li>Inhomogeneous representation </li></ul><ul><li>No sense ! Suggest the point has infinitely la...
Line at infinity (3) <ul><li>Ex: intersection point of 2 lines  x=1  and  x=2 </li></ul>The point at infinity in the direc...
Line at infinity (4) <ul><li>Projective Space P 2   : augment  R 2  by adding points with last coordinate  x 3  = 0  to al...
Concept of points at infinity <ul><li>Simplify the intersection properties of points and lines </li></ul><ul><li>In  P 2 ,...
A model for the projective plane Points  and  Lines  of P 2  are represented by  Rays  and  Planes , respectively, through...
Outline <ul><li>Projective   Geometry </li></ul><ul><li>Projective   Transformation </li></ul><ul><li>Estimation </li></ul...
Mapping between planes
Definition (1) <ul><li>A projectivity is an  invertible  mapping  h  from  P 2  to itself such that 3 points  x 1  ,  x 2 ...
Definition (2) <ul><li>A mapping  h  from  P 2  to  P 2  </li></ul><ul><li>There exists a  non-singular  3 x 3 matrix H su...
Definition (3) <ul><li>H  is a  homogeneous matrix , since as in the homogeneous representation of a point,  only the rati...
A hierarchy of transformations (1)
A hierarchy of transformations (2)
Outline <ul><li>Projective   Geometry </li></ul><ul><li>Projective   Transformation </li></ul><ul><li>Estimation </li></ul...
Document Distortion
Correction
2D Homography <ul><li>x i  in  P 2   x j  in  P 2 </li></ul><ul><li>In a practical situation, the points  x i  and  x j  a...
DLT Algorithm (1)
DLT Algorithm (2) <ul><li>Since each point correspondence provides 2 equations,  4 correspondences are sufficient  to solve ...
Outline <ul><li>Projective   Geometry </li></ul><ul><li>Projective   Transformation </li></ul><ul><li>Estimation </li></ul...
OpenCV Implementation <ul><li>Mat   findHomography (  </li></ul><ul><li>const  Mat & srcPoints,  </li></ul><ul><li>const  ...
Reference <ul><li>Multiple View Geometry in Computer Vision , Cambridge University Press, 2000. </li></ul><ul><li>Projecti...
Upcoming SlideShare
Loading in …5
×

Introduction to homography

18,955 views

Published on

Published in: Education, Technology

Introduction to homography

  1. 1. Introduction to Homography 2010.01.19
  2. 2. Coordinate System view coordinate system object coordinate system x y z world coordinate system
  3. 3. History P->G: 以 E 為眼點從平面 G 到平面 W 的 透視對應
  4. 4. Outline <ul><li>Projective Geometry </li></ul><ul><li>Projective Transformation </li></ul><ul><li>Estimation </li></ul><ul><ul><li>Document Perspective Distortion </li></ul></ul><ul><ul><li>Direct Linear Transform (DLT) Algorithm </li></ul></ul><ul><li>OpenCV Implementation </li></ul>
  5. 5. Homo. representation (1) <ul><li>Lines </li></ul><ul><li>This equivalence relationship is known as a homogeneous vector </li></ul>representative
  6. 6. Homo. representation (2) <ul><li>Points </li></ul>Homo. representation
  7. 7. Degree of freedom (DoF) <ul><li>Point </li></ul><ul><li>Line </li></ul>
  8. 8. <ul><li>2 lines </li></ul><ul><li>Assume </li></ul>Intersection of lines (1)
  9. 9. Intersection of lines (2) <ul><li>Ex: determining the intersection of the lines x = 1 and y = 1 </li></ul>y = 1 x = 1
  10. 10. Line joining points <ul><li>The line passing through two points x and x’ </li></ul><ul><li>Assume </li></ul>
  11. 11. Line at infinity (1) <ul><li>Consider 2 lines </li></ul><ul><li>Intersection </li></ul>
  12. 12. Line at infinity (2) <ul><li>Inhomogeneous representation </li></ul><ul><li>No sense ! Suggest the point has infinitely large coordinates </li></ul>Homogeneous coordinates (x, y, 0) T do not correspond to any finite point in R 2
  13. 13. Line at infinity (3) <ul><li>Ex: intersection point of 2 lines x=1 and x=2 </li></ul>The point at infinity in the direction of the y-axis
  14. 14. Line at infinity (4) <ul><li>Projective Space P 2 : augment R 2 by adding points with last coordinate x 3 = 0 to all homogeneous 3-vectors </li></ul><ul><li>The points with last coordinate x 3 = 0 are known as ideal points , or points at infinity </li></ul><ul><li>The set of all ideal points may be written (x 1 ,x 2 , 0) T . The set lies on a single line, the line at infinity , denoted by the vector (0,0,1) T => (x 1 ,x 2 ,0)(0,0,1) T =0 </li></ul>
  15. 15. Concept of points at infinity <ul><li>Simplify the intersection properties of points and lines </li></ul><ul><li>In P 2 , one may state without qualification (not true in the R 2 ) </li></ul><ul><ul><li>2 distinct lines meet in a single point </li></ul></ul><ul><ul><li>2 distinct points lie on a single line </li></ul></ul>
  16. 16. A model for the projective plane Points and Lines of P 2 are represented by Rays and Planes , respectively, through the origin in R 3 Lines lying in the x 1 x 2 -plane represent ideal points , and the x 1 x 2 -plane represents l ∞
  17. 17. Outline <ul><li>Projective Geometry </li></ul><ul><li>Projective Transformation </li></ul><ul><li>Estimation </li></ul><ul><ul><li>Document Perspective Distortion </li></ul></ul><ul><ul><li>Direct Linear Transform (DLT) Algorithm </li></ul></ul><ul><li>OpenCV Implementation </li></ul>
  18. 18. Mapping between planes
  19. 19. Definition (1) <ul><li>A projectivity is an invertible mapping h from P 2 to itself such that 3 points x 1 , x 2 and x 3 lie on the same line if and only if h(x 1 ) , h(x 2 ) and h(x 3 ) do </li></ul><ul><li>Synonymous </li></ul><ul><ul><li>Collineation </li></ul></ul><ul><ul><li>Homography </li></ul></ul>
  20. 20. Definition (2) <ul><li>A mapping h from P 2 to P 2 </li></ul><ul><li>There exists a non-singular 3 x 3 matrix H such that for any point in P 2 represented by a vector x it is true that </li></ul>
  21. 21. Definition (3) <ul><li>H is a homogeneous matrix , since as in the homogeneous representation of a point, only the ratio of the matrix elements is significant (Dof = 8) </li></ul>
  22. 22. A hierarchy of transformations (1)
  23. 23. A hierarchy of transformations (2)
  24. 24. Outline <ul><li>Projective Geometry </li></ul><ul><li>Projective Transformation </li></ul><ul><li>Estimation </li></ul><ul><ul><li>Document Perspective Distortion </li></ul></ul><ul><ul><li>Direct Linear Transform (DLT) Algorithm </li></ul></ul><ul><li>OpenCV Implementation </li></ul>
  25. 25. Document Distortion
  26. 26. Correction
  27. 27. 2D Homography <ul><li>x i in P 2 x j in P 2 </li></ul><ul><li>In a practical situation, the points x i and x j are points in 2 images (or the same image), each image being considered as a projective plane P 2 </li></ul>
  28. 28. DLT Algorithm (1)
  29. 29. DLT Algorithm (2) <ul><li>Since each point correspondence provides 2 equations, 4 correspondences are sufficient to solve for the 8 degrees of freedom of H </li></ul><ul><li>Use more than 4 correspondences to ensure a more robust solution (The problem then becomes to solve for a vector h that minimizes a suitable cost function ) </li></ul>
  30. 30. Outline <ul><li>Projective Geometry </li></ul><ul><li>Projective Transformation </li></ul><ul><li>Estimation </li></ul><ul><ul><li>Document Perspective Distortion </li></ul></ul><ul><ul><li>Direct Linear Transform (DLT) Algorithm </li></ul></ul><ul><li>OpenCV Implementation </li></ul>
  31. 31. OpenCV Implementation <ul><li>Mat findHomography ( </li></ul><ul><li>const Mat & srcPoints, </li></ul><ul><li>const Mat & dstPoints, </li></ul><ul><li>int method=0, </li></ul><ul><li>double ransacReprojThreshold=3); </li></ul><ul><li>void warpPerspective ( </li></ul><ul><li>const Mat & src, </li></ul><ul><li>CV_OUT Mat & dst, </li></ul><ul><li>const Mat & M, </li></ul><ul><li>Size dsize, </li></ul><ul><li>int flags=INTER_LINEAR, </li></ul><ul><li>int borderMode=BORDER_CONSTANT, </li></ul><ul><li>const Scalar& borderValue=Scalar()); </li></ul>Homography Estimation Projective Transform
  32. 32. Reference <ul><li>Multiple View Geometry in Computer Vision , Cambridge University Press, 2000. </li></ul><ul><li>Projective geometry and homogeneous coordinates [Video] - http://www.youtube.com/watch?v=q3turHmOWq4 </li></ul>

×