From 7999fbf7652a944b975bac1a3122f7288c0bc083 Mon Sep 17 00:00:00 2001 From: Elena Gvozdeva Date: Tue, 5 Aug 2014 11:55:18 +0400 Subject: [PATCH] fixed ocl_integral --- modules/imgproc/src/opencl/integral_sum.cl | 7 +++++-- modules/imgproc/test/ocl/test_imgproc.cpp | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/imgproc/src/opencl/integral_sum.cl b/modules/imgproc/src/opencl/integral_sum.cl index 49a3bde..3c51c1a 100644 --- a/modules/imgproc/src/opencl/integral_sum.cl +++ b/modules/imgproc/src/opencl/integral_sum.cl @@ -132,8 +132,11 @@ kernel void integral_sum_rows(__global const uchar *buf_ptr, int buf_step, int b } dst_sq_offset += dst_sq_step; - dst_sq = (__global sumSQT *)(dst_sq_ptr + mad24(x, dst_sq_step, dst_sq_offset)); - dst_sq[0] = 0; + if (x < rows - 1) + { + dst_sq = (__global sumSQT *)(dst_sq_ptr + mad24(x, dst_sq_step, dst_sq_offset)); + dst_sq[0] = 0; + } int buf_sq_index = mad24((int)sizeof(sumSQT), x, buf_sq_offset); sumSQT accum_sq = 0; diff --git a/modules/imgproc/test/ocl/test_imgproc.cpp b/modules/imgproc/test/ocl/test_imgproc.cpp index 69d8f4e..ad8e26c 100644 --- a/modules/imgproc/test/ocl/test_imgproc.cpp +++ b/modules/imgproc/test/ocl/test_imgproc.cpp @@ -347,7 +347,7 @@ OCL_TEST_P(Integral, Mat2) OCL_ON(cv::integral(usrc_roi, udst_roi, udst2_roi, sdepth, sqdepth)); Near(); - sqdepth == CV_32F ? Near2(2e-4, true) : Near2(); + sqdepth == CV_32F ? Near2(1e-6, true) : Near2(); } } -- 2.7.4