Commit fb7aa43f authored by Vladislav Vinogradov's avatar Vladislav Vinogradov

added gpu 1d window sum, convertTo, based on NPP.

added RGB <-> XYZ color conversion.
gpu morphology minor fix.
parent 12b7f3a0
...@@ -533,6 +533,9 @@ namespace cv ...@@ -533,6 +533,9 @@ namespace cv
//! applies an advanced morphological operation to the image //! applies an advanced morphological operation to the image
CV_EXPORTS void morphologyEx( const GpuMat& src, GpuMat& dst, int op, const Mat& kernel, Point anchor, int iterations); CV_EXPORTS void morphologyEx( const GpuMat& src, GpuMat& dst, int op, const Mat& kernel, Point anchor, int iterations);
CV_EXPORTS void sumWindowColumn(const GpuMat& src, GpuMat& dst, int ksize, int anchor = -1);
CV_EXPORTS void sumWindowRow(const GpuMat& src, GpuMat& dst, int ksize, int anchor = -1);
//////////////////////////////// Image Labeling //////////////////////////////// //////////////////////////////// Image Labeling ////////////////////////////////
......
This diff is collapsed.
...@@ -51,6 +51,9 @@ using namespace cv::gpu; ...@@ -51,6 +51,9 @@ using namespace cv::gpu;
void cv::gpu::erode( const GpuMat&, GpuMat&, const Mat&, Point, int) { throw_nogpu(); } void cv::gpu::erode( const GpuMat&, GpuMat&, const Mat&, Point, int) { throw_nogpu(); }
void cv::gpu::dilate( const GpuMat&, GpuMat&, const Mat&, Point, int) { throw_nogpu(); } void cv::gpu::dilate( const GpuMat&, GpuMat&, const Mat&, Point, int) { throw_nogpu(); }
void cv::gpu::morphologyEx( const GpuMat&, GpuMat&, int, const Mat&, Point, int) { throw_nogpu(); } void cv::gpu::morphologyEx( const GpuMat&, GpuMat&, int, const Mat&, Point, int) { throw_nogpu(); }
void cv::gpu::boxFilter(const GpuMat&, GpuMat&, Size, Point) { throw_nogpu(); }
void cv::gpu::sumWindowColumn(const GpuMat&, GpuMat&, int, int) { throw_nogpu(); }
void cv::gpu::sumWindowRow(const GpuMat&, GpuMat&, int, int) { throw_nogpu(); }
#else #else
...@@ -64,10 +67,10 @@ namespace ...@@ -64,10 +67,10 @@ namespace
CV_Assert(src.type() == CV_8U || src.type() == CV_8UC4); CV_Assert(src.type() == CV_8U || src.type() == CV_8UC4);
CV_Assert(kernel.type() == CV_8U && (kernel.cols & 1) != 0 && (kernel.rows & 1) != 0); CV_Assert(kernel.type() == CV_8U && (kernel.cols & 1) != 0 && (kernel.rows & 1) != 0);
if (anchor.x == -1) if( anchor.x == -1 )
anchor.x = 0; anchor.x = kernel.cols / 2;
if (anchor.y == -1) if( anchor.y == -1 )
anchor.y = 0; anchor.y = kernel.rows / 2;
// in NPP for Cuda 3.1 only such anchor is supported. // in NPP for Cuda 3.1 only such anchor is supported.
CV_Assert(anchor.x == 0 && anchor.y == 0); CV_Assert(anchor.x == 0 && anchor.y == 0);
...@@ -94,10 +97,16 @@ namespace ...@@ -94,10 +97,16 @@ namespace
anc.y = anchor.y; anc.y = anchor.y;
dst.create(src.size(), src.type()); dst.create(src.size(), src.type());
GpuMat dstBuf;
if (iterations > 1)
dstBuf.create(src.size(), src.type());
nppSafeCall( func(src.ptr<Npp8u>(), src.step, dst.ptr<Npp8u>(), dst.step, sz, gpu_krnl.ptr<Npp8u>(), mask_sz, anc) ); nppSafeCall( func(src.ptr<Npp8u>(), src.step, dst.ptr<Npp8u>(), dst.step, sz, gpu_krnl.ptr<Npp8u>(), mask_sz, anc) );
for(int i = 1; i < iterations; ++i) for(int i = 1; i < iterations; ++i)
nppSafeCall( func(dst.ptr<Npp8u>(), dst.step, dst.ptr<Npp8u>(), dst.step, sz, gpu_krnl.ptr<Npp8u>(), mask_sz, anc) ); {
dst.swap(dstBuf);
nppSafeCall( func(dstBuf.ptr<Npp8u>(), dstBuf.step, dst.ptr<Npp8u>(), dst.step, sz, gpu_krnl.ptr<Npp8u>(), mask_sz, anc) );
}
} }
} }
...@@ -154,4 +163,78 @@ void cv::gpu::morphologyEx( const GpuMat& src, GpuMat& dst, int op, const Mat& k ...@@ -154,4 +163,78 @@ void cv::gpu::morphologyEx( const GpuMat& src, GpuMat& dst, int op, const Mat& k
} }
} }
////////////////////////////////////////////////////////////////////////
// boxFilter
void cv::gpu::boxFilter(const GpuMat& src, GpuMat& dst, Size ksize, Point anchor)
{
CV_Assert(src.type() == CV_8UC1 || src.type() == CV_8UC4);
CV_Assert(ksize.height == 3 || ksize.height == 5 || ksize.height == 7);
CV_Assert(ksize.height == ksize.width);
if (anchor.x == -1)
anchor.x = 0;
if (anchor.y == -1)
anchor.y = 0;
CV_Assert(anchor.x == 0 && anchor.y == 0);
dst.create(src.size(), src.type());
NppiSize srcsz;
srcsz.height = src.rows;
srcsz.width = src.cols;
NppiSize masksz;
masksz.height = ksize.height;
masksz.width = ksize.width;
NppiPoint anc;
anc.x = anchor.x;
anc.y = anchor.y;
if (src.type() == CV_8UC1)
{
nppSafeCall( nppiFilterBox_8u_C1R(src.ptr<Npp8u>(), src.step, dst.ptr<Npp8u>(), dst.step, srcsz, masksz, anc) );
}
else
{
nppSafeCall( nppiFilterBox_8u_C4R(src.ptr<Npp8u>(), src.step, dst.ptr<Npp8u>(), dst.step, srcsz, masksz, anc) );
}
}
////////////////////////////////////////////////////////////////////////
// sumWindow Filter
namespace
{
typedef NppStatus (*nppSumWindow_t)(const Npp8u * pSrc, Npp32s nSrcStep,
Npp32f * pDst, Npp32s nDstStep, NppiSize oROI,
Npp32s nMaskSize, Npp32s nAnchor);
inline void sumWindowCaller(nppSumWindow_t func, const GpuMat& src, GpuMat& dst, int ksize, int anchor)
{
CV_Assert(src.type() == CV_8UC1);
if (anchor == -1)
anchor = ksize / 2;
NppiSize sz;
sz.width = src.cols;
sz.height = src.rows;
dst.create(src.size(), CV_32FC1);
nppSafeCall( func(src.ptr<Npp8u>(), src.step, dst.ptr<Npp32f>(), dst.step, sz, ksize, anchor) );
}
}
void cv::gpu::sumWindowColumn(const GpuMat& src, GpuMat& dst, int ksize, int anchor)
{
sumWindowCaller(nppiSumWindowColumn_8u32f_C1R, src, dst, ksize, anchor);
}
void cv::gpu::sumWindowRow(const GpuMat& src, GpuMat& dst, int ksize, int anchor)
{
sumWindowCaller(nppiSumWindowRow_8u32f_C1R, src, dst, ksize, anchor);
}
#endif #endif
This diff is collapsed.
...@@ -132,7 +132,8 @@ void cv::gpu::GpuMat::convertTo( GpuMat& dst, int rtype, double alpha, double be ...@@ -132,7 +132,8 @@ void cv::gpu::GpuMat::convertTo( GpuMat& dst, int rtype, double alpha, double be
rtype = type(); rtype = type();
else else
rtype = CV_MAKETYPE(CV_MAT_DEPTH(rtype), channels()); rtype = CV_MAKETYPE(CV_MAT_DEPTH(rtype), channels());
int stype = type();
int sdepth = depth(), ddepth = CV_MAT_DEPTH(rtype); int sdepth = depth(), ddepth = CV_MAT_DEPTH(rtype);
if( sdepth == ddepth && noScale ) if( sdepth == ddepth && noScale )
{ {
...@@ -146,7 +147,50 @@ void cv::gpu::GpuMat::convertTo( GpuMat& dst, int rtype, double alpha, double be ...@@ -146,7 +147,50 @@ void cv::gpu::GpuMat::convertTo( GpuMat& dst, int rtype, double alpha, double be
psrc = &(temp = *this); psrc = &(temp = *this);
dst.create( size(), rtype ); dst.create( size(), rtype );
matrix_operations::convert_to(*psrc, sdepth, dst, ddepth, psrc->channels(), alpha, beta);
if (!noScale)
matrix_operations::convert_to(*psrc, sdepth, dst, ddepth, psrc->channels(), alpha, beta);
else
{
NppiSize sz;
sz.width = cols;
sz.height = rows;
if (stype == CV_8UC1 && ddepth == CV_16U)
nppSafeCall( nppiConvert_8u16u_C1R(psrc->ptr<Npp8u>(), psrc->step, dst.ptr<Npp16u>(), dst.step, sz) );
else if (stype == CV_16UC1 && ddepth == CV_8U)
nppSafeCall( nppiConvert_16u8u_C1R(psrc->ptr<Npp16u>(), psrc->step, dst.ptr<Npp8u>(), dst.step, sz) );
else if (stype == CV_8UC4 && ddepth == CV_16U)
nppSafeCall( nppiConvert_8u16u_C4R(psrc->ptr<Npp8u>(), psrc->step, dst.ptr<Npp16u>(), dst.step, sz) );
else if (stype == CV_16UC4 && ddepth == CV_8U)
nppSafeCall( nppiConvert_16u8u_C4R(psrc->ptr<Npp16u>(), psrc->step, dst.ptr<Npp8u>(), dst.step, sz) );
else if (stype == CV_8UC1 && ddepth == CV_16S)
nppSafeCall( nppiConvert_8u16s_C1R(psrc->ptr<Npp8u>(), psrc->step, dst.ptr<Npp16s>(), dst.step, sz) );
else if (stype == CV_16SC1 && ddepth == CV_8U)
nppSafeCall( nppiConvert_16s8u_C1R(psrc->ptr<Npp16s>(), psrc->step, dst.ptr<Npp8u>(), dst.step, sz) );
else if (stype == CV_8UC4 && ddepth == CV_16S)
nppSafeCall( nppiConvert_8u16s_C4R(psrc->ptr<Npp8u>(), psrc->step, dst.ptr<Npp16s>(), dst.step, sz) );
else if (stype == CV_16SC4 && ddepth == CV_8U)
nppSafeCall( nppiConvert_16s8u_C4R(psrc->ptr<Npp16s>(), psrc->step, dst.ptr<Npp8u>(), dst.step, sz) );
else if (stype == CV_16SC1 && ddepth == CV_32F)
nppSafeCall( nppiConvert_16s32f_C1R(psrc->ptr<Npp16s>(), psrc->step, dst.ptr<Npp32f>(), dst.step, sz) );
else if (stype == CV_32FC1 && ddepth == CV_16S)
nppSafeCall( nppiConvert_32f16s_C1R(psrc->ptr<Npp32f>(), psrc->step, dst.ptr<Npp16s>(), dst.step, sz, NPP_RND_NEAR) );
else if (stype == CV_8UC1 && ddepth == CV_32F)
nppSafeCall( nppiConvert_8u32f_C1R(psrc->ptr<Npp8u>(), psrc->step, dst.ptr<Npp32f>(), dst.step, sz) );
else if (stype == CV_32FC1 && ddepth == CV_8U)
nppSafeCall( nppiConvert_32f8u_C1R(psrc->ptr<Npp32f>(), psrc->step, dst.ptr<Npp8u>(), dst.step, sz, NPP_RND_NEAR) );
else if (stype == CV_16UC1 && ddepth == CV_32F)
nppSafeCall( nppiConvert_16u32f_C1R(psrc->ptr<Npp16u>(), psrc->step, dst.ptr<Npp32f>(), dst.step, sz) );
else if (stype == CV_32FC1 && ddepth == CV_16U)
nppSafeCall( nppiConvert_32f16u_C1R(psrc->ptr<Npp32f>(), psrc->step, dst.ptr<Npp16u>(), dst.step, sz, NPP_RND_NEAR) );
else if (stype == CV_16UC1 && ddepth == CV_32S)
nppSafeCall( nppiConvert_16u32s_C1R(psrc->ptr<Npp16u>(), psrc->step, dst.ptr<Npp32s>(), dst.step, sz) );
else if (stype == CV_16SC1 && ddepth == CV_32S)
nppSafeCall( nppiConvert_16s32s_C1R(psrc->ptr<Npp16s>(), psrc->step, dst.ptr<Npp32s>(), dst.step, sz) );
else
matrix_operations::convert_to(*psrc, sdepth, dst, ddepth, psrc->channels(), 1.0, 0.0);
}
} }
GpuMat& GpuMat::operator = (const Scalar& s) GpuMat& GpuMat::operator = (const Scalar& s)
......
...@@ -47,12 +47,11 @@ const char* blacklist[] = ...@@ -47,12 +47,11 @@ const char* blacklist[] =
{ {
"GPU-NppImageSum", // crash "GPU-NppImageSum", // crash
"GPU-MatOperatorAsyncCall", // crash "GPU-MatOperatorAsyncCall", // crash
//"GPU-NppErode", // npp func returns error code (CUDA_KERNEL_LAUNCH_ERROR or TEXTURE_BIND_ERROR) //"GPU-NppErode", // different border interpolation
//"GPU-NppDilate", // npp func returns error code (CUDA_KERNEL_LAUNCH_ERROR or TEXTURE_BIND_ERROR) //"GPU-NppMorphologyEx", // different border interpolation
//"GPU-NppMorphologyEx", // npp func returns error code (CUDA_KERNEL_LAUNCH_ERROR or TEXTURE_BIND_ERROR)
//"GPU-NppImageDivide", // different round mode //"GPU-NppImageDivide", // different round mode
//"GPU-NppImageMeanStdDev", // different precision //"GPU-NppImageMeanStdDev", // different precision
//"GPU-NppImageMinNax", // npp bug //"GPU-NppImageMinNax", // npp bug - don't find min/max near right border
//"GPU-NppImageResize", // different precision in interpolation //"GPU-NppImageResize", // different precision in interpolation
//"GPU-NppImageWarpAffine", // different precision in interpolation //"GPU-NppImageWarpAffine", // different precision in interpolation
//"GPU-NppImageWarpPerspective", // different precision in interpolation //"GPU-NppImageWarpPerspective", // different precision in interpolation
...@@ -61,6 +60,7 @@ const char* blacklist[] = ...@@ -61,6 +60,7 @@ const char* blacklist[] =
//"GPU-NppImageExp", // different precision //"GPU-NppImageExp", // different precision
//"GPU-NppImageLog", // different precision //"GPU-NppImageLog", // different precision
//"GPU-NppImageMagnitude", // different precision //"GPU-NppImageMagnitude", // different precision
//"GPU-NppImageSumWindow", // different border interpolation
0 0
}; };
......
...@@ -451,6 +451,47 @@ struct CV_GpuNppImageBlurTest : public CV_GpuImageProcTest ...@@ -451,6 +451,47 @@ struct CV_GpuNppImageBlurTest : public CV_GpuImageProcTest
} }
}; };
////////////////////////////////////////////////////////////////////////////////
// sumWindow
struct CV_GpuNppImageSumWindowTest : public CV_GpuImageProcTest
{
CV_GpuNppImageSumWindowTest() : CV_GpuImageProcTest( "GPU-NppImageSumWindow", "sumWindow" ) {}
int test(const Mat& img)
{
if (img.type() != CV_8UC1)
{
ts->printf(CvTS::LOG, "\nUnsupported type\n");
return CvTS::OK;
}
int ksizes[] = {3, 5, 7};
int ksizes_num = sizeof(ksizes) / sizeof(int);
int test_res = CvTS::OK;
for (int i = 0; i < ksizes_num; ++i)
{
ts->printf(CvTS::LOG, "\nksize = %d\n", ksizes[i]);
Mat cpudst(img.size(), CV_64FC1, Scalar());
cv::Ptr<cv::BaseRowFilter> ft = cv::getRowSumFilter(CV_8UC1, CV_64FC1, ksizes[i], 0);
for (int y = 0; y < img.rows; ++y)
(*ft)(img.ptr(y), cpudst.ptr(y), img.cols, 1);
cpudst.convertTo(cpudst, CV_32F);
GpuMat gpu1(img);
GpuMat gpudst;
cv::gpu::sumWindowRow(gpu1, gpudst, ksizes[i], 0);
if (CheckNorm(cpudst, gpudst) != CvTS::OK)
test_res = CvTS::FAIL_GENERIC;
}
return test_res;
}
};
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// cvtColor // cvtColor
class CV_GpuCvtColorTest : public CvTest class CV_GpuCvtColorTest : public CvTest
...@@ -501,11 +542,13 @@ void CV_GpuCvtColorTest::run( int ) ...@@ -501,11 +542,13 @@ void CV_GpuCvtColorTest::run( int )
int codes[] = { CV_BGR2RGB, CV_RGB2BGRA, CV_BGRA2RGB, int codes[] = { CV_BGR2RGB, CV_RGB2BGRA, CV_BGRA2RGB,
CV_RGB2BGR555, CV_BGR5552BGR, CV_BGR2BGR565, CV_BGR5652RGB, CV_RGB2BGR555, CV_BGR5552BGR, CV_BGR2BGR565, CV_BGR5652RGB,
CV_RGB2YCrCb, CV_YCrCb2BGR, CV_BGR2YUV, CV_YUV2RGB, CV_RGB2YCrCb, CV_YCrCb2BGR, CV_BGR2YUV, CV_YUV2RGB,
CV_RGB2XYZ, CV_XYZ2BGR, CV_BGR2XYZ, CV_XYZ2RGB,
CV_RGB2GRAY, CV_GRAY2BGRA, CV_BGRA2GRAY, CV_RGB2GRAY, CV_GRAY2BGRA, CV_BGRA2GRAY,
CV_GRAY2BGR555, CV_BGR5552GRAY, CV_GRAY2BGR565, CV_BGR5652GRAY}; CV_GRAY2BGR555, CV_BGR5552GRAY, CV_GRAY2BGR565, CV_BGR5652GRAY};
const char* codes_str[] = { "CV_BGR2RGB", "CV_RGB2BGRA", "CV_BGRA2RGB", const char* codes_str[] = { "CV_BGR2RGB", "CV_RGB2BGRA", "CV_BGRA2RGB",
"CV_RGB2BGR555", "CV_BGR5552BGR", "CV_BGR2BGR565", "CV_BGR5652RGB", "CV_RGB2BGR555", "CV_BGR5552BGR", "CV_BGR2BGR565", "CV_BGR5652RGB",
"CV_RGB2YCrCb", "CV_YCrCb2BGR", "CV_BGR2YUV", "CV_YUV2RGB", "CV_RGB2YCrCb", "CV_YCrCb2BGR", "CV_BGR2YUV", "CV_YUV2RGB",
"CV_RGB2XYZ", "CV_XYZ2BGR", "CV_BGR2XYZ", "CV_XYZ2RGB",
"CV_RGB2GRAY", "CV_GRAY2BGRA", "CV_BGRA2GRAY", "CV_RGB2GRAY", "CV_GRAY2BGRA", "CV_BGRA2GRAY",
"CV_GRAY2BGR555", "CV_BGR5552GRAY", "CV_GRAY2BGR565", "CV_BGR5652GRAY"}; "CV_GRAY2BGR555", "CV_BGR5552GRAY", "CV_GRAY2BGR565", "CV_BGR5652GRAY"};
int codes_num = sizeof(codes) / sizeof(int); int codes_num = sizeof(codes) / sizeof(int);
...@@ -554,4 +597,5 @@ CV_GpuNppImageWarpAffineTest CV_GpuNppImageWarpAffine_test; ...@@ -554,4 +597,5 @@ CV_GpuNppImageWarpAffineTest CV_GpuNppImageWarpAffine_test;
CV_GpuNppImageWarpPerspectiveTest CV_GpuNppImageWarpPerspective_test; CV_GpuNppImageWarpPerspectiveTest CV_GpuNppImageWarpPerspective_test;
CV_GpuNppImageIntegralTest CV_GpuNppImageIntegral_test; CV_GpuNppImageIntegralTest CV_GpuNppImageIntegral_test;
CV_GpuNppImageBlurTest CV_GpuNppImageBlur_test; CV_GpuNppImageBlurTest CV_GpuNppImageBlur_test;
CV_GpuCvtColorTest CV_GpuCvtColor_test; CV_GpuNppImageSumWindowTest CV_GpuNppImageSumWindow_test;
CV_GpuCvtColorTest CV_GpuCvtColor_test;
\ No newline at end of file
...@@ -69,7 +69,7 @@ protected: ...@@ -69,7 +69,7 @@ protected:
int test8UC4(const Mat& img) int test8UC4(const Mat& img)
{ {
cv::Mat img_C4; cv::Mat img_C4;
cvtColor(img, img_C4, CV_BGR2BGRA); cvtColor(img, img_C4, CV_BGR2BGRA);
return test(img_C4); return test(img_C4);
} }
...@@ -111,7 +111,7 @@ void CV_GpuNppMorphogyTest::run( int ) ...@@ -111,7 +111,7 @@ void CV_GpuNppMorphogyTest::run( int )
{ {
ts->set_failed_test_info(testResult); ts->set_failed_test_info(testResult);
return; return;
} }
} }
catch(const cv::Exception& e) catch(const cv::Exception& e)
{ {
...@@ -134,10 +134,10 @@ protected: ...@@ -134,10 +134,10 @@ protected:
virtual int test(const Mat& img) virtual int test(const Mat& img)
{ {
GpuMat kernel(Mat::ones(3, 3, CV_8U)); GpuMat kernel(Mat::ones(3, 3, CV_8U));
Point anchor(-1, -1); Point anchor(0, 0);
int iters = 3; int iters = 1;
cv::Mat cpuRes; cv::Mat cpuRes, cpuRes1;
cv::erode(img, cpuRes, kernel, anchor, iters); cv::erode(img, cpuRes, kernel, anchor, iters);
GpuMat gpuRes; GpuMat gpuRes;
...@@ -158,13 +158,13 @@ protected: ...@@ -158,13 +158,13 @@ protected:
virtual int test(const Mat& img) virtual int test(const Mat& img)
{ {
GpuMat kernel(Mat::ones(3, 3, CV_8U)); GpuMat kernel(Mat::ones(3, 3, CV_8U));
Point anchor(-1, -1); Point anchor(0, 0);
int iters = 3; int iters = 1;
cv::Mat cpuRes; cv::Mat cpuRes, cpuRes1;
cv::dilate(img, cpuRes, kernel, anchor, iters); cv::dilate(img, cpuRes, kernel, anchor, iters);
GpuMat gpuRes; GpuMat gpuRes, gpuRes1;
cv::gpu::dilate(GpuMat(img), gpuRes, kernel, anchor, iters); cv::gpu::dilate(GpuMat(img), gpuRes, kernel, anchor, iters);
return CheckNorm(cpuRes, gpuRes); return CheckNorm(cpuRes, gpuRes);
...@@ -186,8 +186,8 @@ protected: ...@@ -186,8 +186,8 @@ protected:
int num = sizeof(ops)/sizeof(ops[0]); int num = sizeof(ops)/sizeof(ops[0]);
GpuMat kernel(Mat::ones(3, 3, CV_8U)); GpuMat kernel(Mat::ones(3, 3, CV_8U));
Point anchor(-1, -1); Point anchor(0, 0);
int iters = 3; int iters = 1;
for(int i = 0; i < num; ++i) for(int i = 0; i < num; ++i)
{ {
......
...@@ -83,8 +83,6 @@ void CV_GpuMatOpConvertToTest::run(int /* start_from */) ...@@ -83,8 +83,6 @@ void CV_GpuMatOpConvertToTest::run(int /* start_from */)
const int dst_type = types[j]; const int dst_type = types[j];
cv::RNG rng(*ts->get_rng()); cv::RNG rng(*ts->get_rng());
const double alpha = rng.uniform(0.0, 2.0);
const double beta = rng.uniform(-75.0, 75.0);
Mat cpumatsrc(img_size, src_type); Mat cpumatsrc(img_size, src_type);
rng.fill(cpumatsrc, RNG::UNIFORM, Scalar::all(0), Scalar::all(300)); rng.fill(cpumatsrc, RNG::UNIFORM, Scalar::all(0), Scalar::all(300));
...@@ -93,8 +91,8 @@ void CV_GpuMatOpConvertToTest::run(int /* start_from */) ...@@ -93,8 +91,8 @@ void CV_GpuMatOpConvertToTest::run(int /* start_from */)
Mat cpumatdst; Mat cpumatdst;
GpuMat gpumatdst; GpuMat gpumatdst;
cpumatsrc.convertTo(cpumatdst, dst_type, alpha, beta); cpumatsrc.convertTo(cpumatdst, dst_type);
gpumatsrc.convertTo(gpumatdst, dst_type, alpha, beta); gpumatsrc.convertTo(gpumatdst, dst_type);
double r = norm(cpumatdst, gpumatdst, NORM_INF); double r = norm(cpumatdst, gpumatdst, NORM_INF);
if (r > 1) if (r > 1)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment