Commit 6f196103 authored by Andrey Kamaev's avatar Andrey Kamaev

Update regression checks in Java test

This follows SURF changes in 1f261c2f
parent b179e2dd
...@@ -85,11 +85,11 @@ public class BruteForceDescriptorMatcherTest extends OpenCVTestCase { ...@@ -85,11 +85,11 @@ public class BruteForceDescriptorMatcherTest extends OpenCVTestCase {
matSize = 100; matSize = 100;
truth = new DMatch[] { truth = new DMatch[] {
new DMatch(0, 0, 0, 1.0496940f), new DMatch(0, 0, 0, 0.6211397f),
new DMatch(1, 0, 0, 1.0984558f), new DMatch(1, 1, 0, 0.9177120f),
new DMatch(2, 1, 0, 0.4945875f), new DMatch(2, 1, 0, 0.3112163f),
new DMatch(3, 1, 0, 0.48435235f), new DMatch(3, 1, 0, 0.2925074f),
new DMatch(4, 0, 0, 1.0836693f) new DMatch(4, 1, 0, 0.9309178f)
}; };
} }
......
...@@ -85,11 +85,11 @@ public class BruteForceL1DescriptorMatcherTest extends OpenCVTestCase { ...@@ -85,11 +85,11 @@ public class BruteForceL1DescriptorMatcherTest extends OpenCVTestCase {
matSize = 100; matSize = 100;
truth = new DMatch[] { truth = new DMatch[] {
new DMatch(0, 1, 0, 6.9202340f), new DMatch(0, 0, 0, 3.0975165f),
new DMatch(1, 1, 0, 6.1675916f), new DMatch(1, 1, 0, 3.5680308f),
new DMatch(2, 1, 0, 2.6798590f), new DMatch(2, 1, 0, 1.3722466f),
new DMatch(3, 1, 0, 2.6545324f), new DMatch(3, 1, 0, 1.3041023f),
new DMatch(4, 0, 0, 6.1294870f) new DMatch(4, 1, 0, 3.5970376f)
}; };
} }
......
...@@ -90,11 +90,11 @@ public class BruteForceSL2DescriptorMatcherTest extends OpenCVTestCase { ...@@ -90,11 +90,11 @@ public class BruteForceSL2DescriptorMatcherTest extends OpenCVTestCase {
matSize = 100; matSize = 100;
truth = new DMatch[] { truth = new DMatch[] {
new DMatch(0, 0, 0, 1.1018573f), new DMatch(0, 0, 0, 0.3858146f),
new DMatch(1, 0, 0, 1.2066052f), new DMatch(1, 1, 0, 0.8421953f),
new DMatch(2, 1, 0, 0.2446168f), new DMatch(2, 1, 0, 0.0968556f),
new DMatch(3, 1, 0, 0.23459719f), new DMatch(3, 1, 0, 0.0855606f),
new DMatch(4, 0, 0, 1.174339f) new DMatch(4, 1, 0, 0.8666080f)
}; };
} }
......
...@@ -158,11 +158,11 @@ public class FlannBasedDescriptorMatcherTest extends OpenCVTestCase { ...@@ -158,11 +158,11 @@ public class FlannBasedDescriptorMatcherTest extends OpenCVTestCase {
matcher = DescriptorMatcher.create(DescriptorMatcher.FLANNBASED); matcher = DescriptorMatcher.create(DescriptorMatcher.FLANNBASED);
matSize = 100; matSize = 100;
truth = new DMatch[] { truth = new DMatch[] {
new DMatch(0, 0, 0, 1.049694f), new DMatch(0, 0, 0, 0.6211397f),
new DMatch(1, 0, 0, 1.0984558f), new DMatch(1, 1, 0, 0.9177120f),
new DMatch(2, 1, 0, 0.4945875f), new DMatch(2, 1, 0, 0.3112163f),
new DMatch(3, 1, 0, 0.48435235f), new DMatch(3, 1, 0, 0.2925075f),
new DMatch(4, 0, 0, 1.0836693f) new DMatch(4, 1, 0, 0.9309179f)
}; };
} }
......
...@@ -27,7 +27,12 @@ public class SURFDescriptorExtractorTest extends OpenCVTestCase { ...@@ -27,7 +27,12 @@ public class SURFDescriptorExtractorTest extends OpenCVTestCase {
@Override @Override
protected void setUp() throws Exception { protected void setUp() throws Exception {
super.setUp(); super.setUp();
extractor = DescriptorExtractor.create(DescriptorExtractor.SURF); 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; matSize = 100;
} }
...@@ -46,19 +51,19 @@ public class SURFDescriptorExtractorTest extends OpenCVTestCase { ...@@ -46,19 +51,19 @@ public class SURFDescriptorExtractorTest extends OpenCVTestCase {
Mat truth = new Mat(1, 128, CvType.CV_32FC1) { Mat truth = new Mat(1, 128, CvType.CV_32FC1) {
{ {
put(0, 0, put(0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0.045382127, 0.075976953, -0.031969212, 0.035002094, 0.012224297, 0, 0, 0, 0, 0, 0, 0, 0, 0.058821894, 0.058821894, -0.045962855, 0.046261817, 0.0085156476,
0.012286193, -0.0088025155, 0.0088025155, 0.00017225844, 0.00017225844, 0, 0, 8.2743405e-05, 0.0085754395, -0.0064509804, 0.0064509804, 0.00044069235, 0.00044069235, 0, 0, 0.00025723741,
8.2743405e-05, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8.2743405e-05, 8.2743405e-05, -0.00017225844, 0.00025723741, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.00025723741, 0.00025723741, -0.00044069235,
0.00017225844, 0, 0, 0.31723264, 0.42715758, -0.19872268, 0.23621935, 0.033304065, 0.033918764, 0.00044069235, 0, 0, 0.36278215, 0.36278215, -0.24688604, 0.26173124, 0.052068226, 0.052662034,
-0.021780485, 0.021780485, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0.0088025145, -0.032815345, 0.032815345, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -0.0064523756,
0.0088025145, 0.012224296, 0.012286192, -0.045382123, 0.075976953, 0.031969212, 0.035002094, 0.0064523756, 0.0082002236, 0.0088908644, -0.059001274, 0.059001274, 0.045789491, 0.04648013,
0.10047197, 0.21463872, -0.0012294546, 0.18176091, -0.075555265, 0.35627601, 0.01270232, 0.11961588, 0.22789426, -0.01322381, 0.18291828, -0.14042182, 0.23973691, 0.073782086, 0.23769434,
0.20058797, -0.037658721, 0.037658721, 0.064850949, 0.064850949, -0.27688536, 0.44229308, -0.027880307, 0.027880307, 0.049587864, 0.049587864, -0.33991757, 0.33991757, 0.21437603, 0.21437603,
0.14888979, 0.14888979, -0.0031531656, 0.0031531656, 0.0068481555, 0.0072466261, -0.034193151, -0.0020763327, 0.0020763327, 0.006245892, 0.006245892, -0.04067041, 0.04067041, 0.019361559,
0.040314503, 0.01108359, 0.023398584, -0.00071876607, 0.00071876607, -0.0031819802, 0.019361559, 0, 0, -0.0035977389, 0.0035977389, 0, 0, -0.00099993451, 0.00099993451, 0.040670406,
0.0031819802, 0, 0, -0.0013680183, 0.0013680183, 0.034193147, 0.040314503, -0.01108359, 0.040670406, -0.019361559, 0.019361559, 0.006245892, 0.006245892, -0.0020763327, 0.0020763327,
0.023398584, 0.006848156, 0.0072466265, -0.0031531656, 0.0031531656, 0, 0, 0, 0, 0, 0, 0, 0, -0.00034532088, 0.00034532088, 0, 0, 0, 0, 0.00034532088, 0.00034532088, -0.00099993451,
-0.0013680183, 0.0013680183, 0, 0, 0.00071876607, 0.00071876607, 0.0031819802, 0.0031819802 0.00099993451, 0, 0, 0, 0, 0.0035977389, 0.0035977389
); );
} }
}; };
......
...@@ -150,7 +150,7 @@ public class SURFFeatureDetectorTest extends OpenCVTestCase { ...@@ -150,7 +150,7 @@ public class SURFFeatureDetectorTest extends OpenCVTestCase {
detector.write(filename); detector.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>0</extended>\n<hessianThreshold>100.</hessianThreshold>\n<nOctaveLayers>3</nOctaveLayers>\n<nOctaves>4</nOctaves>\n<upright>0</upright>\n</opencv_storage>\n";
assertEquals(truth, readFile(filename)); assertEquals(truth, readFile(filename));
} }
...@@ -159,7 +159,7 @@ public class SURFFeatureDetectorTest extends OpenCVTestCase { ...@@ -159,7 +159,7 @@ public class SURFFeatureDetectorTest extends OpenCVTestCase {
detector.write(filename); 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)); assertEquals(truth, readFile(filename));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment