From 6b0e63b652db2a60b6858df86cd8cc898a01c214 Mon Sep 17 00:00:00 2001 From: Alexander Karsakov Date: Mon, 11 Aug 2014 15:37:05 +0400 Subject: [PATCH 1/3] Enabled IPPMorphReplicate in case BORDER_CONSTANT only for 3x3 kernels. --- modules/imgproc/src/morph.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/imgproc/src/morph.cpp b/modules/imgproc/src/morph.cpp index 8985a7f06..ceccff43a 100644 --- a/modules/imgproc/src/morph.cpp +++ b/modules/imgproc/src/morph.cpp @@ -1268,10 +1268,11 @@ static bool IPPMorphOp(int op, InputArray _src, OutputArray _dst, int type = src.type(), depth = CV_MAT_DEPTH(type), cn = CV_MAT_CN(type); if( !( depth == CV_8U || depth == CV_32F ) || !(cn == 1 || cn == 3 || cn == 4) || - !( borderType == cv::BORDER_REPLICATE || (borderType == cv::BORDER_CONSTANT && borderValue == morphologyDefaultBorderValue()) ) - || !( op == MORPH_DILATE || op == MORPH_ERODE) || _src.isSubmatrix() ) + !( borderType == cv::BORDER_REPLICATE || (borderType == cv::BORDER_CONSTANT && borderValue == morphologyDefaultBorderValue() && + kernel.size() == Size(3,3)) ) || !( op == MORPH_DILATE || op == MORPH_ERODE) || _src.isSubmatrix() ) return false; + // In case BORDER_CONSTANT, IPPMorphReplicate works correct with kernels of size 3*3 only if( borderType == cv::BORDER_CONSTANT && kernel.data ) { int x, y; From 835b5e217964f94a1075e11acfc26220a4e63525 Mon Sep 17 00:00:00 2001 From: Alexander Karsakov Date: Mon, 11 Aug 2014 15:40:44 +0400 Subject: [PATCH 2/3] Disabled ippiConvert_32f16s_C1R since it breaks OCL accuracy tests of remap with test_loop_times=30. --- modules/core/src/convert.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/core/src/convert.cpp b/modules/core/src/convert.cpp index fc29b2e1f..5b0a48588 100644 --- a/modules/core/src/convert.cpp +++ b/modules/core/src/convert.cpp @@ -1619,7 +1619,7 @@ DEF_CVT_FUNC_F(8u16s, uchar, short, 8u16s_C1R) DEF_CVT_FUNC_F(8s16s, schar, short, 8s16s_C1R) DEF_CVT_FUNC_F2(16u16s, ushort, short, 16u16s_C1RSfs) DEF_CVT_FUNC_F2(32s16s, int, short, 32s16s_C1RSfs) -DEF_CVT_FUNC_F2(32f16s, float, short, 32f16s_C1RSfs) +DEF_CVT_FUNC(32f16s, float, short) DEF_CVT_FUNC(64f16s, double, short) DEF_CVT_FUNC_F(8u32s, uchar, int, 8u32s_C1R) From 498da24b8b43412cc0beb6ac2877d7222544dc21 Mon Sep 17 00:00:00 2001 From: Alexander Karsakov Date: Mon, 11 Aug 2014 15:46:27 +0400 Subject: [PATCH 3/3] Disabled some IPP calls of cvtColor since it breaks OCL accuracy tests with test_loop_times=30 --- modules/imgproc/src/color.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/modules/imgproc/src/color.cpp b/modules/imgproc/src/color.cpp index db5bcd35f..71f163bba 100644 --- a/modules/imgproc/src/color.cpp +++ b/modules/imgproc/src/color.cpp @@ -3381,18 +3381,16 @@ void cv::cvtColor( InputArray _src, OutputArray _dst, int code, int dcn ) _dst.create(sz, CV_8UC2); dst = _dst.getMat(); -#ifdef HAVE_IPP +#if defined(HAVE_IPP) && 0 // breaks OCL accuracy tests CV_SUPPRESS_DEPRECATED_START -#if 0 + if (code == CV_BGR2BGR565 && scn == 3) { if (CvtColorIPPLoop(src, dst, IPPGeneralFunctor((ippiGeneralFunc)ippiBGRToBGR565_8u16u_C3R))) return; setIppErrorStatus(); } - else -#endif - if (code == CV_BGRA2BGR565 && scn == 4) + else if (code == CV_BGRA2BGR565 && scn == 4) { if (CvtColorIPPLoopCopy(src, dst, IPPReorderGeneralFunctor(ippiSwapChannelsC4C3RTab[depth], @@ -3787,6 +3785,7 @@ void cv::cvtColor( InputArray _src, OutputArray _dst, int code, int dcn ) #if defined (HAVE_IPP) && (IPP_VERSION_MAJOR >= 7) if( depth == CV_8U || depth == CV_16U ) { +#if 0 // breaks OCL accuracy tests if( code == CV_BGR2HSV_FULL && scn == 3 ) { if( CvtColorIPPLoopCopy(src, dst, IPPReorderGeneralFunctor(ippiSwapChannelsC3RTab[depth], ippiRGB2HSVTab[depth], 2, 1, 0, depth)) ) @@ -3799,17 +3798,18 @@ void cv::cvtColor( InputArray _src, OutputArray _dst, int code, int dcn ) return; setIppErrorStatus(); } - else if( code == CV_RGB2HSV_FULL && scn == 3 && depth == CV_16U ) - { - if( CvtColorIPPLoopCopy(src, dst, IPPGeneralFunctor(ippiRGB2HSVTab[depth])) ) - return; - setIppErrorStatus(); - } else if( code == CV_RGB2HSV_FULL && scn == 4 ) { if( CvtColorIPPLoop(src, dst, IPPReorderGeneralFunctor(ippiSwapChannelsC4C3RTab[depth], ippiRGB2HSVTab[depth], 0, 1, 2, depth)) ) return; setIppErrorStatus(); + } else +#endif + if( code == CV_RGB2HSV_FULL && scn == 3 && depth == CV_16U ) + { + if( CvtColorIPPLoopCopy(src, dst, IPPGeneralFunctor(ippiRGB2HSVTab[depth])) ) + return; + setIppErrorStatus(); } else if( code == CV_BGR2HLS_FULL && scn == 3 ) {