Search in sources :

Example 1 with DescribePointSurf

use of boofcv.alg.feature.describe.DescribePointSurf in project BoofCV by lessthanoptimal.

the class TestDetectDescribeSurfPlanar method basicTest.

@Test
public void basicTest() {
    Planar<GrayF32> input = new Planar<>(GrayF32.class, width, height, 3);
    GImageMiscOps.addUniform(input, rand, 0, 200);
    DescribePointSurf<GrayF32> desc = new DescribePointSurf<>(GrayF32.class);
    DescribePointSurfPlanar<GrayF32> descMulti = new DescribePointSurfPlanar<>(desc, 3);
    FastHessianFeatureDetector<GrayF32> detector = FactoryInterestPointAlgs.fastHessian(null);
    OrientationIntegral<GrayF32> orientation = FactoryOrientationAlgs.sliding_ii(null, GrayF32.class);
    DetectDescribeSurfPlanar<GrayF32> alg = new DetectDescribeSurfPlanar<>(detector, orientation, descMulti);
    GrayF32 gray = ConvertImage.average(input, null);
    // see if it detects the same number of points
    detector.detect(gray);
    int expected = detector.getFoundPoints().size();
    alg.detect(gray, input);
    assertEquals(expected, alg.getNumberOfFeatures());
// could improve this unit test by checking scale and orientation
}
Also used : GrayF32(boofcv.struct.image.GrayF32) DescribePointSurf(boofcv.alg.feature.describe.DescribePointSurf) DescribePointSurfPlanar(boofcv.alg.feature.describe.DescribePointSurfPlanar) Planar(boofcv.struct.image.Planar) DescribePointSurfPlanar(boofcv.alg.feature.describe.DescribePointSurfPlanar) Test(org.junit.Test)

Aggregations

DescribePointSurf (boofcv.alg.feature.describe.DescribePointSurf)1 DescribePointSurfPlanar (boofcv.alg.feature.describe.DescribePointSurfPlanar)1 GrayF32 (boofcv.struct.image.GrayF32)1 Planar (boofcv.struct.image.Planar)1 Test (org.junit.Test)1