use of boofcv.struct.feature.TupleDesc_F64 in project BoofCV by lessthanoptimal.
the class TestAssociateStereo2D method constraintY.
/**
* Makes sure observations have the same y-axis
*/
@Test
public void constraintY() {
// zap the rotation so that no adjustment should need to be done
Point3D_F64 X = new Point3D_F64(0.02, -0.5, 3);
SfmTestHelper.renderPointPixel(param, X, leftP, rightP);
// mangle the y-axis
leftP.y += 0.25;
pointsLeft.grow().set(leftP);
pointsRight.grow().set(rightP);
descLeft.grow();
descRight.grow();
AssociateStereo2D<TupleDesc_F64> alg = new AssociateStereo2D<>(scorer, 0.5, TupleDesc_F64.class);
alg.setCalibration(param);
alg.setSource(pointsLeft, descLeft);
alg.setDestination(pointsRight, descRight);
alg.associate();
// at the current tolerance they should still match
assertEquals(1, alg.getMatches().size);
// make the tolerance tighter
alg = new AssociateStereo2D<>(scorer, 0.01, TupleDesc_F64.class);
alg.setCalibration(param);
alg.setSource(pointsLeft, descLeft);
alg.setDestination(pointsRight, descRight);
alg.associate();
assertEquals(0, alg.getMatches().size);
}
Aggregations