From 8dfde47f89dbd3f8a9db06b1680f2fe8a7ff1357 Mon Sep 17 00:00:00 2001 From: Ilya Lavrenov Date: Wed, 30 Oct 2013 16:04:48 +0400 Subject: [PATCH] changed eps in ocl::GaussianBlur test --- modules/ocl/src/filtering.cpp | 18 +++++++++--------- modules/ocl/test/test_filters.cpp | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/ocl/src/filtering.cpp b/modules/ocl/src/filtering.cpp index 4a04e2d..902f2d2 100644 --- a/modules/ocl/src/filtering.cpp +++ b/modules/ocl/src/filtering.cpp @@ -1329,6 +1329,15 @@ Ptr cv::ocl::createGaussianFilter_GPU(int type, Size ksize, do void cv::ocl::GaussianBlur(const oclMat &src, oclMat &dst, Size ksize, double sigma1, double sigma2, int bordertype) { + if (bordertype != BORDER_CONSTANT) + { + if (src.rows == 1) + ksize.height = 1; + + if (src.cols == 1) + ksize.width = 1; + } + if (ksize.width == 1 && ksize.height == 1) { src.copyTo(dst); @@ -1351,15 +1360,6 @@ void cv::ocl::GaussianBlur(const oclMat &src, oclMat &dst, Size ksize, double si dst.create(src.size(), src.type()); - if (bordertype != BORDER_CONSTANT) - { - if (src.rows == 1) - ksize.height = 1; - - if (src.cols == 1) - ksize.width = 1; - } - Ptr f = createGaussianFilter_GPU(src.type(), ksize, sigma1, sigma2, bordertype); f->apply(src, dst); } diff --git a/modules/ocl/test/test_filters.cpp b/modules/ocl/test/test_filters.cpp index a8583b2..30487e7 100644 --- a/modules/ocl/test/test_filters.cpp +++ b/modules/ocl/test/test_filters.cpp @@ -272,7 +272,7 @@ OCL_TEST_P(GaussianBlurTest, Mat) GaussianBlur(src_roi, dst_roi, Size(ksize, ksize), sigma1, sigma2, borderType); ocl::GaussianBlur(gsrc_roi, gdst_roi, Size(ksize, ksize), sigma1, sigma2, borderType); - Near(); + Near(CV_MAT_DEPTH(type) == CV_8U ? 3 : 1e-6, false); } } -- 2.7.4