Class FundamentalMatrixEstimator

java.lang.Object
com.irurueta.ar.epipolar.estimators.FundamentalMatrixEstimator
Direct Known Subclasses:
AffineFundamentalMatrixEstimator, EightPointsFundamentalMatrixEstimator, SevenPointsFundamentalMatrixEstimator

public abstract class FundamentalMatrixEstimator extends Object
Base class for a non-robust fundamental matrix estimator.
  • Field Details

    • DEFAULT_METHOD

      public static final FundamentalMatrixEstimatorMethod DEFAULT_METHOD
      Default method for non-robust fundamental matrix estimation.
    • listener

      Listener to be notified of events generated by this fundamental matrix estimator.
    • leftPoints

      protected List<com.irurueta.geometry.Point2D> leftPoints
      List of 2D points corresponding to left view.
    • rightPoints

      protected List<com.irurueta.geometry.Point2D> rightPoints
      List of 2D points corresponding to right view.
    • locked

      protected boolean locked
      Indicates whether this instance is locked because estimation is being computed.
  • Constructor Details

    • FundamentalMatrixEstimator

      protected FundamentalMatrixEstimator()
      Constructor.
    • FundamentalMatrixEstimator

      protected FundamentalMatrixEstimator(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

    • getLeftPoints

      public List<com.irurueta.geometry.Point2D> getLeftPoints()
      Returns matched 2D points on left view.
      Returns:
      2D points on left view.
    • getRightPoints

      public List<com.irurueta.geometry.Point2D> getRightPoints()
      Returns matched 2D points on right view.
      Returns:
      2D points on right view.
    • setPoints

      public void setPoints(List<com.irurueta.geometry.Point2D> leftPoints, List<com.irurueta.geometry.Point2D> rightPoints) throws com.irurueta.geometry.estimators.LockedException
      Sets matched 2D points on both left and right views.
      Parameters:
      leftPoints - matched 2D points on left view.
      rightPoints - matched 2D points on right view.
      Throws:
      com.irurueta.geometry.estimators.LockedException - if this fundamental matrix estimator is locked.
      IllegalArgumentException - if provided matched points on left and right views do not have the same length.
    • getListener

      public FundamentalMatrixEstimatorListener getListener()
      Returns listener to be notified of events generated by this fundamental matrix estimator.
      Returns:
      listener to be notified of events generated by this fundamental matrix estimator.
    • setListener

      public void setListener(FundamentalMatrixEstimatorListener listener) throws com.irurueta.geometry.estimators.LockedException
      Sets listener to be notified of events generated by this fundamental matrix estimator.
      Parameters:
      listener - listener to be notified of events generated by this fundamental matrix estimator.
      Throws:
      com.irurueta.geometry.estimators.LockedException - if this estimator is locked.
    • isLocked

      public boolean isLocked()
      Returns boolean indicating if estimator is locked because estimation is under progress.
      Returns:
      true if estimator is locked, false otherwise.
    • isReady

      public abstract boolean isReady()
      Returns boolean indicating whether estimator is ready to start the fundamental matrix estimation. This is true when the required number of matched points is provided to obtain a solution.
      Returns:
      true if estimator is ready to start the fundamental matrix estimation, false otherwise.
    • estimate

      public abstract 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.
      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

      public abstract FundamentalMatrixEstimatorMethod getMethod()
      Returns method of non-robust fundamental matrix estimator.
      Returns:
      method of fundamental matrix estimator.
    • getMinRequiredPoints

      public abstract int getMinRequiredPoints()
      Returns minimum number of matched pair of points required to start the estimation.
      Returns:
      minimum number of matched pair of points required to start the estimation.
    • create

      Creates an instance of a fundamental matrix estimator using provided method.
      Parameters:
      method - a fundamental matrix estimator method.
      Returns:
      an instance of a fundamental matrix estimator.
    • create

      public static FundamentalMatrixEstimator create(List<com.irurueta.geometry.Point2D> leftPoints, List<com.irurueta.geometry.Point2D> rightPoints, FundamentalMatrixEstimatorMethod method)
      Creates an instance of a fundamental matrix estimator using provided matched 2D points on left and right views and provided method.
      Parameters:
      leftPoints - matched 2D points on left view.
      rightPoints - matched 2D points on right view.
      method - a fundamental matrix estimator method.
      Returns:
      an instance of a fundamental matrix estimator.
      Throws:
      IllegalArgumentException - if provided list of points do not have the same length.
    • create

      public static FundamentalMatrixEstimator create()
      Creates an instance of a fundamental matrix estimator using default method.
      Returns:
      an instance of a fundamental matrix estimator.
    • create

      public static FundamentalMatrixEstimator create(List<com.irurueta.geometry.Point2D> leftPoints, List<com.irurueta.geometry.Point2D> rightPoints)
      Creates an instance of a fundamental matrix estimator using provided matched 2D points on left and right views and default method.
      Parameters:
      leftPoints - matched 2D points on left view.
      rightPoints - matched 2D points on right view.
      Returns:
      an instance of a fundamental matrix estimator.
      Throws:
      IllegalArgumentException - if provided list of points do not have the same length.
    • internalSetPoints

      private void internalSetPoints(List<com.irurueta.geometry.Point2D> leftPoints, List<com.irurueta.geometry.Point2D> rightPoints)
      Sets matched 2D points on left and right views. This method does not check whether instance is locked or not.
      Parameters:
      leftPoints - matched 2D points on left view.
      rightPoints - matched 2D points on right view.
      Throws:
      IllegalArgumentException - if provided lists of points don't have the same size.