1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 00:03:03 +04:00

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

This commit is contained in:
Alexander Alekhin
2019-01-10 12:29:41 +03:00
18 changed files with 217 additions and 9 deletions
@@ -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.
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -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 )
{
+23
View File
@@ -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;