Merge remote-tracking branch 'upstream/3.4' into merge-3.4
authorAlexander Alekhin <alexander.alekhin@intel.com>
Wed, 13 Jun 2018 16:20:12 +0000 (19:20 +0300)
committerAlexander Alekhin <alexander.alekhin@intel.com>
Wed, 13 Jun 2018 16:34:44 +0000 (19:34 +0300)
OpenCV FFmpeg wrapper download links are preserved from ffmpeg/master branch

12 files changed:
1  2 
3rdparty/ffmpeg/ffmpeg.cmake
doc/tutorials/imgproc/shapedescriptors/bounding_rects_circles/bounding_rects_circles.markdown
doc/tutorials/imgproc/shapedescriptors/bounding_rotated_ellipses/bounding_rotated_ellipses.markdown
doc/tutorials/imgproc/shapedescriptors/find_contours/find_contours.markdown
doc/tutorials/imgproc/shapedescriptors/hull/hull.markdown
doc/tutorials/imgproc/shapedescriptors/moments/moments.markdown
doc/tutorials/imgproc/shapedescriptors/point_polygon_test/point_polygon_test.markdown
doc/tutorials/objdetect/cascade_classifier/cascade_classifier.markdown
doc/tutorials/photo/hdr_imaging/hdr_imaging.markdown
modules/core/src/system.cpp
modules/core/test/test_mat.cpp
modules/videoio/src/videoio_registry.cpp

Simple merge
@@@ -15,9 -15,23 +15,23 @@@ Theor
  Code
  ----
  
+ @add_toggle_cpp
  This tutorial code's is shown lines below. You can also download it from
 -[here](https://github.com/opencv/opencv/tree/3.4/samples/cpp/tutorial_code/ShapeDescriptors/generalContours_demo1.cpp)
 +[here](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/ShapeDescriptors/generalContours_demo1.cpp)
  @include samples/cpp/tutorial_code/ShapeDescriptors/generalContours_demo1.cpp
 -[here](https://github.com/opencv/opencv/tree/3.4/samples/java/tutorial_code/ShapeDescriptors/bounding_rects_circles/GeneralContoursDemo1.java)
+ @end_toggle
+ @add_toggle_java
+ This tutorial code's is shown lines below. You can also download it from
 -[here](https://github.com/opencv/opencv/tree/3.4/samples/python/tutorial_code/ShapeDescriptors/bounding_rects_circles/generalContours_demo1.py)
++[here](https://github.com/opencv/opencv/tree/master/samples/java/tutorial_code/ShapeDescriptors/bounding_rects_circles/GeneralContoursDemo1.java)
+ @include samples/java/tutorial_code/ShapeDescriptors/bounding_rects_circles/GeneralContoursDemo1.java
+ @end_toggle
+ @add_toggle_python
+ This tutorial code's is shown lines below. You can also download it from
++[here](https://github.com/opencv/opencv/tree/master/samples/python/tutorial_code/ShapeDescriptors/bounding_rects_circles/generalContours_demo1.py)
+ @include samples/python/tutorial_code/ShapeDescriptors/bounding_rects_circles/generalContours_demo1.py
+ @end_toggle
  
  Explanation
  -----------
@@@ -15,9 -15,23 +15,23 @@@ Theor
  Code
  ----
  
+ @add_toggle_cpp
  This tutorial code's is shown lines below. You can also download it from
 -[here](https://github.com/opencv/opencv/tree/3.4/samples/cpp/tutorial_code/ShapeDescriptors/generalContours_demo2.cpp)
 +[here](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/ShapeDescriptors/generalContours_demo2.cpp)
  @include samples/cpp/tutorial_code/ShapeDescriptors/generalContours_demo2.cpp
 -[here](https://github.com/opencv/opencv/tree/3.4/samples/java/tutorial_code/ShapeDescriptors/bounding_rotated_ellipses/GeneralContoursDemo2.java)
+ @end_toggle
+ @add_toggle_java
+ This tutorial code's is shown lines below. You can also download it from
 -[here](https://github.com/opencv/opencv/tree/3.4/samples/python/tutorial_code/ShapeDescriptors/bounding_rotated_ellipses/generalContours_demo2.py)
++[here](https://github.com/opencv/opencv/tree/master/samples/java/tutorial_code/ShapeDescriptors/bounding_rotated_ellipses/GeneralContoursDemo2.java)
+ @include samples/java/tutorial_code/ShapeDescriptors/bounding_rotated_ellipses/GeneralContoursDemo2.java
+ @end_toggle
+ @add_toggle_python
+ This tutorial code's is shown lines below. You can also download it from
++[here](https://github.com/opencv/opencv/tree/master/samples/python/tutorial_code/ShapeDescriptors/bounding_rotated_ellipses/generalContours_demo2.py)
+ @include samples/python/tutorial_code/ShapeDescriptors/bounding_rotated_ellipses/generalContours_demo2.py
+ @end_toggle
  
  Explanation
  -----------
@@@ -15,9 -15,23 +15,23 @@@ Theor
  Code
  ----
  
+ @add_toggle_cpp
  This tutorial code's is shown lines below. You can also download it from
 -[here](https://github.com/opencv/opencv/tree/3.4/samples/cpp/tutorial_code/ShapeDescriptors/findContours_demo.cpp)
 +[here](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/ShapeDescriptors/findContours_demo.cpp)
  @include samples/cpp/tutorial_code/ShapeDescriptors/findContours_demo.cpp
 -[here](https://github.com/opencv/opencv/tree/3.4/samples/java/tutorial_code/ShapeDescriptors/find_contours/FindContoursDemo.java)
+ @end_toggle
+ @add_toggle_java
+ This tutorial code's is shown lines below. You can also download it from
 -[here](https://github.com/opencv/opencv/tree/3.4/samples/python/tutorial_code/ShapeDescriptors/find_contours/findContours_demo.py)
++[here](https://github.com/opencv/opencv/tree/master/samples/java/tutorial_code/ShapeDescriptors/find_contours/FindContoursDemo.java)
+ @include samples/java/tutorial_code/ShapeDescriptors/find_contours/FindContoursDemo.java
+ @end_toggle
+ @add_toggle_python
+ This tutorial code's is shown lines below. You can also download it from
++[here](https://github.com/opencv/opencv/tree/master/samples/python/tutorial_code/ShapeDescriptors/find_contours/findContours_demo.py)
+ @include samples/python/tutorial_code/ShapeDescriptors/find_contours/findContours_demo.py
+ @end_toggle
  
  Explanation
  -----------
@@@ -14,10 -14,23 +14,23 @@@ Theor
  Code
  ----
  
+ @add_toggle_cpp
  This tutorial code's is shown lines below. You can also download it from
 -[here](https://github.com/opencv/opencv/tree/3.4/samples/cpp/tutorial_code/ShapeDescriptors/hull_demo.cpp)
 +[here](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/ShapeDescriptors/hull_demo.cpp)
  @include samples/cpp/tutorial_code/ShapeDescriptors/hull_demo.cpp
 -[here](https://github.com/opencv/opencv/tree/3.4/samples/java/tutorial_code/ShapeDescriptors/hull/HullDemo.java)
+ @end_toggle
+ @add_toggle_java
+ This tutorial code's is shown lines below. You can also download it from
 -[here](https://github.com/opencv/opencv/tree/3.4/samples/python/tutorial_code/ShapeDescriptors/hull/hull_demo.py)
++[here](https://github.com/opencv/opencv/tree/master/samples/java/tutorial_code/ShapeDescriptors/hull/HullDemo.java)
+ @include samples/java/tutorial_code/ShapeDescriptors/hull/HullDemo.java
+ @end_toggle
+ @add_toggle_python
+ This tutorial code's is shown lines below. You can also download it from
++[here](https://github.com/opencv/opencv/tree/master/samples/python/tutorial_code/ShapeDescriptors/hull/hull_demo.py)
+ @include samples/python/tutorial_code/ShapeDescriptors/hull/hull_demo.py
+ @end_toggle
  
  Explanation
  -----------
@@@ -16,9 -16,23 +16,23 @@@ Theor
  Code
  ----
  
+ @add_toggle_cpp
  This tutorial code's is shown lines below. You can also download it from
 -[here](https://github.com/opencv/opencv/tree/3.4/samples/cpp/tutorial_code/ShapeDescriptors/moments_demo.cpp)
 +[here](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/ShapeDescriptors/moments_demo.cpp)
  @include samples/cpp/tutorial_code/ShapeDescriptors/moments_demo.cpp
 -[here](https://github.com/opencv/opencv/tree/3.4/samples/java/tutorial_code/ShapeDescriptors/moments/MomentsDemo.java)
+ @end_toggle
+ @add_toggle_java
+ This tutorial code's is shown lines below. You can also download it from
 -[here](https://github.com/opencv/opencv/tree/3.4/samples/python/tutorial_code/ShapeDescriptors/moments/moments_demo.py)
++[here](https://github.com/opencv/opencv/tree/master/samples/java/tutorial_code/ShapeDescriptors/moments/MomentsDemo.java)
+ @include samples/java/tutorial_code/ShapeDescriptors/moments/MomentsDemo.java
+ @end_toggle
+ @add_toggle_python
+ This tutorial code's is shown lines below. You can also download it from
++[here](https://github.com/opencv/opencv/tree/master/samples/python/tutorial_code/ShapeDescriptors/moments/moments_demo.py)
+ @include samples/python/tutorial_code/ShapeDescriptors/moments/moments_demo.py
+ @end_toggle
  
  Explanation
  -----------
@@@ -14,9 -14,23 +14,23 @@@ Theor
  Code
  ----
  
+ @add_toggle_cpp
  This tutorial code's is shown lines below. You can also download it from
 -[here](https://github.com/opencv/opencv/tree/3.4/samples/cpp/tutorial_code/ShapeDescriptors/pointPolygonTest_demo.cpp)
 +[here](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/ShapeDescriptors/pointPolygonTest_demo.cpp)
  @include samples/cpp/tutorial_code/ShapeDescriptors/pointPolygonTest_demo.cpp
 -[here](https://github.com/opencv/opencv/tree/3.4/samples/java/tutorial_code/ShapeDescriptors/point_polygon_test/PointPolygonTestDemo.java)
+ @end_toggle
+ @add_toggle_java
+ This tutorial code's is shown lines below. You can also download it from
 -[here](https://github.com/opencv/opencv/tree/3.4/samples/python/tutorial_code/ShapeDescriptors/point_polygon_test/pointPolygonTest_demo.py)
++[here](https://github.com/opencv/opencv/tree/master/samples/java/tutorial_code/ShapeDescriptors/point_polygon_test/PointPolygonTestDemo.java)
+ @include samples/java/tutorial_code/ShapeDescriptors/point_polygon_test/PointPolygonTestDemo.java
+ @end_toggle
+ @add_toggle_python
+ This tutorial code's is shown lines below. You can also download it from
++[here](https://github.com/opencv/opencv/tree/master/samples/python/tutorial_code/ShapeDescriptors/point_polygon_test/pointPolygonTest_demo.py)
+ @include samples/python/tutorial_code/ShapeDescriptors/point_polygon_test/pointPolygonTest_demo.py
+ @end_toggle
  
  Explanation
  -----------
@@@ -17,9 -17,23 +17,23 @@@ Theor
  Code
  ----
  
+ @add_toggle_cpp
  This tutorial code's is shown lines below. You can also download it from
 -[here](https://github.com/opencv/opencv/tree/3.4/samples/cpp/tutorial_code/objectDetection/objectDetection.cpp)
 +[here](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/objectDetection/objectDetection.cpp)
  @include samples/cpp/tutorial_code/objectDetection/objectDetection.cpp
 -[here](https://github.com/opencv/opencv/tree/3.4/samples/java/tutorial_code/objectDetection/cascade_classifier/ObjectDetectionDemo.java)
+ @end_toggle
+ @add_toggle_java
+ This tutorial code's is shown lines below. You can also download it from
 -[here](https://github.com/opencv/opencv/tree/3.4/samples/python/tutorial_code/objectDetection/cascade_classifier/objectDetection.py)
++[here](https://github.com/opencv/opencv/tree/master/samples/java/tutorial_code/objectDetection/cascade_classifier/ObjectDetectionDemo.java)
+ @include samples/java/tutorial_code/objectDetection/cascade_classifier/ObjectDetectionDemo.java
+ @end_toggle
+ @add_toggle_python
+ This tutorial code's is shown lines below. You can also download it from
++[here](https://github.com/opencv/opencv/tree/master/samples/python/tutorial_code/objectDetection/cascade_classifier/objectDetection.py)
+ @include samples/python/tutorial_code/objectDetection/cascade_classifier/objectDetection.py
+ @end_toggle
  
  Explanation
  -----------
@@@ -31,7 -31,29 +31,29 @@@ Exposure sequenc
  Source Code
  -----------
  
- @include cpp/tutorial_code/photo/hdr_imaging/hdr_imaging.cpp
+ @add_toggle_cpp
+ This tutorial code's is shown lines below. You can also download it from
 -[here](https://github.com/opencv/opencv/tree/3.4/samples/cpp/tutorial_code/photo/hdr_imaging/hdr_imaging.cpp)
++[here](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/photo/hdr_imaging/hdr_imaging.cpp)
+ @include samples/cpp/tutorial_code/photo/hdr_imaging/hdr_imaging.cpp
+ @end_toggle
+ @add_toggle_java
+ This tutorial code's is shown lines below. You can also download it from
 -[here](https://github.com/opencv/opencv/tree/3.4/samples/java/tutorial_code/photo/hdr_imaging/HDRImagingDemo.java)
++[here](https://github.com/opencv/opencv/tree/master/samples/java/tutorial_code/photo/hdr_imaging/HDRImagingDemo.java)
+ @include samples/java/tutorial_code/photo/hdr_imaging/HDRImagingDemo.java
+ @end_toggle
+ @add_toggle_python
+ This tutorial code's is shown lines below. You can also download it from
 -[here](https://github.com/opencv/opencv/tree/3.4/samples/python/tutorial_code/photo/hdr_imaging/hdr_imaging.py)
++[here](https://github.com/opencv/opencv/tree/master/samples/python/tutorial_code/photo/hdr_imaging/hdr_imaging.py)
+ @include samples/python/tutorial_code/photo/hdr_imaging/hdr_imaging.py
+ @end_toggle
+ Sample images
+ -------------
+ Data directory that contains images, exposure times and `list.txt` file can be downloaded from
 -[here](https://github.com/opencv/opencv_extra/tree/3.4/testdata/cv/hdr/exposures).
++[here](https://github.com/opencv/opencv_extra/tree/master/testdata/cv/hdr/exposures).
  
  Explanation
  -----------
Simple merge
@@@ -1608,6 -1612,33 +1608,32 @@@ TEST(Mat, regression_7873_mat_vector_in
      ASSERT_EQ(2, sub_mat.size[2]);
  }
  
 -#ifdef CV_CXX_STD_ARRAY
+ TEST(Mat, regression_10507_mat_setTo)
+ {
+     Size sz(6, 4);
+     Mat test_mask(sz, CV_8UC1, cv::Scalar::all(255));
+     test_mask.at<uchar>(1,0) = 0;
+     test_mask.at<uchar>(0,1) = 0;
+     for (int cn = 1; cn <= 4; cn++)
+     {
+         cv::Mat A(sz, CV_MAKE_TYPE(CV_32F, cn), cv::Scalar::all(5));
+         A.setTo(cv::Scalar::all(std::numeric_limits<float>::quiet_NaN()), test_mask);
+         int nans = 0;
+         for (int y = 0; y < A.rows; y++)
+         {
+             for (int x = 0; x < A.cols; x++)
+             {
+                 for (int c = 0; c < cn; c++)
+                 {
+                     float v = A.ptr<float>(y, x)[c];
+                     nans += (v == v) ? 0 : 1;
+                 }
+             }
+         }
+         EXPECT_EQ(nans, cn * (sz.area() - 2)) << "A=" << A << std::endl << "mask=" << test_mask << std::endl;
+     }
+ }
  TEST(Core_Mat_array, outputArray_create_getMat)
  {
      cv::Mat_<uchar> src_base(5, 1);
@@@ -99,9 -98,7 +99,9 @@@ static const struct VideoBackendInfo bu
      DECLARE_BACKEND(CAP_OPENNI2, "OPENNI2", MODE_CAPTURE_ALL),
  #endif
  #ifdef HAVE_INTELPERC
-     DECLARE_BACKEND(CAP_INTELPERC, "INTEL_PERC", MODE_CAPTURE_ALL),
+     DECLARE_BACKEND(CAP_INTELPERC, "INTEL_PERC", MODE_CAPTURE_BY_INDEX),
 +#elif defined(HAVE_LIBREALSENSE)
 +    DECLARE_BACKEND(CAP_INTELPERC, "INTEL_REALSENSE", MODE_CAPTURE_BY_INDEX),
  #endif
  
      // OpenCV file-based only