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);
}
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);
}
Aggregations