/** Makes sure both minimums and maximums are added */ @Test public void checkMinimumsMaximums() { Helper detector = new Helper(); GeneralToInterestPoint<ImageFloat32, ImageFloat32> alg = new GeneralToInterestPoint<ImageFloat32, ImageFloat32>( detector, 2.5, ImageFloat32.class, ImageFloat32.class); // both turned off alg.detect(input); assertEquals(0, alg.getNumberOfFeatures()); // just minimums detector.minimum = true; alg.detect(input); assertEquals(5, alg.getNumberOfFeatures()); // both minimums and maximums detector.maximum = true; alg.detect(input); assertEquals(11, alg.getNumberOfFeatures()); // just maximums detector.minimum = false; alg.detect(input); assertEquals(6, alg.getNumberOfFeatures()); }
/** Several basic functionality tests */ public void various() { Helper detector = new Helper(); detector.maximum = true; GeneralToInterestPoint<ImageFloat32, ImageFloat32> alg = new GeneralToInterestPoint<ImageFloat32, ImageFloat32>( detector, 2.5, ImageFloat32.class, ImageFloat32.class); alg.detect(input); assertEquals(6, alg.getNumberOfFeatures()); for (int i = 0; i < alg.getNumberOfFeatures(); i++) { assertEquals(2.5, alg.getScale(i), 1e-8); assertEquals(0, alg.getOrientation(i), 1e-8); } assertEquals(1, detector.calledProcess); assertEquals(6, detector.getMaximums().size); }