Commit f12702be authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

fixed bugs in rectangular morphology case

parent 771feb61
...@@ -1182,6 +1182,7 @@ static bool IPPMorphReplicate(int op, const Mat &src, Mat &dst, const Mat &kerne ...@@ -1182,6 +1182,7 @@ static bool IPPMorphReplicate(int op, const Mat &src, Mat &dst, const Mat &kerne
default: default:
return false; return false;
} }
#undef IPP_MORPH_CASE
IppiSize roiSize = {src.cols, src.rows}; IppiSize roiSize = {src.cols, src.rows};
IppiSize kernelSize = {ksize.width, ksize.height}; IppiSize kernelSize = {ksize.width, ksize.height};
...@@ -1206,7 +1207,7 @@ static bool IPPMorphReplicate(int op, const Mat &src, Mat &dst, const Mat &kerne ...@@ -1206,7 +1207,7 @@ static bool IPPMorphReplicate(int op, const Mat &src, Mat &dst, const Mat &kerne
AutoBuffer<uchar> buf(bufSize + 64); AutoBuffer<uchar> buf(bufSize + 64);
uchar* buffer = alignPtr((uchar*)buf, 32); uchar* buffer = alignPtr((uchar*)buf, 32);
return morphRectFunc(_src->data, (int)_src->step[0], dst.data, (int)dst.step[0], return morphRectFunc(_src->data, (int)_src->step[0], dst.data, (int)dst.step[0],
roiSize, kernelSize, point, buffer); roiSize, kernelSize, point, buffer) >= 0;
} }
return false; return false;
} }
...@@ -1268,7 +1269,7 @@ static bool IPPMorphOp(int op, InputArray _src, OutputArray _dst, ...@@ -1268,7 +1269,7 @@ static bool IPPMorphOp(int op, InputArray _src, OutputArray _dst,
rectKernel = true; rectKernel = true;
iterations = 1; iterations = 1;
} }
else if( iterations > 1 && countNonZero(kernel) == kernel.rows*kernel.cols ) else if( iterations >= 1 && countNonZero(kernel) == kernel.rows*kernel.cols )
{ {
ksize = Size(ksize.width + (iterations-1)*(ksize.width-1), ksize = Size(ksize.width + (iterations-1)*(ksize.width-1),
ksize.height + (iterations-1)*(ksize.height-1)), ksize.height + (iterations-1)*(ksize.height-1)),
...@@ -1475,7 +1476,7 @@ static void convertConvKernel( const IplConvKernel* src, cv::Mat& dst, cv::Point ...@@ -1475,7 +1476,7 @@ static void convertConvKernel( const IplConvKernel* src, cv::Mat& dst, cv::Point
int i, size = src->nRows*src->nCols; int i, size = src->nRows*src->nCols;
for( i = 0; i < size; i++ ) for( i = 0; i < size; i++ )
dst.data[i] = (uchar)src->values[i]; dst.data[i] = (uchar)(src->values[i] != 0);
} }
......
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