Commit 620d122f authored by Andrey Kamaev's avatar Andrey Kamaev

Contrib module is added to java wrappers; fixed algorithm initialisation for python bindings

parent b1eba01a
...@@ -6,7 +6,7 @@ if(NOT ANDROID OR NOT PYTHON_EXECUTABLE OR ANDROID_NATIVE_API_LEVEL LESS 8) ...@@ -6,7 +6,7 @@ if(NOT ANDROID OR NOT PYTHON_EXECUTABLE OR ANDROID_NATIVE_API_LEVEL LESS 8)
endif() endif()
set(the_description "The java bindings") set(the_description "The java bindings")
ocv_add_module(java BINDINGS opencv_core opencv_imgproc OPTIONAL opencv_objdetect opencv_features2d opencv_video opencv_highgui opencv_ml opencv_calib3d opencv_photo opencv_nonfree) ocv_add_module(java BINDINGS opencv_core opencv_imgproc OPTIONAL opencv_objdetect opencv_features2d opencv_video opencv_highgui opencv_ml opencv_calib3d opencv_photo opencv_nonfree opencv_contrib)
ocv_module_include_directories("${CMAKE_CURRENT_SOURCE_DIR}/generator/src/cpp") ocv_module_include_directories("${CMAKE_CURRENT_SOURCE_DIR}/generator/src/cpp")
# get list of modules to wrap # get list of modules to wrap
......
...@@ -18,6 +18,10 @@ ...@@ -18,6 +18,10 @@
# include "opencv2/ml/ml.hpp" # include "opencv2/ml/ml.hpp"
#endif #endif
#ifdef HAVE_OPENCV_CONTRIB
# include "opencv2/contrib/contrib.hpp"
#endif
extern "C" { extern "C" {
JNIEXPORT jint JNICALL JNIEXPORT jint JNICALL
...@@ -40,6 +44,9 @@ JNI_OnLoad(JavaVM* vm, void* ) ...@@ -40,6 +44,9 @@ JNI_OnLoad(JavaVM* vm, void* )
#ifdef HAVE_OPENCV_ML #ifdef HAVE_OPENCV_ML
init &= cv::initModule_ml(); init &= cv::initModule_ml();
#endif #endif
#ifdef HAVE_OPENCV_CONTRIB
init &= cv::initModule_contrib();
#endif
if(!init) if(!init)
return -1; return -1;
......
...@@ -22,12 +22,11 @@ ...@@ -22,12 +22,11 @@
#include "opencv2/highgui/highgui.hpp" #include "opencv2/highgui/highgui.hpp"
#include "opencv2/opencv_modules.hpp" #include "opencv2/opencv_modules.hpp"
#ifdef HAVE_OPENCV_NONFREE #ifdef HAVE_OPENCV_NONFREE
#include "opencv2/nonfree/nonfree.hpp" # include "opencv2/nonfree/nonfree.hpp"
static bool makeUseOfNonfree = cv::initModule_nonfree();
#endif #endif
using cv::flann::IndexParams; using cv::flann::IndexParams;
using cv::flann::SearchParams; using cv::flann::SearchParams;
......
...@@ -3878,11 +3878,52 @@ static PyMethodDef old_methods[] = { ...@@ -3878,11 +3878,52 @@ static PyMethodDef old_methods[] = {
/************************************************************************/ /************************************************************************/
/* Module init */ /* Module init */
#include "opencv2/opencv_modules.hpp"
#ifdef HAVE_OPENCV_NONFREE
# include "opencv2/nonfree/nonfree.hpp"
#endif
#ifdef HAVE_OPENCV_FEATURES2D
# include "opencv2/features2d/features2d.hpp"
#endif
#ifdef HAVE_OPENCV_VIDEO
# include "opencv2/video/video.hpp"
#endif
#ifdef HAVE_OPENCV_ML
# include "opencv2/ml/ml.hpp"
#endif
#ifdef HAVE_OPENCV_CONTRIB
# include "opencv2/contrib/contrib.hpp"
#endif
static PyObject* init_cv() static PyObject* init_cv()
{ {
PyObject *m, *d; PyObject *m, *d;
cvSetErrMode(CV_ErrModeParent); cvSetErrMode(CV_ErrModeParent);
bool init = true;
#ifdef HAVE_OPENCV_NONFREE
init &= cv::initModule_nonfree();
#endif
#ifdef HAVE_OPENCV_FEATURES2D
init &= cv::initModule_features2d();
#endif
#ifdef HAVE_OPENCV_VIDEO
init &= cv::initModule_video();
#endif
#ifdef HAVE_OPENCV_ML
init &= cv::initModule_ml();
#endif
#ifdef HAVE_OPENCV_CONTRIB
init &= cv::initModule_contrib();
#endif
if(!init)
return 0;
#define MKTYPE(NAME) NAME##_specials(); to_ok(&NAME##_Type) #define MKTYPE(NAME) NAME##_specials(); to_ok(&NAME##_Type)
MKTYPE(cvcontourtree); MKTYPE(cvcontourtree);
......
...@@ -2,7 +2,6 @@ set(sample example-face-detection) ...@@ -2,7 +2,6 @@ set(sample example-face-detection)
if(BUILD_FAT_JAVA_LIB) if(BUILD_FAT_JAVA_LIB)
set(native_deps opencv_java) set(native_deps opencv_java)
ocv_include_modules(opencv_contrib)
else() else()
set(native_deps opencv_contrib) set(native_deps opencv_contrib)
endif() endif()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment