Class MSACRobustSinglePoint3DTriangulator

java.lang.Object
com.irurueta.ar.sfm.RobustSinglePoint3DTriangulator
com.irurueta.ar.sfm.MSACRobustSinglePoint3DTriangulator

public class MSACRobustSinglePoint3DTriangulator extends RobustSinglePoint3DTriangulator
Robustly triangulates 3D points from matched 2D points and their corresponding cameras on several views using MSAC algorithm.
  • Field Details

    • DEFAULT_THRESHOLD

      public static final double DEFAULT_THRESHOLD
      Constant defining default threshold to determine whether samples are inliers or not. By default, 1.0 is considered a good value for cases where 2D point measures are done on pixels, since typically the minimum resolution is 1 pixel.
      See Also:
    • MIN_THRESHOLD

      public static final double MIN_THRESHOLD
      Minimum value that can be set as threshold. Threshold must be strictly greater than 0.0.
      See Also:
    • threshold

      private double threshold
      Threshold to determine whether samples are inliers or not when testing possible estimation solutions. The threshold refers to the amount of projection error (i.e. distance of projected solution using each camera).
  • Constructor Details

    • MSACRobustSinglePoint3DTriangulator

      public MSACRobustSinglePoint3DTriangulator()
      Constructor.
    • MSACRobustSinglePoint3DTriangulator

      public MSACRobustSinglePoint3DTriangulator(RobustSinglePoint3DTriangulatorListener listener)
      Constructor.
      Parameters:
      listener - listener to be notified of events such as when estimation starts, ends or its progress significantly changes.
    • MSACRobustSinglePoint3DTriangulator

      public MSACRobustSinglePoint3DTriangulator(List<com.irurueta.geometry.Point2D> points, List<com.irurueta.geometry.PinholeCamera> cameras)
      Constructor.
      Parameters:
      points - 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.
      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.
    • MSACRobustSinglePoint3DTriangulator

      public MSACRobustSinglePoint3DTriangulator(List<com.irurueta.geometry.Point2D> points, List<com.irurueta.geometry.PinholeCamera> cameras, RobustSinglePoint3DTriangulatorListener listener)
      Constructor.
      Parameters:
      points - 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.
      listener - listener to be notified of events such as when estimation starts, ends or its progress significantly changes.
      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

    • getThreshold

      public double getThreshold()
      Returns threshold to determine whether points are inliers or not when testing possible estimation solutions. The threshold refers to the amount of error (i.e. Euclidean distance) a possible solution has on projected 2D points.
      Returns:
      threshold to determine whether points are inliers or not when testing possible estimation solutions.
    • setThreshold

      public void setThreshold(double threshold) throws com.irurueta.geometry.estimators.LockedException
      Sets threshold to determine whether points are inliers or not when testing possible estimation solutions. The threshold refers to the amount of error (i.e. Euclidean distance) a possible solution has on projected 2D points.
      Parameters:
      threshold - threshold to be set.
      Throws:
      IllegalArgumentException - if provided value is equal or less than zero.
      com.irurueta.geometry.estimators.LockedException - if robust estimator is locked because an estimation is already in progress.
    • triangulate

      public com.irurueta.geometry.Point3D triangulate() throws com.irurueta.geometry.estimators.LockedException, com.irurueta.geometry.estimators.NotReadyException, com.irurueta.numerical.robust.RobustEstimatorException
      Triangulates 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 can be found.
      Specified by:
      triangulate in class RobustSinglePoint3DTriangulator
      Returns:
      computed triangulated 3D point.
      Throws:
      com.irurueta.geometry.estimators.LockedException - if this instance is locked.
      com.irurueta.geometry.estimators.NotReadyException - if lists of points and cameras don't have the same length or less than 2 views are provided.
      com.irurueta.numerical.robust.RobustEstimatorException - if estimation fails for any reason (i.e. numerical instability, no solution available, etc).
    • getMethod

      public com.irurueta.numerical.robust.RobustEstimatorMethod getMethod()
      Returns method being used for robust estimation.
      Specified by:
      getMethod in class RobustSinglePoint3DTriangulator
      Returns:
      method being used for robust estimation.