use of boofcv.struct.feature.TupleDesc_S8 in project BoofCV by lessthanoptimal.
the class TestDescribeRegionPointConvert method basic.
@Test
public void basic() {
DummyConvert convert = new DummyConvert();
DummyDescribe original = new DummyDescribe();
DescribeRegionPointConvert<GrayF32, TupleDesc_F64, TupleDesc_S8> alg = new DescribeRegionPointConvert<>(original, convert);
TupleDesc_S8 found = alg.createDescription();
assertTrue(found.value.length == 5);
assertFalse(original.calledImageSet);
alg.setImage(null);
assertTrue(original.calledImageSet);
alg.process(1, 2, 2, 2, found);
assertEquals(5, found.value[0]);
assertTrue(alg.requiresOrientation() == original.requiresOrientation());
assertTrue(alg.requiresRadius() == original.requiresRadius());
assertTrue(alg.getDescriptionType() == TupleDesc_S8.class);
}
use of boofcv.struct.feature.TupleDesc_S8 in project BoofCV by lessthanoptimal.
the class TestScoreAssociateSad_S8 method basic.
@Test
public void basic() {
ScoreAssociateSad_S8 scorer = new ScoreAssociateSad_S8();
TupleDesc_S8 a = new TupleDesc_S8(3);
TupleDesc_S8 b = new TupleDesc_S8(3);
a.value = new byte[] { -5, 2, 120 };
b.value = new byte[] { 56, 2, -30 };
assertEquals(211, scorer.score(a, b), 1e-2);
}
Aggregations