@Override public boolean process(List<Point> _dataSet ) { // see if it has the minimum number of points if (_dataSet.size() < modelGenerator.getMinimumPoints() ) return false; // the data set will be modified so a copy is needed. Otherwise indexes of match set will not // be correct dataSet.clear(); dataSet.addAll(_dataSet); // configure internal data structures initialize(dataSet); // iterate until it has exhausted all iterations or stop if the entire data set // is in the inlier set for (int i = 0; i < maxIterations && bestFitPoints.size() != dataSet.size(); i++) { // sample the a small set of points randomDraw(dataSet, sampleSize, initialSample, rand); // get the candidate(s) for this sample set if( modelGenerator.generate(initialSample, candidateParam ) ) { // see if it can find a model better than the current best one selectMatchSet(_dataSet, thresholdFit, candidateParam); // save this results if (bestFitPoints.size() < candidatePoints.size()) { swapCandidateWithBest(); } } } return bestFitPoints.size() > 0; }
@Override public boolean process(List<Point> _dataSet ) { // see if it has the minimum number of points if (_dataSet.size() < modelGenerator.getMinimumPoints() ) return false; // the data set will be modified so a copy is needed. Otherwise indexes of match set will not // be correct dataSet.clear(); dataSet.addAll(_dataSet); // configure internal data structures initialize(dataSet); // iterate until it has exhausted all iterations or stop if the entire data set // is in the inlier set for (int i = 0; i < maxIterations && bestFitPoints.size() != dataSet.size(); i++) { // sample the a small set of points randomDraw(dataSet, sampleSize, initialSample, rand); // get the candidate(s) for this sample set if( modelGenerator.generate(initialSample, candidateParam ) ) { // see if it can find a model better than the current best one selectMatchSet(_dataSet, thresholdFit, candidateParam); // save this results if (bestFitPoints.size() < candidatePoints.size()) { swapCandidateWithBest(); } } } return bestFitPoints.size() > 0; }
Ransac.randomDraw(dataSet, sampleSize, smallSet, rand); if( generator.generate(smallSet, candidate) ) { errorMetric.setModel(candidate); errorMetric.computeDistance(_dataSet,errors);
if( model.modelGenerator.generate(initialSample.toList(), param ) ) {
if( model.modelGenerator.generate(initialSample.toList(), param ) ) {
Ransac.randomDraw(dataSet, sampleSize, smallSet, rand); if( generator.generate(smallSet, candidate) ) { errorMetric.setModel(candidate); errorMetric.computeDistance(_dataSet,errors);