Class GoldStandardCorrector

java.lang.Object
com.irurueta.ar.epipolar.Corrector
com.irurueta.ar.epipolar.GoldStandardCorrector

public class GoldStandardCorrector extends Corrector
Fixes matched pairs 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 liens. 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

    • DEFAULT_FALLBACK_TO_SAMPSON_ENABLED

      public static final boolean DEFAULT_FALLBACK_TO_SAMPSON_ENABLED
      Indicates that correction must use Sampson method as a fallback if Gold Standard correction fails.
      See Also:
    • fallbackToSampsonEnabled

      private boolean fallbackToSampsonEnabled
      Indicates whether correction must use Sampson method as a fallback if Gold Standard correction fails.
  • Constructor Details

    • GoldStandardCorrector

      public GoldStandardCorrector()
      Constructor.
    • GoldStandardCorrector

      public GoldStandardCorrector(FundamentalMatrix fundamentalMatrix)
      Constructor.
      Parameters:
      fundamentalMatrix - fundamental matrix to be set.
    • GoldStandardCorrector

      public GoldStandardCorrector(List<com.irurueta.geometry.Point2D> leftPoints, List<com.irurueta.geometry.Point2D> rightPoints)
      Constructor.
      Parameters:
      leftPoints - points to be corrected on left view.
      rightPoints - points to be corrected on right view.
      Throws:
      IllegalArgumentException - if provided lists of points don't have the same size.
    • GoldStandardCorrector

      public GoldStandardCorrector(List<com.irurueta.geometry.Point2D> leftPoints, List<com.irurueta.geometry.Point2D> rightPoints, FundamentalMatrix fundamentalMatrix)
      Constructor.
      Parameters:
      leftPoints - points to be corrected on left view.
      rightPoints - points to be corrected on right view.
      fundamentalMatrix - fundamental matrix to be set.
      Throws:
      IllegalArgumentException - if provided lists of points don't have the same size.
    • GoldStandardCorrector

      public GoldStandardCorrector(CorrectorListener listener)
      Constructor.
      Parameters:
      listener - listener to handle events generated by this class.
    • GoldStandardCorrector

      public GoldStandardCorrector(FundamentalMatrix fundamentalMatrix, CorrectorListener listener)
      Constructor.
      Parameters:
      fundamentalMatrix - fundamental matrix to be set.
      listener - listener to handle events generated by this class.
    • GoldStandardCorrector

      public GoldStandardCorrector(List<com.irurueta.geometry.Point2D> leftPoints, List<com.irurueta.geometry.Point2D> rightPoints, CorrectorListener listener)
      Constructor.
      Parameters:
      leftPoints - points to be corrected on left view.
      rightPoints - points to be corrected on right view.
      listener - listener to handle events generated by this class.
      Throws:
      IllegalArgumentException - if provided lists of points don't have the same size.
    • GoldStandardCorrector

      public GoldStandardCorrector(List<com.irurueta.geometry.Point2D> leftPoints, List<com.irurueta.geometry.Point2D> rightPoints, FundamentalMatrix fundamentalMatrix, CorrectorListener listener)
      Constructor.
      Parameters:
      leftPoints - points to be corrected on left view.
      rightPoints - points to be corrected on right view.
      fundamentalMatrix - fundamental matrix to be set.
      listener - listener to handle events generated by this class.
      Throws:
      IllegalArgumentException - if provided lists of points don't have the same size.
  • Method Details

    • isFallbackToSampsonEnabled

      public boolean isFallbackToSampsonEnabled()
      Indicates whether correction must use Sampson method as a fallback if Gold Standard correction fails. If true, whenever the correction of a matched pair of points fails, its correction will be done with Sampson method instead. This allows to continue correcting all points at the expense of getting worse results in those points where Gold Standard method failed. If false, whenever a single pair of matched pair of points fails to be corrected, the algorithm stops and no points are corrected at all. By default, fallback is enabled.
      Returns:
      true if fallback is enabled, false otherwise.
    • setFallbackToSampsonEnabled

      public void setFallbackToSampsonEnabled(boolean fallback) throws com.irurueta.geometry.estimators.LockedException
      Sets boolean indicating whether correction must use Sampson method as a fallback if Gold Standard correction fails. If true, whenever the correction of a matched pair of points fails, its correction will be done with Sampson method instead. This allows to continue correcting all points at the expense of getting worse results in those points where Gold Standard method failed. If false, whenever a single pair of matched pair of points fails to be corrected, the algorithm stops and no points are corrected at all. By default, fallback is enabled.
      Parameters:
      fallback - true to enable fallback, false otherwise.
      Throws:
      com.irurueta.geometry.estimators.LockedException - if this instance is locked doing computations.
    • correct

      public void correct() throws com.irurueta.geometry.estimators.NotReadyException, com.irurueta.geometry.estimators.LockedException, CorrectionException
      Corrects the lists of provided matched points to be corrected.
      Specified by:
      correct in class Corrector
      Throws:
      com.irurueta.geometry.estimators.NotReadyException - if this instance is not ready (either points or fundamental matrix has not been provided yet).
      com.irurueta.geometry.estimators.LockedException - if this instance is locked doing computations.
      CorrectionException - if correction fails.
    • getType

      public CorrectorType getType()
      Gets type of correction being used.
      Specified by:
      getType in class Corrector
      Returns:
      type of correction.