Class PROSACPolynomialRobustEstimator
java.lang.Object
com.irurueta.numerical.polynomials.estimators.PolynomialRobustEstimator
com.irurueta.numerical.polynomials.estimators.PROSACPolynomialRobustEstimator
Finds the best polynomial using PROSAC algorithm.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final doubleConstant defining default threshold to determine whether polynomials are inliers or not.static final doubleMinimum value that can be set as threshold.private double[]Quality scores corresponding to each provided polynomial evaluation.private doubleThreshold to determine whether polynomial evaluations are inlers or not when testing possible estimation solutionsFields inherited from class com.irurueta.numerical.polynomials.estimators.PolynomialRobustEstimator
confidence, DEFAULT_CONFIDENCE, DEFAULT_MAX_ITERATIONS, DEFAULT_PROGRESS_DELTA, DEFAULT_ROBUST_METHOD, DEFAULT_USE_GEOMETRIC_DISTANCE, evaluations, listener, locked, MAX_CONFIDENCE, MAX_PROGRESS_DELTA, maxIterations, MIN_CONFIDENCE, MIN_ITERATIONS, MIN_PROGRESS_DELTA, polynomialEstimator, progressDelta, useGeometricDistance -
Constructor Summary
ConstructorsConstructorDescriptionConstructor.PROSACPolynomialRobustEstimator(int degree) Constructor.PROSACPolynomialRobustEstimator(int degree, PolynomialRobustEstimatorListener listener) Constructor.PROSACPolynomialRobustEstimator(int degree, List<PolynomialEvaluation> evaluations) Constructor.PROSACPolynomialRobustEstimator(int degree, List<PolynomialEvaluation> evaluations, PolynomialRobustEstimatorListener listener) Constructor.Constructor.PROSACPolynomialRobustEstimator(List<PolynomialEvaluation> evaluations) Constructor.PROSACPolynomialRobustEstimator(List<PolynomialEvaluation> evaluations, PolynomialRobustEstimatorListener listener) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionestimate()Estimates polynomial.Returns method being used for robust estimation.double[]Returns quality scores corresponding to each provided point.doubleReturns threshold to determine whether polynomials are inliers or not when testing possible estimation solutions.private voidinternalSetQualityScores(double[] qualityScores) Sets quality scores corresponding to each provided polynomial evaluation.booleanisReady()Indicates if estimator is ready to start the polynomial estimation.voidsetQualityScores(double[] qualityScores) Sets quality scores corresponding to each provided point.voidsetThreshold(double threshold) Sets threshold to determine whether polynomials are inliers or not when testing possible estimation solutions.Methods inherited from class com.irurueta.numerical.polynomials.estimators.PolynomialRobustEstimator
create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, create, getAlgebraicDistance, getAlgebraicDistance, getAlgebraicDistance, getAlgebraicDistance, getAlgebraicDistance, getConfidence, getDegree, getDistance, getEvaluations, getGeometricDistance, getGeometricOrAlgebraicDistance, getListener, getMaxIterations, getMinNumberOfEvaluations, getProgressDelta, isGeometricDistanceUsed, isLocked, setConfidence, setDegree, setEvaluations, setGeometricDistanceUsed, setListener, setMaxIterations, setProgressDelta
-
Field Details
-
DEFAULT_THRESHOLD
public static final double DEFAULT_THRESHOLDConstant 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_THRESHOLDMinimum value that can be set as threshold. Threshold must be strictly greater than 0.0.- See Also:
-
threshold
private double thresholdThreshold to determine whether polynomial evaluations are inlers or not when testing possible estimation solutions -
qualityScores
private double[] qualityScoresQuality 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
Constructor.- Parameters:
evaluations- collection of polynomial evaluations.- Throws:
IllegalArgumentException- if provided number of evaluations is less than the required minimum.
-
PROSACPolynomialRobustEstimator
Constructor.- Parameters:
listener- listener to be notified of events such as when estimation starts, ends or its progress significantly changes.
-
PROSACPolynomialRobustEstimator
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
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
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:
getQualityScoresin classPolynomialRobustEstimator- Returns:
- quality scores corresponding to each point
-
setQualityScores
Sets quality scores corresponding to each provided point. The larger the score value the better the quality of the sampled point.- Overrides:
setQualityScoresin classPolynomialRobustEstimator- 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:
isReadyin classPolynomialRobustEstimator- Returns:
- true if estimator is ready, false otherwise
-
estimate
Estimates polynomial.- Specified by:
estimatein classPolynomialRobustEstimator- 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
Returns method being used for robust estimation.- Specified by:
getMethodin classPolynomialRobustEstimator- 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.
-