Set better default for RRANSAC and RMSAC #6158
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
RRANSAC is a faster variant of RANSAC. It performs a pretest before counting all inliers of a candidate model (this is the costly part of RANSAC). The pretest consists of choosing a number of random sample points and then testing if all these points are inliers. If just one is an outlier, the candidate model is discarded. The previous default was to choose 10 percent of all points for this pretest, which is far too much, and the probability of a candidate model (even a good one!) not being discarded is near zero. Therefore RRANSAC fails to find a model in many cases. The new default is to use one point for the pretest. This has a good chance of rejecting very bad models, but not reject any good models. This is a good default for many different datasets.
The same is done for RMSAC, which is a faster variant of MSAC. MSAC uses a different way to judge the quality of a candidate model than RANSAC, but works very similarly otherwise.