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
}
Aggregations