From 52ca0c4bcaea4d834ddde5fcd1fa4199f66a7ce1 Mon Sep 17 00:00:00 2001 From: Alexey Spizhevoy Date: Thu, 23 Dec 2010 10:07:37 +0000 Subject: [PATCH] fixed bug in gpu::dft --- modules/gpu/src/imgproc_gpu.cpp | 2 +- tests/gpu/src/dft_routines.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/gpu/src/imgproc_gpu.cpp b/modules/gpu/src/imgproc_gpu.cpp index 407e948ef9..1a2b48f13f 100644 --- a/modules/gpu/src/imgproc_gpu.cpp +++ b/modules/gpu/src/imgproc_gpu.cpp @@ -1155,7 +1155,7 @@ void cv::gpu::dft(const GpuMat& src, GpuMat& dst, int flags, int nonZeroRows, bo // Make sure here we work with the continuous input, // as CUFFT can't handle gaps if (src.isContinuous()) - src_aux = src; + src_data = src_aux = src; else { src_data = GpuMat(1, src.size().area(), src.type()); diff --git a/tests/gpu/src/dft_routines.cpp b/tests/gpu/src/dft_routines.cpp index 41ffedcdbf..6ed35eb6f0 100644 --- a/tests/gpu/src/dft_routines.cpp +++ b/tests/gpu/src/dft_routines.cpp @@ -246,7 +246,7 @@ struct CV_GpuDftTest: CvTest testR2CThenC2R(1, rows, "single col"); testR2CThenC2R(1, rows + 1, "single col 1"); testR2CThenC2R(cols, 1, "single row" );; - testR2CThenC2R(cols + 1, 1, "single row 1" );; + testR2CThenC2R(cols + 1, 1, "single row 1" ); } catch (const Exception& e) { @@ -258,7 +258,7 @@ struct CV_GpuDftTest: CvTest void gen(int cols, int rows, int cn, Mat& mat) { - RNG rng; + RNG rng(1); mat.create(rows, cols, CV_MAKETYPE(CV_32F, cn)); rng.fill(mat, RNG::UNIFORM, Scalar::all(0.f), Scalar::all(10.f)); } @@ -324,7 +324,7 @@ struct CV_GpuDftTest: CvTest ts->set_failed_test_info(CvTS::FAIL_INVALID_OUTPUT); ok = false; } - if (ok) ok = cmp(b_gold, Mat(d_b), rows * cols * 1e-5f); + if (ok) ok = cmp(b_gold, Mat(d_b), rows * cols * 1e-4f); if (!ok) ts->printf(CvTS::CONSOLE, "testC2C failed: hint=%s, cols=%d, rows=%d, flags=%d\n", hint.c_str(), cols, rows, flags); }