Merge remote-tracking branch 'upstream/3.4' into merge-3.4
authorAlexander Alekhin <alexander.alekhin@intel.com>
Tue, 17 Jul 2018 16:26:50 +0000 (19:26 +0300)
committerAlexander Alekhin <alexander.alekhin@intel.com>
Tue, 17 Jul 2018 16:27:48 +0000 (19:27 +0300)
22 files changed:
1  2 
CMakeLists.txt
cmake/OpenCVDetectCUDA.cmake
cmake/OpenCVDetectInferenceEngine.cmake
doc/tutorials/core/basic_linear_transform/basic_linear_transform.markdown
doc/tutorials/ml/introduction_to_pca/introduction_to_pca.markdown
doc/tutorials/ml/introduction_to_svm/introduction_to_svm.markdown
doc/tutorials/ml/non_linear_svms/non_linear_svms.markdown
modules/calib3d/misc/java/gen_dict.json
modules/calib3d/src/calibinit.cpp
modules/core/include/opencv2/core.hpp
modules/core/include/opencv2/core/cvdef.h
modules/core/include/opencv2/core/mat.hpp
modules/core/include/opencv2/core/mat.inl.hpp
modules/core/include/opencv2/core/matx.hpp
modules/core/src/arithm.cpp
modules/core/src/check.cpp
modules/imgproc/src/deriv.cpp
modules/imgproc/src/drawing.cpp
modules/imgproc/src/smooth.cpp
modules/ml/src/rtrees.cpp
modules/objdetect/include/opencv2/objdetect.hpp
modules/ts/src/ts_func.cpp

diff --cc CMakeLists.txt
Simple merge
Simple merge
@@@ -15,16 -15,27 +15,23 @@@ macro(ie_fail
      return()
  endmacro()
  
 -if(NOT HAVE_CXX11)
 -    message(WARNING "DL Inference engine requires C++11. You can turn it on via ENABLE_CXX11=ON CMake flag.")
 -    ie_fail()
 -endif()
  
+ find_package(InferenceEngine QUIET)
+ if(InferenceEngine_FOUND)
+   set(INF_ENGINE_LIBRARIES "${InferenceEngine_LIBRARIES}")
+   set(INF_ENGINE_INCLUDE_DIRS "${InferenceEngine_INCLUDE_DIRS}")
+   set(INF_ENGINE_VERSION "${InferenceEngine_VERSION}")
+   set(HAVE_INF_ENGINE TRUE)
+   return()
+ endif()
+ ocv_check_environment_variables(INTEL_CVSDK_DIR INF_ENGINE_ROOT_DIR IE_PLUGINS_PATH)
  if(NOT INF_ENGINE_ROOT_DIR OR NOT EXISTS "${INF_ENGINE_ROOT_DIR}/include/inference_engine.hpp")
      set(ie_root_paths "${INF_ENGINE_ROOT_DIR}")
-     if(DEFINED ENV{INTEL_CVSDK_DIR})
-         list(APPEND ie_root_paths "$ENV{INTEL_CVSDK_DIR}")
-         list(APPEND ie_root_paths "$ENV{INTEL_CVSDK_DIR}/inference_engine")
-     endif()
      if(DEFINED INTEL_CVSDK_DIR)
-         list(APPEND ie_root_paths "${INTEL_CVSDK_DIR}")
-         list(APPEND ie_root_paths "${INTEL_CVSDK_DIR}/inference_engine")
+         list(APPEND ie_root_paths "${INTEL_CVSDK_DIR}/")
+         list(APPEND ie_root_paths "${INTEL_CVSDK_DIR}/deployment_tools/inference_engine")
      endif()
  
      if(NOT ie_root_paths)
@@@ -53,8 -53,29 +53,29 @@@ Theor
  Code
  ----
  
 -    [here](https://github.com/opencv/opencv/tree/3.4/samples/cpp/tutorial_code/ImgProc/BasicLinearTransforms.cpp)
+ @add_toggle_cpp
+ -   **Downloadable code**: Click
++    [here](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/ImgProc/BasicLinearTransforms.cpp)
  -   The following code performs the operation \f$g(i,j) = \alpha \cdot f(i,j) + \beta\f$ :
- @include BasicLinearTransforms.cpp
+     @include samples/cpp/tutorial_code/ImgProc/BasicLinearTransforms.cpp
+ @end_toggle
+ @add_toggle_java
+ -   **Downloadable code**: Click
 -    [here](https://github.com/opencv/opencv/tree/3.4/samples/java/tutorial_code/ImgProc/changing_contrast_brightness_image/BasicLinearTransformsDemo.java)
++    [here](https://github.com/opencv/opencv/tree/master/samples/java/tutorial_code/ImgProc/changing_contrast_brightness_image/BasicLinearTransformsDemo.java)
+ -   The following code performs the operation \f$g(i,j) = \alpha \cdot f(i,j) + \beta\f$ :
+     @include samples/java/tutorial_code/ImgProc/changing_contrast_brightness_image/BasicLinearTransformsDemo.java
+ @end_toggle
+ @add_toggle_python
+ -   **Downloadable code**: Click
 -    [here](https://github.com/opencv/opencv/tree/3.4/samples/python/tutorial_code/imgProc/changing_contrast_brightness_image/BasicLinearTransforms.py)
++    [here](https://github.com/opencv/opencv/tree/master/samples/python/tutorial_code/imgProc/changing_contrast_brightness_image/BasicLinearTransforms.py)
+ -   The following code performs the operation \f$g(i,j) = \alpha \cdot f(i,j) + \beta\f$ :
+     @include samples/python/tutorial_code/imgProc/changing_contrast_brightness_image/BasicLinearTransforms.py
+ @end_toggle
  
  Explanation
  -----------
@@@ -185,10 -280,31 +280,31 @@@ and are not intended to be used as a re
  
  ### Code
  
 -Code for the tutorial is [here](https://github.com/opencv/opencv/blob/3.4/samples/cpp/tutorial_code/ImgProc/changing_contrast_brightness_image/changing_contrast_brightness_image.cpp).
+ @add_toggle_cpp
 -Code for the tutorial is [here](https://github.com/opencv/opencv/blob/3.4/samples/java/tutorial_code/ImgProc/changing_contrast_brightness_image/ChangingContrastBrightnessImageDemo.java).
 +Code for the tutorial is [here](https://github.com/opencv/opencv/blob/master/samples/cpp/tutorial_code/ImgProc/changing_contrast_brightness_image/changing_contrast_brightness_image.cpp).
+ @end_toggle
+ @add_toggle_java
 -Code for the tutorial is [here](https://github.com/opencv/opencv/blob/3.4/samples/python/tutorial_code/imgProc/changing_contrast_brightness_image/changing_contrast_brightness_image.py).
++Code for the tutorial is [here](https://github.com/opencv/opencv/blob/master/samples/java/tutorial_code/ImgProc/changing_contrast_brightness_image/ChangingContrastBrightnessImageDemo.java).
+ @end_toggle
+ @add_toggle_python
++Code for the tutorial is [here](https://github.com/opencv/opencv/blob/master/samples/python/tutorial_code/imgProc/changing_contrast_brightness_image/changing_contrast_brightness_image.py).
+ @end_toggle
  Code for the gamma correction:
  
- @snippet changing_contrast_brightness_image.cpp changing-contrast-brightness-gamma-correction
+ @add_toggle_cpp
+ @snippet samples/cpp/tutorial_code/ImgProc/changing_contrast_brightness_image/changing_contrast_brightness_image.cpp changing-contrast-brightness-gamma-correction
+ @end_toggle
+ @add_toggle_java
+ @snippet samples/java/tutorial_code/ImgProc/changing_contrast_brightness_image/ChangingContrastBrightnessImageDemo.java changing-contrast-brightness-gamma-correction
+ @end_toggle
+ @add_toggle_python
+ @snippet samples/python/tutorial_code/imgProc/changing_contrast_brightness_image/changing_contrast_brightness_image.py changing-contrast-brightness-gamma-correction
+ @end_toggle
  
  A look-up table is used to improve the performance of the computation as only 256 values needs to be calculated once.
  
@@@ -91,11 -91,31 +91,31 @@@ __Find the eigenvectors and eigenvalue
  Source Code
  -----------
  
- This tutorial code's is shown lines below. You can also download it from
-     [here](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/ml/introduction_to_pca/introduction_to_pca.cpp).
- @include cpp/tutorial_code/ml/introduction_to_pca/introduction_to_pca.cpp
+ @add_toggle_cpp
+ -   **Downloadable code**: Click
 -    [here](https://github.com/opencv/opencv/tree/3.4/samples/cpp/tutorial_code/ml/introduction_to_pca/introduction_to_pca.cpp)
++    [here](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/ml/introduction_to_pca/introduction_to_pca.cpp)
+ -   **Code at glance:**
+     @include samples/cpp/tutorial_code/ml/introduction_to_pca/introduction_to_pca.cpp
+ @end_toggle
+ @add_toggle_java
+ -   **Downloadable code**: Click
 -    [here](https://github.com/opencv/opencv/tree/3.4/samples/java/tutorial_code/ml/introduction_to_pca/IntroductionToPCADemo.java)
++    [here](https://github.com/opencv/opencv/tree/master/samples/java/tutorial_code/ml/introduction_to_pca/IntroductionToPCADemo.java)
+ -   **Code at glance:**
+     @include samples/java/tutorial_code/ml/introduction_to_pca/IntroductionToPCADemo.java
+ @end_toggle
+ @add_toggle_python
+ -   **Downloadable code**: Click
 -    [here](https://github.com/opencv/opencv/tree/3.4/samples/python/tutorial_code/ml/introduction_to_pca/introduction_to_pca.py)
++    [here](https://github.com/opencv/opencv/tree/master/samples/python/tutorial_code/ml/introduction_to_pca/introduction_to_pca.py)
+ -   **Code at glance:**
+     @include samples/python/tutorial_code/ml/introduction_to_pca/introduction_to_pca.py
+ @end_toggle
  
 -@note Another example using PCA for dimensionality reduction while maintaining an amount of variance can be found at [opencv_source_code/samples/cpp/pca.cpp](https://github.com/opencv/opencv/tree/3.4/samples/cpp/pca.cpp)
 +@note Another example using PCA for dimensionality reduction while maintaining an amount of variance can be found at [opencv_source_code/samples/cpp/pca.cpp](https://github.com/opencv/opencv/tree/master/samples/cpp/pca.cpp)
  
  Explanation
  -----------
@@@ -96,7 -96,29 +96,29 @@@ Source Cod
  
  @note The following code has been implemented with OpenCV 3.0 classes and functions. An equivalent version of the code using OpenCV 2.4 can be found in [this page.](http://docs.opencv.org/2.4/doc/tutorials/ml/introduction_to_svm/introduction_to_svm.html#introductiontosvms)
  
- @include cpp/tutorial_code/ml/introduction_to_svm/introduction_to_svm.cpp
+ @add_toggle_cpp
+ -   **Downloadable code**: Click
 -    [here](https://github.com/opencv/opencv/tree/3.4/samples/cpp/tutorial_code/ml/introduction_to_svm/introduction_to_svm.cpp)
++    [here](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/ml/introduction_to_svm/introduction_to_svm.cpp)
+ -   **Code at glance:**
+     @include samples/cpp/tutorial_code/ml/introduction_to_svm/introduction_to_svm.cpp
+ @end_toggle
+ @add_toggle_java
+ -   **Downloadable code**: Click
 -    [here](https://github.com/opencv/opencv/tree/3.4/samples/java/tutorial_code/ml/introduction_to_svm/IntroductionToSVMDemo.java)
++    [here](https://github.com/opencv/opencv/tree/master/samples/java/tutorial_code/ml/introduction_to_svm/IntroductionToSVMDemo.java)
+ -   **Code at glance:**
+     @include samples/java/tutorial_code/ml/introduction_to_svm/IntroductionToSVMDemo.java
+ @end_toggle
+ @add_toggle_python
+ -   **Downloadable code**: Click
 -    [here](https://github.com/opencv/opencv/tree/3.4/samples/python/tutorial_code/ml/introduction_to_svm/introduction_to_svm.py)
++    [here](https://github.com/opencv/opencv/tree/master/samples/python/tutorial_code/ml/introduction_to_svm/introduction_to_svm.py)
+ -   **Code at glance:**
+     @include samples/python/tutorial_code/ml/introduction_to_svm/introduction_to_svm.py
+ @end_toggle
  
  Explanation
  -----------
@@@ -92,7 -92,29 +92,29 @@@ You may also find the source code in `s
  @note The following code has been implemented with OpenCV 3.0 classes and functions. An equivalent version of the code
  using OpenCV 2.4 can be found in [this page.](http://docs.opencv.org/2.4/doc/tutorials/ml/non_linear_svms/non_linear_svms.html#nonlinearsvms)
  
- @include cpp/tutorial_code/ml/non_linear_svms/non_linear_svms.cpp
+ @add_toggle_cpp
+ -   **Downloadable code**: Click
 -    [here](https://github.com/opencv/opencv/tree/3.4/samples/cpp/tutorial_code/ml/non_linear_svms/non_linear_svms.cpp)
++    [here](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/ml/non_linear_svms/non_linear_svms.cpp)
+ -   **Code at glance:**
+     @include samples/cpp/tutorial_code/ml/non_linear_svms/non_linear_svms.cpp
+ @end_toggle
+ @add_toggle_java
+ -   **Downloadable code**: Click
 -    [here](https://github.com/opencv/opencv/tree/3.4/samples/java/tutorial_code/ml/non_linear_svms/NonLinearSVMsDemo.java)
++    [here](https://github.com/opencv/opencv/tree/master/samples/java/tutorial_code/ml/non_linear_svms/NonLinearSVMsDemo.java)
+ -   **Code at glance:**
+     @include samples/java/tutorial_code/ml/non_linear_svms/NonLinearSVMsDemo.java
+ @end_toggle
+ @add_toggle_python
+ -   **Downloadable code**: Click
 -    [here](https://github.com/opencv/opencv/tree/3.4/samples/python/tutorial_code/ml/non_linear_svms/non_linear_svms.py)
++    [here](https://github.com/opencv/opencv/tree/master/samples/python/tutorial_code/ml/non_linear_svms/non_linear_svms.py)
+ -   **Code at glance:**
+     @include samples/python/tutorial_code/ml/non_linear_svms/non_linear_svms.py
+ @end_toggle
  
  Explanation
  -----------
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge