continue fixing nonfree elements
authorStevenPuttemans <steven.puttemans@kuleuven.be>
Wed, 27 Aug 2014 11:50:11 +0000 (13:50 +0200)
committerStevenPuttemans <steven.puttemans@kuleuven.be>
Thu, 28 Aug 2014 11:30:47 +0000 (13:30 +0200)
fixed dependency of stitching module on xfeatures2d module as optional
fixed the initModule_xfeatures2d function that was called in module stitching since it is in another namespace than the standard cv one.

modules/core/doc/basic_structures.rst
modules/java/CMakeLists.txt
modules/stitching/CMakeLists.txt
modules/stitching/perf/perf_stich.cpp
modules/stitching/src/matchers.cpp
modules/world/src/world_init.cpp
samples/cpp/CMakeLists.txt
samples/gpu/surf_keypoint_matcher.cpp

index ce66c7d..9f96749 100644 (file)
@@ -3133,7 +3133,7 @@ Stores algorithm parameters in a file storage
 
 The method stores all the algorithm parameters (in alphabetic order) to the file storage. The method is virtual. If you define your own Algorithm derivative, your can override the method and store some extra information. However, it's rarely needed. Here are some examples:
 
- * SIFT feature detector (from nonfree module). The class only stores algorithm parameters and no keypoints or their descriptors. Therefore, it's enough to store the algorithm parameters, which is what ``Algorithm::write()`` does. Therefore, there is no dedicated ``SIFT::write()``.
+ * SIFT feature detector (from xfeatures2d module). The class only stores algorithm parameters and no keypoints or their descriptors. Therefore, it's enough to store the algorithm parameters, which is what ``Algorithm::write()`` does. Therefore, there is no dedicated ``SIFT::write()``.
 
  * Background subtractor (from video module). It has the algorithm parameters and also it has the current background model. However, the background model is not stored. First, it's rather big. Then, if you have stored the background model, it would likely become irrelevant on the next run (because of shifted camera, changed background, different lighting etc.). Therefore, ``BackgroundSubtractorMOG`` and ``BackgroundSubtractorMOG2`` also rely on the standard ``Algorithm::write()`` to store just the algorithm parameters.
 
@@ -3179,7 +3179,7 @@ This static method creates a new instance of the specified algorithm. If there i
 
     Ptr<BackgroundSubtractor> bgfg = Algorithm::create<BackgroundSubtractor>("BackgroundSubtractor.MOG2");
 
-.. note:: This is important note about seemingly mysterious behavior of ``Algorithm::create()`` when it returns NULL while it should not. The reason is simple - ``Algorithm::create()`` resides in OpenCV`s core module and the algorithms are implemented in other modules. If you create algorithms dynamically, C++ linker may decide to throw away the modules where the actual algorithms are implemented, since you do not call any functions from the modules. To avoid this problem, you need to call ``initModule_<modulename>();`` somewhere in the beginning of the program before ``Algorithm::create()``. For example, call ``initModule_nonfree()`` in order to use SURF/SIFT, call ``initModule_ml()`` to use expectation maximization etc.
+.. note:: This is important note about seemingly mysterious behavior of ``Algorithm::create()`` when it returns NULL while it should not. The reason is simple - ``Algorithm::create()`` resides in OpenCV`s core module and the algorithms are implemented in other modules. If you create algorithms dynamically, C++ linker may decide to throw away the modules where the actual algorithms are implemented, since you do not call any functions from the modules. To avoid this problem, you need to call ``initModule_<modulename>();`` somewhere in the beginning of the program before ``Algorithm::create()``. For example, call ``initModule_xfeatures2d()`` in order to use SURF/SIFT, call ``initModule_ml()`` to use expectation maximization etc.
 
 Creating Own Algorithms
 -----------------------
index 6eba205..f920d54 100644 (file)
@@ -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_nonfree opencv_contrib)
+ocv_add_module(java BINDINGS opencv_core opencv_imgproc OPTIONAL opencv_objdetect opencv_features2d opencv_video opencv_imgcodecs opencv_videoio opencv_calib3d opencv_photo opencv_xfeatures2d)
 ocv_module_include_directories("${CMAKE_CURRENT_SOURCE_DIR}/generator/src/cpp")
 
 if(NOT ANDROID)
index e1a61b8..73db4a0 100644 (file)
@@ -1,3 +1,3 @@
 set(the_description "Images stitching")
 ocv_define_module(stitching opencv_imgproc opencv_features2d opencv_calib3d opencv_objdetect
-                  OPTIONAL opencv_cuda opencv_cudaarithm opencv_cudafilters opencv_cudafeatures2d)
+                  OPTIONAL opencv_cuda opencv_cudaarithm opencv_cudafilters opencv_cudafeatures2d opencv_xfeatures2d)
index b64fa18..74fd1cc 100644 (file)
@@ -18,7 +18,7 @@ typedef TestBaseWithParam<string> match;
 typedef std::tr1::tuple<string, int> matchVector_t;
 typedef TestBaseWithParam<matchVector_t> matchVector;
 
-#ifdef HAVE_OPENCV_NONFREE_TODO_FIND_WHY_SURF_IS_NOT_ABLE_TO_STITCH_PANOS
+#ifdef HAVE_OPENCV_XFEATURES2D_TODO_FIND_WHY_SURF_IS_NOT_ABLE_TO_STITCH_PANOS
 #define TEST_DETECTORS testing::Values("surf", "orb")
 #else
 #define TEST_DETECTORS testing::Values<string>("orb")
index 45e9725..adb6fab 100644 (file)
@@ -49,7 +49,7 @@ using namespace cv::cuda;
 #ifdef HAVE_OPENCV_XFEATURES2D
 #include "opencv2/xfeatures2d.hpp"
 
-static bool makeUseOfNonfree = initModule_xfeatures2d();
+static bool makeUseOfXfeatures2d = xfeatures2d::initModule_xfeatures2d();
 #endif
 
 namespace {
index c8b31eb..f092a7d 100644 (file)
@@ -52,7 +52,7 @@ bool cv::initAll()
     && initModule_features2d()
 #endif
 #ifdef HAVE_OPENCV_XFEATURES2D
-    && initModule_xfeatures2d()
+    && xfeatures2d::initModule_xfeatures2d()
 #endif
     ;
 }
index 888ab35..dcdf59d 100644 (file)
@@ -6,7 +6,7 @@
 SET(OPENCV_CPP_SAMPLES_REQUIRED_DEPS opencv_core opencv_imgproc opencv_flann
     opencv_imgcodecs opencv_videoio opencv_highgui opencv_ml opencv_video
     opencv_objdetect opencv_photo opencv_features2d opencv_calib3d
-    opencv_stitching opencv_videostab opencv_shape)
+    opencv_stitching opencv_videostab opencv_shape opencv_xfeatures2d)
 
 ocv_check_dependencies(${OPENCV_CPP_SAMPLES_REQUIRED_DEPS})
 
index 21cbc9d..0a8554d 100644 (file)
@@ -91,7 +91,7 @@ int main(int argc, char* argv[])
 
 int main()
 {
-    std::cerr << "OpenCV was built without nonfree module" << std::endl;
+    std::cerr << "OpenCV was built without xfeatures2d module" << std::endl;
     return 0;
 }