Package com.irurueta.ar.epipolar
Class GoldStandardSingleCorrector
java.lang.Object
com.irurueta.ar.epipolar.SingleCorrector
com.irurueta.ar.epipolar.GoldStandardSingleCorrector
Fixes a single matched pair of points so that they perfectly follow a given
epipolar geometry using the Gold Standard method, which is capable to
completely remove errors assuming their gaussianity.
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 lines.
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
FieldsFields inherited from class com.irurueta.ar.epipolar.SingleCorrector
DEFAULT_TYPE, fundamentalMatrix, leftCorrectedPoint, leftPoint, rightCorrectedPoint, rightPoint
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor.GoldStandardSingleCorrector
(FundamentalMatrix fundamentalMatrix) Constructor.GoldStandardSingleCorrector
(com.irurueta.geometry.Point2D leftPoint, com.irurueta.geometry.Point2D rightPoint) Constructor.GoldStandardSingleCorrector
(com.irurueta.geometry.Point2D leftPoint, com.irurueta.geometry.Point2D rightPoint, FundamentalMatrix fundamentalMatrix) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
correct()
Corrects the pair of provided matched points to be corrected.static void
correct
(com.irurueta.geometry.Point2D leftPoint, com.irurueta.geometry.Point2D rightPoint, FundamentalMatrix fundamentalMatrix, com.irurueta.geometry.Point2D correctedLeftPoint, com.irurueta.geometry.Point2D correctedRightPoint) Corrects the pair of provided matched points to be corrected using provided fundamental matrix and stores the corrected points into provided instances.getType()
Gets type of correction being used.private static double
s
(double t, double a, double b, double c, double d, double f1, double f2) Evaluates polynomial to be minimized in order to find best corrected points.Methods inherited from class com.irurueta.ar.epipolar.SingleCorrector
create, create, create, create, create, create, create, create, getFundamentalMatrix, getLeftCorrectedPoint, getLeftPoint, getRightCorrectedPoint, getRightPoint, isReady, setFundamentalMatrix, setPoints, setPointsAndFundamentalMatrix
-
Field Details
-
EPS
private static final double EPSA tiny value.- See Also:
-
-
Constructor Details
-
GoldStandardSingleCorrector
public GoldStandardSingleCorrector()Constructor. -
GoldStandardSingleCorrector
Constructor.- Parameters:
fundamentalMatrix
- fundamental matrix defining the epipolar geometry.
-
GoldStandardSingleCorrector
public GoldStandardSingleCorrector(com.irurueta.geometry.Point2D leftPoint, com.irurueta.geometry.Point2D rightPoint) Constructor.- Parameters:
leftPoint
- matched point on left view to be corrected.rightPoint
- matched point on right view to be corrected.
-
GoldStandardSingleCorrector
public GoldStandardSingleCorrector(com.irurueta.geometry.Point2D leftPoint, com.irurueta.geometry.Point2D rightPoint, FundamentalMatrix fundamentalMatrix) Constructor.- Parameters:
leftPoint
- matched point on left view to be corrected.rightPoint
- matched point on right view to be corrected.fundamentalMatrix
- fundamental matrix defining an epipolar geometry.
-
-
Method Details
-
correct
public void correct() throws com.irurueta.geometry.estimators.NotReadyException, CorrectionExceptionCorrects the pair of provided matched points to be corrected.- Specified by:
correct
in classSingleCorrector
- Throws:
com.irurueta.geometry.estimators.NotReadyException
- if this instance is not ready (either points or fundamental matrix has not been provided yet).CorrectionException
- if correction fails.
-
getType
Gets type of correction being used.- Specified by:
getType
in classSingleCorrector
- Returns:
- type of correction.
-
correct
public static void correct(com.irurueta.geometry.Point2D leftPoint, com.irurueta.geometry.Point2D rightPoint, FundamentalMatrix fundamentalMatrix, com.irurueta.geometry.Point2D correctedLeftPoint, com.irurueta.geometry.Point2D correctedRightPoint) throws com.irurueta.geometry.estimators.NotReadyException, CorrectionException Corrects the pair of provided matched points to be corrected using provided fundamental matrix and stores the corrected points into provided instances.- Parameters:
leftPoint
- point on left view to be corrected.rightPoint
- point on right view to be corrected.fundamentalMatrix
- fundamental matrix defining the epipolar geometry.correctedLeftPoint
- point on left view after correction.correctedRightPoint
- point on right view after correction.- Throws:
com.irurueta.geometry.estimators.NotReadyException
- if provided fundamental matrix is not ready.CorrectionException
- if correction fails.
-
s
private static double s(double t, double a, double b, double c, double d, double f1, double f2) Evaluates polynomial to be minimized in order to find best corrected points.- Parameters:
t
- polynomial variable.a
- a value for transformed fundamental matrix.b
- b value for transformed fundamental matrix.c
- c value for transformed fundamental matrix.d
- d value for transformed fundamental matrix.f1
- f1 value for transformed fundamental matrix.f2
- f2 value for transformed fundamental matrix.- Returns:
- evaluated polynomial value.
-