Commit 60a4e81a authored by Andrey Morozov's avatar Andrey Morozov

small modifications in tests

parent edd68e58
...@@ -19,7 +19,7 @@ class CV_GpuMatOpConvertTo : public CvTest ...@@ -19,7 +19,7 @@ class CV_GpuMatOpConvertTo : public CvTest
void run(int); void run(int);
}; };
CV_GpuMatOpConvertTo::CV_GpuMatOpConvertTo(): CvTest( "GpuMatOperatorConvertTo", "convertTo" ) {} CV_GpuMatOpConvertTo::CV_GpuMatOpConvertTo(): CvTest( "GPU-MatOperatorConvertTo", "convertTo" ) {}
CV_GpuMatOpConvertTo::~CV_GpuMatOpConvertTo() {} CV_GpuMatOpConvertTo::~CV_GpuMatOpConvertTo() {}
void CV_GpuMatOpConvertTo::run( int /* start_from */) void CV_GpuMatOpConvertTo::run( int /* start_from */)
...@@ -44,12 +44,16 @@ void CV_GpuMatOpConvertTo::run( int /* start_from */) ...@@ -44,12 +44,16 @@ void CV_GpuMatOpConvertTo::run( int /* start_from */)
const double alpha = (double)rand() / RAND_MAX * 10.0; const double alpha = (double)rand() / RAND_MAX * 10.0;
const double beta = (double)rand() / RAND_MAX * 10.0; const double beta = (double)rand() / RAND_MAX * 10.0;
Mat cpumatsrc(img_size, src_type); cv::RNG rng(*ts->get_rng());
randu(cpumatsrc, Scalar::all(0), Scalar::all(10));
Mat cpumatsrc(img_size, src_type);
rng.fill(cpumatsrc, RNG::UNIFORM, Scalar::all(0), Scalar::all(10));
GpuMat gpumatsrc(cpumatsrc); GpuMat gpumatsrc(cpumatsrc);
Mat cpumatdst; Mat cpumatdst;
GpuMat gpumatdst; GpuMat gpumatdst;
cpumatsrc.convertTo(cpumatdst, dst_type, alpha, beta); cpumatsrc.convertTo(cpumatdst, dst_type, alpha, beta);
try try
...@@ -65,7 +69,7 @@ void CV_GpuMatOpConvertTo::run( int /* start_from */) ...@@ -65,7 +69,7 @@ void CV_GpuMatOpConvertTo::run( int /* start_from */)
double r = norm(cpumatdst, gpumatdst, NORM_INF); double r = norm(cpumatdst, gpumatdst, NORM_INF);
if (r > 1) if (r > 1)
{ {
cout << "FAILED: " << "SRC_TYPE=" << types_str[i] << "C" << c << " DST_TYPE=" << types_str[j] << " NORM = " << r << endl; cout << "FAILED: " << "SRC_TYPE=" << types_str[i] << "C" << c << " DST_TYPE=" << types_str[j] << " NORM = " << r << endl;
passed = false; passed = false;
......
...@@ -32,7 +32,7 @@ class CV_GpuMatOpCopyTo : public CvTest ...@@ -32,7 +32,7 @@ class CV_GpuMatOpCopyTo : public CvTest
int cols; int cols;
}; };
CV_GpuMatOpCopyTo::CV_GpuMatOpCopyTo(): CvTest( "GpuMatOperatorCopyTo", "copyTo" ) CV_GpuMatOpCopyTo::CV_GpuMatOpCopyTo(): CvTest( "GPU-MatOperatorCopyTo", "copyTo" )
{ {
rows = 234; rows = 234;
cols = 123; cols = 123;
...@@ -54,8 +54,13 @@ bool CV_GpuMatOpCopyTo::compare_matrix(cv::Mat & cpumat, gpu::GpuMat & gpumat) ...@@ -54,8 +54,13 @@ bool CV_GpuMatOpCopyTo::compare_matrix(cv::Mat & cpumat, gpu::GpuMat & gpumat)
GpuMat gmat(cmat); GpuMat gmat(cmat);
Mat cpumask(cpumat.size(), CV_8U); Mat cpumask(cpumat.size(), CV_8U);
randu(cpumask, Scalar::all(0), Scalar::all(127));
cv::RNG rng(*ts->get_rng());
rng.fill(cpumask, RNG::NORMAL, Scalar::all(0), Scalar::all(127));
threshold(cpumask, cpumask, 0, 127, THRESH_BINARY); threshold(cpumask, cpumask, 0, 127, THRESH_BINARY);
GpuMat gpumask(cpumask); GpuMat gpumask(cpumask);
//int64 time = getTickCount(); //int64 time = getTickCount();
......
...@@ -30,7 +30,7 @@ class CV_GpuMatOpSetTo : public CvTest ...@@ -30,7 +30,7 @@ class CV_GpuMatOpSetTo : public CvTest
Scalar s; Scalar s;
}; };
CV_GpuMatOpSetTo::CV_GpuMatOpSetTo(): CvTest( "GpuMatOperatorSetTo", "setTo" ) CV_GpuMatOpSetTo::CV_GpuMatOpSetTo(): CvTest( "GPU-MatOperatorSetTo", "setTo" )
{ {
rows = 256; rows = 256;
cols = 124; cols = 124;
......
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