Class SampsonSingleCorrector

java.lang.Object
com.irurueta.ar.epipolar.SingleCorrector
com.irurueta.ar.epipolar.SampsonSingleCorrector

public class SampsonSingleCorrector extends SingleCorrector
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).
  • Constructor Details

    • SampsonSingleCorrector

      public SampsonSingleCorrector()
      Constructor.
    • SampsonSingleCorrector

      public SampsonSingleCorrector(FundamentalMatrix fundamentalMatrix)
      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.NotReadyException
      Corrects the pair of provided matched points to be corrected.
      Specified by:
      correct in class SingleCorrector
      Throws:
      com.irurueta.geometry.estimators.NotReadyException - if this instance is not ready (either points or fundamental matrix has not been provided yet).
    • getType

      public CorrectorType getType()
      Gets type of correction being used.
      Specified by:
      getType in class SingleCorrector
      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.