From af6134b4b6d08d2ee2e1910d69f7948325a15d34 Mon Sep 17 00:00:00 2001 From: Vladimir Bystricky Date: Thu, 5 Dec 2013 14:25:15 +0400 Subject: [PATCH] Fix issue in boxFilter with destination depth not equal to source depth. --- modules/imgproc/src/smooth.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/imgproc/src/smooth.cpp b/modules/imgproc/src/smooth.cpp index c310688..6478031 100644 --- a/modules/imgproc/src/smooth.cpp +++ b/modules/imgproc/src/smooth.cpp @@ -622,12 +622,14 @@ static bool ocl_boxFilter( InputArray _src, OutputArray _dst, int ddepth, return false;//TODO int sdepth = CV_MAT_DEPTH(type); + if( ddepth < 0 ) + ddepth = sdepth; + else if (ddepth != sdepth) + return false; if( anchor.x < 0 ) anchor.x = ksize.width / 2; if( anchor.y < 0 ) anchor.y = ksize.height / 2; - if( ddepth < 0 ) - ddepth = sdepth; ocl::Kernel kernel; -- 2.7.4