Package com.irurueta.ar.sfm
Class DualAbsoluteQuadricInitialCamerasEstimator
java.lang.Object
com.irurueta.ar.sfm.InitialCamerasEstimator
com.irurueta.ar.sfm.DualAbsoluteQuadricInitialCamerasEstimator
Estimates an initial pair of cameras in the metric stratum (up to an
arbitrary scale) using a given fundamental matrix and assuming zero skewness
and principal point at the origin for the intrinsic parameters of estimated
cameras.
Aspect ratio can be configured but by default it is assumed to be 1.0.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate double
Aspect ratio of intrinsic parameters of cameras.Fields inherited from class com.irurueta.ar.sfm.InitialCamerasEstimator
DEFAULT_METHOD, estimatedLeftCamera, estimatedRightCamera, fundamentalMatrix, listener, locked
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor.DualAbsoluteQuadricInitialCamerasEstimator
(FundamentalMatrix fundamentalMatrix) Constructor.DualAbsoluteQuadricInitialCamerasEstimator
(FundamentalMatrix fundamentalMatrix, InitialCamerasEstimatorListener listener) Constructor.Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
estimate()
Estimates cameras.static void
generateInitialMetricCamerasUsingDAQ
(FundamentalMatrix fundamentalMatrix, double aspectRatio, com.irurueta.geometry.PinholeCamera leftCamera, com.irurueta.geometry.PinholeCamera rightCamera) Generates initial cameras in metric stratum (with arbitrary scale) using provided fundamental matrix by means of estimation of the Dual Absolute Quadric and the required projective to metric transformation.static void
generateInitialMetricCamerasUsingDAQ
(FundamentalMatrix fundamentalMatrix, com.irurueta.geometry.PinholeCamera leftCamera, com.irurueta.geometry.PinholeCamera rightCamera) Generates initial cameras in metric stratum (with arbitrary scale) using provided fundamental matrix by means of estimation of the Dual Absolute Quadric and the required projective to metric transformation.double
Gets aspect ratio of intrinsic parameters of cameras.Returns method used by this estimator.boolean
isReady()
Indicates if estimator is ready.void
setAspectRatio
(double aspectRatio) Sets aspect ratio of intrinsic parameters of cameras.Methods inherited from class com.irurueta.ar.sfm.InitialCamerasEstimator
create, create, create, create, create, create, create, create, getEstimatedLeftCamera, getEstimatedRightCamera, getFundamentalMatrix, getListener, isLocked, setFundamentalMatrix, setListener
-
Field Details
-
aspectRatio
private double aspectRatioAspect ratio of intrinsic parameters of cameras. Typically, this value is 1.0 if vertical coordinates increase upwards, or -1.0 if it is the opposite.
-
-
Constructor Details
-
DualAbsoluteQuadricInitialCamerasEstimator
public DualAbsoluteQuadricInitialCamerasEstimator()Constructor. -
DualAbsoluteQuadricInitialCamerasEstimator
Constructor.- Parameters:
fundamentalMatrix
- fundamental matrix relating two views.
-
DualAbsoluteQuadricInitialCamerasEstimator
Constructor.- Parameters:
listener
- listener to handle events raised by this instance.
-
DualAbsoluteQuadricInitialCamerasEstimator
public DualAbsoluteQuadricInitialCamerasEstimator(FundamentalMatrix fundamentalMatrix, InitialCamerasEstimatorListener listener) Constructor.- Parameters:
fundamentalMatrix
- fundamental matrix relating two views.listener
- listener to handle events raised by this instance.
-
-
Method Details
-
getMethod
Returns method used by this estimator.- Specified by:
getMethod
in classInitialCamerasEstimator
- Returns:
- method used by this estimator.
-
isReady
public boolean isReady()Indicates if estimator is ready.- Specified by:
isReady
in classInitialCamerasEstimator
- Returns:
- true if estimator is ready, false otherwise.
-
estimate
public void estimate() throws com.irurueta.geometry.estimators.LockedException, com.irurueta.geometry.estimators.NotReadyException, InitialCamerasEstimationFailedExceptionEstimates cameras.- Specified by:
estimate
in classInitialCamerasEstimator
- 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.
-
getAspectRatio
public double getAspectRatio()Gets aspect ratio of intrinsic parameters of cameras. Typically, this value is 1.0 if vertical coordinates increase upwards, or -1.0 if it is the opposite.- Returns:
- aspect ratio of intrinsic parameters of cameras.
-
setAspectRatio
public void setAspectRatio(double aspectRatio) throws com.irurueta.geometry.estimators.LockedException Sets aspect ratio of intrinsic parameters of cameras. Typically, this value is 1.0 if vertical coordinates increase upwards, or -1.0 if it is the opposite.- Parameters:
aspectRatio
- aspect ratio of intrinsic parameters of cameras.- Throws:
com.irurueta.geometry.estimators.LockedException
- if estimator is locked.
-
generateInitialMetricCamerasUsingDAQ
public static void generateInitialMetricCamerasUsingDAQ(FundamentalMatrix fundamentalMatrix, com.irurueta.geometry.PinholeCamera leftCamera, com.irurueta.geometry.PinholeCamera rightCamera) throws InitialCamerasEstimationFailedException Generates initial cameras in metric stratum (with arbitrary scale) using provided fundamental matrix by means of estimation of the Dual Absolute Quadric and the required projective to metric transformation.- Parameters:
fundamentalMatrix
- input fundamental matrix to estimate cameras.leftCamera
- instance where left camera will be stored.rightCamera
- instance where right camera will be stored.- Throws:
InitialCamerasEstimationFailedException
- if estimation fails.
-
generateInitialMetricCamerasUsingDAQ
public static void generateInitialMetricCamerasUsingDAQ(FundamentalMatrix fundamentalMatrix, double aspectRatio, com.irurueta.geometry.PinholeCamera leftCamera, com.irurueta.geometry.PinholeCamera rightCamera) throws InitialCamerasEstimationFailedException Generates initial cameras in metric stratum (with arbitrary scale) using provided fundamental matrix by means of estimation of the Dual Absolute Quadric and the required projective to metric transformation.- Parameters:
fundamentalMatrix
- input fundamental matrix to estimate cameras.aspectRatio
- aspect ratio of intrinsic parameters of cameras. Typically, this value is 1.0 if vertical coordinates increase upwards or -1.0 if it is the opposite.leftCamera
- instance where left camera will be stored.rightCamera
- instance where right camera will be stored.- Throws:
InitialCamerasEstimationFailedException
- if estimation fails.
-