Random Sample Consensus (RANSAC) is an iterative non-deterministic algorithm for the robust estimation of parameters of a mathematical model from several random subsets of inliers from the complete dataset (containing outliers). In this recipe, we will use the skimage.measure module's implementation of the RANSAC algorithm. Each iteration of the RANSAC algorithm does the following:
-
It selects a random sample of a size of min_samples from the original data (hypothetical inliers) and ensures that the sample dataset is valid for fitting the model.
-
It fits a model (that is, estimate the model parameters) to the sampled dataset and ensures that the estimated model is valid.
-
It checks whether the estimated model fits to all of the other data points. Computes the consensus set (inliers) and the outliers from all of the...