Merge remote-tracking branch 'upstream/3.4' into merge-3.4
authorAlexander Alekhin <alexander.a.alekhin@gmail.com>
Tue, 30 Apr 2019 19:59:49 +0000 (19:59 +0000)
committerAlexander Alekhin <alexander.a.alekhin@gmail.com>
Wed, 1 May 2019 08:27:45 +0000 (08:27 +0000)
24 files changed:
1  2 
CMakeLists.txt
cmake/OpenCVCompilerOptions.cmake
cmake/OpenCVFindLibsGUI.cmake
modules/calib3d/include/opencv2/calib3d.hpp
modules/calib3d/misc/java/test/Calib3dTest.java
modules/calib3d/src/fundam.cpp
modules/core/include/opencv2/core/utility.hpp
modules/dnn/include/opencv2/dnn/all_layers.hpp
modules/dnn/include/opencv2/dnn/version.hpp
modules/dnn/src/dnn.cpp
modules/dnn/src/layers/convolution_layer.cpp
modules/dnn/src/layers/detection_output_layer.cpp
modules/dnn/src/layers/lrn_layer.cpp
modules/dnn/src/layers/pooling_layer.cpp
modules/dnn/src/onnx/onnx_importer.cpp
modules/dnn/src/op_inf_engine.cpp
modules/dnn/src/tensorflow/tf_graph_simplifier.cpp
modules/dnn/src/tensorflow/tf_importer.cpp
modules/dnn/test/test_backends.cpp
modules/dnn/test/test_common.hpp
modules/ts/src/ts.cpp
modules/ts/src/ts_perf.cpp
modules/videoio/src/cap_v4l.cpp
samples/cpp/detect_mser.cpp

diff --cc CMakeLists.txt
Simple merge
Simple merge
Simple merge
@@@ -913,46 -848,8 +913,46 @@@ square grouping and ordering algorithm 
  CV_EXPORTS_W bool findChessboardCorners( InputArray image, Size patternSize, OutputArray corners,
                                           int flags = CALIB_CB_ADAPTIVE_THRESH + CALIB_CB_NORMALIZE_IMAGE );
  
 +/*
 +   Checks whether the image contains chessboard of the specific size or not.
 +   If yes, nonzero value is returned.
 +*/
 +CV_EXPORTS_W bool checkChessboard(InputArray img, Size size);
 +
 +/** @brief Finds the positions of internal corners of the chessboard using a sector based approach.
 +
 +@param image Source chessboard view. It must be an 8-bit grayscale or color image.
 +@param patternSize Number of inner corners per a chessboard row and column
 +( patternSize = cv::Size(points_per_row,points_per_colum) = cv::Size(columns,rows) ).
 +@param corners Output array of detected corners.
 +@param flags Various operation flags that can be zero or a combination of the following values:
 +-   **CALIB_CB_NORMALIZE_IMAGE** Normalize the image gamma with equalizeHist before detection.
 +-   **CALIB_CB_EXHAUSTIVE ** Run an exhaustive search to improve detection rate.
 +-   **CALIB_CB_ACCURACY ** Up sample input image to improve sub-pixel accuracy due to aliasing effects.
 +This should be used if an accurate camera calibration is required.
 +
 +The function is analog to findchessboardCorners but uses a localized radon
 +transformation approximated by box filters being more robust to all sort of
 +noise, faster on larger images and is able to directly return the sub-pixel
 +position of the internal chessboard corners. The Method is based on the paper
 +@cite duda2018 "Accurate Detection and Localization of Checkerboard Corners for
 +Calibration" demonstrating that the returned sub-pixel positions are more
 +accurate than the one returned by cornerSubPix allowing a precise camera
 +calibration for demanding applications.
 +
 +@note The function requires a white boarder with roughly the same width as one
 +of the checkerboard fields around the whole board to improve the detection in
 +various environments. In addition, because of the localized radon
 +transformation it is beneficial to use round corners for the field corners
 +which are located on the outside of the board. The following figure illustrates
 +a sample checkerboard optimized for the detection. However, any other checkerboard
 +can be used as well.
 +![Checkerboard](pics/checkerboard_radon.png)
 + */
 +CV_EXPORTS_W bool findChessboardCornersSB(InputArray image,Size patternSize, OutputArray corners,int flags=0);
 +
  //! finds subpixel-accurate positions of the chessboard corners
- CV_EXPORTS bool find4QuadCornerSubpix( InputArray img, InputOutputArray corners, Size region_size );
+ CV_EXPORTS_W bool find4QuadCornerSubpix( InputArray img, InputOutputArray corners, Size region_size );
  
  /** @brief Renders the detected chessboard corners.
  
Simple merge
index b7a6a3f,0000000..6f53969
mode 100644,000000..100644
--- /dev/null
@@@ -1,21 -1,0 +1,21 @@@
- #define OPENCV_DNN_API_VERSION 20190422
 +// This file is part of OpenCV project.
 +// It is subject to the license terms in the LICENSE file found in the top-level directory
 +// of this distribution and at http://opencv.org/license.html.
 +
 +#ifndef OPENCV_DNN_VERSION_HPP
 +#define OPENCV_DNN_VERSION_HPP
 +
 +/// Use with major OpenCV version only.
++#define OPENCV_DNN_API_VERSION 20190430
 +
 +#if !defined CV_DOXYGEN && !defined CV_STATIC_ANALYSIS && !defined CV_DNN_DONT_ADD_INLINE_NS
 +#define CV__DNN_INLINE_NS __CV_CAT(dnn4_v, OPENCV_DNN_API_VERSION)
 +#define CV__DNN_INLINE_NS_BEGIN namespace CV__DNN_INLINE_NS {
 +#define CV__DNN_INLINE_NS_END }
 +namespace cv { namespace dnn { namespace CV__DNN_INLINE_NS { } using namespace CV__DNN_INLINE_NS; }}
 +#else
 +#define CV__DNN_INLINE_NS_BEGIN
 +#define CV__DNN_INLINE_NS_END
 +#endif
 +
 +#endif  // OPENCV_DNN_VERSION_HPP
Simple merge
@@@ -243,9 -254,7 +255,13 @@@ public
          }
          else
  #endif
 -            return (kernel_size.size() == 2) && (backendId == DNN_BACKEND_OPENCV || backendId == DNN_BACKEND_HALIDE);
++        {
++            if (kernel_size.size() != 2)
++                return false;
 +            return backendId == DNN_BACKEND_OPENCV ||
 +                   backendId == DNN_BACKEND_HALIDE ||
 +                   (backendId == DNN_BACKEND_VKCOM && haveVulkan());
++        }
      }
  
      bool getMemoryShapes(const std::vector<MatShape> &inputs,
@@@ -92,10 -91,8 +92,10 @@@ public
      virtual bool supportBackend(int backendId) CV_OVERRIDE
      {
          if (backendId == DNN_BACKEND_INFERENCE_ENGINE)
-             return bias == 1;
+             return bias == (int)bias;
 -        return backendId == DNN_BACKEND_OPENCV || backendId == DNN_BACKEND_HALIDE;
 +        return backendId == DNN_BACKEND_OPENCV ||
 +               backendId == DNN_BACKEND_HALIDE ||
 +               (backendId == DNN_BACKEND_VKCOM && haveVulkan() && (size % 2 == 1) && (type == CHANNEL_NRM));
      }
  
  #ifdef HAVE_OPENCL
@@@ -162,11 -177,9 +178,15 @@@ public
  #endif
          }
          else
 -            return (kernel_size.empty() || kernel_size.size() == 2) && (backendId == DNN_BACKEND_OPENCV ||
++        {
++            if (!kernel_size.empty() && kernel_size.size() != 2)  // TODO Support Pooling3D
++                return false;
 +            return backendId == DNN_BACKEND_OPENCV ||
                     (backendId == DNN_BACKEND_HALIDE && haveHalide() &&
 -                   (type == MAX || (type == AVE && !pad_t && !pad_l && !pad_b && !pad_r))));
 +                       (type == MAX || (type == AVE && !pad_t && !pad_l && !pad_b && !pad_r))) ||
 +                   (backendId == DNN_BACKEND_VKCOM && haveVulkan() &&
 +                       (type == MAX || type == AVE));
++        }
      }
  
  #ifdef HAVE_OPENCL
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge