Search in sources :

Example 6 with TupleDesc_S8

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);
}
Also used : TupleDesc_S8(boofcv.struct.feature.TupleDesc_S8) GrayF32(boofcv.struct.image.GrayF32) TupleDesc_F64(boofcv.struct.feature.TupleDesc_F64) Test(org.junit.Test)

Example 7 with TupleDesc_S8

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);
}
Also used : TupleDesc_S8(boofcv.struct.feature.TupleDesc_S8) Test(org.junit.Test)

Aggregations

TupleDesc_S8 (boofcv.struct.feature.TupleDesc_S8)7 Test (org.junit.Test)6 TupleDesc_F64 (boofcv.struct.feature.TupleDesc_F64)5 GrayF32 (boofcv.struct.image.GrayF32)2 DescribeRegionPoint (boofcv.abst.feature.describe.DescribeRegionPoint)1 DescribeRegionPointConvert (boofcv.abst.feature.describe.DescribeRegionPointConvert)1 ConfigFastHessian (boofcv.abst.feature.detect.interest.ConfigFastHessian)1 FactoryDescribeRegionPoint (boofcv.factory.feature.describe.FactoryDescribeRegionPoint)1 ConvertBufferedImage (boofcv.io.image.ConvertBufferedImage)1 BufferedImage (java.awt.image.BufferedImage)1