From c0a0852f053cee5e30c6fd6ba3779d4b7d490716 Mon Sep 17 00:00:00 2001 From: Rostislav Vasilikhin Date: Thu, 5 Sep 2024 05:46:17 +0200 Subject: [PATCH] added more data types for warpAffine() perf tests --- modules/imgproc/perf/perf_warp.cpp | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/modules/imgproc/perf/perf_warp.cpp b/modules/imgproc/perf/perf_warp.cpp index 688d449a55..cb4c32c905 100644 --- a/modules/imgproc/perf/perf_warp.cpp +++ b/modules/imgproc/perf/perf_warp.cpp @@ -12,7 +12,7 @@ CV_ENUM(InterType, INTER_NEAREST, INTER_LINEAR) CV_ENUM(InterTypeExtended, INTER_NEAREST, INTER_LINEAR, WARP_RELATIVE_MAP) CV_ENUM(RemapMode, HALF_SIZE, UPSIDE_DOWN, REFLECTION_X, REFLECTION_BOTH) -typedef TestBaseWithParam< tuple > TestWarpAffine; +typedef TestBaseWithParam< tuple > TestWarpAffine; typedef TestBaseWithParam< tuple > TestWarpPerspective; typedef TestBaseWithParam< tuple > TestWarpPerspectiveNear_t; typedef TestBaseWithParam< tuple > TestRemap; @@ -21,6 +21,7 @@ void update_map(const Mat& src, Mat& map_x, Mat& map_y, const int remapMode, boo PERF_TEST_P( TestWarpAffine, WarpAffine, Combine( + Values(CV_8UC1, CV_8UC4), Values( szVGA, sz720p, sz1080p ), InterType::all(), BorderMode::all() @@ -28,13 +29,14 @@ PERF_TEST_P( TestWarpAffine, WarpAffine, ) { Size sz, szSrc(512, 512); - int borderMode, interType; - sz = get<0>(GetParam()); - interType = get<1>(GetParam()); - borderMode = get<2>(GetParam()); + int borderMode, interType, dataType; + dataType = get<0>(GetParam()); + sz = get<1>(GetParam()); + interType = get<2>(GetParam()); + borderMode = get<3>(GetParam()); Scalar borderColor = Scalar::all(150); - Mat src(szSrc,CV_8UC4), dst(sz, CV_8UC4); + Mat src(szSrc, dataType), dst(sz, dataType); cvtest::fillGradient(src); if(borderMode == BORDER_CONSTANT) cvtest::smoothBorder(src, borderColor, 1); Mat warpMat = getRotationMatrix2D(Point2f(src.cols/2.f, src.rows/2.f), 30., 2.2); @@ -47,6 +49,7 @@ PERF_TEST_P( TestWarpAffine, WarpAffine, PERF_TEST_P(TestWarpAffine, DISABLED_WarpAffine_ovx, Combine( + Values(CV_8UC1, CV_8UC4), Values(szVGA, sz720p, sz1080p), InterType::all(), BorderMode::all() @@ -54,13 +57,16 @@ PERF_TEST_P(TestWarpAffine, DISABLED_WarpAffine_ovx, ) { Size sz, szSrc(512, 512); - int borderMode, interType; - sz = get<0>(GetParam()); - interType = get<1>(GetParam()); - borderMode = get<2>(GetParam()); + int borderMode, interType, dataType; + + dataType = get<0>(GetParam()); + sz = get<1>(GetParam()); + interType = get<2>(GetParam()); + borderMode = get<3>(GetParam()); + Scalar borderColor = Scalar::all(150); - Mat src(szSrc, CV_8UC1), dst(sz, CV_8UC1); + Mat src(szSrc, dataType), dst(sz, dataType); cvtest::fillGradient(src); if (borderMode == BORDER_CONSTANT) cvtest::smoothBorder(src, borderColor, 1); Mat warpMat = getRotationMatrix2D(Point2f(src.cols / 2.f, src.rows / 2.f), 30., 2.2);