fixed OpenCL morph operations for case when kernel does not have zero element
This commit is contained in:
parent
b10e1e5c7e
commit
58be2546ca
@ -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)
|
else if (iterations > 1 && countNonZero(_kernel) == _kernel.rows * _kernel.cols)
|
||||||
{
|
{
|
||||||
anchor = Point(anchor.x * iterations, anchor.y * iterations);
|
anchor = Point(anchor.x * iterations, anchor.y * iterations);
|
||||||
kernel = getStructuringElement(MORPH_RECT, Size(ksize.width + iterations * (ksize.width - 1),
|
kernel = getStructuringElement(MORPH_RECT, Size(ksize.width + (iterations - 1) * (ksize.width - 1),
|
||||||
ksize.height + iterations * (ksize.height - 1)), anchor);
|
ksize.height + (iterations - 1) * (ksize.height - 1)), anchor);
|
||||||
iterations = 1;
|
iterations = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user