Class SingleCorrector

java.lang.Object
com.irurueta.ar.epipolar.SingleCorrector
Direct Known Subclasses:
GoldStandardSingleCorrector, SampsonSingleCorrector

public abstract class SingleCorrector extends Object
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

    Fields
    Modifier and Type
    Field
    Description
    static final CorrectorType
    Default corrector type.
    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

    Constructors
    Modifier
    Constructor
    Description
    protected
    Constructor.
    protected
    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 Type
    Method
    Description
    abstract void
    Corrects the pair of provided matched points to be corrected.
    Creates an instance of a single corrector using default type.
    Creates an instance of a single corrector using provided type.
    create(FundamentalMatrix fundamentalMatrix)
    Creates an instance of a single corrector using provided fundamental matrix and default type.
    create(FundamentalMatrix fundamentalMatrix, CorrectorType type)
    Creates an instance of a single corrector using provided fundamental matrix and provided type.
    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.
    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.
    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.
    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
    Gets type of correction being used.
    boolean
    Indicates whether this instance is ready to correct provided left and right points using provided fundamental matrix.
    final void
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • DEFAULT_TYPE

      public static final CorrectorType DEFAULT_TYPE
      Default corrector type.
    • leftPoint

      protected com.irurueta.geometry.Point2D leftPoint
      Left matched point to be corrected.
    • rightPoint

      protected com.irurueta.geometry.Point2D rightPoint
      Right matched point to be corrected.
    • leftCorrectedPoint

      protected com.irurueta.geometry.Point2D leftCorrectedPoint
      Left matched point after correction.
    • rightCorrectedPoint

      protected com.irurueta.geometry.Point2D rightCorrectedPoint
      Right matched point after correction.
    • fundamentalMatrix

      protected FundamentalMatrix fundamentalMatrix
      A fundamental matrix defining an epipolar geometry.
  • Constructor Details

    • SingleCorrector

      protected SingleCorrector()
      Constructor.
    • SingleCorrector

      protected SingleCorrector(FundamentalMatrix fundamentalMatrix)
      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

      public final void setFundamentalMatrix(FundamentalMatrix fundamentalMatrix)
      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

      public FundamentalMatrix 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, CorrectionException
      Corrects 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

      public abstract CorrectorType getType()
      Gets type of correction being used.
      Returns:
      type of correction.
    • create

      public static SingleCorrector create(CorrectorType type)
      Creates an instance of a single corrector using provided type.
      Parameters:
      type - a corrector type.
      Returns:
      an instance of a single corrector.
    • create

      public static SingleCorrector create(FundamentalMatrix fundamentalMatrix, CorrectorType type)
      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

      public static SingleCorrector create()
      Creates an instance of a single corrector using default type.
      Returns:
      an instance of a single corrector.
    • create

      public static SingleCorrector create(FundamentalMatrix fundamentalMatrix)
      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.