RandomSampleConsensus Class
Class implementing the Random Sample Consensus (RANSAC) algorithm for a generic data type.
RANSAC is an iterative non-deterministic algorithm used for fitting estimation in the presence of a large number of outliers in the data.
OthersTModelThe type of the model being fitted to the data.
delegate TModel GenerateModel ( int index1,
int index2 )
Delegate for generating a model from a pair of samples, represented by their indices.
Parametersindex1The first sample index.
index2The second sample index.
ReturnsA model generated from the provided indices.
delegate float EvaluateModelScore ( TModel model,
TModel modelSet )
Delegate for evaluating the agreement score of a model with respect to the entire dataset.
ParametersmodelThe model to be evaluated.
modelSetThe set of all generated models for comparison.
ReturnsThe score representing the model's agreement with the data.
RandomSampleConsensus ( int dataPoints,
int exclusionZone )
Initializes a new instance of the RandomSampleConsensus class.
ParametersdataPointsThe total number of sample points.
exclusionZoneThe threshold to avoid selecting samples too close to each other.
Calculates the best fitting model based on the RANSAC algorithm.
ParametersmodelGeneratorThe function to generate models from data points.
modelScorerThe function to evaluate the agreement score of a model.
ReturnsThe model that best fits the data according to the RANSAC algorithm.