From 76e403cf251ad65ba9f7dc11381074f6993fdb81 Mon Sep 17 00:00:00 2001 From: Everton Constantino Date: Wed, 4 Sep 2019 13:14:00 -0300 Subject: [PATCH] Merge pull request #15440 from everton1984:new_integral_tests * Adding all possible data type interactions to the perf tests since some use SIMD acceleration and others do not. * Disabling full tests by default. * Giving proper names, removing magic numbers and sanity checks of new performance tests for the integral function. * Giving proper names, making array static. --- modules/imgproc/perf/perf_integral.cpp | 41 ++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/modules/imgproc/perf/perf_integral.cpp b/modules/imgproc/perf/perf_integral.cpp index 85a426efc9..59a5060937 100644 --- a/modules/imgproc/perf/perf_integral.cpp +++ b/modules/imgproc/perf/perf_integral.cpp @@ -5,9 +5,24 @@ namespace opencv_test { +enum PerfSqMatDepth{ + DEPTH_32S_32S = 0, + DEPTH_32S_32F, + DEPTH_32S_64F, + DEPTH_32F_32F, + DEPTH_32F_64F, + DEPTH_64F_64F}; + +CV_ENUM(IntegralOutputDepths, DEPTH_32S_32S, DEPTH_32S_32F, DEPTH_32S_64F, DEPTH_32F_32F, DEPTH_32F_64F, DEPTH_64F_64F); + +static int extraOutputDepths[6][2] = {{CV_32S, CV_32S}, {CV_32S, CV_32F}, {CV_32S, CV_64F}, {CV_32F, CV_32F}, {CV_32F, CV_64F}, {CV_64F, CV_64F}}; + typedef tuple Size_MatType_OutMatDepth_t; typedef perf::TestBaseWithParam Size_MatType_OutMatDepth; +typedef tuple Size_MatType_OutMatDepthArray_t; +typedef perf::TestBaseWithParam Size_MatType_OutMatDepthArray; + PERF_TEST_P(Size_MatType_OutMatDepth, integral, testing::Combine( testing::Values(TYPICAL_MAT_SIZES), @@ -55,6 +70,32 @@ PERF_TEST_P(Size_MatType_OutMatDepth, integral_sqsum, SANITY_CHECK(sqsum, 1e-6); } +PERF_TEST_P(Size_MatType_OutMatDepthArray, DISABLED_integral_sqsum_full, + testing::Combine( + testing::Values(TYPICAL_MAT_SIZES), + testing::Values(CV_8UC1, CV_8UC2, CV_8UC3, CV_8UC4), + testing::Values(DEPTH_32S_32S, DEPTH_32S_32F, DEPTH_32S_64F, DEPTH_32F_32F, DEPTH_32F_64F, DEPTH_64F_64F) + ) + ) +{ + Size sz = get<0>(GetParam()); + int matType = get<1>(GetParam()); + int *outputDepths = (int *)extraOutputDepths[get<2>(GetParam())]; + int sdepth = outputDepths[0]; + int sqdepth = outputDepths[1]; + + Mat src(sz, matType); + Mat sum(sz, sdepth); + Mat sqsum(sz, sqdepth); + + declare.in(src, WARMUP_RNG).out(sum, sqsum); + declare.time(100); + + TEST_CYCLE() integral(src, sum, sqsum, sdepth, sqdepth); + + SANITY_CHECK_NOTHING(); +} + PERF_TEST_P( Size_MatType_OutMatDepth, integral_sqsum_tilted, testing::Combine( testing::Values(TYPICAL_MAT_SIZES),