small modifications in tests

This commit is contained in:
Andrey Morozov 2010-07-23 07:58:03 +00:00
parent edd68e588b
commit 60a4e81a12
3 changed files with 17 additions and 8 deletions

View File

@ -19,7 +19,7 @@ class CV_GpuMatOpConvertTo : public CvTest
void run(int);
};
CV_GpuMatOpConvertTo::CV_GpuMatOpConvertTo(): CvTest( "GpuMatOperatorConvertTo", "convertTo" ) {}
CV_GpuMatOpConvertTo::CV_GpuMatOpConvertTo(): CvTest( "GPU-MatOperatorConvertTo", "convertTo" ) {}
CV_GpuMatOpConvertTo::~CV_GpuMatOpConvertTo() {}
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 beta = (double)rand() / RAND_MAX * 10.0;
Mat cpumatsrc(img_size, src_type);
randu(cpumatsrc, Scalar::all(0), Scalar::all(10));
cv::RNG rng(*ts->get_rng());
Mat cpumatsrc(img_size, src_type);
rng.fill(cpumatsrc, RNG::UNIFORM, Scalar::all(0), Scalar::all(10));
GpuMat gpumatsrc(cpumatsrc);
Mat cpumatdst;
GpuMat gpumatdst;
cpumatsrc.convertTo(cpumatdst, dst_type, alpha, beta);
try
@ -65,7 +69,7 @@ void CV_GpuMatOpConvertTo::run( int /* start_from */)
double r = norm(cpumatdst, gpumatdst, NORM_INF);
if (r > 1)
{
{
cout << "FAILED: " << "SRC_TYPE=" << types_str[i] << "C" << c << " DST_TYPE=" << types_str[j] << " NORM = " << r << endl;
passed = false;

View File

@ -32,7 +32,7 @@ class CV_GpuMatOpCopyTo : public CvTest
int cols;
};
CV_GpuMatOpCopyTo::CV_GpuMatOpCopyTo(): CvTest( "GpuMatOperatorCopyTo", "copyTo" )
CV_GpuMatOpCopyTo::CV_GpuMatOpCopyTo(): CvTest( "GPU-MatOperatorCopyTo", "copyTo" )
{
rows = 234;
cols = 123;
@ -54,8 +54,13 @@ bool CV_GpuMatOpCopyTo::compare_matrix(cv::Mat & cpumat, gpu::GpuMat & gpumat)
GpuMat gmat(cmat);
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);
GpuMat gpumask(cpumask);
//int64 time = getTickCount();

View File

@ -30,7 +30,7 @@ class CV_GpuMatOpSetTo : public CvTest
Scalar s;
};
CV_GpuMatOpSetTo::CV_GpuMatOpSetTo(): CvTest( "GpuMatOperatorSetTo", "setTo" )
CV_GpuMatOpSetTo::CV_GpuMatOpSetTo(): CvTest( "GPU-MatOperatorSetTo", "setTo" )
{
rows = 256;
cols = 124;