Class LMSEHomogeneousSinglePoint3DTriangulator

java.lang.Object
com.irurueta.ar.sfm.SinglePoint3DTriangulator
com.irurueta.ar.sfm.LMSEHomogeneousSinglePoint3DTriangulator

public class LMSEHomogeneousSinglePoint3DTriangulator extends SinglePoint3DTriangulator
Triangulates matched 2D points into a single 3D one by using 2D point correspondences on different views along with the corresponding cameras on each of those views by finding an LMSE solution to homogeneous systems of equations.
  • Field Details

    • DEFAULT_ALLOW_LMSE_SOLUTION

      public static final boolean DEFAULT_ALLOW_LMSE_SOLUTION
      Indicates if by default an LMSE (the Least Mean Square Error) is allowed if more correspondences than the minimum are provided.
      See Also:
    • allowLMSESolution

      private boolean allowLMSESolution
      Indicates if an LMSE (the Least Mean Square Error) solution is allowed if more correspondences than the minimum are provided. If false, the exceeding correspondences will be ignored and only the 6 first correspondences will be used.
  • Constructor Details

    • LMSEHomogeneousSinglePoint3DTriangulator

      public LMSEHomogeneousSinglePoint3DTriangulator()
      Constructor.
    • LMSEHomogeneousSinglePoint3DTriangulator

      public LMSEHomogeneousSinglePoint3DTriangulator(List<com.irurueta.geometry.Point2D> points2D, List<com.irurueta.geometry.PinholeCamera> cameras)
      Constructor.
      Parameters:
      points2D - list of matched 2D points on each view. Each point in the list is assumed to be projected by the corresponding camera in the list.
      cameras - camera for each view where 2D points are represented.
      Throws:
      IllegalArgumentException - if provided lists don't have the same length or their length is less than 2 views, which is the minimum required to compute triangulation.
    • LMSEHomogeneousSinglePoint3DTriangulator

      public LMSEHomogeneousSinglePoint3DTriangulator(SinglePoint3DTriangulatorListener listener)
      Constructor.
      Parameters:
      listener - listener to notify events generated by instances of this class.
    • LMSEHomogeneousSinglePoint3DTriangulator

      public LMSEHomogeneousSinglePoint3DTriangulator(List<com.irurueta.geometry.Point2D> points2D, List<com.irurueta.geometry.PinholeCamera> cameras, SinglePoint3DTriangulatorListener listener)
      Constructor.
      Parameters:
      points2D - list of matched 2D points on each view. Each point in the list is assumed to be projected by the corresponding camera in the list.
      cameras - cameras for each view where 2D points are represented.
      listener - listener to notify events generated by instances of this class.
      Throws:
      IllegalArgumentException - if provided lists don't have the same length or their length is less than 2 views, which is the minimum required to compute triangulation.
  • Method Details

    • isLMSESolutionAllowed

      public boolean isLMSESolutionAllowed()
      Indicates if an LMSE (the Least Mean Square Error) solution is allowed if more correspondences than the minimum are provided. If false, the exceeding correspondences will be ignored and only the 2 first matches corresponding to the first 2 views will be used.
      Returns:
      true if LMSE solution is allowed, false otherwise.
    • setLMSESolutionAllowed

      public void setLMSESolutionAllowed(boolean allowed) throws com.irurueta.geometry.estimators.LockedException
      Specifies if an LMSE (the Least Mean Square Error) solution is allowed if more correspondences than the minimum are provided. If false, the exceeding correspondences will be ignored and only the 2 first matches corresponding to the first 2 views will be used.
      Parameters:
      allowed - true if LMSE solution is allowed, false otherwise.
      Throws:
      com.irurueta.geometry.estimators.LockedException - if estimator is locked.
    • getType

      public Point3DTriangulatorType getType()
      Returns type of triangulator.
      Specified by:
      getType in class SinglePoint3DTriangulator
      Returns:
      type of triangulator.
    • triangulate

      protected void triangulate(List<com.irurueta.geometry.Point2D> points2D, List<com.irurueta.geometry.PinholeCamera> cameras, com.irurueta.geometry.Point3D result) throws Point3DTriangulationException
      Internal method to triangulate provided matched 2D points being projected by each corresponding camera into a single 3D point. At least 2 matched 2D points and their corresponding 2 cameras are required to compute triangulation. If more views are provided, an averaged solution is found. This method does not check whether instance is locked or ready.
      Specified by:
      triangulate in class SinglePoint3DTriangulator
      Parameters:
      points2D - matched 2D points. Each point in the list is assumed to be projected by the corresponding camera in the list.
      cameras - list of cameras associated to the matched 2D point on the same position as the camera on the list.
      result - instance where triangulated 3D point is stored.
      Throws:
      Point3DTriangulationException - if triangulation fails for some other reason (i.e. degenerate geometry, numerical instabilities, etc.).