Commit 68c916aa authored by Andrey Pavlenko's avatar Andrey Pavlenko Committed by OpenCV Buildbot

Merge pull request #1719 from ilya-lavrenov:ocl_gaussianBlur

parents 089cf423 8dfde47f
...@@ -1369,6 +1369,15 @@ Ptr<FilterEngine_GPU> cv::ocl::createGaussianFilter_GPU(int type, Size ksize, do ...@@ -1369,6 +1369,15 @@ Ptr<FilterEngine_GPU> 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) 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) if (ksize.width == 1 && ksize.height == 1)
{ {
src.copyTo(dst); src.copyTo(dst);
...@@ -1391,15 +1400,6 @@ void cv::ocl::GaussianBlur(const oclMat &src, oclMat &dst, Size ksize, double si ...@@ -1391,15 +1400,6 @@ void cv::ocl::GaussianBlur(const oclMat &src, oclMat &dst, Size ksize, double si
dst.create(src.size(), src.type()); 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<FilterEngine_GPU> f = createGaussianFilter_GPU(src.type(), ksize, sigma1, sigma2, bordertype); Ptr<FilterEngine_GPU> f = createGaussianFilter_GPU(src.type(), ksize, sigma1, sigma2, bordertype);
f->apply(src, dst); f->apply(src, dst);
} }
......
...@@ -272,7 +272,7 @@ OCL_TEST_P(GaussianBlurTest, Mat) ...@@ -272,7 +272,7 @@ OCL_TEST_P(GaussianBlurTest, Mat)
GaussianBlur(src_roi, dst_roi, Size(ksize, ksize), sigma1, sigma2, borderType); GaussianBlur(src_roi, dst_roi, Size(ksize, ksize), sigma1, sigma2, borderType);
ocl::GaussianBlur(gsrc_roi, gdst_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);
} }
} }
......
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