Merge pull request #7497 from abratchik:java.wrapper.fix.3.1

pull/7596/head
Alexander Alekhin 8 years ago
commit 811eb76277
  1. 4
      modules/calib3d/misc/java/test/Calib3dTest.java
  2. 14
      modules/features2d/misc/java/test/BRIEFDescriptorExtractorTest.java
  3. 21
      modules/features2d/misc/java/test/BruteForceDescriptorMatcherTest.java
  4. 11
      modules/features2d/misc/java/test/BruteForceHammingDescriptorMatcherTest.java
  5. 9
      modules/features2d/misc/java/test/BruteForceHammingLUTDescriptorMatcherTest.java
  6. 23
      modules/features2d/misc/java/test/BruteForceL1DescriptorMatcherTest.java
  7. 21
      modules/features2d/misc/java/test/BruteForceSL2DescriptorMatcherTest.java
  8. 39
      modules/features2d/misc/java/test/DynamicDENSEFeatureDetectorTest.java
  9. 39
      modules/features2d/misc/java/test/DynamicFASTFeatureDetectorTest.java
  10. 39
      modules/features2d/misc/java/test/DynamicGFTTFeatureDetectorTest.java
  11. 39
      modules/features2d/misc/java/test/DynamicHARRISFeatureDetectorTest.java
  12. 39
      modules/features2d/misc/java/test/DynamicMSERFeatureDetectorTest.java
  13. 39
      modules/features2d/misc/java/test/DynamicORBFeatureDetectorTest.java
  14. 39
      modules/features2d/misc/java/test/DynamicSIFTFeatureDetectorTest.java
  15. 39
      modules/features2d/misc/java/test/DynamicSIMPLEBLOBFeatureDetectorTest.java
  16. 39
      modules/features2d/misc/java/test/DynamicSTARFeatureDetectorTest.java
  17. 39
      modules/features2d/misc/java/test/DynamicSURFFeatureDetectorTest.java
  18. 13
      modules/features2d/misc/java/test/FASTFeatureDetectorTest.java
  19. 11
      modules/features2d/misc/java/test/Features2dTest.java
  20. 127
      modules/features2d/misc/java/test/FernGenericDescriptorMatcherTest.java
  21. 23
      modules/features2d/misc/java/test/FlannBasedDescriptorMatcherTest.java
  22. 39
      modules/features2d/misc/java/test/GridDENSEFeatureDetectorTest.java
  23. 39
      modules/features2d/misc/java/test/GridFASTFeatureDetectorTest.java
  24. 39
      modules/features2d/misc/java/test/GridGFTTFeatureDetectorTest.java
  25. 39
      modules/features2d/misc/java/test/GridHARRISFeatureDetectorTest.java
  26. 39
      modules/features2d/misc/java/test/GridMSERFeatureDetectorTest.java
  27. 39
      modules/features2d/misc/java/test/GridORBFeatureDetectorTest.java
  28. 39
      modules/features2d/misc/java/test/GridSIFTFeatureDetectorTest.java
  29. 39
      modules/features2d/misc/java/test/GridSIMPLEBLOBFeatureDetectorTest.java
  30. 39
      modules/features2d/misc/java/test/GridSTARFeatureDetectorTest.java
  31. 39
      modules/features2d/misc/java/test/GridSURFFeatureDetectorTest.java
  32. 21
      modules/features2d/misc/java/test/ORBDescriptorExtractorTest.java
  33. 127
      modules/features2d/misc/java/test/OneWayGenericDescriptorMatcherTest.java
  34. 39
      modules/features2d/misc/java/test/OpponentBRIEFDescriptorExtractorTest.java
  35. 39
      modules/features2d/misc/java/test/OpponentORBDescriptorExtractorTest.java
  36. 39
      modules/features2d/misc/java/test/OpponentSIFTDescriptorExtractorTest.java
  37. 39
      modules/features2d/misc/java/test/OpponentSURFDescriptorExtractorTest.java
  38. 39
      modules/features2d/misc/java/test/PyramidDENSEFeatureDetectorTest.java
  39. 39
      modules/features2d/misc/java/test/PyramidFASTFeatureDetectorTest.java
  40. 39
      modules/features2d/misc/java/test/PyramidGFTTFeatureDetectorTest.java
  41. 39
      modules/features2d/misc/java/test/PyramidHARRISFeatureDetectorTest.java
  42. 39
      modules/features2d/misc/java/test/PyramidMSERFeatureDetectorTest.java
  43. 39
      modules/features2d/misc/java/test/PyramidORBFeatureDetectorTest.java
  44. 39
      modules/features2d/misc/java/test/PyramidSIFTFeatureDetectorTest.java
  45. 39
      modules/features2d/misc/java/test/PyramidSIMPLEBLOBFeatureDetectorTest.java
  46. 39
      modules/features2d/misc/java/test/PyramidSTARFeatureDetectorTest.java
  47. 39
      modules/features2d/misc/java/test/PyramidSURFFeatureDetectorTest.java
  48. 16
      modules/features2d/misc/java/test/SIFTDescriptorExtractorTest.java
  49. 18
      modules/features2d/misc/java/test/STARFeatureDetectorTest.java
  50. 23
      modules/features2d/misc/java/test/SURFDescriptorExtractorTest.java
  51. 42
      modules/features2d/misc/java/test/SURFFeatureDetectorTest.java
  52. 6
      modules/imgproc/misc/java/test/ImgprocTest.java
  53. 80
      modules/java/android_test/src/org/opencv/test/OpenCVTestCase.java
  54. 79
      modules/java/pure_test/src/org/opencv/test/OpenCVTestCase.java

@ -1,7 +1,6 @@
package org.opencv.test.calib3d;
import org.opencv.calib3d.Calib3d;
import org.opencv.core.Core;
import org.opencv.core.CvType;
import org.opencv.core.Mat;
import org.opencv.core.MatOfDouble;
@ -237,6 +236,8 @@ public class Calib3dTest extends OpenCVTestCase {
}
public void testFindFundamentalMatListOfPointListOfPoint() {
fail("Not yet implemented");
/*
int minFundamentalMatPoints = 8;
MatOfPoint2f pts = new MatOfPoint2f();
@ -253,6 +254,7 @@ public class Calib3dTest extends OpenCVTestCase {
truth = new Mat(3, 3, CvType.CV_64F);
truth.put(0, 0, 0, -0.577, 0.288, 0.577, 0, 0.288, -0.288, -0.288, 0);
assertMatEqual(truth, fm, EPS);
*/
}
public void testFindFundamentalMatListOfPointListOfPointInt() {

@ -1,20 +1,19 @@
package org.opencv.test.features2d;
import org.opencv.core.Core;
import org.opencv.core.CvType;
import org.opencv.core.Mat;
import org.opencv.core.MatOfKeyPoint;
import org.opencv.core.Point;
import org.opencv.core.Scalar;
import org.opencv.features2d.DescriptorExtractor;
import org.opencv.core.KeyPoint;
import org.opencv.test.OpenCVTestCase;
import org.opencv.test.OpenCVTestRunner;
import org.opencv.imgproc.Imgproc;
import org.opencv.features2d.Feature2D;
public class BRIEFDescriptorExtractorTest extends OpenCVTestCase {
DescriptorExtractor extractor;
Feature2D extractor;
int matSize;
private Mat getTestImg() {
@ -28,7 +27,7 @@ public class BRIEFDescriptorExtractorTest extends OpenCVTestCase {
@Override
protected void setUp() throws Exception {
super.setUp();
extractor = DescriptorExtractor.create(DescriptorExtractor.BRIEF);
extractor = createClassInstance(XFEATURES2D+"BriefDescriptorExtractor", DEFAULT_FACTORY, null, null);
matSize = 100;
}
@ -69,12 +68,13 @@ public class BRIEFDescriptorExtractorTest extends OpenCVTestCase {
}
public void testEmpty() {
assertFalse(extractor.empty());
// assertFalse(extractor.empty());
fail("Not yet implemented"); // BRIEF does not override empty() method
}
public void testRead() {
String filename = OpenCVTestRunner.getTempFileName("yml");
writeFile(filename, "%YAML:1.0\ndescriptorSize: 64\n");
writeFile(filename, "%YAML:1.0\n---\ndescriptorSize: 64\n");
extractor.read(filename);
@ -95,7 +95,7 @@ public class BRIEFDescriptorExtractorTest extends OpenCVTestCase {
extractor.write(filename);
String truth = "%YAML:1.0\ndescriptorSize: 32\n";
String truth = "%YAML:1.0\n---\ndescriptorSize: 32\n";
assertEquals(truth, readFile(filename));
}

@ -4,7 +4,6 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.opencv.core.Core;
import org.opencv.core.CvType;
import org.opencv.core.Mat;
import org.opencv.core.MatOfDMatch;
@ -12,13 +11,12 @@ import org.opencv.core.MatOfKeyPoint;
import org.opencv.core.Point;
import org.opencv.core.Scalar;
import org.opencv.core.DMatch;
import org.opencv.features2d.DescriptorExtractor;
import org.opencv.features2d.DescriptorMatcher;
import org.opencv.features2d.FeatureDetector;
import org.opencv.core.KeyPoint;
import org.opencv.test.OpenCVTestCase;
import org.opencv.test.OpenCVTestRunner;
import org.opencv.imgproc.Imgproc;
import org.opencv.features2d.Feature2D;
public class BruteForceDescriptorMatcherTest extends OpenCVTestCase {
@ -39,12 +37,13 @@ public class BruteForceDescriptorMatcherTest extends OpenCVTestCase {
MatOfKeyPoint keypoints = new MatOfKeyPoint();
Mat descriptors = new Mat();
FeatureDetector detector = FeatureDetector.create(FeatureDetector.SURF);
DescriptorExtractor extractor = DescriptorExtractor.create(DescriptorExtractor.SURF);
Feature2D detector = createClassInstance(XFEATURES2D+"SURF", DEFAULT_FACTORY, null, null);
Feature2D extractor = createClassInstance(XFEATURES2D+"SURF", DEFAULT_FACTORY, null, null);
String filename = OpenCVTestRunner.getTempFileName("yml");
writeFile(filename, "%YAML:1.0\nhessianThreshold: 8000.\noctaves: 3\noctaveLayers: 4\nupright: 0\n");
detector.read(filename);
setProperty(detector, "hessianThreshold", "double", 8000);
setProperty(detector, "nOctaves", "int", 3);
setProperty(detector, "nOctaveLayers", "int", 4);
setProperty(detector, "upright", "boolean", false);
detector.detect(img, keypoints);
extractor.compute(img, keypoints, descriptors);
@ -65,7 +64,7 @@ public class BruteForceDescriptorMatcherTest extends OpenCVTestCase {
MatOfKeyPoint keypoints = new MatOfKeyPoint(new KeyPoint(50, 50, 16, 0, 20000, 1, -1), new KeyPoint(42, 42, 16, 160, 10000, 1, -1));
Mat descriptors = new Mat();
DescriptorExtractor extractor = DescriptorExtractor.create(DescriptorExtractor.SURF);
Feature2D extractor = createClassInstance(XFEATURES2D+"SURF", DEFAULT_FACTORY, null, null);
extractor.compute(img, keypoints, descriptors);
@ -273,7 +272,7 @@ public class BruteForceDescriptorMatcherTest extends OpenCVTestCase {
public void testRead() {
String filename = OpenCVTestRunner.getTempFileName("yml");
writeFile(filename, "%YAML:1.0\n");
writeFile(filename, "%YAML:1.0\n---\n");
matcher.read(filename);
assertTrue(true);// BruteforceMatcher has no settings
@ -288,7 +287,7 @@ public class BruteForceDescriptorMatcherTest extends OpenCVTestCase {
matcher.write(filename);
String truth = "%YAML:1.0\n";
String truth = "%YAML:1.0\n---\n";
assertEquals(truth, readFile(filename));
}

@ -4,7 +4,6 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.opencv.core.Core;
import org.opencv.core.CvType;
import org.opencv.core.Mat;
import org.opencv.core.MatOfDMatch;
@ -12,12 +11,12 @@ import org.opencv.core.MatOfKeyPoint;
import org.opencv.core.Point;
import org.opencv.core.Scalar;
import org.opencv.core.DMatch;
import org.opencv.features2d.DescriptorExtractor;
import org.opencv.features2d.DescriptorMatcher;
import org.opencv.features2d.FeatureDetector;
import org.opencv.test.OpenCVTestCase;
import org.opencv.test.OpenCVTestRunner;
import org.opencv.imgproc.Imgproc;
import org.opencv.features2d.Feature2D;
public class BruteForceHammingDescriptorMatcherTest extends OpenCVTestCase {
@ -48,7 +47,7 @@ public class BruteForceHammingDescriptorMatcherTest extends OpenCVTestCase {
Mat descriptors = new Mat();
FeatureDetector detector = FeatureDetector.create(FeatureDetector.FAST);
DescriptorExtractor extractor = DescriptorExtractor.create(DescriptorExtractor.BRIEF);
Feature2D extractor = createClassInstance(XFEATURES2D+"BriefDescriptorExtractor", DEFAULT_FACTORY, null, null);
detector.detect(img, keypoints);
extractor.compute(img, keypoints, descriptors);
@ -212,7 +211,7 @@ public class BruteForceHammingDescriptorMatcherTest extends OpenCVTestCase {
matcher.radiusMatch(query, train, matches, 50.f);
assertEquals(matches.size(), 4);
assertEquals(4, matches.size());
assertTrue(matches.get(0).empty());
assertMatEqual(matches.get(1), new MatOfDMatch(truth[1]), EPS);
assertMatEqual(matches.get(2), new MatOfDMatch(truth[2]), EPS);
@ -241,7 +240,7 @@ public class BruteForceHammingDescriptorMatcherTest extends OpenCVTestCase {
public void testRead() {
String filename = OpenCVTestRunner.getTempFileName("yml");
writeFile(filename, "%YAML:1.0\n");
writeFile(filename, "%YAML:1.0\n---\n");
matcher.read(filename);
assertTrue(true);// BruteforceMatcher has no settings
@ -256,7 +255,7 @@ public class BruteForceHammingDescriptorMatcherTest extends OpenCVTestCase {
matcher.write(filename);
String truth = "%YAML:1.0\n";
String truth = "%YAML:1.0\n---\n";
assertEquals(truth, readFile(filename));
}

@ -3,7 +3,6 @@ package org.opencv.test.features2d;
import java.util.Arrays;
import java.util.List;
import org.opencv.core.Core;
import org.opencv.core.CvType;
import org.opencv.core.Mat;
import org.opencv.core.MatOfDMatch;
@ -11,12 +10,12 @@ import org.opencv.core.MatOfKeyPoint;
import org.opencv.core.Point;
import org.opencv.core.Scalar;
import org.opencv.core.DMatch;
import org.opencv.features2d.DescriptorExtractor;
import org.opencv.features2d.DescriptorMatcher;
import org.opencv.features2d.FeatureDetector;
import org.opencv.test.OpenCVTestCase;
import org.opencv.test.OpenCVTestRunner;
import org.opencv.imgproc.Imgproc;
import org.opencv.features2d.Feature2D;
public class BruteForceHammingLUTDescriptorMatcherTest extends OpenCVTestCase {
@ -47,7 +46,7 @@ public class BruteForceHammingLUTDescriptorMatcherTest extends OpenCVTestCase {
Mat descriptors = new Mat();
FeatureDetector detector = FeatureDetector.create(FeatureDetector.FAST);
DescriptorExtractor extractor = DescriptorExtractor.create(DescriptorExtractor.BRIEF);
Feature2D extractor = createClassInstance(XFEATURES2D+"BriefDescriptorExtractor", DEFAULT_FACTORY, null, null);
detector.detect(img, keypoints);
extractor.compute(img, keypoints, descriptors);
@ -236,7 +235,7 @@ public class BruteForceHammingLUTDescriptorMatcherTest extends OpenCVTestCase {
public void testRead() {
String filename = OpenCVTestRunner.getTempFileName("yml");
writeFile(filename, "%YAML:1.0\n");
writeFile(filename, "%YAML:1.0\n---\n");
matcher.read(filename);
assertTrue(true);// BruteforceMatcher has no settings
@ -251,7 +250,7 @@ public class BruteForceHammingLUTDescriptorMatcherTest extends OpenCVTestCase {
matcher.write(filename);
String truth = "%YAML:1.0\n";
String truth = "%YAML:1.0\n---\n";
assertEquals(truth, readFile(filename));
}

@ -3,7 +3,6 @@ package org.opencv.test.features2d;
import java.util.Arrays;
import java.util.List;
import org.opencv.core.Core;
import org.opencv.core.CvType;
import org.opencv.core.Mat;
import org.opencv.core.MatOfDMatch;
@ -11,13 +10,12 @@ import org.opencv.core.MatOfKeyPoint;
import org.opencv.core.Point;
import org.opencv.core.Scalar;
import org.opencv.core.DMatch;
import org.opencv.features2d.DescriptorExtractor;
import org.opencv.features2d.DescriptorMatcher;
import org.opencv.features2d.FeatureDetector;
import org.opencv.core.KeyPoint;
import org.opencv.test.OpenCVTestCase;
import org.opencv.test.OpenCVTestRunner;
import org.opencv.imgproc.Imgproc;
import org.opencv.features2d.Feature2D;
public class BruteForceL1DescriptorMatcherTest extends OpenCVTestCase {
@ -38,13 +36,14 @@ public class BruteForceL1DescriptorMatcherTest extends OpenCVTestCase {
MatOfKeyPoint keypoints = new MatOfKeyPoint();
Mat descriptors = new Mat();
FeatureDetector detector = FeatureDetector.create(FeatureDetector.SURF);
DescriptorExtractor extractor = DescriptorExtractor.create(DescriptorExtractor.SURF);
Feature2D detector = createClassInstance(XFEATURES2D+"SURF", DEFAULT_FACTORY, null, null);
Feature2D extractor = createClassInstance(XFEATURES2D+"SURF", DEFAULT_FACTORY, null, null);
String filename = OpenCVTestRunner.getTempFileName("yml");
//writeFile(filename, "%YAML:1.0\nhessianThreshold: 8000.\noctaves: 3\noctaveLayers: 4\nupright: 0\n");
writeFile(filename, "%YAML:1.0\nname: \"Feature2D.SURF\"\nextended: 1\nhessianThreshold: 8000.\nnOctaveLayers: 2\nnOctaves: 3\nupright: 0\n");
detector.read(filename);
setProperty(detector, "extended", "boolean", true);
setProperty(detector, "hessianThreshold", "double", 8000);
setProperty(detector, "nOctaveLayers", "int", 2);
setProperty(detector, "nOctaves", "int", 3);
setProperty(detector, "upright", "boolean", false);
detector.detect(img, keypoints);
extractor.compute(img, keypoints, descriptors);
@ -65,7 +64,7 @@ public class BruteForceL1DescriptorMatcherTest extends OpenCVTestCase {
MatOfKeyPoint keypoints = new MatOfKeyPoint(new KeyPoint(50, 50, 16, 0, 20000, 1, -1), new KeyPoint(42, 42, 16, 160, 10000, 1, -1));
Mat descriptors = new Mat();
DescriptorExtractor extractor = DescriptorExtractor.create(DescriptorExtractor.SURF);
Feature2D extractor = createClassInstance(XFEATURES2D+"SURF", DEFAULT_FACTORY, null, null);
extractor.compute(img, keypoints, descriptors);
@ -247,7 +246,7 @@ public class BruteForceL1DescriptorMatcherTest extends OpenCVTestCase {
public void testRead() {
String filename = OpenCVTestRunner.getTempFileName("yml");
writeFile(filename, "%YAML:1.0\n");
writeFile(filename, "%YAML:1.0\n---\n");
matcher.read(filename);
assertTrue(true);// BruteforceMatcher has no settings
@ -262,7 +261,7 @@ public class BruteForceL1DescriptorMatcherTest extends OpenCVTestCase {
matcher.write(filename);
String truth = "%YAML:1.0\n";
String truth = "%YAML:1.0\n---\n";
assertEquals(truth, readFile(filename));
}

@ -3,7 +3,6 @@ package org.opencv.test.features2d;
import java.util.Arrays;
import java.util.List;
import org.opencv.core.Core;
import org.opencv.core.CvType;
import org.opencv.core.Mat;
import org.opencv.core.MatOfDMatch;
@ -11,13 +10,12 @@ import org.opencv.core.MatOfKeyPoint;
import org.opencv.core.Point;
import org.opencv.core.Scalar;
import org.opencv.core.DMatch;
import org.opencv.features2d.DescriptorExtractor;
import org.opencv.features2d.DescriptorMatcher;
import org.opencv.features2d.FeatureDetector;
import org.opencv.core.KeyPoint;
import org.opencv.test.OpenCVTestCase;
import org.opencv.test.OpenCVTestRunner;
import org.opencv.imgproc.Imgproc;
import org.opencv.features2d.Feature2D;
public class BruteForceSL2DescriptorMatcherTest extends OpenCVTestCase {
@ -44,12 +42,13 @@ public class BruteForceSL2DescriptorMatcherTest extends OpenCVTestCase {
MatOfKeyPoint keypoints = new MatOfKeyPoint();
Mat descriptors = new Mat();
FeatureDetector detector = FeatureDetector.create(FeatureDetector.SURF);
DescriptorExtractor extractor = DescriptorExtractor.create(DescriptorExtractor.SURF);
Feature2D detector = createClassInstance(XFEATURES2D+"SURF", DEFAULT_FACTORY, null, null);
Feature2D extractor = createClassInstance(XFEATURES2D+"SURF", DEFAULT_FACTORY, null, null);
String filename = OpenCVTestRunner.getTempFileName("yml");
writeFile(filename, "%YAML:1.0\nhessianThreshold: 8000.\noctaves: 3\noctaveLayers: 4\nupright: 0\n");
detector.read(filename);
setProperty(detector, "hessianThreshold", "double", 8000);
setProperty(detector, "nOctaves", "int", 3);
setProperty(detector, "nOctaveLayers", "int", 4);
setProperty(detector, "upright", "boolean", false);
detector.detect(img, keypoints);
extractor.compute(img, keypoints, descriptors);
@ -70,7 +69,7 @@ public class BruteForceSL2DescriptorMatcherTest extends OpenCVTestCase {
MatOfKeyPoint keypoints = new MatOfKeyPoint(new KeyPoint(50, 50, 16, 0, 20000, 1, -1), new KeyPoint(42, 42, 16, 160, 10000, 1, -1));
Mat descriptors = new Mat();
DescriptorExtractor extractor = DescriptorExtractor.create(DescriptorExtractor.SURF);
Feature2D extractor = createClassInstance(XFEATURES2D+"SURF", DEFAULT_FACTORY, null, null);
extractor.compute(img, keypoints, descriptors);
@ -259,7 +258,7 @@ public class BruteForceSL2DescriptorMatcherTest extends OpenCVTestCase {
public void testRead() {
String filename = OpenCVTestRunner.getTempFileName("yml");
writeFile(filename, "%YAML:1.0\n");
writeFile(filename, "%YAML:1.0\n---\n");
matcher.read(filename);
assertTrue(true);// BruteforceMatcher has no settings
@ -274,7 +273,7 @@ public class BruteForceSL2DescriptorMatcherTest extends OpenCVTestCase {
matcher.write(filename);
String truth = "%YAML:1.0\n";
String truth = "%YAML:1.0\n---\n";
assertEquals(truth, readFile(filename));
}

@ -1,39 +0,0 @@
package org.opencv.test.features2d;
import org.opencv.test.OpenCVTestCase;
public class DynamicDENSEFeatureDetectorTest extends OpenCVTestCase {
public void testCreate() {
fail("Not yet implemented");
}
public void testDetectListOfMatListOfListOfKeyPoint() {
fail("Not yet implemented");
}
public void testDetectListOfMatListOfListOfKeyPointListOfMat() {
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPoint() {
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPointMat() {
fail("Not yet implemented");
}
public void testEmpty() {
fail("Not yet implemented");
}
public void testRead() {
fail("Not yet implemented");
}
public void testWrite() {
fail("Not yet implemented");
}
}

@ -1,39 +0,0 @@
package org.opencv.test.features2d;
import org.opencv.test.OpenCVTestCase;
public class DynamicFASTFeatureDetectorTest extends OpenCVTestCase {
public void testCreate() {
fail("Not yet implemented");
}
public void testDetectListOfMatListOfListOfKeyPoint() {
fail("Not yet implemented");
}
public void testDetectListOfMatListOfListOfKeyPointListOfMat() {
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPoint() {
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPointMat() {
fail("Not yet implemented");
}
public void testEmpty() {
fail("Not yet implemented");
}
public void testRead() {
fail("Not yet implemented");
}
public void testWrite() {
fail("Not yet implemented");
}
}

@ -1,39 +0,0 @@
package org.opencv.test.features2d;
import org.opencv.test.OpenCVTestCase;
public class DynamicGFTTFeatureDetectorTest extends OpenCVTestCase {
public void testCreate() {
fail("Not yet implemented");
}
public void testDetectListOfMatListOfListOfKeyPoint() {
fail("Not yet implemented");
}
public void testDetectListOfMatListOfListOfKeyPointListOfMat() {
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPoint() {
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPointMat() {
fail("Not yet implemented");
}
public void testEmpty() {
fail("Not yet implemented");
}
public void testRead() {
fail("Not yet implemented");
}
public void testWrite() {
fail("Not yet implemented");
}
}

@ -1,39 +0,0 @@
package org.opencv.test.features2d;
import org.opencv.test.OpenCVTestCase;
public class DynamicHARRISFeatureDetectorTest extends OpenCVTestCase {
public void testCreate() {
fail("Not yet implemented");
}
public void testDetectListOfMatListOfListOfKeyPoint() {
fail("Not yet implemented");
}
public void testDetectListOfMatListOfListOfKeyPointListOfMat() {
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPoint() {
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPointMat() {
fail("Not yet implemented");
}
public void testEmpty() {
fail("Not yet implemented");
}
public void testRead() {
fail("Not yet implemented");
}
public void testWrite() {
fail("Not yet implemented");
}
}

@ -1,39 +0,0 @@
package org.opencv.test.features2d;
import org.opencv.test.OpenCVTestCase;
public class DynamicMSERFeatureDetectorTest extends OpenCVTestCase {
public void testCreate() {
fail("Not yet implemented");
}
public void testDetectListOfMatListOfListOfKeyPoint() {
fail("Not yet implemented");
}
public void testDetectListOfMatListOfListOfKeyPointListOfMat() {
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPoint() {
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPointMat() {
fail("Not yet implemented");
}
public void testEmpty() {
fail("Not yet implemented");
}
public void testRead() {
fail("Not yet implemented");
}
public void testWrite() {
fail("Not yet implemented");
}
}

@ -1,39 +0,0 @@
package org.opencv.test.features2d;
import org.opencv.test.OpenCVTestCase;
public class DynamicORBFeatureDetectorTest extends OpenCVTestCase {
public void testCreate() {
fail("Not yet implemented");
}
public void testDetectListOfMatListOfListOfKeyPoint() {
fail("Not yet implemented");
}
public void testDetectListOfMatListOfListOfKeyPointListOfMat() {
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPoint() {
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPointMat() {
fail("Not yet implemented");
}
public void testEmpty() {
fail("Not yet implemented");
}
public void testRead() {
fail("Not yet implemented");
}
public void testWrite() {
fail("Not yet implemented");
}
}

@ -1,39 +0,0 @@
package org.opencv.test.features2d;
import org.opencv.test.OpenCVTestCase;
public class DynamicSIFTFeatureDetectorTest extends OpenCVTestCase {
public void testCreate() {
fail("Not yet implemented");
}
public void testDetectListOfMatListOfListOfKeyPoint() {
fail("Not yet implemented");
}
public void testDetectListOfMatListOfListOfKeyPointListOfMat() {
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPoint() {
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPointMat() {
fail("Not yet implemented");
}
public void testEmpty() {
fail("Not yet implemented");
}
public void testRead() {
fail("Not yet implemented");
}
public void testWrite() {
fail("Not yet implemented");
}
}

@ -1,39 +0,0 @@
package org.opencv.test.features2d;
import org.opencv.test.OpenCVTestCase;
public class DynamicSIMPLEBLOBFeatureDetectorTest extends OpenCVTestCase {
public void testCreate() {
fail("Not yet implemented");
}
public void testDetectListOfMatListOfListOfKeyPoint() {
fail("Not yet implemented");
}
public void testDetectListOfMatListOfListOfKeyPointListOfMat() {
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPoint() {
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPointMat() {
fail("Not yet implemented");
}
public void testEmpty() {
fail("Not yet implemented");
}
public void testRead() {
fail("Not yet implemented");
}
public void testWrite() {
fail("Not yet implemented");
}
}

@ -1,39 +0,0 @@
package org.opencv.test.features2d;
import org.opencv.test.OpenCVTestCase;
public class DynamicSTARFeatureDetectorTest extends OpenCVTestCase {
public void testCreate() {
fail("Not yet implemented");
}
public void testDetectListOfMatListOfListOfKeyPoint() {
fail("Not yet implemented");
}
public void testDetectListOfMatListOfListOfKeyPointListOfMat() {
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPoint() {
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPointMat() {
fail("Not yet implemented");
}
public void testEmpty() {
fail("Not yet implemented");
}
public void testRead() {
fail("Not yet implemented");
}
public void testWrite() {
fail("Not yet implemented");
}
}

@ -1,39 +0,0 @@
package org.opencv.test.features2d;
import org.opencv.test.OpenCVTestCase;
public class DynamicSURFFeatureDetectorTest extends OpenCVTestCase {
public void testCreate() {
fail("Not yet implemented");
}
public void testDetectListOfMatListOfListOfKeyPoint() {
fail("Not yet implemented");
}
public void testDetectListOfMatListOfListOfKeyPointListOfMat() {
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPoint() {
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPointMat() {
fail("Not yet implemented");
}
public void testEmpty() {
fail("Not yet implemented");
}
public void testRead() {
fail("Not yet implemented");
}
public void testWrite() {
fail("Not yet implemented");
}
}

@ -76,20 +76,21 @@ public class FASTFeatureDetectorTest extends OpenCVTestCase {
}
public void testEmpty() {
assertFalse(detector.empty());
// assertFalse(detector.empty());
fail("Not yet implemented"); //FAST does not override empty() method
}
public void testRead() {
String filename = OpenCVTestRunner.getTempFileName("yml");
writeFile(filename, "%YAML:1.0\nthreshold: 130\nnonmaxSuppression: 1\n");
writeFile(filename, "%YAML:1.0\n---\nthreshold: 130\nnonmaxSuppression: 1\n");
detector.read(filename);
MatOfKeyPoint keypoints1 = new MatOfKeyPoint();
detector.detect(grayChess, keypoints1);
writeFile(filename, "%YAML:1.0\nthreshold: 150\nnonmaxSuppression: 1\n");
writeFile(filename, "%YAML:1.0\n---\nthreshold: 150\nnonmaxSuppression: 1\n");
detector.read(filename);
MatOfKeyPoint keypoints2 = new MatOfKeyPoint();
@ -126,7 +127,8 @@ public class FASTFeatureDetectorTest extends OpenCVTestCase {
detector.write(filename);
String truth = "<?xml version=\"1.0\"?>\n<opencv_storage>\n<name>Feature2D.FAST</name>\n<nonmaxSuppression>1</nonmaxSuppression>\n<threshold>10</threshold>\n<type>2</type>\n</opencv_storage>\n";
// String truth = "<?xml version=\"1.0\"?>\n<opencv_storage>\n<name>Feature2D.FAST</name>\n<nonmaxSuppression>1</nonmaxSuppression>\n<threshold>10</threshold>\n<type>2</type>\n</opencv_storage>\n";
String truth = "<?xml version=\"1.0\"?>\n<opencv_storage>\n</opencv_storage>\n";
String data = readFile(filename);
//Log.d("qqq", "\"" + data + "\"");
assertEquals(truth, data);
@ -137,7 +139,8 @@ public class FASTFeatureDetectorTest extends OpenCVTestCase {
detector.write(filename);
String truth = "%YAML:1.0\nname: \"Feature2D.FAST\"\nnonmaxSuppression: 1\nthreshold: 10\ntype: 2\n";
// String truth = "%YAML:1.0\n---\nname: \"Feature2D.FAST\"\nnonmaxSuppression: 1\nthreshold: 10\ntype: 2\n";
String truth = "%YAML:1.0\n---\n";
String data = readFile(filename);
//Log.d("qqq", "\"" + data + "\"");

@ -13,14 +13,13 @@ import org.opencv.core.MatOfPoint2f;
import org.opencv.core.Point;
import org.opencv.core.Range;
import org.opencv.core.DMatch;
import org.opencv.features2d.DescriptorExtractor;
import org.opencv.features2d.DescriptorMatcher;
import org.opencv.features2d.FeatureDetector;
import org.opencv.features2d.Features2d;
import org.opencv.core.KeyPoint;
import org.opencv.imgcodecs.Imgcodecs;
import org.opencv.test.OpenCVTestCase;
import org.opencv.test.OpenCVTestRunner;
import org.opencv.features2d.Feature2D;
public class Features2dTest extends OpenCVTestCase {
@ -78,11 +77,11 @@ public class Features2dTest extends OpenCVTestCase {
public void testPTOD()
{
String detectorCfg = "%YAML:1.0\nhessianThreshold: 4000.\noctaves: 3\noctaveLayers: 4\nupright: 0\n";
String extractorCfg = "%YAML:1.0\nnOctaves: 4\nnOctaveLayers: 2\nextended: 0\nupright: 0\n";
String detectorCfg = "%YAML:1.0\n---\nhessianThreshold: 4000.\noctaves: 3\noctaveLayers: 4\nupright: 0\n";
String extractorCfg = "%YAML:1.0\n---\nnOctaves: 4\nnOctaveLayers: 2\nextended: 0\nupright: 0\n";
FeatureDetector detector = FeatureDetector.create(FeatureDetector.SURF);
DescriptorExtractor extractor = DescriptorExtractor.create(DescriptorExtractor.SURF);
Feature2D detector = createClassInstance(XFEATURES2D+"SURF", DEFAULT_FACTORY, null, null);
Feature2D extractor = createClassInstance(XFEATURES2D+"SURF", DEFAULT_FACTORY, null, null);
DescriptorMatcher matcher = DescriptorMatcher.create(DescriptorMatcher.BRUTEFORCE);
String detectorCfgFile = OpenCVTestRunner.getTempFileName("yml");

@ -1,127 +0,0 @@
package org.opencv.test.features2d;
import org.opencv.test.OpenCVTestCase;
public class FernGenericDescriptorMatcherTest extends OpenCVTestCase {
public void testAdd() {
fail("Not yet implemented");
}
public void testClassifyMatListOfKeyPointMatListOfKeyPoint() {
fail("Not yet implemented");
}
public void testClassifyMatListOfKeyPoint() {
fail("Not yet implemented");
}
public void testClear() {
fail("Not yet implemented");
}
public void testCloneBoolean() {
fail("Not yet implemented");
}
public void testClone() {
fail("Not yet implemented");
}
public void testCreate() {
fail("Not yet implemented");
}
public void testEmpty() {
fail("Not yet implemented");
}
public void testGetTrainImages() {
fail("Not yet implemented");
}
public void testGetTrainKeypoints() {
fail("Not yet implemented");
}
public void testIsMaskSupported() {
fail("Not yet implemented");
}
public void testKnnMatchMatListOfKeyPointMatListOfKeyPointListOfListOfDMatchIntMatBoolean() {
fail("Not yet implemented");
}
public void testKnnMatchMatListOfKeyPointMatListOfKeyPointListOfListOfDMatchIntMat() {
fail("Not yet implemented");
}
public void testKnnMatchMatListOfKeyPointMatListOfKeyPointListOfListOfDMatchInt() {
fail("Not yet implemented");
}
public void testKnnMatchMatListOfKeyPointListOfListOfDMatchIntListOfMatBoolean() {
fail("Not yet implemented");
}
public void testKnnMatchMatListOfKeyPointListOfListOfDMatchIntListOfMat() {
fail("Not yet implemented");
}
public void testKnnMatchMatListOfKeyPointListOfListOfDMatchInt() {
fail("Not yet implemented");
}
public void testMatchMatListOfKeyPointMatListOfKeyPointListOfDMatchMat() {
fail("Not yet implemented");
}
public void testMatchMatListOfKeyPointMatListOfKeyPointListOfDMatch() {
fail("Not yet implemented");
}
public void testMatchMatListOfKeyPointListOfDMatchListOfMat() {
fail("Not yet implemented");
}
public void testMatchMatListOfKeyPointListOfDMatch() {
fail("Not yet implemented");
}
public void testRadiusMatchMatListOfKeyPointMatListOfKeyPointListOfListOfDMatchFloatMatBoolean() {
fail("Not yet implemented");
}
public void testRadiusMatchMatListOfKeyPointMatListOfKeyPointListOfListOfDMatchFloatMat() {
fail("Not yet implemented");
}
public void testRadiusMatchMatListOfKeyPointMatListOfKeyPointListOfListOfDMatchFloat() {
fail("Not yet implemented");
}
public void testRadiusMatchMatListOfKeyPointListOfListOfDMatchFloatListOfMatBoolean() {
fail("Not yet implemented");
}
public void testRadiusMatchMatListOfKeyPointListOfListOfDMatchFloatListOfMat() {
fail("Not yet implemented");
}
public void testRadiusMatchMatListOfKeyPointListOfListOfDMatchFloat() {
fail("Not yet implemented");
}
public void testRead() {
fail("Not yet implemented");
}
public void testTrain() {
fail("Not yet implemented");
}
public void testWrite() {
fail("Not yet implemented");
}
}

@ -3,7 +3,6 @@ package org.opencv.test.features2d;
import java.util.Arrays;
import java.util.List;
import org.opencv.core.Core;
import org.opencv.core.CvException;
import org.opencv.core.CvType;
import org.opencv.core.Mat;
@ -12,18 +11,18 @@ import org.opencv.core.MatOfKeyPoint;
import org.opencv.core.Point;
import org.opencv.core.Scalar;
import org.opencv.core.DMatch;
import org.opencv.features2d.DescriptorExtractor;
import org.opencv.features2d.DescriptorMatcher;
import org.opencv.features2d.FeatureDetector;
import org.opencv.core.KeyPoint;
import org.opencv.test.OpenCVTestCase;
import org.opencv.test.OpenCVTestRunner;
import org.opencv.imgproc.Imgproc;
import org.opencv.features2d.Feature2D;
public class FlannBasedDescriptorMatcherTest extends OpenCVTestCase {
static final String xmlParamsDefault = "<?xml version=\"1.0\"?>\n"
+ "<opencv_storage>\n"
+ "<format>3</format>\n"
+ "<indexParams>\n"
+ " <_>\n"
+ " <name>algorithm</name>\n"
@ -47,7 +46,8 @@ public class FlannBasedDescriptorMatcherTest extends OpenCVTestCase {
+ " <type>15</type>\n"
+ " <value>1</value></_></searchParams>\n"
+ "</opencv_storage>\n";
static final String ymlParamsDefault = "%YAML:1.0\n"
static final String ymlParamsDefault = "%YAML:1.0\n---\n"
+ "format: 3\n"
+ "indexParams:\n"
+ " -\n"
+ " name: algorithm\n"
@ -70,7 +70,8 @@ public class FlannBasedDescriptorMatcherTest extends OpenCVTestCase {
+ " name: sorted\n"
+ " type: 15\n"
+ " value: 1\n";
static final String ymlParamsModified = "%YAML:1.0\n"
static final String ymlParamsModified = "%YAML:1.0\n---\n"
+ "format: 3\n"
+ "indexParams:\n"
+ " -\n"
+ " name: algorithm\n"
@ -113,12 +114,12 @@ public class FlannBasedDescriptorMatcherTest extends OpenCVTestCase {
MatOfKeyPoint keypoints = new MatOfKeyPoint();
Mat descriptors = new Mat();
FeatureDetector detector = FeatureDetector.create(FeatureDetector.SURF);
DescriptorExtractor extractor = DescriptorExtractor.create(DescriptorExtractor.SURF);
Feature2D detector = createClassInstance(XFEATURES2D+"SURF", DEFAULT_FACTORY, null, null);
Feature2D extractor = createClassInstance(XFEATURES2D+"SURF", DEFAULT_FACTORY, null, null);
String filename = OpenCVTestRunner.getTempFileName("yml");
writeFile(filename, "%YAML:1.0\nhessianThreshold: 8000.\noctaves: 3\noctaveLayers: 4\nupright: 0\n");
detector.read(filename);
setProperty(detector, "hessianThreshold", "double", 8000);
setProperty(detector, "nOctaves", "int", 3);
setProperty(detector, "upright", "boolean", false);
detector.detect(img, keypoints);
extractor.compute(img, keypoints, descriptors);
@ -139,7 +140,7 @@ public class FlannBasedDescriptorMatcherTest extends OpenCVTestCase {
MatOfKeyPoint keypoints = new MatOfKeyPoint(new KeyPoint(50, 50, 16, 0, 20000, 1, -1), new KeyPoint(42, 42, 16, 160, 10000, 1, -1));
Mat descriptors = new Mat();
DescriptorExtractor extractor = DescriptorExtractor.create(DescriptorExtractor.SURF);
Feature2D extractor = createClassInstance(XFEATURES2D+"SURF", DEFAULT_FACTORY, null, null);
extractor.compute(img, keypoints, descriptors);

@ -1,39 +0,0 @@
package org.opencv.test.features2d;
import org.opencv.test.OpenCVTestCase;
public class GridDENSEFeatureDetectorTest extends OpenCVTestCase {
public void testCreate() {
fail("Not yet implemented");
}
public void testDetectListOfMatListOfListOfKeyPoint() {
fail("Not yet implemented");
}
public void testDetectListOfMatListOfListOfKeyPointListOfMat() {
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPoint() {
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPointMat() {
fail("Not yet implemented");
}
public void testEmpty() {
fail("Not yet implemented");
}
public void testRead() {
fail("Not yet implemented");
}
public void testWrite() {
fail("Not yet implemented");
}
}

@ -1,39 +0,0 @@
package org.opencv.test.features2d;
import org.opencv.test.OpenCVTestCase;
public class GridFASTFeatureDetectorTest extends OpenCVTestCase {
public void testCreate() {
fail("Not yet implemented");
}
public void testDetectListOfMatListOfListOfKeyPoint() {
fail("Not yet implemented");
}
public void testDetectListOfMatListOfListOfKeyPointListOfMat() {
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPoint() {
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPointMat() {
fail("Not yet implemented");
}
public void testEmpty() {
fail("Not yet implemented");
}
public void testRead() {
fail("Not yet implemented");
}
public void testWrite() {
fail("Not yet implemented");
}
}

@ -1,39 +0,0 @@
package org.opencv.test.features2d;
import org.opencv.test.OpenCVTestCase;
public class GridGFTTFeatureDetectorTest extends OpenCVTestCase {
public void testCreate() {
fail("Not yet implemented");
}
public void testDetectListOfMatListOfListOfKeyPoint() {
fail("Not yet implemented");
}
public void testDetectListOfMatListOfListOfKeyPointListOfMat() {
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPoint() {
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPointMat() {
fail("Not yet implemented");
}
public void testEmpty() {
fail("Not yet implemented");
}
public void testRead() {
fail("Not yet implemented");
}
public void testWrite() {
fail("Not yet implemented");
}
}

@ -1,39 +0,0 @@
package org.opencv.test.features2d;
import org.opencv.test.OpenCVTestCase;
public class GridHARRISFeatureDetectorTest extends OpenCVTestCase {
public void testCreate() {
fail("Not yet implemented");
}
public void testDetectListOfMatListOfListOfKeyPoint() {
fail("Not yet implemented");
}
public void testDetectListOfMatListOfListOfKeyPointListOfMat() {
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPoint() {
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPointMat() {
fail("Not yet implemented");
}
public void testEmpty() {
fail("Not yet implemented");
}
public void testRead() {
fail("Not yet implemented");
}
public void testWrite() {
fail("Not yet implemented");
}
}

@ -1,39 +0,0 @@
package org.opencv.test.features2d;
import org.opencv.test.OpenCVTestCase;
public class GridMSERFeatureDetectorTest extends OpenCVTestCase {
public void testCreate() {
fail("Not yet implemented");
}
public void testDetectListOfMatListOfListOfKeyPoint() {
fail("Not yet implemented");
}
public void testDetectListOfMatListOfListOfKeyPointListOfMat() {
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPoint() {
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPointMat() {
fail("Not yet implemented");
}
public void testEmpty() {
fail("Not yet implemented");
}
public void testRead() {
fail("Not yet implemented");
}
public void testWrite() {
fail("Not yet implemented");
}
}

@ -1,39 +0,0 @@
package org.opencv.test.features2d;
import org.opencv.test.OpenCVTestCase;
public class GridORBFeatureDetectorTest extends OpenCVTestCase {
public void testCreate() {
fail("Not yet implemented");
}
public void testDetectListOfMatListOfListOfKeyPoint() {
fail("Not yet implemented");
}
public void testDetectListOfMatListOfListOfKeyPointListOfMat() {
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPoint() {
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPointMat() {
fail("Not yet implemented");
}
public void testEmpty() {
fail("Not yet implemented");
}
public void testRead() {
fail("Not yet implemented");
}
public void testWrite() {
fail("Not yet implemented");
}
}

@ -1,39 +0,0 @@
package org.opencv.test.features2d;
import org.opencv.test.OpenCVTestCase;
public class GridSIFTFeatureDetectorTest extends OpenCVTestCase {
public void testCreate() {
fail("Not yet implemented");
}
public void testDetectListOfMatListOfListOfKeyPoint() {
fail("Not yet implemented");
}
public void testDetectListOfMatListOfListOfKeyPointListOfMat() {
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPoint() {
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPointMat() {
fail("Not yet implemented");
}
public void testEmpty() {
fail("Not yet implemented");
}
public void testRead() {
fail("Not yet implemented");
}
public void testWrite() {
fail("Not yet implemented");
}
}

@ -1,39 +0,0 @@
package org.opencv.test.features2d;
import org.opencv.test.OpenCVTestCase;
public class GridSIMPLEBLOBFeatureDetectorTest extends OpenCVTestCase {
public void testCreate() {
fail("Not yet implemented");
}
public void testDetectListOfMatListOfListOfKeyPoint() {
fail("Not yet implemented");
}
public void testDetectListOfMatListOfListOfKeyPointListOfMat() {
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPoint() {
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPointMat() {
fail("Not yet implemented");
}
public void testEmpty() {
fail("Not yet implemented");
}
public void testRead() {
fail("Not yet implemented");
}
public void testWrite() {
fail("Not yet implemented");
}
}

@ -1,39 +0,0 @@
package org.opencv.test.features2d;
import org.opencv.test.OpenCVTestCase;
public class GridSTARFeatureDetectorTest extends OpenCVTestCase {
public void testCreate() {
fail("Not yet implemented");
}
public void testDetectListOfMatListOfListOfKeyPoint() {
fail("Not yet implemented");
}
public void testDetectListOfMatListOfListOfKeyPointListOfMat() {
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPoint() {
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPointMat() {
fail("Not yet implemented");
}
public void testEmpty() {
fail("Not yet implemented");
}
public void testRead() {
fail("Not yet implemented");
}
public void testWrite() {
fail("Not yet implemented");
}
}

@ -1,39 +0,0 @@
package org.opencv.test.features2d;
import org.opencv.test.OpenCVTestCase;
public class GridSURFFeatureDetectorTest extends OpenCVTestCase {
public void testCreate() {
fail("Not yet implemented");
}
public void testDetectListOfMatListOfListOfKeyPoint() {
fail("Not yet implemented");
}
public void testDetectListOfMatListOfListOfKeyPointListOfMat() {
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPoint() {
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPointMat() {
fail("Not yet implemented");
}
public void testEmpty() {
fail("Not yet implemented");
}
public void testRead() {
fail("Not yet implemented");
}
public void testWrite() {
fail("Not yet implemented");
}
}

@ -8,13 +8,14 @@ import org.opencv.core.Point;
import org.opencv.core.Scalar;
import org.opencv.features2d.DescriptorExtractor;
import org.opencv.core.KeyPoint;
import org.opencv.features2d.ORB;
import org.opencv.test.OpenCVTestCase;
import org.opencv.test.OpenCVTestRunner;
import org.opencv.imgproc.Imgproc;
public class ORBDescriptorExtractorTest extends OpenCVTestCase {
DescriptorExtractor extractor;
ORB extractor;
int matSize;
public static void assertDescriptorsClose(Mat expected, Mat actual, int allowedDistance) {
@ -33,7 +34,7 @@ public class ORBDescriptorExtractorTest extends OpenCVTestCase {
@Override
protected void setUp() throws Exception {
super.setUp();
extractor = DescriptorExtractor.create(DescriptorExtractor.ORB);
extractor = ORB.create();
matSize = 100;
}
@ -71,7 +72,8 @@ public class ORBDescriptorExtractorTest extends OpenCVTestCase {
}
public void testEmpty() {
assertFalse(extractor.empty());
// assertFalse(extractor.empty());
fail("Not yet implemented"); // ORB does not override empty() method
}
public void testRead() {
@ -80,9 +82,10 @@ public class ORBDescriptorExtractorTest extends OpenCVTestCase {
Mat img = getTestImg();
Mat descriptors = new Mat();
String filename = OpenCVTestRunner.getTempFileName("yml");
writeFile(filename, "%YAML:1.0\nscaleFactor: 1.1\nnLevels: 3\nfirstLevel: 0\nedgeThreshold: 31\npatchSize: 31\n");
extractor.read(filename);
// String filename = OpenCVTestRunner.getTempFileName("yml");
// writeFile(filename, "%YAML:1.0\n---\nscaleFactor: 1.1\nnLevels: 3\nfirstLevel: 0\nedgeThreshold: 31\npatchSize: 31\n");
// extractor.read(filename);
extractor = ORB.create(500, 1.1f, 3, 31, 0, 2, ORB.HARRIS_SCORE, 31, 20);
extractor.compute(img, keypoints, descriptors);
@ -100,7 +103,8 @@ public class ORBDescriptorExtractorTest extends OpenCVTestCase {
extractor.write(filename);
String truth = "<?xml version=\"1.0\"?>\n<opencv_storage>\n<name>Feature2D.ORB</name>\n<WTA_K>2</WTA_K>\n<edgeThreshold>31</edgeThreshold>\n<firstLevel>0</firstLevel>\n<nFeatures>500</nFeatures>\n<nLevels>8</nLevels>\n<patchSize>31</patchSize>\n<scaleFactor>1.2000000476837158e+00</scaleFactor>\n<scoreType>0</scoreType>\n</opencv_storage>\n";
// String truth = "<?xml version=\"1.0\"?>\n<opencv_storage>\n<name>Feature2D.ORB</name>\n<WTA_K>2</WTA_K>\n<edgeThreshold>31</edgeThreshold>\n<firstLevel>0</firstLevel>\n<nFeatures>500</nFeatures>\n<nLevels>8</nLevels>\n<patchSize>31</patchSize>\n<scaleFactor>1.2000000476837158e+00</scaleFactor>\n<scoreType>0</scoreType>\n</opencv_storage>\n";
String truth = "<?xml version=\"1.0\"?>\n<opencv_storage>\n</opencv_storage>\n";
String actual = readFile(filename);
actual = actual.replaceAll("e\\+000", "e+00"); // NOTE: workaround for different platforms double representation
assertEquals(truth, actual);
@ -111,7 +115,8 @@ public class ORBDescriptorExtractorTest extends OpenCVTestCase {
extractor.write(filename);
String truth = "%YAML:1.0\nname: \"Feature2D.ORB\"\nWTA_K: 2\nedgeThreshold: 31\nfirstLevel: 0\nnFeatures: 500\nnLevels: 8\npatchSize: 31\nscaleFactor: 1.2000000476837158e+00\nscoreType: 0\n";
// String truth = "%YAML:1.0\n---\nname: \"Feature2D.ORB\"\nWTA_K: 2\nedgeThreshold: 31\nfirstLevel: 0\nnFeatures: 500\nnLevels: 8\npatchSize: 31\nscaleFactor: 1.2000000476837158e+00\nscoreType: 0\n";
String truth = "%YAML:1.0\n---\n";
String actual = readFile(filename);
actual = actual.replaceAll("e\\+000", "e+00"); // NOTE: workaround for different platforms double representation
assertEquals(truth, actual);

@ -1,127 +0,0 @@
package org.opencv.test.features2d;
import org.opencv.test.OpenCVTestCase;
public class OneWayGenericDescriptorMatcherTest extends OpenCVTestCase {
public void testAdd() {
fail("Not yet implemented");
}
public void testClassifyMatListOfKeyPointMatListOfKeyPoint() {
fail("Not yet implemented");
}
public void testClassifyMatListOfKeyPoint() {
fail("Not yet implemented");
}
public void testClear() {
fail("Not yet implemented");
}
public void testCloneBoolean() {
fail("Not yet implemented");
}
public void testClone() {
fail("Not yet implemented");
}
public void testCreate() {
fail("Not yet implemented");
}
public void testEmpty() {
fail("Not yet implemented");
}
public void testGetTrainImages() {
fail("Not yet implemented");
}
public void testGetTrainKeypoints() {
fail("Not yet implemented");
}
public void testIsMaskSupported() {
fail("Not yet implemented");
}
public void testKnnMatchMatListOfKeyPointMatListOfKeyPointListOfListOfDMatchIntMatBoolean() {
fail("Not yet implemented");
}
public void testKnnMatchMatListOfKeyPointMatListOfKeyPointListOfListOfDMatchIntMat() {
fail("Not yet implemented");
}
public void testKnnMatchMatListOfKeyPointMatListOfKeyPointListOfListOfDMatchInt() {
fail("Not yet implemented");
}
public void testKnnMatchMatListOfKeyPointListOfListOfDMatchIntListOfMatBoolean() {
fail("Not yet implemented");
}
public void testKnnMatchMatListOfKeyPointListOfListOfDMatchIntListOfMat() {
fail("Not yet implemented");
}
public void testKnnMatchMatListOfKeyPointListOfListOfDMatchInt() {
fail("Not yet implemented");
}
public void testMatchMatListOfKeyPointMatListOfKeyPointListOfDMatchMat() {
fail("Not yet implemented");
}
public void testMatchMatListOfKeyPointMatListOfKeyPointListOfDMatch() {
fail("Not yet implemented");
}
public void testMatchMatListOfKeyPointListOfDMatchListOfMat() {
fail("Not yet implemented");
}
public void testMatchMatListOfKeyPointListOfDMatch() {
fail("Not yet implemented");
}
public void testRadiusMatchMatListOfKeyPointMatListOfKeyPointListOfListOfDMatchFloatMatBoolean() {
fail("Not yet implemented");
}
public void testRadiusMatchMatListOfKeyPointMatListOfKeyPointListOfListOfDMatchFloatMat() {
fail("Not yet implemented");
}
public void testRadiusMatchMatListOfKeyPointMatListOfKeyPointListOfListOfDMatchFloat() {
fail("Not yet implemented");
}
public void testRadiusMatchMatListOfKeyPointListOfListOfDMatchFloatListOfMatBoolean() {
fail("Not yet implemented");
}
public void testRadiusMatchMatListOfKeyPointListOfListOfDMatchFloatListOfMat() {
fail("Not yet implemented");
}
public void testRadiusMatchMatListOfKeyPointListOfListOfDMatchFloat() {
fail("Not yet implemented");
}
public void testRead() {
fail("Not yet implemented");
}
public void testTrain() {
fail("Not yet implemented");
}
public void testWrite() {
fail("Not yet implemented");
}
}

@ -1,39 +0,0 @@
package org.opencv.test.features2d;
import org.opencv.test.OpenCVTestCase;
public class OpponentBRIEFDescriptorExtractorTest extends OpenCVTestCase {
public void testComputeListOfMatListOfListOfKeyPointListOfMat() {
fail("Not yet implemented");
}
public void testComputeMatListOfKeyPointMat() {
fail("Not yet implemented");
}
public void testCreate() {
fail("Not yet implemented");
}
public void testDescriptorSize() {
fail("Not yet implemented");
}
public void testDescriptorType() {
fail("Not yet implemented");
}
public void testEmpty() {
fail("Not yet implemented");
}
public void testRead() {
fail("Not yet implemented");
}
public void testWrite() {
fail("Not yet implemented");
}
}

@ -1,39 +0,0 @@
package org.opencv.test.features2d;
import org.opencv.test.OpenCVTestCase;
public class OpponentORBDescriptorExtractorTest extends OpenCVTestCase {
public void testComputeListOfMatListOfListOfKeyPointListOfMat() {
fail("Not yet implemented");
}
public void testComputeMatListOfKeyPointMat() {
fail("Not yet implemented");
}
public void testCreate() {
fail("Not yet implemented");
}
public void testDescriptorSize() {
fail("Not yet implemented");
}
public void testDescriptorType() {
fail("Not yet implemented");
}
public void testEmpty() {
fail("Not yet implemented");
}
public void testRead() {
fail("Not yet implemented");
}
public void testWrite() {
fail("Not yet implemented");
}
}

@ -1,39 +0,0 @@
package org.opencv.test.features2d;
import org.opencv.test.OpenCVTestCase;
public class OpponentSIFTDescriptorExtractorTest extends OpenCVTestCase {
public void testComputeListOfMatListOfListOfKeyPointListOfMat() {
fail("Not yet implemented");
}
public void testComputeMatListOfKeyPointMat() {
fail("Not yet implemented");
}
public void testCreate() {
fail("Not yet implemented");
}
public void testDescriptorSize() {
fail("Not yet implemented");
}
public void testDescriptorType() {
fail("Not yet implemented");
}
public void testEmpty() {
fail("Not yet implemented");
}
public void testRead() {
fail("Not yet implemented");
}
public void testWrite() {
fail("Not yet implemented");
}
}

@ -1,39 +0,0 @@
package org.opencv.test.features2d;
import org.opencv.test.OpenCVTestCase;
public class OpponentSURFDescriptorExtractorTest extends OpenCVTestCase {
public void testComputeListOfMatListOfListOfKeyPointListOfMat() {
fail("Not yet implemented");
}
public void testComputeMatListOfKeyPointMat() {
fail("Not yet implemented");
}
public void testCreate() {
fail("Not yet implemented");
}
public void testDescriptorSize() {
fail("Not yet implemented");
}
public void testDescriptorType() {
fail("Not yet implemented");
}
public void testEmpty() {
fail("Not yet implemented");
}
public void testRead() {
fail("Not yet implemented");
}
public void testWrite() {
fail("Not yet implemented");
}
}

@ -1,39 +0,0 @@
package org.opencv.test.features2d;
import org.opencv.test.OpenCVTestCase;
public class PyramidDENSEFeatureDetectorTest extends OpenCVTestCase {
public void testCreate() {
fail("Not yet implemented");
}
public void testDetectListOfMatListOfListOfKeyPoint() {
fail("Not yet implemented");
}
public void testDetectListOfMatListOfListOfKeyPointListOfMat() {
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPoint() {
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPointMat() {
fail("Not yet implemented");
}
public void testEmpty() {
fail("Not yet implemented");
}
public void testRead() {
fail("Not yet implemented");
}
public void testWrite() {
fail("Not yet implemented");
}
}

@ -1,39 +0,0 @@
package org.opencv.test.features2d;
import org.opencv.test.OpenCVTestCase;
public class PyramidFASTFeatureDetectorTest extends OpenCVTestCase {
public void testCreate() {
fail("Not yet implemented");
}
public void testDetectListOfMatListOfListOfKeyPoint() {
fail("Not yet implemented");
}
public void testDetectListOfMatListOfListOfKeyPointListOfMat() {
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPoint() {
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPointMat() {
fail("Not yet implemented");
}
public void testEmpty() {
fail("Not yet implemented");
}
public void testRead() {
fail("Not yet implemented");
}
public void testWrite() {
fail("Not yet implemented");
}
}

@ -1,39 +0,0 @@
package org.opencv.test.features2d;
import org.opencv.test.OpenCVTestCase;
public class PyramidGFTTFeatureDetectorTest extends OpenCVTestCase {
public void testCreate() {
fail("Not yet implemented");
}
public void testDetectListOfMatListOfListOfKeyPoint() {
fail("Not yet implemented");
}
public void testDetectListOfMatListOfListOfKeyPointListOfMat() {
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPoint() {
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPointMat() {
fail("Not yet implemented");
}
public void testEmpty() {
fail("Not yet implemented");
}
public void testRead() {
fail("Not yet implemented");
}
public void testWrite() {
fail("Not yet implemented");
}
}

@ -1,39 +0,0 @@
package org.opencv.test.features2d;
import org.opencv.test.OpenCVTestCase;
public class PyramidHARRISFeatureDetectorTest extends OpenCVTestCase {
public void testCreate() {
fail("Not yet implemented");
}
public void testDetectListOfMatListOfListOfKeyPoint() {
fail("Not yet implemented");
}
public void testDetectListOfMatListOfListOfKeyPointListOfMat() {
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPoint() {
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPointMat() {
fail("Not yet implemented");
}
public void testEmpty() {
fail("Not yet implemented");
}
public void testRead() {
fail("Not yet implemented");
}
public void testWrite() {
fail("Not yet implemented");
}
}

@ -1,39 +0,0 @@
package org.opencv.test.features2d;
import org.opencv.test.OpenCVTestCase;
public class PyramidMSERFeatureDetectorTest extends OpenCVTestCase {
public void testCreate() {
fail("Not yet implemented");
}
public void testDetectListOfMatListOfListOfKeyPoint() {
fail("Not yet implemented");
}
public void testDetectListOfMatListOfListOfKeyPointListOfMat() {
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPoint() {
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPointMat() {
fail("Not yet implemented");
}
public void testEmpty() {
fail("Not yet implemented");
}
public void testRead() {
fail("Not yet implemented");
}
public void testWrite() {
fail("Not yet implemented");
}
}

@ -1,39 +0,0 @@
package org.opencv.test.features2d;
import org.opencv.test.OpenCVTestCase;
public class PyramidORBFeatureDetectorTest extends OpenCVTestCase {
public void testCreate() {
fail("Not yet implemented");
}
public void testDetectListOfMatListOfListOfKeyPoint() {
fail("Not yet implemented");
}
public void testDetectListOfMatListOfListOfKeyPointListOfMat() {
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPoint() {
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPointMat() {
fail("Not yet implemented");
}
public void testEmpty() {
fail("Not yet implemented");
}
public void testRead() {
fail("Not yet implemented");
}
public void testWrite() {
fail("Not yet implemented");
}
}

@ -1,39 +0,0 @@
package org.opencv.test.features2d;
import org.opencv.test.OpenCVTestCase;
public class PyramidSIFTFeatureDetectorTest extends OpenCVTestCase {
public void testCreate() {
fail("Not yet implemented");
}
public void testDetectListOfMatListOfListOfKeyPoint() {
fail("Not yet implemented");
}
public void testDetectListOfMatListOfListOfKeyPointListOfMat() {
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPoint() {
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPointMat() {
fail("Not yet implemented");
}
public void testEmpty() {
fail("Not yet implemented");
}
public void testRead() {
fail("Not yet implemented");
}
public void testWrite() {
fail("Not yet implemented");
}
}

@ -1,39 +0,0 @@
package org.opencv.test.features2d;
import org.opencv.test.OpenCVTestCase;
public class PyramidSIMPLEBLOBFeatureDetectorTest extends OpenCVTestCase {
public void testCreate() {
fail("Not yet implemented");
}
public void testDetectListOfMatListOfListOfKeyPoint() {
fail("Not yet implemented");
}
public void testDetectListOfMatListOfListOfKeyPointListOfMat() {
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPoint() {
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPointMat() {
fail("Not yet implemented");
}
public void testEmpty() {
fail("Not yet implemented");
}
public void testRead() {
fail("Not yet implemented");
}
public void testWrite() {
fail("Not yet implemented");
}
}

@ -1,39 +0,0 @@
package org.opencv.test.features2d;
import org.opencv.test.OpenCVTestCase;
public class PyramidSTARFeatureDetectorTest extends OpenCVTestCase {
public void testCreate() {
fail("Not yet implemented");
}
public void testDetectListOfMatListOfListOfKeyPoint() {
fail("Not yet implemented");
}
public void testDetectListOfMatListOfListOfKeyPointListOfMat() {
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPoint() {
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPointMat() {
fail("Not yet implemented");
}
public void testEmpty() {
fail("Not yet implemented");
}
public void testRead() {
fail("Not yet implemented");
}
public void testWrite() {
fail("Not yet implemented");
}
}

@ -1,39 +0,0 @@
package org.opencv.test.features2d;
import org.opencv.test.OpenCVTestCase;
public class PyramidSURFFeatureDetectorTest extends OpenCVTestCase {
public void testCreate() {
fail("Not yet implemented");
}
public void testDetectListOfMatListOfListOfKeyPoint() {
fail("Not yet implemented");
}
public void testDetectListOfMatListOfListOfKeyPointListOfMat() {
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPoint() {
fail("Not yet implemented");
}
public void testDetectMatListOfKeyPointMat() {
fail("Not yet implemented");
}
public void testEmpty() {
fail("Not yet implemented");
}
public void testRead() {
fail("Not yet implemented");
}
public void testWrite() {
fail("Not yet implemented");
}
}

@ -1,20 +1,19 @@
package org.opencv.test.features2d;
import org.opencv.core.Core;
import org.opencv.core.CvType;
import org.opencv.core.Mat;
import org.opencv.core.MatOfKeyPoint;
import org.opencv.core.Point;
import org.opencv.core.Scalar;
import org.opencv.features2d.DescriptorExtractor;
import org.opencv.core.KeyPoint;
import org.opencv.test.OpenCVTestCase;
import org.opencv.test.OpenCVTestRunner;
import org.opencv.imgproc.Imgproc;
import org.opencv.features2d.Feature2D;
public class SIFTDescriptorExtractorTest extends OpenCVTestCase {
DescriptorExtractor extractor;
Feature2D extractor;
KeyPoint keypoint;
int matSize;
Mat truth;
@ -30,7 +29,7 @@ public class SIFTDescriptorExtractorTest extends OpenCVTestCase {
@Override
protected void setUp() throws Exception {
super.setUp();
extractor = DescriptorExtractor.create(DescriptorExtractor.SIFT);
extractor = createClassInstance(XFEATURES2D+"SIFT", DEFAULT_FACTORY, null, null);
keypoint = new KeyPoint(55.775577545166016f, 44.224422454833984f, 16, 9.754629f, 8617.863f, 1, -1);
matSize = 100;
truth = new Mat(1, 128, CvType.CV_32FC1) {
@ -75,7 +74,8 @@ public class SIFTDescriptorExtractorTest extends OpenCVTestCase {
}
public void testEmpty() {
assertFalse(extractor.empty());
// assertFalse(extractor.empty());
fail("Not yet implemented"); //SIFT does not override empty() method
}
public void testRead() {
@ -87,7 +87,8 @@ public class SIFTDescriptorExtractorTest extends OpenCVTestCase {
extractor.write(filename);
String truth = "<?xml version=\"1.0\"?>\n<opencv_storage>\n<name>Feature2D.SIFT</name>\n<contrastThreshold>4.0000000000000001e-02</contrastThreshold>\n<edgeThreshold>10.</edgeThreshold>\n<nFeatures>0</nFeatures>\n<nOctaveLayers>3</nOctaveLayers>\n<sigma>1.6000000000000001e+00</sigma>\n</opencv_storage>\n";
// String truth = "<?xml version=\"1.0\"?>\n<opencv_storage>\n<name>Feature2D.SIFT</name>\n<contrastThreshold>4.0000000000000001e-02</contrastThreshold>\n<edgeThreshold>10.</edgeThreshold>\n<nFeatures>0</nFeatures>\n<nOctaveLayers>3</nOctaveLayers>\n<sigma>1.6000000000000001e+00</sigma>\n</opencv_storage>\n";
String truth = "<?xml version=\"1.0\"?>\n<opencv_storage>\n</opencv_storage>\n";
String actual = readFile(filename);
actual = actual.replaceAll("e([+-])0(\\d\\d)", "e$1$2"); // NOTE: workaround for different platforms double representation
assertEquals(truth, actual);
@ -98,7 +99,8 @@ public class SIFTDescriptorExtractorTest extends OpenCVTestCase {
extractor.write(filename);
String truth = "%YAML:1.0\nname: \"Feature2D.SIFT\"\ncontrastThreshold: 4.0000000000000001e-02\nedgeThreshold: 10.\nnFeatures: 0\nnOctaveLayers: 3\nsigma: 1.6000000000000001e+00\n";
// String truth = "%YAML:1.0\n---\nname: \"Feature2D.SIFT\"\ncontrastThreshold: 4.0000000000000001e-02\nedgeThreshold: 10.\nnFeatures: 0\nnOctaveLayers: 3\nsigma: 1.6000000000000001e+00\n";
String truth = "%YAML:1.0\n---\n";
String actual = readFile(filename);
actual = actual.replaceAll("e([+-])0(\\d\\d)", "e$1$2"); // NOTE: workaround for different platforms double representation
assertEquals(truth, actual);

@ -2,21 +2,20 @@ package org.opencv.test.features2d;
import java.util.Arrays;
import org.opencv.core.Core;
import org.opencv.core.CvType;
import org.opencv.core.Mat;
import org.opencv.core.MatOfKeyPoint;
import org.opencv.core.Point;
import org.opencv.core.Scalar;
import org.opencv.features2d.FeatureDetector;
import org.opencv.core.KeyPoint;
import org.opencv.test.OpenCVTestCase;
import org.opencv.test.OpenCVTestRunner;
import org.opencv.imgproc.Imgproc;
import org.opencv.features2d.Feature2D;
public class STARFeatureDetectorTest extends OpenCVTestCase {
FeatureDetector detector;
Feature2D detector;
int matSize;
KeyPoint[] truth;
@ -44,7 +43,7 @@ public class STARFeatureDetectorTest extends OpenCVTestCase {
protected void setUp() throws Exception {
super.setUp();
detector = FeatureDetector.create(FeatureDetector.STAR);
detector = createClassInstance(XFEATURES2D+"StarDetector", DEFAULT_FACTORY, null, null);
matSize = 200;
truth = new KeyPoint[] {
new KeyPoint( 95, 80, 22, -1, 31.5957f, 0, -1),
@ -91,7 +90,8 @@ public class STARFeatureDetectorTest extends OpenCVTestCase {
}
public void testEmpty() {
assertFalse(detector.empty());
// assertFalse(detector.empty());
fail("Not yet implemented");
}
public void testRead() {
@ -101,7 +101,7 @@ public class STARFeatureDetectorTest extends OpenCVTestCase {
detector.detect(img, keypoints1);
String filename = OpenCVTestRunner.getTempFileName("yml");
writeFile(filename, "%YAML:1.0\nmaxSize: 45\nresponseThreshold: 150\nlineThresholdProjected: 10\nlineThresholdBinarized: 8\nsuppressNonmaxSize: 5\n");
writeFile(filename, "%YAML:1.0\n---\nmaxSize: 45\nresponseThreshold: 150\nlineThresholdProjected: 10\nlineThresholdBinarized: 8\nsuppressNonmaxSize: 5\n");
detector.read(filename);
MatOfKeyPoint keypoints2 = new MatOfKeyPoint();
@ -115,7 +115,8 @@ public class STARFeatureDetectorTest extends OpenCVTestCase {
detector.write(filename);
String truth = "<?xml version=\"1.0\"?>\n<opencv_storage>\n<name>Feature2D.STAR</name>\n<lineThresholdBinarized>8</lineThresholdBinarized>\n<lineThresholdProjected>10</lineThresholdProjected>\n<maxSize>45</maxSize>\n<responseThreshold>30</responseThreshold>\n<suppressNonmaxSize>5</suppressNonmaxSize>\n</opencv_storage>\n";
// String truth = "<?xml version=\"1.0\"?>\n<opencv_storage>\n<name>Feature2D.STAR</name>\n<lineThresholdBinarized>8</lineThresholdBinarized>\n<lineThresholdProjected>10</lineThresholdProjected>\n<maxSize>45</maxSize>\n<responseThreshold>30</responseThreshold>\n<suppressNonmaxSize>5</suppressNonmaxSize>\n</opencv_storage>\n";
String truth = "<?xml version=\"1.0\"?>\n<opencv_storage>\n</opencv_storage>\n";
assertEquals(truth, readFile(filename));
}
@ -124,7 +125,8 @@ public class STARFeatureDetectorTest extends OpenCVTestCase {
detector.write(filename);
String truth = "%YAML:1.0\nname: \"Feature2D.STAR\"\nlineThresholdBinarized: 8\nlineThresholdProjected: 10\nmaxSize: 45\nresponseThreshold: 30\nsuppressNonmaxSize: 5\n";
// String truth = "%YAML:1.0\n---\nname: \"Feature2D.STAR\"\nlineThresholdBinarized: 8\nlineThresholdProjected: 10\nmaxSize: 45\nresponseThreshold: 30\nsuppressNonmaxSize: 5\n";
String truth = "%YAML:1.0\n---\n";
assertEquals(truth, readFile(filename));
}

@ -1,20 +1,19 @@
package org.opencv.test.features2d;
import org.opencv.core.Core;
import org.opencv.core.CvType;
import org.opencv.core.Mat;
import org.opencv.core.MatOfKeyPoint;
import org.opencv.core.Point;
import org.opencv.core.Scalar;
import org.opencv.features2d.DescriptorExtractor;
import org.opencv.core.KeyPoint;
import org.opencv.test.OpenCVTestCase;
import org.opencv.test.OpenCVTestRunner;
import org.opencv.imgproc.Imgproc;
import org.opencv.features2d.Feature2D;
public class SURFDescriptorExtractorTest extends OpenCVTestCase {
DescriptorExtractor extractor;
Feature2D extractor;
int matSize;
private Mat getTestImg() {
@ -29,10 +28,9 @@ public class SURFDescriptorExtractorTest extends OpenCVTestCase {
protected void setUp() throws Exception {
super.setUp();
extractor = DescriptorExtractor.create(DescriptorExtractor.SURF);
String filename = OpenCVTestRunner.getTempFileName("yml");
writeFile(filename, "%YAML:1.0\nextended: 1\nhessianThreshold: 100.\nnOctaveLayers: 2\nnOctaves: 4\nupright: 0");
extractor.read(filename);
Class[] cParams = {double.class, int.class, int.class, boolean.class, boolean.class};
Object[] oValues = {100, 2, 4, true, false};
extractor = createClassInstance(XFEATURES2D+"SURF", DEFAULT_FACTORY, cParams, oValues);
matSize = 100;
}
@ -85,12 +83,13 @@ public class SURFDescriptorExtractorTest extends OpenCVTestCase {
}
public void testEmpty() {
assertFalse(extractor.empty());
// assertFalse(extractor.empty());
fail("Not yet implemented");
}
public void testRead() {
String filename = OpenCVTestRunner.getTempFileName("yml");
writeFile(filename, "%YAML:1.0\nnOctaves: 4\nnOctaveLayers: 2\nextended: 1\nupright: 0\n");
writeFile(filename, "%YAML:1.0\n---\nnOctaves: 4\nnOctaveLayers: 2\nextended: 1\nupright: 0\n");
extractor.read(filename);
@ -102,7 +101,8 @@ public class SURFDescriptorExtractorTest extends OpenCVTestCase {
extractor.write(filename);
String truth = "<?xml version=\"1.0\"?>\n<opencv_storage>\n<name>Feature2D.SURF</name>\n<extended>1</extended>\n<hessianThreshold>100.</hessianThreshold>\n<nOctaveLayers>2</nOctaveLayers>\n<nOctaves>4</nOctaves>\n<upright>0</upright>\n</opencv_storage>\n";
// String truth = "<?xml version=\"1.0\"?>\n<opencv_storage>\n<name>Feature2D.SURF</name>\n<extended>1</extended>\n<hessianThreshold>100.</hessianThreshold>\n<nOctaveLayers>2</nOctaveLayers>\n<nOctaves>4</nOctaves>\n<upright>0</upright>\n</opencv_storage>\n";
String truth = "<?xml version=\"1.0\"?>\n<opencv_storage>\n</opencv_storage>\n";
assertEquals(truth, readFile(filename));
}
@ -111,7 +111,8 @@ public class SURFDescriptorExtractorTest extends OpenCVTestCase {
extractor.write(filename);
String truth = "%YAML:1.0\nname: \"Feature2D.SURF\"\nextended: 1\nhessianThreshold: 100.\nnOctaveLayers: 2\nnOctaves: 4\nupright: 0\n";
// String truth = "%YAML:1.0\n---\nname: \"Feature2D.SURF\"\nextended: 1\nhessianThreshold: 100.\nnOctaveLayers: 2\nnOctaves: 4\nupright: 0\n";
String truth = "%YAML:1.0\n---\n";
assertEquals(truth, readFile(filename));
}

@ -6,21 +6,20 @@ import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import org.opencv.core.Core;
import org.opencv.core.CvType;
import org.opencv.core.Mat;
import org.opencv.core.MatOfKeyPoint;
import org.opencv.core.Point;
import org.opencv.core.Scalar;
import org.opencv.features2d.FeatureDetector;
import org.opencv.core.KeyPoint;
import org.opencv.test.OpenCVTestCase;
import org.opencv.test.OpenCVTestRunner;
import org.opencv.imgproc.Imgproc;
import org.opencv.features2d.Feature2D;
public class SURFFeatureDetectorTest extends OpenCVTestCase {
FeatureDetector detector;
Feature2D detector;
int matSize;
KeyPoint[] truth;
@ -54,7 +53,7 @@ public class SURFFeatureDetectorTest extends OpenCVTestCase {
@Override
protected void setUp() throws Exception {
super.setUp();
detector = FeatureDetector.create(FeatureDetector.SURF);
detector = createClassInstance(XFEATURES2D+"SURF", DEFAULT_FACTORY, null, null);
matSize = 100;
truth = new KeyPoint[] {
new KeyPoint(55.775578f, 55.775578f, 16, 80.245735f, 8617.8633f, 0, -1),
@ -69,9 +68,11 @@ public class SURFFeatureDetectorTest extends OpenCVTestCase {
}
public void testDetectListOfMatListOfListOfKeyPoint() {
String filename = OpenCVTestRunner.getTempFileName("yml");
writeFile(filename, "%YAML:1.0\nhessianThreshold: 8000.\noctaves: 3\noctaveLayers: 4\nupright: 0\n");
detector.read(filename);
setProperty(detector, "hessianThreshold", "double", 8000);
setProperty(detector, "nOctaves", "int", 3);
setProperty(detector, "nOctaveLayers", "int", 4);
setProperty(detector, "upright", "boolean", false);
List<MatOfKeyPoint> keypoints = new ArrayList<MatOfKeyPoint>();
Mat cross = getTestImg();
@ -96,9 +97,11 @@ public class SURFFeatureDetectorTest extends OpenCVTestCase {
}
public void testDetectMatListOfKeyPoint() {
String filename = OpenCVTestRunner.getTempFileName("yml");
writeFile(filename, "%YAML:1.0\nhessianThreshold: 8000.\noctaves: 3\noctaveLayers: 4\nupright: 0\n");
detector.read(filename);
setProperty(detector, "hessianThreshold", "double", 8000);
setProperty(detector, "nOctaves", "int", 3);
setProperty(detector, "nOctaveLayers", "int", 4);
setProperty(detector, "upright", "boolean", false);
MatOfKeyPoint keypoints = new MatOfKeyPoint();
Mat cross = getTestImg();
@ -111,9 +114,11 @@ public class SURFFeatureDetectorTest extends OpenCVTestCase {
}
public void testDetectMatListOfKeyPointMat() {
String filename = OpenCVTestRunner.getTempFileName("yml");
writeFile(filename, "%YAML:1.0\nhessianThreshold: 8000.\noctaves: 3\noctaveLayers: 4\nupright: 0\n");
detector.read(filename);
setProperty(detector, "hessianThreshold", "double", 8000);
setProperty(detector, "nOctaves", "int", 3);
setProperty(detector, "nOctaveLayers", "int", 4);
setProperty(detector, "upright", "boolean", false);
Mat img = getTestImg();
Mat mask = getMaskImg();
@ -127,7 +132,8 @@ public class SURFFeatureDetectorTest extends OpenCVTestCase {
}
public void testEmpty() {
assertFalse(detector.empty());
// assertFalse(detector.empty());
fail("Not yet implemented");
}
public void testRead() {
@ -137,7 +143,7 @@ public class SURFFeatureDetectorTest extends OpenCVTestCase {
detector.detect(cross, keypoints1);
String filename = OpenCVTestRunner.getTempFileName("yml");
writeFile(filename, "%YAML:1.0\nhessianThreshold: 8000.\noctaves: 3\noctaveLayers: 4\nupright: 0\n");
writeFile(filename, "%YAML:1.0\n---\nhessianThreshold: 8000.\noctaves: 3\noctaveLayers: 4\nupright: 0\n");
detector.read(filename);
MatOfKeyPoint keypoints2 = new MatOfKeyPoint();
@ -151,7 +157,8 @@ public class SURFFeatureDetectorTest extends OpenCVTestCase {
detector.write(filename);
String truth = "<?xml version=\"1.0\"?>\n<opencv_storage>\n<name>Feature2D.SURF</name>\n<extended>0</extended>\n<hessianThreshold>100.</hessianThreshold>\n<nOctaveLayers>3</nOctaveLayers>\n<nOctaves>4</nOctaves>\n<upright>0</upright>\n</opencv_storage>\n";
// String truth = "<?xml version=\"1.0\"?>\n<opencv_storage>\n<name>Feature2D.SURF</name>\n<extended>0</extended>\n<hessianThreshold>100.</hessianThreshold>\n<nOctaveLayers>3</nOctaveLayers>\n<nOctaves>4</nOctaves>\n<upright>0</upright>\n</opencv_storage>\n";
String truth = "<?xml version=\"1.0\"?>\n<opencv_storage>\n</opencv_storage>\n";
assertEquals(truth, readFile(filename));
}
@ -160,7 +167,8 @@ public class SURFFeatureDetectorTest extends OpenCVTestCase {
detector.write(filename);
String truth = "%YAML:1.0\nname: \"Feature2D.SURF\"\nextended: 0\nhessianThreshold: 100.\nnOctaveLayers: 3\nnOctaves: 4\nupright: 0\n";
// String truth = "%YAML:1.0\n---\nname: \"Feature2D.SURF\"\nextended: 0\nhessianThreshold: 100.\nnOctaveLayers: 3\nnOctaves: 4\nupright: 0\n";
String truth = "%YAML:1.0\n---\n";
assertEquals(truth, readFile(filename));
}

@ -1116,7 +1116,7 @@ public class ImgprocTest extends OpenCVTestCase {
Imgproc.HoughLinesP(img, lines, 1, 3.1415926/180, 100);
assertEquals(2, lines.cols());
assertEquals(2, lines.rows());
/*
Log.d("HoughLinesP", "lines=" + lines);
@ -1407,14 +1407,14 @@ public class ImgprocTest extends OpenCVTestCase {
}
public void testMinEnclosingCircle() {
MatOfPoint2f points = new MatOfPoint2f(new Point(0, 0), new Point(-1, 0), new Point(0, -1), new Point(1, 0), new Point(0, 1));
MatOfPoint2f points = new MatOfPoint2f(new Point(0, 0), new Point(-100, 0), new Point(0, -100), new Point(100, 0), new Point(0, 100));
Point actualCenter = new Point();
float[] radius = new float[1];
Imgproc.minEnclosingCircle(points, actualCenter, radius);
assertEquals(new Point(0, 0), actualCenter);
assertEquals(1.03f, radius[0], EPS);
assertEquals(100.0f, radius[0], 1.0);
}
public void testMomentsMat() {

@ -24,6 +24,9 @@ import org.opencv.core.KeyPoint;
import org.opencv.imgcodecs.Imgcodecs;
import android.util.Log;
import java.lang.reflect.Method;
import static junit.framework.Assert.assertFalse;
import static junit.framework.Assert.assertTrue;
public class OpenCVTestCase extends TestCase {
//change to 'true' to unblock fail on fail("Not yet implemented")
@ -31,6 +34,9 @@ public class OpenCVTestCase extends TestCase {
protected static boolean isTestCaseEnabled = true;
protected static final String XFEATURES2D = "org.opencv.xfeatures2d.";
protected static final String DEFAULT_FACTORY = "create";
protected static final int matSize = 10;
protected static final double EPS = 0.001;
protected static final double weakEPS = 0.5;
@ -461,4 +467,78 @@ public class OpenCVTestCase extends TestCase {
}
}
protected <T> T createClassInstance(String cname, String factoryName, Class cParams[], Object oValues[]) {
T instance = null;
assertFalse("Class name should not be empty", "".equals(cname));
String message="";
try {
Class algClass = getClassForName(cname);
Method factory = null;
if(cParams!=null && cParams.length>0) {
if(!"".equals(factoryName)) {
factory = algClass.getDeclaredMethod(factoryName, cParams);
instance = (T) factory.invoke(null, oValues);
}
else {
instance = (T) algClass.getConstructor(cParams).newInstance(oValues);
}
}
else {
if(!"".equals(factoryName)) {
factory = algClass.getDeclaredMethod(factoryName);
instance = (T) factory.invoke(null);
}
else {
instance = (T) algClass.getConstructor().newInstance();
}
}
}
catch(Exception ex) {
message = TAG + " :: " + "could not instantiate " + cname + "! Exception: " + ex.getMessage();
}
assertTrue(message, instance!=null);
return instance;
}
protected <T> void setProperty(T instance, String propertyName, String propertyType, Object propertyValue) {
String message = "";
try {
String smethod = "set" + propertyName.substring(0,1).toUpperCase() + propertyName.substring(1);
Method setter = instance.getClass().getMethod(smethod, getClassForName(propertyType));
setter.invoke(instance, propertyValue);
}
catch(Exception ex) {
message = "Error when setting property [" + propertyName + "]: " + ex.getMessage();
}
assertTrue(message, "".equals(message));
}
protected Class getClassForName(String sclass) throws ClassNotFoundException{
if("int".equals(sclass))
return Integer.TYPE;
else if("long".equals(sclass))
return Long.TYPE;
else if("double".equals(sclass))
return Double.TYPE;
else if("float".equals(sclass))
return Float.TYPE;
else if("boolean".equals(sclass))
return Boolean.TYPE;
else if("char".equals(sclass))
return Character.TYPE;
else if("byte".equals(sclass))
return Byte.TYPE;
else if("short".equals(sclass))
return Short.TYPE;
else
return Class.forName(sclass);
}
}

@ -4,11 +4,10 @@ package org.opencv.test;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.nio.MappedByteBuffer;
import java.lang.reflect.Method;
import java.nio.channels.FileChannel;
import java.nio.charset.Charset;
import java.util.List;
@ -33,6 +32,9 @@ public class OpenCVTestCase extends TestCase {
protected static boolean isTestCaseEnabled = true;
protected static final String XFEATURES2D = "org.opencv.xfeatures2d.";
protected static final String DEFAULT_FACTORY = "create";
protected static final int matSize = 10;
protected static final double EPS = 0.001;
protected static final double weakEPS = 0.5;
@ -491,4 +493,77 @@ public class OpenCVTestCase extends TestCase {
}
}
protected <T> T createClassInstance(String cname, String factoryName, Class cParams[], Object oValues[]) {
T instance = null;
assertFalse("Class name should not be empty", "".equals(cname));
String message="";
try {
Class algClass = getClassForName(cname);
Method factory = null;
if(cParams!=null && cParams.length>0) {
if(!"".equals(factoryName)) {
factory = algClass.getDeclaredMethod(factoryName, cParams);
instance = (T) factory.invoke(null, oValues);
}
else {
instance = (T) algClass.getConstructor(cParams).newInstance(oValues);
}
}
else {
if(!"".equals(factoryName)) {
factory = algClass.getDeclaredMethod(factoryName);
instance = (T) factory.invoke(null);
}
else {
instance = (T) algClass.getConstructor().newInstance();
}
}
}
catch(Exception ex) {
message = TAG + " :: " + "could not instantiate " + cname + "! Exception: " + ex.getMessage();
}
assertTrue(message, instance!=null);
return instance;
}
protected <T> void setProperty(T instance, String propertyName, String propertyType, Object propertyValue) {
String message = "";
try {
String smethod = "set" + propertyName.substring(0,1).toUpperCase() + propertyName.substring(1);
Method setter = instance.getClass().getMethod(smethod, getClassForName(propertyType));
setter.invoke(instance, propertyValue);
}
catch(Exception ex) {
message = "Error when setting property [" + propertyName + "]: " + ex.getMessage();
}
assertTrue(message, "".equals(message));
}
protected Class getClassForName(String sclass) throws ClassNotFoundException{
if("int".equals(sclass))
return Integer.TYPE;
else if("long".equals(sclass))
return Long.TYPE;
else if("double".equals(sclass))
return Double.TYPE;
else if("float".equals(sclass))
return Float.TYPE;
else if("boolean".equals(sclass))
return Boolean.TYPE;
else if("char".equals(sclass))
return Character.TYPE;
else if("byte".equals(sclass))
return Byte.TYPE;
else if("short".equals(sclass))
return Short.TYPE;
else
return Class.forName(sclass);
}
}

Loading…
Cancel
Save