Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts: modules/ocl/src/cl_runtime/cl_runtime.cpp modules/ocl/src/cl_runtime/clamdblas_runtime.cpp modules/ocl/src/cl_runtime/clamdfft_runtime.cpp modules/ocl/src/cl_runtime/generator/template/clamdblas_runtime.cpp.in modules/ocl/src/cl_runtime/generator/template/clamdfft_runtime.cpp.in
This commit is contained in:
@@ -247,10 +247,7 @@ void Mat::copyTo( OutputArray _dst ) const
|
||||
const uchar* sptr = data;
|
||||
uchar* dptr = dst.data;
|
||||
|
||||
// to handle the copying 1xn matrix => nx1 std vector.
|
||||
Size sz = size() == dst.size() ?
|
||||
getContinuousSize(*this, dst) :
|
||||
getContinuousSize(*this);
|
||||
Size sz = getContinuousSize(*this, dst);
|
||||
size_t len = sz.width*elemSize();
|
||||
|
||||
for( ; sz.height--; sptr += step, dptr += dst.step )
|
||||
@@ -301,6 +298,7 @@ void Mat::copyTo( OutputArray _dst, InputArray _mask ) const
|
||||
|
||||
if( dims <= 2 )
|
||||
{
|
||||
CV_Assert( size() == mask.size() );
|
||||
Size sz = getContinuousSize(*this, dst, mask, mcn);
|
||||
copymask(data, step, mask.data, mask.step, dst.data, dst.step, sz, &esz);
|
||||
return;
|
||||
|
@@ -67,7 +67,7 @@
|
||||
#define CV_CL_GET_PROC_ADDRESS(name) WinGetProcAddress(name)
|
||||
#endif // _WIN32
|
||||
|
||||
#if defined(linux)
|
||||
#if defined(__linux__)
|
||||
#include <dlfcn.h>
|
||||
#include <stdio.h>
|
||||
|
||||
|
@@ -67,7 +67,7 @@
|
||||
#define CV_CL_GET_PROC_ADDRESS(name) WinGetProcAddress(name)
|
||||
#endif // _WIN32
|
||||
|
||||
#if defined(linux)
|
||||
#if defined(__linux__)
|
||||
#include <dlfcn.h>
|
||||
#include <stdio.h>
|
||||
|
||||
|
@@ -125,7 +125,7 @@ static void* WinGetProcAddress(const char* name)
|
||||
#define CV_CL_GET_PROC_ADDRESS(name) WinGetProcAddress(name)
|
||||
#endif // _WIN32
|
||||
|
||||
#if defined(linux)
|
||||
#if defined(__linux__)
|
||||
#include <dlfcn.h>
|
||||
#include <stdio.h>
|
||||
|
||||
|
@@ -1139,3 +1139,24 @@ TEST(Core_Mat, reshape_1942)
|
||||
);
|
||||
ASSERT_EQ(1, cn);
|
||||
}
|
||||
|
||||
TEST(Core_Mat, copyNx1ToVector)
|
||||
{
|
||||
cv::Mat_<uchar> src(5, 1);
|
||||
cv::Mat_<uchar> ref_dst8;
|
||||
cv::Mat_<ushort> ref_dst16;
|
||||
std::vector<uchar> dst8;
|
||||
std::vector<ushort> dst16;
|
||||
|
||||
src << 1, 2, 3, 4, 5;
|
||||
|
||||
src.copyTo(ref_dst8);
|
||||
src.copyTo(dst8);
|
||||
|
||||
ASSERT_PRED_FORMAT2(cvtest::MatComparator(0, 0), ref_dst8, cv::Mat_<uchar>(dst8));
|
||||
|
||||
src.convertTo(ref_dst16, CV_16U);
|
||||
src.convertTo(dst16, CV_16U);
|
||||
|
||||
ASSERT_PRED_FORMAT2(cvtest::MatComparator(0, 0), ref_dst16, cv::Mat_<ushort>(dst16));
|
||||
}
|
||||
|
Reference in New Issue
Block a user