Class InitialCamerasEstimator

java.lang.Object
com.irurueta.ar.sfm.InitialCamerasEstimator
Direct Known Subclasses:
DualAbsoluteQuadricInitialCamerasEstimator, DualImageOfAbsoluteConicInitialCamerasEstimator, EssentialMatrixInitialCamerasEstimator

public abstract class InitialCamerasEstimator extends Object
Estimates initial cameras to initialize geometry in a metric stratum. This class uses provided fundamental matrix in order to obtain a pair of cameras and upgrade such cameras into a metric stratum. This class assumes that principal point of intrinsic camera parameters are located at the origin of coordinates, and also that skewness of such intrinsic parameters is zero. This class can upgrade cameras to a metric stratum by either estimating the Dual Absolute Quadric and its corresponding projective to metric transformation, or by solving the Kruppa equations to estimate the Dual Image of Absolute Conic to determine intrinsic parameters and then compute the essential matrix and use 2D point matches to triangulate them and find the initial cameras.
  • Field Details

    • DEFAULT_METHOD

      public static final InitialCamerasEstimatorMethod DEFAULT_METHOD
      Default method.
    • fundamentalMatrix

      protected FundamentalMatrix fundamentalMatrix
      Fundamental matrix relating two views whose cameras need to be estimated.
    • locked

      protected boolean locked
      Indicates if this estimator is locked or not.
    • estimatedLeftCamera

      protected com.irurueta.geometry.PinholeCamera estimatedLeftCamera
      Estimated camera for left view.
    • estimatedRightCamera

      protected com.irurueta.geometry.PinholeCamera estimatedRightCamera
      Estimated camera for right view.
    • listener

      protected InitialCamerasEstimatorListener listener
      Listener to handle events raised by this instance.
  • Constructor Details

    • InitialCamerasEstimator

      protected InitialCamerasEstimator()
      Constructor.
    • InitialCamerasEstimator

      protected InitialCamerasEstimator(FundamentalMatrix fundamentalMatrix)
      Constructor.
      Parameters:
      fundamentalMatrix - fundamental matrix relating two views.
    • InitialCamerasEstimator

      protected InitialCamerasEstimator(InitialCamerasEstimatorListener listener)
      Constructor.
      Parameters:
      listener - listener to handle events raised by this instance.
    • InitialCamerasEstimator

      protected InitialCamerasEstimator(FundamentalMatrix fundamentalMatrix, InitialCamerasEstimatorListener listener)
      Constructor.
      Parameters:
      fundamentalMatrix - fundamental matrix relating two views.
      listener - listener to handle events raised by this instance.
  • Method Details

    • getFundamentalMatrix

      public FundamentalMatrix getFundamentalMatrix()
      Gets fundamental matrix relating two views whose cameras need to be estimated.
      Returns:
      fundamental matrix relating two views.
    • setFundamentalMatrix

      public void setFundamentalMatrix(FundamentalMatrix fundamentalMatrix) throws com.irurueta.geometry.estimators.LockedException
      Sets fundamental matrix relating two views whose cameras need to be estimated.
      Parameters:
      fundamentalMatrix - fundamental matrix relating two views.
      Throws:
      com.irurueta.geometry.estimators.LockedException - if estimator is locked.
    • getListener

      public InitialCamerasEstimatorListener getListener()
      Gets listener to handle events raised by this instance.
      Returns:
      listener to handle events raised by this instance.
    • setListener

      public void setListener(InitialCamerasEstimatorListener listener)
      Sets listener to handle events raised by this instance.
      Parameters:
      listener - listener to handle events raised by this instance.
    • isLocked

      public boolean isLocked()
      Indicates if this estimator is locked or not.
      Returns:
      true if this estimator is locked, false otherwise.
    • getEstimatedLeftCamera

      public com.irurueta.geometry.PinholeCamera getEstimatedLeftCamera()
      Gets estimated camera for left view.
      Returns:
      estimated camera for left view.
    • getEstimatedRightCamera

      public com.irurueta.geometry.PinholeCamera getEstimatedRightCamera()
      Gets estimated camera for right view.
      Returns:
      estimated camera for right view.
    • getMethod

      public abstract InitialCamerasEstimatorMethod getMethod()
      Returns method used by this estimator.
      Returns:
      method used by this estimator.
    • isReady

      public abstract boolean isReady()
      Indicates if estimator is ready.
      Returns:
      true if estimator is ready, false otherwise.
    • estimate

      public abstract void estimate() throws com.irurueta.geometry.estimators.LockedException, com.irurueta.geometry.estimators.NotReadyException, InitialCamerasEstimationFailedException
      Estimates cameras.
      Throws:
      com.irurueta.geometry.estimators.LockedException - if estimator is locked.
      com.irurueta.geometry.estimators.NotReadyException - if estimator is not ready.
      InitialCamerasEstimationFailedException - if estimation of cameras fails for some reason, typically due to numerical instabilities.
    • create

      Creates an instance of an initial cameras estimator using provided method.
      Parameters:
      method - method to estimate initial cameras.
      Returns:
      an estimator.
    • create

      public static InitialCamerasEstimator create(FundamentalMatrix fundamentalMatrix, InitialCamerasEstimatorMethod method)
      Creates an instance of an initial cameras estimator using provided fundamental matrix and provided method.
      Parameters:
      fundamentalMatrix - fundamental matrix relating two views.
      method - method to estimate initial cameras.
      Returns:
      an estimator.
    • create

      Creates an instance of an initial cameras estimator using provided listener and method.
      Parameters:
      listener - listener to handle events.
      method - method to estimate initial cameras.
      Returns:
      an estimator.
    • create

      Creates an instance of an initial cameras estimator using provided fundamental matrix, listener and method.
      Parameters:
      fundamentalMatrix - fundamental matrix relating two views.
      listener - listener to handle events.
      method - method to estimate initial cameras.
      Returns:
      an estimator.
    • create

      public static InitialCamerasEstimator create()
      Creates an instance of an initial cameras estimator using provided method.
      Returns:
      an estimator.
    • create

      public static InitialCamerasEstimator create(FundamentalMatrix fundamentalMatrix)
      Creates an instance of an initial cameras estimator using provided fundamental matrix and provided method.
      Parameters:
      fundamentalMatrix - fundamental matrix relating two views.
      Returns:
      an estimator.
    • create

      Creates an instance of an initial cameras estimator using provided listener and method.
      Parameters:
      listener - listener to handle events.
      Returns:
      an estimator.
    • create

      public static InitialCamerasEstimator create(FundamentalMatrix fundamentalMatrix, InitialCamerasEstimatorListener listener)
      Creates an instance of an initial cameras estimator using provided fundamental matrix, listener and method.
      Parameters:
      fundamentalMatrix - fundamental matrix relating two views.
      listener - listener to handle events.
      Returns:
      an estimator.