From 6f1961031c17ea8cd91e3d076eb26a428f52d51f Mon Sep 17 00:00:00 2001 From: Andrey Kamaev Date: Fri, 1 Feb 2013 14:37:24 +0400 Subject: [PATCH] Update regression checks in Java test This follows SURF changes in 1f261c2 --- .../BruteForceDescriptorMatcherTest.java | 10 +++--- .../BruteForceL1DescriptorMatcherTest.java | 10 +++--- .../BruteForceSL2DescriptorMatcherTest.java | 10 +++--- .../FlannBasedDescriptorMatcherTest.java | 10 +++--- .../SURFDescriptorExtractorTest.java | 31 +++++++++++-------- .../features2d/SURFFeatureDetectorTest.java | 4 +-- 6 files changed, 40 insertions(+), 35 deletions(-) diff --git a/modules/java/android_test/src/org/opencv/test/features2d/BruteForceDescriptorMatcherTest.java b/modules/java/android_test/src/org/opencv/test/features2d/BruteForceDescriptorMatcherTest.java index 28e07b1b2..2d4330735 100644 --- a/modules/java/android_test/src/org/opencv/test/features2d/BruteForceDescriptorMatcherTest.java +++ b/modules/java/android_test/src/org/opencv/test/features2d/BruteForceDescriptorMatcherTest.java @@ -85,11 +85,11 @@ public class BruteForceDescriptorMatcherTest extends OpenCVTestCase { matSize = 100; truth = new DMatch[] { - new DMatch(0, 0, 0, 1.0496940f), - new DMatch(1, 0, 0, 1.0984558f), - new DMatch(2, 1, 0, 0.4945875f), - new DMatch(3, 1, 0, 0.48435235f), - new DMatch(4, 0, 0, 1.0836693f) + new DMatch(0, 0, 0, 0.6211397f), + new DMatch(1, 1, 0, 0.9177120f), + new DMatch(2, 1, 0, 0.3112163f), + new DMatch(3, 1, 0, 0.2925074f), + new DMatch(4, 1, 0, 0.9309178f) }; } diff --git a/modules/java/android_test/src/org/opencv/test/features2d/BruteForceL1DescriptorMatcherTest.java b/modules/java/android_test/src/org/opencv/test/features2d/BruteForceL1DescriptorMatcherTest.java index d5370f32b..5d0ab51e4 100644 --- a/modules/java/android_test/src/org/opencv/test/features2d/BruteForceL1DescriptorMatcherTest.java +++ b/modules/java/android_test/src/org/opencv/test/features2d/BruteForceL1DescriptorMatcherTest.java @@ -85,11 +85,11 @@ public class BruteForceL1DescriptorMatcherTest extends OpenCVTestCase { matSize = 100; truth = new DMatch[] { - new DMatch(0, 1, 0, 6.9202340f), - new DMatch(1, 1, 0, 6.1675916f), - new DMatch(2, 1, 0, 2.6798590f), - new DMatch(3, 1, 0, 2.6545324f), - new DMatch(4, 0, 0, 6.1294870f) + new DMatch(0, 0, 0, 3.0975165f), + new DMatch(1, 1, 0, 3.5680308f), + new DMatch(2, 1, 0, 1.3722466f), + new DMatch(3, 1, 0, 1.3041023f), + new DMatch(4, 1, 0, 3.5970376f) }; } diff --git a/modules/java/android_test/src/org/opencv/test/features2d/BruteForceSL2DescriptorMatcherTest.java b/modules/java/android_test/src/org/opencv/test/features2d/BruteForceSL2DescriptorMatcherTest.java index 39253f044..6a097b4fa 100644 --- a/modules/java/android_test/src/org/opencv/test/features2d/BruteForceSL2DescriptorMatcherTest.java +++ b/modules/java/android_test/src/org/opencv/test/features2d/BruteForceSL2DescriptorMatcherTest.java @@ -90,11 +90,11 @@ public class BruteForceSL2DescriptorMatcherTest extends OpenCVTestCase { matSize = 100; truth = new DMatch[] { - new DMatch(0, 0, 0, 1.1018573f), - new DMatch(1, 0, 0, 1.2066052f), - new DMatch(2, 1, 0, 0.2446168f), - new DMatch(3, 1, 0, 0.23459719f), - new DMatch(4, 0, 0, 1.174339f) + new DMatch(0, 0, 0, 0.3858146f), + new DMatch(1, 1, 0, 0.8421953f), + new DMatch(2, 1, 0, 0.0968556f), + new DMatch(3, 1, 0, 0.0855606f), + new DMatch(4, 1, 0, 0.8666080f) }; } diff --git a/modules/java/android_test/src/org/opencv/test/features2d/FlannBasedDescriptorMatcherTest.java b/modules/java/android_test/src/org/opencv/test/features2d/FlannBasedDescriptorMatcherTest.java index 96e498639..70c994b28 100644 --- a/modules/java/android_test/src/org/opencv/test/features2d/FlannBasedDescriptorMatcherTest.java +++ b/modules/java/android_test/src/org/opencv/test/features2d/FlannBasedDescriptorMatcherTest.java @@ -158,11 +158,11 @@ public class FlannBasedDescriptorMatcherTest extends OpenCVTestCase { matcher = DescriptorMatcher.create(DescriptorMatcher.FLANNBASED); matSize = 100; truth = new DMatch[] { - new DMatch(0, 0, 0, 1.049694f), - new DMatch(1, 0, 0, 1.0984558f), - new DMatch(2, 1, 0, 0.4945875f), - new DMatch(3, 1, 0, 0.48435235f), - new DMatch(4, 0, 0, 1.0836693f) + new DMatch(0, 0, 0, 0.6211397f), + new DMatch(1, 1, 0, 0.9177120f), + new DMatch(2, 1, 0, 0.3112163f), + new DMatch(3, 1, 0, 0.2925075f), + new DMatch(4, 1, 0, 0.9309179f) }; } diff --git a/modules/java/android_test/src/org/opencv/test/features2d/SURFDescriptorExtractorTest.java b/modules/java/android_test/src/org/opencv/test/features2d/SURFDescriptorExtractorTest.java index 8b063ee4f..af2e26efb 100644 --- a/modules/java/android_test/src/org/opencv/test/features2d/SURFDescriptorExtractorTest.java +++ b/modules/java/android_test/src/org/opencv/test/features2d/SURFDescriptorExtractorTest.java @@ -27,7 +27,12 @@ public class SURFDescriptorExtractorTest extends OpenCVTestCase { @Override 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); + matSize = 100; } @@ -46,19 +51,19 @@ public class SURFDescriptorExtractorTest extends OpenCVTestCase { Mat truth = new Mat(1, 128, CvType.CV_32FC1) { { put(0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0.045382127, 0.075976953, -0.031969212, 0.035002094, 0.012224297, - 0.012286193, -0.0088025155, 0.0088025155, 0.00017225844, 0.00017225844, 0, 0, 8.2743405e-05, - 8.2743405e-05, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8.2743405e-05, 8.2743405e-05, -0.00017225844, - 0.00017225844, 0, 0, 0.31723264, 0.42715758, -0.19872268, 0.23621935, 0.033304065, 0.033918764, - -0.021780485, 0.021780485, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0.0088025145, - 0.0088025145, 0.012224296, 0.012286192, -0.045382123, 0.075976953, 0.031969212, 0.035002094, - 0.10047197, 0.21463872, -0.0012294546, 0.18176091, -0.075555265, 0.35627601, 0.01270232, - 0.20058797, -0.037658721, 0.037658721, 0.064850949, 0.064850949, -0.27688536, 0.44229308, - 0.14888979, 0.14888979, -0.0031531656, 0.0031531656, 0.0068481555, 0.0072466261, -0.034193151, - 0.040314503, 0.01108359, 0.023398584, -0.00071876607, 0.00071876607, -0.0031819802, - 0.0031819802, 0, 0, -0.0013680183, 0.0013680183, 0.034193147, 0.040314503, -0.01108359, - 0.023398584, 0.006848156, 0.0072466265, -0.0031531656, 0.0031531656, 0, 0, 0, 0, 0, 0, 0, 0, - -0.0013680183, 0.0013680183, 0, 0, 0.00071876607, 0.00071876607, 0.0031819802, 0.0031819802 + 0, 0, 0, 0, 0, 0, 0, 0, 0.058821894, 0.058821894, -0.045962855, 0.046261817, 0.0085156476, + 0.0085754395, -0.0064509804, 0.0064509804, 0.00044069235, 0.00044069235, 0, 0, 0.00025723741, + 0.00025723741, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.00025723741, 0.00025723741, -0.00044069235, + 0.00044069235, 0, 0, 0.36278215, 0.36278215, -0.24688604, 0.26173124, 0.052068226, 0.052662034, + -0.032815345, 0.032815345, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0.0064523756, + 0.0064523756, 0.0082002236, 0.0088908644, -0.059001274, 0.059001274, 0.045789491, 0.04648013, + 0.11961588, 0.22789426, -0.01322381, 0.18291828, -0.14042182, 0.23973691, 0.073782086, 0.23769434, + -0.027880307, 0.027880307, 0.049587864, 0.049587864, -0.33991757, 0.33991757, 0.21437603, 0.21437603, + -0.0020763327, 0.0020763327, 0.006245892, 0.006245892, -0.04067041, 0.04067041, 0.019361559, + 0.019361559, 0, 0, -0.0035977389, 0.0035977389, 0, 0, -0.00099993451, 0.00099993451, 0.040670406, + 0.040670406, -0.019361559, 0.019361559, 0.006245892, 0.006245892, -0.0020763327, 0.0020763327, + -0.00034532088, 0.00034532088, 0, 0, 0, 0, 0.00034532088, 0.00034532088, -0.00099993451, + 0.00099993451, 0, 0, 0, 0, 0.0035977389, 0.0035977389 ); } }; diff --git a/modules/java/android_test/src/org/opencv/test/features2d/SURFFeatureDetectorTest.java b/modules/java/android_test/src/org/opencv/test/features2d/SURFFeatureDetectorTest.java index 29da6ffcb..778d6f373 100644 --- a/modules/java/android_test/src/org/opencv/test/features2d/SURFFeatureDetectorTest.java +++ b/modules/java/android_test/src/org/opencv/test/features2d/SURFFeatureDetectorTest.java @@ -150,7 +150,7 @@ public class SURFFeatureDetectorTest extends OpenCVTestCase { detector.write(filename); - String truth = "\n\nFeature2D.SURF\n1\n100.\n2\n4\n0\n\n"; + String truth = "\n\nFeature2D.SURF\n0\n100.\n3\n4\n0\n\n"; assertEquals(truth, readFile(filename)); } @@ -159,7 +159,7 @@ public class SURFFeatureDetectorTest extends OpenCVTestCase { detector.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\nname: \"Feature2D.SURF\"\nextended: 0\nhessianThreshold: 100.\nnOctaveLayers: 3\nnOctaves: 4\nupright: 0\n"; assertEquals(truth, readFile(filename)); }