private void addShapeToOutput(List<PointVectorNN> inliers) { ModelFitter<Object, PointVectorNN> fitter = fitters.get(ransac.getModelIndex()); Object shapeParam = models.get(ransac.getModelIndex()); fitter.fitModel(inliers, ransac.getModelParameters(), shapeParam); // convert the results into output format Shape os = output.grow(); os.parameters = modelManagers.get(ransac.getModelIndex()).createModelInstance(); modelManagers.get(ransac.getModelIndex()).copyModel(shapeParam,os.parameters); os.type = shapeList.get(ransac.getModelIndex()); os.points.clear(); os.indexes.reset(); // add the points to it for (int j = 0; j < inliers.size(); j++) { PointVectorNN pv = inliers.get(j); os.points.add(pv.p); os.indexes.add(pv.index); } }
shapeDesc.modelManager.copyModel(ransacParam, output.modelParam); output.points.addAll(ransacInliers); refineShape.configure(shapeDesc.modelFitter, shapeDesc.modelDistance,