From b3bae170ed05e3e01c2c4b5a312b54e5b1dad92f Mon Sep 17 00:00:00 2001 From: Maksim Shabunin Date: Mon, 8 Sep 2014 17:35:55 +0400 Subject: [PATCH] Fixed java tests build - disabled xfeature2d dependency for java wrappers - fixed java wrappers build after cmake rerun - disabled opencv_ml tests temporarily - fixed Imgproc usage in java tests --- cmake/OpenCVDetectPython.cmake | 2 +- .../org/opencv/test/calib3d/Calib3dTest.java | 7 ++-- .../src/org/opencv/test/core/CoreTest.java | 21 +++++----- .../BRIEFDescriptorExtractorTest.java | 1 + .../BruteForceDescriptorMatcherTest.java | 1 + ...ruteForceHammingDescriptorMatcherTest.java | 1 + ...eForceHammingLUTDescriptorMatcherTest.java | 1 + .../BruteForceL1DescriptorMatcherTest.java | 1 + .../BruteForceSL2DescriptorMatcherTest.java | 1 + .../features2d/FASTFeatureDetectorTest.java | 1 + .../FlannBasedDescriptorMatcherTest.java | 1 + .../ORBDescriptorExtractorTest.java | 1 + .../SIFTDescriptorExtractorTest.java | 1 + .../features2d/STARFeatureDetectorTest.java | 11 ++--- .../SURFDescriptorExtractorTest.java | 1 + .../features2d/SURFFeatureDetectorTest.java | 1 + .../org/opencv/test/imgproc/ImgprocTest.java | 40 +++++++++---------- .../src/org/opencv/test/photo/PhotoTest.java | 5 ++- modules/java/generator/gen_java.py | 7 +++- modules/java/test/CMakeLists.txt | 2 + 20 files changed, 64 insertions(+), 43 deletions(-) diff --git a/cmake/OpenCVDetectPython.cmake b/cmake/OpenCVDetectPython.cmake index 91e62e38c..19f481bc3 100644 --- a/cmake/OpenCVDetectPython.cmake +++ b/cmake/OpenCVDetectPython.cmake @@ -228,7 +228,7 @@ find_python(3.4 "${MIN_VER_PYTHON3}" PYTHON3_LIBRARY PYTHON3_INCLUDE_DIR PYTHON3_NUMPY_INCLUDE_DIRS PYTHON3_NUMPY_VERSION) # Use Python 2 as default Python interpreter -if(PYTHON2LIBS_FOUND) +if(PYTHON2INTERP_FOUND) set(PYTHON_DEFAULT_AVAILABLE "TRUE") set(PYTHON_DEFAULT_EXECUTABLE "${PYTHON2_EXECUTABLE}") endif() diff --git a/modules/java/android_test/src/org/opencv/test/calib3d/Calib3dTest.java b/modules/java/android_test/src/org/opencv/test/calib3d/Calib3dTest.java index 69b8d0fcb..73ccc8f50 100644 --- a/modules/java/android_test/src/org/opencv/test/calib3d/Calib3dTest.java +++ b/modules/java/android_test/src/org/opencv/test/calib3d/Calib3dTest.java @@ -11,6 +11,7 @@ import org.opencv.core.Point; import org.opencv.core.Scalar; import org.opencv.core.Size; import org.opencv.test.OpenCVTestCase; +import org.opencv.imgproc.Imgproc; public class Calib3dTest extends OpenCVTestCase { @@ -162,7 +163,7 @@ public class Calib3dTest extends OpenCVTestCase { public void testFilterSpecklesMatDoubleIntDouble() { gray_16s_1024.copyTo(dst); Point center = new Point(gray_16s_1024.rows() / 2., gray_16s_1024.cols() / 2.); - Core.circle(dst, center, 1, Scalar.all(4096)); + Imgproc.circle(dst, center, 1, Scalar.all(4096)); assertMatNotEqual(gray_16s_1024, dst); Calib3d.filterSpeckles(dst, 1024.0, 100, 0.); @@ -199,7 +200,7 @@ public class Calib3dTest extends OpenCVTestCase { for (int i = 0; i < 5; i++) for (int j = 0; j < 5; j++) { Point pt = new Point(size * (2 * i + 1) / 10, size * (2 * j + 1) / 10); - Core.circle(img, pt, 10, new Scalar(0), -1); + Imgproc.circle(img, pt, 10, new Scalar(0), -1); } assertTrue(Calib3d.findCirclesGrid(img, new Size(5, 5), centers)); @@ -224,7 +225,7 @@ public class Calib3dTest extends OpenCVTestCase { for (int i = 0; i < 3; i++) for (int j = 0; j < 5; j++) { Point pt = new Point(offsetx + (2 * i + j % 2) * step, offsety + step * j); - Core.circle(img, pt, 10, new Scalar(0), -1); + Imgproc.circle(img, pt, 10, new Scalar(0), -1); } assertTrue(Calib3d.findCirclesGrid(img, new Size(3, 5), centers, Calib3d.CALIB_CB_CLUSTERING diff --git a/modules/java/android_test/src/org/opencv/test/core/CoreTest.java b/modules/java/android_test/src/org/opencv/test/core/CoreTest.java index b94edc0e1..9c60fd565 100644 --- a/modules/java/android_test/src/org/opencv/test/core/CoreTest.java +++ b/modules/java/android_test/src/org/opencv/test/core/CoreTest.java @@ -19,6 +19,7 @@ import org.opencv.core.Scalar; import org.opencv.core.Size; import org.opencv.core.TermCriteria; import org.opencv.test.OpenCVTestCase; +import org.opencv.imgproc.Imgproc; public class CoreTest extends OpenCVTestCase { @@ -455,12 +456,12 @@ public class CoreTest extends OpenCVTestCase { // current implementation of fixed-point version of fillConvexPoly // requires image to be at least 2-pixel wider in each direction than // contour - Imgproc.fillConvexPoly(gray0, polyline1, colorWhite, Imgproc.line_8, 0); + Imgproc.fillConvexPoly(gray0, polyline1, colorWhite, Imgproc.LINE_8, 0); assertTrue(0 < Core.countNonZero(gray0)); assertTrue(gray0.total() > Core.countNonZero(gray0)); - Imgproc.fillConvexPoly(gray0, polyline2, colorBlack, Imgproc.line_8, 1); + Imgproc.fillConvexPoly(gray0, polyline2, colorBlack, Imgproc.LINE_8, 1); assertEquals("see http://code.opencv.org/issues/1284", 0, Core.countNonZero(gray0)); } @@ -503,11 +504,11 @@ public class CoreTest extends OpenCVTestCase { List polylines2 = new ArrayList(); polylines2.add(polyline2); - Imgproc.fillPoly(gray0, polylines1, new Scalar(1), Imgproc.line_8, 0, new Point(0, 0)); + Imgproc.fillPoly(gray0, polylines1, new Scalar(1), Imgproc.LINE_8, 0, new Point(0, 0)); assertTrue(0 < Core.countNonZero(gray0)); - Imgproc.fillPoly(gray0, polylines2, new Scalar(0), Imgproc.line_8, 0, new Point(1, 1)); + Imgproc.fillPoly(gray0, polylines2, new Scalar(0), Imgproc.LINE_8, 0, new Point(1, 1)); assertEquals(0, Core.countNonZero(gray0)); } @@ -877,11 +878,11 @@ public class CoreTest extends OpenCVTestCase { Point point1_4 = new Point(3 * 4, 4 * 4); Point point2_4 = new Point(nPoints * 4, nPoints * 4); - Imgproc.line(gray0, point2, point1, colorWhite, 2, Imgproc.line_8, 0); + Imgproc.line(gray0, point2, point1, colorWhite, 2, Imgproc.LINE_8, 0); assertFalse(0 == Core.countNonZero(gray0)); - Imgproc.line(gray0, point2_4, point1_4, colorBlack, 2, Imgproc.line_8, 2); + Imgproc.line(gray0, point2_4, point1_4, colorBlack, 2, Imgproc.LINE_8, 2); assertEquals(0, Core.countNonZero(gray0)); } @@ -1616,8 +1617,8 @@ public class CoreTest extends OpenCVTestCase { Point topLeft = new Point(0, 0); Scalar color = new Scalar(128); - Imgproc.rectangle(gray0, bottomRight, topLeft, color, 2, Imgproc.line_AA, 0); - Imgproc.rectangle(gray0, bottomRight, topLeft, colorBlack, 2, Imgproc.line_4, 0); + Imgproc.rectangle(gray0, bottomRight, topLeft, color, 2, Imgproc.LINE_AA, 0); + Imgproc.rectangle(gray0, bottomRight, topLeft, colorBlack, 2, Imgproc.LINE_4, 0); assertTrue(0 != Core.countNonZero(gray0)); } @@ -1628,11 +1629,11 @@ public class CoreTest extends OpenCVTestCase { Point topLeft = new Point(0, 0); Scalar color = new Scalar(128); - Imgproc.rectangle(gray0, bottomRight1, topLeft, color, 2, Imgproc.line_8, 1); + Imgproc.rectangle(gray0, bottomRight1, topLeft, color, 2, Imgproc.LINE_8, 1); assertTrue(0 != Core.countNonZero(gray0)); - Imgproc.rectangle(gray0, bottomRight2, topLeft, colorBlack, 2, Imgproc.line_8, 0); + Imgproc.rectangle(gray0, bottomRight2, topLeft, colorBlack, 2, Imgproc.LINE_8, 0); assertEquals(0, Core.countNonZero(gray0)); } diff --git a/modules/java/android_test/src/org/opencv/test/features2d/BRIEFDescriptorExtractorTest.java b/modules/java/android_test/src/org/opencv/test/features2d/BRIEFDescriptorExtractorTest.java index f3e5c6562..9f10e2538 100644 --- a/modules/java/android_test/src/org/opencv/test/features2d/BRIEFDescriptorExtractorTest.java +++ b/modules/java/android_test/src/org/opencv/test/features2d/BRIEFDescriptorExtractorTest.java @@ -10,6 +10,7 @@ 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; public class BRIEFDescriptorExtractorTest extends OpenCVTestCase { 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 92290a68e..a6152eed2 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 @@ -18,6 +18,7 @@ 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; public class BruteForceDescriptorMatcherTest extends OpenCVTestCase { diff --git a/modules/java/android_test/src/org/opencv/test/features2d/BruteForceHammingDescriptorMatcherTest.java b/modules/java/android_test/src/org/opencv/test/features2d/BruteForceHammingDescriptorMatcherTest.java index f33a7acf5..c038f4af9 100644 --- a/modules/java/android_test/src/org/opencv/test/features2d/BruteForceHammingDescriptorMatcherTest.java +++ b/modules/java/android_test/src/org/opencv/test/features2d/BruteForceHammingDescriptorMatcherTest.java @@ -17,6 +17,7 @@ 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; public class BruteForceHammingDescriptorMatcherTest extends OpenCVTestCase { diff --git a/modules/java/android_test/src/org/opencv/test/features2d/BruteForceHammingLUTDescriptorMatcherTest.java b/modules/java/android_test/src/org/opencv/test/features2d/BruteForceHammingLUTDescriptorMatcherTest.java index f4d9437ba..9e2ce83e9 100644 --- a/modules/java/android_test/src/org/opencv/test/features2d/BruteForceHammingLUTDescriptorMatcherTest.java +++ b/modules/java/android_test/src/org/opencv/test/features2d/BruteForceHammingLUTDescriptorMatcherTest.java @@ -16,6 +16,7 @@ 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; public class BruteForceHammingLUTDescriptorMatcherTest extends OpenCVTestCase { 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 7e9b7223c..e15d070a0 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 @@ -17,6 +17,7 @@ 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; public class BruteForceL1DescriptorMatcherTest extends OpenCVTestCase { 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 e0361b145..90746766d 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 @@ -17,6 +17,7 @@ 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; public class BruteForceSL2DescriptorMatcherTest extends OpenCVTestCase { diff --git a/modules/java/android_test/src/org/opencv/test/features2d/FASTFeatureDetectorTest.java b/modules/java/android_test/src/org/opencv/test/features2d/FASTFeatureDetectorTest.java index 9e273e39f..0afe7eb8f 100644 --- a/modules/java/android_test/src/org/opencv/test/features2d/FASTFeatureDetectorTest.java +++ b/modules/java/android_test/src/org/opencv/test/features2d/FASTFeatureDetectorTest.java @@ -12,6 +12,7 @@ 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; public class FASTFeatureDetectorTest extends OpenCVTestCase { 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 e6d6a412f..3bdfa8990 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 @@ -18,6 +18,7 @@ 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; public class FlannBasedDescriptorMatcherTest extends OpenCVTestCase { diff --git a/modules/java/android_test/src/org/opencv/test/features2d/ORBDescriptorExtractorTest.java b/modules/java/android_test/src/org/opencv/test/features2d/ORBDescriptorExtractorTest.java index be974b36b..5869d6765 100644 --- a/modules/java/android_test/src/org/opencv/test/features2d/ORBDescriptorExtractorTest.java +++ b/modules/java/android_test/src/org/opencv/test/features2d/ORBDescriptorExtractorTest.java @@ -10,6 +10,7 @@ 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; public class ORBDescriptorExtractorTest extends OpenCVTestCase { diff --git a/modules/java/android_test/src/org/opencv/test/features2d/SIFTDescriptorExtractorTest.java b/modules/java/android_test/src/org/opencv/test/features2d/SIFTDescriptorExtractorTest.java index fd81aa4ab..33c5d450a 100644 --- a/modules/java/android_test/src/org/opencv/test/features2d/SIFTDescriptorExtractorTest.java +++ b/modules/java/android_test/src/org/opencv/test/features2d/SIFTDescriptorExtractorTest.java @@ -10,6 +10,7 @@ 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; public class SIFTDescriptorExtractorTest extends OpenCVTestCase { diff --git a/modules/java/android_test/src/org/opencv/test/features2d/STARFeatureDetectorTest.java b/modules/java/android_test/src/org/opencv/test/features2d/STARFeatureDetectorTest.java index 35e332c5c..282f04361 100644 --- a/modules/java/android_test/src/org/opencv/test/features2d/STARFeatureDetectorTest.java +++ b/modules/java/android_test/src/org/opencv/test/features2d/STARFeatureDetectorTest.java @@ -12,6 +12,7 @@ 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; public class STARFeatureDetectorTest extends OpenCVTestCase { @@ -33,11 +34,11 @@ public class STARFeatureDetectorTest extends OpenCVTestCase { int offset = 40; Mat img = new Mat(matSize, matSize, CvType.CV_8U, new Scalar(255)); - Core.circle(img, new Point(center - offset, center), radius, color, -1); - Core.circle(img, new Point(center + offset, center), radius, color, -1); - Core.circle(img, new Point(center, center - offset), radius, color, -1); - Core.circle(img, new Point(center, center + offset), radius, color, -1); - Core.circle(img, new Point(center, center), radius, color, -1); + Imgproc.circle(img, new Point(center - offset, center), radius, color, -1); + Imgproc.circle(img, new Point(center + offset, center), radius, color, -1); + Imgproc.circle(img, new Point(center, center - offset), radius, color, -1); + Imgproc.circle(img, new Point(center, center + offset), radius, color, -1); + Imgproc.circle(img, new Point(center, center), radius, color, -1); return img; } 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 96c61c951..8973592e6 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 @@ -10,6 +10,7 @@ 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; public class SURFDescriptorExtractorTest extends OpenCVTestCase { 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 576ea4589..75d1dab09 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 @@ -16,6 +16,7 @@ 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; public class SURFFeatureDetectorTest extends OpenCVTestCase { diff --git a/modules/java/android_test/src/org/opencv/test/imgproc/ImgprocTest.java b/modules/java/android_test/src/org/opencv/test/imgproc/ImgprocTest.java index c9c38a45f..f6cb5eee9 100644 --- a/modules/java/android_test/src/org/opencv/test/imgproc/ImgprocTest.java +++ b/modules/java/android_test/src/org/opencv/test/imgproc/ImgprocTest.java @@ -647,7 +647,7 @@ public class ImgprocTest extends OpenCVTestCase { List contours = new ArrayList(); Imgproc.findContours(gray0, contours, new Mat(), Imgproc.RETR_EXTERNAL, Imgproc.CHAIN_APPROX_SIMPLE); - Core.drawContours(gray0, contours, -1, new Scalar(0)); + Imgproc.drawContours(gray0, contours, -1, new Scalar(0)); assertEquals(0, Core.countNonZero(gray0)); } @@ -657,7 +657,7 @@ public class ImgprocTest extends OpenCVTestCase { List contours = new ArrayList(); Imgproc.findContours(gray0, contours, new Mat(), Imgproc.RETR_EXTERNAL, Imgproc.CHAIN_APPROX_SIMPLE); - Core.drawContours(gray0, contours, -1, new Scalar(0), Core.FILLED); + Imgproc.drawContours(gray0, contours, -1, new Scalar(0), Core.FILLED); assertEquals(0, Core.countNonZero(gray0)); } @@ -758,7 +758,7 @@ public class ImgprocTest extends OpenCVTestCase { assertEquals(contours.size(), 0); assertEquals(contours.size(), hierarchy.total()); - Imgproc.rectangle(img, new Point(10, 20), new Point(20, 30), new Scalar(100), 3, Imgproc.line_AA, 0); + Imgproc.rectangle(img, new Point(10, 20), new Point(20, 30), new Scalar(100), 3, Imgproc.LINE_AA, 0); Imgproc.rectangle(img, new Point(30, 35), new Point(40, 45), new Scalar(200)); Imgproc.findContours(img, contours, hierarchy, Imgproc.RETR_EXTERNAL, Imgproc.CHAIN_APPROX_SIMPLE); @@ -775,7 +775,7 @@ public class ImgprocTest extends OpenCVTestCase { List contours2 = new ArrayList(); Mat hierarchy = new Mat(); - Imgproc.rectangle(img, new Point(10, 20), new Point(20, 30), new Scalar(100), 3, Imgproc.line_AA, 0); + Imgproc.rectangle(img, new Point(10, 20), new Point(20, 30), new Scalar(100), 3, Imgproc.LINE_AA, 0); Imgproc.rectangle(img, new Point(30, 35), new Point(40, 45), new Scalar(200)); Imgproc.findContours(img, contours, hierarchy, Imgproc.RETR_EXTERNAL, Imgproc.CHAIN_APPROX_SIMPLE); @@ -817,24 +817,24 @@ public class ImgprocTest extends OpenCVTestCase { public void testFloodFillMatMatPointScalar() { Mat mask = new Mat(matSize + 2, matSize + 2, CvType.CV_8U, new Scalar(0)); Mat img = gray0; - Core.circle(mask, new Point(matSize / 2 + 1, matSize / 2 + 1), 3, new Scalar(2)); + Imgproc.circle(mask, new Point(matSize / 2 + 1, matSize / 2 + 1), 3, new Scalar(2)); int retval = Imgproc.floodFill(img, mask, new Point(matSize / 2, matSize / 2), new Scalar(1)); assertEquals(Core.countNonZero(img), retval); - Core.circle(mask, new Point(matSize / 2 + 1, matSize / 2 + 1), 3, new Scalar(0)); + Imgproc.circle(mask, new Point(matSize / 2 + 1, matSize / 2 + 1), 3, new Scalar(0)); assertEquals(retval + 4 * (matSize + 1), Core.countNonZero(mask)); assertMatEqual(mask.submat(1, matSize + 1, 1, matSize + 1), img); } public void testFloodFillMatMatPointScalar_WithoutMask() { Mat img = gray0; - Core.circle(img, new Point(matSize / 2, matSize / 2), 3, new Scalar(2)); + Imgproc.circle(img, new Point(matSize / 2, matSize / 2), 3, new Scalar(2)); // TODO: ideally we should pass null instead of "new Mat()" int retval = Imgproc.floodFill(img, new Mat(), new Point(matSize / 2, matSize / 2), new Scalar(1)); - Core.circle(img, new Point(matSize / 2, matSize / 2), 3, new Scalar(0)); + Imgproc.circle(img, new Point(matSize / 2, matSize / 2), 3, new Scalar(0)); assertEquals(Core.countNonZero(img), retval); } @@ -1063,7 +1063,7 @@ public class ImgprocTest extends OpenCVTestCase { Point center = new Point(img.cols() / 2, img.rows() / 2); int radius = Math.min(img.cols() / 4, img.rows() / 4); - Core.circle(img, center, radius, colorBlack, 3); + Imgproc.circle(img, center, radius, colorBlack, 3); Imgproc.HoughCircles(img, circles, Imgproc.CV_HOUGH_GRADIENT, 2, img.rows() / 4); @@ -1973,7 +1973,7 @@ public class ImgprocTest extends OpenCVTestCase { Scalar color128 = new Scalar(128); Scalar color0 = new Scalar(0); - Imgproc.circle(gray0, center2, radius * 2, color128, 2, Imgproc.line_4, 1/* + Imgproc.circle(gray0, center2, radius * 2, color128, 2, Imgproc.LINE_4, 1/* * Number * of * fractional @@ -1981,7 +1981,7 @@ public class ImgprocTest extends OpenCVTestCase { */); assertFalse(0 == Core.countNonZero(gray0)); - Imgproc.circle(gray0, center, radius, color0, 2, Imgproc.line_4, 0); + Imgproc.circle(gray0, center, radius, color0, 2, Imgproc.LINE_4, 0); assertTrue(0 == Core.countNonZero(gray0)); } @@ -1991,7 +1991,7 @@ public class ImgprocTest extends OpenCVTestCase { Point pt1 = new Point(5.0, 15.0); Point pt2 = new Point(25.0, 15.0); - assertTrue(Core.clipLine(r, pt1, pt2)); + assertTrue(Imgproc.clipLine(r, pt1, pt2)); Point pt1Clipped = new Point(10.0, 15.0); Point pt2Clipped = new Point(19.0, 15.0); @@ -2003,7 +2003,7 @@ public class ImgprocTest extends OpenCVTestCase { pt1Clipped = new Point(5.0, 5.0); pt2Clipped = new Point(25.0, 5.0); - assertFalse(Core.clipLine(r, pt1, pt2)); + assertFalse(Imgproc.clipLine(r, pt1, pt2)); assertEquals(pt1Clipped, pt1); assertEquals(pt2Clipped, pt2); @@ -2054,11 +2054,11 @@ public class ImgprocTest extends OpenCVTestCase { Size axes2 = new Size(4, 4); double angle = 30, startAngle = 0, endAngle = 30; - Imgproc.ellipse(gray0, center, axes, angle, startAngle, endAngle, colorWhite, Core.FILLED, Imgproc.line_4, 0); + Imgproc.ellipse(gray0, center, axes, angle, startAngle, endAngle, colorWhite, Core.FILLED, Imgproc.LINE_4, 0); assertTrue(0 != Core.countNonZero(gray0)); - Imgproc.ellipse(gray0, center2, axes2, angle, startAngle, endAngle, colorBlack, Core.FILLED, Imgproc.line_4, 1); + Imgproc.ellipse(gray0, center2, axes2, angle, startAngle, endAngle, colorBlack, Core.FILLED, Imgproc.LINE_4, 1); assertEquals(0, Core.countNonZero(gray0)); } @@ -2107,8 +2107,8 @@ public class ImgprocTest extends OpenCVTestCase { Size size = new Size(2, matSize * 2 / 3); RotatedRect box = new RotatedRect(center, size, 20); - Imgproc.ellipse(gray0, box, new Scalar(9), 1, Imgproc.line_AA); - Imgproc.ellipse(gray0, box, new Scalar(0), 1, Imgproc.line_4); + Imgproc.ellipse(gray0, box, new Scalar(9), 1, Imgproc.LINE_AA); + Imgproc.ellipse(gray0, box, new Scalar(0), 1, Imgproc.LINE_4); assertTrue(0 < Core.countNonZero(gray0)); } @@ -2144,11 +2144,11 @@ public class ImgprocTest extends OpenCVTestCase { List polyline2 = new ArrayList(); polyline2.add(new MatOfPoint(new Point(2, 2), new Point(14, 2), new Point(14, 12), new Point(2, 12))); - Imgproc.polylines(img, polyline1, true, new Scalar(100), 2, Imgproc.line_8, 0); + Imgproc.polylines(img, polyline1, true, new Scalar(100), 2, Imgproc.LINE_8, 0); assertTrue(Core.countNonZero(img) > 0); - Imgproc.polylines(img, polyline2, true, new Scalar(0), 2, Imgproc.line_8, 1); + Imgproc.polylines(img, polyline2, true, new Scalar(0), 2, Imgproc.LINE_8, 1); assertEquals(0, Core.countNonZero(img)); } @@ -2188,7 +2188,7 @@ public class ImgprocTest extends OpenCVTestCase { Mat img = new Mat(20 + (int) labelSize.height, 20 + (int) labelSize.width, CvType.CV_8U, colorBlack); Point origin = new Point(10, 10); - Imgproc.putText(img, text, origin, Core.FONT_HERSHEY_SIMPLEX, 1.0, colorWhite, 1, Imgproc.line_8, true); + Imgproc.putText(img, text, origin, Core.FONT_HERSHEY_SIMPLEX, 1.0, colorWhite, 1, Imgproc.LINE_8, true); assertTrue(Core.countNonZero(img) > 0); // check that border is not corrupted diff --git a/modules/java/android_test/src/org/opencv/test/photo/PhotoTest.java b/modules/java/android_test/src/org/opencv/test/photo/PhotoTest.java index c19caec68..27bac6380 100644 --- a/modules/java/android_test/src/org/opencv/test/photo/PhotoTest.java +++ b/modules/java/android_test/src/org/opencv/test/photo/PhotoTest.java @@ -5,13 +5,14 @@ import org.opencv.core.CvType; import org.opencv.core.Point; import org.opencv.photo.Photo; import org.opencv.test.OpenCVTestCase; +import org.opencv.imgproc.Imgproc; public class PhotoTest extends OpenCVTestCase { public void testInpaint() { Point p = new Point(matSize / 2, matSize / 2); - Core.circle(gray255, p, 2, colorBlack, Core.FILLED); - Core.circle(gray0, p, 2, colorWhite, Core.FILLED); + Imgproc.circle(gray255, p, 2, colorBlack, Core.FILLED); + Imgproc.circle(gray0, p, 2, colorWhite, Core.FILLED); Photo.inpaint(gray255, gray0, dst, 3, Photo.INPAINT_TELEA); diff --git a/modules/java/generator/gen_java.py b/modules/java/generator/gen_java.py index a4df8175b..2b66f95a3 100755 --- a/modules/java/generator/gen_java.py +++ b/modules/java/generator/gen_java.py @@ -127,7 +127,6 @@ missing_consts = \ ( ('SVD_MODIFY_A', 1), ('SVD_NO_UV', 2), ('SVD_FULL_UV', 4), ('FILLED', -1), - ('LINE_AA', 16), ('LINE_8', 8), ('LINE_4', 4), ('REDUCE_SUM', 0), ('REDUCE_AVG', 1), ('REDUCE_MAX', 2), ('REDUCE_MIN', 3), ) #public }, # Core @@ -142,7 +141,11 @@ missing_consts = \ ('IPL_BORDER_WRAP', 3 ), ('IPL_BORDER_REFLECT_101', 4 ), ('IPL_BORDER_TRANSPARENT', 5 ), - ) # private + ), # private + 'public' : + ( + ('LINE_AA', 16), ('LINE_8', 8), ('LINE_4', 4), + ) #public }, # Imgproc "Calib3d": diff --git a/modules/java/test/CMakeLists.txt b/modules/java/test/CMakeLists.txt index 5479b4264..4a40ce271 100644 --- a/modules/java/test/CMakeLists.txt +++ b/modules/java/test/CMakeLists.txt @@ -19,6 +19,8 @@ file(GLOB_RECURSE opencv_test_java_files RELATIVE "${android_source_dir}" "${and ocv_list_filterout(opencv_test_java_files "OpenCVTest(Case|Runner).java") # These files aren't for desktop Java. ocv_list_filterout(opencv_test_java_files "/android/") +# opencv_ml is broken +ocv_list_filterout(opencv_test_java_files "/ml/") # These are files updated for pure Java. file(GLOB_RECURSE modified_files RELATIVE "${java_source_dir}" "${java_source_dir}/src/*")