Package com.irurueta.ar.epipolar
Class SampsonSingleCorrector
java.lang.Object
com.irurueta.ar.epipolar.SingleCorrector
com.irurueta.ar.epipolar.SampsonSingleCorrector
Fixes a single matched pair of points so that they perfectly follow a given
epipolar geometry using the Sampson approximation.
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 Sampson approximation which is capable to remove
small errors when matches are close to their real epipolar lines. This method
is faster than the Gold standard method, but can only correct small errors
(1 or 2 pixels).
-
Field Summary
Fields inherited from class com.irurueta.ar.epipolar.SingleCorrector
DEFAULT_TYPE, fundamentalMatrix, leftCorrectedPoint, leftPoint, rightCorrectedPoint, rightPoint
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor.SampsonSingleCorrector
(FundamentalMatrix fundamentalMatrix) Constructor.SampsonSingleCorrector
(com.irurueta.geometry.Point2D leftPoint, com.irurueta.geometry.Point2D rightPoint) Constructor.SampsonSingleCorrector
(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.protected 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, com.irurueta.geometry.Line2D leftEpipolarLine, com.irurueta.geometry.Line2D rightEpipolarLine) 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.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
-
Constructor Details
-
SampsonSingleCorrector
public SampsonSingleCorrector()Constructor. -
SampsonSingleCorrector
Constructor.- Parameters:
fundamentalMatrix
- fundamental matrix defining the epipolar geometry.
-
SampsonSingleCorrector
public SampsonSingleCorrector(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.
-
SampsonSingleCorrector
public SampsonSingleCorrector(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.NotReadyExceptionCorrects 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).
-
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 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.
-
correct
protected 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, com.irurueta.geometry.Line2D leftEpipolarLine, com.irurueta.geometry.Line2D rightEpipolarLine) throws com.irurueta.geometry.estimators.NotReadyException Corrects the pair of provided matched points to be corrected using provided fundamental matrix and stores the corrected points into provided instances. Provided epipolar lines are used for memory efficiency purposes only, so that those instances can be reused.- 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.leftEpipolarLine
- left epipolar line to be reused for memory efficiency purposes.rightEpipolarLine
- right epipolar line to be reused for memory efficiency purposes.- Throws:
com.irurueta.geometry.estimators.NotReadyException
- if provided fundamental matrix is not ready.
-