Package org.hipparchus.fitting.ransac
Class RansacFitter<M>
java.lang.Object
org.hipparchus.fitting.ransac.RansacFitter<M>
- Type Parameters:
M- mathematical model representing the parameters to estimate
Class implementing Random sample consensus (RANSAC) algorithm.
RANSAC is a robust method for estimating the parameters of a mathematical model from a set of observed data. It works iteratively selecting random subsets of the input data, fitting a model to these subsets, and then determining how many data points from the entire set are consistent with the estimated model parameters. The model can yields the largest number of inliers (i.e., point that fit well) is considered the best estimate.
This implementation is designed to be generic and can be used with
different types of models, such as polynomial models.
- Since:
- 4.1
-
Constructor Summary
ConstructorsConstructorDescriptionRansacFitter(IModelFitter<M> fitter, int sampleSize, int maxIterations, double threshold, int minInliers, int seed) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionFits the set of observed data to determine the model parameters.
-
Constructor Details
-
RansacFitter
public RansacFitter(IModelFitter<M> fitter, int sampleSize, int maxIterations, double threshold, int minInliers, int seed) Constructor.- Parameters:
fitter- mathematical model fittersampleSize- minimum number of data points to estimate the model parametersmaxIterations- maximum number of iterations allowed to fit the modelthreshold- threshold to assert that a data point fits the modelminInliers- minimum number of close data points required to assert that the model fits the input dataseed- seed for the random generator
-
-
Method Details
-
fit
Fits the set of observed data to determine the model parameters.- Parameters:
points- set of observed data- Returns:
- a java class containing the best estimate of the model parameters
-