From 31f72a39f85980aec7da088efa66b8b49c577602 Mon Sep 17 00:00:00 2001 From: Denes Tarjan Date: Mon, 7 Oct 2024 12:21:22 +0000 Subject: [PATCH] Update patch to enable new benchmarks in perf_pyramids and perf_remap --- .../opencv/extra_benchmarks/opencv-4.10.patch | 110 ++++++++++++++---- 1 file changed, 85 insertions(+), 25 deletions(-) diff --git a/adapters/opencv/extra_benchmarks/opencv-4.10.patch b/adapters/opencv/extra_benchmarks/opencv-4.10.patch index 3bc37e274..e4c11d971 100644 --- a/adapters/opencv/extra_benchmarks/opencv-4.10.patch +++ b/adapters/opencv/extra_benchmarks/opencv-4.10.patch @@ -17,7 +17,7 @@ index 36f400e34f..2f39ff1274 100644 --- a/modules/core/perf/perf_arithm.cpp +++ b/modules/core/perf/perf_arithm.cpp @@ -447,7 +447,7 @@ PERF_TEST_P_(BinaryOpTest, transposeND) - + INSTANTIATE_TEST_CASE_P(/*nothing*/ , BinaryOpTest, testing::Combine( - testing::Values(szVGA, sz720p, sz1080p), @@ -30,7 +30,7 @@ index be706e1a83..862b8b7c35 100644 --- a/modules/core/perf/perf_compare.cpp +++ b/modules/core/perf/perf_compare.cpp @@ -11,7 +11,7 @@ typedef perf::TestBaseWithParam Size_MatType_CmpType; - + PERF_TEST_P( Size_MatType_CmpType, compare, testing::Combine( - testing::Values(::perf::szVGA, ::perf::sz1080p), @@ -45,12 +45,12 @@ index 344d81cb8a..ef5a3aa7d2 100644 @@ -4,17 +4,18 @@ namespace opencv_test { using namespace perf; - + -typedef tuple Size_DepthSrc_DepthDst_Channels_alpha_t; -typedef perf::TestBaseWithParam Size_DepthSrc_DepthDst_Channels_alpha; +typedef tuple Size_DepthSrc_DepthDst_Channels_alpha_beta_t; +typedef perf::TestBaseWithParam Size_DepthSrc_DepthDst_Channels_alpha_beta; - + -PERF_TEST_P( Size_DepthSrc_DepthDst_Channels_alpha, convertTo, +PERF_TEST_P( Size_DepthSrc_DepthDst_Channels_alpha_beta, convertTo, testing::Combine @@ -71,16 +71,16 @@ index 344d81cb8a..ef5a3aa7d2 100644 int channels = get<3>(GetParam()); double alpha = get<4>(GetParam()); + double beta = get<5>(GetParam()); - + int maxValue = 255; - + @@ -31,7 +33,7 @@ PERF_TEST_P( Size_DepthSrc_DepthDst_Channels_alpha, convertTo, Mat dst(sz, CV_MAKETYPE(depthDst, channels)); - + int runs = (sz.width <= 640) ? 8 : 1; - TEST_CYCLE_MULTIRUN(runs) src.convertTo(dst, depthDst, alpha); + TEST_CYCLE_MULTIRUN(runs) src.convertTo(dst, depthDst, alpha, beta); - + double eps = depthSrc <= CV_32S && (depthDst <= CV_32S || depthDst == CV_64F) ? 1e-12 : (FLT_EPSILON * maxValue); eps = eps * std::max(1.0, fabs(alpha)); diff --git a/modules/core/perf/perf_exp.cpp b/modules/core/perf/perf_exp.cpp @@ -289,17 +289,17 @@ index d1f5a6b1ca..62463e2a28 100644 --- a/modules/imgproc/perf/perf_blur.cpp +++ b/modules/imgproc/perf/perf_blur.cpp @@ -35,6 +35,7 @@ PERF_TEST_P(Size_MatType_kSize, medianBlur, - + CV_ENUM(BorderType3x3, BORDER_REPLICATE, BORDER_CONSTANT) CV_ENUM(BorderType, BORDER_REPLICATE, BORDER_CONSTANT, BORDER_REFLECT, BORDER_REFLECT101) +CV_ENUM(BorderTypeKleidiCV, BORDER_REPLICATE, BORDER_REFLECT, BORDER_REFLECT101, BORDER_WRAP) - + typedef tuple Size_MatType_BorderType3x3_t; typedef perf::TestBaseWithParam Size_MatType_BorderType3x3; @@ -45,9 +46,12 @@ typedef perf::TestBaseWithParam Size_MatType_BorderTy typedef tuple Size_ksize_BorderType_t; typedef perf::TestBaseWithParam Size_ksize_BorderType; - + +typedef tuple Size_MatType_BorderTypeKleidiCV_t; +typedef perf::TestBaseWithParam Size_MatType_BorderTypeKleidiCV; + @@ -313,7 +313,7 @@ index d1f5a6b1ca..62463e2a28 100644 @@ -67,6 +71,28 @@ PERF_TEST_P(Size_MatType_BorderType3x3, gaussianBlur3x3, SANITY_CHECK(dst, 1); } - + +PERF_TEST_P(Size_MatType_BorderType3x3, gaussianBlur3x3_CustomSigma, + testing::Combine( + testing::Values(szODD, szQVGA, szVGA, sz720p, sz1080p, sz2160p), @@ -340,7 +340,7 @@ index d1f5a6b1ca..62463e2a28 100644 testing::Combine( testing::Values(szODD, szQVGA, szVGA, sz720p), @@ -188,7 +214,7 @@ PERF_TEST_P(Size_MatType_BorderType3x3, box3x3_inplace, - + PERF_TEST_P(Size_MatType_BorderType, gaussianBlur5x5, testing::Combine( - testing::Values(szODD, szQVGA, szVGA, sz720p), @@ -351,7 +351,7 @@ index d1f5a6b1ca..62463e2a28 100644 @@ -208,6 +234,116 @@ PERF_TEST_P(Size_MatType_BorderType, gaussianBlur5x5, SANITY_CHECK(dst, 1); } - + +PERF_TEST_P(Size_MatType_BorderType, gaussianBlur5x5_CustomSigma, + testing::Combine( + testing::Values(szODD, szQVGA, szVGA, sz720p, sz1080p, sz2160p), @@ -470,7 +470,7 @@ index 5915b507ce..4a8c02df40 100644 --- a/modules/imgproc/perf/perf_cvt_color.cpp +++ b/modules/imgproc/perf/perf_cvt_color.cpp @@ -319,7 +319,7 @@ typedef perf::TestBaseWithParam Size_CvtMode; - + PERF_TEST_P(Size_CvtMode, cvtColor8u, testing::Combine( - testing::Values(::perf::szODD, ::perf::szVGA, ::perf::sz1080p), @@ -479,7 +479,7 @@ index 5915b507ce..4a8c02df40 100644 ) ) @@ -435,7 +435,7 @@ typedef perf::TestBaseWithParam Size_CvtMode2; - + PERF_TEST_P(Size_CvtMode2, cvtColorYUV420, testing::Combine( - testing::Values(szVGA, sz1080p, Size(130, 60)), @@ -494,7 +494,7 @@ index dc9e975a21..1b73c5eaee 100644 @@ -39,4 +39,64 @@ PERF_TEST_P(Size_MatType, dilate, TYPICAL_MATS_MORPH) SANITY_CHECK(dst); } - + +typedef tuple MorphParams_t; +typedef perf::TestBaseWithParam Erode; +typedef perf::TestBaseWithParam Dilate; @@ -556,6 +556,66 @@ index dc9e975a21..1b73c5eaee 100644 +} + } // namespace +diff --git a/modules/imgproc/perf/perf_pyramids.cpp b/modules/imgproc/perf/perf_pyramids.cpp +index 5dd5b9cece..42c83b2903 100644 +--- a/modules/imgproc/perf/perf_pyramids.cpp ++++ b/modules/imgproc/perf/perf_pyramids.cpp +@@ -6,7 +6,7 @@ + namespace opencv_test { + + PERF_TEST_P(Size_MatType, pyrDown, testing::Combine( +- testing::Values(sz1080p, sz720p, szVGA, szQVGA, szODD), ++ testing::Values(sz1080p, sz720p, szVGA, szQVGA, szODD, sz2160p), + testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_16SC1, CV_16SC3, CV_16SC4, CV_32FC1, CV_32FC3, CV_32FC4) + ) + ) +diff --git a/modules/imgproc/perf/perf_remap.cpp b/modules/imgproc/perf/perf_remap.cpp +index bd2129d233..351c082bed 100644 +--- a/modules/imgproc/perf/perf_remap.cpp ++++ b/modules/imgproc/perf/perf_remap.cpp +@@ -6,25 +6,28 @@ + namespace opencv_test { + + CV_ENUM(InterType, INTER_NEAREST, INTER_LINEAR, INTER_CUBIC, INTER_LANCZOS4) ++CV_ENUM(BorderType, BORDER_REPLICATE, BORDER_CONSTANT) + +-typedef TestBaseWithParam< tuple > TestRemap; ++typedef TestBaseWithParam< tuple > TestRemap; + + PERF_TEST_P( TestRemap, Remap, + Combine( +- Values( szVGA, sz1080p ), +- Values( CV_16UC1, CV_16SC1, CV_32FC1 ), ++ Values( szVGA, sz1080p, sz2160p ), ++ Values( CV_8UC1, CV_16UC1, CV_16SC1, CV_32FC1 ), + Values( CV_16SC2, CV_32FC1, CV_32FC2 ), +- InterType::all() ++ InterType::all(), ++ BorderType::all() + ) + ) + { + Size sz; +- int src_type, map1_type, inter_type; ++ int src_type, map1_type, inter_type, border_type; + + sz = get<0>(GetParam()); + src_type = get<1>(GetParam()); + map1_type = get<2>(GetParam()); + inter_type = get<3>(GetParam()); ++ border_type = get<4>(GetParam()); + + Mat src(sz, src_type), dst(sz, src_type), map1(sz, map1_type), map2; + if (map1_type == CV_32FC1) +@@ -62,7 +65,7 @@ PERF_TEST_P( TestRemap, Remap, + declare.in(src, WARMUP_RNG).out(dst).time(20); + + int runs = (sz.width <= 640) ? 3 : 1; +- TEST_CYCLE_MULTIRUN(runs) remap(src, dst, map1, map2, inter_type); ++ TEST_CYCLE_MULTIRUN(runs) remap(src, dst, map1, map2, inter_type, border_type); + + SANITY_CHECK(dst); + } diff --git a/modules/imgproc/perf/perf_resize.cpp b/modules/imgproc/perf/perf_resize.cpp index 0f470a5f81..4e31ffec82 100644 --- a/modules/imgproc/perf/perf_resize.cpp @@ -601,29 +661,29 @@ index 0f470a5f81..4e31ffec82 100644 ) ) diff --git a/modules/imgproc/perf/perf_sepfilters.cpp b/modules/imgproc/perf/perf_sepfilters.cpp -index 480aab9f20..430d5387ad 100644 +index 480aab9f20..d33a29d5ed 100644 --- a/modules/imgproc/perf/perf_sepfilters.cpp +++ b/modules/imgproc/perf/perf_sepfilters.cpp @@ -5,7 +5,7 @@ - + namespace opencv_test { - + -#define FILTER_SRC_SIZES szODD, szQVGA, szVGA +#define FILTER_SRC_SIZES szODD, szQVGA, szVGA, sz1080p, sz2160p - + CV_ENUM(BorderType3x3, BORDER_REPLICATE, BORDER_CONSTANT) CV_ENUM(BorderType3x3ROI, BORDER_DEFAULT, BORDER_REPLICATE|BORDER_ISOLATED, BORDER_CONSTANT|BORDER_ISOLATED) @@ -242,4 +242,32 @@ PERF_TEST_P(Size_MatType_dx_dy_Border3x3ROI, scharrViaSobelFilter, SANITY_CHECK(dst); } - + +CV_ENUM(BorderMode_KleidiCV, BORDER_REPLICATE, BORDER_REFLECT, BORDER_REFLECT_101) +typedef TestBaseWithParam> SepFilter2D_KleidiCV; + +PERF_TEST_P(SepFilter2D_KleidiCV, SepFilter2D, + testing::Combine( + testing::Values(sz1080p, sz2160p), -+ testing::Values(CV_8UC1, CV_8UC4, CV_16UC1, CV_16UC4), ++ testing::Values(CV_8UC1, CV_8UC4, CV_16UC1, CV_16UC4, CV_16SC1, CV_16SC4), + testing::Values(5), + BorderMode_KleidiCV::all() + ) @@ -652,8 +712,8 @@ index 7aa3809f27..9ff587f325 100644 +++ b/modules/ts/include/opencv2/ts/ts_perf.hpp @@ -78,7 +78,7 @@ const static cv::Size szSmall128 = cv::Size(128, 128); #define SZ_TYPICAL ::testing::Values(::perf::szVGA, ::perf::szqHD, ::perf::sz720p, ::perf::szODD) - - + + -#define TYPICAL_MAT_SIZES ::perf::szVGA, ::perf::sz720p, ::perf::sz1080p, ::perf::szODD +#define TYPICAL_MAT_SIZES ::perf::szVGA, ::perf::sz720p, ::perf::sz1080p, ::perf::szODD, ::perf::sz2160p #define TYPICAL_MAT_TYPES CV_8UC1, CV_8UC4, CV_32FC1 -- GitLab