From 11a0e3ff783e986bb340e91dcb29779835c6d4ee Mon Sep 17 00:00:00 2001 From: vbystricky Date: Thu, 31 Jul 2014 17:29:06 +0400 Subject: [PATCH 1/2] Fix error in OCL minmaxloc --- modules/core/src/opencl/minmaxloc.cl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/core/src/opencl/minmaxloc.cl b/modules/core/src/opencl/minmaxloc.cl index 664673e5a2..1d84567ef9 100644 --- a/modules/core/src/opencl/minmaxloc.cl +++ b/modules/core/src/opencl/minmaxloc.cl @@ -209,7 +209,7 @@ __kernel void minmaxloc(__global const uchar * srcptr, int src_step, int src_off #if kercn == 1 #ifdef NEED_MINVAL -#if NEED_MINLOC +#ifdef NEED_MINLOC if (minval > temp) { minval = temp; @@ -326,7 +326,7 @@ __kernel void minmaxloc(__global const uchar * srcptr, int src_step, int src_off int lid2 = lsize + lid; #ifdef NEED_MINVAL -#ifdef NEED_MAXLOC +#ifdef NEED_MINLOC if (localmem_min[lid] >= localmem_min[lid2]) { if (localmem_min[lid] == localmem_min[lid2]) From b48e487d53072d0855de0a265479c2c856b80443 Mon Sep 17 00:00:00 2001 From: vbystricky Date: Thu, 31 Jul 2014 19:12:10 +0400 Subject: [PATCH 2/2] Enable ocl version of minmaxloc with mask --- modules/core/src/stat.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/core/src/stat.cpp b/modules/core/src/stat.cpp index 76aec13db5..a0fde76509 100644 --- a/modules/core/src/stat.cpp +++ b/modules/core/src/stat.cpp @@ -1452,7 +1452,7 @@ static bool ocl_minMaxIdx( InputArray _src, double* minVal, double* maxVal, int* CV_Assert(!haveSrc2 || _src2.type() == type); - if (depth == CV_32S || depth == CV_32F || !_mask.empty()) + if (depth == CV_32S || depth == CV_32F) return false; if ((depth == CV_64F || ddepth == CV_64F) && !doubleSupport)