Package com.irurueta.ar.epipolar
Class SingleCorrector
java.lang.Object
com.irurueta.ar.epipolar.SingleCorrector
- Direct Known Subclasses:
GoldStandardSingleCorrector
,SampsonSingleCorrector
Fixes a single matched pair 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 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 is an abstract class, subclasses will implement different methods to
fix matched points coordinates
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final CorrectorType
Default corrector type.protected FundamentalMatrix
A fundamental matrix defining an epipolar geometry.protected com.irurueta.geometry.Point2D
Left matched point after correction.protected com.irurueta.geometry.Point2D
Left matched point to be corrected.protected com.irurueta.geometry.Point2D
Right matched point after correction.protected com.irurueta.geometry.Point2D
Right matched point to be corrected. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Constructor.protected
SingleCorrector
(FundamentalMatrix fundamentalMatrix) Constructor.protected
SingleCorrector
(com.irurueta.geometry.Point2D leftPoint, com.irurueta.geometry.Point2D rightPoint) Constructor.protected
SingleCorrector
(com.irurueta.geometry.Point2D leftPoint, com.irurueta.geometry.Point2D rightPoint, FundamentalMatrix fundamentalMatrix) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionabstract void
correct()
Corrects the pair of provided matched points to be corrected.static SingleCorrector
create()
Creates an instance of a single corrector using default type.static SingleCorrector
create
(CorrectorType type) Creates an instance of a single corrector using provided type.static SingleCorrector
create
(FundamentalMatrix fundamentalMatrix) Creates an instance of a single corrector using provided fundamental matrix and default type.static SingleCorrector
create
(FundamentalMatrix fundamentalMatrix, CorrectorType type) Creates an instance of a single corrector using provided fundamental matrix and provided type.static SingleCorrector
create
(com.irurueta.geometry.Point2D leftPoint, com.irurueta.geometry.Point2D rightPoint) Creates an instance of a single corrector using provided left and right points to be corrected.static SingleCorrector
create
(com.irurueta.geometry.Point2D leftPoint, com.irurueta.geometry.Point2D rightPoint, CorrectorType type) Creates an instance of a single corrector using provided left and right points to be corrected, and provided type.static SingleCorrector
create
(com.irurueta.geometry.Point2D leftPoint, com.irurueta.geometry.Point2D rightPoint, FundamentalMatrix fundamentalMatrix) Creates an instance of a single corrector using provided left and right points to be corrected, provided fundamental matrix and default type.static SingleCorrector
create
(com.irurueta.geometry.Point2D leftPoint, com.irurueta.geometry.Point2D rightPoint, FundamentalMatrix fundamentalMatrix, CorrectorType type) Creates an instance of a single corrector using provided left and right points to be corrected, fundamental matrix and provided type.Returns fundamental matrix defining epipolar geometry.com.irurueta.geometry.Point2D
Returns matched point on left view after correction.com.irurueta.geometry.Point2D
Returns matched point on left view.com.irurueta.geometry.Point2D
Returns matched point on right view after correction.com.irurueta.geometry.Point2D
Returns matched point on right view.abstract CorrectorType
getType()
Gets type of correction being used.boolean
isReady()
Indicates whether this instance is ready to correct provided left and right points using provided fundamental matrix.final void
setFundamentalMatrix
(FundamentalMatrix fundamentalMatrix) Sets the fundamental matrix defining the epipolar geometry.final void
setPoints
(com.irurueta.geometry.Point2D leftPoint, com.irurueta.geometry.Point2D rightPoint) Sets a matched pair of points to be corrected.final void
setPointsAndFundamentalMatrix
(com.irurueta.geometry.Point2D leftPoint, com.irurueta.geometry.Point2D rightPoint, FundamentalMatrix fundamentalMatrix) Sets a matched pair of points to be corrected and a fundamental matrix defining the epipolar geometry.
-
Field Details
-
DEFAULT_TYPE
Default corrector type. -
leftPoint
protected com.irurueta.geometry.Point2D leftPointLeft matched point to be corrected. -
rightPoint
protected com.irurueta.geometry.Point2D rightPointRight matched point to be corrected. -
leftCorrectedPoint
protected com.irurueta.geometry.Point2D leftCorrectedPointLeft matched point after correction. -
rightCorrectedPoint
protected com.irurueta.geometry.Point2D rightCorrectedPointRight matched point after correction. -
fundamentalMatrix
A fundamental matrix defining an epipolar geometry.
-
-
Constructor Details
-
SingleCorrector
protected SingleCorrector()Constructor. -
SingleCorrector
Constructor.- Parameters:
fundamentalMatrix
- fundamental matrix defining the epipolar geometry.
-
SingleCorrector
protected SingleCorrector(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.
-
SingleCorrector
protected SingleCorrector(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
-
setPointsAndFundamentalMatrix
public final void setPointsAndFundamentalMatrix(com.irurueta.geometry.Point2D leftPoint, com.irurueta.geometry.Point2D rightPoint, FundamentalMatrix fundamentalMatrix) Sets a matched pair of points to be corrected and a fundamental matrix defining the epipolar geometry.- 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.
-
setPoints
public final void setPoints(com.irurueta.geometry.Point2D leftPoint, com.irurueta.geometry.Point2D rightPoint) Sets a matched pair of points to be corrected.- Parameters:
leftPoint
- matched point on left view to be corrected.rightPoint
- matched point on right view to be corrected.
-
setFundamentalMatrix
Sets the fundamental matrix defining the epipolar geometry.- Parameters:
fundamentalMatrix
- fundamental matrix to be set.
-
getLeftPoint
public com.irurueta.geometry.Point2D getLeftPoint()Returns matched point on left view.- Returns:
- matched point on left view.
-
getRightPoint
public com.irurueta.geometry.Point2D getRightPoint()Returns matched point on right view.- Returns:
- matched point on right view.
-
getFundamentalMatrix
Returns fundamental matrix defining epipolar geometry.- Returns:
- fundamental matrix defining epipolar geometry.
-
isReady
public boolean isReady()Indicates whether this instance is ready to correct provided left and right points using provided fundamental matrix.- Returns:
- true if ready, false otherwise.
-
getLeftCorrectedPoint
public com.irurueta.geometry.Point2D getLeftCorrectedPoint()Returns matched point on left view after correction.- Returns:
- matched point on left view after correction.
-
getRightCorrectedPoint
public com.irurueta.geometry.Point2D getRightCorrectedPoint()Returns matched point on right view after correction.- Returns:
- matched point on right view after correction.
-
correct
public abstract void correct() throws com.irurueta.geometry.estimators.NotReadyException, CorrectionExceptionCorrects the pair of provided matched points to be corrected.- 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.- Returns:
- type of correction.
-
create
Creates an instance of a single corrector using provided type.- Parameters:
type
- a corrector type.- Returns:
- an instance of a single corrector.
-
create
Creates an instance of a single corrector using provided fundamental matrix and provided type.- Parameters:
fundamentalMatrix
- fundamental matrix defining the epipolar geometry.type
- a corrector type.- Returns:
- an instance of a single corrector.
-
create
public static SingleCorrector create(com.irurueta.geometry.Point2D leftPoint, com.irurueta.geometry.Point2D rightPoint, CorrectorType type) Creates an instance of a single corrector using provided left and right points to be corrected, and provided type.- Parameters:
leftPoint
- matched point on left view to be corrected.rightPoint
- matched point on right view to be corrected.type
- a corrector type.- Returns:
- an instance of a single corrector.
-
create
public static SingleCorrector create(com.irurueta.geometry.Point2D leftPoint, com.irurueta.geometry.Point2D rightPoint, FundamentalMatrix fundamentalMatrix, CorrectorType type) Creates an instance of a single corrector using provided left and right points to be corrected, fundamental matrix and provided type.- Parameters:
leftPoint
- matched point on left view to be corrected.rightPoint
- matched point on right view to be corrected.fundamentalMatrix
- fundamental matrix defining the epipolar geometry.type
- a corrector type.- Returns:
- an instance of a single corrector.
-
create
Creates an instance of a single corrector using default type.- Returns:
- an instance of a single corrector.
-
create
Creates an instance of a single corrector using provided fundamental matrix and default type.- Parameters:
fundamentalMatrix
- fundamental matrix defining the epipolar geometry.- Returns:
- an instance of a single corrector.
-
create
public static SingleCorrector create(com.irurueta.geometry.Point2D leftPoint, com.irurueta.geometry.Point2D rightPoint) Creates an instance of a single corrector using provided left and right points to be corrected.- Parameters:
leftPoint
- matched point on left view to be corrected.rightPoint
- matched point on right view to be corrected.- Returns:
- an instance of a single corrector.
-
create
public static SingleCorrector create(com.irurueta.geometry.Point2D leftPoint, com.irurueta.geometry.Point2D rightPoint, FundamentalMatrix fundamentalMatrix) Creates an instance of a single corrector using provided left and right points to be corrected, provided fundamental matrix and default type.- Parameters:
leftPoint
- matched point on left view to be corrected.rightPoint
- matched point on right view to be corrected.fundamentalMatrix
- fundamental matrix defining the epipolar geometry.- Returns:
- an instance of a single corrector.
-