Class GoldStandardSingleCorrector

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

public class GoldStandardSingleCorrector extends SingleCorrector
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 Details

  • Constructor Details

    • GoldStandardSingleCorrector

      public GoldStandardSingleCorrector()
      Constructor.
    • GoldStandardSingleCorrector

      public GoldStandardSingleCorrector(FundamentalMatrix fundamentalMatrix)
      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, CorrectionException
      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).
      CorrectionException - if correction fails.
    • 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, 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.