Class PROSACPolynomialRobustEstimator

java.lang.Object
com.irurueta.numerical.polynomials.estimators.PolynomialRobustEstimator
com.irurueta.numerical.polynomials.estimators.PROSACPolynomialRobustEstimator

public class PROSACPolynomialRobustEstimator extends PolynomialRobustEstimator
Finds the best polynomial using PROSAC algorithm.
  • Field Details

    • DEFAULT_THRESHOLD

      public static final double DEFAULT_THRESHOLD
      Constant defining default threshold to determine whether polynomials are inliers or not. Threshold will be used to compare either algebraic or geometric distance of estimated polynomial respect each provided evaluation.
      See Also:
    • MIN_THRESHOLD

      public static final double MIN_THRESHOLD
      Minimum value that can be set as threshold. Threshold must be strictly greater than 0.0.
      See Also:
    • threshold

      private double threshold
      Threshold to determine whether polynomial evaluations are inlers or not when testing possible estimation solutions
    • qualityScores

      private double[] qualityScores
      Quality scores corresponding to each provided polynomial evaluation. The larger the score value the better the quality of the sample.
  • Constructor Details

    • PROSACPolynomialRobustEstimator

      public PROSACPolynomialRobustEstimator()
      Constructor.
    • PROSACPolynomialRobustEstimator

      public PROSACPolynomialRobustEstimator(int degree)
      Constructor.
      Parameters:
      degree - degree of polynomial to be estimated.
      Throws:
      IllegalArgumentException - if provided degree is less than 1.
    • PROSACPolynomialRobustEstimator

      public PROSACPolynomialRobustEstimator(List<PolynomialEvaluation> evaluations)
      Constructor.
      Parameters:
      evaluations - collection of polynomial evaluations.
      Throws:
      IllegalArgumentException - if provided number of evaluations is less than the required minimum.
    • PROSACPolynomialRobustEstimator

      public PROSACPolynomialRobustEstimator(PolynomialRobustEstimatorListener listener)
      Constructor.
      Parameters:
      listener - listener to be notified of events such as when estimation starts, ends or its progress significantly changes.
    • PROSACPolynomialRobustEstimator

      public PROSACPolynomialRobustEstimator(int degree, List<PolynomialEvaluation> evaluations)
      Constructor.
      Parameters:
      degree - degree of polynomial to be estimated.
      evaluations - collection of polynomial evaluations.
      Throws:
      IllegalArgumentException - if provided degree is less than 1 or if provided number of evaluations is less than the required minimum for provided degree.
    • PROSACPolynomialRobustEstimator

      public PROSACPolynomialRobustEstimator(int degree, PolynomialRobustEstimatorListener listener)
      Constructor.
      Parameters:
      degree - degree of polynomial to be estimated.
      listener - listener to be notified of events such as when estimation starts, ends or its progress significantly changes.
      Throws:
      IllegalArgumentException - if provided degree is less than 1.
    • PROSACPolynomialRobustEstimator

      public PROSACPolynomialRobustEstimator(List<PolynomialEvaluation> evaluations, PolynomialRobustEstimatorListener listener)
      Constructor.
      Parameters:
      evaluations - collection of polynomial evaluations.
      listener - listener to be notified of events such as when estimation starts, ends or its progress significantly changes.
      Throws:
      IllegalArgumentException - if provided number of evaluations is less than the required minimum.
    • PROSACPolynomialRobustEstimator

      public PROSACPolynomialRobustEstimator(int degree, List<PolynomialEvaluation> evaluations, PolynomialRobustEstimatorListener listener)
      Constructor.
      Parameters:
      degree - degree of polynomial to be estimated.
      evaluations - collection of polynomial evaluations.
      listener - listener to be notified of events such as when estimation starts, ends or its progress significantly changes.
      Throws:
      IllegalArgumentException - if provided degree is less than 1 or if provided number of evaluations is less than the required minimum for provided degree.
  • Method Details

    • getThreshold

      public double getThreshold()
      Returns threshold to determine whether polynomials are inliers or not when testing possible estimation solutions.
      Returns:
      threshold to determine whether polynomials are inliers or not when testing possible estimation solutions.
    • setThreshold

      public void setThreshold(double threshold) throws LockedException
      Sets threshold to determine whether polynomials are inliers or not when testing possible estimation solutions.
      Parameters:
      threshold - threshold to determine whether polynomials are inliers or not when testing possible estimation solutions.
      Throws:
      IllegalArgumentException - if provided value is equal or less than zero.
      LockedException - if robust estimator is locked.
    • getQualityScores

      public double[] getQualityScores()
      Returns quality scores corresponding to each provided point. The larger the score value the betther the quality of the sampled point
      Overrides:
      getQualityScores in class PolynomialRobustEstimator
      Returns:
      quality scores corresponding to each point
    • setQualityScores

      public void setQualityScores(double[] qualityScores) throws LockedException
      Sets quality scores corresponding to each provided point. The larger the score value the better the quality of the sampled point.
      Overrides:
      setQualityScores in class PolynomialRobustEstimator
      Parameters:
      qualityScores - quality scores corresponding to each point.
      Throws:
      LockedException - if robust estimator is locked because an estimation is already in progress.
      IllegalArgumentException - if provided quality scores length is smaller than required minimum size.
    • isReady

      public boolean isReady()
      Indicates if estimator is ready to start the polynomial estimation. This is true when input data (i.e. polynomial evaluations and quality scores) are provided and enough data is available.
      Overrides:
      isReady in class PolynomialRobustEstimator
      Returns:
      true if estimator is ready, false otherwise
    • estimate

      Estimates polynomial.
      Specified by:
      estimate in class PolynomialRobustEstimator
      Returns:
      estimated polynomial.
      Throws:
      LockedException - if robust estimator is locked because an estimation is already in progress.
      NotReadyException - if provided input data is not enough to start the estimation.
      RobustEstimatorException - if estimation fails for any other reason (i.e. numerical instability, no solution available, etc).
    • getMethod

      public RobustEstimatorMethod getMethod()
      Returns method being used for robust estimation.
      Specified by:
      getMethod in class PolynomialRobustEstimator
      Returns:
      method being used for robust estimation.
    • internalSetQualityScores

      private void internalSetQualityScores(double[] qualityScores)
      Sets quality scores corresponding to each provided polynomial evaluation. This method is used internally and does not check whether instance is locked or not
      Parameters:
      qualityScores - quality scores to be set
      Throws:
      IllegalArgumentException - if provided quality scores length is smaller than required minimum size.