Search in sources :

Example 71 with TupleDesc_F64

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);
}
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 72 with TupleDesc_F64

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

Example 73 with TupleDesc_F64

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

Example 74 with TupleDesc_F64

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

Example 75 with TupleDesc_F64

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);
}
Also used : TupleDesc_F64(boofcv.struct.feature.TupleDesc_F64) AssociateSurfBasic(boofcv.alg.feature.associate.AssociateSurfBasic)

Aggregations

TupleDesc_F64 (boofcv.struct.feature.TupleDesc_F64)127 Test (org.junit.jupiter.api.Test)74 GrayF32 (boofcv.struct.image.GrayF32)27 DogArray_I32 (org.ddogleg.struct.DogArray_I32)15 Test (org.junit.Test)14 GrayU8 (boofcv.struct.image.GrayU8)13 ArrayList (java.util.ArrayList)12 DogArray (org.ddogleg.struct.DogArray)10 DetectDescribePoint (boofcv.abst.feature.detdesc.DetectDescribePoint)7 ConfigFastHessian (boofcv.abst.feature.detect.interest.ConfigFastHessian)7 ConfigAssociateGreedy (boofcv.factory.feature.associate.ConfigAssociateGreedy)7 TupleDesc_S8 (boofcv.struct.feature.TupleDesc_S8)7 File (java.io.File)7 AssociatedTripleIndex (boofcv.struct.feature.AssociatedTripleIndex)6 Point2D_F64 (georegression.struct.point.Point2D_F64)6 Point2D_I32 (georegression.struct.point.Point2D_I32)6 Planar (boofcv.struct.image.Planar)5 RecognitionNearestNeighborInvertedFile (boofcv.alg.scene.ann.RecognitionNearestNeighborInvertedFile)4 InvertedFile (boofcv.alg.scene.bow.InvertedFile)4 ConvertBufferedImage (boofcv.io.image.ConvertBufferedImage)4