From 457123027e11e869a0bbe8edf58f1d5e74e776c7 Mon Sep 17 00:00:00 2001 From: Maksim Shabunin Date: Thu, 19 Feb 2015 16:17:19 +0300 Subject: [PATCH 1/2] Modified java wrapping mechanism --- cmake/OpenCVModule.cmake | 33 ++- modules/calib3d/CMakeLists.txt | 2 +- .../misc/java/test}/Calib3dTest.java | 0 .../misc/java/test}/StereoBMTest.java | 0 .../misc/java/test}/StereoSGBMTest.java | 0 modules/core/CMakeLists.txt | 4 +- .../core.filelist => core/misc/java/filelist} | 2 +- .../misc/java}/src/cpp/core_manual.cpp | 8 +- .../misc/java}/src/cpp/core_manual.hpp | 0 .../misc/java}/src/java/core+CvException.java | 0 .../misc/java}/src/java/core+CvType.java | 0 .../misc/java}/src/java/core+DMatch.java | 0 .../misc/java}/src/java/core+KeyPoint.java | 0 .../misc/java}/src/java/core+Mat.java | 0 .../misc/java}/src/java/core+MatOfByte.java | 0 .../misc/java}/src/java/core+MatOfDMatch.java | 0 .../misc/java}/src/java/core+MatOfDouble.java | 0 .../misc/java}/src/java/core+MatOfFloat.java | 0 .../misc/java}/src/java/core+MatOfFloat4.java | 0 .../misc/java}/src/java/core+MatOfFloat6.java | 0 .../misc/java}/src/java/core+MatOfInt.java | 0 .../misc/java}/src/java/core+MatOfInt4.java | 0 .../java}/src/java/core+MatOfKeyPoint.java | 0 .../misc/java}/src/java/core+MatOfPoint.java | 0 .../java}/src/java/core+MatOfPoint2f.java | 0 .../misc/java}/src/java/core+MatOfPoint3.java | 0 .../java}/src/java/core+MatOfPoint3f.java | 0 .../misc/java}/src/java/core+MatOfRect.java | 0 .../misc/java}/src/java/core+Point.java | 0 .../misc/java}/src/java/core+Point3.java | 0 .../misc/java}/src/java/core+Range.java | 0 .../misc/java}/src/java/core+Rect.java | 0 .../misc/java}/src/java/core+RotatedRect.java | 0 .../misc/java}/src/java/core+Scalar.java | 0 .../misc/java}/src/java/core+Size.java | 0 .../java}/src/java/core+TermCriteria.java | 0 .../misc/java/test}/CoreTest.java | 0 .../misc/java/test}/CvTypeTest.java | 0 .../misc/java/test}/DMatchTest.java | 0 .../misc/java/test}/KeyPointTest.java | 0 .../core => core/misc/java/test}/MatTest.java | 0 .../misc/java/test}/Point3Test.java | 0 .../misc/java/test}/PointTest.java | 0 .../misc/java/test}/RangeTest.java | 0 .../misc/java/test}/RectTest.java | 0 .../misc/java/test}/RotatedRectTest.java | 0 .../misc/java/test}/ScalarTest.java | 0 .../misc/java/test}/SizeTest.java | 0 .../misc/java/test}/TermCriteriaTest.java | 0 modules/features2d/CMakeLists.txt | 2 +- modules/features2d/misc/java/filelist | 1 + .../java/src/cpp/features2d_converters.cpp | 112 +++++++++ .../java/src/cpp/features2d_converters.hpp | 22 ++ .../misc/java}/src/cpp/features2d_manual.hpp | 1 + .../test}/BRIEFDescriptorExtractorTest.java | 0 .../BruteForceDescriptorMatcherTest.java | 0 ...ruteForceHammingDescriptorMatcherTest.java | 0 ...eForceHammingLUTDescriptorMatcherTest.java | 0 .../BruteForceL1DescriptorMatcherTest.java | 0 .../BruteForceSL2DescriptorMatcherTest.java | 0 .../java/test}/DENSEFeatureDetectorTest.java | 0 .../DynamicDENSEFeatureDetectorTest.java | 0 .../test}/DynamicFASTFeatureDetectorTest.java | 0 .../test}/DynamicGFTTFeatureDetectorTest.java | 0 .../DynamicHARRISFeatureDetectorTest.java | 0 .../test}/DynamicMSERFeatureDetectorTest.java | 0 .../test}/DynamicORBFeatureDetectorTest.java | 0 .../test}/DynamicSIFTFeatureDetectorTest.java | 0 .../DynamicSIMPLEBLOBFeatureDetectorTest.java | 0 .../test}/DynamicSTARFeatureDetectorTest.java | 0 .../test}/DynamicSURFFeatureDetectorTest.java | 0 .../java/test}/FASTFeatureDetectorTest.java | 0 .../misc/java/test}/Features2dTest.java | 0 .../FernGenericDescriptorMatcherTest.java | 0 .../FlannBasedDescriptorMatcherTest.java | 0 .../java/test}/GFTTFeatureDetectorTest.java | 0 .../test}/GridDENSEFeatureDetectorTest.java | 0 .../test}/GridFASTFeatureDetectorTest.java | 0 .../test}/GridGFTTFeatureDetectorTest.java | 0 .../test}/GridHARRISFeatureDetectorTest.java | 0 .../test}/GridMSERFeatureDetectorTest.java | 0 .../test}/GridORBFeatureDetectorTest.java | 0 .../test}/GridSIFTFeatureDetectorTest.java | 0 .../GridSIMPLEBLOBFeatureDetectorTest.java | 0 .../test}/GridSTARFeatureDetectorTest.java | 0 .../test}/GridSURFFeatureDetectorTest.java | 0 .../java/test}/HARRISFeatureDetectorTest.java | 0 .../java/test}/MSERFeatureDetectorTest.java | 0 .../test}/ORBDescriptorExtractorTest.java | 0 .../java/test}/ORBFeatureDetectorTest.java | 0 .../OneWayGenericDescriptorMatcherTest.java | 0 .../OpponentBRIEFDescriptorExtractorTest.java | 0 .../OpponentORBDescriptorExtractorTest.java | 0 .../OpponentSIFTDescriptorExtractorTest.java | 0 .../OpponentSURFDescriptorExtractorTest.java | 0 .../PyramidDENSEFeatureDetectorTest.java | 0 .../test}/PyramidFASTFeatureDetectorTest.java | 0 .../test}/PyramidGFTTFeatureDetectorTest.java | 0 .../PyramidHARRISFeatureDetectorTest.java | 0 .../test}/PyramidMSERFeatureDetectorTest.java | 0 .../test}/PyramidORBFeatureDetectorTest.java | 0 .../test}/PyramidSIFTFeatureDetectorTest.java | 0 .../PyramidSIMPLEBLOBFeatureDetectorTest.java | 0 .../test}/PyramidSTARFeatureDetectorTest.java | 0 .../test}/PyramidSURFFeatureDetectorTest.java | 0 .../test}/SIFTDescriptorExtractorTest.java | 0 .../java/test}/SIFTFeatureDetectorTest.java | 0 .../test}/SIMPLEBLOBFeatureDetectorTest.java | 0 .../java/test}/STARFeatureDetectorTest.java | 0 .../test}/SURFDescriptorExtractorTest.java | 0 .../java/test}/SURFFeatureDetectorTest.java | 0 modules/imgcodecs/CMakeLists.txt | 2 +- .../misc/java/test}/HighguiTest.java | 0 modules/imgproc/CMakeLists.txt | 2 +- .../misc/java/test}/ImgprocTest.java | 2 +- .../misc/java/test}/MomentsTest.java | 0 .../misc/java/test}/Subdiv2DTest.java | 0 modules/java/CMakeLists.txt | 225 ++++++++++++------ modules/java/android_test/CMakeLists.txt | 36 ++- .../src/org/opencv/test/ml/CvANN_MLPTest.java | 68 ------ .../test/ml/CvANN_MLP_TrainParamsTest.java | 76 ------ .../org/opencv/test/ml/CvBoostParamsTest.java | 44 ---- .../src/org/opencv/test/ml/CvBoostTest.java | 92 ------- .../org/opencv/test/ml/CvDTreeParamsTest.java | 76 ------ .../src/org/opencv/test/ml/CvDTreeTest.java | 44 ---- .../src/org/opencv/test/ml/CvERTreesTest.java | 36 --- .../opencv/test/ml/CvGBTreesParamsTest.java | 44 ---- .../src/org/opencv/test/ml/CvGBTreesTest.java | 84 ------- .../org/opencv/test/ml/CvKNearestTest.java | 52 ---- .../test/ml/CvNormalBayesClassifierTest.java | 52 ---- .../org/opencv/test/ml/CvParamGridTest.java | 36 --- .../org/opencv/test/ml/CvRTParamsTest.java | 28 --- .../src/org/opencv/test/ml/CvRTreesTest.java | 60 ----- .../org/opencv/test/ml/CvSVMParamsTest.java | 76 ------ .../src/org/opencv/test/ml/CvSVMTest.java | 100 -------- .../res/drawable/chessboard.jpg | Bin .../res/drawable/icon.png | Bin .../res/drawable/lena.png | Bin .../res/layout/main.xml | 0 .../res/raw/lbpcascade_frontalface.xml | 0 .../res/values/strings.xml | 0 .../org/opencv/test/utils/ConvertersTest.java | 0 .../generator/config/bioinspired.filelist | 3 - .../java/generator/config/features2d.filelist | 1 - modules/java/generator/config/ml.filelist | 0 .../java/generator/config/nonfree.filelist | 0 modules/java/generator/gen_java.py | 7 +- modules/java/generator/src/cpp/common.h | 4 - modules/java/generator/src/cpp/converters.cpp | 111 --------- modules/java/generator/src/cpp/converters.h | 17 -- .../java/{test => pure_test}/CMakeLists.txt | 57 ++--- modules/java/{test => pure_test}/build.xml | 0 .../{test => pure_test}/lib/junit-4.11.jar | Bin .../src/org/opencv/test/OpenCVTestCase.java | 0 .../src/org/opencv/test/OpenCVTestRunner.java | 0 modules/objdetect/CMakeLists.txt | 2 +- .../java/test}/CascadeClassifierTest.java | 0 .../misc/java/test}/HOGDescriptorTest.java | 0 .../misc/java/test}/ObjdetectTest.java | 0 modules/photo/CMakeLists.txt | 2 +- .../misc/java/test}/PhotoTest.java | 0 modules/video/CMakeLists.txt | 2 +- .../test}/BackgroundSubtractorMOGTest.java | 0 .../misc/java/test}/KalmanFilterTest.java | 0 .../misc/java/test}/VideoTest.java | 0 modules/videoio/CMakeLists.txt | 2 +- .../misc/java/test}/VideoCaptureTest.java | 0 167 files changed, 376 insertions(+), 1254 deletions(-) rename modules/{java/android_test/src/org/opencv/test/calib3d => calib3d/misc/java/test}/Calib3dTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/calib3d => calib3d/misc/java/test}/StereoBMTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/calib3d => calib3d/misc/java/test}/StereoSGBMTest.java (100%) rename modules/{java/generator/config/core.filelist => core/misc/java/filelist} (67%) rename modules/{java/generator => core/misc/java}/src/cpp/core_manual.cpp (79%) rename modules/{java/generator => core/misc/java}/src/cpp/core_manual.hpp (100%) rename modules/{java/generator => core/misc/java}/src/java/core+CvException.java (100%) rename modules/{java/generator => core/misc/java}/src/java/core+CvType.java (100%) rename modules/{java/generator => core/misc/java}/src/java/core+DMatch.java (100%) rename modules/{java/generator => core/misc/java}/src/java/core+KeyPoint.java (100%) rename modules/{java/generator => core/misc/java}/src/java/core+Mat.java (100%) rename modules/{java/generator => core/misc/java}/src/java/core+MatOfByte.java (100%) rename modules/{java/generator => core/misc/java}/src/java/core+MatOfDMatch.java (100%) rename modules/{java/generator => core/misc/java}/src/java/core+MatOfDouble.java (100%) rename modules/{java/generator => core/misc/java}/src/java/core+MatOfFloat.java (100%) rename modules/{java/generator => core/misc/java}/src/java/core+MatOfFloat4.java (100%) rename modules/{java/generator => core/misc/java}/src/java/core+MatOfFloat6.java (100%) rename modules/{java/generator => core/misc/java}/src/java/core+MatOfInt.java (100%) rename modules/{java/generator => core/misc/java}/src/java/core+MatOfInt4.java (100%) rename modules/{java/generator => core/misc/java}/src/java/core+MatOfKeyPoint.java (100%) rename modules/{java/generator => core/misc/java}/src/java/core+MatOfPoint.java (100%) rename modules/{java/generator => core/misc/java}/src/java/core+MatOfPoint2f.java (100%) rename modules/{java/generator => core/misc/java}/src/java/core+MatOfPoint3.java (100%) rename modules/{java/generator => core/misc/java}/src/java/core+MatOfPoint3f.java (100%) rename modules/{java/generator => core/misc/java}/src/java/core+MatOfRect.java (100%) rename modules/{java/generator => core/misc/java}/src/java/core+Point.java (100%) rename modules/{java/generator => core/misc/java}/src/java/core+Point3.java (100%) rename modules/{java/generator => core/misc/java}/src/java/core+Range.java (100%) rename modules/{java/generator => core/misc/java}/src/java/core+Rect.java (100%) rename modules/{java/generator => core/misc/java}/src/java/core+RotatedRect.java (100%) rename modules/{java/generator => core/misc/java}/src/java/core+Scalar.java (100%) rename modules/{java/generator => core/misc/java}/src/java/core+Size.java (100%) rename modules/{java/generator => core/misc/java}/src/java/core+TermCriteria.java (100%) rename modules/{java/android_test/src/org/opencv/test/core => core/misc/java/test}/CoreTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/core => core/misc/java/test}/CvTypeTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/core => core/misc/java/test}/DMatchTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/core => core/misc/java/test}/KeyPointTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/core => core/misc/java/test}/MatTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/core => core/misc/java/test}/Point3Test.java (100%) rename modules/{java/android_test/src/org/opencv/test/core => core/misc/java/test}/PointTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/core => core/misc/java/test}/RangeTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/core => core/misc/java/test}/RectTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/core => core/misc/java/test}/RotatedRectTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/core => core/misc/java/test}/ScalarTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/core => core/misc/java/test}/SizeTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/core => core/misc/java/test}/TermCriteriaTest.java (100%) create mode 100644 modules/features2d/misc/java/filelist create mode 100644 modules/features2d/misc/java/src/cpp/features2d_converters.cpp create mode 100644 modules/features2d/misc/java/src/cpp/features2d_converters.hpp rename modules/{java/generator => features2d/misc/java}/src/cpp/features2d_manual.hpp (99%) rename modules/{java/android_test/src/org/opencv/test/features2d => features2d/misc/java/test}/BRIEFDescriptorExtractorTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/features2d => features2d/misc/java/test}/BruteForceDescriptorMatcherTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/features2d => features2d/misc/java/test}/BruteForceHammingDescriptorMatcherTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/features2d => features2d/misc/java/test}/BruteForceHammingLUTDescriptorMatcherTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/features2d => features2d/misc/java/test}/BruteForceL1DescriptorMatcherTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/features2d => features2d/misc/java/test}/BruteForceSL2DescriptorMatcherTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/features2d => features2d/misc/java/test}/DENSEFeatureDetectorTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/features2d => features2d/misc/java/test}/DynamicDENSEFeatureDetectorTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/features2d => features2d/misc/java/test}/DynamicFASTFeatureDetectorTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/features2d => features2d/misc/java/test}/DynamicGFTTFeatureDetectorTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/features2d => features2d/misc/java/test}/DynamicHARRISFeatureDetectorTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/features2d => features2d/misc/java/test}/DynamicMSERFeatureDetectorTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/features2d => features2d/misc/java/test}/DynamicORBFeatureDetectorTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/features2d => features2d/misc/java/test}/DynamicSIFTFeatureDetectorTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/features2d => features2d/misc/java/test}/DynamicSIMPLEBLOBFeatureDetectorTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/features2d => features2d/misc/java/test}/DynamicSTARFeatureDetectorTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/features2d => features2d/misc/java/test}/DynamicSURFFeatureDetectorTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/features2d => features2d/misc/java/test}/FASTFeatureDetectorTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/features2d => features2d/misc/java/test}/Features2dTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/features2d => features2d/misc/java/test}/FernGenericDescriptorMatcherTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/features2d => features2d/misc/java/test}/FlannBasedDescriptorMatcherTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/features2d => features2d/misc/java/test}/GFTTFeatureDetectorTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/features2d => features2d/misc/java/test}/GridDENSEFeatureDetectorTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/features2d => features2d/misc/java/test}/GridFASTFeatureDetectorTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/features2d => features2d/misc/java/test}/GridGFTTFeatureDetectorTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/features2d => features2d/misc/java/test}/GridHARRISFeatureDetectorTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/features2d => features2d/misc/java/test}/GridMSERFeatureDetectorTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/features2d => features2d/misc/java/test}/GridORBFeatureDetectorTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/features2d => features2d/misc/java/test}/GridSIFTFeatureDetectorTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/features2d => features2d/misc/java/test}/GridSIMPLEBLOBFeatureDetectorTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/features2d => features2d/misc/java/test}/GridSTARFeatureDetectorTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/features2d => features2d/misc/java/test}/GridSURFFeatureDetectorTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/features2d => features2d/misc/java/test}/HARRISFeatureDetectorTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/features2d => features2d/misc/java/test}/MSERFeatureDetectorTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/features2d => features2d/misc/java/test}/ORBDescriptorExtractorTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/features2d => features2d/misc/java/test}/ORBFeatureDetectorTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/features2d => features2d/misc/java/test}/OneWayGenericDescriptorMatcherTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/features2d => features2d/misc/java/test}/OpponentBRIEFDescriptorExtractorTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/features2d => features2d/misc/java/test}/OpponentORBDescriptorExtractorTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/features2d => features2d/misc/java/test}/OpponentSIFTDescriptorExtractorTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/features2d => features2d/misc/java/test}/OpponentSURFDescriptorExtractorTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/features2d => features2d/misc/java/test}/PyramidDENSEFeatureDetectorTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/features2d => features2d/misc/java/test}/PyramidFASTFeatureDetectorTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/features2d => features2d/misc/java/test}/PyramidGFTTFeatureDetectorTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/features2d => features2d/misc/java/test}/PyramidHARRISFeatureDetectorTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/features2d => features2d/misc/java/test}/PyramidMSERFeatureDetectorTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/features2d => features2d/misc/java/test}/PyramidORBFeatureDetectorTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/features2d => features2d/misc/java/test}/PyramidSIFTFeatureDetectorTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/features2d => features2d/misc/java/test}/PyramidSIMPLEBLOBFeatureDetectorTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/features2d => features2d/misc/java/test}/PyramidSTARFeatureDetectorTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/features2d => features2d/misc/java/test}/PyramidSURFFeatureDetectorTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/features2d => features2d/misc/java/test}/SIFTDescriptorExtractorTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/features2d => features2d/misc/java/test}/SIFTFeatureDetectorTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/features2d => features2d/misc/java/test}/SIMPLEBLOBFeatureDetectorTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/features2d => features2d/misc/java/test}/STARFeatureDetectorTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/features2d => features2d/misc/java/test}/SURFDescriptorExtractorTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/features2d => features2d/misc/java/test}/SURFFeatureDetectorTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/highgui => imgcodecs/misc/java/test}/HighguiTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/imgproc => imgproc/misc/java/test}/ImgprocTest.java (99%) rename modules/{java/android_test/src/org/opencv/test/imgproc => imgproc/misc/java/test}/MomentsTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/imgproc => imgproc/misc/java/test}/Subdiv2DTest.java (100%) delete mode 100644 modules/java/android_test/src/org/opencv/test/ml/CvANN_MLPTest.java delete mode 100644 modules/java/android_test/src/org/opencv/test/ml/CvANN_MLP_TrainParamsTest.java delete mode 100644 modules/java/android_test/src/org/opencv/test/ml/CvBoostParamsTest.java delete mode 100644 modules/java/android_test/src/org/opencv/test/ml/CvBoostTest.java delete mode 100644 modules/java/android_test/src/org/opencv/test/ml/CvDTreeParamsTest.java delete mode 100644 modules/java/android_test/src/org/opencv/test/ml/CvDTreeTest.java delete mode 100644 modules/java/android_test/src/org/opencv/test/ml/CvERTreesTest.java delete mode 100644 modules/java/android_test/src/org/opencv/test/ml/CvGBTreesParamsTest.java delete mode 100644 modules/java/android_test/src/org/opencv/test/ml/CvGBTreesTest.java delete mode 100644 modules/java/android_test/src/org/opencv/test/ml/CvKNearestTest.java delete mode 100644 modules/java/android_test/src/org/opencv/test/ml/CvNormalBayesClassifierTest.java delete mode 100644 modules/java/android_test/src/org/opencv/test/ml/CvParamGridTest.java delete mode 100644 modules/java/android_test/src/org/opencv/test/ml/CvRTParamsTest.java delete mode 100644 modules/java/android_test/src/org/opencv/test/ml/CvRTreesTest.java delete mode 100644 modules/java/android_test/src/org/opencv/test/ml/CvSVMParamsTest.java delete mode 100644 modules/java/android_test/src/org/opencv/test/ml/CvSVMTest.java rename modules/java/{android_test => common_test}/res/drawable/chessboard.jpg (100%) rename modules/java/{android_test => common_test}/res/drawable/icon.png (100%) rename modules/java/{android_test => common_test}/res/drawable/lena.png (100%) rename modules/java/{android_test => common_test}/res/layout/main.xml (100%) rename modules/java/{android_test => common_test}/res/raw/lbpcascade_frontalface.xml (100%) rename modules/java/{android_test => common_test}/res/values/strings.xml (100%) rename modules/java/{android_test => common_test}/src/org/opencv/test/utils/ConvertersTest.java (100%) delete mode 100644 modules/java/generator/config/bioinspired.filelist delete mode 100644 modules/java/generator/config/features2d.filelist delete mode 100644 modules/java/generator/config/ml.filelist delete mode 100644 modules/java/generator/config/nonfree.filelist rename modules/java/{test => pure_test}/CMakeLists.txt (52%) rename modules/java/{test => pure_test}/build.xml (100%) rename modules/java/{test => pure_test}/lib/junit-4.11.jar (100%) rename modules/java/{test => pure_test}/src/org/opencv/test/OpenCVTestCase.java (100%) rename modules/java/{test => pure_test}/src/org/opencv/test/OpenCVTestRunner.java (100%) rename modules/{java/android_test/src/org/opencv/test/objdetect => objdetect/misc/java/test}/CascadeClassifierTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/objdetect => objdetect/misc/java/test}/HOGDescriptorTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/objdetect => objdetect/misc/java/test}/ObjdetectTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/photo => photo/misc/java/test}/PhotoTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/video => video/misc/java/test}/BackgroundSubtractorMOGTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/video => video/misc/java/test}/KalmanFilterTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/video => video/misc/java/test}/VideoTest.java (100%) rename modules/{java/android_test/src/org/opencv/test/highgui => videoio/misc/java/test}/VideoCaptureTest.java (100%) diff --git a/cmake/OpenCVModule.cmake b/cmake/OpenCVModule.cmake index 7370ff4216..27990911fe 100644 --- a/cmake/OpenCVModule.cmake +++ b/cmake/OpenCVModule.cmake @@ -21,8 +21,25 @@ # OPENCV_MODULE_${the_module}_IS_PART_OF_WORLD # OPENCV_MODULE_${the_module}_CUDA_OBJECTS - compiled CUDA objects list # OPENCV_MODULE_${the_module}_CHILDREN - list of submodules for compound modules (cmake >= 2.8.8) +# OPENCV_MODULE_${the_module}_WRAPPERS - list of wrappers supporting this module # HAVE_${the_module} - for fast check of module availability +# Module layout: +# +# ├── doc - docs +# ├── include +# │   └── opencv2 +# │   └── - sub headers +# ├── misc +# │   ├── java - additional files for java wrapper +# │   └── python - additional files for python wrapper +# ├── perf - perfomance tests +# ├── samples - sample code +# ├── src - sources +# ├── test - accuracy tests +# └── tutorials - tutorials + + # To control the setup of the module you could also set: # the_description - text to be used as current module description # OPENCV_MODULE_TYPE - STATIC|SHARED - set to force override global settings for current module @@ -72,7 +89,7 @@ unset(OPENCV_WORLD_MODULES CACHE) # adds dependencies to OpenCV module # Usage: -# add_dependencies(opencv_ [REQUIRED] [] [OPTIONAL ]) +# add_dependencies(opencv_ [REQUIRED] [] [OPTIONAL ] [WRAP ]) # Notes: # * - can include full names of modules or full pathes to shared/static libraries or cmake targets macro(ocv_add_dependencies full_modname) @@ -87,6 +104,8 @@ macro(ocv_add_dependencies full_modname) set(__depsvar OPENCV_MODULE_${full_modname}_PRIVATE_REQ_DEPS) elseif(d STREQUAL "PRIVATE_OPTIONAL") set(__depsvar OPENCV_MODULE_${full_modname}_PRIVATE_OPT_DEPS) + elseif(d STREQUAL "WRAP") + set(__depsvar OPENCV_MODULE_${full_modname}_WRAPPERS) else() list(APPEND ${__depsvar} "${d}") endif() @@ -97,6 +116,7 @@ macro(ocv_add_dependencies full_modname) ocv_list_unique(OPENCV_MODULE_${full_modname}_OPT_DEPS) ocv_list_unique(OPENCV_MODULE_${full_modname}_PRIVATE_REQ_DEPS) ocv_list_unique(OPENCV_MODULE_${full_modname}_PRIVATE_OPT_DEPS) + ocv_list_unique(OPENCV_MODULE_${full_modname}_WRAPPERS) set(OPENCV_MODULE_${full_modname}_REQ_DEPS ${OPENCV_MODULE_${full_modname}_REQ_DEPS} CACHE INTERNAL "Required dependencies of ${full_modname} module") @@ -106,11 +126,13 @@ macro(ocv_add_dependencies full_modname) CACHE INTERNAL "Required private dependencies of ${full_modname} module") set(OPENCV_MODULE_${full_modname}_PRIVATE_OPT_DEPS ${OPENCV_MODULE_${full_modname}_PRIVATE_OPT_DEPS} CACHE INTERNAL "Optional private dependencies of ${full_modname} module") + set(OPENCV_MODULE_${full_modname}_WRAPPERS ${OPENCV_MODULE_${full_modname}_WRAPPERS} + CACHE INTERNAL "List of wrappers supporting module ${full_modname}") endmacro() # declare new OpenCV module in current folder # Usage: -# ocv_add_module( [INTERNAL|BINDINGS] [REQUIRED] [] [OPTIONAL ]) +# ocv_add_module( [INTERNAL|BINDINGS] [REQUIRED] [] [OPTIONAL ] [WRAP ]) # Example: # ocv_add_module(yaom INTERNAL opencv_core opencv_highgui opencv_flann OPTIONAL opencv_cudev) macro(ocv_add_module _name) @@ -181,6 +203,11 @@ macro(ocv_add_module _name) # add submodules if any set(OPENCV_MODULE_${the_module}_CHILDREN "${OPENCV_MODULE_CHILDREN}" CACHE INTERNAL "List of ${the_module} submodules") + # add reverse wrapper dependencies + foreach (wrapper ${OPENCV_MODULE_${the_module}_WRAPPERS}) + ocv_add_dependencies(opencv_${wrapper} OPTIONAL ${the_module}) + endforeach() + # stop processing of current file return() else() @@ -796,7 +823,7 @@ endmacro() # short command for adding simple OpenCV module # see ocv_add_module for argument details # Usage: -# ocv_define_module(module_name [INTERNAL] [EXCLUDE_CUDA] [REQUIRED] [] [OPTIONAL ]) +# ocv_define_module(module_name [INTERNAL] [EXCLUDE_CUDA] [REQUIRED] [] [OPTIONAL ] [WRAP ]) macro(ocv_define_module module_name) ocv_debug_message("ocv_define_module(" ${module_name} ${ARGN} ")") set(_argn ${ARGN}) diff --git a/modules/calib3d/CMakeLists.txt b/modules/calib3d/CMakeLists.txt index 4fb7a1b618..844365f71e 100644 --- a/modules/calib3d/CMakeLists.txt +++ b/modules/calib3d/CMakeLists.txt @@ -1,2 +1,2 @@ set(the_description "Camera Calibration and 3D Reconstruction") -ocv_define_module(calib3d opencv_imgproc opencv_features2d) +ocv_define_module(calib3d opencv_imgproc opencv_features2d WRAP java) diff --git a/modules/java/android_test/src/org/opencv/test/calib3d/Calib3dTest.java b/modules/calib3d/misc/java/test/Calib3dTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/calib3d/Calib3dTest.java rename to modules/calib3d/misc/java/test/Calib3dTest.java diff --git a/modules/java/android_test/src/org/opencv/test/calib3d/StereoBMTest.java b/modules/calib3d/misc/java/test/StereoBMTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/calib3d/StereoBMTest.java rename to modules/calib3d/misc/java/test/StereoBMTest.java diff --git a/modules/java/android_test/src/org/opencv/test/calib3d/StereoSGBMTest.java b/modules/calib3d/misc/java/test/StereoSGBMTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/calib3d/StereoSGBMTest.java rename to modules/calib3d/misc/java/test/StereoSGBMTest.java diff --git a/modules/core/CMakeLists.txt b/modules/core/CMakeLists.txt index 5158dec5f4..22668f4892 100644 --- a/modules/core/CMakeLists.txt +++ b/modules/core/CMakeLists.txt @@ -1,5 +1,7 @@ set(the_description "The Core Functionality") -ocv_add_module(core PRIVATE_REQUIRED ${ZLIB_LIBRARIES} "${OPENCL_LIBRARIES}" OPTIONAL opencv_cudev) +ocv_add_module(core PRIVATE_REQUIRED ${ZLIB_LIBRARIES} "${OPENCL_LIBRARIES}" + OPTIONAL opencv_cudev + WRAP java) if(HAVE_WINRT_CX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /ZW") diff --git a/modules/java/generator/config/core.filelist b/modules/core/misc/java/filelist similarity index 67% rename from modules/java/generator/config/core.filelist rename to modules/core/misc/java/filelist index 27a46dc6e0..acf02c9afc 100644 --- a/modules/java/generator/config/core.filelist +++ b/modules/core/misc/java/filelist @@ -1,4 +1,4 @@ include/opencv2/core/base.hpp include/opencv2/core.hpp include/opencv2/core/utility.hpp -../java/generator/src/cpp/core_manual.hpp +misc/java/src/cpp/core_manual.hpp diff --git a/modules/java/generator/src/cpp/core_manual.cpp b/modules/core/misc/java/src/cpp/core_manual.cpp similarity index 79% rename from modules/java/generator/src/cpp/core_manual.cpp rename to modules/core/misc/java/src/cpp/core_manual.cpp index 97ce27ee37..4fe2ff7889 100644 --- a/modules/java/generator/src/cpp/core_manual.cpp +++ b/modules/core/misc/java/src/cpp/core_manual.cpp @@ -1,6 +1,6 @@ #define LOG_TAG "org.opencv.core.Core" #include "common.h" - +#include "core_manual.hpp" #include "opencv2/core/utility.hpp" static int quietCallback( int, const char*, const char*, const char*, int, void* ) @@ -8,10 +8,14 @@ static int quietCallback( int, const char*, const char*, const char*, int, void* return 0; } -void cv::setErrorVerbosity(bool verbose) +namespace cv { + +void setErrorVerbosity(bool verbose) { if(verbose) cv::redirectError(0); else cv::redirectError((cv::ErrorCallback)quietCallback); } + +} diff --git a/modules/java/generator/src/cpp/core_manual.hpp b/modules/core/misc/java/src/cpp/core_manual.hpp similarity index 100% rename from modules/java/generator/src/cpp/core_manual.hpp rename to modules/core/misc/java/src/cpp/core_manual.hpp diff --git a/modules/java/generator/src/java/core+CvException.java b/modules/core/misc/java/src/java/core+CvException.java similarity index 100% rename from modules/java/generator/src/java/core+CvException.java rename to modules/core/misc/java/src/java/core+CvException.java diff --git a/modules/java/generator/src/java/core+CvType.java b/modules/core/misc/java/src/java/core+CvType.java similarity index 100% rename from modules/java/generator/src/java/core+CvType.java rename to modules/core/misc/java/src/java/core+CvType.java diff --git a/modules/java/generator/src/java/core+DMatch.java b/modules/core/misc/java/src/java/core+DMatch.java similarity index 100% rename from modules/java/generator/src/java/core+DMatch.java rename to modules/core/misc/java/src/java/core+DMatch.java diff --git a/modules/java/generator/src/java/core+KeyPoint.java b/modules/core/misc/java/src/java/core+KeyPoint.java similarity index 100% rename from modules/java/generator/src/java/core+KeyPoint.java rename to modules/core/misc/java/src/java/core+KeyPoint.java diff --git a/modules/java/generator/src/java/core+Mat.java b/modules/core/misc/java/src/java/core+Mat.java similarity index 100% rename from modules/java/generator/src/java/core+Mat.java rename to modules/core/misc/java/src/java/core+Mat.java diff --git a/modules/java/generator/src/java/core+MatOfByte.java b/modules/core/misc/java/src/java/core+MatOfByte.java similarity index 100% rename from modules/java/generator/src/java/core+MatOfByte.java rename to modules/core/misc/java/src/java/core+MatOfByte.java diff --git a/modules/java/generator/src/java/core+MatOfDMatch.java b/modules/core/misc/java/src/java/core+MatOfDMatch.java similarity index 100% rename from modules/java/generator/src/java/core+MatOfDMatch.java rename to modules/core/misc/java/src/java/core+MatOfDMatch.java diff --git a/modules/java/generator/src/java/core+MatOfDouble.java b/modules/core/misc/java/src/java/core+MatOfDouble.java similarity index 100% rename from modules/java/generator/src/java/core+MatOfDouble.java rename to modules/core/misc/java/src/java/core+MatOfDouble.java diff --git a/modules/java/generator/src/java/core+MatOfFloat.java b/modules/core/misc/java/src/java/core+MatOfFloat.java similarity index 100% rename from modules/java/generator/src/java/core+MatOfFloat.java rename to modules/core/misc/java/src/java/core+MatOfFloat.java diff --git a/modules/java/generator/src/java/core+MatOfFloat4.java b/modules/core/misc/java/src/java/core+MatOfFloat4.java similarity index 100% rename from modules/java/generator/src/java/core+MatOfFloat4.java rename to modules/core/misc/java/src/java/core+MatOfFloat4.java diff --git a/modules/java/generator/src/java/core+MatOfFloat6.java b/modules/core/misc/java/src/java/core+MatOfFloat6.java similarity index 100% rename from modules/java/generator/src/java/core+MatOfFloat6.java rename to modules/core/misc/java/src/java/core+MatOfFloat6.java diff --git a/modules/java/generator/src/java/core+MatOfInt.java b/modules/core/misc/java/src/java/core+MatOfInt.java similarity index 100% rename from modules/java/generator/src/java/core+MatOfInt.java rename to modules/core/misc/java/src/java/core+MatOfInt.java diff --git a/modules/java/generator/src/java/core+MatOfInt4.java b/modules/core/misc/java/src/java/core+MatOfInt4.java similarity index 100% rename from modules/java/generator/src/java/core+MatOfInt4.java rename to modules/core/misc/java/src/java/core+MatOfInt4.java diff --git a/modules/java/generator/src/java/core+MatOfKeyPoint.java b/modules/core/misc/java/src/java/core+MatOfKeyPoint.java similarity index 100% rename from modules/java/generator/src/java/core+MatOfKeyPoint.java rename to modules/core/misc/java/src/java/core+MatOfKeyPoint.java diff --git a/modules/java/generator/src/java/core+MatOfPoint.java b/modules/core/misc/java/src/java/core+MatOfPoint.java similarity index 100% rename from modules/java/generator/src/java/core+MatOfPoint.java rename to modules/core/misc/java/src/java/core+MatOfPoint.java diff --git a/modules/java/generator/src/java/core+MatOfPoint2f.java b/modules/core/misc/java/src/java/core+MatOfPoint2f.java similarity index 100% rename from modules/java/generator/src/java/core+MatOfPoint2f.java rename to modules/core/misc/java/src/java/core+MatOfPoint2f.java diff --git a/modules/java/generator/src/java/core+MatOfPoint3.java b/modules/core/misc/java/src/java/core+MatOfPoint3.java similarity index 100% rename from modules/java/generator/src/java/core+MatOfPoint3.java rename to modules/core/misc/java/src/java/core+MatOfPoint3.java diff --git a/modules/java/generator/src/java/core+MatOfPoint3f.java b/modules/core/misc/java/src/java/core+MatOfPoint3f.java similarity index 100% rename from modules/java/generator/src/java/core+MatOfPoint3f.java rename to modules/core/misc/java/src/java/core+MatOfPoint3f.java diff --git a/modules/java/generator/src/java/core+MatOfRect.java b/modules/core/misc/java/src/java/core+MatOfRect.java similarity index 100% rename from modules/java/generator/src/java/core+MatOfRect.java rename to modules/core/misc/java/src/java/core+MatOfRect.java diff --git a/modules/java/generator/src/java/core+Point.java b/modules/core/misc/java/src/java/core+Point.java similarity index 100% rename from modules/java/generator/src/java/core+Point.java rename to modules/core/misc/java/src/java/core+Point.java diff --git a/modules/java/generator/src/java/core+Point3.java b/modules/core/misc/java/src/java/core+Point3.java similarity index 100% rename from modules/java/generator/src/java/core+Point3.java rename to modules/core/misc/java/src/java/core+Point3.java diff --git a/modules/java/generator/src/java/core+Range.java b/modules/core/misc/java/src/java/core+Range.java similarity index 100% rename from modules/java/generator/src/java/core+Range.java rename to modules/core/misc/java/src/java/core+Range.java diff --git a/modules/java/generator/src/java/core+Rect.java b/modules/core/misc/java/src/java/core+Rect.java similarity index 100% rename from modules/java/generator/src/java/core+Rect.java rename to modules/core/misc/java/src/java/core+Rect.java diff --git a/modules/java/generator/src/java/core+RotatedRect.java b/modules/core/misc/java/src/java/core+RotatedRect.java similarity index 100% rename from modules/java/generator/src/java/core+RotatedRect.java rename to modules/core/misc/java/src/java/core+RotatedRect.java diff --git a/modules/java/generator/src/java/core+Scalar.java b/modules/core/misc/java/src/java/core+Scalar.java similarity index 100% rename from modules/java/generator/src/java/core+Scalar.java rename to modules/core/misc/java/src/java/core+Scalar.java diff --git a/modules/java/generator/src/java/core+Size.java b/modules/core/misc/java/src/java/core+Size.java similarity index 100% rename from modules/java/generator/src/java/core+Size.java rename to modules/core/misc/java/src/java/core+Size.java diff --git a/modules/java/generator/src/java/core+TermCriteria.java b/modules/core/misc/java/src/java/core+TermCriteria.java similarity index 100% rename from modules/java/generator/src/java/core+TermCriteria.java rename to modules/core/misc/java/src/java/core+TermCriteria.java diff --git a/modules/java/android_test/src/org/opencv/test/core/CoreTest.java b/modules/core/misc/java/test/CoreTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/core/CoreTest.java rename to modules/core/misc/java/test/CoreTest.java diff --git a/modules/java/android_test/src/org/opencv/test/core/CvTypeTest.java b/modules/core/misc/java/test/CvTypeTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/core/CvTypeTest.java rename to modules/core/misc/java/test/CvTypeTest.java diff --git a/modules/java/android_test/src/org/opencv/test/core/DMatchTest.java b/modules/core/misc/java/test/DMatchTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/core/DMatchTest.java rename to modules/core/misc/java/test/DMatchTest.java diff --git a/modules/java/android_test/src/org/opencv/test/core/KeyPointTest.java b/modules/core/misc/java/test/KeyPointTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/core/KeyPointTest.java rename to modules/core/misc/java/test/KeyPointTest.java diff --git a/modules/java/android_test/src/org/opencv/test/core/MatTest.java b/modules/core/misc/java/test/MatTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/core/MatTest.java rename to modules/core/misc/java/test/MatTest.java diff --git a/modules/java/android_test/src/org/opencv/test/core/Point3Test.java b/modules/core/misc/java/test/Point3Test.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/core/Point3Test.java rename to modules/core/misc/java/test/Point3Test.java diff --git a/modules/java/android_test/src/org/opencv/test/core/PointTest.java b/modules/core/misc/java/test/PointTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/core/PointTest.java rename to modules/core/misc/java/test/PointTest.java diff --git a/modules/java/android_test/src/org/opencv/test/core/RangeTest.java b/modules/core/misc/java/test/RangeTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/core/RangeTest.java rename to modules/core/misc/java/test/RangeTest.java diff --git a/modules/java/android_test/src/org/opencv/test/core/RectTest.java b/modules/core/misc/java/test/RectTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/core/RectTest.java rename to modules/core/misc/java/test/RectTest.java diff --git a/modules/java/android_test/src/org/opencv/test/core/RotatedRectTest.java b/modules/core/misc/java/test/RotatedRectTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/core/RotatedRectTest.java rename to modules/core/misc/java/test/RotatedRectTest.java diff --git a/modules/java/android_test/src/org/opencv/test/core/ScalarTest.java b/modules/core/misc/java/test/ScalarTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/core/ScalarTest.java rename to modules/core/misc/java/test/ScalarTest.java diff --git a/modules/java/android_test/src/org/opencv/test/core/SizeTest.java b/modules/core/misc/java/test/SizeTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/core/SizeTest.java rename to modules/core/misc/java/test/SizeTest.java diff --git a/modules/java/android_test/src/org/opencv/test/core/TermCriteriaTest.java b/modules/core/misc/java/test/TermCriteriaTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/core/TermCriteriaTest.java rename to modules/core/misc/java/test/TermCriteriaTest.java diff --git a/modules/features2d/CMakeLists.txt b/modules/features2d/CMakeLists.txt index ad6df94149..3395b99161 100644 --- a/modules/features2d/CMakeLists.txt +++ b/modules/features2d/CMakeLists.txt @@ -1,2 +1,2 @@ set(the_description "2D Features Framework") -ocv_define_module(features2d opencv_imgproc opencv_ml opencv_flann OPTIONAL opencv_highgui) +ocv_define_module(features2d opencv_imgproc opencv_ml opencv_flann OPTIONAL opencv_highgui WRAP java) diff --git a/modules/features2d/misc/java/filelist b/modules/features2d/misc/java/filelist new file mode 100644 index 0000000000..d4ff5ec262 --- /dev/null +++ b/modules/features2d/misc/java/filelist @@ -0,0 +1 @@ +misc/java/src/cpp/features2d_manual.hpp diff --git a/modules/features2d/misc/java/src/cpp/features2d_converters.cpp b/modules/features2d/misc/java/src/cpp/features2d_converters.cpp new file mode 100644 index 0000000000..4d82b6eca4 --- /dev/null +++ b/modules/features2d/misc/java/src/cpp/features2d_converters.cpp @@ -0,0 +1,112 @@ +#define LOG_TAG "org.opencv.utils.Converters" +#include "common.h" +#include "features2d_converters.hpp" + +using namespace cv; + +#define CHECK_MAT(cond) if(!(cond)){ LOGD("FAILED: " #cond); return; } + + +//vector_KeyPoint +void Mat_to_vector_KeyPoint(Mat& mat, std::vector& v_kp) +{ + v_kp.clear(); + CHECK_MAT(mat.type()==CV_32FC(7) && mat.cols==1); + for(int i=0; i v = mat.at< Vec >(i, 0); + KeyPoint kp(v[0], v[1], v[2], v[3], v[4], (int)v[5], (int)v[6]); + v_kp.push_back(kp); + } + return; +} + + +void vector_KeyPoint_to_Mat(std::vector& v_kp, Mat& mat) +{ + int count = (int)v_kp.size(); + mat.create(count, 1, CV_32FC(7)); + for(int i=0; i >(i, 0) = Vec(kp.pt.x, kp.pt.y, kp.size, kp.angle, kp.response, (float)kp.octave, (float)kp.class_id); + } +} + +//vector_DMatch +void Mat_to_vector_DMatch(Mat& mat, std::vector& v_dm) +{ + v_dm.clear(); + CHECK_MAT(mat.type()==CV_32FC4 && mat.cols==1); + for(int i=0; i v = mat.at< Vec >(i, 0); + DMatch dm((int)v[0], (int)v[1], (int)v[2], v[3]); + v_dm.push_back(dm); + } + return; +} + + +void vector_DMatch_to_Mat(std::vector& v_dm, Mat& mat) +{ + int count = (int)v_dm.size(); + mat.create(count, 1, CV_32FC4); + for(int i=0; i >(i, 0) = Vec((float)dm.queryIdx, (float)dm.trainIdx, (float)dm.imgIdx, dm.distance); + } +} + +void Mat_to_vector_vector_KeyPoint(Mat& mat, std::vector< std::vector< KeyPoint > >& vv_kp) +{ + std::vector vm; + vm.reserve( mat.rows ); + Mat_to_vector_Mat(mat, vm); + for(size_t i=0; i vkp; + Mat_to_vector_KeyPoint(vm[i], vkp); + vv_kp.push_back(vkp); + } +} + +void vector_vector_KeyPoint_to_Mat(std::vector< std::vector< KeyPoint > >& vv_kp, Mat& mat) +{ + std::vector vm; + vm.reserve( vv_kp.size() ); + for(size_t i=0; i >& vv_dm) +{ + std::vector vm; + vm.reserve( mat.rows ); + Mat_to_vector_Mat(mat, vm); + for(size_t i=0; i vdm; + Mat_to_vector_DMatch(vm[i], vdm); + vv_dm.push_back(vdm); + } +} + +void vector_vector_DMatch_to_Mat(std::vector< std::vector< DMatch > >& vv_dm, Mat& mat) +{ + std::vector vm; + vm.reserve( vv_dm.size() ); + for(size_t i=0; i& v_kp); +void vector_KeyPoint_to_Mat(std::vector& v_kp, cv::Mat& mat); + +void Mat_to_vector_DMatch(cv::Mat& mat, std::vector& v_dm); +void vector_DMatch_to_Mat(std::vector& v_dm, cv::Mat& mat); + +void Mat_to_vector_vector_KeyPoint(cv::Mat& mat, std::vector< std::vector< cv::KeyPoint > >& vv_kp); +void vector_vector_KeyPoint_to_Mat(std::vector< std::vector< cv::KeyPoint > >& vv_kp, cv::Mat& mat); + +void Mat_to_vector_vector_DMatch(cv::Mat& mat, std::vector< std::vector< cv::DMatch > >& vv_dm); +void vector_vector_DMatch_to_Mat(std::vector< std::vector< cv::DMatch > >& vv_dm, cv::Mat& mat); + + +#endif diff --git a/modules/java/generator/src/cpp/features2d_manual.hpp b/modules/features2d/misc/java/src/cpp/features2d_manual.hpp similarity index 99% rename from modules/java/generator/src/cpp/features2d_manual.hpp rename to modules/features2d/misc/java/src/cpp/features2d_manual.hpp index 29e0320767..abd66235a1 100644 --- a/modules/java/generator/src/cpp/features2d_manual.hpp +++ b/modules/features2d/misc/java/src/cpp/features2d_manual.hpp @@ -5,6 +5,7 @@ #ifdef HAVE_OPENCV_FEATURES2D #include "opencv2/features2d.hpp" +#include "features2d_converters.hpp" #undef SIMPLEBLOB // to solve conflict with wincrypt.h on windows diff --git a/modules/java/android_test/src/org/opencv/test/features2d/BRIEFDescriptorExtractorTest.java b/modules/features2d/misc/java/test/BRIEFDescriptorExtractorTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/features2d/BRIEFDescriptorExtractorTest.java rename to modules/features2d/misc/java/test/BRIEFDescriptorExtractorTest.java diff --git a/modules/java/android_test/src/org/opencv/test/features2d/BruteForceDescriptorMatcherTest.java b/modules/features2d/misc/java/test/BruteForceDescriptorMatcherTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/features2d/BruteForceDescriptorMatcherTest.java rename to modules/features2d/misc/java/test/BruteForceDescriptorMatcherTest.java diff --git a/modules/java/android_test/src/org/opencv/test/features2d/BruteForceHammingDescriptorMatcherTest.java b/modules/features2d/misc/java/test/BruteForceHammingDescriptorMatcherTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/features2d/BruteForceHammingDescriptorMatcherTest.java rename to modules/features2d/misc/java/test/BruteForceHammingDescriptorMatcherTest.java diff --git a/modules/java/android_test/src/org/opencv/test/features2d/BruteForceHammingLUTDescriptorMatcherTest.java b/modules/features2d/misc/java/test/BruteForceHammingLUTDescriptorMatcherTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/features2d/BruteForceHammingLUTDescriptorMatcherTest.java rename to modules/features2d/misc/java/test/BruteForceHammingLUTDescriptorMatcherTest.java diff --git a/modules/java/android_test/src/org/opencv/test/features2d/BruteForceL1DescriptorMatcherTest.java b/modules/features2d/misc/java/test/BruteForceL1DescriptorMatcherTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/features2d/BruteForceL1DescriptorMatcherTest.java rename to modules/features2d/misc/java/test/BruteForceL1DescriptorMatcherTest.java diff --git a/modules/java/android_test/src/org/opencv/test/features2d/BruteForceSL2DescriptorMatcherTest.java b/modules/features2d/misc/java/test/BruteForceSL2DescriptorMatcherTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/features2d/BruteForceSL2DescriptorMatcherTest.java rename to modules/features2d/misc/java/test/BruteForceSL2DescriptorMatcherTest.java diff --git a/modules/java/android_test/src/org/opencv/test/features2d/DENSEFeatureDetectorTest.java b/modules/features2d/misc/java/test/DENSEFeatureDetectorTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/features2d/DENSEFeatureDetectorTest.java rename to modules/features2d/misc/java/test/DENSEFeatureDetectorTest.java diff --git a/modules/java/android_test/src/org/opencv/test/features2d/DynamicDENSEFeatureDetectorTest.java b/modules/features2d/misc/java/test/DynamicDENSEFeatureDetectorTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/features2d/DynamicDENSEFeatureDetectorTest.java rename to modules/features2d/misc/java/test/DynamicDENSEFeatureDetectorTest.java diff --git a/modules/java/android_test/src/org/opencv/test/features2d/DynamicFASTFeatureDetectorTest.java b/modules/features2d/misc/java/test/DynamicFASTFeatureDetectorTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/features2d/DynamicFASTFeatureDetectorTest.java rename to modules/features2d/misc/java/test/DynamicFASTFeatureDetectorTest.java diff --git a/modules/java/android_test/src/org/opencv/test/features2d/DynamicGFTTFeatureDetectorTest.java b/modules/features2d/misc/java/test/DynamicGFTTFeatureDetectorTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/features2d/DynamicGFTTFeatureDetectorTest.java rename to modules/features2d/misc/java/test/DynamicGFTTFeatureDetectorTest.java diff --git a/modules/java/android_test/src/org/opencv/test/features2d/DynamicHARRISFeatureDetectorTest.java b/modules/features2d/misc/java/test/DynamicHARRISFeatureDetectorTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/features2d/DynamicHARRISFeatureDetectorTest.java rename to modules/features2d/misc/java/test/DynamicHARRISFeatureDetectorTest.java diff --git a/modules/java/android_test/src/org/opencv/test/features2d/DynamicMSERFeatureDetectorTest.java b/modules/features2d/misc/java/test/DynamicMSERFeatureDetectorTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/features2d/DynamicMSERFeatureDetectorTest.java rename to modules/features2d/misc/java/test/DynamicMSERFeatureDetectorTest.java diff --git a/modules/java/android_test/src/org/opencv/test/features2d/DynamicORBFeatureDetectorTest.java b/modules/features2d/misc/java/test/DynamicORBFeatureDetectorTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/features2d/DynamicORBFeatureDetectorTest.java rename to modules/features2d/misc/java/test/DynamicORBFeatureDetectorTest.java diff --git a/modules/java/android_test/src/org/opencv/test/features2d/DynamicSIFTFeatureDetectorTest.java b/modules/features2d/misc/java/test/DynamicSIFTFeatureDetectorTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/features2d/DynamicSIFTFeatureDetectorTest.java rename to modules/features2d/misc/java/test/DynamicSIFTFeatureDetectorTest.java diff --git a/modules/java/android_test/src/org/opencv/test/features2d/DynamicSIMPLEBLOBFeatureDetectorTest.java b/modules/features2d/misc/java/test/DynamicSIMPLEBLOBFeatureDetectorTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/features2d/DynamicSIMPLEBLOBFeatureDetectorTest.java rename to modules/features2d/misc/java/test/DynamicSIMPLEBLOBFeatureDetectorTest.java diff --git a/modules/java/android_test/src/org/opencv/test/features2d/DynamicSTARFeatureDetectorTest.java b/modules/features2d/misc/java/test/DynamicSTARFeatureDetectorTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/features2d/DynamicSTARFeatureDetectorTest.java rename to modules/features2d/misc/java/test/DynamicSTARFeatureDetectorTest.java diff --git a/modules/java/android_test/src/org/opencv/test/features2d/DynamicSURFFeatureDetectorTest.java b/modules/features2d/misc/java/test/DynamicSURFFeatureDetectorTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/features2d/DynamicSURFFeatureDetectorTest.java rename to modules/features2d/misc/java/test/DynamicSURFFeatureDetectorTest.java diff --git a/modules/java/android_test/src/org/opencv/test/features2d/FASTFeatureDetectorTest.java b/modules/features2d/misc/java/test/FASTFeatureDetectorTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/features2d/FASTFeatureDetectorTest.java rename to modules/features2d/misc/java/test/FASTFeatureDetectorTest.java diff --git a/modules/java/android_test/src/org/opencv/test/features2d/Features2dTest.java b/modules/features2d/misc/java/test/Features2dTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/features2d/Features2dTest.java rename to modules/features2d/misc/java/test/Features2dTest.java diff --git a/modules/java/android_test/src/org/opencv/test/features2d/FernGenericDescriptorMatcherTest.java b/modules/features2d/misc/java/test/FernGenericDescriptorMatcherTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/features2d/FernGenericDescriptorMatcherTest.java rename to modules/features2d/misc/java/test/FernGenericDescriptorMatcherTest.java diff --git a/modules/java/android_test/src/org/opencv/test/features2d/FlannBasedDescriptorMatcherTest.java b/modules/features2d/misc/java/test/FlannBasedDescriptorMatcherTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/features2d/FlannBasedDescriptorMatcherTest.java rename to modules/features2d/misc/java/test/FlannBasedDescriptorMatcherTest.java diff --git a/modules/java/android_test/src/org/opencv/test/features2d/GFTTFeatureDetectorTest.java b/modules/features2d/misc/java/test/GFTTFeatureDetectorTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/features2d/GFTTFeatureDetectorTest.java rename to modules/features2d/misc/java/test/GFTTFeatureDetectorTest.java diff --git a/modules/java/android_test/src/org/opencv/test/features2d/GridDENSEFeatureDetectorTest.java b/modules/features2d/misc/java/test/GridDENSEFeatureDetectorTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/features2d/GridDENSEFeatureDetectorTest.java rename to modules/features2d/misc/java/test/GridDENSEFeatureDetectorTest.java diff --git a/modules/java/android_test/src/org/opencv/test/features2d/GridFASTFeatureDetectorTest.java b/modules/features2d/misc/java/test/GridFASTFeatureDetectorTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/features2d/GridFASTFeatureDetectorTest.java rename to modules/features2d/misc/java/test/GridFASTFeatureDetectorTest.java diff --git a/modules/java/android_test/src/org/opencv/test/features2d/GridGFTTFeatureDetectorTest.java b/modules/features2d/misc/java/test/GridGFTTFeatureDetectorTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/features2d/GridGFTTFeatureDetectorTest.java rename to modules/features2d/misc/java/test/GridGFTTFeatureDetectorTest.java diff --git a/modules/java/android_test/src/org/opencv/test/features2d/GridHARRISFeatureDetectorTest.java b/modules/features2d/misc/java/test/GridHARRISFeatureDetectorTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/features2d/GridHARRISFeatureDetectorTest.java rename to modules/features2d/misc/java/test/GridHARRISFeatureDetectorTest.java diff --git a/modules/java/android_test/src/org/opencv/test/features2d/GridMSERFeatureDetectorTest.java b/modules/features2d/misc/java/test/GridMSERFeatureDetectorTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/features2d/GridMSERFeatureDetectorTest.java rename to modules/features2d/misc/java/test/GridMSERFeatureDetectorTest.java diff --git a/modules/java/android_test/src/org/opencv/test/features2d/GridORBFeatureDetectorTest.java b/modules/features2d/misc/java/test/GridORBFeatureDetectorTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/features2d/GridORBFeatureDetectorTest.java rename to modules/features2d/misc/java/test/GridORBFeatureDetectorTest.java diff --git a/modules/java/android_test/src/org/opencv/test/features2d/GridSIFTFeatureDetectorTest.java b/modules/features2d/misc/java/test/GridSIFTFeatureDetectorTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/features2d/GridSIFTFeatureDetectorTest.java rename to modules/features2d/misc/java/test/GridSIFTFeatureDetectorTest.java diff --git a/modules/java/android_test/src/org/opencv/test/features2d/GridSIMPLEBLOBFeatureDetectorTest.java b/modules/features2d/misc/java/test/GridSIMPLEBLOBFeatureDetectorTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/features2d/GridSIMPLEBLOBFeatureDetectorTest.java rename to modules/features2d/misc/java/test/GridSIMPLEBLOBFeatureDetectorTest.java diff --git a/modules/java/android_test/src/org/opencv/test/features2d/GridSTARFeatureDetectorTest.java b/modules/features2d/misc/java/test/GridSTARFeatureDetectorTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/features2d/GridSTARFeatureDetectorTest.java rename to modules/features2d/misc/java/test/GridSTARFeatureDetectorTest.java diff --git a/modules/java/android_test/src/org/opencv/test/features2d/GridSURFFeatureDetectorTest.java b/modules/features2d/misc/java/test/GridSURFFeatureDetectorTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/features2d/GridSURFFeatureDetectorTest.java rename to modules/features2d/misc/java/test/GridSURFFeatureDetectorTest.java diff --git a/modules/java/android_test/src/org/opencv/test/features2d/HARRISFeatureDetectorTest.java b/modules/features2d/misc/java/test/HARRISFeatureDetectorTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/features2d/HARRISFeatureDetectorTest.java rename to modules/features2d/misc/java/test/HARRISFeatureDetectorTest.java diff --git a/modules/java/android_test/src/org/opencv/test/features2d/MSERFeatureDetectorTest.java b/modules/features2d/misc/java/test/MSERFeatureDetectorTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/features2d/MSERFeatureDetectorTest.java rename to modules/features2d/misc/java/test/MSERFeatureDetectorTest.java diff --git a/modules/java/android_test/src/org/opencv/test/features2d/ORBDescriptorExtractorTest.java b/modules/features2d/misc/java/test/ORBDescriptorExtractorTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/features2d/ORBDescriptorExtractorTest.java rename to modules/features2d/misc/java/test/ORBDescriptorExtractorTest.java diff --git a/modules/java/android_test/src/org/opencv/test/features2d/ORBFeatureDetectorTest.java b/modules/features2d/misc/java/test/ORBFeatureDetectorTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/features2d/ORBFeatureDetectorTest.java rename to modules/features2d/misc/java/test/ORBFeatureDetectorTest.java diff --git a/modules/java/android_test/src/org/opencv/test/features2d/OneWayGenericDescriptorMatcherTest.java b/modules/features2d/misc/java/test/OneWayGenericDescriptorMatcherTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/features2d/OneWayGenericDescriptorMatcherTest.java rename to modules/features2d/misc/java/test/OneWayGenericDescriptorMatcherTest.java diff --git a/modules/java/android_test/src/org/opencv/test/features2d/OpponentBRIEFDescriptorExtractorTest.java b/modules/features2d/misc/java/test/OpponentBRIEFDescriptorExtractorTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/features2d/OpponentBRIEFDescriptorExtractorTest.java rename to modules/features2d/misc/java/test/OpponentBRIEFDescriptorExtractorTest.java diff --git a/modules/java/android_test/src/org/opencv/test/features2d/OpponentORBDescriptorExtractorTest.java b/modules/features2d/misc/java/test/OpponentORBDescriptorExtractorTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/features2d/OpponentORBDescriptorExtractorTest.java rename to modules/features2d/misc/java/test/OpponentORBDescriptorExtractorTest.java diff --git a/modules/java/android_test/src/org/opencv/test/features2d/OpponentSIFTDescriptorExtractorTest.java b/modules/features2d/misc/java/test/OpponentSIFTDescriptorExtractorTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/features2d/OpponentSIFTDescriptorExtractorTest.java rename to modules/features2d/misc/java/test/OpponentSIFTDescriptorExtractorTest.java diff --git a/modules/java/android_test/src/org/opencv/test/features2d/OpponentSURFDescriptorExtractorTest.java b/modules/features2d/misc/java/test/OpponentSURFDescriptorExtractorTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/features2d/OpponentSURFDescriptorExtractorTest.java rename to modules/features2d/misc/java/test/OpponentSURFDescriptorExtractorTest.java diff --git a/modules/java/android_test/src/org/opencv/test/features2d/PyramidDENSEFeatureDetectorTest.java b/modules/features2d/misc/java/test/PyramidDENSEFeatureDetectorTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/features2d/PyramidDENSEFeatureDetectorTest.java rename to modules/features2d/misc/java/test/PyramidDENSEFeatureDetectorTest.java diff --git a/modules/java/android_test/src/org/opencv/test/features2d/PyramidFASTFeatureDetectorTest.java b/modules/features2d/misc/java/test/PyramidFASTFeatureDetectorTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/features2d/PyramidFASTFeatureDetectorTest.java rename to modules/features2d/misc/java/test/PyramidFASTFeatureDetectorTest.java diff --git a/modules/java/android_test/src/org/opencv/test/features2d/PyramidGFTTFeatureDetectorTest.java b/modules/features2d/misc/java/test/PyramidGFTTFeatureDetectorTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/features2d/PyramidGFTTFeatureDetectorTest.java rename to modules/features2d/misc/java/test/PyramidGFTTFeatureDetectorTest.java diff --git a/modules/java/android_test/src/org/opencv/test/features2d/PyramidHARRISFeatureDetectorTest.java b/modules/features2d/misc/java/test/PyramidHARRISFeatureDetectorTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/features2d/PyramidHARRISFeatureDetectorTest.java rename to modules/features2d/misc/java/test/PyramidHARRISFeatureDetectorTest.java diff --git a/modules/java/android_test/src/org/opencv/test/features2d/PyramidMSERFeatureDetectorTest.java b/modules/features2d/misc/java/test/PyramidMSERFeatureDetectorTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/features2d/PyramidMSERFeatureDetectorTest.java rename to modules/features2d/misc/java/test/PyramidMSERFeatureDetectorTest.java diff --git a/modules/java/android_test/src/org/opencv/test/features2d/PyramidORBFeatureDetectorTest.java b/modules/features2d/misc/java/test/PyramidORBFeatureDetectorTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/features2d/PyramidORBFeatureDetectorTest.java rename to modules/features2d/misc/java/test/PyramidORBFeatureDetectorTest.java diff --git a/modules/java/android_test/src/org/opencv/test/features2d/PyramidSIFTFeatureDetectorTest.java b/modules/features2d/misc/java/test/PyramidSIFTFeatureDetectorTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/features2d/PyramidSIFTFeatureDetectorTest.java rename to modules/features2d/misc/java/test/PyramidSIFTFeatureDetectorTest.java diff --git a/modules/java/android_test/src/org/opencv/test/features2d/PyramidSIMPLEBLOBFeatureDetectorTest.java b/modules/features2d/misc/java/test/PyramidSIMPLEBLOBFeatureDetectorTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/features2d/PyramidSIMPLEBLOBFeatureDetectorTest.java rename to modules/features2d/misc/java/test/PyramidSIMPLEBLOBFeatureDetectorTest.java diff --git a/modules/java/android_test/src/org/opencv/test/features2d/PyramidSTARFeatureDetectorTest.java b/modules/features2d/misc/java/test/PyramidSTARFeatureDetectorTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/features2d/PyramidSTARFeatureDetectorTest.java rename to modules/features2d/misc/java/test/PyramidSTARFeatureDetectorTest.java diff --git a/modules/java/android_test/src/org/opencv/test/features2d/PyramidSURFFeatureDetectorTest.java b/modules/features2d/misc/java/test/PyramidSURFFeatureDetectorTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/features2d/PyramidSURFFeatureDetectorTest.java rename to modules/features2d/misc/java/test/PyramidSURFFeatureDetectorTest.java diff --git a/modules/java/android_test/src/org/opencv/test/features2d/SIFTDescriptorExtractorTest.java b/modules/features2d/misc/java/test/SIFTDescriptorExtractorTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/features2d/SIFTDescriptorExtractorTest.java rename to modules/features2d/misc/java/test/SIFTDescriptorExtractorTest.java diff --git a/modules/java/android_test/src/org/opencv/test/features2d/SIFTFeatureDetectorTest.java b/modules/features2d/misc/java/test/SIFTFeatureDetectorTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/features2d/SIFTFeatureDetectorTest.java rename to modules/features2d/misc/java/test/SIFTFeatureDetectorTest.java diff --git a/modules/java/android_test/src/org/opencv/test/features2d/SIMPLEBLOBFeatureDetectorTest.java b/modules/features2d/misc/java/test/SIMPLEBLOBFeatureDetectorTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/features2d/SIMPLEBLOBFeatureDetectorTest.java rename to modules/features2d/misc/java/test/SIMPLEBLOBFeatureDetectorTest.java diff --git a/modules/java/android_test/src/org/opencv/test/features2d/STARFeatureDetectorTest.java b/modules/features2d/misc/java/test/STARFeatureDetectorTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/features2d/STARFeatureDetectorTest.java rename to modules/features2d/misc/java/test/STARFeatureDetectorTest.java diff --git a/modules/java/android_test/src/org/opencv/test/features2d/SURFDescriptorExtractorTest.java b/modules/features2d/misc/java/test/SURFDescriptorExtractorTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/features2d/SURFDescriptorExtractorTest.java rename to modules/features2d/misc/java/test/SURFDescriptorExtractorTest.java diff --git a/modules/java/android_test/src/org/opencv/test/features2d/SURFFeatureDetectorTest.java b/modules/features2d/misc/java/test/SURFFeatureDetectorTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/features2d/SURFFeatureDetectorTest.java rename to modules/features2d/misc/java/test/SURFFeatureDetectorTest.java diff --git a/modules/imgcodecs/CMakeLists.txt b/modules/imgcodecs/CMakeLists.txt index 3d0110ef48..0d3bd52f8b 100644 --- a/modules/imgcodecs/CMakeLists.txt +++ b/modules/imgcodecs/CMakeLists.txt @@ -1,5 +1,5 @@ set(the_description "Image codecs") -ocv_add_module(imgcodecs opencv_imgproc) +ocv_add_module(imgcodecs opencv_imgproc WRAP java) # ---------------------------------------------------------------------------- # CMake file for imgcodecs. See root CMakeLists.txt diff --git a/modules/java/android_test/src/org/opencv/test/highgui/HighguiTest.java b/modules/imgcodecs/misc/java/test/HighguiTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/highgui/HighguiTest.java rename to modules/imgcodecs/misc/java/test/HighguiTest.java diff --git a/modules/imgproc/CMakeLists.txt b/modules/imgproc/CMakeLists.txt index 652d6e1ebe..10bc5f0de8 100644 --- a/modules/imgproc/CMakeLists.txt +++ b/modules/imgproc/CMakeLists.txt @@ -1,2 +1,2 @@ set(the_description "Image Processing") -ocv_define_module(imgproc opencv_core) +ocv_define_module(imgproc opencv_core WRAP java) diff --git a/modules/java/android_test/src/org/opencv/test/imgproc/ImgprocTest.java b/modules/imgproc/misc/java/test/ImgprocTest.java similarity index 99% rename from modules/java/android_test/src/org/opencv/test/imgproc/ImgprocTest.java rename to modules/imgproc/misc/java/test/ImgprocTest.java index f6cb5eee9f..0b06152b3c 100644 --- a/modules/java/android_test/src/org/opencv/test/imgproc/ImgprocTest.java +++ b/modules/imgproc/misc/java/test/ImgprocTest.java @@ -165,7 +165,7 @@ public class ImgprocTest extends OpenCVTestCase { double arcLength = Imgproc.arcLength(curve, false); - assertEquals(5.656854152679443, arcLength); + assertEquals(5.656854249, arcLength, 0.000001); } public void testBilateralFilterMatMatIntDoubleDouble() { diff --git a/modules/java/android_test/src/org/opencv/test/imgproc/MomentsTest.java b/modules/imgproc/misc/java/test/MomentsTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/imgproc/MomentsTest.java rename to modules/imgproc/misc/java/test/MomentsTest.java diff --git a/modules/java/android_test/src/org/opencv/test/imgproc/Subdiv2DTest.java b/modules/imgproc/misc/java/test/Subdiv2DTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/imgproc/Subdiv2DTest.java rename to modules/imgproc/misc/java/test/Subdiv2DTest.java diff --git a/modules/java/CMakeLists.txt b/modules/java/CMakeLists.txt index 1d7a467869..bf2e5598bb 100644 --- a/modules/java/CMakeLists.txt +++ b/modules/java/CMakeLists.txt @@ -8,7 +8,7 @@ if(IOS OR NOT PYTHON_DEFAULT_AVAILABLE OR NOT ANT_EXECUTABLE OR NOT (JNI_FOUND O endif() set(the_description "The java bindings") -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_bioinspired) +ocv_add_module(java BINDINGS opencv_core opencv_imgproc) ocv_module_include_directories("${CMAKE_CURRENT_SOURCE_DIR}/generator/src/cpp") if(NOT ANDROID) @@ -20,88 +20,168 @@ set(JAVA_INSTALL_ROOT "sdk/java") set(JNI_INSTALL_ROOT "sdk/native") # get list of modules to wrap -string(REPLACE "opencv_" "" OPENCV_JAVA_MODULES "${OPENCV_MODULE_${the_module}_REQ_DEPS};${OPENCV_MODULE_${the_module}_OPT_DEPS}") -foreach(module ${OPENCV_JAVA_MODULES}) - if(NOT HAVE_opencv_${module}) - list(REMOVE_ITEM OPENCV_JAVA_MODULES ${module}) +message(STATUS "Wrapped in java:") +set(OPENCV_JAVA_MODULES) +foreach(m ${OPENCV_MODULES_BUILD}) + if (";${OPENCV_MODULE_${m}_WRAPPERS};" MATCHES ";java;" AND HAVE_${m}) + string(REPLACE "opencv_" "" m ${m}) + list(APPEND OPENCV_JAVA_MODULES ${m}) + message(STATUS "\topencv_${m}") endif() endforeach() ###################################################################################################################################### +# UTILITY: make C headers go first +macro(sort_headers_c_cpp __lst) + set(__cpp ${${__lst}}) + ocv_list_filterout(__cpp "\\\\.h$") + if(__cpp) + list(REMOVE_ITEM ${__lst} ${__cpp}) + list(APPEND ${__lst} ${__cpp}) + endif() + unset(__cpp) +endmacro() + +# UTILITY: force cmake to rerun when files from list have changed +macro(add_cmake_dependencies) + foreach (f ${ARGN}) + get_filename_component(f_name "${f}" NAME) + configure_file(${f} ${OpenCV_BINARY_DIR}/junk/${f_name}.junk COPYONLY) + endforeach() +endmacro() + +# UTILITY: glob specific sources and append them to list (type is in H, CPP, JAVA, AIDL) +macro(glob_more_specific_sources _type _root _output) + unset(_masks) + if(${_type} STREQUAL "H") + set(_masks "${_root}/src/cpp/*.h" "${root}/src/cpp/*.hpp") + elseif(${_type} STREQUAL "CPP") + set(_masks "${_root}/src/cpp/*.cpp") + elseif(${_type} STREQUAL "JAVA") + set(_masks "${_root}/src/java/*.java") + elseif(${_type} STREQUAL "AIDL") + set(_masks "${_root}/src/java/*.aidl") + endif() + if (_masks) + file(GLOB _result ${_masks}) + list(APPEND ${_output} ${_result}) + else() + message(WARNING "Bad argument passed to macro: skipped") + endif() +endmacro() + +# UTILITY: copy common java test files and add them to _deps +# copy_common_tests( ) +macro(copy_common_tests _src_location _dst_location _deps) + set(_src ${${_src_location}}) + set(_dst ${${_dst_location}}) + file(GLOB_RECURSE _files RELATIVE "${_src}" "${_src}/res/*" "${_src}/src/*") + foreach(f ${_files}) + add_custom_command( + OUTPUT "${_dst}/${f}" + COMMAND ${CMAKE_COMMAND} -E copy "${_src}/${f}" "${_dst}/${f}" + MAIN_DEPENDENCY "${_src}/${f}" + COMMENT "Copying ${f}") + list(APPEND ${_deps} "${_src}/${f}" "${_dst}/${f}") + endforeach() + unset(_files) + unset(_src) + unset(_dst) +endmacro() + +# UTILITY: copy all java tests for specific module and add them to _deps +# copy_modules_tests( ) +macro(copy_modules_tests _modules _dst_location _deps) + set(_dst ${${_dst_location}}) + foreach(module ${${_modules}}) + set(_src "${OPENCV_MODULE_opencv_${module}_LOCATION}/misc/java/test") + set(_tree "src/org/opencv/test/${module}") + file(GLOB _files RELATIVE "${_src}" "${_src}/*.java") + foreach (f ${_files}) + add_custom_command( + OUTPUT "${_dst}/${_tree}/${f}" + COMMAND ${CMAKE_COMMAND} -E copy "${_src}/${f}" "${_dst}/${_tree}/${f}" + MAIN_DEPENDENCY "${_src}/${f}" + COMMENT "Copying ${f}") + list(APPEND ${_deps} "${_src}/${f}" "${_dst}/${_tree}/${f}") + endforeach() + unset(_files) + unset(_src) + unset(_tree) + endforeach() + unset(_dst) +endmacro() + +###################################################################################################################################### + # scripts set(scripts_gen_java "${CMAKE_CURRENT_SOURCE_DIR}/generator/gen_java.py") set(scripts_hdr_parser "${CMAKE_CURRENT_SOURCE_DIR}/../python/src2/hdr_parser.py") +# directory to store temporary files generated on first gen_java.py run +set(probe_dir "${CMAKE_CURRENT_BINARY_DIR}/gen_java_out") + # handwritten C/C++ and Java sources -file(GLOB handwrittren_h_sources "${CMAKE_CURRENT_SOURCE_DIR}/generator/src/cpp/*.h" "${CMAKE_CURRENT_SOURCE_DIR}/generator/src/cpp/*.hpp") -file(GLOB handwrittren_cpp_sources "${CMAKE_CURRENT_SOURCE_DIR}/generator/src/cpp/*.cpp") -file(GLOB handwrittren_java_sources "${CMAKE_CURRENT_SOURCE_DIR}/generator/src/java/*.java") -file(GLOB handwrittren_aidl_sources "${CMAKE_CURRENT_SOURCE_DIR}/generator/src/java/*.aidl") +glob_more_specific_sources(H "${CMAKE_CURRENT_SOURCE_DIR}/generator" handwritten_h_sources) +glob_more_specific_sources(CPP "${CMAKE_CURRENT_SOURCE_DIR}/generator" handwritten_cpp_sources) +glob_more_specific_sources(JAVA "${CMAKE_CURRENT_SOURCE_DIR}/generator" handwritten_java_sources) +glob_more_specific_sources(AIDL "${CMAKE_CURRENT_SOURCE_DIR}/generator" handwritten_aidl_sources) + +# headers of OpenCV modules +set(opencv_public_headers "") +set(generated_cpp_sources "") +set(generated_java_sources "") +foreach(module ${OPENCV_JAVA_MODULES}) + set(module_java_dir "${OPENCV_MODULE_opencv_${module}_LOCATION}/misc/java") + set(custom_header_list "${module_java_dir}/filelist") + if(EXISTS "${custom_header_list}") + file(STRINGS "${custom_header_list}" module_headers) + ocv_list_add_prefix(module_headers "${OPENCV_MODULE_opencv_${module}_LOCATION}/") + else() + set(module_headers "${OPENCV_MODULE_opencv_${module}_HEADERS}") + endif() + + if(NOT module_headers) + message(WARNING "Module ${module} does not have headers to wrap for java") + endif() + + sort_headers_c_cpp(module_headers) + + set(opencv_public_headers_${module} ${module_headers}) + list(APPEND opencv_public_headers ${module_headers}) + list(APPEND generated_cpp_sources "${CMAKE_CURRENT_BINARY_DIR}/${module}.cpp") + + include_directories("${module_java_dir}/src/cpp") + + glob_more_specific_sources(H "${module_java_dir}" handwritten_h_sources) + glob_more_specific_sources(CPP "${module_java_dir}" handwritten_cpp_sources) + glob_more_specific_sources(JAVA "${module_java_dir}" handwritten_java_sources) + glob_more_specific_sources(AIDL "${module_java_dir}" handwritten_aidl_sources) + + # first run of gen_java.py (to get list of generated files) + file(REMOVE_RECURSE "${probe_dir}") + file(MAKE_DIRECTORY "${probe_dir}") + execute_process(COMMAND ${PYTHON_DEFAULT_EXECUTABLE} "${scripts_gen_java}" "${scripts_hdr_parser}" ${module} ${opencv_public_headers_${module}} + WORKING_DIRECTORY "${probe_dir}" + OUTPUT_QUIET ERROR_QUIET) + file(GLOB_RECURSE generated_java_sources_${module} RELATIVE "${probe_dir}" "${probe_dir}/*.java") + ocv_list_add_prefix(generated_java_sources_${module} "${CMAKE_CURRENT_BINARY_DIR}/") + list(APPEND generated_java_sources ${generated_java_sources_${module}}) +endforeach() + +file(REMOVE_RECURSE "${probe_dir}") + if(NOT ANDROID) - ocv_list_filterout(handwrittren_java_sources "/(engine|android)\\\\+") - ocv_list_filterout(handwrittren_aidl_sources "/(engine|android)\\\\+") + ocv_list_filterout(handwritten_java_sources "/(engine|android)\\\\+") + ocv_list_filterout(handwritten_aidl_sources "/(engine|android)\\\\+") else() file(GLOB_RECURSE handwrittren_lib_project_files_rel RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/android_lib/" "${CMAKE_CURRENT_SOURCE_DIR}/android_lib/*") list(REMOVE_ITEM handwrittren_lib_project_files_rel "${ANDROID_MANIFEST_FILE}") endif() -# headers of OpenCV modules -set(opencv_public_headers "") -foreach(module ${OPENCV_JAVA_MODULES}) - # get list of module headers - if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/generator/config/${module}.filelist") - file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/generator/config/${module}.filelist" module_headers) - ocv_list_add_prefix(module_headers "${OPENCV_MODULE_opencv_${module}_LOCATION}/") - else() - set(module_headers "${OPENCV_MODULE_opencv_${module}_HEADERS}") - endif() - if(module_headers) - # C headers must go first - set(module_headers_cpp ${module_headers}) - ocv_list_filterout(module_headers_cpp "\\\\.h$") - if(module_headers_cpp) - list(REMOVE_ITEM module_headers ${module_headers_cpp}) - list(APPEND module_headers ${module_headers_cpp}) - endif() - unset(module_headers_cpp) - - set(opencv_public_headers_${module} ${module_headers}) - list(APPEND opencv_public_headers ${module_headers}) - else() - list(REMOVE_ITEM OPENCV_JAVA_MODULES ${module}) - endif() -endforeach() - -# generated cpp files -set(generated_cpp_sources "") -foreach(module ${OPENCV_JAVA_MODULES}) - list(APPEND generated_cpp_sources "${CMAKE_CURRENT_BINARY_DIR}/${module}.cpp") -endforeach() - # IMPORTANT: add dependencies to cmake (we should rerun cmake if any of these files is modified) -configure_file("${scripts_gen_java}" "${OpenCV_BINARY_DIR}/junk/gen_java.junk" COPYONLY) -configure_file("${scripts_hdr_parser}" "${OpenCV_BINARY_DIR}/junk/hdr_parser.junk" COPYONLY) -foreach(header ${opencv_public_headers}) - get_filename_component(header_name "${header}" NAME) - configure_file("${header}" "${OpenCV_BINARY_DIR}/junk/${header_name}.junk" COPYONLY) -endforeach() - -# generated java files -set(generated_java_sources "") -foreach(module ${OPENCV_JAVA_MODULES}) - # first run of gen_java.py (to get list of generated files) - file(REMOVE_RECURSE "${CMAKE_CURRENT_BINARY_DIR}/gen_java_out/") - file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/gen_java_out") - execute_process(COMMAND ${PYTHON_DEFAULT_EXECUTABLE} "${scripts_gen_java}" "${scripts_hdr_parser}" ${module} ${opencv_public_headers_${module}} - WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/gen_java_out" - OUTPUT_QUIET ERROR_QUIET) - unset(generated_java_sources_${module}) - file(GLOB_RECURSE generated_java_sources_${module} RELATIVE "${CMAKE_CURRENT_BINARY_DIR}/gen_java_out/" "${CMAKE_CURRENT_BINARY_DIR}/gen_java_out/*.java") - ocv_list_add_prefix(generated_java_sources_${module} "${CMAKE_CURRENT_BINARY_DIR}/") - - list(APPEND generated_java_sources ${generated_java_sources_${module}}) -endforeach() +add_cmake_dependencies(${scripts_gen_java} ${scripts_hdr_parser} ${opencv_public_headers}) ###################################################################################################################################### @@ -116,19 +196,20 @@ foreach(module ${OPENCV_JAVA_MODULES}) ) endforeach() +# step 2: TODO: generate documentation somewhere + # step 3: copy files to destination -set(step3_input_files ${generated_java_sources} ${handwrittren_java_sources} ${handwrittren_aidl_sources}) +set(step3_input_files ${generated_java_sources} ${handwritten_java_sources} ${handwritten_aidl_sources}) set(copied_files "") foreach(java_file ${step3_input_files}) get_filename_component(java_file_name "${java_file}" NAME) string(REPLACE "-jdoc.java" ".java" java_file_name "${java_file_name}") string(REPLACE "+" "/" java_file_name "${java_file_name}") set(output_name "${OpenCV_BINARY_DIR}/src/org/opencv/${java_file_name}") - add_custom_command(OUTPUT "${output_name}" COMMAND ${CMAKE_COMMAND} -E copy "${java_file}" "${output_name}" MAIN_DEPENDENCY "${java_file}" - DEPENDS ${step1_depends} ${generated_java_sources} ${handwrittren_java_sources} + DEPENDS ${step1_depends} ${generated_java_sources} ${handwritten_java_sources} COMMENT "Generating src/org/opencv/${java_file_name}" ) list(APPEND copied_files "${output_name}") @@ -154,7 +235,7 @@ if(ANDROID) endforeach() # library project jni sources (nothing really depends on them so we will not add them to step3_input_files) - foreach(jni_file ${handwrittren_cpp_sources} ${handwrittren_h_sources} ${generated_cpp_sources}) + foreach(jni_file ${handwritten_cpp_sources} ${handwritten_h_sources} ${generated_cpp_sources}) get_filename_component(jni_file_name "${jni_file}" NAME) add_custom_command(OUTPUT "${OpenCV_BINARY_DIR}/jni/${jni_file_name}" COMMAND ${CMAKE_COMMAND} -E copy "${jni_file}" "${OpenCV_BINARY_DIR}/jni/${jni_file_name}" @@ -250,7 +331,7 @@ endif(ANDROID) # workarounding lack of `__attribute__ ((visibility("default")))` in jni_md.h/JNIEXPORT string(REPLACE "-fvisibility=hidden" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") -ocv_add_library(${the_module} SHARED ${handwrittren_h_sources} ${handwrittren_cpp_sources} ${generated_cpp_sources} +ocv_add_library(${the_module} SHARED ${handwritten_h_sources} ${handwritten_cpp_sources} ${generated_cpp_sources} ${copied_files} "${JAR_FILE}" "${JAR_FILE}.dephelper") @@ -332,6 +413,6 @@ if(BUILD_TESTS) if(ANDROID) add_subdirectory(android_test) else() - add_subdirectory(test) + add_subdirectory(pure_test) endif() endif() diff --git a/modules/java/android_test/CMakeLists.txt b/modules/java/android_test/CMakeLists.txt index d1a26bf6cb..08db704b8d 100644 --- a/modules/java/android_test/CMakeLists.txt +++ b/modules/java/android_test/CMakeLists.txt @@ -1,34 +1,30 @@ -# list of modules covered with tests -set(tested_modules opencv_calib3d opencv_core opencv_features2d opencv_highgui opencv_imgproc opencv_objdetect opencv_photo opencv_video) - -# opencv_ml is broken -#list(APPEND tested_modules opencv_ml) - -ocv_check_dependencies(opencv_java ${tested_modules}) - -if(NOT OCV_DEPENDENCIES_FOUND OR NOT ANT_EXECUTABLE OR NOT ANDROID_EXECUTABLE OR NOT ANDROID_TOOLS_Pkg_Revision GREATER 13) +if(NOT ANT_EXECUTABLE OR NOT ANDROID_EXECUTABLE OR NOT ANDROID_TOOLS_Pkg_Revision GREATER 13) return() endif() project(opencv_test_java) set(opencv_test_java_bin_dir "${CMAKE_CURRENT_BINARY_DIR}/.build") +set(test_dir "${CMAKE_CURRENT_SOURCE_DIR}") +set(test_common_dir "${CMAKE_CURRENT_SOURCE_DIR}/../common_test") -# get project sources -file(GLOB_RECURSE opencv_test_java_files RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/res/*" "${CMAKE_CURRENT_SOURCE_DIR}/src/*") -ocv_list_filterout(opencv_test_java_files ".svn") -# opencv_ml is broken -ocv_list_filterout(opencv_test_java_files "/ml/") - -# copy sources out from the build tree set(opencv_test_java_file_deps "") -foreach(f ${opencv_test_java_files} ${ANDROID_MANIFEST_FILE} ".classpath" ".project") + +# 1. gather and copy common test files (resources, utils, etc.) +copy_common_tests(test_common_dir opencv_test_java_bin_dir opencv_test_java_file_deps) + +# 2. gather and copy tests from each module +copy_modules_tests(OPENCV_JAVA_MODULES opencv_test_java_bin_dir opencv_test_java_file_deps) + +# 3. gather and copy specific files for Android +file(GLOB_RECURSE test_files RELATIVE "${test_dir}" "${test_dir}/res/*" "${test_dir}/src/*") +foreach(f ${test_files} ${ANDROID_MANIFEST_FILE} ".classpath" ".project") add_custom_command( OUTPUT "${opencv_test_java_bin_dir}/${f}" - COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/${f}" "${opencv_test_java_bin_dir}/${f}" - MAIN_DEPENDENCY "${CMAKE_CURRENT_SOURCE_DIR}/${f}" + COMMAND ${CMAKE_COMMAND} -E copy "${test_dir}/${f}" "${opencv_test_java_bin_dir}/${f}" + MAIN_DEPENDENCY "${test_dir}/${f}" COMMENT "Copying ${f}") - list(APPEND opencv_test_java_file_deps "${CMAKE_CURRENT_SOURCE_DIR}/${f}" "${opencv_test_java_bin_dir}/${f}") + list(APPEND opencv_test_java_file_deps "${test_dir}/${f}" "${opencv_test_java_bin_dir}/${f}") endforeach() # fix Android project diff --git a/modules/java/android_test/src/org/opencv/test/ml/CvANN_MLPTest.java b/modules/java/android_test/src/org/opencv/test/ml/CvANN_MLPTest.java deleted file mode 100644 index f0480a50c6..0000000000 --- a/modules/java/android_test/src/org/opencv/test/ml/CvANN_MLPTest.java +++ /dev/null @@ -1,68 +0,0 @@ -package org.opencv.test.ml; - -import org.opencv.ml.CvANN_MLP; -import org.opencv.test.OpenCVTestCase; - -public class CvANN_MLPTest extends OpenCVTestCase { - - public void testClear() { - fail("Not yet implemented"); - } - - public void testCreateMat() { - fail("Not yet implemented"); - } - - public void testCreateMatInt() { - fail("Not yet implemented"); - } - - public void testCreateMatIntDouble() { - fail("Not yet implemented"); - } - - public void testCreateMatIntDoubleDouble() { - fail("Not yet implemented"); - } - - public void testCvANN_MLP() { - new CvANN_MLP(); - } - - public void testCvANN_MLPMat() { - fail("Not yet implemented"); - } - - public void testCvANN_MLPMatInt() { - fail("Not yet implemented"); - } - - public void testCvANN_MLPMatIntDouble() { - fail("Not yet implemented"); - } - - public void testCvANN_MLPMatIntDoubleDouble() { - fail("Not yet implemented"); - } - - public void testPredict() { - fail("Not yet implemented"); - } - - public void testTrainMatMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatMatMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatMatMatMatCvANN_MLP_TrainParams() { - fail("Not yet implemented"); - } - - public void testTrainMatMatMatMatCvANN_MLP_TrainParamsInt() { - fail("Not yet implemented"); - } - -} diff --git a/modules/java/android_test/src/org/opencv/test/ml/CvANN_MLP_TrainParamsTest.java b/modules/java/android_test/src/org/opencv/test/ml/CvANN_MLP_TrainParamsTest.java deleted file mode 100644 index 64b28cae24..0000000000 --- a/modules/java/android_test/src/org/opencv/test/ml/CvANN_MLP_TrainParamsTest.java +++ /dev/null @@ -1,76 +0,0 @@ -package org.opencv.test.ml; - -import org.opencv.ml.CvANN_MLP_TrainParams; -import org.opencv.test.OpenCVTestCase; - -public class CvANN_MLP_TrainParamsTest extends OpenCVTestCase { - - public void testCvANN_MLP_TrainParams() { - new CvANN_MLP_TrainParams(); - } - - public void testGet_bp_dw_scale() { - fail("Not yet implemented"); - } - - public void testGet_bp_moment_scale() { - fail("Not yet implemented"); - } - - public void testGet_rp_dw_max() { - fail("Not yet implemented"); - } - - public void testGet_rp_dw_min() { - fail("Not yet implemented"); - } - - public void testGet_rp_dw_minus() { - fail("Not yet implemented"); - } - - public void testGet_rp_dw_plus() { - fail("Not yet implemented"); - } - - public void testGet_rp_dw0() { - fail("Not yet implemented"); - } - - public void testGet_train_method() { - fail("Not yet implemented"); - } - - public void testSet_bp_dw_scale() { - fail("Not yet implemented"); - } - - public void testSet_bp_moment_scale() { - fail("Not yet implemented"); - } - - public void testSet_rp_dw_max() { - fail("Not yet implemented"); - } - - public void testSet_rp_dw_min() { - fail("Not yet implemented"); - } - - public void testSet_rp_dw_minus() { - fail("Not yet implemented"); - } - - public void testSet_rp_dw_plus() { - fail("Not yet implemented"); - } - - public void testSet_rp_dw0() { - fail("Not yet implemented"); - } - - public void testSet_train_method() { - fail("Not yet implemented"); - } - -} diff --git a/modules/java/android_test/src/org/opencv/test/ml/CvBoostParamsTest.java b/modules/java/android_test/src/org/opencv/test/ml/CvBoostParamsTest.java deleted file mode 100644 index 22c878def4..0000000000 --- a/modules/java/android_test/src/org/opencv/test/ml/CvBoostParamsTest.java +++ /dev/null @@ -1,44 +0,0 @@ -package org.opencv.test.ml; - -import org.opencv.ml.CvBoostParams; -import org.opencv.test.OpenCVTestCase; - -public class CvBoostParamsTest extends OpenCVTestCase { - - public void testCvBoostParams() { - new CvBoostParams(); - } - - public void testGet_boost_type() { - fail("Not yet implemented"); - } - - public void testGet_split_criteria() { - fail("Not yet implemented"); - } - - public void testGet_weak_count() { - fail("Not yet implemented"); - } - - public void testGet_weight_trim_rate() { - fail("Not yet implemented"); - } - - public void testSet_boost_type() { - fail("Not yet implemented"); - } - - public void testSet_split_criteria() { - fail("Not yet implemented"); - } - - public void testSet_weak_count() { - fail("Not yet implemented"); - } - - public void testSet_weight_trim_rate() { - fail("Not yet implemented"); - } - -} diff --git a/modules/java/android_test/src/org/opencv/test/ml/CvBoostTest.java b/modules/java/android_test/src/org/opencv/test/ml/CvBoostTest.java deleted file mode 100644 index f97ebceea7..0000000000 --- a/modules/java/android_test/src/org/opencv/test/ml/CvBoostTest.java +++ /dev/null @@ -1,92 +0,0 @@ -package org.opencv.test.ml; - -import org.opencv.ml.CvBoost; -import org.opencv.test.OpenCVTestCase; - -public class CvBoostTest extends OpenCVTestCase { - - public void testClear() { - fail("Not yet implemented"); - } - - public void testCvBoost() { - new CvBoost(); - } - - public void testCvBoostMatIntMat() { - fail("Not yet implemented"); - } - - public void testCvBoostMatIntMatMat() { - fail("Not yet implemented"); - } - - public void testCvBoostMatIntMatMatMat() { - fail("Not yet implemented"); - } - - public void testCvBoostMatIntMatMatMatMat() { - fail("Not yet implemented"); - } - - public void testCvBoostMatIntMatMatMatMatMat() { - fail("Not yet implemented"); - } - - public void testCvBoostMatIntMatMatMatMatMatCvBoostParams() { - fail("Not yet implemented"); - } - - public void testPredictMat() { - fail("Not yet implemented"); - } - - public void testPredictMatMat() { - fail("Not yet implemented"); - } - - public void testPredictMatMatRange() { - fail("Not yet implemented"); - } - - public void testPredictMatMatRangeBoolean() { - fail("Not yet implemented"); - } - - public void testPredictMatMatRangeBooleanBoolean() { - fail("Not yet implemented"); - } - - public void testPrune() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMat() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMatMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMatMatMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMatMatMatMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMatMatMatMatMatCvBoostParams() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMatMatMatMatMatCvBoostParamsBoolean() { - fail("Not yet implemented"); - } - -} diff --git a/modules/java/android_test/src/org/opencv/test/ml/CvDTreeParamsTest.java b/modules/java/android_test/src/org/opencv/test/ml/CvDTreeParamsTest.java deleted file mode 100644 index 8d848ce39c..0000000000 --- a/modules/java/android_test/src/org/opencv/test/ml/CvDTreeParamsTest.java +++ /dev/null @@ -1,76 +0,0 @@ -package org.opencv.test.ml; - -import org.opencv.ml.CvDTreeParams; -import org.opencv.test.OpenCVTestCase; - -public class CvDTreeParamsTest extends OpenCVTestCase { - - public void testCvDTreeParams() { - new CvDTreeParams(); - } - - public void testGet_cv_folds() { - fail("Not yet implemented"); - } - - public void testGet_max_categories() { - fail("Not yet implemented"); - } - - public void testGet_max_depth() { - fail("Not yet implemented"); - } - - public void testGet_min_sample_count() { - fail("Not yet implemented"); - } - - public void testGet_regression_accuracy() { - fail("Not yet implemented"); - } - - public void testGet_truncate_pruned_tree() { - fail("Not yet implemented"); - } - - public void testGet_use_1se_rule() { - fail("Not yet implemented"); - } - - public void testGet_use_surrogates() { - fail("Not yet implemented"); - } - - public void testSet_cv_folds() { - fail("Not yet implemented"); - } - - public void testSet_max_categories() { - fail("Not yet implemented"); - } - - public void testSet_max_depth() { - fail("Not yet implemented"); - } - - public void testSet_min_sample_count() { - fail("Not yet implemented"); - } - - public void testSet_regression_accuracy() { - fail("Not yet implemented"); - } - - public void testSet_truncate_pruned_tree() { - fail("Not yet implemented"); - } - - public void testSet_use_1se_rule() { - fail("Not yet implemented"); - } - - public void testSet_use_surrogates() { - fail("Not yet implemented"); - } - -} diff --git a/modules/java/android_test/src/org/opencv/test/ml/CvDTreeTest.java b/modules/java/android_test/src/org/opencv/test/ml/CvDTreeTest.java deleted file mode 100644 index 695dad826d..0000000000 --- a/modules/java/android_test/src/org/opencv/test/ml/CvDTreeTest.java +++ /dev/null @@ -1,44 +0,0 @@ -package org.opencv.test.ml; - -import org.opencv.ml.CvDTree; -import org.opencv.test.OpenCVTestCase; - -public class CvDTreeTest extends OpenCVTestCase { - - public void testClear() { - fail("Not yet implemented"); - } - - public void testCvDTree() { - new CvDTree(); - } - - public void testGetVarImportance() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMat() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMatMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMatMatMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMatMatMatMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMatMatMatMatMatCvDTreeParams() { - fail("Not yet implemented"); - } - -} diff --git a/modules/java/android_test/src/org/opencv/test/ml/CvERTreesTest.java b/modules/java/android_test/src/org/opencv/test/ml/CvERTreesTest.java deleted file mode 100644 index a4f3391aa8..0000000000 --- a/modules/java/android_test/src/org/opencv/test/ml/CvERTreesTest.java +++ /dev/null @@ -1,36 +0,0 @@ -package org.opencv.test.ml; - -import org.opencv.ml.CvERTrees; -import org.opencv.test.OpenCVTestCase; - -public class CvERTreesTest extends OpenCVTestCase { - - public void testCvERTrees() { - new CvERTrees(); - } - - public void testTrainMatIntMat() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMatMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMatMatMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMatMatMatMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMatMatMatMatMatCvRTParams() { - fail("Not yet implemented"); - } - -} diff --git a/modules/java/android_test/src/org/opencv/test/ml/CvGBTreesParamsTest.java b/modules/java/android_test/src/org/opencv/test/ml/CvGBTreesParamsTest.java deleted file mode 100644 index 733096db97..0000000000 --- a/modules/java/android_test/src/org/opencv/test/ml/CvGBTreesParamsTest.java +++ /dev/null @@ -1,44 +0,0 @@ -package org.opencv.test.ml; - -import org.opencv.ml.CvGBTreesParams; -import org.opencv.test.OpenCVTestCase; - -public class CvGBTreesParamsTest extends OpenCVTestCase { - - public void testCvGBTreesParams() { - new CvGBTreesParams(); - } - - public void testGet_loss_function_type() { - fail("Not yet implemented"); - } - - public void testGet_shrinkage() { - fail("Not yet implemented"); - } - - public void testGet_subsample_portion() { - fail("Not yet implemented"); - } - - public void testGet_weak_count() { - fail("Not yet implemented"); - } - - public void testSet_loss_function_type() { - fail("Not yet implemented"); - } - - public void testSet_shrinkage() { - fail("Not yet implemented"); - } - - public void testSet_subsample_portion() { - fail("Not yet implemented"); - } - - public void testSet_weak_count() { - fail("Not yet implemented"); - } - -} diff --git a/modules/java/android_test/src/org/opencv/test/ml/CvGBTreesTest.java b/modules/java/android_test/src/org/opencv/test/ml/CvGBTreesTest.java deleted file mode 100644 index a35fa610a5..0000000000 --- a/modules/java/android_test/src/org/opencv/test/ml/CvGBTreesTest.java +++ /dev/null @@ -1,84 +0,0 @@ -package org.opencv.test.ml; - -import org.opencv.ml.CvGBTrees; -import org.opencv.test.OpenCVTestCase; - -public class CvGBTreesTest extends OpenCVTestCase { - - public void testClear() { - fail("Not yet implemented"); - } - - public void testCvGBTrees() { - new CvGBTrees(); - } - - public void testCvGBTreesMatIntMat() { - fail("Not yet implemented"); - } - - public void testCvGBTreesMatIntMatMat() { - fail("Not yet implemented"); - } - - public void testCvGBTreesMatIntMatMatMat() { - fail("Not yet implemented"); - } - - public void testCvGBTreesMatIntMatMatMatMat() { - fail("Not yet implemented"); - } - - public void testCvGBTreesMatIntMatMatMatMatMat() { - fail("Not yet implemented"); - } - - public void testCvGBTreesMatIntMatMatMatMatMatCvGBTreesParams() { - fail("Not yet implemented"); - } - - public void testPredictMat() { - fail("Not yet implemented"); - } - - public void testPredictMatMat() { - fail("Not yet implemented"); - } - - public void testPredictMatMatRange() { - fail("Not yet implemented"); - } - - public void testPredictMatMatRangeInt() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMat() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMatMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMatMatMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMatMatMatMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMatMatMatMatMatCvGBTreesParams() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMatMatMatMatMatCvGBTreesParamsBoolean() { - fail("Not yet implemented"); - } - -} diff --git a/modules/java/android_test/src/org/opencv/test/ml/CvKNearestTest.java b/modules/java/android_test/src/org/opencv/test/ml/CvKNearestTest.java deleted file mode 100644 index 1bcab5183d..0000000000 --- a/modules/java/android_test/src/org/opencv/test/ml/CvKNearestTest.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.opencv.test.ml; - -import org.opencv.ml.CvKNearest; -import org.opencv.test.OpenCVTestCase; - -public class CvKNearestTest extends OpenCVTestCase { - - public void testCvKNearest() { - new CvKNearest(); - } - - public void testCvKNearestMatMat() { - fail("Not yet implemented"); - } - - public void testCvKNearestMatMatMat() { - fail("Not yet implemented"); - } - - public void testCvKNearestMatMatMatBoolean() { - fail("Not yet implemented"); - } - - public void testCvKNearestMatMatMatBooleanInt() { - fail("Not yet implemented"); - } - - public void testFind_nearest() { - fail("Not yet implemented"); - } - - public void testTrainMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatMatMatBoolean() { - fail("Not yet implemented"); - } - - public void testTrainMatMatMatBooleanInt() { - fail("Not yet implemented"); - } - - public void testTrainMatMatMatBooleanIntBoolean() { - fail("Not yet implemented"); - } - -} diff --git a/modules/java/android_test/src/org/opencv/test/ml/CvNormalBayesClassifierTest.java b/modules/java/android_test/src/org/opencv/test/ml/CvNormalBayesClassifierTest.java deleted file mode 100644 index f071c121ab..0000000000 --- a/modules/java/android_test/src/org/opencv/test/ml/CvNormalBayesClassifierTest.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.opencv.test.ml; - -import org.opencv.ml.CvNormalBayesClassifier; -import org.opencv.test.OpenCVTestCase; - -public class CvNormalBayesClassifierTest extends OpenCVTestCase { - - public void testClear() { - fail("Not yet implemented"); - } - - public void testCvNormalBayesClassifier() { - new CvNormalBayesClassifier(); - } - - public void testCvNormalBayesClassifierMatMat() { - fail("Not yet implemented"); - } - - public void testCvNormalBayesClassifierMatMatMat() { - fail("Not yet implemented"); - } - - public void testCvNormalBayesClassifierMatMatMatMat() { - fail("Not yet implemented"); - } - - public void testPredictMat() { - fail("Not yet implemented"); - } - - public void testPredictMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatMatMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatMatMatMatBoolean() { - fail("Not yet implemented"); - } - -} diff --git a/modules/java/android_test/src/org/opencv/test/ml/CvParamGridTest.java b/modules/java/android_test/src/org/opencv/test/ml/CvParamGridTest.java deleted file mode 100644 index 0e1a11079f..0000000000 --- a/modules/java/android_test/src/org/opencv/test/ml/CvParamGridTest.java +++ /dev/null @@ -1,36 +0,0 @@ -package org.opencv.test.ml; - -import org.opencv.ml.CvParamGrid; -import org.opencv.test.OpenCVTestCase; - -public class CvParamGridTest extends OpenCVTestCase { - - public void testCvParamGrid() { - new CvParamGrid(); - } - - public void testGet_max_val() { - fail("Not yet implemented"); - } - - public void testGet_min_val() { - fail("Not yet implemented"); - } - - public void testGet_step() { - fail("Not yet implemented"); - } - - public void testSet_max_val() { - fail("Not yet implemented"); - } - - public void testSet_min_val() { - fail("Not yet implemented"); - } - - public void testSet_step() { - fail("Not yet implemented"); - } - -} diff --git a/modules/java/android_test/src/org/opencv/test/ml/CvRTParamsTest.java b/modules/java/android_test/src/org/opencv/test/ml/CvRTParamsTest.java deleted file mode 100644 index c098635da9..0000000000 --- a/modules/java/android_test/src/org/opencv/test/ml/CvRTParamsTest.java +++ /dev/null @@ -1,28 +0,0 @@ -package org.opencv.test.ml; - -import org.opencv.ml.CvRTParams; -import org.opencv.test.OpenCVTestCase; - -public class CvRTParamsTest extends OpenCVTestCase { - - public void testCvRTParams() { - new CvRTParams(); - } - - public void testGet_calc_var_importance() { - fail("Not yet implemented"); - } - - public void testGet_nactive_vars() { - fail("Not yet implemented"); - } - - public void testSet_calc_var_importance() { - fail("Not yet implemented"); - } - - public void testSet_nactive_vars() { - fail("Not yet implemented"); - } - -} diff --git a/modules/java/android_test/src/org/opencv/test/ml/CvRTreesTest.java b/modules/java/android_test/src/org/opencv/test/ml/CvRTreesTest.java deleted file mode 100644 index 25e1011156..0000000000 --- a/modules/java/android_test/src/org/opencv/test/ml/CvRTreesTest.java +++ /dev/null @@ -1,60 +0,0 @@ -package org.opencv.test.ml; - -import org.opencv.ml.CvRTrees; -import org.opencv.test.OpenCVTestCase; - -public class CvRTreesTest extends OpenCVTestCase { - - public void testClear() { - fail("Not yet implemented"); - } - - public void testCvRTrees() { - new CvRTrees(); - } - - public void testGetVarImportance() { - fail("Not yet implemented"); - } - - public void testPredict_probMat() { - fail("Not yet implemented"); - } - - public void testPredict_probMatMat() { - fail("Not yet implemented"); - } - - public void testPredictMat() { - fail("Not yet implemented"); - } - - public void testPredictMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMat() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMatMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMatMatMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMatMatMatMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatIntMatMatMatMatMatCvRTParams() { - fail("Not yet implemented"); - } - -} diff --git a/modules/java/android_test/src/org/opencv/test/ml/CvSVMParamsTest.java b/modules/java/android_test/src/org/opencv/test/ml/CvSVMParamsTest.java deleted file mode 100644 index 49cb370aaf..0000000000 --- a/modules/java/android_test/src/org/opencv/test/ml/CvSVMParamsTest.java +++ /dev/null @@ -1,76 +0,0 @@ -package org.opencv.test.ml; - -import org.opencv.ml.CvSVMParams; -import org.opencv.test.OpenCVTestCase; - -public class CvSVMParamsTest extends OpenCVTestCase { - - public void testCvSVMParams() { - new CvSVMParams(); - } - - public void testGet_C() { - fail("Not yet implemented"); - } - - public void testGet_coef0() { - fail("Not yet implemented"); - } - - public void testGet_degree() { - fail("Not yet implemented"); - } - - public void testGet_gamma() { - fail("Not yet implemented"); - } - - public void testGet_kernel_type() { - fail("Not yet implemented"); - } - - public void testGet_nu() { - fail("Not yet implemented"); - } - - public void testGet_p() { - fail("Not yet implemented"); - } - - public void testGet_svm_type() { - fail("Not yet implemented"); - } - - public void testSet_C() { - fail("Not yet implemented"); - } - - public void testSet_coef0() { - fail("Not yet implemented"); - } - - public void testSet_degree() { - fail("Not yet implemented"); - } - - public void testSet_gamma() { - fail("Not yet implemented"); - } - - public void testSet_kernel_type() { - fail("Not yet implemented"); - } - - public void testSet_nu() { - fail("Not yet implemented"); - } - - public void testSet_p() { - fail("Not yet implemented"); - } - - public void testSet_svm_type() { - fail("Not yet implemented"); - } - -} diff --git a/modules/java/android_test/src/org/opencv/test/ml/CvSVMTest.java b/modules/java/android_test/src/org/opencv/test/ml/CvSVMTest.java deleted file mode 100644 index 41ffed1e40..0000000000 --- a/modules/java/android_test/src/org/opencv/test/ml/CvSVMTest.java +++ /dev/null @@ -1,100 +0,0 @@ -package org.opencv.test.ml; - -import org.opencv.ml.CvSVM; -import org.opencv.test.OpenCVTestCase; - -public class CvSVMTest extends OpenCVTestCase { - - public void testClear() { - fail("Not yet implemented"); - } - - public void testCvSVM() { - new CvSVM(); - } - - public void testCvSVMMatMat() { - fail("Not yet implemented"); - } - - public void testCvSVMMatMatMat() { - fail("Not yet implemented"); - } - - public void testCvSVMMatMatMatMat() { - fail("Not yet implemented"); - } - - public void testCvSVMMatMatMatMatCvSVMParams() { - fail("Not yet implemented"); - } - - public void testGet_support_vector_count() { - fail("Not yet implemented"); - } - - public void testGet_var_count() { - fail("Not yet implemented"); - } - - public void testPredictMat() { - fail("Not yet implemented"); - } - - public void testPredictMatBoolean() { - fail("Not yet implemented"); - } - - public void testTrain_autoMatMatMatMatCvSVMParams() { - fail("Not yet implemented"); - } - - public void testTrain_autoMatMatMatMatCvSVMParamsInt() { - fail("Not yet implemented"); - } - - public void testTrain_autoMatMatMatMatCvSVMParamsIntCvParamGrid() { - fail("Not yet implemented"); - } - - public void testTrain_autoMatMatMatMatCvSVMParamsIntCvParamGridCvParamGrid() { - fail("Not yet implemented"); - } - - public void testTrain_autoMatMatMatMatCvSVMParamsIntCvParamGridCvParamGridCvParamGrid() { - fail("Not yet implemented"); - } - - public void testTrain_autoMatMatMatMatCvSVMParamsIntCvParamGridCvParamGridCvParamGridCvParamGrid() { - fail("Not yet implemented"); - } - - public void testTrain_autoMatMatMatMatCvSVMParamsIntCvParamGridCvParamGridCvParamGridCvParamGridCvParamGrid() { - fail("Not yet implemented"); - } - - public void testTrain_autoMatMatMatMatCvSVMParamsIntCvParamGridCvParamGridCvParamGridCvParamGridCvParamGridCvParamGrid() { - fail("Not yet implemented"); - } - - public void testTrain_autoMatMatMatMatCvSVMParamsIntCvParamGridCvParamGridCvParamGridCvParamGridCvParamGridCvParamGridBoolean() { - fail("Not yet implemented"); - } - - public void testTrainMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatMatMatMat() { - fail("Not yet implemented"); - } - - public void testTrainMatMatMatMatCvSVMParams() { - fail("Not yet implemented"); - } - -} diff --git a/modules/java/android_test/res/drawable/chessboard.jpg b/modules/java/common_test/res/drawable/chessboard.jpg similarity index 100% rename from modules/java/android_test/res/drawable/chessboard.jpg rename to modules/java/common_test/res/drawable/chessboard.jpg diff --git a/modules/java/android_test/res/drawable/icon.png b/modules/java/common_test/res/drawable/icon.png similarity index 100% rename from modules/java/android_test/res/drawable/icon.png rename to modules/java/common_test/res/drawable/icon.png diff --git a/modules/java/android_test/res/drawable/lena.png b/modules/java/common_test/res/drawable/lena.png similarity index 100% rename from modules/java/android_test/res/drawable/lena.png rename to modules/java/common_test/res/drawable/lena.png diff --git a/modules/java/android_test/res/layout/main.xml b/modules/java/common_test/res/layout/main.xml similarity index 100% rename from modules/java/android_test/res/layout/main.xml rename to modules/java/common_test/res/layout/main.xml diff --git a/modules/java/android_test/res/raw/lbpcascade_frontalface.xml b/modules/java/common_test/res/raw/lbpcascade_frontalface.xml similarity index 100% rename from modules/java/android_test/res/raw/lbpcascade_frontalface.xml rename to modules/java/common_test/res/raw/lbpcascade_frontalface.xml diff --git a/modules/java/android_test/res/values/strings.xml b/modules/java/common_test/res/values/strings.xml similarity index 100% rename from modules/java/android_test/res/values/strings.xml rename to modules/java/common_test/res/values/strings.xml diff --git a/modules/java/android_test/src/org/opencv/test/utils/ConvertersTest.java b/modules/java/common_test/src/org/opencv/test/utils/ConvertersTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/utils/ConvertersTest.java rename to modules/java/common_test/src/org/opencv/test/utils/ConvertersTest.java diff --git a/modules/java/generator/config/bioinspired.filelist b/modules/java/generator/config/bioinspired.filelist deleted file mode 100644 index 33b3c9e977..0000000000 --- a/modules/java/generator/config/bioinspired.filelist +++ /dev/null @@ -1,3 +0,0 @@ -include/opencv2/bioinspired/retina.hpp -include/opencv2/bioinspired/retinafasttonemapping.hpp -include/opencv2/bioinspired/transientareassegmentationmodule.hpp diff --git a/modules/java/generator/config/features2d.filelist b/modules/java/generator/config/features2d.filelist deleted file mode 100644 index b1c84efc7d..0000000000 --- a/modules/java/generator/config/features2d.filelist +++ /dev/null @@ -1 +0,0 @@ -../java/generator/src/cpp/features2d_manual.hpp diff --git a/modules/java/generator/config/ml.filelist b/modules/java/generator/config/ml.filelist deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/modules/java/generator/config/nonfree.filelist b/modules/java/generator/config/nonfree.filelist deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/modules/java/generator/gen_java.py b/modules/java/generator/gen_java.py index bd29e2bf7f..ccdb03fdad 100755 --- a/modules/java/generator/gen_java.py +++ b/modules/java/generator/gen_java.py @@ -714,6 +714,8 @@ T_CPP_MODULE = """ #include "opencv2/$m.hpp" +$includes + using namespace cv; /// throw java exception @@ -1081,11 +1083,14 @@ class JavaWrapperGenerator(object): self.add_class( ['class ' + self.Module, '', [], []] ) # [ 'class/struct cname', ':bases', [modlist] [props] ] # scan the headers and build more descriptive maps of classes, consts, functions + includes = []; for hdr in srcfiles: decls = parser.parse(hdr) self.namespaces = parser.namespaces logging.info("\n\n===== Header: %s =====", hdr) logging.info("Namespaces: %s", parser.namespaces) + if decls: + includes.append('#include "' + hdr + '"') for decl in decls: logging.info("\n--- Incoming ---\n%s", pformat(decl, 4)) name = decl[0] @@ -1107,7 +1112,7 @@ class JavaWrapperGenerator(object): self.save("%s/%s+%s.java" % (output_path, module, ci.jname), classJavaCode) moduleCppCode.write(ci.generateCppCode()) ci.cleanupCodeStreams() - self.save(output_path+"/"+module+".cpp", Template(T_CPP_MODULE).substitute(m = module, M = module.upper(), code = moduleCppCode.getvalue())) + self.save(output_path+"/"+module+".cpp", Template(T_CPP_MODULE).substitute(m = module, M = module.upper(), code = moduleCppCode.getvalue(), includes = "\n".join(includes))) self.save(output_path+"/"+module+".txt", self.makeReport()) def makeReport(self): diff --git a/modules/java/generator/src/cpp/common.h b/modules/java/generator/src/cpp/common.h index 0c0b025f57..4142b8c4d0 100644 --- a/modules/java/generator/src/cpp/common.h +++ b/modules/java/generator/src/cpp/common.h @@ -24,10 +24,6 @@ #include "converters.h" -#include "core_manual.hpp" -#include "features2d_manual.hpp" - - #ifdef _MSC_VER # pragma warning(disable:4800 4244) #endif diff --git a/modules/java/generator/src/cpp/converters.cpp b/modules/java/generator/src/cpp/converters.cpp index f03ddcee19..3c771ce734 100644 --- a/modules/java/generator/src/cpp/converters.cpp +++ b/modules/java/generator/src/cpp/converters.cpp @@ -173,35 +173,6 @@ void vector_Point3d_to_Mat(std::vector& v_point, Mat& mat) mat = Mat(v_point, true); } -#ifdef HAVE_OPENCV_FEATURES2D -//vector_KeyPoint -void Mat_to_vector_KeyPoint(Mat& mat, std::vector& v_kp) -{ - v_kp.clear(); - CHECK_MAT(mat.type()==CV_32FC(7) && mat.cols==1); - for(int i=0; i v = mat.at< Vec >(i, 0); - KeyPoint kp(v[0], v[1], v[2], v[3], v[4], (int)v[5], (int)v[6]); - v_kp.push_back(kp); - } - return; -} - - -void vector_KeyPoint_to_Mat(std::vector& v_kp, Mat& mat) -{ - int count = (int)v_kp.size(); - mat.create(count, 1, CV_32FC(7)); - for(int i=0; i >(i, 0) = Vec(kp.pt.x, kp.pt.y, kp.size, kp.angle, kp.response, (float)kp.octave, (float)kp.class_id); - } -} -#endif - - //vector_Mat void Mat_to_vector_Mat(cv::Mat& mat, std::vector& v_mat) { @@ -233,34 +204,6 @@ void vector_Mat_to_Mat(std::vector& v_mat, cv::Mat& mat) } } -#ifdef HAVE_OPENCV_FEATURES2D -//vector_DMatch -void Mat_to_vector_DMatch(Mat& mat, std::vector& v_dm) -{ - v_dm.clear(); - CHECK_MAT(mat.type()==CV_32FC4 && mat.cols==1); - for(int i=0; i v = mat.at< Vec >(i, 0); - DMatch dm((int)v[0], (int)v[1], (int)v[2], v[3]); - v_dm.push_back(dm); - } - return; -} - - -void vector_DMatch_to_Mat(std::vector& v_dm, Mat& mat) -{ - int count = (int)v_dm.size(); - mat.create(count, 1, CV_32FC4); - for(int i=0; i >(i, 0) = Vec((float)dm.queryIdx, (float)dm.trainIdx, (float)dm.imgIdx, dm.distance); - } -} -#endif - void Mat_to_vector_vector_Point(Mat& mat, std::vector< std::vector< Point > >& vv_pt) { std::vector vm; @@ -300,60 +243,6 @@ void Mat_to_vector_vector_Point3f(Mat& mat, std::vector< std::vector< Point3f > } } -#ifdef HAVE_OPENCV_FEATURES2D -void Mat_to_vector_vector_KeyPoint(Mat& mat, std::vector< std::vector< KeyPoint > >& vv_kp) -{ - std::vector vm; - vm.reserve( mat.rows ); - Mat_to_vector_Mat(mat, vm); - for(size_t i=0; i vkp; - Mat_to_vector_KeyPoint(vm[i], vkp); - vv_kp.push_back(vkp); - } -} - -void vector_vector_KeyPoint_to_Mat(std::vector< std::vector< KeyPoint > >& vv_kp, Mat& mat) -{ - std::vector vm; - vm.reserve( vv_kp.size() ); - for(size_t i=0; i >& vv_dm) -{ - std::vector vm; - vm.reserve( mat.rows ); - Mat_to_vector_Mat(mat, vm); - for(size_t i=0; i vdm; - Mat_to_vector_DMatch(vm[i], vdm); - vv_dm.push_back(vdm); - } -} - -void vector_vector_DMatch_to_Mat(std::vector< std::vector< DMatch > >& vv_dm, Mat& mat) -{ - std::vector vm; - vm.reserve( vv_dm.size() ); - for(size_t i=0; i >& vv_ch) { std::vector vm; diff --git a/modules/java/generator/src/cpp/converters.h b/modules/java/generator/src/cpp/converters.h index 27651bc80d..257f9449e3 100644 --- a/modules/java/generator/src/cpp/converters.h +++ b/modules/java/generator/src/cpp/converters.h @@ -1,6 +1,5 @@ #include "opencv2/opencv_modules.hpp" #include "opencv2/core.hpp" -#include "features2d_manual.hpp" void Mat_to_vector_int(cv::Mat& mat, std::vector& v_int); void vector_int_to_Mat(std::vector& v_int, cv::Mat& mat); @@ -39,25 +38,9 @@ void vector_Vec4i_to_Mat(std::vector& v_vec, cv::Mat& mat); void vector_Vec4f_to_Mat(std::vector& v_vec, cv::Mat& mat); void vector_Vec6f_to_Mat(std::vector& v_vec, cv::Mat& mat); -#ifdef HAVE_OPENCV_FEATURES2D -void Mat_to_vector_KeyPoint(cv::Mat& mat, std::vector& v_kp); -void vector_KeyPoint_to_Mat(std::vector& v_kp, cv::Mat& mat); -#endif - void Mat_to_vector_Mat(cv::Mat& mat, std::vector& v_mat); void vector_Mat_to_Mat(std::vector& v_mat, cv::Mat& mat); -#ifdef HAVE_OPENCV_FEATURES2D -void Mat_to_vector_DMatch(cv::Mat& mat, std::vector& v_dm); -void vector_DMatch_to_Mat(std::vector& v_dm, cv::Mat& mat); - -void Mat_to_vector_vector_KeyPoint(cv::Mat& mat, std::vector< std::vector< cv::KeyPoint > >& vv_kp); -void vector_vector_KeyPoint_to_Mat(std::vector< std::vector< cv::KeyPoint > >& vv_kp, cv::Mat& mat); - -void Mat_to_vector_vector_DMatch(cv::Mat& mat, std::vector< std::vector< cv::DMatch > >& vv_dm); -void vector_vector_DMatch_to_Mat(std::vector< std::vector< cv::DMatch > >& vv_dm, cv::Mat& mat); -#endif - void Mat_to_vector_vector_char(cv::Mat& mat, std::vector< std::vector< char > >& vv_ch); void vector_vector_char_to_Mat(std::vector< std::vector< char > >& vv_ch, cv::Mat& mat); diff --git a/modules/java/test/CMakeLists.txt b/modules/java/pure_test/CMakeLists.txt similarity index 52% rename from modules/java/test/CMakeLists.txt rename to modules/java/pure_test/CMakeLists.txt index 4f1b422eb0..6c9766c7d5 100644 --- a/modules/java/test/CMakeLists.txt +++ b/modules/java/pure_test/CMakeLists.txt @@ -1,59 +1,34 @@ -# list of modules covered with tests -set(tested_modules opencv_calib3d opencv_core opencv_features2d opencv_highgui opencv_imgproc opencv_objdetect opencv_photo opencv_video) - -# opencv_ml is broken -#list(APPEND tested_modules opencv_ml) - -ocv_check_dependencies(opencv_java ${tested_modules}) - -if(NOT OCV_DEPENDENCIES_FOUND) +if(NOT ANT_EXECUTABLE) return() endif() project(opencv_test_java) set(opencv_test_java_bin_dir "${CMAKE_CURRENT_BINARY_DIR}/.build") -set(android_source_dir "${CMAKE_CURRENT_SOURCE_DIR}/../android_test") -set(java_source_dir ${CMAKE_CURRENT_SOURCE_DIR}) +set(test_dir ${CMAKE_CURRENT_SOURCE_DIR}) +set(test_common_dir "${CMAKE_CURRENT_SOURCE_DIR}/../common_test") + +set(opencv_test_java_file_deps "") # make sure the build directory exists file(MAKE_DIRECTORY "${opencv_test_java_bin_dir}") -# get project sources -file(GLOB_RECURSE opencv_test_java_files RELATIVE "${android_source_dir}" "${android_source_dir}/res/*" "${android_source_dir}/src/*.java") -# These are the files that need to be updated for pure Java. -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/") +# 1. gather and copy common test files (resources, utils, etc.) +copy_common_tests(test_common_dir opencv_test_java_bin_dir opencv_test_java_file_deps) -# These are files updated for pure Java. -file(GLOB_RECURSE modified_files RELATIVE "${java_source_dir}" "${java_source_dir}/src/*") +# 2. gather and copy tests from each module +copy_modules_tests(OPENCV_JAVA_MODULES opencv_test_java_bin_dir opencv_test_java_file_deps) -# These are extra jars needed to run the tests. -file(GLOB_RECURSE lib_files RELATIVE "${java_source_dir}" "${java_source_dir}/lib/*.jar") - -# copy sources out from the build tree -set(opencv_test_java_file_deps "") -foreach(f ${opencv_test_java_files}) +# 3. gather and copy specific files for pure java +file(GLOB_RECURSE test_files RELATIVE "${test_dir}" "${test_dir}/src/*") +file(GLOB_RECURSE test_lib_files RELATIVE "${test_dir}" "${test_dir}/lib/*.jar") +foreach(f ${test_files} ${test_lib_files}) add_custom_command(OUTPUT "${opencv_test_java_bin_dir}/${f}" - COMMAND ${CMAKE_COMMAND} -E copy "${android_source_dir}/${f}" "${opencv_test_java_bin_dir}/${f}" - DEPENDS "${android_source_dir}/${f}" + COMMAND ${CMAKE_COMMAND} -E copy "${test_dir}/${f}" "${opencv_test_java_bin_dir}/${f}" + DEPENDS "${test_dir}/${f}" COMMENT "Copying ${f}" ) - list(APPEND opencv_test_java_file_deps "${android_source_dir}/${f}" "${opencv_test_java_bin_dir}/${f}") -endforeach() - -# Overwrite select Android sources with Java-specific sources. -# Also, copy over the libs we'll need for testing. -foreach(f ${modified_files} ${lib_files}) - add_custom_command(OUTPUT "${opencv_test_java_bin_dir}/${f}" - COMMAND ${CMAKE_COMMAND} -E copy "${java_source_dir}/${f}" "${opencv_test_java_bin_dir}/${f}" - DEPENDS "${java_source_dir}/${f}" - COMMENT "Copying ${f}" - ) - list(APPEND opencv_test_java_file_deps "${java_source_dir}/${f}" "${opencv_test_java_bin_dir}/${f}") + list(APPEND opencv_test_java_file_deps "${test_dir}/${f}" "${opencv_test_java_bin_dir}/${f}") endforeach() # Copy the OpenCV jar after it has been generated. diff --git a/modules/java/test/build.xml b/modules/java/pure_test/build.xml similarity index 100% rename from modules/java/test/build.xml rename to modules/java/pure_test/build.xml diff --git a/modules/java/test/lib/junit-4.11.jar b/modules/java/pure_test/lib/junit-4.11.jar similarity index 100% rename from modules/java/test/lib/junit-4.11.jar rename to modules/java/pure_test/lib/junit-4.11.jar diff --git a/modules/java/test/src/org/opencv/test/OpenCVTestCase.java b/modules/java/pure_test/src/org/opencv/test/OpenCVTestCase.java similarity index 100% rename from modules/java/test/src/org/opencv/test/OpenCVTestCase.java rename to modules/java/pure_test/src/org/opencv/test/OpenCVTestCase.java diff --git a/modules/java/test/src/org/opencv/test/OpenCVTestRunner.java b/modules/java/pure_test/src/org/opencv/test/OpenCVTestRunner.java similarity index 100% rename from modules/java/test/src/org/opencv/test/OpenCVTestRunner.java rename to modules/java/pure_test/src/org/opencv/test/OpenCVTestRunner.java diff --git a/modules/objdetect/CMakeLists.txt b/modules/objdetect/CMakeLists.txt index 5739ee9e38..1f3844a263 100644 --- a/modules/objdetect/CMakeLists.txt +++ b/modules/objdetect/CMakeLists.txt @@ -1,2 +1,2 @@ set(the_description "Object Detection") -ocv_define_module(objdetect opencv_core opencv_imgproc opencv_ml OPTIONAL opencv_highgui) +ocv_define_module(objdetect opencv_core opencv_imgproc opencv_ml OPTIONAL opencv_highgui WRAP java) diff --git a/modules/java/android_test/src/org/opencv/test/objdetect/CascadeClassifierTest.java b/modules/objdetect/misc/java/test/CascadeClassifierTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/objdetect/CascadeClassifierTest.java rename to modules/objdetect/misc/java/test/CascadeClassifierTest.java diff --git a/modules/java/android_test/src/org/opencv/test/objdetect/HOGDescriptorTest.java b/modules/objdetect/misc/java/test/HOGDescriptorTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/objdetect/HOGDescriptorTest.java rename to modules/objdetect/misc/java/test/HOGDescriptorTest.java diff --git a/modules/java/android_test/src/org/opencv/test/objdetect/ObjdetectTest.java b/modules/objdetect/misc/java/test/ObjdetectTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/objdetect/ObjdetectTest.java rename to modules/objdetect/misc/java/test/ObjdetectTest.java diff --git a/modules/photo/CMakeLists.txt b/modules/photo/CMakeLists.txt index 4694a8ed84..725f2bfdfe 100644 --- a/modules/photo/CMakeLists.txt +++ b/modules/photo/CMakeLists.txt @@ -4,4 +4,4 @@ if(HAVE_CUDA) ocv_warnings_disable(CMAKE_CXX_FLAGS -Wundef -Wmissing-declarations) endif() -ocv_define_module(photo opencv_imgproc OPTIONAL opencv_cudaarithm opencv_cudaimgproc) +ocv_define_module(photo opencv_imgproc OPTIONAL opencv_cudaarithm opencv_cudaimgproc WRAP java) diff --git a/modules/java/android_test/src/org/opencv/test/photo/PhotoTest.java b/modules/photo/misc/java/test/PhotoTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/photo/PhotoTest.java rename to modules/photo/misc/java/test/PhotoTest.java diff --git a/modules/video/CMakeLists.txt b/modules/video/CMakeLists.txt index 7423803a2a..57d86f08b3 100644 --- a/modules/video/CMakeLists.txt +++ b/modules/video/CMakeLists.txt @@ -1,2 +1,2 @@ set(the_description "Video Analysis") -ocv_define_module(video opencv_imgproc) +ocv_define_module(video opencv_imgproc WRAP java) diff --git a/modules/java/android_test/src/org/opencv/test/video/BackgroundSubtractorMOGTest.java b/modules/video/misc/java/test/BackgroundSubtractorMOGTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/video/BackgroundSubtractorMOGTest.java rename to modules/video/misc/java/test/BackgroundSubtractorMOGTest.java diff --git a/modules/java/android_test/src/org/opencv/test/video/KalmanFilterTest.java b/modules/video/misc/java/test/KalmanFilterTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/video/KalmanFilterTest.java rename to modules/video/misc/java/test/KalmanFilterTest.java diff --git a/modules/java/android_test/src/org/opencv/test/video/VideoTest.java b/modules/video/misc/java/test/VideoTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/video/VideoTest.java rename to modules/video/misc/java/test/VideoTest.java diff --git a/modules/videoio/CMakeLists.txt b/modules/videoio/CMakeLists.txt index 1635e2022f..f52e69e95d 100644 --- a/modules/videoio/CMakeLists.txt +++ b/modules/videoio/CMakeLists.txt @@ -1,5 +1,5 @@ set(the_description "Media I/O") -ocv_add_module(videoio opencv_imgproc opencv_imgcodecs OPTIONAL opencv_androidcamera) +ocv_add_module(videoio opencv_imgproc opencv_imgcodecs OPTIONAL opencv_androidcamera WRAP java) # ---------------------------------------------------------------------------- # CMake file for videoio. See root CMakeLists.txt diff --git a/modules/java/android_test/src/org/opencv/test/highgui/VideoCaptureTest.java b/modules/videoio/misc/java/test/VideoCaptureTest.java similarity index 100% rename from modules/java/android_test/src/org/opencv/test/highgui/VideoCaptureTest.java rename to modules/videoio/misc/java/test/VideoCaptureTest.java From 37c74e38f427519fe6151308def22c2a87f44947 Mon Sep 17 00:00:00 2001 From: Maksim Shabunin Date: Tue, 24 Feb 2015 18:38:12 +0300 Subject: [PATCH 2/2] Python support --- cmake/OpenCVModule.cmake | 26 ++++++++------------- modules/calib3d/CMakeLists.txt | 2 +- modules/core/CMakeLists.txt | 2 +- modules/features2d/CMakeLists.txt | 2 +- modules/flann/CMakeLists.txt | 2 +- modules/highgui/CMakeLists.txt | 2 +- modules/imgcodecs/CMakeLists.txt | 2 +- modules/imgproc/CMakeLists.txt | 2 +- modules/java/CMakeLists.txt | 4 ++-- modules/objdetect/CMakeLists.txt | 2 +- modules/photo/CMakeLists.txt | 2 +- modules/python/common.cmake | 38 +++++++++++-------------------- modules/shape/CMakeLists.txt | 2 +- modules/stitching/CMakeLists.txt | 3 ++- modules/superres/CMakeLists.txt | 3 ++- modules/video/CMakeLists.txt | 2 +- modules/videoio/CMakeLists.txt | 2 +- modules/videostab/CMakeLists.txt | 2 +- modules/viz/CMakeLists.txt | 2 +- 19 files changed, 43 insertions(+), 59 deletions(-) diff --git a/cmake/OpenCVModule.cmake b/cmake/OpenCVModule.cmake index 27990911fe..955dcc4afd 100644 --- a/cmake/OpenCVModule.cmake +++ b/cmake/OpenCVModule.cmake @@ -24,22 +24,6 @@ # OPENCV_MODULE_${the_module}_WRAPPERS - list of wrappers supporting this module # HAVE_${the_module} - for fast check of module availability -# Module layout: -# -# ├── doc - docs -# ├── include -# │   └── opencv2 -# │   └── - sub headers -# ├── misc -# │   ├── java - additional files for java wrapper -# │   └── python - additional files for python wrapper -# ├── perf - perfomance tests -# ├── samples - sample code -# ├── src - sources -# ├── test - accuracy tests -# └── tutorials - tutorials - - # To control the setup of the module you could also set: # the_description - text to be used as current module description # OPENCV_MODULE_TYPE - STATIC|SHARED - set to force override global settings for current module @@ -77,6 +61,7 @@ foreach(mod ${OPENCV_MODULES_BUILD} ${OPENCV_MODULES_DISABLED_USER} ${OPENCV_MOD unset(OPENCV_MODULE_${mod}_PRIVATE_REQ_DEPS CACHE) unset(OPENCV_MODULE_${mod}_PRIVATE_OPT_DEPS CACHE) unset(OPENCV_MODULE_${mod}_LINK_DEPS CACHE) + unset(OPENCV_MODULE_${mod}_WRAPPERS CACHE) endforeach() # clean modules info which needs to be recalculated @@ -112,6 +97,15 @@ macro(ocv_add_dependencies full_modname) endforeach() unset(__depsvar) + # hack for python + set(__python_idx) + list(FIND OPENCV_MODULE_${full_modname}_WRAPPERS "python" __python_idx) + if (NOT __python_idx EQUAL -1) + list(REMOVE_ITEM OPENCV_MODULE_${full_modname}_WRAPPERS "python") + list(APPEND OPENCV_MODULE_${full_modname}_WRAPPERS "python2" "python3") + endif() + unset(__python_idx) + ocv_list_unique(OPENCV_MODULE_${full_modname}_REQ_DEPS) ocv_list_unique(OPENCV_MODULE_${full_modname}_OPT_DEPS) ocv_list_unique(OPENCV_MODULE_${full_modname}_PRIVATE_REQ_DEPS) diff --git a/modules/calib3d/CMakeLists.txt b/modules/calib3d/CMakeLists.txt index 844365f71e..b79944da59 100644 --- a/modules/calib3d/CMakeLists.txt +++ b/modules/calib3d/CMakeLists.txt @@ -1,2 +1,2 @@ set(the_description "Camera Calibration and 3D Reconstruction") -ocv_define_module(calib3d opencv_imgproc opencv_features2d WRAP java) +ocv_define_module(calib3d opencv_imgproc opencv_features2d WRAP java python) diff --git a/modules/core/CMakeLists.txt b/modules/core/CMakeLists.txt index 22668f4892..7052ce615a 100644 --- a/modules/core/CMakeLists.txt +++ b/modules/core/CMakeLists.txt @@ -1,7 +1,7 @@ set(the_description "The Core Functionality") ocv_add_module(core PRIVATE_REQUIRED ${ZLIB_LIBRARIES} "${OPENCL_LIBRARIES}" OPTIONAL opencv_cudev - WRAP java) + WRAP java python) if(HAVE_WINRT_CX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /ZW") diff --git a/modules/features2d/CMakeLists.txt b/modules/features2d/CMakeLists.txt index 3395b99161..bf7d66e433 100644 --- a/modules/features2d/CMakeLists.txt +++ b/modules/features2d/CMakeLists.txt @@ -1,2 +1,2 @@ set(the_description "2D Features Framework") -ocv_define_module(features2d opencv_imgproc opencv_ml opencv_flann OPTIONAL opencv_highgui WRAP java) +ocv_define_module(features2d opencv_imgproc opencv_ml opencv_flann OPTIONAL opencv_highgui WRAP java python) diff --git a/modules/flann/CMakeLists.txt b/modules/flann/CMakeLists.txt index a6326c40a0..78e041129b 100644 --- a/modules/flann/CMakeLists.txt +++ b/modules/flann/CMakeLists.txt @@ -1,2 +1,2 @@ set(the_description "Clustering and Search in Multi-Dimensional Spaces") -ocv_define_module(flann opencv_core) +ocv_define_module(flann opencv_core WRAP python) diff --git a/modules/highgui/CMakeLists.txt b/modules/highgui/CMakeLists.txt index 174a620020..e9d496f33b 100644 --- a/modules/highgui/CMakeLists.txt +++ b/modules/highgui/CMakeLists.txt @@ -1,5 +1,5 @@ set(the_description "High-level GUI and Media I/O") -ocv_add_module(highgui opencv_imgproc opencv_imgcodecs opencv_videoio OPTIONAL opencv_androidcamera) +ocv_add_module(highgui opencv_imgproc opencv_imgcodecs opencv_videoio OPTIONAL opencv_androidcamera WRAP python) # ---------------------------------------------------------------------------- # CMake file for highgui. See root CMakeLists.txt diff --git a/modules/imgcodecs/CMakeLists.txt b/modules/imgcodecs/CMakeLists.txt index 0d3bd52f8b..f7bd8f4b11 100644 --- a/modules/imgcodecs/CMakeLists.txt +++ b/modules/imgcodecs/CMakeLists.txt @@ -1,5 +1,5 @@ set(the_description "Image codecs") -ocv_add_module(imgcodecs opencv_imgproc WRAP java) +ocv_add_module(imgcodecs opencv_imgproc WRAP java python) # ---------------------------------------------------------------------------- # CMake file for imgcodecs. See root CMakeLists.txt diff --git a/modules/imgproc/CMakeLists.txt b/modules/imgproc/CMakeLists.txt index 10bc5f0de8..afe89aaa1e 100644 --- a/modules/imgproc/CMakeLists.txt +++ b/modules/imgproc/CMakeLists.txt @@ -1,2 +1,2 @@ set(the_description "Image Processing") -ocv_define_module(imgproc opencv_core WRAP java) +ocv_define_module(imgproc opencv_core WRAP java python) diff --git a/modules/java/CMakeLists.txt b/modules/java/CMakeLists.txt index bf2e5598bb..7acc4dfb73 100644 --- a/modules/java/CMakeLists.txt +++ b/modules/java/CMakeLists.txt @@ -20,13 +20,13 @@ set(JAVA_INSTALL_ROOT "sdk/java") set(JNI_INSTALL_ROOT "sdk/native") # get list of modules to wrap -message(STATUS "Wrapped in java:") +# message(STATUS "Wrapped in java:") set(OPENCV_JAVA_MODULES) foreach(m ${OPENCV_MODULES_BUILD}) if (";${OPENCV_MODULE_${m}_WRAPPERS};" MATCHES ";java;" AND HAVE_${m}) string(REPLACE "opencv_" "" m ${m}) list(APPEND OPENCV_JAVA_MODULES ${m}) - message(STATUS "\topencv_${m}") + # message(STATUS "\topencv_${m}") endif() endforeach() diff --git a/modules/objdetect/CMakeLists.txt b/modules/objdetect/CMakeLists.txt index 1f3844a263..d42e9e8f11 100644 --- a/modules/objdetect/CMakeLists.txt +++ b/modules/objdetect/CMakeLists.txt @@ -1,2 +1,2 @@ set(the_description "Object Detection") -ocv_define_module(objdetect opencv_core opencv_imgproc opencv_ml OPTIONAL opencv_highgui WRAP java) +ocv_define_module(objdetect opencv_core opencv_imgproc opencv_ml OPTIONAL opencv_highgui WRAP java python) diff --git a/modules/photo/CMakeLists.txt b/modules/photo/CMakeLists.txt index 725f2bfdfe..88ac35d83f 100644 --- a/modules/photo/CMakeLists.txt +++ b/modules/photo/CMakeLists.txt @@ -4,4 +4,4 @@ if(HAVE_CUDA) ocv_warnings_disable(CMAKE_CXX_FLAGS -Wundef -Wmissing-declarations) endif() -ocv_define_module(photo opencv_imgproc OPTIONAL opencv_cudaarithm opencv_cudaimgproc WRAP java) +ocv_define_module(photo opencv_imgproc OPTIONAL opencv_cudaarithm opencv_cudaimgproc WRAP java python) diff --git a/modules/python/common.cmake b/modules/python/common.cmake index a082d0777a..b09b721925 100644 --- a/modules/python/common.cmake +++ b/modules/python/common.cmake @@ -1,28 +1,7 @@ # This file is included from a subdirectory set(PYTHON_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../") -set(candidate_deps "") -foreach(mp ${OPENCV_MODULES_PATH} ${OPENCV_EXTRA_MODULES_PATH}) - file(GLOB names "${mp}/*") - foreach(m IN LISTS names) - if(IS_DIRECTORY ${m}) - get_filename_component(m ${m} NAME) - list(APPEND candidate_deps "opencv_${m}") - endif() - endforeach(m) -endforeach(mp) - -# module blacklist -ocv_list_filterout(candidate_deps "^opencv_cud(a|ev)") -ocv_list_filterout(candidate_deps "^opencv_matlab$") -ocv_list_filterout(candidate_deps "^opencv_ts$") -ocv_list_filterout(candidate_deps "^opencv_adas$") -ocv_list_filterout(candidate_deps "^opencv_tracking$") -ocv_list_filterout(candidate_deps "^opencv_bioinspired$") -ocv_list_filterout(candidate_deps "^opencv_java$") -ocv_list_filterout(candidate_deps "^opencv_contrib_world$") - -ocv_add_module(${MODULE_NAME} BINDINGS OPTIONAL ${candidate_deps}) +ocv_add_module(${MODULE_NAME} BINDINGS) ocv_module_include_directories( "${PYTHON_INCLUDE_PATH}" @@ -30,16 +9,25 @@ ocv_module_include_directories( "${PYTHON_SOURCE_DIR}/src2" ) +# get list of modules to wrap +# message(STATUS "Wrapped in ${MODULE_NAME}:") +set(OPENCV_PYTHON_MODULES) +foreach(m ${OPENCV_MODULES_BUILD}) + if (";${OPENCV_MODULE_${m}_WRAPPERS};" MATCHES ";${MODULE_NAME};" AND HAVE_${m}) + list(APPEND OPENCV_PYTHON_MODULES ${m}) + # message(STATUS "\t${m}") + endif() +endforeach() + set(opencv_hdrs "") -foreach(m IN LISTS OPENCV_MODULE_opencv_${MODULE_NAME}_DEPS) - list(APPEND opencv_hdrs ${OPENCV_MODULE_${m}_HEADERS}) +foreach(m ${OPENCV_PYTHON_MODULES}) + list(APPEND opencv_hdrs ${OPENCV_MODULE_${m}_HEADERS}) endforeach(m) # header blacklist ocv_list_filterout(opencv_hdrs ".h$") ocv_list_filterout(opencv_hdrs "cuda") ocv_list_filterout(opencv_hdrs "cudev") -ocv_list_filterout(opencv_hdrs "opencv2/objdetect/detection_based_tracker.hpp") set(cv2_generated_hdrs "${CMAKE_CURRENT_BINARY_DIR}/pyopencv_generated_include.h" diff --git a/modules/shape/CMakeLists.txt b/modules/shape/CMakeLists.txt index 77150c4dea..fcd317089a 100644 --- a/modules/shape/CMakeLists.txt +++ b/modules/shape/CMakeLists.txt @@ -1,2 +1,2 @@ set(the_description "Shape descriptors and matchers.") -ocv_define_module(shape opencv_core opencv_imgproc opencv_video) +ocv_define_module(shape opencv_core opencv_imgproc opencv_video WRAP python) diff --git a/modules/stitching/CMakeLists.txt b/modules/stitching/CMakeLists.txt index 8650f7280e..9a24f43160 100644 --- a/modules/stitching/CMakeLists.txt +++ b/modules/stitching/CMakeLists.txt @@ -5,4 +5,5 @@ if(HAVE_CUDA) endif() ocv_define_module(stitching opencv_imgproc opencv_features2d opencv_calib3d opencv_objdetect - OPTIONAL opencv_cudaarithm opencv_cudafilters opencv_cudafeatures2d opencv_cudalegacy opencv_xfeatures2d) + OPTIONAL opencv_cudaarithm opencv_cudafilters opencv_cudafeatures2d opencv_cudalegacy opencv_xfeatures2d + WRAP python) diff --git a/modules/superres/CMakeLists.txt b/modules/superres/CMakeLists.txt index f85cf20736..03809ef66b 100644 --- a/modules/superres/CMakeLists.txt +++ b/modules/superres/CMakeLists.txt @@ -5,4 +5,5 @@ endif() set(the_description "Super Resolution") ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4127 -Wundef -Wshadow) ocv_define_module(superres opencv_imgproc opencv_video - OPTIONAL opencv_videoio opencv_cudaarithm opencv_cudafilters opencv_cudawarping opencv_cudaimgproc opencv_cudaoptflow opencv_cudacodec) + OPTIONAL opencv_videoio opencv_cudaarithm opencv_cudafilters opencv_cudawarping opencv_cudaimgproc opencv_cudaoptflow opencv_cudacodec + WRAP python) diff --git a/modules/video/CMakeLists.txt b/modules/video/CMakeLists.txt index 57d86f08b3..15705cfc3a 100644 --- a/modules/video/CMakeLists.txt +++ b/modules/video/CMakeLists.txt @@ -1,2 +1,2 @@ set(the_description "Video Analysis") -ocv_define_module(video opencv_imgproc WRAP java) +ocv_define_module(video opencv_imgproc WRAP java python) diff --git a/modules/videoio/CMakeLists.txt b/modules/videoio/CMakeLists.txt index f52e69e95d..61a517a87b 100644 --- a/modules/videoio/CMakeLists.txt +++ b/modules/videoio/CMakeLists.txt @@ -1,5 +1,5 @@ set(the_description "Media I/O") -ocv_add_module(videoio opencv_imgproc opencv_imgcodecs OPTIONAL opencv_androidcamera WRAP java) +ocv_add_module(videoio opencv_imgproc opencv_imgcodecs OPTIONAL opencv_androidcamera WRAP java python) # ---------------------------------------------------------------------------- # CMake file for videoio. See root CMakeLists.txt diff --git a/modules/videostab/CMakeLists.txt b/modules/videostab/CMakeLists.txt index f57a5d2151..8f7ae830a8 100644 --- a/modules/videostab/CMakeLists.txt +++ b/modules/videostab/CMakeLists.txt @@ -5,4 +5,4 @@ if(HAVE_CUDA) endif() ocv_define_module(videostab opencv_imgproc opencv_features2d opencv_video opencv_photo opencv_calib3d - OPTIONAL opencv_cudawarping opencv_cudaoptflow opencv_videoio) +OPTIONAL opencv_cudawarping opencv_cudaoptflow opencv_videoio WRAP python) diff --git a/modules/viz/CMakeLists.txt b/modules/viz/CMakeLists.txt index 7fddb53880..9fd0301635 100644 --- a/modules/viz/CMakeLists.txt +++ b/modules/viz/CMakeLists.txt @@ -4,7 +4,7 @@ endif() include(${VTK_USE_FILE}) set(the_description "Viz") -ocv_define_module(viz opencv_core ${VTK_LIBRARIES}) +ocv_define_module(viz opencv_core ${VTK_LIBRARIES} WRAP python) if(APPLE AND BUILD_opencv_viz) ocv_target_link_libraries(opencv_viz "-framework Cocoa")