use of boofcv.struct.feature.TupleDesc_F64 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_F64 in project BoofCV by lessthanoptimal.
the class TestDescribeRegionPoint_SIFT method process.
@Test
public void process() {
GrayF32 image = new GrayF32(640, 480);
GImageMiscOps.fillUniform(image, rand, 0, 200);
DescribeRegionPoint_SIFT<GrayF32> alg = declare();
alg.setImage(image);
TupleDesc_F64 desc0 = alg.createDescription();
TupleDesc_F64 desc1 = alg.createDescription();
TupleDesc_F64 desc2 = alg.createDescription();
// same location, but different orientations and scales
assertTrue(alg.process(100, 120, 0.5, 10, desc0));
assertTrue(alg.process(100, 50, -1.1, 10, desc1));
assertTrue(alg.process(100, 50, 0.5, 7, desc2));
// should be 3 different descriptions
assertNotEquals(desc0.getDouble(0), desc1.getDouble(0), 1e-6);
assertNotEquals(desc0.getDouble(0), desc2.getDouble(0), 1e-6);
assertNotEquals(desc1.getDouble(0), desc2.getDouble(0), 1e-6);
// see if it blows up along the image border
assertTrue(alg.process(0, 120, 0.5, 10, desc0));
assertTrue(alg.process(100, 0, 0.5, 10, desc0));
assertTrue(alg.process(639, 120, 0.5, 10, desc0));
assertTrue(alg.process(100, 479, 0.5, 10, desc0));
}
use of boofcv.struct.feature.TupleDesc_F64 in project BoofCV by lessthanoptimal.
the class TestDescribeRegionPoint_SIFT method flags.
@Test
public void flags() {
DescribeRegionPoint_SIFT<GrayF32> alg = declare();
assertTrue(alg.requiresOrientation());
assertTrue(alg.requiresRadius());
TupleDesc_F64 desc = alg.createDescription();
assertEquals(128, desc.size());
assertEquals(2 * alg.describe.getCanonicalRadius(), alg.getCanonicalWidth(), 1e-8);
}
use of boofcv.struct.feature.TupleDesc_F64 in project BoofCV by lessthanoptimal.
the class TestScoreAssociateSad_F64 method compareToExpected.
@Test
public void compareToExpected() {
ScoreAssociateSad_F64 scorer = new ScoreAssociateSad_F64();
TupleDesc_F64 a = new TupleDesc_F64(5);
TupleDesc_F64 b = new TupleDesc_F64(5);
a.value = new double[] { 1.1, 2, 3, 4.5, 5 };
b.value = new double[] { -1, 2, 6.1, 3, 6 };
assertEquals(7.7, scorer.score(a, b), 1e-2);
}
use of boofcv.struct.feature.TupleDesc_F64 in project BoofCV by lessthanoptimal.
the class TestWrapAssociateSurfBasic method createAlg.
@Override
public AssociateDescription<BrightFeature> createAlg() {
ScoreAssociation<TupleDesc_F64> score = new ScoreAssociateEuclidean_F64();
AssociateDescription<TupleDesc_F64> assoc = FactoryAssociation.greedy(score, Double.MAX_VALUE, false);
AssociateSurfBasic basic = new AssociateSurfBasic(assoc);
return new WrapAssociateSurfBasic(basic);
}
Aggregations