From b32fbe72f6f619c074f504e70e52e8bc5efdc984 Mon Sep 17 00:00:00 2001 From: vbystricky Date: Thu, 19 Jun 2014 17:07:09 +0400 Subject: [PATCH] Add peromance tests for OCL integral sum of square --- modules/imgproc/perf/opencl/perf_imgproc.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/modules/imgproc/perf/opencl/perf_imgproc.cpp b/modules/imgproc/perf/opencl/perf_imgproc.cpp index 7144987..2d9e20b 100644 --- a/modules/imgproc/perf/opencl/perf_imgproc.cpp +++ b/modules/imgproc/perf/opencl/perf_imgproc.cpp @@ -234,6 +234,23 @@ OCL_PERF_TEST_P(IntegralFixture, Integral1, ::testing::Combine(OCL_TEST_SIZES, O SANITY_CHECK(dst, 1e-6, ERROR_RELATIVE); } +OCL_PERF_TEST_P(IntegralFixture, Integral2, ::testing::Combine(OCL_TEST_SIZES, OCL_PERF_ENUM(CV_32S, CV_32F))) +{ + const IntegralParams params = GetParam(); + const Size srcSize = get<0>(params); + const int ddepth = get<1>(params); + + checkDeviceMaxMemoryAllocSize(srcSize, ddepth); + + UMat src(srcSize, CV_8UC1), sum(srcSize + Size(1, 1), ddepth), sqsum(srcSize + Size(1, 1), ddepth); + declare.in(src, WARMUP_RNG).out(sum).out(sqsum); + + OCL_TEST_CYCLE() cv::integral(src, sum, sqsum, ddepth, ddepth); + + SANITY_CHECK(sum, 2e-6, ERROR_RELATIVE); + SANITY_CHECK(sqsum, 2e-6, ERROR_RELATIVE); +} + ///////////// Threshold //////////////////////// CV_ENUM(ThreshType, THRESH_BINARY, THRESH_BINARY_INV, THRESH_TRUNC, THRESH_TOZERO_INV) -- 2.7.4