Search in sources :

Example 1 with QueueMatrix

use of boofcv.struct.geo.QueueMatrix in project BoofCV by lessthanoptimal.

the class TestGeoModelEstimatorNto1 method createSolution.

private DMatrixRMaj createSolution() {
    EssentialNister5 nister = new EssentialNister5();
    FastQueue<DMatrixRMaj> solutions = new QueueMatrix(3, 3);
    assertTrue(nister.process(obs, solutions));
    return solutions.get(0);
}
Also used : DMatrixRMaj(org.ejml.data.DMatrixRMaj) EssentialNister5(boofcv.alg.geo.f.EssentialNister5) QueueMatrix(boofcv.struct.geo.QueueMatrix)

Example 2 with QueueMatrix

use of boofcv.struct.geo.QueueMatrix in project BoofCV by lessthanoptimal.

the class CheckEstimateNofEpipolar method checkConstraint.

/**
 * Make sure the ordering of the epipolar constraint is computed correctly
 */
@Test
public void checkConstraint() {
    init(50, isPixels);
    boolean workedOnce = false;
    FastQueue<DMatrixRMaj> solutions = new QueueMatrix(3, 3);
    for (int i = 0; i < 10; i++) {
        List<AssociatedPair> pairs = randomPairs(alg.getMinimumPoints());
        if (!alg.process(pairs, solutions)) {
            continue;
        }
        if (solutions.size() <= 0)
            continue;
        workedOnce = true;
        for (DMatrixRMaj F : solutions.toList()) {
            // normalize to ensure proper scaling
            double n = CommonOps_DDRM.elementMaxAbs(F);
            CommonOps_DDRM.scale(1.0 / n, F);
            for (AssociatedPair p : pairs) {
                double correct = Math.abs(GeometryMath_F64.innerProd(p.p2, F, p.p1));
                double wrong = Math.abs(GeometryMath_F64.innerProd(p.p1, F, p.p2));
                assertTrue(correct < wrong * 0.001);
            }
        }
    }
    assertTrue(workedOnce);
}
Also used : AssociatedPair(boofcv.struct.geo.AssociatedPair) DMatrixRMaj(org.ejml.data.DMatrixRMaj) QueueMatrix(boofcv.struct.geo.QueueMatrix) Test(org.junit.Test)

Aggregations

QueueMatrix (boofcv.struct.geo.QueueMatrix)2 DMatrixRMaj (org.ejml.data.DMatrixRMaj)2 EssentialNister5 (boofcv.alg.geo.f.EssentialNister5)1 AssociatedPair (boofcv.struct.geo.AssociatedPair)1 Test (org.junit.Test)1