From: Ilya Lavrenov Date: Mon, 28 Oct 2013 12:46:41 +0000 (+0400) Subject: fixed OpenCL morph operations for case when kernel does not have zero element X-Git-Tag: accepted/tizen/ivi/20140515.103456~1^2~332^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=58be2546ca6ba3e00ab7f008069f70ff984ba3bd;p=profile%2Fivi%2Fopencv.git fixed OpenCL morph operations for case when kernel does not have zero element --- diff --git a/modules/ocl/src/filtering.cpp b/modules/ocl/src/filtering.cpp index 954d1d5..4a04e2d 100644 --- a/modules/ocl/src/filtering.cpp +++ b/modules/ocl/src/filtering.cpp @@ -416,8 +416,8 @@ void morphOp(int op, const oclMat &src, oclMat &dst, const Mat &_kernel, Point a else if (iterations > 1 && countNonZero(_kernel) == _kernel.rows * _kernel.cols) { anchor = Point(anchor.x * iterations, anchor.y * iterations); - kernel = getStructuringElement(MORPH_RECT, Size(ksize.width + iterations * (ksize.width - 1), - ksize.height + iterations * (ksize.height - 1)), anchor); + kernel = getStructuringElement(MORPH_RECT, Size(ksize.width + (iterations - 1) * (ksize.width - 1), + ksize.height + (iterations - 1) * (ksize.height - 1)), anchor); iterations = 1; } else