Search in sources :

Example 1 with Helper

use of boofcv.abst.feature.detect.interest.TestGeneralToInterestPoint.Helper in project BoofCV by lessthanoptimal.

the class TestGeneralToInterestMulti method various.

/**
 * Several basic functionality tests
 */
public void various() {
    Helper detector = new Helper();
    detector.maximum = true;
    GeneralToInterestMulti<GrayF32, GrayF32> alg = new GeneralToInterestMulti<>(detector, 2.5, GrayF32.class, GrayF32.class);
    alg.detect(input);
    assertEquals(1, alg.getNumberOfSets());
    FoundPointSO set = alg.getFeatureSet(0);
    assertEquals(6, set.getNumberOfFeatures());
    for (int i = 0; i < set.getNumberOfFeatures(); i++) {
        assertEquals(2.5, set.getRadius(i), 1e-8);
        assertEquals(0, set.getOrientation(i), 1e-8);
    }
    assertEquals(1, detector.calledProcess);
    assertEquals(6, detector.getMaximums().size);
}
Also used : Helper(boofcv.abst.feature.detect.interest.TestGeneralToInterestPoint.Helper) GrayF32(boofcv.struct.image.GrayF32)

Example 2 with Helper

use of boofcv.abst.feature.detect.interest.TestGeneralToInterestPoint.Helper in project BoofCV by lessthanoptimal.

the class TestGeneralToInterestMulti method checkMinimumsMaximums.

/**
 * Makes sure both minimums and maximums are added
 */
@Test
public void checkMinimumsMaximums() {
    Helper detector = new Helper();
    detector.minimum = true;
    GeneralToInterestMulti<GrayF32, GrayF32> alg;
    // just minimums
    alg = new GeneralToInterestMulti<>(detector, 2.5, GrayF32.class, GrayF32.class);
    assertEquals(1, alg.getNumberOfSets());
    alg.detect(input);
    assertEquals(5, alg.getFeatureSet(0).getNumberOfFeatures());
    // both minimums and maximums
    detector.maximum = true;
    alg = new GeneralToInterestMulti<>(detector, 2.5, GrayF32.class, GrayF32.class);
    assertEquals(2, alg.getNumberOfSets());
    alg.detect(input);
    assertEquals(5, alg.getFeatureSet(0).getNumberOfFeatures());
    assertEquals(6, alg.getFeatureSet(1).getNumberOfFeatures());
    // just maximums
    detector.minimum = false;
    alg = new GeneralToInterestMulti<>(detector, 2.5, GrayF32.class, GrayF32.class);
    assertEquals(1, alg.getNumberOfSets());
    alg.detect(input);
    assertEquals(6, alg.getFeatureSet(0).getNumberOfFeatures());
}
Also used : Helper(boofcv.abst.feature.detect.interest.TestGeneralToInterestPoint.Helper) GrayF32(boofcv.struct.image.GrayF32) Test(org.junit.Test)

Aggregations

Helper (boofcv.abst.feature.detect.interest.TestGeneralToInterestPoint.Helper)2 GrayF32 (boofcv.struct.image.GrayF32)2 Test (org.junit.Test)1