Package com.irurueta.ar.epipolar
Class GoldStandardCorrector
java.lang.Object
com.irurueta.ar.epipolar.Corrector
com.irurueta.ar.epipolar.GoldStandardCorrector
Fixes matched pairs of points so that they perfectly follow a given epipolar
geometry.
When matching points typically the matching precision is about 1 pixel,
however this makes that matched points under a given epipolar geometry (i.e.
fundamental or essential matrix), do not lie perfectly on the corresponding
epipolar plane or epipolar liens.
The consequence is that triangularization of these matches will fail or
produce inaccurate results.
By fixing matched points using a corrector following a given epipolar
geometry, this effect is alleviated.
This corrector uses the Gold Standard method, which is more expensive to
compute than the Sampson approximation, but is capable to remove larger
errors assuming their gaussianity. Contrary to the Sampson corrector, the
Gold Standard method might fail in some situations, while in those cases
probably the Sampson corrector produces wrong results without failing.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final boolean
Indicates that correction must use Sampson method as a fallback if Gold Standard correction fails.private boolean
Indicates whether correction must use Sampson method as a fallback if Gold Standard correction fails.Fields inherited from class com.irurueta.ar.epipolar.Corrector
DEFAULT_PROGRESS_DELTA, DEFAULT_TYPE, fundamentalMatrix, leftCorrectedPoints, leftPoints, listener, locked, MAX_PROGRESS_DELTA, MIN_PROGRESS_DELTA, progressDelta, rightCorrectedPoints, rightPoints
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor.GoldStandardCorrector
(CorrectorListener listener) Constructor.GoldStandardCorrector
(FundamentalMatrix fundamentalMatrix) Constructor.GoldStandardCorrector
(FundamentalMatrix fundamentalMatrix, CorrectorListener listener) Constructor.GoldStandardCorrector
(List<com.irurueta.geometry.Point2D> leftPoints, List<com.irurueta.geometry.Point2D> rightPoints) Constructor.GoldStandardCorrector
(List<com.irurueta.geometry.Point2D> leftPoints, List<com.irurueta.geometry.Point2D> rightPoints, CorrectorListener listener) Constructor.GoldStandardCorrector
(List<com.irurueta.geometry.Point2D> leftPoints, List<com.irurueta.geometry.Point2D> rightPoints, FundamentalMatrix fundamentalMatrix) Constructor.GoldStandardCorrector
(List<com.irurueta.geometry.Point2D> leftPoints, List<com.irurueta.geometry.Point2D> rightPoints, FundamentalMatrix fundamentalMatrix, CorrectorListener listener) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
correct()
Corrects the lists of provided matched points to be corrected.getType()
Gets type of correction being used.boolean
Indicates whether correction must use Sampson method as a fallback if Gold Standard correction fails.void
setFallbackToSampsonEnabled
(boolean fallback) Sets boolean indicating whether correction must use Sampson method as a fallback if Gold Standard correction fails.Methods inherited from class com.irurueta.ar.epipolar.Corrector
areValidPoints, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, getFundamentalMatrix, getLeftCorrectedPoints, getLeftPoints, getListener, getProgressDelta, getRightCorrectedPoints, getRightPoints, isLocked, isReady, setFundamentalMatrix, setLeftAndRightPoints, setListener, setPointsAndFundamentalMatrix, setProgressDelta
-
Field Details
-
DEFAULT_FALLBACK_TO_SAMPSON_ENABLED
public static final boolean DEFAULT_FALLBACK_TO_SAMPSON_ENABLEDIndicates that correction must use Sampson method as a fallback if Gold Standard correction fails.- See Also:
-
fallbackToSampsonEnabled
private boolean fallbackToSampsonEnabledIndicates whether correction must use Sampson method as a fallback if Gold Standard correction fails.
-
-
Constructor Details
-
GoldStandardCorrector
public GoldStandardCorrector()Constructor. -
GoldStandardCorrector
Constructor.- Parameters:
fundamentalMatrix
- fundamental matrix to be set.
-
GoldStandardCorrector
public GoldStandardCorrector(List<com.irurueta.geometry.Point2D> leftPoints, List<com.irurueta.geometry.Point2D> rightPoints) Constructor.- Parameters:
leftPoints
- points to be corrected on left view.rightPoints
- points to be corrected on right view.- Throws:
IllegalArgumentException
- if provided lists of points don't have the same size.
-
GoldStandardCorrector
public GoldStandardCorrector(List<com.irurueta.geometry.Point2D> leftPoints, List<com.irurueta.geometry.Point2D> rightPoints, FundamentalMatrix fundamentalMatrix) Constructor.- Parameters:
leftPoints
- points to be corrected on left view.rightPoints
- points to be corrected on right view.fundamentalMatrix
- fundamental matrix to be set.- Throws:
IllegalArgumentException
- if provided lists of points don't have the same size.
-
GoldStandardCorrector
Constructor.- Parameters:
listener
- listener to handle events generated by this class.
-
GoldStandardCorrector
Constructor.- Parameters:
fundamentalMatrix
- fundamental matrix to be set.listener
- listener to handle events generated by this class.
-
GoldStandardCorrector
public GoldStandardCorrector(List<com.irurueta.geometry.Point2D> leftPoints, List<com.irurueta.geometry.Point2D> rightPoints, CorrectorListener listener) Constructor.- Parameters:
leftPoints
- points to be corrected on left view.rightPoints
- points to be corrected on right view.listener
- listener to handle events generated by this class.- Throws:
IllegalArgumentException
- if provided lists of points don't have the same size.
-
GoldStandardCorrector
public GoldStandardCorrector(List<com.irurueta.geometry.Point2D> leftPoints, List<com.irurueta.geometry.Point2D> rightPoints, FundamentalMatrix fundamentalMatrix, CorrectorListener listener) Constructor.- Parameters:
leftPoints
- points to be corrected on left view.rightPoints
- points to be corrected on right view.fundamentalMatrix
- fundamental matrix to be set.listener
- listener to handle events generated by this class.- Throws:
IllegalArgumentException
- if provided lists of points don't have the same size.
-
-
Method Details
-
isFallbackToSampsonEnabled
public boolean isFallbackToSampsonEnabled()Indicates whether correction must use Sampson method as a fallback if Gold Standard correction fails. If true, whenever the correction of a matched pair of points fails, its correction will be done with Sampson method instead. This allows to continue correcting all points at the expense of getting worse results in those points where Gold Standard method failed. If false, whenever a single pair of matched pair of points fails to be corrected, the algorithm stops and no points are corrected at all. By default, fallback is enabled.- Returns:
- true if fallback is enabled, false otherwise.
-
setFallbackToSampsonEnabled
public void setFallbackToSampsonEnabled(boolean fallback) throws com.irurueta.geometry.estimators.LockedException Sets boolean indicating whether correction must use Sampson method as a fallback if Gold Standard correction fails. If true, whenever the correction of a matched pair of points fails, its correction will be done with Sampson method instead. This allows to continue correcting all points at the expense of getting worse results in those points where Gold Standard method failed. If false, whenever a single pair of matched pair of points fails to be corrected, the algorithm stops and no points are corrected at all. By default, fallback is enabled.- Parameters:
fallback
- true to enable fallback, false otherwise.- Throws:
com.irurueta.geometry.estimators.LockedException
- if this instance is locked doing computations.
-
correct
public void correct() throws com.irurueta.geometry.estimators.NotReadyException, com.irurueta.geometry.estimators.LockedException, CorrectionExceptionCorrects the lists of provided matched points to be corrected.- Specified by:
correct
in classCorrector
- Throws:
com.irurueta.geometry.estimators.NotReadyException
- if this instance is not ready (either points or fundamental matrix has not been provided yet).com.irurueta.geometry.estimators.LockedException
- if this instance is locked doing computations.CorrectionException
- if correction fails.
-
getType
Gets type of correction being used.
-