Skip to content

Commit 79f593a

Browse files
author
Andrey Pavlenko
committed
Merge pull request opencv#3198 from mshabunin:java_test_fix
2 parents 71edf1b + 39874ef commit 79f593a

28 files changed

+87
-53
lines changed

cmake/OpenCVDetectPython.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ find_python(3.4 "${MIN_VER_PYTHON3}" PYTHON3_LIBRARY PYTHON3_INCLUDE_DIR
233233
PYTHON3_NUMPY_INCLUDE_DIRS PYTHON3_NUMPY_VERSION)
234234

235235
# Use Python 2 as default Python interpreter
236-
if(PYTHON2LIBS_FOUND)
236+
if(PYTHON2INTERP_FOUND)
237237
set(PYTHON_DEFAULT_AVAILABLE "TRUE")
238238
set(PYTHON_DEFAULT_EXECUTABLE "${PYTHON2_EXECUTABLE}")
239239
endif()

modules/java/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ if(IOS OR NOT PYTHON_DEFAULT_AVAILABLE OR NOT ANT_EXECUTABLE OR NOT (JNI_FOUND O
88
endif()
99

1010
set(the_description "The java bindings")
11-
ocv_add_module(java BINDINGS opencv_core opencv_imgproc OPTIONAL opencv_objdetect opencv_features2d opencv_video opencv_imgcodecs opencv_videoio opencv_calib3d opencv_photo opencv_xfeatures2d)
11+
ocv_add_module(java BINDINGS opencv_core opencv_imgproc OPTIONAL opencv_objdetect opencv_features2d opencv_video opencv_imgcodecs opencv_videoio opencv_calib3d opencv_photo)
1212
ocv_module_include_directories("${CMAKE_CURRENT_SOURCE_DIR}/generator/src/cpp")
1313

1414
if(NOT ANDROID)

modules/java/android_test/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ set(opencv_test_java_bin_dir "${CMAKE_CURRENT_BINARY_DIR}/.build")
1111
# get project sources
1212
file(GLOB_RECURSE opencv_test_java_files RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/res/*" "${CMAKE_CURRENT_SOURCE_DIR}/src/*")
1313
ocv_list_filterout(opencv_test_java_files ".svn")
14+
# opencv_ml is broken
15+
ocv_list_filterout(opencv_test_java_files "/ml/")
1416

1517
# copy sources out from the build tree
1618
set(opencv_test_java_file_deps "")

modules/java/android_test/src/org/opencv/test/calib3d/Calib3dTest.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import org.opencv.core.Scalar;
1212
import org.opencv.core.Size;
1313
import org.opencv.test.OpenCVTestCase;
14+
import org.opencv.imgproc.Imgproc;
1415

1516
public class Calib3dTest extends OpenCVTestCase {
1617

@@ -162,7 +163,7 @@ public void testEstimateAffine3DMatMatMatMatDoubleDouble() {
162163
public void testFilterSpecklesMatDoubleIntDouble() {
163164
gray_16s_1024.copyTo(dst);
164165
Point center = new Point(gray_16s_1024.rows() / 2., gray_16s_1024.cols() / 2.);
165-
Core.circle(dst, center, 1, Scalar.all(4096));
166+
Imgproc.circle(dst, center, 1, Scalar.all(4096));
166167

167168
assertMatNotEqual(gray_16s_1024, dst);
168169
Calib3d.filterSpeckles(dst, 1024.0, 100, 0.);
@@ -199,7 +200,7 @@ public void testFindCirclesGridMatSizeMat() {
199200
for (int i = 0; i < 5; i++)
200201
for (int j = 0; j < 5; j++) {
201202
Point pt = new Point(size * (2 * i + 1) / 10, size * (2 * j + 1) / 10);
202-
Core.circle(img, pt, 10, new Scalar(0), -1);
203+
Imgproc.circle(img, pt, 10, new Scalar(0), -1);
203204
}
204205

205206
assertTrue(Calib3d.findCirclesGrid(img, new Size(5, 5), centers));
@@ -224,7 +225,7 @@ public void testFindCirclesGridMatSizeMatInt() {
224225
for (int i = 0; i < 3; i++)
225226
for (int j = 0; j < 5; j++) {
226227
Point pt = new Point(offsetx + (2 * i + j % 2) * step, offsety + step * j);
227-
Core.circle(img, pt, 10, new Scalar(0), -1);
228+
Imgproc.circle(img, pt, 10, new Scalar(0), -1);
228229
}
229230

230231
assertTrue(Calib3d.findCirclesGrid(img, new Size(3, 5), centers, Calib3d.CALIB_CB_CLUSTERING

modules/java/android_test/src/org/opencv/test/core/CoreTest.java

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import org.opencv.core.Size;
2020
import org.opencv.core.TermCriteria;
2121
import org.opencv.test.OpenCVTestCase;
22+
import org.opencv.imgproc.Imgproc;
2223

2324
public class CoreTest extends OpenCVTestCase {
2425

@@ -455,12 +456,12 @@ public void testFillConvexPolyMatListOfPointScalarIntInt() {
455456
// current implementation of fixed-point version of fillConvexPoly
456457
// requires image to be at least 2-pixel wider in each direction than
457458
// contour
458-
Imgproc.fillConvexPoly(gray0, polyline1, colorWhite, Imgproc.line_8, 0);
459+
Imgproc.fillConvexPoly(gray0, polyline1, colorWhite, Imgproc.LINE_8, 0);
459460

460461
assertTrue(0 < Core.countNonZero(gray0));
461462
assertTrue(gray0.total() > Core.countNonZero(gray0));
462463

463-
Imgproc.fillConvexPoly(gray0, polyline2, colorBlack, Imgproc.line_8, 1);
464+
Imgproc.fillConvexPoly(gray0, polyline2, colorBlack, Imgproc.LINE_8, 1);
464465

465466
assertEquals("see http://code.opencv.org/issues/1284", 0, Core.countNonZero(gray0));
466467
}
@@ -503,11 +504,11 @@ public void testFillPolyMatListOfListOfPointScalarIntIntPoint() {
503504
List<MatOfPoint> polylines2 = new ArrayList<MatOfPoint>();
504505
polylines2.add(polyline2);
505506

506-
Imgproc.fillPoly(gray0, polylines1, new Scalar(1), Imgproc.line_8, 0, new Point(0, 0));
507+
Imgproc.fillPoly(gray0, polylines1, new Scalar(1), Imgproc.LINE_8, 0, new Point(0, 0));
507508

508509
assertTrue(0 < Core.countNonZero(gray0));
509510

510-
Imgproc.fillPoly(gray0, polylines2, new Scalar(0), Imgproc.line_8, 0, new Point(1, 1));
511+
Imgproc.fillPoly(gray0, polylines2, new Scalar(0), Imgproc.LINE_8, 0, new Point(1, 1));
511512

512513
assertEquals(0, Core.countNonZero(gray0));
513514
}
@@ -877,11 +878,11 @@ public void testLineMatPointPointScalarIntIntInt() {
877878
Point point1_4 = new Point(3 * 4, 4 * 4);
878879
Point point2_4 = new Point(nPoints * 4, nPoints * 4);
879880

880-
Imgproc.line(gray0, point2, point1, colorWhite, 2, Imgproc.line_8, 0);
881+
Imgproc.line(gray0, point2, point1, colorWhite, 2, Imgproc.LINE_8, 0);
881882

882883
assertFalse(0 == Core.countNonZero(gray0));
883884

884-
Imgproc.line(gray0, point2_4, point1_4, colorBlack, 2, Imgproc.line_8, 2);
885+
Imgproc.line(gray0, point2_4, point1_4, colorBlack, 2, Imgproc.LINE_8, 2);
885886

886887
assertEquals(0, Core.countNonZero(gray0));
887888
}
@@ -1616,8 +1617,8 @@ public void testRectangleMatPointPointScalarIntInt() {
16161617
Point topLeft = new Point(0, 0);
16171618
Scalar color = new Scalar(128);
16181619

1619-
Imgproc.rectangle(gray0, bottomRight, topLeft, color, 2, Imgproc.line_AA, 0);
1620-
Imgproc.rectangle(gray0, bottomRight, topLeft, colorBlack, 2, Imgproc.line_4, 0);
1620+
Imgproc.rectangle(gray0, bottomRight, topLeft, color, 2, Imgproc.LINE_AA, 0);
1621+
Imgproc.rectangle(gray0, bottomRight, topLeft, colorBlack, 2, Imgproc.LINE_4, 0);
16211622

16221623
assertTrue(0 != Core.countNonZero(gray0));
16231624
}
@@ -1628,11 +1629,11 @@ public void testRectangleMatPointPointScalarIntIntInt() {
16281629
Point topLeft = new Point(0, 0);
16291630
Scalar color = new Scalar(128);
16301631

1631-
Imgproc.rectangle(gray0, bottomRight1, topLeft, color, 2, Imgproc.line_8, 1);
1632+
Imgproc.rectangle(gray0, bottomRight1, topLeft, color, 2, Imgproc.LINE_8, 1);
16321633

16331634
assertTrue(0 != Core.countNonZero(gray0));
16341635

1635-
Imgproc.rectangle(gray0, bottomRight2, topLeft, colorBlack, 2, Imgproc.line_8, 0);
1636+
Imgproc.rectangle(gray0, bottomRight2, topLeft, colorBlack, 2, Imgproc.LINE_8, 0);
16361637

16371638
assertEquals(0, Core.countNonZero(gray0));
16381639
}

modules/java/android_test/src/org/opencv/test/features2d/BRIEFDescriptorExtractorTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import org.opencv.core.KeyPoint;
1111
import org.opencv.test.OpenCVTestCase;
1212
import org.opencv.test.OpenCVTestRunner;
13+
import org.opencv.imgproc.Imgproc;
1314

1415
public class BRIEFDescriptorExtractorTest extends OpenCVTestCase {
1516

modules/java/android_test/src/org/opencv/test/features2d/BruteForceDescriptorMatcherTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import org.opencv.core.KeyPoint;
1919
import org.opencv.test.OpenCVTestCase;
2020
import org.opencv.test.OpenCVTestRunner;
21+
import org.opencv.imgproc.Imgproc;
2122

2223
public class BruteForceDescriptorMatcherTest extends OpenCVTestCase {
2324

modules/java/android_test/src/org/opencv/test/features2d/BruteForceHammingDescriptorMatcherTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import org.opencv.features2d.FeatureDetector;
1818
import org.opencv.test.OpenCVTestCase;
1919
import org.opencv.test.OpenCVTestRunner;
20+
import org.opencv.imgproc.Imgproc;
2021

2122
public class BruteForceHammingDescriptorMatcherTest extends OpenCVTestCase {
2223

modules/java/android_test/src/org/opencv/test/features2d/BruteForceHammingLUTDescriptorMatcherTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import org.opencv.features2d.FeatureDetector;
1717
import org.opencv.test.OpenCVTestCase;
1818
import org.opencv.test.OpenCVTestRunner;
19+
import org.opencv.imgproc.Imgproc;
1920

2021
public class BruteForceHammingLUTDescriptorMatcherTest extends OpenCVTestCase {
2122

modules/java/android_test/src/org/opencv/test/features2d/BruteForceL1DescriptorMatcherTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import org.opencv.core.KeyPoint;
1818
import org.opencv.test.OpenCVTestCase;
1919
import org.opencv.test.OpenCVTestRunner;
20+
import org.opencv.imgproc.Imgproc;
2021

2122
public class BruteForceL1DescriptorMatcherTest extends OpenCVTestCase {
2223

0 commit comments

Comments
 (0)