From: Alexander Alekhin Date: Wed, 13 Jun 2018 16:20:12 +0000 (+0300) Subject: Merge remote-tracking branch 'upstream/3.4' into merge-3.4 X-Git-Tag: accepted/tizen/6.0/unified/20201030.111113~1^2~617 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0d6518aaa05bc66b5724844938b6920627c5f13c;p=platform%2Fupstream%2Fopencv.git Merge remote-tracking branch 'upstream/3.4' into merge-3.4 OpenCV FFmpeg wrapper download links are preserved from ffmpeg/master branch --- 0d6518aaa05bc66b5724844938b6920627c5f13c diff --cc doc/tutorials/imgproc/shapedescriptors/bounding_rects_circles/bounding_rects_circles.markdown index 56d886d,99cc2c1..14dc954 --- a/doc/tutorials/imgproc/shapedescriptors/bounding_rects_circles/bounding_rects_circles.markdown +++ b/doc/tutorials/imgproc/shapedescriptors/bounding_rects_circles/bounding_rects_circles.markdown @@@ -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 + @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/ShapeDescriptors/bounding_rects_circles/GeneralContoursDemo1.java) ++[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/3.4/samples/python/tutorial_code/ShapeDescriptors/bounding_rects_circles/generalContours_demo1.py) ++[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 ----------- diff --cc doc/tutorials/imgproc/shapedescriptors/bounding_rotated_ellipses/bounding_rotated_ellipses.markdown index e7b3a94,a482936..7bda574 --- a/doc/tutorials/imgproc/shapedescriptors/bounding_rotated_ellipses/bounding_rotated_ellipses.markdown +++ b/doc/tutorials/imgproc/shapedescriptors/bounding_rotated_ellipses/bounding_rotated_ellipses.markdown @@@ -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 + @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/ShapeDescriptors/bounding_rotated_ellipses/GeneralContoursDemo2.java) ++[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/3.4/samples/python/tutorial_code/ShapeDescriptors/bounding_rotated_ellipses/generalContours_demo2.py) ++[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 ----------- diff --cc doc/tutorials/imgproc/shapedescriptors/find_contours/find_contours.markdown index 11d1d9f,c1171bb..bfadb4d --- a/doc/tutorials/imgproc/shapedescriptors/find_contours/find_contours.markdown +++ b/doc/tutorials/imgproc/shapedescriptors/find_contours/find_contours.markdown @@@ -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 + @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/ShapeDescriptors/find_contours/FindContoursDemo.java) ++[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/3.4/samples/python/tutorial_code/ShapeDescriptors/find_contours/findContours_demo.py) ++[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 ----------- diff --cc doc/tutorials/imgproc/shapedescriptors/hull/hull.markdown index 38df720,7d7fae1..bd8b115 --- a/doc/tutorials/imgproc/shapedescriptors/hull/hull.markdown +++ b/doc/tutorials/imgproc/shapedescriptors/hull/hull.markdown @@@ -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 + @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/ShapeDescriptors/hull/HullDemo.java) ++[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/3.4/samples/python/tutorial_code/ShapeDescriptors/hull/hull_demo.py) ++[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 ----------- diff --cc doc/tutorials/imgproc/shapedescriptors/moments/moments.markdown index 3ef4c13,de9e79c..98ab606 --- a/doc/tutorials/imgproc/shapedescriptors/moments/moments.markdown +++ b/doc/tutorials/imgproc/shapedescriptors/moments/moments.markdown @@@ -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 + @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/ShapeDescriptors/moments/MomentsDemo.java) ++[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/3.4/samples/python/tutorial_code/ShapeDescriptors/moments/moments_demo.py) ++[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 ----------- diff --cc doc/tutorials/imgproc/shapedescriptors/point_polygon_test/point_polygon_test.markdown index 4ffb98b,4a42eea..db97f63 --- a/doc/tutorials/imgproc/shapedescriptors/point_polygon_test/point_polygon_test.markdown +++ b/doc/tutorials/imgproc/shapedescriptors/point_polygon_test/point_polygon_test.markdown @@@ -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 + @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/ShapeDescriptors/point_polygon_test/PointPolygonTestDemo.java) ++[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/3.4/samples/python/tutorial_code/ShapeDescriptors/point_polygon_test/pointPolygonTest_demo.py) ++[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 ----------- diff --cc doc/tutorials/objdetect/cascade_classifier/cascade_classifier.markdown index 53ed36e,3c7bf6b..c2f7851 --- a/doc/tutorials/objdetect/cascade_classifier/cascade_classifier.markdown +++ b/doc/tutorials/objdetect/cascade_classifier/cascade_classifier.markdown @@@ -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 + @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/objectDetection/cascade_classifier/ObjectDetectionDemo.java) ++[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/3.4/samples/python/tutorial_code/objectDetection/cascade_classifier/objectDetection.py) ++[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 ----------- diff --cc doc/tutorials/photo/hdr_imaging/hdr_imaging.markdown index 07f993d,b26c8f4..b8e8b30 --- a/doc/tutorials/photo/hdr_imaging/hdr_imaging.markdown +++ b/doc/tutorials/photo/hdr_imaging/hdr_imaging.markdown @@@ -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 ----------- diff --cc modules/core/test/test_mat.cpp index b43ab20,ad480eb..0b9de5d --- a/modules/core/test/test_mat.cpp +++ b/modules/core/test/test_mat.cpp @@@ -1608,6 -1612,33 +1608,32 @@@ TEST(Mat, regression_7873_mat_vector_in ASSERT_EQ(2, sub_mat.size[2]); } + TEST(Mat, regression_10507_mat_setTo) + { + Size sz(6, 4); + Mat test_mask(sz, CV_8UC1, cv::Scalar::all(255)); + test_mask.at(1,0) = 0; + test_mask.at(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::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(y, x)[c]; + nans += (v == v) ? 0 : 1; + } + } + } + EXPECT_EQ(nans, cn * (sz.area() - 2)) << "A=" << A << std::endl << "mask=" << test_mask << std::endl; + } + } + -#ifdef CV_CXX_STD_ARRAY TEST(Core_Mat_array, outputArray_create_getMat) { cv::Mat_ src_base(5, 1); diff --cc modules/videoio/src/videoio_registry.cpp index f802692,1f990b1..16d265a --- a/modules/videoio/src/videoio_registry.cpp +++ b/modules/videoio/src/videoio_registry.cpp @@@ -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