Class InhomogeneousRightEpipoleRefiner
java.lang.Object
com.irurueta.geometry.refiners.Refiner<T>
com.irurueta.geometry.refiners.InliersDataRefiner<T>
com.irurueta.geometry.refiners.PairMatchesAndInliersDataRefiner<com.irurueta.geometry.Point2D,com.irurueta.geometry.Point2D,com.irurueta.geometry.Point2D>
com.irurueta.ar.epipolar.refiners.RightEpipoleRefiner
com.irurueta.ar.epipolar.refiners.InhomogeneousRightEpipoleRefiner
Refines the epipole of a fundamental matrix formed by an initial epipole
estimation and an estimated homography.
Any fundamental matrix can be expressed as F = [e']x*H, where
e' is the epipole on the right view, []x is the skew matrix, and H is a
non-degenerate homography.
This class refines an initial epipole so that residuals from provided point
correspondences generating fundamental matrix F are reduced.
This class is especially useful in cases where geometry of the scene is
degenerate (e.g. planar scene) and provided point correspondences would
generate an inaccurate fundamental matrix.
This implementation uses Levenberg-Marquardt algorithm for a fast cost
optimization and uses inhomogeneous points for epipole refinement,
which makes it unsuitable for cases when epipoles are at or near infinity
(i.e. pure lateral translations).
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Maximum allowed number of refinement iterations.Fields inherited from class com.irurueta.ar.epipolar.refiners.RightEpipoleRefiner
homography, testLine
Fields inherited from class com.irurueta.geometry.refiners.PairMatchesAndInliersDataRefiner
samples1, samples2
Fields inherited from class com.irurueta.geometry.refiners.InliersDataRefiner
inliers, numInliers, residuals
Fields inherited from class com.irurueta.geometry.refiners.Refiner
covariance, DEFAULT_KEEP_COVARIANCE, initialEstimation, keepCovariance, listener, locked
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor.InhomogeneousRightEpipoleRefiner
(com.irurueta.geometry.Point2D initialEpipoleEstimation, boolean keepCovariance, com.irurueta.numerical.robust.InliersData inliersData, List<com.irurueta.geometry.Point2D> samples1, List<com.irurueta.geometry.Point2D> samples2, double refinementStandardDeviation, com.irurueta.geometry.Transformation2D homography) Constructor.InhomogeneousRightEpipoleRefiner
(com.irurueta.geometry.Point2D initialEpipoleEstimation, boolean keepCovariance, BitSet inliers, double[] residuals, int numInliers, List<com.irurueta.geometry.Point2D> samples1, List<com.irurueta.geometry.Point2D> samples2, double refinementStandardDeviation, com.irurueta.geometry.Transformation2D homography) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionboolean
refine
(com.irurueta.geometry.Point2D result) Refines provided initial right epipole estimation.Methods inherited from class com.irurueta.ar.epipolar.refiners.RightEpipoleRefiner
computeFundamentalMatrix, getHomography, getRefinementStandardDeviation, isReady, refine, residual, setHomography, setRefinementStandardDeviation, totalResidual
Methods inherited from class com.irurueta.geometry.refiners.PairMatchesAndInliersDataRefiner
getSamples1, getSamples2, setSamples1, setSamples2
Methods inherited from class com.irurueta.geometry.refiners.InliersDataRefiner
getInliers, getNumInliers, getResiduals, getTotalSamples, setInliers, setInliersData, setNumInliers, setResiduals
Methods inherited from class com.irurueta.geometry.refiners.Refiner
getCovariance, getInitialEstimation, getListener, isCovarianceKept, isLocked, setCovarianceKept, setInitialEstimation, setListener
-
Field Details
-
MAX_ITERS
public static final int MAX_ITERSMaximum allowed number of refinement iterations.- See Also:
-
-
Constructor Details
-
InhomogeneousRightEpipoleRefiner
public InhomogeneousRightEpipoleRefiner()Constructor. -
InhomogeneousRightEpipoleRefiner
public InhomogeneousRightEpipoleRefiner(com.irurueta.geometry.Point2D initialEpipoleEstimation, boolean keepCovariance, BitSet inliers, double[] residuals, int numInliers, List<com.irurueta.geometry.Point2D> samples1, List<com.irurueta.geometry.Point2D> samples2, double refinementStandardDeviation, com.irurueta.geometry.Transformation2D homography) Constructor.- Parameters:
initialEpipoleEstimation
- initial right epipole estimation to be set and refined.keepCovariance
- true if covariance of estimation must be kept after refinement, false otherwise.inliers
- set indicating which of the provided matches are inliers.residuals
- residuals for matched samples.numInliers
- number of inliers on initial estimation.samples1
- 1st set of paired samples.samples2
- 2nd set of paired samples.refinementStandardDeviation
- standard deviation used for Levenberg-Marquardt fitting.homography
- homography relating samples in two views, which is used to generate a fundamental matrix and its corresponding epipolar geometry.
-
InhomogeneousRightEpipoleRefiner
public InhomogeneousRightEpipoleRefiner(com.irurueta.geometry.Point2D initialEpipoleEstimation, boolean keepCovariance, com.irurueta.numerical.robust.InliersData inliersData, List<com.irurueta.geometry.Point2D> samples1, List<com.irurueta.geometry.Point2D> samples2, double refinementStandardDeviation, com.irurueta.geometry.Transformation2D homography) Constructor.- Parameters:
initialEpipoleEstimation
- initial right epipole estimation to be set and refined.keepCovariance
- true if covariance of estimation must be kept after refinement, false otherwise.inliersData
- inlier data, typically obtained from a robust estimator.samples1
- 1st set of paired samples.samples2
- 2nd set of paired samples.refinementStandardDeviation
- standard deviation used for Levenberg-Marquardt fitting.homography
- homography relating samples in two views, which is used to generate a fundamental matrix and its corresponding epipolar geometry.
-
-
Method Details
-
refine
public boolean refine(com.irurueta.geometry.Point2D result) throws com.irurueta.geometry.estimators.NotReadyException, com.irurueta.geometry.estimators.LockedException, com.irurueta.geometry.refiners.RefinerException Refines provided initial right epipole estimation. This method always sets a value into provided result instance regardless of the fact that error has actually improved in LMSE terms or not.- Specified by:
refine
in classcom.irurueta.geometry.refiners.Refiner<com.irurueta.geometry.Point2D>
- Parameters:
result
- instance where refined estimation will be stored.- Returns:
- true if result improves (decreases) in LMSE terms respect to initial estimation, false if no improvement has been achieved.
- Throws:
com.irurueta.geometry.estimators.NotReadyException
- if not enough input data has been provided.com.irurueta.geometry.estimators.LockedException
- if estimator is locked because refinement is already in progress.com.irurueta.geometry.refiners.RefinerException
- if refinement fails for some reason (e.g. unable to converge to a result).
-