Class DecomposeHomography


public class DecomposeHomography extends Object

Decomposes a homography matrix to extract its internal geometric structure. There are four possible solutions, with two that are physically possible. The physically possible solution can be found by imposing a positive depth constraint. See PositiveDepthConstraintCheck for details on how to do that.

A homography matrix is defined as H = (R + (1/d)*T*NT), where R is a 3x3 rotation matrix, d is the distance of the plane, N is the plane's normal, T is the translation vector. The decomposition works by computing the SVD of HTH and the following the procedure outlines in [1].

The input homography is assumed to be from view 'a' to view 'b'. Then the resulting transform (R,T) is the transform from view 'a' to view 'b'. The values of d and N are all from the view 'a' perspective. Since there's a scale ambiguity the value of d is assumed to be 1 and T is scaled appropriately.

"An Invitation to 3-D Vision" 1st edition page 137.

  • Constructor Details

    • DecomposeHomography

      public DecomposeHomography()
  • Method Details

    • decompose

      public void decompose(DMatrixRMaj homography)
      Decomposed the provided homography matrix into its R,T/d,N components. Four solutions will be produced and can be accessed with getSolutionsN() and getSolutionsSE().
      homography - Homography matrix. Not modified.
    • getSolutionsSE

      public List<Se3_F64> getSolutionsSE()

      Returns the camera motion part of the solution. Note that se.T=(1/d)T

      WARNING: Data is reused each time decompose is called.

      Set of rigid body camera motions
    • getSolutionsN

      public List<Vector3D_F64> getSolutionsN()

      Returns the normal of the plane part of the solution

      WARNING: Data is reused each time decompose is called.

      Set of plane normals