Class AffineFundamentalMatrixEstimator

java.lang.Object
com.irurueta.ar.epipolar.estimators.FundamentalMatrixEstimator
com.irurueta.ar.epipolar.estimators.AffineFundamentalMatrixEstimator

public class AffineFundamentalMatrixEstimator extends FundamentalMatrixEstimator
Non-robust fundamental matrix estimator for Affine camera projection model. This implementation uses 4 matched 2D points on left and right views.
  • Field Details

    • DEFAULT_ALLOW_LMSE_SOLUTION

      public static final boolean DEFAULT_ALLOW_LMSE_SOLUTION
      Constant indicating that by default an LMSE solution is not allowed.
      See Also:
    • MIN_REQUIRED_POINTS

      public static final int MIN_REQUIRED_POINTS
      Minimum number of matched 2D points to start the estimation.
      See Also:
    • DEFAULT_NORMALIZE_POINT_CORRESPONDENCES

      public static final boolean DEFAULT_NORMALIZE_POINT_CORRESPONDENCES
      Indicates if by default provided point correspondences are normalized to increase the accuracy of the estimation.
      See Also:
    • allowLMSESolution

      private boolean allowLMSESolution
      Indicates whether an LMSE (the Least Mean Square Error) solution is allowed or not.
    • normalizePoints

      private boolean normalizePoints
      Indicates whether provided matched 2D points must be normalized to increase the accuracy of the estimation.
  • Constructor Details

    • AffineFundamentalMatrixEstimator

      public AffineFundamentalMatrixEstimator()
      Constructor.
    • AffineFundamentalMatrixEstimator

      public AffineFundamentalMatrixEstimator(List<com.irurueta.geometry.Point2D> leftPoints, List<com.irurueta.geometry.Point2D> rightPoints)
      Constructor with matched 2D points.
      Parameters:
      leftPoints - 2D points on left view.
      rightPoints - 2D points on right view.
      Throws:
      IllegalArgumentException - if provided list of points do not have the same length.
  • Method Details

    • isLMSESolutionAllowed

      public boolean isLMSESolutionAllowed()
      Returns boolean indicating whether an LMSE (the Least Mean Square Error) solution is allowed or not. When an LMSE solution is allowed, more than 8 matched points can be used for fundamental matrix estimation. If LMSE solution is not allowed then only the 4 former matched points will be taken into account.
      Returns:
      true if an LMSE solution is allowed, false otherwise.
    • setLMSESolutionAllowed

      public void setLMSESolutionAllowed(boolean allowed) throws com.irurueta.geometry.estimators.LockedException
      Sets boolean indicating whether an LMSE (the Least Mean Square Error) solution is allowed or not. When an LMSE solution is allowed, more than 8 matched points can be used for fundamental matrix estimation. If LMSE solution is not allowed then only the 4 former matched points will be taken into account.
      Parameters:
      allowed - true if an LMSE solution is allowed, false otherwise.
      Throws:
      com.irurueta.geometry.estimators.LockedException - if this instance is locked because an estimation is in progress.
    • arePointsNormalized

      public boolean arePointsNormalized()
      Indicates whether provided matched 2D points must be normalized to increase the accuracy of the estimation.
      Returns:
      true if points must be normalized, false otherwise.
    • setPointsNormalized

      public void setPointsNormalized(boolean normalizePoints) throws com.irurueta.geometry.estimators.LockedException
      Sets boolean indicating whether provided matched 2D points must be normalized to increase the accuracy of the estimation.
      Parameters:
      normalizePoints - true if points must be normalized, false otherwise.
      Throws:
      com.irurueta.geometry.estimators.LockedException - if this instance is locked because an estimation is in progress.
    • isReady

      public boolean isReady()
      Returns boolean indicating whether estimator is ready to start the fundamental matrix estimation. This is true when the required minimum number of matched points is provided to obtain a solution and both left and right views have the same number of matched points.
      Specified by:
      isReady in class FundamentalMatrixEstimator
      Returns:
      true if estimator is ready to start the fundamental matrix estimation, false otherwise.
    • estimate

      public FundamentalMatrix estimate() throws com.irurueta.geometry.estimators.LockedException, com.irurueta.geometry.estimators.NotReadyException, FundamentalMatrixEstimatorException
      Estimates a fundamental matrix using provided lists of matched points on left and right views.
      Specified by:
      estimate in class FundamentalMatrixEstimator
      Returns:
      a fundamental matrix.
      Throws:
      com.irurueta.geometry.estimators.LockedException - if estimator is locked doing an estimation.
      com.irurueta.geometry.estimators.NotReadyException - if estimator is not ready because required input points have not already been provided.
      FundamentalMatrixEstimatorException - if configuration of provided 2D points is degenerate and fundamental matrix estimation fails.
    • getMethod

      Returns method of non-robust fundamental matrix estimator.
      Specified by:
      getMethod in class FundamentalMatrixEstimator
      Returns:
      method of fundamental matrix estimator.
    • getMinRequiredPoints

      public int getMinRequiredPoints()
      Returns minimum number of matched pair of points required to start the estimation. This implementation requires a minimum of 4 points
      Specified by:
      getMinRequiredPoints in class FundamentalMatrixEstimator
      Returns:
      minimum number of matched pair of points required to start the estimation. Always returns 4.