Fix for Bug4243. Made changes relating to non OpenCL devices

pull/3932/head
Nisarg Thakkar 10 years ago
parent a0bc0ab7cb
commit 00094a8792
  1. 16
      modules/imgproc/src/morph.cpp

@ -1823,19 +1823,13 @@ void cv::morphologyEx( InputArray _src, OutputArray _dst, int op,
InputArray _kernel, Point anchor, int iterations,
int borderType, const Scalar& borderValue )
{
#ifdef HAVE_OPENCL
Size ksize = _kernel.size();
Mat tempKernel;
if (ksize.height==0 || ksize.width==0)
{
tempKernel = getStructuringElement(MORPH_RECT, Size(3,3), Point(1,1));
ksize = tempKernel.size();
}
else
Mat kernel = _kernel.getMat();
if (kernel.empty())
{
tempKernel = _kernel.getMat();
kernel = getStructuringElement(MORPH_RECT, Size(3,3), Point(1,1));
}
InputArray kernel = InputArray(tempKernel);
#ifdef HAVE_OPENCL
Size ksize = kernel.size();
anchor = normalizeAnchor(anchor, ksize);
CV_OCL_RUN(_dst.isUMat() && _src.dims() <= 2 && _src.channels() <= 4 &&

Loading…
Cancel
Save