Search in sources :

Example 1 with ConfigTrifocalError

use of boofcv.factory.geo.ConfigTrifocalError in project BoofCV by lessthanoptimal.

the class ExampleComputeTrifocalTensor method computeTrifocal.

/**
 * Computes the Trifocal Tensor using RANSAC given associated features across 3-views. The found tensor
 * is copied into model and the inliers are returned.
 */
public static List<AssociatedTriple> computeTrifocal(DogArray<AssociatedTriple> associated, TrifocalTensor model) {
    var configRansac = new ConfigRansac();
    configRansac.iterations = 500;
    configRansac.inlierThreshold = 1;
    var configTri = new ConfigTrifocal();
    ConfigTrifocalError configError = new ConfigTrifocalError();
    configError.model = ConfigTrifocalError.Model.REPROJECTION_REFINE;
    Ransac<TrifocalTensor, AssociatedTriple> ransac = FactoryMultiViewRobust.trifocalRansac(configTri, configError, configRansac);
    ransac.process(associated.toList());
    model.setTo(ransac.getModelParameters());
    return ransac.getMatchSet();
}
Also used : AssociatedTriple(boofcv.struct.geo.AssociatedTriple) ConfigTrifocal(boofcv.factory.geo.ConfigTrifocal) TrifocalTensor(boofcv.struct.geo.TrifocalTensor) ConfigRansac(boofcv.factory.geo.ConfigRansac) ConfigTrifocalError(boofcv.factory.geo.ConfigTrifocalError)

Aggregations

ConfigRansac (boofcv.factory.geo.ConfigRansac)1 ConfigTrifocal (boofcv.factory.geo.ConfigTrifocal)1 ConfigTrifocalError (boofcv.factory.geo.ConfigTrifocalError)1 AssociatedTriple (boofcv.struct.geo.AssociatedTriple)1 TrifocalTensor (boofcv.struct.geo.TrifocalTensor)1