Merge remote-tracking branch 'upstream/3.4' into merge-3.4

pull/13604/head
Alexander Alekhin 6 years ago
commit 7e2ebecd52
  1. 1
      3rdparty/carotene/src/resize.cpp
  2. 1
      modules/core/include/opencv2/core/cuda/functional.hpp
  3. 2
      modules/core/include/opencv2/core/cvdef.h
  4. 2
      modules/core/misc/java/src/java/core+RotatedRect.java
  5. 2
      modules/core/src/glob.cpp
  6. 2
      modules/core/src/merge.cpp
  7. 23
      modules/core/test/test_mat.cpp
  8. 3
      modules/dnn/src/layers/convolution_layer.cpp
  9. BIN
      modules/imgproc/doc/pics/colormaps/colorscale_cividis.jpg
  10. BIN
      modules/imgproc/doc/pics/colormaps/colorscale_inferno.jpg
  11. BIN
      modules/imgproc/doc/pics/colormaps/colorscale_magma.jpg
  12. BIN
      modules/imgproc/doc/pics/colormaps/colorscale_plasma.jpg
  13. BIN
      modules/imgproc/doc/pics/colormaps/colorscale_twilight.jpg
  14. BIN
      modules/imgproc/doc/pics/colormaps/colorscale_twilight_shifted.jpg
  15. BIN
      modules/imgproc/doc/pics/colormaps/colorscale_viridis.jpg
  16. 9
      modules/imgproc/include/opencv2/imgproc.hpp
  17. 177
      modules/imgproc/src/colormap.cpp
  18. 4
      samples/dnn/edge_detection.py

@ -109,6 +109,7 @@ bool isResizeLinearOpenCVSupported(const Size2D &ssize, const Size2D &dsize, u32
&& dsize.width >= 2 && dsize.height >= 8
&& (2*dsize.width != ssize.width || 2*dsize.height != ssize.height)) // 2x downscaling is performed as area in OpenCV which differs from this implementation
return isSupportedConfiguration();
return false;
default:
return false;
};

@ -47,7 +47,6 @@
#include "saturate_cast.hpp"
#include "vec_traits.hpp"
#include "type_traits.hpp"
#include "device_functions.h"
/** @file
* @deprecated Use @ref cudev instead.

@ -585,7 +585,7 @@ __CV_ENUM_FLAGS_BITWISE_XOR_EQ (EnumType, EnumType)
#ifdef CV_XADD
// allow to use user-defined macro
#elif defined __GNUC__ || defined __clang__
# if defined __clang__ && __clang_major__ >= 3 && !defined __ANDROID__ && !defined __EMSCRIPTEN__ && !defined(__CUDACC__)
# if defined __clang__ && __clang_major__ >= 3 && !defined __ANDROID__ && !defined __EMSCRIPTEN__ && !defined(__CUDACC__) && !defined __INTEL_COMPILER
# ifdef __ATOMIC_ACQ_REL
# define CV_XADD(addr, delta) __c11_atomic_fetch_add((_Atomic(int)*)(addr), delta, __ATOMIC_ACQ_REL)
# else

@ -33,7 +33,7 @@ public class RotatedRect {
angle = vals.length > 4 ? (double) vals[4] : 0;
} else {
center.x = 0;
center.x = 0;
center.y = 0;
size.width = 0;
size.height = 0;
angle = 0;

@ -60,7 +60,7 @@ namespace
#ifdef WINRT
WIN32_FIND_DATAW data;
#else
WIN32_FIND_DATA data;
WIN32_FIND_DATAA data;
#endif
HANDLE handle;
dirent ent;

@ -307,7 +307,7 @@ void cv::merge(const Mat* mv, size_t n, OutputArray _dst)
return;
}
CV_IPP_RUN_FAST(ipp_merge(mv, dst, (int)n));
CV_IPP_RUN(allch1, ipp_merge(mv, dst, (int)n));
if( !allch1 )
{

@ -1878,6 +1878,29 @@ TEST(Core_Split, crash_12171)
EXPECT_EQ(2, dst2.ptr<uchar>(1)[1]);
}
TEST(Core_Merge, bug_13544)
{
Mat src1(2, 2, CV_8UC3, Scalar::all(1));
Mat src2(2, 2, CV_8UC3, Scalar::all(2));
Mat src3(2, 2, CV_8UC3, Scalar::all(3));
Mat src_arr[] = { src1, src2, src3 };
Mat dst;
merge(src_arr, 3, dst);
ASSERT_EQ(9, dst.channels()); // Avoid memory access out of buffer
EXPECT_EQ(3, (int)dst.ptr<uchar>(0)[6]);
EXPECT_EQ(3, (int)dst.ptr<uchar>(0)[7]);
EXPECT_EQ(3, (int)dst.ptr<uchar>(0)[8]);
EXPECT_EQ(1, (int)dst.ptr<uchar>(1)[0]);
EXPECT_EQ(1, (int)dst.ptr<uchar>(1)[1]);
EXPECT_EQ(1, (int)dst.ptr<uchar>(1)[2]);
EXPECT_EQ(2, (int)dst.ptr<uchar>(1)[3]);
EXPECT_EQ(2, (int)dst.ptr<uchar>(1)[4]);
EXPECT_EQ(2, (int)dst.ptr<uchar>(1)[5]);
EXPECT_EQ(3, (int)dst.ptr<uchar>(1)[6]);
EXPECT_EQ(3, (int)dst.ptr<uchar>(1)[7]);
EXPECT_EQ(3, (int)dst.ptr<uchar>(1)[8]);
}
struct CustomType // like cv::Keypoint
{
Point2f pt;

@ -262,6 +262,9 @@ public:
}
int ngroups = inpCn / blobs[0].size[1];
if (ngroups == 0 || ngroups * blobs[0].size[1] != inpCn)
CV_Error(Error::StsError, format("Number of input channels should "
"be multiple of %d but got %d", blobs[0].size[1], inpCn));
CV_Assert(ngroups > 0 && inpCn % ngroups == 0 && outCn % ngroups == 0);
int dims[] = {inputs[0][0], outCn, out.height, out.width};

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

@ -4201,7 +4201,14 @@ enum ColormapTypes
COLORMAP_HSV = 9, //!< ![HSV](pics/colormaps/colorscale_hsv.jpg)
COLORMAP_PINK = 10, //!< ![pink](pics/colormaps/colorscale_pink.jpg)
COLORMAP_HOT = 11, //!< ![hot](pics/colormaps/colorscale_hot.jpg)
COLORMAP_PARULA = 12 //!< ![parula](pics/colormaps/colorscale_parula.jpg)
COLORMAP_PARULA = 12, //!< ![parula](pics/colormaps/colorscale_parula.jpg)
COLORMAP_MAGMA = 13, //!< ![magma](pics/colormaps/colorscale_magma.jpg)
COLORMAP_INFERNO = 14, //!< ![inferno](pics/colormaps/colorscale_inferno.jpg)
COLORMAP_PLASMA = 15, //!< ![plasma](pics/colormaps/colorscale_plasma.jpg)
COLORMAP_VIRIDIS = 16, //!< ![viridis](pics/colormaps/colorscale_viridis.jpg)
COLORMAP_CIVIDIS = 17, //!< ![cividis](pics/colormaps/colorscale_cividis.jpg)
COLORMAP_TWILIGHT = 18, //!< ![twilight](pics/colormaps/colorscale_twilight.jpg)
COLORMAP_TWILIGHT_SHIFTED = 19 //!< ![twilight shifted](pics/colormaps/colorscale_twilight_shifted.jpg)
};
/** @example samples/cpp/falsecolor.cpp

File diff suppressed because one or more lines are too long

@ -27,8 +27,8 @@ class CropLayer(object):
batchSize, numChannels = inputShape[0], inputShape[1]
height, width = targetShape[2], targetShape[3]
self.ystart = (inputShape[2] - targetShape[2]) / 2
self.xstart = (inputShape[3] - targetShape[3]) / 2
self.ystart = (inputShape[2] - targetShape[2]) // 2
self.xstart = (inputShape[3] - targetShape[3]) // 2
self.yend = self.ystart + height
self.xend = self.xstart + width

Loading…
Cancel
Save