Class PlanarFundamentalMatrixEstimator
java.lang.Object
com.irurueta.ar.epipolar.estimators.PlanarFundamentalMatrixEstimator
This class takes an input 2D homography (e.g. transformation) and a given
pair of intrinsic parameters for left and right views, and estimates all
possible fundamental matrices generating such homography in a planar scene.
This estimator will generate either 2 or 4 possible solutions, however only
1 solution will be physically possible, which corresponds to the solution
that generates triangulated points located in front of the cameras generating
such epipolar geometries.
This class is useful in planar scenes where 8-point and 7-point algorithms
will fail since this kind of geometry is a degenerate configuration of
points.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate com.irurueta.geometry.Transformation2D
2D transformation relating two views (left view to right view).private com.irurueta.geometry.PinholeCameraIntrinsicParameters
Intrinsic parameters to be used on left view.Listener to attend events generated by this instance.private boolean
Indicates whether estimator is locked while estimating fundamental matrix.private com.irurueta.geometry.PinholeCameraIntrinsicParameters
Intrinsic parameters to be used on right view. -
Constructor Summary
ConstructorsConstructorDescriptionConstructor.PlanarFundamentalMatrixEstimator
(com.irurueta.geometry.Transformation2D homography, com.irurueta.geometry.PinholeCameraIntrinsicParameters leftIntrinsics, com.irurueta.geometry.PinholeCameraIntrinsicParameters rightIntrinsics) Constructor.PlanarFundamentalMatrixEstimator
(com.irurueta.geometry.Transformation2D homography, com.irurueta.geometry.PinholeCameraIntrinsicParameters leftIntrinsics, com.irurueta.geometry.PinholeCameraIntrinsicParameters rightIntrinsics, PlanarFundamentalMatrixEstimatorListener listener) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionestimate()
Estimates fundamental matrices and returns the estimated result.void
estimate
(List<FundamentalMatrix> result) Estimates fundamental matrices and stores result into provided instance.com.irurueta.geometry.Transformation2D
Gets 2D transformation relating two views (left view to right view).com.irurueta.geometry.PinholeCameraIntrinsicParameters
Gets intrinsic parameters to be used on left view.Gets listener to attend events generated by this instance.com.irurueta.geometry.PinholeCameraIntrinsicParameters
Gets intrinsic parameters to be used on right view.boolean
isLocked()
Indicates whether estimator is locked while estimating fundamental matrix.boolean
isReady()
Indicates whether estimator is ready to start the estimation when all required data has been provided.void
setHomography
(com.irurueta.geometry.Transformation2D homography) Sets 2D transformation relating two views (left view to right view).void
setLeftIntrinsics
(com.irurueta.geometry.PinholeCameraIntrinsicParameters leftIntrinsics) Sets intrinsic parameters to be used on left view.void
Sets listener to attend events generated by this instance.void
setRightIntrinsics
(com.irurueta.geometry.PinholeCameraIntrinsicParameters rightIntrinsics) Sets intrinsic parameters to be used on right view.
-
Field Details
-
homography
private com.irurueta.geometry.Transformation2D homography2D transformation relating two views (left view to right view). -
leftIntrinsics
private com.irurueta.geometry.PinholeCameraIntrinsicParameters leftIntrinsicsIntrinsic parameters to be used on left view. -
rightIntrinsics
private com.irurueta.geometry.PinholeCameraIntrinsicParameters rightIntrinsicsIntrinsic parameters to be used on right view. -
listener
Listener to attend events generated by this instance. -
locked
private boolean lockedIndicates whether estimator is locked while estimating fundamental matrix.
-
-
Constructor Details
-
PlanarFundamentalMatrixEstimator
public PlanarFundamentalMatrixEstimator()Constructor. -
PlanarFundamentalMatrixEstimator
public PlanarFundamentalMatrixEstimator(com.irurueta.geometry.Transformation2D homography, com.irurueta.geometry.PinholeCameraIntrinsicParameters leftIntrinsics, com.irurueta.geometry.PinholeCameraIntrinsicParameters rightIntrinsics) Constructor.- Parameters:
homography
- 2D transformation relating two views (left view to right view).leftIntrinsics
- intrinsic parameters to be used on left view.rightIntrinsics
- intrinsic parameters to be used on right view.
-
PlanarFundamentalMatrixEstimator
public PlanarFundamentalMatrixEstimator(com.irurueta.geometry.Transformation2D homography, com.irurueta.geometry.PinholeCameraIntrinsicParameters leftIntrinsics, com.irurueta.geometry.PinholeCameraIntrinsicParameters rightIntrinsics, PlanarFundamentalMatrixEstimatorListener listener) Constructor.- Parameters:
homography
- 2D transformation relating two views (left view to right view).leftIntrinsics
- intrinsic parameters to be used on left view.rightIntrinsics
- intrinsic parameters to be used on right view.listener
- listener to attend events generated by this instance.
-
-
Method Details
-
getHomography
public com.irurueta.geometry.Transformation2D getHomography()Gets 2D transformation relating two views (left view to right view).- Returns:
- 2D transformation relating two views.
-
setHomography
public void setHomography(com.irurueta.geometry.Transformation2D homography) throws com.irurueta.geometry.estimators.LockedException Sets 2D transformation relating two views (left view to right view).- Parameters:
homography
- 2D transformation relating two views.- Throws:
com.irurueta.geometry.estimators.LockedException
- if estimator is locked.
-
getLeftIntrinsics
public com.irurueta.geometry.PinholeCameraIntrinsicParameters getLeftIntrinsics()Gets intrinsic parameters to be used on left view.- Returns:
- intrinsic parameters to be used on left view.
-
setLeftIntrinsics
public void setLeftIntrinsics(com.irurueta.geometry.PinholeCameraIntrinsicParameters leftIntrinsics) throws com.irurueta.geometry.estimators.LockedException Sets intrinsic parameters to be used on left view.- Parameters:
leftIntrinsics
- intrinsic parameters to be used on left view.- Throws:
com.irurueta.geometry.estimators.LockedException
- if estimator is locked.
-
getRightIntrinsics
public com.irurueta.geometry.PinholeCameraIntrinsicParameters getRightIntrinsics()Gets intrinsic parameters to be used on right view.- Returns:
- intrinsic parameters to be used on right view.
-
setRightIntrinsics
public void setRightIntrinsics(com.irurueta.geometry.PinholeCameraIntrinsicParameters rightIntrinsics) throws com.irurueta.geometry.estimators.LockedException Sets intrinsic parameters to be used on right view.- Parameters:
rightIntrinsics
- intrinsic parameters to be used on right view.- Throws:
com.irurueta.geometry.estimators.LockedException
- if estimator is locked.
-
getListener
Gets listener to attend events generated by this instance.- Returns:
- listener to attend events generated by this instance.
-
setListener
Sets listener to attend events generated by this instance.- Parameters:
listener
- listener to attend events generated by this instance.
-
isLocked
public boolean isLocked()Indicates whether estimator is locked while estimating fundamental matrix.- Returns:
- true if estimator is locked, false otherwise.
-
isReady
public boolean isReady()Indicates whether estimator is ready to start the estimation when all required data has been provided.- Returns:
- true if estimator is ready, false otherwise.
-
estimate
public List<FundamentalMatrix> estimate() throws com.irurueta.geometry.estimators.LockedException, com.irurueta.geometry.estimators.NotReadyException, FundamentalMatrixEstimatorExceptionEstimates fundamental matrices and returns the estimated result.- Returns:
- estimated fundamental matrices.
- Throws:
com.irurueta.geometry.estimators.LockedException
- if estimator is locked.com.irurueta.geometry.estimators.NotReadyException
- if estimator is not ready.FundamentalMatrixEstimatorException
- if estimation fails for some reason.
-
estimate
public void estimate(List<FundamentalMatrix> result) throws com.irurueta.geometry.estimators.LockedException, com.irurueta.geometry.estimators.NotReadyException, FundamentalMatrixEstimatorException Estimates fundamental matrices and stores result into provided instance.- Parameters:
result
- instance where result will be stored.- Throws:
com.irurueta.geometry.estimators.LockedException
- if estimator is locked.com.irurueta.geometry.estimators.NotReadyException
- if estimator is not ready.FundamentalMatrixEstimatorException
- if estimation fails for some reason.
-