Package com.irurueta.ar.sfm
Class InitialCamerasEstimator
java.lang.Object
com.irurueta.ar.sfm.InitialCamerasEstimator
- Direct Known Subclasses:
DualAbsoluteQuadricInitialCamerasEstimator,DualImageOfAbsoluteConicInitialCamerasEstimator,EssentialMatrixInitialCamerasEstimator
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final InitialCamerasEstimatorMethodDefault method.protected com.irurueta.geometry.PinholeCameraEstimated camera for left view.protected com.irurueta.geometry.PinholeCameraEstimated camera for right view.protected FundamentalMatrixFundamental matrix relating two views whose cameras need to be estimated.protected InitialCamerasEstimatorListenerListener to handle events raised by this instance.protected booleanIndicates if this estimator is locked or not. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructor.protectedInitialCamerasEstimator(FundamentalMatrix fundamentalMatrix) Constructor.protectedInitialCamerasEstimator(FundamentalMatrix fundamentalMatrix, InitialCamerasEstimatorListener listener) Constructor.protectedConstructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic InitialCamerasEstimatorcreate()Creates an instance of an initial cameras estimator using provided method.static InitialCamerasEstimatorcreate(FundamentalMatrix fundamentalMatrix) Creates an instance of an initial cameras estimator using provided fundamental matrix and provided method.static InitialCamerasEstimatorcreate(FundamentalMatrix fundamentalMatrix, InitialCamerasEstimatorListener listener) Creates an instance of an initial cameras estimator using provided fundamental matrix, listener and method.static InitialCamerasEstimatorcreate(FundamentalMatrix fundamentalMatrix, InitialCamerasEstimatorListener listener, InitialCamerasEstimatorMethod method) Creates an instance of an initial cameras estimator using provided fundamental matrix, listener and method.static InitialCamerasEstimatorcreate(FundamentalMatrix fundamentalMatrix, InitialCamerasEstimatorMethod method) Creates an instance of an initial cameras estimator using provided fundamental matrix and provided method.static InitialCamerasEstimatorcreate(InitialCamerasEstimatorListener listener) Creates an instance of an initial cameras estimator using provided listener and method.static InitialCamerasEstimatorcreate(InitialCamerasEstimatorListener listener, InitialCamerasEstimatorMethod method) Creates an instance of an initial cameras estimator using provided listener and method.static InitialCamerasEstimatorcreate(InitialCamerasEstimatorMethod method) Creates an instance of an initial cameras estimator using provided method.abstract voidestimate()Estimates cameras.com.irurueta.geometry.PinholeCameraGets estimated camera for left view.com.irurueta.geometry.PinholeCameraGets estimated camera for right view.Gets fundamental matrix relating two views whose cameras need to be estimated.Gets listener to handle events raised by this instance.abstract InitialCamerasEstimatorMethodReturns method used by this estimator.booleanisLocked()Indicates if this estimator is locked or not.abstract booleanisReady()Indicates if estimator is ready.voidsetFundamentalMatrix(FundamentalMatrix fundamentalMatrix) Sets fundamental matrix relating two views whose cameras need to be estimated.voidsetListener(InitialCamerasEstimatorListener listener) Sets listener to handle events raised by this instance.
-
Field Details
-
DEFAULT_METHOD
Default method. -
fundamentalMatrix
Fundamental matrix relating two views whose cameras need to be estimated. -
locked
protected boolean lockedIndicates if this estimator is locked or not. -
estimatedLeftCamera
protected com.irurueta.geometry.PinholeCamera estimatedLeftCameraEstimated camera for left view. -
estimatedRightCamera
protected com.irurueta.geometry.PinholeCamera estimatedRightCameraEstimated camera for right view. -
listener
Listener to handle events raised by this instance.
-
-
Constructor Details
-
InitialCamerasEstimator
protected InitialCamerasEstimator()Constructor. -
InitialCamerasEstimator
Constructor.- Parameters:
fundamentalMatrix- fundamental matrix relating two views.
-
InitialCamerasEstimator
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
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
Gets listener to handle events raised by this instance.- Returns:
- listener to handle events raised by this instance.
-
setListener
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
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, InitialCamerasEstimationFailedExceptionEstimates 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
public static InitialCamerasEstimator create(InitialCamerasEstimatorListener listener, InitialCamerasEstimatorMethod method) 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
public static InitialCamerasEstimator create(FundamentalMatrix fundamentalMatrix, InitialCamerasEstimatorListener listener, InitialCamerasEstimatorMethod method) 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
Creates an instance of an initial cameras estimator using provided method.- Returns:
- an estimator.
-
create
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.
-