From f48e270ddfccada85c9e02c06383787cb3dd6fb0 Mon Sep 17 00:00:00 2001 From: "Fedorov, Andrey" Date: Fri, 10 Jul 2026 07:37:16 -0700 Subject: [PATCH 01/12] easy gaps filled --- modules/core/perf/perf_arithm.cpp | 26 ++++++++- modules/core/perf/perf_compare.cpp | 2 +- modules/core/perf/perf_dot.cpp | 2 +- modules/core/perf/perf_flip.cpp | 2 +- modules/core/perf/perf_mat.cpp | 4 +- modules/core/perf/perf_merge.cpp | 2 +- modules/core/perf/perf_norm.cpp | 12 ++-- modules/core/perf/perf_reduce.cpp | 4 +- modules/core/perf/perf_sort.cpp | 7 +-- modules/core/perf/perf_split.cpp | 2 +- modules/core/perf/perf_stat.cpp | 15 +++-- modules/imgproc/perf/perf_accumulate.cpp | 16 +++--- modules/imgproc/perf/perf_bilateral.cpp | 2 +- modules/imgproc/perf/perf_blur.cpp | 61 +++++++++++++++++++-- modules/imgproc/perf/perf_corners.cpp | 60 +++++++++++++++++++- modules/imgproc/perf/perf_filter2d.cpp | 33 +++++++++++ modules/imgproc/perf/perf_laplacian.cpp | 37 ++++++++++++- modules/imgproc/perf/perf_matchTemplate.cpp | 29 ++++++++++ modules/imgproc/perf/perf_moments.cpp | 2 +- modules/imgproc/perf/perf_morph.cpp | 55 ++++++++++++++++++- modules/imgproc/perf/perf_sepfilters.cpp | 53 ++++++++++++++++++ 21 files changed, 379 insertions(+), 47 deletions(-) diff --git a/modules/core/perf/perf_arithm.cpp b/modules/core/perf/perf_arithm.cpp index d8b65e1a08fb..19a3905f8cef 100644 --- a/modules/core/perf/perf_arithm.cpp +++ b/modules/core/perf/perf_arithm.cpp @@ -436,6 +436,30 @@ PERF_TEST_P_(BinaryOpTest, transpose2d) SANITY_CHECK_NOTHING(); } +// Multichannel transpose (matches IPP perf coverage: 8U/16U/32F x C1/C3/C4) +typedef Size_MatType TransposeMultiChannelTest; + +PERF_TEST_P_(TransposeMultiChannelTest, transpose2d_multichannel) +{ + Size sz = get<0>(GetParam()); + int type = get<1>(GetParam()); + Size tsz = Size(sz.height, sz.width); + cv::Mat a(sz, type), b(tsz, type); + + declare.in(a, WARMUP_RNG).out(b); + + TEST_CYCLE() cv::transpose(a, b); + + SANITY_CHECK_NOTHING(); +} + +INSTANTIATE_TEST_CASE_P(/*nothing*/ , TransposeMultiChannelTest, + testing::Combine( + testing::Values(szVGA, sz720p, sz1080p), + testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, CV_32FC1, CV_32FC3, CV_32FC4) + ) +); + static cv::Mat makeTransposeNDOutput(const cv::Mat& src, const std::vector& order) { std::vector new_sz(order.size()); @@ -526,7 +550,7 @@ PERF_TEST_P_(BinaryOpTest, transposeND_generic_move_tail_order) INSTANTIATE_TEST_CASE_P(/*nothing*/ , BinaryOpTest, testing::Combine( testing::Values(szVGA, sz720p, sz1080p), - testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_8SC1, CV_16SC1, CV_16SC2, CV_16SC3, CV_16SC4, CV_32SC1, CV_32FC1) + testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_8SC1, CV_16UC1, CV_16SC1, CV_16SC2, CV_16SC3, CV_16SC4, CV_32SC1, CV_32FC1, CV_64FC1) ) ); diff --git a/modules/core/perf/perf_compare.cpp b/modules/core/perf/perf_compare.cpp index be706e1a83fc..2b595a79da07 100644 --- a/modules/core/perf/perf_compare.cpp +++ b/modules/core/perf/perf_compare.cpp @@ -35,7 +35,7 @@ PERF_TEST_P( Size_MatType_CmpType, compare, PERF_TEST_P( Size_MatType_CmpType, compareScalar, testing::Combine( testing::Values(TYPICAL_MAT_SIZES), - testing::Values(TYPICAL_MAT_TYPES), + testing::Values(CV_8UC1, CV_8UC4, CV_16UC1, CV_16SC1, CV_32FC1), CmpType::all() ) ) diff --git a/modules/core/perf/perf_dot.cpp b/modules/core/perf/perf_dot.cpp index 1230220a4c46..441ab652bf14 100644 --- a/modules/core/perf/perf_dot.cpp +++ b/modules/core/perf/perf_dot.cpp @@ -9,7 +9,7 @@ typedef TestBaseWithParam MatType_Length; PERF_TEST_P( MatType_Length, dot, testing::Combine( - testing::Values( CV_8UC1, CV_8SC1, CV_16SC1, CV_16UC1, CV_32SC1, CV_32FC1 ), + testing::Values( CV_8UC1, CV_8SC1, CV_16SC1, CV_16UC1, CV_32SC1, CV_32FC1, CV_64FC1 ), testing::Values( 32, 64, 128, 256, 512, 1024 ) )) { diff --git a/modules/core/perf/perf_flip.cpp b/modules/core/perf/perf_flip.cpp index 6e89cd6e9aaf..9e3539c65a58 100644 --- a/modules/core/perf/perf_flip.cpp +++ b/modules/core/perf/perf_flip.cpp @@ -15,7 +15,7 @@ enum }; #define FLIP_SIZES szQVGA, szVGA, sz1080p -#define FLIP_TYPES CV_8UC1, CV_8UC2, CV_8UC3, CV_8UC4, CV_8SC1, CV_16SC1, CV_16SC2, CV_16SC3, CV_16SC4, CV_32SC1, CV_32FC1 +#define FLIP_TYPES CV_8UC1, CV_8UC2, CV_8UC3, CV_8UC4, CV_8SC1, CV_16UC1, CV_16UC3, CV_16UC4, CV_16SC1, CV_16SC2, CV_16SC3, CV_16SC4, CV_32SC1, CV_32FC1, CV_32FC3, CV_32FC4 #define FLIP_CODES FLIP_X, FLIP_Y, FLIP_XY CV_FLAGS(FlipCode, FLIP_X, FLIP_Y, FLIP_XY); diff --git a/modules/core/perf/perf_mat.cpp b/modules/core/perf/perf_mat.cpp index 277eb92c2182..c70dc5207a97 100644 --- a/modules/core/perf/perf_mat.cpp +++ b/modules/core/perf/perf_mat.cpp @@ -99,7 +99,7 @@ PERF_TEST_P(Size_MatType, Mat_Clone_Roi, PERF_TEST_P(Size_MatType, Mat_CopyToWithMask, testing::Combine(testing::Values(::perf::sz1080p, ::perf::szODD), - testing::Values(CV_8UC1, CV_8UC2, CV_8UC3, CV_16UC1, CV_16UC3, CV_32SC1, CV_32SC2, CV_32FC4)) + testing::Values(CV_8UC1, CV_8UC2, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC2, CV_16UC3, CV_16UC4, CV_16SC1, CV_16SC2, CV_16SC3, CV_16SC4, CV_32SC1, CV_32SC2, CV_32SC3, CV_32SC4, CV_32FC1, CV_32FC2, CV_32FC3, CV_32FC4, CV_64FC1, CV_64FC2)) ) { const Size_MatType_t params = GetParam(); @@ -119,7 +119,7 @@ PERF_TEST_P(Size_MatType, Mat_CopyToWithMask, PERF_TEST_P(Size_MatType, Mat_SetToWithMask, testing::Combine(testing::Values(TYPICAL_MAT_SIZES), - testing::Values(CV_8UC1, CV_8UC2)) + testing::Values(CV_8UC1, CV_8UC2, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, CV_32SC1, CV_32SC3, CV_32SC4, CV_32FC1, CV_32FC3, CV_32FC4)) ) { const Size_MatType_t params = GetParam(); diff --git a/modules/core/perf/perf_merge.cpp b/modules/core/perf/perf_merge.cpp index e10642dcb493..5e662428a176 100644 --- a/modules/core/perf/perf_merge.cpp +++ b/modules/core/perf/perf_merge.cpp @@ -11,7 +11,7 @@ PERF_TEST_P( Size_SrcDepth_DstChannels, merge, testing::Combine ( testing::Values(TYPICAL_MAT_SIZES), - testing::Values(CV_8U, CV_16S, CV_32S, CV_32F, CV_64F), + testing::Values(CV_8U, CV_16U, CV_16S, CV_32S, CV_32F, CV_64F), testing::Values(2, 3, 4) ) ) diff --git a/modules/core/perf/perf_norm.cpp b/modules/core/perf/perf_norm.cpp index c47398f8fc37..7b5c92efe036 100644 --- a/modules/core/perf/perf_norm.cpp +++ b/modules/core/perf/perf_norm.cpp @@ -15,7 +15,7 @@ PERF_TEST_P(Size_MatType_NormType, norm, testing::Combine( testing::Values(TYPICAL_MAT_SIZES), testing::Values(CV_8UC1, CV_8UC4, CV_8SC1, CV_16UC1, CV_16SC1, CV_32SC1, CV_32FC1, CV_64FC1), - testing::Values((int)NORM_INF, (int)NORM_L1, (int)NORM_L2) + testing::Values((int)NORM_INF, (int)NORM_L1, (int)NORM_L2, (int)NORM_L2SQR) ) ) { @@ -36,8 +36,8 @@ PERF_TEST_P(Size_MatType_NormType, norm, PERF_TEST_P(Size_MatType_NormType, norm_mask, testing::Combine( testing::Values(TYPICAL_MAT_SIZES), - testing::Values(CV_8UC1, CV_8UC4, CV_8SC1, CV_16UC1, CV_16SC1, CV_32SC1, CV_32FC1, CV_64FC1), - testing::Values((int)NORM_INF, (int)NORM_L1, (int)NORM_L2) + testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_8SC1, CV_16UC1, CV_16UC3, CV_16SC1, CV_32SC1, CV_32FC1, CV_32FC3, CV_64FC1), + testing::Values((int)NORM_INF, (int)NORM_L1, (int)NORM_L2, (int)NORM_L2SQR) ) ) { @@ -60,7 +60,7 @@ PERF_TEST_P(Size_MatType_NormType, norm2, testing::Combine( testing::Values(TYPICAL_MAT_SIZES), testing::Values(CV_8UC1, CV_8UC4, CV_8SC1, CV_16UC1, CV_16SC1, CV_32SC1, CV_32FC1, CV_64FC1), - testing::Values((int)NORM_INF, (int)NORM_L1, (int)NORM_L2, (int)(NORM_RELATIVE+NORM_INF), (int)(NORM_RELATIVE+NORM_L1), (int)(NORM_RELATIVE+NORM_L2)) + testing::Values((int)NORM_INF, (int)NORM_L1, (int)NORM_L2, (int)NORM_L2SQR, (int)(NORM_RELATIVE+NORM_INF), (int)(NORM_RELATIVE+NORM_L1), (int)(NORM_RELATIVE+NORM_L2)) ) ) { @@ -82,8 +82,8 @@ PERF_TEST_P(Size_MatType_NormType, norm2, PERF_TEST_P(Size_MatType_NormType, norm2_mask, testing::Combine( testing::Values(TYPICAL_MAT_SIZES), - testing::Values(CV_8UC1, CV_8UC4, CV_8SC1, CV_16UC1, CV_16SC1, CV_32SC1, CV_32FC1, CV_64FC1), - testing::Values((int)NORM_INF, (int)NORM_L1, (int)NORM_L2, (int)(NORM_RELATIVE|NORM_INF), (int)(NORM_RELATIVE|NORM_L1), (int)(NORM_RELATIVE|NORM_L2)) + testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_8SC1, CV_16UC1, CV_16UC3, CV_16SC1, CV_32SC1, CV_32FC1, CV_32FC3, CV_64FC1), + testing::Values((int)NORM_INF, (int)NORM_L1, (int)NORM_L2, (int)NORM_L2SQR, (int)(NORM_RELATIVE|NORM_INF), (int)(NORM_RELATIVE|NORM_L1), (int)(NORM_RELATIVE|NORM_L2)) ) ) { diff --git a/modules/core/perf/perf_reduce.cpp b/modules/core/perf/perf_reduce.cpp index bcd10b18c539..01732f899d63 100644 --- a/modules/core/perf/perf_reduce.cpp +++ b/modules/core/perf/perf_reduce.cpp @@ -12,7 +12,7 @@ typedef perf::TestBaseWithParam Size_MatType_ROp; PERF_TEST_P(Size_MatType_ROp, reduceR, testing::Combine( testing::Values(TYPICAL_MAT_SIZES), - testing::Values(TYPICAL_MAT_TYPES), + testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, CV_16SC1, CV_16SC3, CV_16SC4, CV_32FC1, CV_32FC3, CV_32FC4), ROp::all() ) ) @@ -40,7 +40,7 @@ PERF_TEST_P(Size_MatType_ROp, reduceR, PERF_TEST_P(Size_MatType_ROp, reduceC, testing::Combine( testing::Values(TYPICAL_MAT_SIZES), - testing::Values(TYPICAL_MAT_TYPES), + testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, CV_16SC1, CV_16SC3, CV_16SC4, CV_32FC1, CV_32FC3, CV_32FC4), ROp::all() ) ) diff --git a/modules/core/perf/perf_sort.cpp b/modules/core/perf/perf_sort.cpp index 98056901aea1..2fcc08924c67 100644 --- a/modules/core/perf/perf_sort.cpp +++ b/modules/core/perf/perf_sort.cpp @@ -5,8 +5,8 @@ namespace opencv_test using namespace perf; #define TYPICAL_MAT_SIZES_SORT TYPICAL_MAT_SIZES -#define TYPICAL_MAT_TYPES_SORT CV_8UC1, CV_16UC1, CV_32FC1 -#define SORT_TYPES SORT_EVERY_ROW | SORT_ASCENDING, SORT_EVERY_ROW | SORT_DESCENDING +#define TYPICAL_MAT_TYPES_SORT CV_8UC1, CV_16UC1, CV_16SC1, CV_32SC1, CV_32FC1, CV_64FC1 +#define SORT_TYPES SORT_EVERY_ROW | SORT_ASCENDING, SORT_EVERY_ROW | SORT_DESCENDING, SORT_EVERY_COLUMN | SORT_ASCENDING, SORT_EVERY_COLUMN | SORT_DESCENDING #define TYPICAL_MATS_SORT testing::Combine( testing::Values(TYPICAL_MAT_SIZES_SORT), testing::Values(TYPICAL_MAT_TYPES_SORT), testing::Values(SORT_TYPES) ) typedef tuple sortParams; @@ -29,9 +29,6 @@ PERF_TEST_P(sortFixture, sort, TYPICAL_MATS_SORT) typedef sortFixture sortIdxFixture; -#undef SORT_TYPES -#define SORT_TYPES SORT_EVERY_COLUMN | SORT_ASCENDING, SORT_EVERY_COLUMN | SORT_DESCENDING - PERF_TEST_P(sortIdxFixture, sorIdx, TYPICAL_MATS_SORT) { const sortParams params = GetParam(); diff --git a/modules/core/perf/perf_split.cpp b/modules/core/perf/perf_split.cpp index 2cbc0b289cae..604d391560fb 100644 --- a/modules/core/perf/perf_split.cpp +++ b/modules/core/perf/perf_split.cpp @@ -11,7 +11,7 @@ PERF_TEST_P( Size_Depth_Channels, split, testing::Combine ( testing::Values(TYPICAL_MAT_SIZES), - testing::Values(CV_8U, CV_16S, CV_32F, CV_64F), + testing::Values(CV_8U, CV_16U, CV_16S, CV_32F, CV_64F), testing::Values(2, 3, 4) ) ) diff --git a/modules/core/perf/perf_stat.cpp b/modules/core/perf/perf_stat.cpp index 884647584445..83a681e90c13 100644 --- a/modules/core/perf/perf_stat.cpp +++ b/modules/core/perf/perf_stat.cpp @@ -4,7 +4,8 @@ namespace opencv_test { using namespace perf; -PERF_TEST_P(Size_MatType, sum, TYPICAL_MATS) +PERF_TEST_P(Size_MatType, sum, testing::Combine( testing::Values( TYPICAL_MAT_SIZES ), + testing::Values( CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, CV_16SC1, CV_16SC3, CV_16SC4, CV_32FC1, CV_32FC3, CV_32FC4 ) )) { Size sz = get<0>(GetParam()); int type = get<1>(GetParam()); @@ -19,7 +20,8 @@ PERF_TEST_P(Size_MatType, sum, TYPICAL_MATS) SANITY_CHECK(s, 1e-6, ERROR_RELATIVE); } -PERF_TEST_P(Size_MatType, mean, TYPICAL_MATS) +PERF_TEST_P(Size_MatType, mean, testing::Combine( testing::Values( TYPICAL_MAT_SIZES ), + testing::Values( CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, CV_16SC1, CV_16SC3, CV_16SC4, CV_32FC1, CV_32FC3, CV_32FC4 ) )) { Size sz = get<0>(GetParam()); int type = get<1>(GetParam()); @@ -34,7 +36,8 @@ PERF_TEST_P(Size_MatType, mean, TYPICAL_MATS) SANITY_CHECK(s, 1e-5); } -PERF_TEST_P(Size_MatType, mean_mask, TYPICAL_MATS) +PERF_TEST_P(Size_MatType, mean_mask, testing::Combine( testing::Values( TYPICAL_MAT_SIZES ), + testing::Values( CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, CV_32FC1, CV_32FC3, CV_32FC4 ) )) { Size sz = get<0>(GetParam()); int type = get<1>(GetParam()); @@ -50,7 +53,8 @@ PERF_TEST_P(Size_MatType, mean_mask, TYPICAL_MATS) SANITY_CHECK(s, 5e-5); } -PERF_TEST_P(Size_MatType, meanStdDev, TYPICAL_MATS) +PERF_TEST_P(Size_MatType, meanStdDev, testing::Combine( testing::Values( TYPICAL_MAT_SIZES ), + testing::Values( CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, CV_32FC1, CV_32FC3, CV_32FC4 ) )) { Size sz = get<0>(GetParam()); int matType = get<1>(GetParam()); @@ -67,7 +71,8 @@ PERF_TEST_P(Size_MatType, meanStdDev, TYPICAL_MATS) SANITY_CHECK(dev, 1e-5, ERROR_RELATIVE); } -PERF_TEST_P(Size_MatType, meanStdDev_mask, TYPICAL_MATS) +PERF_TEST_P(Size_MatType, meanStdDev_mask, testing::Combine( testing::Values( TYPICAL_MAT_SIZES ), + testing::Values( CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, CV_32FC1, CV_32FC3, CV_32FC4 ) )) { Size sz = get<0>(GetParam()); int matType = get<1>(GetParam()); diff --git a/modules/imgproc/perf/perf_accumulate.cpp b/modules/imgproc/perf/perf_accumulate.cpp index 884ab9c295b2..ef2acf91e351 100644 --- a/modules/imgproc/perf/perf_accumulate.cpp +++ b/modules/imgproc/perf/perf_accumulate.cpp @@ -39,7 +39,7 @@ typedef Size_MatType Accumulate; /////////////////////////////////// Accumulate /////////////////////////////////// -PERF_TEST_P_ACCUMULATE(Accumulate, MAT_TYPES_ACCUMLATE, +PERF_TEST_P_ACCUMULATE(Accumulate, MAT_TYPES_ACCUMLATE_C, PERF_ACCUMULATE_INIT(CV_32FC), accumulate(src1, dst)) PERF_TEST_P_ACCUMULATE(AccumulateMask, MAT_TYPES_ACCUMLATE_C, @@ -51,7 +51,7 @@ PERF_TEST_P_ACCUMULATE(AccumulateMask32FC4, CV_32FC4, PERF_TEST_P_ACCUMULATE(AccumulateMask8UC4To32FC4, CV_8UC4, PERF_ACCUMULATE_MASK_INIT(CV_32FC), accumulate(src1, dst, mask)) -PERF_TEST_P_ACCUMULATE(AccumulateDouble, MAT_TYPES_ACCUMLATE_D, +PERF_TEST_P_ACCUMULATE(AccumulateDouble, MAT_TYPES_ACCUMLATE_D_C, PERF_ACCUMULATE_INIT(CV_64FC), accumulate(src1, dst)) PERF_TEST_P_ACCUMULATE(AccumulateDoubleMask, MAT_TYPES_ACCUMLATE_D_C, @@ -59,13 +59,13 @@ PERF_TEST_P_ACCUMULATE(AccumulateDoubleMask, MAT_TYPES_ACCUMLATE_D_C, ///////////////////////////// AccumulateSquare /////////////////////////////////// -PERF_TEST_P_ACCUMULATE(Square, MAT_TYPES_ACCUMLATE, +PERF_TEST_P_ACCUMULATE(Square, MAT_TYPES_ACCUMLATE_C, PERF_ACCUMULATE_INIT(CV_32FC), accumulateSquare(src1, dst)) PERF_TEST_P_ACCUMULATE(SquareMask, MAT_TYPES_ACCUMLATE_C, PERF_ACCUMULATE_MASK_INIT(CV_32FC), accumulateSquare(src1, dst, mask)) -PERF_TEST_P_ACCUMULATE(SquareDouble, MAT_TYPES_ACCUMLATE_D, +PERF_TEST_P_ACCUMULATE(SquareDouble, MAT_TYPES_ACCUMLATE_D_C, PERF_ACCUMULATE_INIT(CV_64FC), accumulateSquare(src1, dst)) PERF_TEST_P_ACCUMULATE(SquareDoubleMask, MAT_TYPES_ACCUMLATE_D_C, @@ -83,13 +83,13 @@ PERF_TEST_P_ACCUMULATE(SquareDoubleMask, MAT_TYPES_ACCUMLATE_D_C, Mat src2(srcSize, srcType); \ declare.in(src2); -PERF_TEST_P_ACCUMULATE(Product, MAT_TYPES_ACCUMLATE, +PERF_TEST_P_ACCUMULATE(Product, MAT_TYPES_ACCUMLATE_C, PERF_ACCUMULATE_INIT_2(CV_32FC), accumulateProduct(src1, src2, dst)) PERF_TEST_P_ACCUMULATE(ProductMask, MAT_TYPES_ACCUMLATE_C, PERF_ACCUMULATE_MASK_INIT_2(CV_32FC), accumulateProduct(src1, src2, dst, mask)) -PERF_TEST_P_ACCUMULATE(ProductDouble, MAT_TYPES_ACCUMLATE_D, +PERF_TEST_P_ACCUMULATE(ProductDouble, MAT_TYPES_ACCUMLATE_D_C, PERF_ACCUMULATE_INIT_2(CV_64FC), accumulateProduct(src1, src2, dst)) PERF_TEST_P_ACCUMULATE(ProductDoubleMask, MAT_TYPES_ACCUMLATE_D_C, @@ -97,13 +97,13 @@ PERF_TEST_P_ACCUMULATE(ProductDoubleMask, MAT_TYPES_ACCUMLATE_D_C, ///////////////////////////// AccumulateWeighted /////////////////////////////////// -PERF_TEST_P_ACCUMULATE(Weighted, MAT_TYPES_ACCUMLATE, +PERF_TEST_P_ACCUMULATE(Weighted, MAT_TYPES_ACCUMLATE_C, PERF_ACCUMULATE_INIT(CV_32FC), accumulateWeighted(src1, dst, 0.123)) PERF_TEST_P_ACCUMULATE(WeightedMask, MAT_TYPES_ACCUMLATE_C, PERF_ACCUMULATE_MASK_INIT(CV_32FC), accumulateWeighted(src1, dst, 0.123, mask)) -PERF_TEST_P_ACCUMULATE(WeightedDouble, MAT_TYPES_ACCUMLATE_D, +PERF_TEST_P_ACCUMULATE(WeightedDouble, MAT_TYPES_ACCUMLATE_D_C, PERF_ACCUMULATE_INIT(CV_64FC), accumulateWeighted(src1, dst, 0.123456)) PERF_TEST_P_ACCUMULATE(WeightedDoubleMask, MAT_TYPES_ACCUMLATE_D_C, diff --git a/modules/imgproc/perf/perf_bilateral.cpp b/modules/imgproc/perf/perf_bilateral.cpp index 38f2a503d34e..cd1cd016a9aa 100644 --- a/modules/imgproc/perf/perf_bilateral.cpp +++ b/modules/imgproc/perf/perf_bilateral.cpp @@ -12,7 +12,7 @@ typedef TestBaseWithParam< tuple > TestBilateralFil PERF_TEST_P( TestBilateralFilter, BilateralFilter, Combine( Values( szVGA, sz1080p ), // image size - Values( 3, 5 ), // d + Values( 3, 5, 7, 21 ), // d Mat_Type::all(), // image type Values(1., 5.) ) diff --git a/modules/imgproc/perf/perf_blur.cpp b/modules/imgproc/perf/perf_blur.cpp index fd649b08c68a..67a544332418 100644 --- a/modules/imgproc/perf/perf_blur.cpp +++ b/modules/imgproc/perf/perf_blur.cpp @@ -11,7 +11,7 @@ typedef perf::TestBaseWithParam Size_MatType_kSize; PERF_TEST_P(Size_MatType_kSize, medianBlur, testing::Combine( testing::Values(szODD, szQVGA, szVGA, sz720p), - testing::Values(CV_8UC1, CV_8UC4, CV_16UC1, CV_16SC1, CV_32FC1), + testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, CV_16SC1, CV_16SC3, CV_16SC4, CV_32FC1), testing::Values(3, 5) ) ) @@ -33,6 +33,31 @@ PERF_TEST_P(Size_MatType_kSize, medianBlur, SANITY_CHECK(dst); } +// Large median kernels (matches IPP perf coverage: ksize 7, 21). +// cv::medianBlur only supports aperture > 5 for CV_8U, so this is 8-bit only. +PERF_TEST_P(Size_MatType_kSize, medianBlur_large, + testing::Combine( + testing::Values(szODD, szQVGA, szVGA, sz720p), + testing::Values(CV_8UC1, CV_8UC3, CV_8UC4), + testing::Values(7, 21) + ) + ) +{ + Size size = get<0>(GetParam()); + int type = get<1>(GetParam()); + int ksize = get<2>(GetParam()); + + Mat src(size, type); + Mat dst(size, type); + + declare.in(src, WARMUP_RNG).out(dst); + declare.time(15); + + TEST_CYCLE() medianBlur(src, dst, ksize); + + SANITY_CHECK(dst); +} + CV_ENUM(BorderType3x3, BORDER_REPLICATE, BORDER_CONSTANT) CV_ENUM(BorderType, BORDER_REPLICATE, BORDER_CONSTANT, BORDER_REFLECT, BORDER_REFLECT101) @@ -52,7 +77,7 @@ typedef perf::TestBaseWithParam Size_MatType_Bo PERF_TEST_P(Size_MatType_BorderType3x3, gaussianBlur3x3, testing::Combine( testing::Values(szODD, szQVGA, szVGA, sz720p), - testing::Values(CV_8UC1, CV_8UC4, CV_16UC1, CV_16SC1, CV_32FC1), + testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16SC1, CV_16SC3, CV_32FC1, CV_32FC3), BorderType3x3::all() ) ) @@ -121,9 +146,9 @@ PERF_TEST_P(Size_MatType_BorderType, blur16x16, PERF_TEST_P(Size_MatType_BorderType_ksize, box, testing::Combine( testing::Values(szODD, szQVGA, szVGA, sz720p), - testing::Values(CV_8UC1, CV_16SC1, CV_32SC1, CV_32FC1, CV_32FC3), + testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, CV_16SC1, CV_16SC3, CV_16SC4, CV_32SC1, CV_32FC1, CV_32FC3, CV_32FC4), BorderType::all(), - testing::Values(3, 5) + testing::Values(3, 5, 7, 21) ) ) { @@ -199,7 +224,7 @@ PERF_TEST_P(Size_MatType_BorderType_ksize, box_inplace, PERF_TEST_P(Size_MatType_BorderType, gaussianBlur5x5, testing::Combine( testing::Values(szODD, szQVGA, szVGA, sz720p), - testing::Values(CV_8UC1, CV_8UC4, CV_16UC1, CV_16SC1, CV_32FC1), + testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16SC1, CV_16SC3, CV_32FC1, CV_32FC3), BorderType::all() ) ) @@ -218,6 +243,32 @@ PERF_TEST_P(Size_MatType_BorderType, gaussianBlur5x5, SANITY_CHECK(dst, 1); } +// Larger Gaussian kernels (matches IPP perf coverage: kernel sizes 7 and 21) +PERF_TEST_P(Size_MatType_BorderType_ksize, gaussianBlur, + testing::Combine( + testing::Values(szVGA, sz720p), + testing::Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16UC3, CV_16SC1, CV_16SC3, CV_32FC1, CV_32FC3), + BorderType::all(), + testing::Values(7, 21) + ) + ) +{ + auto p = GetParam(); + Size size = get<0>(p); + int type = get<1>(p); + BorderType btype = get<2>(p); + int ksize = get<3>(p); + + Mat src(size, type); + Mat dst(size, type); + + declare.in(src, WARMUP_RNG).out(dst); + + TEST_CYCLE() GaussianBlur(src, dst, Size(ksize, ksize), 0, 0, btype); + + SANITY_CHECK(dst, 1); +} + PERF_TEST_P(Size_MatType_BorderType, blur5x5, testing::Combine( testing::Values(szVGA, sz720p), diff --git a/modules/imgproc/perf/perf_corners.cpp b/modules/imgproc/perf/perf_corners.cpp index 38f602107648..2f2536345e3f 100644 --- a/modules/imgproc/perf/perf_corners.cpp +++ b/modules/imgproc/perf/perf_corners.cpp @@ -14,7 +14,7 @@ PERF_TEST_P(Img_BlockSize_ApertureSize_k_BorderType, cornerHarris, testing::Combine( testing::Values( "stitching/a1.png", "cv/shared/pic5.png"), testing::Values( 3, 5 ), - testing::Values( 3, 5 ), + testing::Values( -1, 3, 5 ), // -1 = Scharr aperture testing::Values( 0.04, 0.1 ), BorderType::all() ) @@ -36,6 +36,35 @@ PERF_TEST_P(Img_BlockSize_ApertureSize_k_BorderType, cornerHarris, SANITY_CHECK(dst, 2e-5, ERROR_RELATIVE); } +// 32F source (matches IPP perf coverage: cornerHarris also runs on CV_32FC1 input) +PERF_TEST_P(Img_BlockSize_ApertureSize_k_BorderType, cornerHarris_32f, + testing::Combine( + testing::Values( "stitching/a1.png", "cv/shared/pic5.png"), + testing::Values( 3, 5 ), + testing::Values( -1, 3, 5 ), + testing::Values( 0.04, 0.1 ), + BorderType::all() + ) + ) +{ + string filename = getDataPath(get<0>(GetParam())); + int blockSize = get<1>(GetParam()); + int apertureSize = get<2>(GetParam()); + double k = get<3>(GetParam()); + BorderType borderType = get<4>(GetParam()); + + Mat src8u = imread(filename, IMREAD_GRAYSCALE); + ASSERT_FALSE(src8u.empty()) << "Unable to load source image: " << filename; + Mat src; + src8u.convertTo(src, CV_32F, 1.0 / 255); + + Mat dst; + + TEST_CYCLE() cornerHarris(src, dst, blockSize, apertureSize, k, borderType); + + SANITY_CHECK_NOTHING(); +} + typedef tuple Img_BlockSize_ApertureSize_BorderType_t; typedef perf::TestBaseWithParam Img_BlockSize_ApertureSize_BorderType; @@ -70,7 +99,7 @@ PERF_TEST_P(Img_BlockSize_ApertureSize_BorderType, cornerMinEigenVal, testing::Combine( testing::Values( "stitching/a1.png", "cv/shared/pic5.png"), testing::Values( 3, 5 ), - testing::Values( 3, 5 ), + testing::Values( -1, 3, 5 ), // -1 = Scharr aperture BorderType::all() ) ) @@ -90,4 +119,31 @@ PERF_TEST_P(Img_BlockSize_ApertureSize_BorderType, cornerMinEigenVal, SANITY_CHECK(dst, 2e-5, ERROR_RELATIVE); } +// 32F source (matches IPP perf coverage: cornerMinEigenVal also runs on CV_32FC1 input) +PERF_TEST_P(Img_BlockSize_ApertureSize_BorderType, cornerMinEigenVal_32f, + testing::Combine( + testing::Values( "stitching/a1.png", "cv/shared/pic5.png"), + testing::Values( 3, 5 ), + testing::Values( -1, 3, 5 ), + BorderType::all() + ) + ) +{ + string filename = getDataPath(get<0>(GetParam())); + int blockSize = get<1>(GetParam()); + int apertureSize = get<2>(GetParam()); + BorderType borderType = get<3>(GetParam()); + + Mat src8u = imread(filename, IMREAD_GRAYSCALE); + ASSERT_FALSE(src8u.empty()) << "Unable to load source image: " << filename; + Mat src; + src8u.convertTo(src, CV_32F, 1.0 / 255); + + Mat dst; + + TEST_CYCLE() cornerMinEigenVal(src, dst, blockSize, apertureSize, borderType); + + SANITY_CHECK_NOTHING(); +} + } // namespace diff --git a/modules/imgproc/perf/perf_filter2d.cpp b/modules/imgproc/perf/perf_filter2d.cpp index 6eae9891b87a..379d6014c0e8 100644 --- a/modules/imgproc/perf/perf_filter2d.cpp +++ b/modules/imgproc/perf/perf_filter2d.cpp @@ -39,6 +39,39 @@ PERF_TEST_P( TestFilter2d, Filter2d, SANITY_CHECK(dst, 1); } +// Type/kernel sweep (matches IPP perf coverage: 8U/16U/16S/32F x C1/C3/C4, kernels 3/5/7/21) +typedef TestBaseWithParam< tuple > TestFilter2dTypes; + +PERF_TEST_P( TestFilter2dTypes, Filter2d_types, + Combine( + Values( sz1080p ), + Values( CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, + CV_16SC1, CV_16SC3, CV_16SC4, CV_32FC1, CV_32FC3, CV_32FC4 ), + Values( 3, 5, 7, 21 ), + Values( (int)BORDER_REPLICATE ) + ) +) +{ + Size sz = get<0>(GetParam()); + int type = get<1>(GetParam()); + int kSize = get<2>(GetParam()); + int border = get<3>(GetParam()); + + Mat src(sz, type); + Mat dst(sz, type); + + Mat kernel(kSize, kSize, CV_32FC1); + randu(kernel, -3, 10); + double s = fabs( sum(kernel)[0] ); + if(s > 1e-3) kernel /= s; + + declare.in(src, WARMUP_RNG).out(dst).time(20); + + TEST_CYCLE() cv::filter2D(src, dst, -1, kernel, Point(-1, -1), 0., border); + + SANITY_CHECK_NOTHING(); +} + PERF_TEST_P(TestFilter2d, DISABLED_Filter2d_ovx, Combine( Values(Size(320, 240), sz1080p), diff --git a/modules/imgproc/perf/perf_laplacian.cpp b/modules/imgproc/perf/perf_laplacian.cpp index cacd88d13043..574a1524c996 100644 --- a/modules/imgproc/perf/perf_laplacian.cpp +++ b/modules/imgproc/perf/perf_laplacian.cpp @@ -6,7 +6,8 @@ namespace opencv_test { CV_ENUM(BorderMode, BORDER_CONSTANT, BORDER_REPLICATE, BORDER_REFLECT_101) -CV_ENUM(TargetDepth, CV_8U, CV_16S) +CV_ENUM(TargetDepth, CV_8U, CV_16S, CV_32F) +CV_ENUM(SrcDepth, CV_8U, CV_32F) typedef tuple LaplacianParams; typedef perf::TestBaseWithParam Perf_Laplacian; @@ -15,7 +16,7 @@ PERF_TEST_P(Perf_Laplacian, Laplacian, testing::Combine( testing::Values(szVGA, sz720p, sz1080p), testing::Values(1, 3, 5), // ksize: 1, 3, 5 - TargetDepth::all(), // CV_8U and CV_16S + TargetDepth::all(), // CV_8U, CV_16S and CV_32F BorderMode::all() )) { @@ -25,7 +26,7 @@ PERF_TEST_P(Perf_Laplacian, Laplacian, int borderMode = get<3>(GetParam()); Mat src(sz, CV_8UC1); - Mat dst(sz, ddepth == CV_16S ? CV_16SC1 : CV_8UC1); + Mat dst(sz, ddepth == CV_16S ? CV_16SC1 : ddepth == CV_32F ? CV_32FC1 : CV_8UC1); declare.in(src, WARMUP_RNG).out(dst); @@ -37,4 +38,34 @@ PERF_TEST_P(Perf_Laplacian, Laplacian, SANITY_CHECK(dst); } +// Float source (matches IPP perf coverage: 32F src -> 16S/32F dst) +typedef tuple LaplacianParams32f; +typedef perf::TestBaseWithParam Perf_Laplacian32f; + +PERF_TEST_P(Perf_Laplacian32f, Laplacian, + testing::Combine( + testing::Values(szVGA, sz720p, sz1080p), + testing::Values(1, 3, 5), + testing::Values((int)CV_32F), + BorderMode::all() + )) +{ + Size sz = get<0>(GetParam()); + int ksize = get<1>(GetParam()); + int ddepth = get<2>(GetParam()); + int borderMode = get<3>(GetParam()); + + Mat src(sz, CV_32FC1); + Mat dst(sz, ddepth); + + declare.in(src, WARMUP_RNG).out(dst); + + TEST_CYCLE() + { + cv::Laplacian(src, dst, ddepth, ksize, 1.0, 0.0, borderMode); + } + + SANITY_CHECK_NOTHING(); +} + } // namespace opencv_test \ No newline at end of file diff --git a/modules/imgproc/perf/perf_matchTemplate.cpp b/modules/imgproc/perf/perf_matchTemplate.cpp index 9a50c4cc5d01..026c8ddd32af 100644 --- a/modules/imgproc/perf/perf_matchTemplate.cpp +++ b/modules/imgproc/perf/perf_matchTemplate.cpp @@ -47,6 +47,35 @@ PERF_TEST_P(ImgSize_TmplSize_Method, matchTemplateSmall, SANITY_CHECK(result, eps); } +// 32F source (matches IPP perf coverage: matchTemplate also runs on CV_32FC1 input) +PERF_TEST_P(ImgSize_TmplSize_Method, matchTemplateSmall_32f, + testing::Combine( + testing::Values(cv::Size(320, 240), cv::Size(640, 480), + cv::Size(1024, 768)), + testing::Values(cv::Size(12, 12), cv::Size(16, 16)), + MethodType::all() + ) + ) +{ + Size imgSz = get<0>(GetParam()); + Size tmplSz = get<1>(GetParam()); + int method = get<2>(GetParam()); + + Mat img(imgSz, CV_32FC1); + Mat tmpl(tmplSz, CV_32FC1); + Mat result(imgSz - tmplSz + Size(1,1), CV_32F); + + declare + .in(img, WARMUP_RNG) + .in(tmpl, WARMUP_RNG) + .out(result) + .time(30); + + TEST_CYCLE() matchTemplate(img, tmpl, result, method); + + SANITY_CHECK_NOTHING(); +} + PERF_TEST_P(ImgSize_TmplSize_Method, matchTemplateBig, testing::Combine( testing::Values(cv::Size(1280, 1024)), diff --git a/modules/imgproc/perf/perf_moments.cpp b/modules/imgproc/perf/perf_moments.cpp index 5d9c0366a174..c995b5839c8a 100644 --- a/modules/imgproc/perf/perf_moments.cpp +++ b/modules/imgproc/perf/perf_moments.cpp @@ -15,7 +15,7 @@ typedef perf::TestBaseWithParam MomentsFixture_val; PERF_TEST_P(MomentsFixture_val, Moments1, ::testing::Combine( testing::Values(TYPICAL_MAT_SIZES), - testing::Values(CV_16U, CV_16S, CV_32F, CV_64F), + testing::Values(CV_8U, CV_16U, CV_16S, CV_32F, CV_64F), testing::Bool())) { const MomentsParams_t params = GetParam(); diff --git a/modules/imgproc/perf/perf_morph.cpp b/modules/imgproc/perf/perf_morph.cpp index dc9e975a21fb..2dd991bdce02 100644 --- a/modules/imgproc/perf/perf_morph.cpp +++ b/modules/imgproc/perf/perf_morph.cpp @@ -5,7 +5,7 @@ namespace opencv_test { -#define TYPICAL_MAT_TYPES_MORPH CV_8UC1, CV_8UC4 +#define TYPICAL_MAT_TYPES_MORPH CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16SC1, CV_32FC1, CV_32FC3, CV_32FC4 #define TYPICAL_MATS_MORPH testing::Combine(SZ_ALL_GA, testing::Values(TYPICAL_MAT_TYPES_MORPH)) PERF_TEST_P(Size_MatType, erode, TYPICAL_MATS_MORPH) @@ -39,4 +39,57 @@ PERF_TEST_P(Size_MatType, dilate, TYPICAL_MATS_MORPH) SANITY_CHECK(dst); } +// Parameterized kernel size + iterations (matches IPP perf coverage: +// rect structuring element of size 3/5/7/21, 1 and 3 iterations). +typedef tuple Size_MatType_kSize_iter_t; +typedef perf::TestBaseWithParam Size_MatType_kSize_iter; + +PERF_TEST_P(Size_MatType_kSize_iter, erode_kernel, + testing::Combine( + SZ_ALL_GA, + testing::Values(TYPICAL_MAT_TYPES_MORPH), + testing::Values(3, 5, 7, 21), + testing::Values(1, 3) + )) +{ + Size sz = get<0>(GetParam()); + int type = get<1>(GetParam()); + int ksize = get<2>(GetParam()); + int iters = get<3>(GetParam()); + + Mat src(sz, type); + Mat dst(sz, type); + Mat kernel = getStructuringElement(MORPH_RECT, Size(ksize, ksize)); + + declare.in(src, WARMUP_RNG).out(dst); + + TEST_CYCLE() erode(src, dst, kernel, Point(-1, -1), iters); + + SANITY_CHECK_NOTHING(); +} + +PERF_TEST_P(Size_MatType_kSize_iter, dilate_kernel, + testing::Combine( + SZ_ALL_GA, + testing::Values(TYPICAL_MAT_TYPES_MORPH), + testing::Values(3, 5, 7, 21), + testing::Values(1, 3) + )) +{ + Size sz = get<0>(GetParam()); + int type = get<1>(GetParam()); + int ksize = get<2>(GetParam()); + int iters = get<3>(GetParam()); + + Mat src(sz, type); + Mat dst(sz, type); + Mat kernel = getStructuringElement(MORPH_RECT, Size(ksize, ksize)); + + declare.in(src, WARMUP_RNG).out(dst); + + TEST_CYCLE() dilate(src, dst, kernel, Point(-1, -1), iters); + + SANITY_CHECK_NOTHING(); +} + } // namespace diff --git a/modules/imgproc/perf/perf_sepfilters.cpp b/modules/imgproc/perf/perf_sepfilters.cpp index 480aab9f2014..696a0630d851 100644 --- a/modules/imgproc/perf/perf_sepfilters.cpp +++ b/modules/imgproc/perf/perf_sepfilters.cpp @@ -242,4 +242,57 @@ PERF_TEST_P(Size_MatType_dx_dy_Border3x3ROI, scharrViaSobelFilter, SANITY_CHECK(dst); } +/**************** Sobel / Scharr with 32F source ********************/ +// Matches IPP perf coverage: Sobel/Scharr also run on CV_32FC1 input (32F -> 32F). + +PERF_TEST_P(Size_MatType_dx_dy_Border3x3, sobelFilter_32f, + testing::Combine( + testing::Values(FILTER_SRC_SIZES), + testing::Values(CV_32F), + testing::Values(make_tuple(0, 1), make_tuple(1, 0), make_tuple(1, 1), make_tuple(0, 2), make_tuple(2, 0), make_tuple(2, 2)), + BorderType3x3::all() + ) + ) +{ + Size size = get<0>(GetParam()); + int ddepth = get<1>(GetParam()); + int dx = get<0>(get<2>(GetParam())); + int dy = get<1>(get<2>(GetParam())); + BorderType3x3 border = get<3>(GetParam()); + + Mat src(size, CV_32F); + Mat dst(size, ddepth); + + declare.in(src, WARMUP_RNG).out(dst); + + TEST_CYCLE() Sobel(src, dst, ddepth, dx, dy, 3, 1, 0, border); + + SANITY_CHECK_NOTHING(); +} + +PERF_TEST_P(Size_MatType_dx_dy_Border3x3, scharrFilter_32f, + testing::Combine( + testing::Values(FILTER_SRC_SIZES), + testing::Values(CV_32F), + testing::Values(make_tuple(0, 1), make_tuple(1, 0)), + BorderType3x3::all() + ) + ) +{ + Size size = get<0>(GetParam()); + int ddepth = get<1>(GetParam()); + int dx = get<0>(get<2>(GetParam())); + int dy = get<1>(get<2>(GetParam())); + BorderType3x3 border = get<3>(GetParam()); + + Mat src(size, CV_32F); + Mat dst(size, ddepth); + + declare.in(src, WARMUP_RNG).out(dst); + + TEST_CYCLE() Scharr(src, dst, ddepth, dx, dy, 1, 0, border); + + SANITY_CHECK_NOTHING(); +} + } // namespace From 004e05694b202be0a90dcfed728ddee1af16c3d4 Mon Sep 17 00:00:00 2001 From: "Fedorov, Andrey" Date: Fri, 10 Jul 2026 08:35:39 -0700 Subject: [PATCH 02/12] add more cases --- modules/core/perf/perf_arithm.cpp | 24 +++++++++++++ modules/core/perf/perf_convertTo.cpp | 29 ++++++++++++++++ modules/core/perf/perf_lut.cpp | 27 +++++++++++++++ modules/core/perf/perf_norm.cpp | 4 +-- modules/core/perf/perf_reduce.cpp | 45 +++++++++++++++++++++++++ modules/imgproc/perf/perf_filter2d.cpp | 32 ++++++++++++++++++ modules/imgproc/perf/perf_histogram.cpp | 43 +++++++++++++++++++++++ 7 files changed, 202 insertions(+), 2 deletions(-) diff --git a/modules/core/perf/perf_arithm.cpp b/modules/core/perf/perf_arithm.cpp index 19a3905f8cef..db4d41cc72f9 100644 --- a/modules/core/perf/perf_arithm.cpp +++ b/modules/core/perf/perf_arithm.cpp @@ -830,6 +830,30 @@ INSTANTIATE_TEST_CASE_P(/*nothing*/ , SqrtFixture, ) ); +// Full power sweep (matches IPP perf coverage: cv::pow over a range of exponents) +typedef perf::TestBaseWithParam> PowFixture; +PERF_TEST_P_(PowFixture, Pow) { + Size sz = get<0>(GetParam()); + int type = get<1>(GetParam()); + double power = get<2>(GetParam()); + + Mat src(sz, type), dst(sz, type); + randu(src, FLT_EPSILON, 1000); + declare.in(src).out(dst); + + TEST_CYCLE() cv::pow(src, power, dst); + + SANITY_CHECK_NOTHING(); +} +INSTANTIATE_TEST_CASE_P(/*nothing*/ , PowFixture, + testing::Combine( + testing::Values(sz1080p), + testing::Values(CV_32FC1, CV_64FC1), + testing::Values(-6.0, -5.0, -4.5, -4.0, -3.0, -2.0, -1.0, -0.7, -0.5, 0.0, + 0.5, 0.7, 1.0, 2.0, 3.0, 4.0, 4.5, 5.0, 6.0) + ) +); + ///////////// Rotate //////////////////////// typedef perf::TestBaseWithParam> RotateTest; diff --git a/modules/core/perf/perf_convertTo.cpp b/modules/core/perf/perf_convertTo.cpp index 344d81cb8a59..130718564fa0 100644 --- a/modules/core/perf/perf_convertTo.cpp +++ b/modules/core/perf/perf_convertTo.cpp @@ -38,4 +38,33 @@ PERF_TEST_P( Size_DepthSrc_DepthDst_Channels_alpha, convertTo, SANITY_CHECK(dst, eps); } +// Scale + shift (matches IPP perf coverage: convertTo with a nonzero beta/shift) +PERF_TEST_P( Size_DepthSrc_DepthDst_Channels_alpha, convertTo_scale_shift, + testing::Combine + ( + testing::Values(szVGA, sz1080p), + testing::Values(CV_8U, CV_8S, CV_16U, CV_16S, CV_32S, CV_32F, CV_64F), + testing::Values(CV_8U, CV_8S, CV_16U, CV_16S, CV_32S, CV_32F, CV_64F), + testing::Values(1, 4), + testing::Values(1.0, 1./255) + ) + ) +{ + Size sz = get<0>(GetParam()); + int depthSrc = get<1>(GetParam()); + int depthDst = get<2>(GetParam()); + int channels = get<3>(GetParam()); + double alpha = get<4>(GetParam()); + double beta = 5.0; + + Mat src(sz, CV_MAKETYPE(depthSrc, channels)); + randu(src, 0, 255); + Mat dst(sz, CV_MAKETYPE(depthDst, channels)); + + int runs = (sz.width <= 640) ? 8 : 1; + TEST_CYCLE_MULTIRUN(runs) src.convertTo(dst, depthDst, alpha, beta); + + SANITY_CHECK_NOTHING(); +} + } // namespace diff --git a/modules/core/perf/perf_lut.cpp b/modules/core/perf/perf_lut.cpp index 6f185ac7826a..4e381654ed06 100644 --- a/modules/core/perf/perf_lut.cpp +++ b/modules/core/perf/perf_lut.cpp @@ -43,4 +43,31 @@ PERF_TEST_P( SizePrm, LUT_multi, SANITY_CHECK_NOTHING(); } +// Channel + output-depth sweep (matches IPP perf coverage: +// 8U->8U C1/C3/C4 and 8U->32S C1). +typedef perf::TestBaseWithParam< tuple > Size_MatType_LUT; + +PERF_TEST_P( Size_MatType_LUT, LUT_types, + testing::Combine( + testing::Values(szVGA, sz1080p), + testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_32SC1) + ) + ) +{ + Size sz = get<0>(GetParam()); + int type = get<1>(GetParam()); + int cn = CV_MAT_CN(type); + int lutDepth = CV_MAT_DEPTH(type); + + Mat src(sz, CV_8UC(cn)); + randu(src, 0, 256); + Mat lut(1, 256, CV_MAKETYPE(lutDepth, 1)); + randu(lut, 0, 256); + Mat dst(sz, CV_MAKETYPE(lutDepth, cn)); + + TEST_CYCLE() LUT(src, lut, dst); + + SANITY_CHECK_NOTHING(); +} + }} // namespace diff --git a/modules/core/perf/perf_norm.cpp b/modules/core/perf/perf_norm.cpp index 7b5c92efe036..ab3f98fa50e2 100644 --- a/modules/core/perf/perf_norm.cpp +++ b/modules/core/perf/perf_norm.cpp @@ -60,7 +60,7 @@ PERF_TEST_P(Size_MatType_NormType, norm2, testing::Combine( testing::Values(TYPICAL_MAT_SIZES), testing::Values(CV_8UC1, CV_8UC4, CV_8SC1, CV_16UC1, CV_16SC1, CV_32SC1, CV_32FC1, CV_64FC1), - testing::Values((int)NORM_INF, (int)NORM_L1, (int)NORM_L2, (int)NORM_L2SQR, (int)(NORM_RELATIVE+NORM_INF), (int)(NORM_RELATIVE+NORM_L1), (int)(NORM_RELATIVE+NORM_L2)) + testing::Values((int)NORM_INF, (int)NORM_L1, (int)NORM_L2, (int)NORM_L2SQR, (int)(NORM_RELATIVE+NORM_INF), (int)(NORM_RELATIVE+NORM_L1), (int)(NORM_RELATIVE+NORM_L2), (int)(NORM_RELATIVE+NORM_L2SQR)) ) ) { @@ -83,7 +83,7 @@ PERF_TEST_P(Size_MatType_NormType, norm2_mask, testing::Combine( testing::Values(TYPICAL_MAT_SIZES), testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_8SC1, CV_16UC1, CV_16UC3, CV_16SC1, CV_32SC1, CV_32FC1, CV_32FC3, CV_64FC1), - testing::Values((int)NORM_INF, (int)NORM_L1, (int)NORM_L2, (int)NORM_L2SQR, (int)(NORM_RELATIVE|NORM_INF), (int)(NORM_RELATIVE|NORM_L1), (int)(NORM_RELATIVE|NORM_L2)) + testing::Values((int)NORM_INF, (int)NORM_L1, (int)NORM_L2, (int)NORM_L2SQR, (int)(NORM_RELATIVE|NORM_INF), (int)(NORM_RELATIVE|NORM_L1), (int)(NORM_RELATIVE|NORM_L2), (int)(NORM_RELATIVE|NORM_L2SQR)) ) ) { diff --git a/modules/core/perf/perf_reduce.cpp b/modules/core/perf/perf_reduce.cpp index 01732f899d63..d6c98ca923f8 100644 --- a/modules/core/perf/perf_reduce.cpp +++ b/modules/core/perf/perf_reduce.cpp @@ -64,6 +64,51 @@ PERF_TEST_P(Size_MatType_ROp, reduceC, SANITY_CHECK_NOTHING(); } +// Explicit src->dst depth reduce (matches IPP ippReduce_Diff perf coverage: +// SUM/AVG with an explicit output depth over src/dst depth pairs x C1/C3/C4). +CV_ENUM(ROpDiff, REDUCE_SUM, REDUCE_AVG) +typedef tuple, ROpDiff, int> Size_SrcType_DstDepth_ROp_Dim_t; +typedef perf::TestBaseWithParam Size_SrcType_DstDepth_ROp_Dim; + +PERF_TEST_P(Size_SrcType_DstDepth_ROp_Dim, reduce_diff, + testing::Combine( + testing::Values(sz1080p), + testing::Values( + make_tuple((MatType)CV_8UC1, (MatDepth)CV_32S), make_tuple((MatType)CV_8UC3, (MatDepth)CV_32S), make_tuple((MatType)CV_8UC4, (MatDepth)CV_32S), + make_tuple((MatType)CV_8UC1, (MatDepth)CV_32F), make_tuple((MatType)CV_8UC3, (MatDepth)CV_32F), make_tuple((MatType)CV_8UC4, (MatDepth)CV_32F), + make_tuple((MatType)CV_8UC1, (MatDepth)CV_64F), make_tuple((MatType)CV_8UC3, (MatDepth)CV_64F), make_tuple((MatType)CV_8UC4, (MatDepth)CV_64F), + make_tuple((MatType)CV_16UC1, (MatDepth)CV_32F), make_tuple((MatType)CV_16UC3, (MatDepth)CV_32F), make_tuple((MatType)CV_16UC4, (MatDepth)CV_32F), + make_tuple((MatType)CV_16UC1, (MatDepth)CV_64F), make_tuple((MatType)CV_16UC3, (MatDepth)CV_64F), make_tuple((MatType)CV_16UC4, (MatDepth)CV_64F), + make_tuple((MatType)CV_16SC1, (MatDepth)CV_32F), make_tuple((MatType)CV_16SC3, (MatDepth)CV_32F), make_tuple((MatType)CV_16SC4, (MatDepth)CV_32F), + make_tuple((MatType)CV_16SC1, (MatDepth)CV_64F), make_tuple((MatType)CV_16SC3, (MatDepth)CV_64F), make_tuple((MatType)CV_16SC4, (MatDepth)CV_64F), + make_tuple((MatType)CV_32FC1, (MatDepth)CV_32F), make_tuple((MatType)CV_32FC3, (MatDepth)CV_32F), make_tuple((MatType)CV_32FC4, (MatDepth)CV_32F), + make_tuple((MatType)CV_32FC1, (MatDepth)CV_64F), make_tuple((MatType)CV_32FC3, (MatDepth)CV_64F), make_tuple((MatType)CV_32FC4, (MatDepth)CV_64F), + make_tuple((MatType)CV_64FC1, (MatDepth)CV_64F), make_tuple((MatType)CV_64FC3, (MatDepth)CV_64F), make_tuple((MatType)CV_64FC4, (MatDepth)CV_64F)), + ROpDiff::all(), + testing::Values(0, 1) // reduce dim: 0 = rows, 1 = columns + ) + ) +{ + Size sz = get<0>(GetParam()); + int srcType = get<0>(get<1>(GetParam())); + int dstDepth = get<1>(get<1>(GetParam())); + int reduceOp = get<2>(GetParam()); + int dim = get<3>(GetParam()); + + int cn = CV_MAT_CN(srcType); + Size dstSize = (dim == 0) ? Size(sz.width, 1) : Size(1, sz.height); + + Mat src(sz, srcType); + Mat vec(dstSize, CV_MAKETYPE(dstDepth, cn)); + + declare.in(src, WARMUP_RNG).out(vec); + declare.time(100); + + TEST_CYCLE_MULTIRUN(15) reduce(src, vec, dim, reduceOp, dstDepth); + + SANITY_CHECK_NOTHING(); +} + typedef tuple Size_MatType_RMode_t; typedef perf::TestBaseWithParam Size_MatType_RMode; diff --git a/modules/imgproc/perf/perf_filter2d.cpp b/modules/imgproc/perf/perf_filter2d.cpp index 379d6014c0e8..54bc4353a078 100644 --- a/modules/imgproc/perf/perf_filter2d.cpp +++ b/modules/imgproc/perf/perf_filter2d.cpp @@ -72,6 +72,38 @@ PERF_TEST_P( TestFilter2dTypes, Filter2d_types, SANITY_CHECK_NOTHING(); } +// sepFilter2D type/kernel sweep (matches IPP ippSepFilter2D perf coverage: +// 8U/16U/16S/32F x C1/C3/C4, kernels 3/5/7/21, same-depth output). +PERF_TEST_P( TestFilter2dTypes, sepFilter2D_types, + Combine( + Values( sz1080p ), + Values( CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, + CV_16SC1, CV_16SC3, CV_16SC4, CV_32FC1, CV_32FC3, CV_32FC4 ), + Values( 3, 5, 7, 21 ), + Values( (int)BORDER_REPLICATE ) + ) +) +{ + Size sz = get<0>(GetParam()); + int type = get<1>(GetParam()); + int kSize = get<2>(GetParam()); + int border = get<3>(GetParam()); + + Mat src(sz, type); + Mat dst(sz, type); + + Mat kernelX(1, kSize, CV_32FC1); + Mat kernelY(1, kSize, CV_32FC1); + randu(kernelX, -6, 6); + randu(kernelY, -6, 6); + + declare.in(src, WARMUP_RNG).out(dst).time(20); + + TEST_CYCLE() cv::sepFilter2D(src, dst, -1, kernelX, kernelY, Point(-1, -1), 0., border); + + SANITY_CHECK_NOTHING(); +} + PERF_TEST_P(TestFilter2d, DISABLED_Filter2d_ovx, Combine( Values(Size(320, 240), sz1080p), diff --git a/modules/imgproc/perf/perf_histogram.cpp b/modules/imgproc/perf/perf_histogram.cpp index d80d8a6d517f..921aef56fe0b 100644 --- a/modules/imgproc/perf/perf_histogram.cpp +++ b/modules/imgproc/perf/perf_histogram.cpp @@ -41,6 +41,49 @@ PERF_TEST_P(Size_Source, calcHist1d, SANITY_CHECK(hist); } +// Non-uniform ranges + accumulate (matches IPP perf coverage: calcHist sweeps +// uniform ∈ {true,false} × accumulate ∈ {true,false}). +typedef tuple Size_Source_Uniform_Accum_t; +typedef TestBaseWithParam Size_Source_Uniform_Accum; + +PERF_TEST_P(Size_Source_Uniform_Accum, calcHist1d_mode, + testing::Combine(testing::Values(sz3MP, sz5MP), + testing::Values(CV_8U, CV_16U, CV_32F), + testing::Bool(), // uniform + testing::Bool()) ) // accumulate +{ + Size size = get<0>(GetParam()); + MatType type = get<1>(GetParam()); + bool uniform = get<2>(GetParam()); + bool accumulate = get<3>(GetParam()); + + Mat source(size.height, size.width, type); + Mat hist; + int channels [] = {0}; + const int bins = 256; + int histSize [] = {bins}; + int dims = 1; + int numberOfImages = 1; + + randu(source, rangeLow, rangeHight); + + // Uniform ranges use the {low, high} form; non-uniform needs explicit bin edges. + const float uni[] = {rangeLow, rangeHight}; + std::vector edges(bins + 1); + for (int i = 0; i <= bins; ++i) + edges[i] = rangeLow + (rangeHight - rangeLow) * i / bins; + const float* ranges[] = { uniform ? uni : edges.data() }; + + declare.in(source); + + TEST_CYCLE_MULTIRUN(3) + { + calcHist(&source, numberOfImages, channels, Mat(), hist, dims, histSize, ranges, uniform, accumulate); + } + + SANITY_CHECK_NOTHING(); +} + PERF_TEST_P(Size_Source, calcHist2d, testing::Combine(testing::Values(sz3MP, sz5MP), testing::Values(CV_8UC2, CV_16UC2, CV_32FC2) ) From cf08d88412c7cc44d0566721fc3185457922cad0 Mon Sep 17 00:00:00 2001 From: "Fedorov, Andrey" Date: Mon, 13 Jul 2026 05:23:41 -0700 Subject: [PATCH 03/12] fixed issues. tests are passed --- modules/core/perf/perf_convertTo.cpp | 5 ++++- modules/core/perf/perf_lut.cpp | 2 +- modules/core/perf/perf_reduce.cpp | 21 +++++++++++++++++++-- modules/imgproc/perf/perf_filter2d.cpp | 2 +- modules/imgproc/perf/perf_histogram.cpp | 2 +- modules/imgproc/perf/perf_morph.cpp | 4 ++-- 6 files changed, 28 insertions(+), 8 deletions(-) diff --git a/modules/core/perf/perf_convertTo.cpp b/modules/core/perf/perf_convertTo.cpp index 130718564fa0..6103eccb38f7 100644 --- a/modules/core/perf/perf_convertTo.cpp +++ b/modules/core/perf/perf_convertTo.cpp @@ -61,10 +61,13 @@ PERF_TEST_P( Size_DepthSrc_DepthDst_Channels_alpha, convertTo_scale_shift, randu(src, 0, 255); Mat dst(sz, CV_MAKETYPE(depthDst, channels)); + int maxValue = 255; int runs = (sz.width <= 640) ? 8 : 1; TEST_CYCLE_MULTIRUN(runs) src.convertTo(dst, depthDst, alpha, beta); - SANITY_CHECK_NOTHING(); + double eps = depthSrc <= CV_32S && (depthDst <= CV_32S || depthDst == CV_64F) ? 1e-12 : (FLT_EPSILON * maxValue); + eps = eps * std::max(1.0, fabs(alpha)) + fabs(beta); + SANITY_CHECK(dst, eps); } } // namespace diff --git a/modules/core/perf/perf_lut.cpp b/modules/core/perf/perf_lut.cpp index 4e381654ed06..abbc7b9daaf4 100644 --- a/modules/core/perf/perf_lut.cpp +++ b/modules/core/perf/perf_lut.cpp @@ -67,7 +67,7 @@ PERF_TEST_P( Size_MatType_LUT, LUT_types, TEST_CYCLE() LUT(src, lut, dst); - SANITY_CHECK_NOTHING(); + SANITY_CHECK(dst); } }} // namespace diff --git a/modules/core/perf/perf_reduce.cpp b/modules/core/perf/perf_reduce.cpp index d6c98ca923f8..da6abc5c670e 100644 --- a/modules/core/perf/perf_reduce.cpp +++ b/modules/core/perf/perf_reduce.cpp @@ -21,8 +21,18 @@ PERF_TEST_P(Size_MatType_ROp, reduceR, int matType = get<1>(GetParam()); int reduceOp = get<2>(GetParam()); + int sdepth = CV_MAT_DEPTH(matType); + bool accumulate = (reduceOp == REDUCE_SUM || reduceOp == REDUCE_AVG || reduceOp == REDUCE_SUM2); + + // Accumulate ops (SUM/AVG/SUM2) over 16U/16S need a floating-point output; + // that depth-changing coverage is exercised by the reduce_diff test below. + // Here we keep the same-depth path: MAX/MIN for all types, and SUM/AVG for + // 8U (->32S) and float types. + if( accumulate && (sdepth == CV_16U || sdepth == CV_16S) ) + throw ::perf::TestBase::PerfSkipTestException(); + int ddepth = -1; - if( CV_MAT_DEPTH(matType) < CV_32S && (reduceOp == REDUCE_SUM || reduceOp == REDUCE_AVG || reduceOp == REDUCE_SUM2) ) + if( accumulate && sdepth < CV_32S ) ddepth = CV_32S; Mat src(sz, matType); @@ -49,8 +59,15 @@ PERF_TEST_P(Size_MatType_ROp, reduceC, int matType = get<1>(GetParam()); int reduceOp = get<2>(GetParam()); + int sdepth = CV_MAT_DEPTH(matType); + bool accumulate = (reduceOp == REDUCE_SUM || reduceOp == REDUCE_AVG || reduceOp == REDUCE_SUM2); + + // See reduceR: accumulate ops over 16U/16S are covered by reduce_diff. + if( accumulate && (sdepth == CV_16U || sdepth == CV_16S) ) + throw ::perf::TestBase::PerfSkipTestException(); + int ddepth = -1; - if( CV_MAT_DEPTH(matType)< CV_32S && (reduceOp == REDUCE_SUM || reduceOp == REDUCE_AVG || reduceOp == REDUCE_SUM2) ) + if( accumulate && sdepth < CV_32S ) ddepth = CV_32S; Mat src(sz, matType); diff --git a/modules/imgproc/perf/perf_filter2d.cpp b/modules/imgproc/perf/perf_filter2d.cpp index 54bc4353a078..43b789a872b5 100644 --- a/modules/imgproc/perf/perf_filter2d.cpp +++ b/modules/imgproc/perf/perf_filter2d.cpp @@ -69,7 +69,7 @@ PERF_TEST_P( TestFilter2dTypes, Filter2d_types, TEST_CYCLE() cv::filter2D(src, dst, -1, kernel, Point(-1, -1), 0., border); - SANITY_CHECK_NOTHING(); + SANITY_CHECK(dst, 1); } // sepFilter2D type/kernel sweep (matches IPP ippSepFilter2D perf coverage: diff --git a/modules/imgproc/perf/perf_histogram.cpp b/modules/imgproc/perf/perf_histogram.cpp index 921aef56fe0b..da84912096f8 100644 --- a/modules/imgproc/perf/perf_histogram.cpp +++ b/modules/imgproc/perf/perf_histogram.cpp @@ -81,7 +81,7 @@ PERF_TEST_P(Size_Source_Uniform_Accum, calcHist1d_mode, calcHist(&source, numberOfImages, channels, Mat(), hist, dims, histSize, ranges, uniform, accumulate); } - SANITY_CHECK_NOTHING(); + SANITY_CHECK(hist); } PERF_TEST_P(Size_Source, calcHist2d, diff --git a/modules/imgproc/perf/perf_morph.cpp b/modules/imgproc/perf/perf_morph.cpp index 2dd991bdce02..64f55225adfd 100644 --- a/modules/imgproc/perf/perf_morph.cpp +++ b/modules/imgproc/perf/perf_morph.cpp @@ -65,7 +65,7 @@ PERF_TEST_P(Size_MatType_kSize_iter, erode_kernel, TEST_CYCLE() erode(src, dst, kernel, Point(-1, -1), iters); - SANITY_CHECK_NOTHING(); + SANITY_CHECK(dst); } PERF_TEST_P(Size_MatType_kSize_iter, dilate_kernel, @@ -89,7 +89,7 @@ PERF_TEST_P(Size_MatType_kSize_iter, dilate_kernel, TEST_CYCLE() dilate(src, dst, kernel, Point(-1, -1), iters); - SANITY_CHECK_NOTHING(); + SANITY_CHECK(dst); } } // namespace From f9eeec50db26067740964619d02ef2c8bd561c39 Mon Sep 17 00:00:00 2001 From: "Fedorov, Andrey" Date: Mon, 13 Jul 2026 08:51:21 -0700 Subject: [PATCH 04/12] added more core tests --- modules/core/perf/perf_arithm.cpp | 90 ++++++++++++++++++++++++++++ modules/core/perf/perf_bitwise.cpp | 50 ++++++++++++++++ modules/core/perf/perf_channels.cpp | 53 ++++++++++++++++ modules/core/perf/perf_convertTo.cpp | 36 +++++++++++ modules/core/perf/perf_flip.cpp | 26 ++++++++ modules/core/perf/perf_minmaxloc.cpp | 75 +++++++++++++++++++++++ modules/core/perf/perf_sort.cpp | 22 +++++++ 7 files changed, 352 insertions(+) create mode 100644 modules/core/perf/perf_channels.cpp diff --git a/modules/core/perf/perf_arithm.cpp b/modules/core/perf/perf_arithm.cpp index db4d41cc72f9..4c42cd9c9e60 100644 --- a/modules/core/perf/perf_arithm.cpp +++ b/modules/core/perf/perf_arithm.cpp @@ -394,6 +394,26 @@ PERF_TEST_P_(BinaryOpTest, multiplyScale) SANITY_CHECK_NOTHING(); } +// Scalar-operand multiply (matches IPP ippMultiply_Const: multiply(mat, Scalar)) +PERF_TEST_P_(BinaryOpTest, multiplyScalar) +{ + Size sz = get<0>(GetParam()); + int type = get<1>(GetParam()); + cv::Mat a(sz, type), c(sz, type); + cv::Scalar s = 1.333; + + declare.in(a, WARMUP_RNG).out(c); + if (CV_MAT_DEPTH(type) == CV_32S) + { + a /= (2 << 16); + s = 2.0; + } + + TEST_CYCLE() cv::multiply(a, s, c); + + SANITY_CHECK_NOTHING(); +} + PERF_TEST_P_(BinaryOpTest, divide) { Size sz = get<0>(GetParam()); @@ -460,6 +480,36 @@ INSTANTIATE_TEST_CASE_P(/*nothing*/ , TransposeMultiChannelTest, ) ); +// In-place transpose (matches IPP ippTranspose_Inplace: transpose(dst, dst)). +// In-place transpose requires a square matrix. +typedef Size_MatType TransposeInplaceTest; + +PERF_TEST_P_(TransposeInplaceTest, transpose2d_inplace) +{ + Size sz = get<0>(GetParam()); + int type = get<1>(GetParam()); + cv::Mat a(sz, type), b(sz, type); + + declare.in(a, WARMUP_RNG).out(b); + + while (next()) + { + a.copyTo(b); + startTimer(); + cv::transpose(b, b); + stopTimer(); + } + + SANITY_CHECK_NOTHING(); +} + +INSTANTIATE_TEST_CASE_P(/*nothing*/ , TransposeInplaceTest, + testing::Combine( + testing::Values(cv::Size(1280, 1280), cv::Size(1920, 1920)), + testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, CV_32FC1, CV_32FC3, CV_32FC4) + ) +); + static cv::Mat makeTransposeNDOutput(const cv::Mat& src, const std::vector& order) { std::vector new_sz(order.size()); @@ -808,6 +858,46 @@ INSTANTIATE_TEST_CASE_P(/*nothing*/ , ArithmMixedTest, ) ); +// add/subtract with two mixed input depths + explicit output depth +// (matches IPP ippAdd_Scale / ippSubtract_Scale: add(src1{8U/16U/16S}, src2{16U}, +// dst, noArray(), CV_32F)). +typedef perf::TestBaseWithParam> ArithmScaleTest; + +PERF_TEST_P_(ArithmScaleTest, add_scale) +{ + auto p = GetParam(); + Size sz = get<0>(p); + int src1Type = get<1>(p); + + cv::Mat a(sz, src1Type), b(sz, CV_16UC1), c(sz, CV_32FC1); + declare.in(a, b, WARMUP_RNG).out(c); + + TEST_CYCLE() cv::add(a, b, c, noArray(), CV_32F); + + SANITY_CHECK_NOTHING(); +} + +PERF_TEST_P_(ArithmScaleTest, subtract_scale) +{ + auto p = GetParam(); + Size sz = get<0>(p); + int src1Type = get<1>(p); + + cv::Mat a(sz, src1Type), b(sz, CV_16UC1), c(sz, CV_32FC1); + declare.in(a, b, WARMUP_RNG).out(c); + + TEST_CYCLE() cv::subtract(a, b, c, noArray(), CV_32F); + + SANITY_CHECK_NOTHING(); +} + +INSTANTIATE_TEST_CASE_P(/*nothing*/ , ArithmScaleTest, + testing::Combine( + testing::Values(szVGA, sz720p, sz1080p), + testing::Values((perf::MatType)CV_8UC1, (perf::MatType)CV_16UC1, (perf::MatType)CV_16SC1) + ) +); + typedef perf::TestBaseWithParam> SqrtFixture; PERF_TEST_P_(SqrtFixture, Sqrt) { Size sz = get<0>(GetParam()); diff --git a/modules/core/perf/perf_bitwise.cpp b/modules/core/perf/perf_bitwise.cpp index ed1279af545e..54775c011216 100644 --- a/modules/core/perf/perf_bitwise.cpp +++ b/modules/core/perf/perf_bitwise.cpp @@ -72,4 +72,54 @@ PERF_TEST_P(Size_MatType, bitwise_xor, TYPICAL_MATS_BITW_ARITHM) SANITY_CHECK(c); } +// Scalar-operand bitwise ops (matches IPP ippBitwise{And,Or,Xor}_Const: +// bitwise_*(mat, Scalar)). +PERF_TEST_P(Size_MatType, bitwise_and_scalar, TYPICAL_MATS_BITW_ARITHM) +{ + Size sz = get<0>(GetParam()); + int type = get<1>(GetParam()); + cv::Mat a = Mat(sz, type); + cv::Mat c = Mat(sz, type); + cv::Scalar s = Scalar::all(50); + + declare.in(a, WARMUP_RNG).out(c); + declare.time(100); + + TEST_CYCLE() cv::bitwise_and(a, s, c); + + SANITY_CHECK(c); +} + +PERF_TEST_P(Size_MatType, bitwise_or_scalar, TYPICAL_MATS_BITW_ARITHM) +{ + Size sz = get<0>(GetParam()); + int type = get<1>(GetParam()); + cv::Mat a = Mat(sz, type); + cv::Mat c = Mat(sz, type); + cv::Scalar s = Scalar::all(50); + + declare.in(a, WARMUP_RNG).out(c); + declare.time(100); + + TEST_CYCLE() cv::bitwise_or(a, s, c); + + SANITY_CHECK(c); +} + +PERF_TEST_P(Size_MatType, bitwise_xor_scalar, TYPICAL_MATS_BITW_ARITHM) +{ + Size sz = get<0>(GetParam()); + int type = get<1>(GetParam()); + cv::Mat a = Mat(sz, type); + cv::Mat c = Mat(sz, type); + cv::Scalar s = Scalar::all(50); + + declare.in(a, WARMUP_RNG).out(c); + declare.time(100); + + TEST_CYCLE() cv::bitwise_xor(a, s, c); + + SANITY_CHECK(c); +} + } // namespace diff --git a/modules/core/perf/perf_channels.cpp b/modules/core/perf/perf_channels.cpp new file mode 100644 index 000000000000..65d2cc6e8481 --- /dev/null +++ b/modules/core/perf/perf_channels.cpp @@ -0,0 +1,53 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this distribution and at http://opencv.org/license.html. +#include "perf_precomp.hpp" + +namespace opencv_test +{ +using namespace perf; + +typedef tuple Size_MatType_t; +typedef perf::TestBaseWithParam Size_MatType_Channels; + +PERF_TEST_P(Size_MatType_Channels, extractChannel, + testing::Combine( + testing::Values(TYPICAL_MAT_SIZES), + testing::Values(CV_8UC3, CV_8UC4, CV_16UC3, CV_16UC4, CV_32FC3, CV_32FC4) + )) +{ + Size sz = get<0>(GetParam()); + int type = get<1>(GetParam()); + + Mat src(sz, type); + Mat dst(sz, CV_MAKETYPE(CV_MAT_DEPTH(type), 1)); + + declare.in(src, WARMUP_RNG).out(dst); + + int coi = CV_MAT_CN(type) - 1; + TEST_CYCLE_MULTIRUN(10) cv::extractChannel(src, dst, coi); + + SANITY_CHECK_NOTHING(); +} + +PERF_TEST_P(Size_MatType_Channels, insertChannel, + testing::Combine( + testing::Values(TYPICAL_MAT_SIZES), + testing::Values(CV_8UC3, CV_8UC4, CV_16UC3, CV_16UC4, CV_32FC3, CV_32FC4) + )) +{ + Size sz = get<0>(GetParam()); + int type = get<1>(GetParam()); + + Mat src(sz, CV_MAKETYPE(CV_MAT_DEPTH(type), 1)); + Mat dst(sz, type); + + declare.in(src, WARMUP_RNG).out(dst); + + int coi = CV_MAT_CN(type) - 1; + TEST_CYCLE_MULTIRUN(10) cv::insertChannel(src, dst, coi); + + SANITY_CHECK_NOTHING(); +} + +} // namespace diff --git a/modules/core/perf/perf_convertTo.cpp b/modules/core/perf/perf_convertTo.cpp index 6103eccb38f7..7211e0459a28 100644 --- a/modules/core/perf/perf_convertTo.cpp +++ b/modules/core/perf/perf_convertTo.cpp @@ -70,4 +70,40 @@ PERF_TEST_P( Size_DepthSrc_DepthDst_Channels_alpha, convertTo_scale_shift, SANITY_CHECK(dst, eps); } +// In-place convertTo with scale+shift (matches IPP ippConvertTo_ScaleInplace: +// dst.convertTo(dst, sameType, scale, shift)). In-place requires src type==dst type. +typedef tuple Size_Depth_alpha_t; +typedef perf::TestBaseWithParam Size_Depth_alpha; + +PERF_TEST_P( Size_Depth_alpha, convertTo_scale_shift_inplace, + testing::Combine + ( + testing::Values(szVGA, sz1080p), + testing::Values(CV_8U, CV_8S, CV_16U, CV_16S, CV_32S, CV_32F, CV_64F), + testing::Values(1.0, 1./255) + ) + ) +{ + Size sz = get<0>(GetParam()); + int depth = get<1>(GetParam()); + double alpha = get<2>(GetParam()); + double beta = 5.0; + + Mat src(sz, CV_MAKETYPE(depth, 1)); + randu(src, 0, 255); + Mat dst(sz, CV_MAKETYPE(depth, 1)); + + int runs = (sz.width <= 640) ? 8 : 1; + while (next()) + { + src.copyTo(dst); + startTimer(); + for (int i = 0; i < runs; ++i) + dst.convertTo(dst, depth, alpha, beta); + stopTimer(); + } + + SANITY_CHECK_NOTHING(); +} + } // namespace diff --git a/modules/core/perf/perf_flip.cpp b/modules/core/perf/perf_flip.cpp index 9e3539c65a58..b0eaeb0a4917 100644 --- a/modules/core/perf/perf_flip.cpp +++ b/modules/core/perf/perf_flip.cpp @@ -42,4 +42,30 @@ PERF_TEST_P(Size_MatType_FlipCode, SANITY_CHECK_NOTHING(); } +// In-place flip (matches IPP ippFlip_Inplace: flip(dst, dst, ...)) +PERF_TEST_P(Size_MatType_FlipCode, + flip_inplace, + testing::Combine(testing::Values(FLIP_SIZES), + testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, CV_32FC1, CV_32FC3, CV_32FC4), + testing::Values(FLIP_CODES))) +{ + Size sz = get<0>(GetParam()); + int matType = get<1>(GetParam()); + int flipCode = get<2>(GetParam()) - 1; + + Mat src(sz, matType); + Mat dst(sz, matType); + declare.in(src, WARMUP_RNG).out(dst); + + while (next()) + { + src.copyTo(dst); + startTimer(); + cv::flip(dst, dst, flipCode); + stopTimer(); + } + + SANITY_CHECK_NOTHING(); +} + }} // namespace opencv_test diff --git a/modules/core/perf/perf_minmaxloc.cpp b/modules/core/perf/perf_minmaxloc.cpp index 9fc605233cdf..965e0a919d7e 100644 --- a/modules/core/perf/perf_minmaxloc.cpp +++ b/modules/core/perf/perf_minmaxloc.cpp @@ -32,4 +32,79 @@ PERF_TEST_P(Size_MatType, minMaxLoc, testing::Combine( SANITY_CHECK(maxVal, 1e-12); } +// minMaxIdx (n-dim min/max + linear index), with the null-pointer combinations +// IPP exercises: which of {min, max, min-idx, max-idx} outputs are requested. +enum +{ + MMI_MIN = 0x1, + MMI_MAX = 0x2, + MMI_IDX = 0x4, + MMI_MIN_IDX = MMI_MIN | MMI_IDX, + MMI_MAX_IDX = MMI_MAX | MMI_IDX, + MMI_MIN_MAX = MMI_MIN | MMI_MAX, + MMI_ALL = MMI_MIN_IDX | MMI_MAX_IDX, +}; +CV_ENUM(MinMaxType, MMI_ALL, MMI_MIN_MAX, MMI_MIN_IDX, MMI_MAX_IDX) + +typedef tuple Size_MatType_MinMaxType_t; +typedef perf::TestBaseWithParam Size_MatType_MinMaxType; + +PERF_TEST_P(Size_MatType_MinMaxType, minMaxIdx, testing::Combine( + testing::Values(TYPICAL_MAT_SIZES), + testing::Values(CV_8UC1, CV_16UC1, CV_16SC1, CV_32FC1), + MinMaxType::all() + ) + ) +{ + Size sz = get<0>(GetParam()); + int matType = get<1>(GetParam()); + int flags = get<2>(GetParam()); + + Mat src(sz, matType); + double minVal = 0, maxVal = 0; + int minIdx[2] = {0}, maxIdx[2] = {0}; + + double *pMinVal = (flags & MMI_MIN) ? &minVal : NULL; + double *pMaxVal = (flags & MMI_MAX) ? &maxVal : NULL; + int *pMinIdx = ((flags & MMI_MIN) && (flags & MMI_IDX)) ? minIdx : NULL; + int *pMaxIdx = ((flags & MMI_MAX) && (flags & MMI_IDX)) ? maxIdx : NULL; + + // middle of the range to avoid early-exit short-cuts + randu(src, 1, 155); + declare.in(src); + + TEST_CYCLE() cv::minMaxIdx(src, pMinVal, pMaxVal, pMinIdx, pMaxIdx); + + SANITY_CHECK_NOTHING(); +} + +PERF_TEST_P(Size_MatType_MinMaxType, minMaxIdx_mask, testing::Combine( + testing::Values(TYPICAL_MAT_SIZES), + testing::Values(CV_8UC1, CV_16UC1, CV_16SC1, CV_32FC1), + MinMaxType::all() + ) + ) +{ + Size sz = get<0>(GetParam()); + int matType = get<1>(GetParam()); + int flags = get<2>(GetParam()); + + Mat src(sz, matType); + Mat mask = Mat::ones(sz, CV_8UC1); + double minVal = 0, maxVal = 0; + int minIdx[2] = {0}, maxIdx[2] = {0}; + + double *pMinVal = (flags & MMI_MIN) ? &minVal : NULL; + double *pMaxVal = (flags & MMI_MAX) ? &maxVal : NULL; + int *pMinIdx = ((flags & MMI_MIN) && (flags & MMI_IDX)) ? minIdx : NULL; + int *pMaxIdx = ((flags & MMI_MAX) && (flags & MMI_IDX)) ? maxIdx : NULL; + + randu(src, 1, 155); + declare.in(src).in(mask); + + TEST_CYCLE() cv::minMaxIdx(src, pMinVal, pMaxVal, pMinIdx, pMaxIdx, mask); + + SANITY_CHECK_NOTHING(); +} + } // namespace diff --git a/modules/core/perf/perf_sort.cpp b/modules/core/perf/perf_sort.cpp index 2fcc08924c67..d7eeb36c413b 100644 --- a/modules/core/perf/perf_sort.cpp +++ b/modules/core/perf/perf_sort.cpp @@ -27,6 +27,28 @@ PERF_TEST_P(sortFixture, sort, TYPICAL_MATS_SORT) SANITY_CHECK(b); } +// In-place sort (matches IPP ippSort_Inplace: sort(dst, dst, flags)) +PERF_TEST_P(sortFixture, sort_inplace, TYPICAL_MATS_SORT) +{ + const sortParams params = GetParam(); + const Size sz = get<0>(params); + const int type = get<1>(params), flags = get<2>(params); + + cv::Mat a(sz, type), b(sz, type); + + declare.in(a, WARMUP_RNG).out(b); + + while (next()) + { + a.copyTo(b); + startTimer(); + cv::sort(b, b, flags); + stopTimer(); + } + + SANITY_CHECK(b); +} + typedef sortFixture sortIdxFixture; PERF_TEST_P(sortIdxFixture, sorIdx, TYPICAL_MATS_SORT) From 99f5d14a0ec276ace531bded4da676749e94c010 Mon Sep 17 00:00:00 2001 From: "Fedorov, Andrey" Date: Tue, 14 Jul 2026 04:38:49 -0700 Subject: [PATCH 05/12] add more imgproc perf tests --- modules/imgproc/perf/perf_blur.cpp | 32 +++++++++ modules/imgproc/perf/perf_canny.cpp | 32 +++++++++ modules/imgproc/perf/perf_copymakeborder.cpp | 71 ++++++++++++++++++++ modules/imgproc/perf/perf_getrectsubpix.cpp | 41 +++++++++++ modules/imgproc/perf/perf_morph.cpp | 32 +++++++++ modules/imgproc/perf/perf_resize.cpp | 31 +++++++++ modules/imgproc/perf/perf_threshold.cpp | 32 +++++++++ 7 files changed, 271 insertions(+) create mode 100644 modules/imgproc/perf/perf_copymakeborder.cpp create mode 100644 modules/imgproc/perf/perf_getrectsubpix.cpp diff --git a/modules/imgproc/perf/perf_blur.cpp b/modules/imgproc/perf/perf_blur.cpp index 67a544332418..b1dc2436ec8e 100644 --- a/modules/imgproc/perf/perf_blur.cpp +++ b/modules/imgproc/perf/perf_blur.cpp @@ -58,6 +58,38 @@ PERF_TEST_P(Size_MatType_kSize, medianBlur_large, SANITY_CHECK(dst); } +// In-place median blur (matches IPP ippMedianBlur_Inplace: medianBlur(dst, dst, k)). +// ksize 3/5 for all listed types (ksize > 5 is 8-bit only, covered by _large above). +PERF_TEST_P(Size_MatType_kSize, medianBlur_inplace, + testing::Combine( + testing::Values(szODD, szQVGA, szVGA, sz720p), + testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16SC1, CV_16SC3, CV_32FC1), + testing::Values(3, 5) + ) + ) +{ + Size size = get<0>(GetParam()); + int type = get<1>(GetParam()); + int ksize = get<2>(GetParam()); + + Mat src(size, type); + Mat dst(size, type); + + declare.in(src, WARMUP_RNG).out(dst); + if (CV_MAT_DEPTH(type) > CV_16S || CV_MAT_CN(type) > 1) + declare.time(15); + + while (next()) + { + src.copyTo(dst); + startTimer(); + cv::medianBlur(dst, dst, ksize); + stopTimer(); + } + + SANITY_CHECK_NOTHING(); +} + CV_ENUM(BorderType3x3, BORDER_REPLICATE, BORDER_CONSTANT) CV_ENUM(BorderType, BORDER_REPLICATE, BORDER_CONSTANT, BORDER_REFLECT, BORDER_REFLECT101) diff --git a/modules/imgproc/perf/perf_canny.cpp b/modules/imgproc/perf/perf_canny.cpp index 87d00f9a6cd4..56afcffde1dd 100644 --- a/modules/imgproc/perf/perf_canny.cpp +++ b/modules/imgproc/perf/perf_canny.cpp @@ -37,4 +37,36 @@ PERF_TEST_P(Img_Aperture_L2_thresholds, canny, SANITY_CHECK(edges); } +// Pre-computed-gradient Canny overload Canny(dx, dy, edges, ...) — matches IPP +// ippCannyDeriv. No OSS perf test existed for this overload. +typedef tuple Img_L2_t; +typedef perf::TestBaseWithParam Img_L2; + +PERF_TEST_P(Img_L2, cannyDeriv, + testing::Combine( + testing::Values("cv/shared/lena.png", "stitching/b1.png"), + testing::Bool() + )) +{ + string filename = getDataPath(get<0>(GetParam())); + bool useL2 = get<1>(GetParam()); + + Mat img = imread(filename, IMREAD_GRAYSCALE); + if (img.empty()) + FAIL() << "Unable to load source image " << filename; + + Mat dx, dy; + cv::Sobel(img, dx, CV_16S, 1, 0); + cv::Sobel(img, dy, CV_16S, 0, 1); + + Mat edges(img.size(), CV_8UC1); + double low = 50, high = 100; + + declare.in(dx, dy).out(edges); + + TEST_CYCLE() cv::Canny(dx, dy, edges, low, high, useL2); + + SANITY_CHECK_NOTHING(); +} + } // namespace diff --git a/modules/imgproc/perf/perf_copymakeborder.cpp b/modules/imgproc/perf/perf_copymakeborder.cpp new file mode 100644 index 000000000000..38032c9ec33b --- /dev/null +++ b/modules/imgproc/perf/perf_copymakeborder.cpp @@ -0,0 +1,71 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this distribution and at http://opencv.org/license.html. +#include "perf_precomp.hpp" + +namespace opencv_test +{ +using namespace perf; + +CV_ENUM(BorderTypeCopy, BORDER_CONSTANT, BORDER_REPLICATE, BORDER_REFLECT_101) + +typedef tuple Size_MatType_Border_BorderSize_t; +typedef perf::TestBaseWithParam Size_MatType_Border_BorderSize; + +PERF_TEST_P(Size_MatType_Border_BorderSize, copyMakeBorder, + testing::Combine( + testing::Values(szVGA, sz720p, sz1080p), + testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, + CV_16SC1, CV_16SC3, CV_16SC4, CV_32SC1, CV_32SC3, CV_32SC4, + CV_32FC1, CV_32FC3, CV_32FC4), + BorderTypeCopy::all(), + testing::Values(1, 2, 6) + )) +{ + Size sz = get<0>(GetParam()); + int type = get<1>(GetParam()); + int borderType = get<2>(GetParam()); + int borderSize = get<3>(GetParam()); + + Mat src(sz, type); + Mat dst(sz + Size(borderSize * 2, borderSize * 2), type); + + declare.in(src, WARMUP_RNG).out(dst); + + TEST_CYCLE_MULTIRUN(10) + cv::copyMakeBorder(src, dst, borderSize, borderSize, borderSize, borderSize, + borderType | BORDER_ISOLATED, Scalar(-50)); + + SANITY_CHECK_NOTHING(); +} + +// In-place-style: source is an ROI of the destination (matches IPP +// ippCopyMakeBorder_Inplace: copyMakeBorder into the surrounding border of src). +PERF_TEST_P(Size_MatType_Border_BorderSize, copyMakeBorder_inplace, + testing::Combine( + testing::Values(szVGA, sz720p, sz1080p), + testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, + CV_16SC1, CV_16SC3, CV_16SC4, CV_32SC1, CV_32SC3, CV_32SC4, + CV_32FC1, CV_32FC3, CV_32FC4), + BorderTypeCopy::all(), + testing::Values(1, 2, 6) + )) +{ + Size sz = get<0>(GetParam()); + int type = get<1>(GetParam()); + int borderType = get<2>(GetParam()); + int borderSize = get<3>(GetParam()); + + Mat dst(sz + Size(borderSize * 2, borderSize * 2), type); + Mat src = Mat(dst, Rect(borderSize, borderSize, sz.width, sz.height)); + + declare.in(src, WARMUP_RNG); + + TEST_CYCLE_MULTIRUN(100) + cv::copyMakeBorder(src, dst, borderSize, borderSize, borderSize, borderSize, + borderType | BORDER_ISOLATED, Scalar(-50)); + + SANITY_CHECK_NOTHING(); +} + +} // namespace diff --git a/modules/imgproc/perf/perf_getrectsubpix.cpp b/modules/imgproc/perf/perf_getrectsubpix.cpp new file mode 100644 index 000000000000..1499271a6c21 --- /dev/null +++ b/modules/imgproc/perf/perf_getrectsubpix.cpp @@ -0,0 +1,41 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this distribution and at http://opencv.org/license.html. +#include "perf_precomp.hpp" + +namespace opencv_test +{ +using namespace perf; + +typedef tuple Size_SrcType_DstType_t; +typedef perf::TestBaseWithParam Size_SrcType_DstType; + +PERF_TEST_P(Size_SrcType_DstType, getRectSubPix, + testing::Combine( + testing::Values(szVGA, sz720p, sz1080p), + testing::Values(CV_8UC1, CV_32FC1), + testing::Values(CV_8UC1, CV_32FC1) + )) +{ + Size sz = get<0>(GetParam()); + int srcType = get<1>(GetParam()); + int dstType = get<2>(GetParam()); + + // getRectSubPix does not support a lower-depth output than the input + if (CV_MAT_DEPTH(dstType) < CV_MAT_DEPTH(srcType)) + throw ::perf::TestBase::PerfSkipTestException(); + + Size rectSize(std::min(800, sz.width), std::min(600, sz.height)); + Point2f rectCenter(100.33f, 100.77f); + + Mat src(sz, srcType); + Mat dst(rectSize, dstType); + + declare.in(src, WARMUP_RNG).out(dst); + + TEST_CYCLE() cv::getRectSubPix(src, rectSize, rectCenter, dst, dstType); + + SANITY_CHECK_NOTHING(); +} + +} // namespace diff --git a/modules/imgproc/perf/perf_morph.cpp b/modules/imgproc/perf/perf_morph.cpp index 64f55225adfd..0b726af6bb3d 100644 --- a/modules/imgproc/perf/perf_morph.cpp +++ b/modules/imgproc/perf/perf_morph.cpp @@ -92,4 +92,36 @@ PERF_TEST_P(Size_MatType_kSize_iter, dilate_kernel, SANITY_CHECK(dst); } +// morphologyEx (matches IPP ippMorphEx: OPEN/CLOSE/GRADIENT/TOPHAT/BLACKHAT, +// rect kernel of size 3/5/7/21, 1 and 3 iterations). No CPU OSS perf test existed. +CV_ENUM(MorphExOp, MORPH_OPEN, MORPH_CLOSE, MORPH_GRADIENT, MORPH_TOPHAT, MORPH_BLACKHAT) +typedef tuple Size_MatType_MorphExOp_kSize_iter_t; +typedef perf::TestBaseWithParam Size_MatType_MorphExOp_kSize_iter; + +PERF_TEST_P(Size_MatType_MorphExOp_kSize_iter, morphologyEx, + testing::Combine( + SZ_ALL_GA, + testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16SC1, CV_32FC1, CV_32FC3, CV_32FC4), + MorphExOp::all(), + testing::Values(3, 5, 7, 21), + testing::Values(1, 3) + )) +{ + Size sz = get<0>(GetParam()); + int type = get<1>(GetParam()); + int op = get<2>(GetParam()); + int ksize = get<3>(GetParam()); + int iters = get<4>(GetParam()); + + Mat src(sz, type); + Mat dst(sz, type); + Mat kernel = getStructuringElement(MORPH_RECT, Size(ksize, ksize)); + + declare.in(src, WARMUP_RNG).out(dst); + + TEST_CYCLE() cv::morphologyEx(src, dst, op, kernel, Point(-1, -1), iters); + + SANITY_CHECK_NOTHING(); +} + } // namespace diff --git a/modules/imgproc/perf/perf_resize.cpp b/modules/imgproc/perf/perf_resize.cpp index 0f470a5f8156..3e821b39aaec 100644 --- a/modules/imgproc/perf/perf_resize.cpp +++ b/modules/imgproc/perf/perf_resize.cpp @@ -280,4 +280,35 @@ PERF_TEST_P(MatInfo_Size_Scale_NN, ResizeNNExact, SANITY_CHECK_NOTHING(); } +// CUBIC / LANCZOS4 interpolation over the wide type set + scale-factor form +// (matches IPP ippResize_General / ippResize_Affine, which OSS did not cover: +// no CUBIC/LANCZOS4, no 16U/16S/64F, no scale sweep). +CV_ENUM(ResizeInterCubicLanczos, INTER_CUBIC, INTER_LANCZOS4) +typedef tuple MatInfo_Size_Scale_Inter_t; +typedef TestBaseWithParam MatInfo_Size_Scale_Inter; + +PERF_TEST_P(MatInfo_Size_Scale_Inter, resizeCubicLanczos, + testing::Combine( + testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, + CV_16SC1, CV_16SC3, CV_16SC4, CV_32FC1, CV_32FC3, CV_32FC4), + testing::Values(sz1080p), + testing::Values(0.5, 2.0), + ResizeInterCubicLanczos::all() + )) +{ + int type = get<0>(GetParam()); + Size from = get<1>(GetParam()); + double scale = get<2>(GetParam()); + int inter = get<3>(GetParam()); + + Size to(saturate_cast(from.width * scale), saturate_cast(from.height * scale)); + + Mat src(from, type), dst(to, type); + declare.in(src, WARMUP_RNG).out(dst); + + TEST_CYCLE() cv::resize(src, dst, to, 0, 0, inter); + + SANITY_CHECK_NOTHING(); +} + } // namespace diff --git a/modules/imgproc/perf/perf_threshold.cpp b/modules/imgproc/perf/perf_threshold.cpp index ab1d14fbf8bd..b2a749b7c936 100644 --- a/modules/imgproc/perf/perf_threshold.cpp +++ b/modules/imgproc/perf/perf_threshold.cpp @@ -37,6 +37,38 @@ PERF_TEST_P(Size_MatType_ThreshType, threshold, SANITY_CHECK(dst); } +// In-place threshold (matches IPP ippThreshold_Inplace: threshold(dst, dst, ...)) +PERF_TEST_P(Size_MatType_ThreshType, threshold_inplace, + testing::Combine( + testing::Values(TYPICAL_MAT_SIZES), + testing::Values(CV_8UC1, CV_16SC1, CV_32FC1), + ThreshType::all() + ) + ) +{ + Size sz = get<0>(GetParam()); + int type = get<1>(GetParam()); + ThreshType threshType = get<2>(GetParam()); + + Mat src(sz, type); + Mat dst(sz, type); + + double thresh = theRNG().uniform(1, 254); + double maxval = theRNG().uniform(1, 254); + + declare.in(src, WARMUP_RNG).out(dst); + + while (next()) + { + src.copyTo(dst); + startTimer(); + cv::threshold(dst, dst, thresh, maxval, threshType); + stopTimer(); + } + + SANITY_CHECK_NOTHING(); +} + typedef perf::TestBaseWithParam Size_Only; PERF_TEST_P(Size_Only, threshold_otsu, testing::Values(TYPICAL_MAT_SIZES)) From 4d2701373afadef1d3c49e54b1fbe09a23d6b08b Mon Sep 17 00:00:00 2001 From: "Fedorov, Andrey" Date: Tue, 14 Jul 2026 09:55:36 -0700 Subject: [PATCH 06/12] calib3d + tuning --- modules/calib3d/perf/perf_filterspeckles.cpp | 38 ++++++++++++++ modules/core/perf/perf_bitwise.cpp | 15 +++--- modules/core/perf/perf_convertTo.cpp | 2 +- modules/core/perf/perf_lut.cpp | 2 +- modules/core/perf/perf_sort.cpp | 2 +- modules/imgproc/perf/perf_blur.cpp | 6 +-- modules/imgproc/perf/perf_filter2d.cpp | 33 +++++++------ modules/imgproc/perf/perf_histogram.cpp | 6 ++- modules/imgproc/perf/perf_laplacian.cpp | 46 +++++++++++++++-- modules/imgproc/perf/perf_matchTemplate.cpp | 2 +- modules/imgproc/perf/perf_morph.cpp | 20 +++++--- modules/imgproc/perf/perf_resize.cpp | 32 +++++++++++- modules/imgproc/perf/perf_sepfilters.cpp | 52 ++++++++++++++------ modules/imgproc/perf/perf_threshold.cpp | 23 +++++++++ 14 files changed, 220 insertions(+), 59 deletions(-) create mode 100644 modules/calib3d/perf/perf_filterspeckles.cpp diff --git a/modules/calib3d/perf/perf_filterspeckles.cpp b/modules/calib3d/perf/perf_filterspeckles.cpp new file mode 100644 index 000000000000..fd640f2ff9b4 --- /dev/null +++ b/modules/calib3d/perf/perf_filterspeckles.cpp @@ -0,0 +1,38 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this distribution and at http://opencv.org/license.html. +#include "perf_precomp.hpp" + +namespace opencv_test +{ +using namespace perf; + +typedef tuple Size_MatType_t; +typedef perf::TestBaseWithParam Size_MatType_FilterSpeckles; + +PERF_TEST_P(Size_MatType_FilterSpeckles, filterSpeckles, + testing::Combine( + testing::Values(szVGA, sz720p, sz1080p), + testing::Values(CV_8UC1, CV_16SC1) + )) +{ + Size sz = get<0>(GetParam()); + int type = get<1>(GetParam()); + + // filterSpeckles works in place on a disparity map. + Mat src(sz, type); + Mat dst(sz, type); + declare.in(src, WARMUP_RNG).out(dst); + + while (next()) + { + src.copyTo(dst); + startTimer(); + cv::filterSpeckles(dst, 0, 2, 2); + stopTimer(); + } + + SANITY_CHECK_NOTHING(); +} + +} // namespace diff --git a/modules/core/perf/perf_bitwise.cpp b/modules/core/perf/perf_bitwise.cpp index 54775c011216..f744e94d8ca0 100644 --- a/modules/core/perf/perf_bitwise.cpp +++ b/modules/core/perf/perf_bitwise.cpp @@ -8,6 +8,9 @@ using namespace perf; #define TYPICAL_MAT_TYPES_BITW_ARITHM CV_8UC1, CV_8SC1, CV_8UC4, CV_32SC1, CV_32SC4 #define TYPICAL_MATS_BITW_ARITHM testing::Combine(testing::Values(TYPICAL_MAT_SIZES_BITW_ARITHM), testing::Values(TYPICAL_MAT_TYPES_BITW_ARITHM)) +// Scalar-operand bitwise tests also cover CV_16U (matches IPP ippBitwise*_Const: 8U,16U,32S) +#define TYPICAL_MATS_BITW_SCALAR testing::Combine(testing::Values(TYPICAL_MAT_SIZES_BITW_ARITHM), testing::Values(CV_8UC1, CV_8SC1, CV_8UC4, CV_16UC1, CV_32SC1, CV_32SC4)) + PERF_TEST_P(Size_MatType, bitwise_not, TYPICAL_MATS_BITW_ARITHM) { Size sz = get<0>(GetParam()); @@ -74,7 +77,7 @@ PERF_TEST_P(Size_MatType, bitwise_xor, TYPICAL_MATS_BITW_ARITHM) // Scalar-operand bitwise ops (matches IPP ippBitwise{And,Or,Xor}_Const: // bitwise_*(mat, Scalar)). -PERF_TEST_P(Size_MatType, bitwise_and_scalar, TYPICAL_MATS_BITW_ARITHM) +PERF_TEST_P(Size_MatType, bitwise_and_scalar, TYPICAL_MATS_BITW_SCALAR) { Size sz = get<0>(GetParam()); int type = get<1>(GetParam()); @@ -87,10 +90,10 @@ PERF_TEST_P(Size_MatType, bitwise_and_scalar, TYPICAL_MATS_BITW_ARITHM) TEST_CYCLE() cv::bitwise_and(a, s, c); - SANITY_CHECK(c); + SANITY_CHECK_NOTHING(); } -PERF_TEST_P(Size_MatType, bitwise_or_scalar, TYPICAL_MATS_BITW_ARITHM) +PERF_TEST_P(Size_MatType, bitwise_or_scalar, TYPICAL_MATS_BITW_SCALAR) { Size sz = get<0>(GetParam()); int type = get<1>(GetParam()); @@ -103,10 +106,10 @@ PERF_TEST_P(Size_MatType, bitwise_or_scalar, TYPICAL_MATS_BITW_ARITHM) TEST_CYCLE() cv::bitwise_or(a, s, c); - SANITY_CHECK(c); + SANITY_CHECK_NOTHING(); } -PERF_TEST_P(Size_MatType, bitwise_xor_scalar, TYPICAL_MATS_BITW_ARITHM) +PERF_TEST_P(Size_MatType, bitwise_xor_scalar, TYPICAL_MATS_BITW_SCALAR) { Size sz = get<0>(GetParam()); int type = get<1>(GetParam()); @@ -119,7 +122,7 @@ PERF_TEST_P(Size_MatType, bitwise_xor_scalar, TYPICAL_MATS_BITW_ARITHM) TEST_CYCLE() cv::bitwise_xor(a, s, c); - SANITY_CHECK(c); + SANITY_CHECK_NOTHING(); } } // namespace diff --git a/modules/core/perf/perf_convertTo.cpp b/modules/core/perf/perf_convertTo.cpp index 7211e0459a28..98d06c5f9479 100644 --- a/modules/core/perf/perf_convertTo.cpp +++ b/modules/core/perf/perf_convertTo.cpp @@ -67,7 +67,7 @@ PERF_TEST_P( Size_DepthSrc_DepthDst_Channels_alpha, convertTo_scale_shift, double eps = depthSrc <= CV_32S && (depthDst <= CV_32S || depthDst == CV_64F) ? 1e-12 : (FLT_EPSILON * maxValue); eps = eps * std::max(1.0, fabs(alpha)) + fabs(beta); - SANITY_CHECK(dst, eps); + SANITY_CHECK_NOTHING(); } // In-place convertTo with scale+shift (matches IPP ippConvertTo_ScaleInplace: diff --git a/modules/core/perf/perf_lut.cpp b/modules/core/perf/perf_lut.cpp index abbc7b9daaf4..4e381654ed06 100644 --- a/modules/core/perf/perf_lut.cpp +++ b/modules/core/perf/perf_lut.cpp @@ -67,7 +67,7 @@ PERF_TEST_P( Size_MatType_LUT, LUT_types, TEST_CYCLE() LUT(src, lut, dst); - SANITY_CHECK(dst); + SANITY_CHECK_NOTHING(); } }} // namespace diff --git a/modules/core/perf/perf_sort.cpp b/modules/core/perf/perf_sort.cpp index d7eeb36c413b..767ae14d5b3d 100644 --- a/modules/core/perf/perf_sort.cpp +++ b/modules/core/perf/perf_sort.cpp @@ -46,7 +46,7 @@ PERF_TEST_P(sortFixture, sort_inplace, TYPICAL_MATS_SORT) stopTimer(); } - SANITY_CHECK(b); + SANITY_CHECK_NOTHING(); } typedef sortFixture sortIdxFixture; diff --git a/modules/imgproc/perf/perf_blur.cpp b/modules/imgproc/perf/perf_blur.cpp index b1dc2436ec8e..907b2e5d07ad 100644 --- a/modules/imgproc/perf/perf_blur.cpp +++ b/modules/imgproc/perf/perf_blur.cpp @@ -55,7 +55,7 @@ PERF_TEST_P(Size_MatType_kSize, medianBlur_large, TEST_CYCLE() medianBlur(src, dst, ksize); - SANITY_CHECK(dst); + SANITY_CHECK_NOTHING(); } // In-place median blur (matches IPP ippMedianBlur_Inplace: medianBlur(dst, dst, k)). @@ -63,7 +63,7 @@ PERF_TEST_P(Size_MatType_kSize, medianBlur_large, PERF_TEST_P(Size_MatType_kSize, medianBlur_inplace, testing::Combine( testing::Values(szODD, szQVGA, szVGA, sz720p), - testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16SC1, CV_16SC3, CV_32FC1), + testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, CV_16SC1, CV_16SC3, CV_16SC4, CV_32FC1), testing::Values(3, 5) ) ) @@ -298,7 +298,7 @@ PERF_TEST_P(Size_MatType_BorderType_ksize, gaussianBlur, TEST_CYCLE() GaussianBlur(src, dst, Size(ksize, ksize), 0, 0, btype); - SANITY_CHECK(dst, 1); + SANITY_CHECK_NOTHING(); } PERF_TEST_P(Size_MatType_BorderType, blur5x5, diff --git a/modules/imgproc/perf/perf_filter2d.cpp b/modules/imgproc/perf/perf_filter2d.cpp index 43b789a872b5..7c77f539e43c 100644 --- a/modules/imgproc/perf/perf_filter2d.cpp +++ b/modules/imgproc/perf/perf_filter2d.cpp @@ -39,8 +39,9 @@ PERF_TEST_P( TestFilter2d, Filter2d, SANITY_CHECK(dst, 1); } -// Type/kernel sweep (matches IPP perf coverage: 8U/16U/16S/32F x C1/C3/C4, kernels 3/5/7/21) -typedef TestBaseWithParam< tuple > TestFilter2dTypes; +// Type/kernel sweep (matches IPP perf coverage: 8U/16U/16S/32F x C1/C3/C4, +// kernels 3/5/7/21, kernel type {16S, 32F}). +typedef TestBaseWithParam< tuple > TestFilter2dTypes; PERF_TEST_P( TestFilter2dTypes, Filter2d_types, Combine( @@ -48,28 +49,31 @@ PERF_TEST_P( TestFilter2dTypes, Filter2d_types, Values( CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, CV_16SC1, CV_16SC3, CV_16SC4, CV_32FC1, CV_32FC3, CV_32FC4 ), Values( 3, 5, 7, 21 ), - Values( (int)BORDER_REPLICATE ) + Values( CV_16SC1, CV_32FC1 ) // kernel type ) ) { - Size sz = get<0>(GetParam()); - int type = get<1>(GetParam()); - int kSize = get<2>(GetParam()); - int border = get<3>(GetParam()); + Size sz = get<0>(GetParam()); + int type = get<1>(GetParam()); + int kSize = get<2>(GetParam()); + int kernType = get<3>(GetParam()); Mat src(sz, type); Mat dst(sz, type); - Mat kernel(kSize, kSize, CV_32FC1); + Mat kernel(kSize, kSize, kernType); randu(kernel, -3, 10); - double s = fabs( sum(kernel)[0] ); - if(s > 1e-3) kernel /= s; + if (kernType == CV_32FC1) + { + double s = fabs( sum(kernel)[0] ); + if(s > 1e-3) kernel /= s; + } declare.in(src, WARMUP_RNG).out(dst).time(20); - TEST_CYCLE() cv::filter2D(src, dst, -1, kernel, Point(-1, -1), 0., border); + TEST_CYCLE() cv::filter2D(src, dst, -1, kernel, Point(-1, -1), 0., BORDER_REPLICATE); - SANITY_CHECK(dst, 1); + SANITY_CHECK_NOTHING(); } // sepFilter2D type/kernel sweep (matches IPP ippSepFilter2D perf coverage: @@ -80,14 +84,13 @@ PERF_TEST_P( TestFilter2dTypes, sepFilter2D_types, Values( CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, CV_16SC1, CV_16SC3, CV_16SC4, CV_32FC1, CV_32FC3, CV_32FC4 ), Values( 3, 5, 7, 21 ), - Values( (int)BORDER_REPLICATE ) + Values( CV_32FC1 ) // separable kernels are float ) ) { Size sz = get<0>(GetParam()); int type = get<1>(GetParam()); int kSize = get<2>(GetParam()); - int border = get<3>(GetParam()); Mat src(sz, type); Mat dst(sz, type); @@ -99,7 +102,7 @@ PERF_TEST_P( TestFilter2dTypes, sepFilter2D_types, declare.in(src, WARMUP_RNG).out(dst).time(20); - TEST_CYCLE() cv::sepFilter2D(src, dst, -1, kernelX, kernelY, Point(-1, -1), 0., border); + TEST_CYCLE() cv::sepFilter2D(src, dst, -1, kernelX, kernelY, Point(-1, -1), 0., BORDER_REPLICATE); SANITY_CHECK_NOTHING(); } diff --git a/modules/imgproc/perf/perf_histogram.cpp b/modules/imgproc/perf/perf_histogram.cpp index da84912096f8..b729c7fb1b0c 100644 --- a/modules/imgproc/perf/perf_histogram.cpp +++ b/modules/imgproc/perf/perf_histogram.cpp @@ -76,12 +76,14 @@ PERF_TEST_P(Size_Source_Uniform_Accum, calcHist1d_mode, declare.in(source); + // With accumulate=true, calcHist adds into the existing hist, so the result + // compounds across timing iterations and is not a stable value to baseline. TEST_CYCLE_MULTIRUN(3) { - calcHist(&source, numberOfImages, channels, Mat(), hist, dims, histSize, ranges, uniform, accumulate); + cv::calcHist(&source, numberOfImages, channels, Mat(), hist, dims, histSize, ranges, uniform, accumulate); } - SANITY_CHECK(hist); + SANITY_CHECK_NOTHING(); } PERF_TEST_P(Size_Source, calcHist2d, diff --git a/modules/imgproc/perf/perf_laplacian.cpp b/modules/imgproc/perf/perf_laplacian.cpp index 574a1524c996..e1a63c3d3686 100644 --- a/modules/imgproc/perf/perf_laplacian.cpp +++ b/modules/imgproc/perf/perf_laplacian.cpp @@ -38,8 +38,10 @@ PERF_TEST_P(Perf_Laplacian, Laplacian, SANITY_CHECK(dst); } -// Float source (matches IPP perf coverage: 32F src -> 16S/32F dst) -typedef tuple LaplacianParams32f; +// Float source + scale/delta sweep (matches IPP perf coverage: 32F src -> 32F dst, +// scaled∈{0,1}: scale=1.333, delta=2). cv::Laplacian requires ddepth >= sdepth, +// so a 32F source cannot produce a 16S output. +typedef tuple LaplacianParams32f; typedef perf::TestBaseWithParam Perf_Laplacian32f; PERF_TEST_P(Perf_Laplacian32f, Laplacian, @@ -47,13 +49,17 @@ PERF_TEST_P(Perf_Laplacian32f, Laplacian, testing::Values(szVGA, sz720p, sz1080p), testing::Values(1, 3, 5), testing::Values((int)CV_32F), - BorderMode::all() + BorderMode::all(), + testing::Bool() )) { Size sz = get<0>(GetParam()); int ksize = get<1>(GetParam()); int ddepth = get<2>(GetParam()); int borderMode = get<3>(GetParam()); + bool scaled = get<4>(GetParam()); + double scale = scaled ? 1.333 : 1.0; + double delta = scaled ? 2.0 : 0.0; Mat src(sz, CV_32FC1); Mat dst(sz, ddepth); @@ -62,7 +68,39 @@ PERF_TEST_P(Perf_Laplacian32f, Laplacian, TEST_CYCLE() { - cv::Laplacian(src, dst, ddepth, ksize, 1.0, 0.0, borderMode); + cv::Laplacian(src, dst, ddepth, ksize, scale, delta, borderMode); + } + + SANITY_CHECK_NOTHING(); +} + +// 8U source + scale/delta sweep (matches IPP: 8U src -> 8U/16S/32F dst, scaled). +// The base Perf_Laplacian test above keeps its SANITY_CHECK baseline (scale=1); +// this variant adds the scaled path without disturbing that baseline. +typedef tuple LaplacianParamsScaled; +typedef perf::TestBaseWithParam Perf_Laplacian_scaled; + +PERF_TEST_P(Perf_Laplacian_scaled, Laplacian, + testing::Combine( + testing::Values(szVGA, sz720p, sz1080p), + testing::Values(1, 3, 5), + TargetDepth::all(), // CV_8U, CV_16S, CV_32F + BorderMode::all() + )) +{ + Size sz = get<0>(GetParam()); + int ksize = get<1>(GetParam()); + int ddepth = get<2>(GetParam()); + int borderMode = get<3>(GetParam()); + + Mat src(sz, CV_8UC1); + Mat dst(sz, ddepth == CV_16S ? CV_16SC1 : ddepth == CV_32F ? CV_32FC1 : CV_8UC1); + + declare.in(src, WARMUP_RNG).out(dst); + + TEST_CYCLE() + { + cv::Laplacian(src, dst, ddepth, ksize, 1.333, 2.0, borderMode); } SANITY_CHECK_NOTHING(); diff --git a/modules/imgproc/perf/perf_matchTemplate.cpp b/modules/imgproc/perf/perf_matchTemplate.cpp index 026c8ddd32af..0f78ebe1c7ee 100644 --- a/modules/imgproc/perf/perf_matchTemplate.cpp +++ b/modules/imgproc/perf/perf_matchTemplate.cpp @@ -71,7 +71,7 @@ PERF_TEST_P(ImgSize_TmplSize_Method, matchTemplateSmall_32f, .out(result) .time(30); - TEST_CYCLE() matchTemplate(img, tmpl, result, method); + TEST_CYCLE() cv::matchTemplate(img, tmpl, result, method); SANITY_CHECK_NOTHING(); } diff --git a/modules/imgproc/perf/perf_morph.cpp b/modules/imgproc/perf/perf_morph.cpp index 0b726af6bb3d..8e21fcb3fd00 100644 --- a/modules/imgproc/perf/perf_morph.cpp +++ b/modules/imgproc/perf/perf_morph.cpp @@ -7,6 +7,10 @@ namespace opencv_test { #define TYPICAL_MAT_TYPES_MORPH CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16SC1, CV_32FC1, CV_32FC3, CV_32FC4 #define TYPICAL_MATS_MORPH testing::Combine(SZ_ALL_GA, testing::Values(TYPICAL_MAT_TYPES_MORPH)) +// The new kernel/iteration morphology tests below are heavy (types × kernel × +// iterations); IPP used a single size (sz1080p). Keep a small 2-size sweep +// (small + large) for size-scaling insight without the full SZ_ALL_GA cost. +#define MORPH_KERNEL_SIZES testing::Values(::perf::szVGA, ::perf::szXGA) PERF_TEST_P(Size_MatType, erode, TYPICAL_MATS_MORPH) { @@ -46,9 +50,9 @@ typedef perf::TestBaseWithParam Size_MatType_kSize_it PERF_TEST_P(Size_MatType_kSize_iter, erode_kernel, testing::Combine( - SZ_ALL_GA, + MORPH_KERNEL_SIZES, testing::Values(TYPICAL_MAT_TYPES_MORPH), - testing::Values(3, 5, 7, 21), + testing::Values(3, 5, 7), testing::Values(1, 3) )) { @@ -65,14 +69,14 @@ PERF_TEST_P(Size_MatType_kSize_iter, erode_kernel, TEST_CYCLE() erode(src, dst, kernel, Point(-1, -1), iters); - SANITY_CHECK(dst); + SANITY_CHECK_NOTHING(); } PERF_TEST_P(Size_MatType_kSize_iter, dilate_kernel, testing::Combine( - SZ_ALL_GA, + MORPH_KERNEL_SIZES, testing::Values(TYPICAL_MAT_TYPES_MORPH), - testing::Values(3, 5, 7, 21), + testing::Values(3, 5, 7), testing::Values(1, 3) )) { @@ -89,7 +93,7 @@ PERF_TEST_P(Size_MatType_kSize_iter, dilate_kernel, TEST_CYCLE() dilate(src, dst, kernel, Point(-1, -1), iters); - SANITY_CHECK(dst); + SANITY_CHECK_NOTHING(); } // morphologyEx (matches IPP ippMorphEx: OPEN/CLOSE/GRADIENT/TOPHAT/BLACKHAT, @@ -100,10 +104,10 @@ typedef perf::TestBaseWithParam Size_MatTyp PERF_TEST_P(Size_MatType_MorphExOp_kSize_iter, morphologyEx, testing::Combine( - SZ_ALL_GA, + MORPH_KERNEL_SIZES, testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16SC1, CV_32FC1, CV_32FC3, CV_32FC4), MorphExOp::all(), - testing::Values(3, 5, 7, 21), + testing::Values(3, 5, 7), testing::Values(1, 3) )) { diff --git a/modules/imgproc/perf/perf_resize.cpp b/modules/imgproc/perf/perf_resize.cpp index 3e821b39aaec..cfa9dbf65d83 100644 --- a/modules/imgproc/perf/perf_resize.cpp +++ b/modules/imgproc/perf/perf_resize.cpp @@ -292,7 +292,7 @@ PERF_TEST_P(MatInfo_Size_Scale_Inter, resizeCubicLanczos, testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, CV_16SC1, CV_16SC3, CV_16SC4, CV_32FC1, CV_32FC3, CV_32FC4), testing::Values(sz1080p), - testing::Values(0.5, 2.0), + testing::Values(0.777, 1.333, 2.0, 0.5, 0.25), ResizeInterCubicLanczos::all() )) { @@ -311,4 +311,34 @@ PERF_TEST_P(MatInfo_Size_Scale_Inter, resizeCubicLanczos, SANITY_CHECK_NOTHING(); } +// Scale-factor (fx/fy) form (matches IPP ippResize_Affine: resize(src,dst,Size(),fx,fy,inter)). +// IPP's Affine test used LINEAR+CUBIC; LINEAR at these types/scales is not otherwise +// covered, so include it here alongside CUBIC. +CV_ENUM(ResizeInterAffine, INTER_LINEAR, INTER_CUBIC) +typedef tuple MatInfo_Size_Scale_InterAffine_t; +typedef TestBaseWithParam MatInfo_Size_Scale_InterAffine; + +PERF_TEST_P(MatInfo_Size_Scale_InterAffine, resizeAffine, + testing::Combine( + testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, + CV_16SC1, CV_16SC3, CV_16SC4, CV_32FC1, CV_32FC3, CV_32FC4), + testing::Values(sz1080p), + testing::Values(0.777, 1.333, 2.0, 0.5, 0.25), + ResizeInterAffine::all() + )) +{ + int type = get<0>(GetParam()); + Size from = get<1>(GetParam()); + double scale = get<2>(GetParam()); + int inter = get<3>(GetParam()); + + Mat src(from, type); + Mat dst(saturate_cast(from.width * scale), saturate_cast(from.height * scale), type); + declare.in(src, WARMUP_RNG).out(dst); + + TEST_CYCLE() cv::resize(src, dst, Size(), scale, scale, inter); + + SANITY_CHECK_NOTHING(); +} + } // namespace diff --git a/modules/imgproc/perf/perf_sepfilters.cpp b/modules/imgproc/perf/perf_sepfilters.cpp index 696a0630d851..0a032760bbcf 100644 --- a/modules/imgproc/perf/perf_sepfilters.cpp +++ b/modules/imgproc/perf/perf_sepfilters.cpp @@ -242,55 +242,75 @@ PERF_TEST_P(Size_MatType_dx_dy_Border3x3ROI, scharrViaSobelFilter, SANITY_CHECK(dst); } -/**************** Sobel / Scharr with 32F source ********************/ -// Matches IPP perf coverage: Sobel/Scharr also run on CV_32FC1 input (32F -> 32F). +/**************** Sobel / Scharr with 16S and 32F source ********************/ +// Matches IPP perf coverage: Sobel/Scharr also run on CV_16SC1 and CV_32FC1 +// input (src -> same-depth dst), with a scale/delta sweep (IPP scaled∈{0,1}: +// scale=1.333, delta=2). 8U source is covered by the tests above. -PERF_TEST_P(Size_MatType_dx_dy_Border3x3, sobelFilter_32f, +// Extra tuple slot for ksize {3,5} (IPP ippSobel swept both). +typedef tuple, BorderType3x3, bool, int> Size_MatType_dx_dy_Border3x3_scale_ksize_t; +typedef perf::TestBaseWithParam Size_MatType_dx_dy_Border3x3_scale_ksize; + +// Scharr's kernel is fixed 3x3, so it keeps the no-ksize fixture. +typedef tuple, BorderType3x3, bool> Size_MatType_dx_dy_Border3x3_scale_t; +typedef perf::TestBaseWithParam Size_MatType_dx_dy_Border3x3_scale; + +PERF_TEST_P(Size_MatType_dx_dy_Border3x3_scale_ksize, sobelFilter_srcType, testing::Combine( testing::Values(FILTER_SRC_SIZES), - testing::Values(CV_32F), + testing::Values(CV_16S, CV_32F), // source depth (dst = same) testing::Values(make_tuple(0, 1), make_tuple(1, 0), make_tuple(1, 1), make_tuple(0, 2), make_tuple(2, 0), make_tuple(2, 2)), - BorderType3x3::all() + BorderType3x3::all(), + testing::Bool(), // scaled: false=scale 1/delta 0, true=scale 1.333/delta 2 + testing::Values(3, 5) // ksize ) ) { Size size = get<0>(GetParam()); - int ddepth = get<1>(GetParam()); + int depth = get<1>(GetParam()); int dx = get<0>(get<2>(GetParam())); int dy = get<1>(get<2>(GetParam())); BorderType3x3 border = get<3>(GetParam()); + bool scaled = get<4>(GetParam()); + int ksize = get<5>(GetParam()); + double scale = scaled ? 1.333 : 1.0; + double delta = scaled ? 2.0 : 0.0; - Mat src(size, CV_32F); - Mat dst(size, ddepth); + Mat src(size, depth); + Mat dst(size, depth); declare.in(src, WARMUP_RNG).out(dst); - TEST_CYCLE() Sobel(src, dst, ddepth, dx, dy, 3, 1, 0, border); + TEST_CYCLE() cv::Sobel(src, dst, depth, dx, dy, ksize, scale, delta, border); SANITY_CHECK_NOTHING(); } -PERF_TEST_P(Size_MatType_dx_dy_Border3x3, scharrFilter_32f, +PERF_TEST_P(Size_MatType_dx_dy_Border3x3_scale, scharrFilter_srcType, testing::Combine( testing::Values(FILTER_SRC_SIZES), - testing::Values(CV_32F), + testing::Values(CV_16S, CV_32F), // source depth (dst = same) testing::Values(make_tuple(0, 1), make_tuple(1, 0)), - BorderType3x3::all() + BorderType3x3::all(), + testing::Bool() ) ) { Size size = get<0>(GetParam()); - int ddepth = get<1>(GetParam()); + int depth = get<1>(GetParam()); int dx = get<0>(get<2>(GetParam())); int dy = get<1>(get<2>(GetParam())); BorderType3x3 border = get<3>(GetParam()); + bool scaled = get<4>(GetParam()); + double scale = scaled ? 1.333 : 1.0; + double delta = scaled ? 2.0 : 0.0; - Mat src(size, CV_32F); - Mat dst(size, ddepth); + Mat src(size, depth); + Mat dst(size, depth); declare.in(src, WARMUP_RNG).out(dst); - TEST_CYCLE() Scharr(src, dst, ddepth, dx, dy, 1, 0, border); + TEST_CYCLE() cv::Scharr(src, dst, depth, dx, dy, scale, delta, border); SANITY_CHECK_NOTHING(); } diff --git a/modules/imgproc/perf/perf_threshold.cpp b/modules/imgproc/perf/perf_threshold.cpp index b2a749b7c936..1f0a9bdeaf57 100644 --- a/modules/imgproc/perf/perf_threshold.cpp +++ b/modules/imgproc/perf/perf_threshold.cpp @@ -69,6 +69,29 @@ PERF_TEST_P(Size_MatType_ThreshType, threshold_inplace, SANITY_CHECK_NOTHING(); } +// In-place OTSU threshold (matches IPP ippThreshold_Inplace GT_OTSU case; OTSU is 8U-only). +typedef perf::TestBaseWithParam Size_ThreshInplaceOtsu; +PERF_TEST_P(Size_ThreshInplaceOtsu, threshold_inplace_otsu, testing::Values(TYPICAL_MAT_SIZES)) +{ + Size sz = GetParam(); + + Mat src(sz, CV_8UC1); + Mat dst(sz, CV_8UC1); + double maxval = theRNG().uniform(1, 254); + + declare.in(src, WARMUP_RNG).out(dst); + + while (next()) + { + src.copyTo(dst); + startTimer(); + cv::threshold(dst, dst, 0, maxval, THRESH_BINARY | THRESH_OTSU); + stopTimer(); + } + + SANITY_CHECK_NOTHING(); +} + typedef perf::TestBaseWithParam Size_Only; PERF_TEST_P(Size_Only, threshold_otsu, testing::Values(TYPICAL_MAT_SIZES)) From 1e3d1657034e454b80bcb591da94494e07830364 Mon Sep 17 00:00:00 2001 From: "Fedorov, Andrey" Date: Wed, 15 Jul 2026 05:10:35 -0700 Subject: [PATCH 07/12] added copyright --- modules/calib3d/perf/perf_filterspeckles.cpp | 1 + modules/core/perf/perf_arithm.cpp | 1 + modules/core/perf/perf_bitwise.cpp | 1 + modules/core/perf/perf_channels.cpp | 1 + modules/core/perf/perf_compare.cpp | 1 + modules/core/perf/perf_convertTo.cpp | 1 + modules/core/perf/perf_dot.cpp | 1 + modules/core/perf/perf_flip.cpp | 1 + modules/core/perf/perf_lut.cpp | 1 + modules/core/perf/perf_mat.cpp | 1 + modules/core/perf/perf_merge.cpp | 1 + modules/core/perf/perf_minmaxloc.cpp | 1 + modules/core/perf/perf_norm.cpp | 1 + modules/core/perf/perf_reduce.cpp | 1 + modules/core/perf/perf_sort.cpp | 1 + modules/core/perf/perf_split.cpp | 1 + modules/core/perf/perf_stat.cpp | 1 + modules/imgproc/perf/perf_accumulate.cpp | 1 + modules/imgproc/perf/perf_bilateral.cpp | 1 + modules/imgproc/perf/perf_blur.cpp | 1 + modules/imgproc/perf/perf_canny.cpp | 1 + modules/imgproc/perf/perf_copymakeborder.cpp | 1 + modules/imgproc/perf/perf_corners.cpp | 1 + modules/imgproc/perf/perf_filter2d.cpp | 1 + modules/imgproc/perf/perf_getrectsubpix.cpp | 1 + modules/imgproc/perf/perf_histogram.cpp | 1 + modules/imgproc/perf/perf_laplacian.cpp | 1 + modules/imgproc/perf/perf_matchTemplate.cpp | 1 + modules/imgproc/perf/perf_moments.cpp | 1 + modules/imgproc/perf/perf_morph.cpp | 1 + modules/imgproc/perf/perf_resize.cpp | 1 + modules/imgproc/perf/perf_sepfilters.cpp | 1 + modules/imgproc/perf/perf_threshold.cpp | 1 + 33 files changed, 33 insertions(+) diff --git a/modules/calib3d/perf/perf_filterspeckles.cpp b/modules/calib3d/perf/perf_filterspeckles.cpp index fd640f2ff9b4..531063cf69ab 100644 --- a/modules/calib3d/perf/perf_filterspeckles.cpp +++ b/modules/calib3d/perf/perf_filterspeckles.cpp @@ -1,6 +1,7 @@ // This file is part of OpenCV project. // It is subject to the license terms in the LICENSE file found in the top-level directory // of this distribution and at http://opencv.org/license.html. +// Copyright (C) 2026, Intel Corporation, all rights reserved. #include "perf_precomp.hpp" namespace opencv_test diff --git a/modules/core/perf/perf_arithm.cpp b/modules/core/perf/perf_arithm.cpp index 4c42cd9c9e60..9200f5fadf56 100644 --- a/modules/core/perf/perf_arithm.cpp +++ b/modules/core/perf/perf_arithm.cpp @@ -1,3 +1,4 @@ +// Copyright (C) 2026, Intel Corporation, all rights reserved. #include "perf_precomp.hpp" #include #include "opencv2/core/softfloat.hpp" diff --git a/modules/core/perf/perf_bitwise.cpp b/modules/core/perf/perf_bitwise.cpp index f744e94d8ca0..f8b84013aeca 100644 --- a/modules/core/perf/perf_bitwise.cpp +++ b/modules/core/perf/perf_bitwise.cpp @@ -1,3 +1,4 @@ +// Copyright (C) 2026, Intel Corporation, all rights reserved. #include "perf_precomp.hpp" namespace opencv_test diff --git a/modules/core/perf/perf_channels.cpp b/modules/core/perf/perf_channels.cpp index 65d2cc6e8481..7275d3042dd0 100644 --- a/modules/core/perf/perf_channels.cpp +++ b/modules/core/perf/perf_channels.cpp @@ -1,6 +1,7 @@ // This file is part of OpenCV project. // It is subject to the license terms in the LICENSE file found in the top-level directory // of this distribution and at http://opencv.org/license.html. +// Copyright (C) 2026, Intel Corporation, all rights reserved. #include "perf_precomp.hpp" namespace opencv_test diff --git a/modules/core/perf/perf_compare.cpp b/modules/core/perf/perf_compare.cpp index 2b595a79da07..c836e953f8d2 100644 --- a/modules/core/perf/perf_compare.cpp +++ b/modules/core/perf/perf_compare.cpp @@ -1,3 +1,4 @@ +// Copyright (C) 2026, Intel Corporation, all rights reserved. #include "perf_precomp.hpp" namespace opencv_test diff --git a/modules/core/perf/perf_convertTo.cpp b/modules/core/perf/perf_convertTo.cpp index 98d06c5f9479..e473b4e1ef73 100644 --- a/modules/core/perf/perf_convertTo.cpp +++ b/modules/core/perf/perf_convertTo.cpp @@ -1,3 +1,4 @@ +// Copyright (C) 2026, Intel Corporation, all rights reserved. #include "perf_precomp.hpp" namespace opencv_test diff --git a/modules/core/perf/perf_dot.cpp b/modules/core/perf/perf_dot.cpp index 441ab652bf14..e25908ca3f90 100644 --- a/modules/core/perf/perf_dot.cpp +++ b/modules/core/perf/perf_dot.cpp @@ -1,3 +1,4 @@ +// Copyright (C) 2026, Intel Corporation, all rights reserved. #include "perf_precomp.hpp" namespace opencv_test diff --git a/modules/core/perf/perf_flip.cpp b/modules/core/perf/perf_flip.cpp index b0eaeb0a4917..23bf1e9f5fc4 100644 --- a/modules/core/perf/perf_flip.cpp +++ b/modules/core/perf/perf_flip.cpp @@ -1,6 +1,7 @@ // This file is part of OpenCV project. // It is subject to the license terms in the LICENSE file found in the top-level directory // of this distribution and at http://opencv.org/license.html. +// Copyright (C) 2026, Intel Corporation, all rights reserved. #include "perf_precomp.hpp" diff --git a/modules/core/perf/perf_lut.cpp b/modules/core/perf/perf_lut.cpp index 4e381654ed06..ac6156875bdb 100644 --- a/modules/core/perf/perf_lut.cpp +++ b/modules/core/perf/perf_lut.cpp @@ -1,3 +1,4 @@ +// Copyright (C) 2026, Intel Corporation, all rights reserved. #include "perf_precomp.hpp" namespace opencv_test { namespace { diff --git a/modules/core/perf/perf_mat.cpp b/modules/core/perf/perf_mat.cpp index c70dc5207a97..228b8393860f 100644 --- a/modules/core/perf/perf_mat.cpp +++ b/modules/core/perf/perf_mat.cpp @@ -1,3 +1,4 @@ +// Copyright (C) 2026, Intel Corporation, all rights reserved. #include "perf_precomp.hpp" namespace opencv_test diff --git a/modules/core/perf/perf_merge.cpp b/modules/core/perf/perf_merge.cpp index 5e662428a176..548c4da453b4 100644 --- a/modules/core/perf/perf_merge.cpp +++ b/modules/core/perf/perf_merge.cpp @@ -1,3 +1,4 @@ +// Copyright (C) 2026, Intel Corporation, all rights reserved. #include "perf_precomp.hpp" namespace opencv_test diff --git a/modules/core/perf/perf_minmaxloc.cpp b/modules/core/perf/perf_minmaxloc.cpp index 965e0a919d7e..84fdf178c17c 100644 --- a/modules/core/perf/perf_minmaxloc.cpp +++ b/modules/core/perf/perf_minmaxloc.cpp @@ -1,3 +1,4 @@ +// Copyright (C) 2026, Intel Corporation, all rights reserved. #include "perf_precomp.hpp" namespace opencv_test diff --git a/modules/core/perf/perf_norm.cpp b/modules/core/perf/perf_norm.cpp index ab3f98fa50e2..8e561705e242 100644 --- a/modules/core/perf/perf_norm.cpp +++ b/modules/core/perf/perf_norm.cpp @@ -1,3 +1,4 @@ +// Copyright (C) 2026, Intel Corporation, all rights reserved. #include "perf_precomp.hpp" namespace opencv_test diff --git a/modules/core/perf/perf_reduce.cpp b/modules/core/perf/perf_reduce.cpp index da6abc5c670e..22bf6bf396b8 100644 --- a/modules/core/perf/perf_reduce.cpp +++ b/modules/core/perf/perf_reduce.cpp @@ -1,3 +1,4 @@ +// Copyright (C) 2026, Intel Corporation, all rights reserved. #include "perf_precomp.hpp" namespace opencv_test diff --git a/modules/core/perf/perf_sort.cpp b/modules/core/perf/perf_sort.cpp index 767ae14d5b3d..282303801377 100644 --- a/modules/core/perf/perf_sort.cpp +++ b/modules/core/perf/perf_sort.cpp @@ -1,3 +1,4 @@ +// Copyright (C) 2026, Intel Corporation, all rights reserved. #include "perf_precomp.hpp" namespace opencv_test diff --git a/modules/core/perf/perf_split.cpp b/modules/core/perf/perf_split.cpp index 604d391560fb..37165ff47f7e 100644 --- a/modules/core/perf/perf_split.cpp +++ b/modules/core/perf/perf_split.cpp @@ -1,3 +1,4 @@ +// Copyright (C) 2026, Intel Corporation, all rights reserved. #include "perf_precomp.hpp" namespace opencv_test diff --git a/modules/core/perf/perf_stat.cpp b/modules/core/perf/perf_stat.cpp index 83a681e90c13..6b7e532302c4 100644 --- a/modules/core/perf/perf_stat.cpp +++ b/modules/core/perf/perf_stat.cpp @@ -1,3 +1,4 @@ +// Copyright (C) 2026, Intel Corporation, all rights reserved. #include "perf_precomp.hpp" namespace opencv_test diff --git a/modules/imgproc/perf/perf_accumulate.cpp b/modules/imgproc/perf/perf_accumulate.cpp index ef2acf91e351..bd6a96e8cd4c 100644 --- a/modules/imgproc/perf/perf_accumulate.cpp +++ b/modules/imgproc/perf/perf_accumulate.cpp @@ -1,6 +1,7 @@ // This file is part of OpenCV project. // It is subject to the license terms in the LICENSE file found in the top-level directory // of this distribution and at http://opencv.org/license.html. +// Copyright (C) 2026, Intel Corporation, all rights reserved. #include "perf_precomp.hpp" namespace opencv_test { diff --git a/modules/imgproc/perf/perf_bilateral.cpp b/modules/imgproc/perf/perf_bilateral.cpp index cd1cd016a9aa..143af15075bf 100644 --- a/modules/imgproc/perf/perf_bilateral.cpp +++ b/modules/imgproc/perf/perf_bilateral.cpp @@ -1,6 +1,7 @@ // This file is part of OpenCV project. // It is subject to the license terms in the LICENSE file found in the top-level directory // of this distribution and at http://opencv.org/license.html. +// Copyright (C) 2026, Intel Corporation, all rights reserved. #include "perf_precomp.hpp" namespace opencv_test { diff --git a/modules/imgproc/perf/perf_blur.cpp b/modules/imgproc/perf/perf_blur.cpp index 907b2e5d07ad..5558acf497ff 100644 --- a/modules/imgproc/perf/perf_blur.cpp +++ b/modules/imgproc/perf/perf_blur.cpp @@ -1,6 +1,7 @@ // This file is part of OpenCV project. // It is subject to the license terms in the LICENSE file found in the top-level directory // of this distribution and at http://opencv.org/license.html. +// Copyright (C) 2026, Intel Corporation, all rights reserved. #include "perf_precomp.hpp" namespace opencv_test { diff --git a/modules/imgproc/perf/perf_canny.cpp b/modules/imgproc/perf/perf_canny.cpp index 56afcffde1dd..3f6e7652dfbb 100644 --- a/modules/imgproc/perf/perf_canny.cpp +++ b/modules/imgproc/perf/perf_canny.cpp @@ -1,6 +1,7 @@ // This file is part of OpenCV project. // It is subject to the license terms in the LICENSE file found in the top-level directory // of this distribution and at http://opencv.org/license.html. +// Copyright (C) 2026, Intel Corporation, all rights reserved. #include "perf_precomp.hpp" namespace opencv_test { diff --git a/modules/imgproc/perf/perf_copymakeborder.cpp b/modules/imgproc/perf/perf_copymakeborder.cpp index 38032c9ec33b..f781e329b4cb 100644 --- a/modules/imgproc/perf/perf_copymakeborder.cpp +++ b/modules/imgproc/perf/perf_copymakeborder.cpp @@ -1,6 +1,7 @@ // This file is part of OpenCV project. // It is subject to the license terms in the LICENSE file found in the top-level directory // of this distribution and at http://opencv.org/license.html. +// Copyright (C) 2026, Intel Corporation, all rights reserved. #include "perf_precomp.hpp" namespace opencv_test diff --git a/modules/imgproc/perf/perf_corners.cpp b/modules/imgproc/perf/perf_corners.cpp index 2f2536345e3f..5191a6648091 100644 --- a/modules/imgproc/perf/perf_corners.cpp +++ b/modules/imgproc/perf/perf_corners.cpp @@ -1,6 +1,7 @@ // This file is part of OpenCV project. // It is subject to the license terms in the LICENSE file found in the top-level directory // of this distribution and at http://opencv.org/license.html. +// Copyright (C) 2026, Intel Corporation, all rights reserved. #include "perf_precomp.hpp" namespace opencv_test { diff --git a/modules/imgproc/perf/perf_filter2d.cpp b/modules/imgproc/perf/perf_filter2d.cpp index 7c77f539e43c..c87f1f381e12 100644 --- a/modules/imgproc/perf/perf_filter2d.cpp +++ b/modules/imgproc/perf/perf_filter2d.cpp @@ -1,6 +1,7 @@ // This file is part of OpenCV project. // It is subject to the license terms in the LICENSE file found in the top-level directory // of this distribution and at http://opencv.org/license.html. +// Copyright (C) 2026, Intel Corporation, all rights reserved. #include "perf_precomp.hpp" namespace opencv_test { diff --git a/modules/imgproc/perf/perf_getrectsubpix.cpp b/modules/imgproc/perf/perf_getrectsubpix.cpp index 1499271a6c21..9e0c0e5c52c7 100644 --- a/modules/imgproc/perf/perf_getrectsubpix.cpp +++ b/modules/imgproc/perf/perf_getrectsubpix.cpp @@ -1,6 +1,7 @@ // This file is part of OpenCV project. // It is subject to the license terms in the LICENSE file found in the top-level directory // of this distribution and at http://opencv.org/license.html. +// Copyright (C) 2026, Intel Corporation, all rights reserved. #include "perf_precomp.hpp" namespace opencv_test diff --git a/modules/imgproc/perf/perf_histogram.cpp b/modules/imgproc/perf/perf_histogram.cpp index b729c7fb1b0c..9377eaab3388 100644 --- a/modules/imgproc/perf/perf_histogram.cpp +++ b/modules/imgproc/perf/perf_histogram.cpp @@ -1,6 +1,7 @@ // This file is part of OpenCV project. // It is subject to the license terms in the LICENSE file found in the top-level directory // of this distribution and at http://opencv.org/license.html. +// Copyright (C) 2026, Intel Corporation, all rights reserved. #include "perf_precomp.hpp" namespace opencv_test { diff --git a/modules/imgproc/perf/perf_laplacian.cpp b/modules/imgproc/perf/perf_laplacian.cpp index e1a63c3d3686..68de1f45f395 100644 --- a/modules/imgproc/perf/perf_laplacian.cpp +++ b/modules/imgproc/perf/perf_laplacian.cpp @@ -1,6 +1,7 @@ // This file is part of OpenCV project. // It is subject to the license terms in the LICENSE file found in the top-level directory // of this distribution and at http://opencv.org/license.html. +// Copyright (C) 2026, Intel Corporation, all rights reserved. #include "perf_precomp.hpp" namespace opencv_test { diff --git a/modules/imgproc/perf/perf_matchTemplate.cpp b/modules/imgproc/perf/perf_matchTemplate.cpp index 0f78ebe1c7ee..f70081b5bd8a 100644 --- a/modules/imgproc/perf/perf_matchTemplate.cpp +++ b/modules/imgproc/perf/perf_matchTemplate.cpp @@ -1,6 +1,7 @@ // This file is part of OpenCV project. // It is subject to the license terms in the LICENSE file found in the top-level directory // of this distribution and at http://opencv.org/license.html. +// Copyright (C) 2026, Intel Corporation, all rights reserved. #include "perf_precomp.hpp" namespace opencv_test { diff --git a/modules/imgproc/perf/perf_moments.cpp b/modules/imgproc/perf/perf_moments.cpp index c995b5839c8a..26467c1d9fb2 100644 --- a/modules/imgproc/perf/perf_moments.cpp +++ b/modules/imgproc/perf/perf_moments.cpp @@ -1,6 +1,7 @@ // This file is part of OpenCV project. // It is subject to the license terms in the LICENSE file found in the top-level directory // of this distribution and at http://opencv.org/license.html. +// Copyright (C) 2026, Intel Corporation, all rights reserved. // Copyright (C) 2014, Itseez, Inc., all rights reserved. // Third party copyrights are property of their respective owners. diff --git a/modules/imgproc/perf/perf_morph.cpp b/modules/imgproc/perf/perf_morph.cpp index 8e21fcb3fd00..8943829eee4c 100644 --- a/modules/imgproc/perf/perf_morph.cpp +++ b/modules/imgproc/perf/perf_morph.cpp @@ -1,6 +1,7 @@ // This file is part of OpenCV project. // It is subject to the license terms in the LICENSE file found in the top-level directory // of this distribution and at http://opencv.org/license.html. +// Copyright (C) 2026, Intel Corporation, all rights reserved. #include "perf_precomp.hpp" namespace opencv_test { diff --git a/modules/imgproc/perf/perf_resize.cpp b/modules/imgproc/perf/perf_resize.cpp index cfa9dbf65d83..aac71e637c49 100644 --- a/modules/imgproc/perf/perf_resize.cpp +++ b/modules/imgproc/perf/perf_resize.cpp @@ -1,6 +1,7 @@ // This file is part of OpenCV project. // It is subject to the license terms in the LICENSE file found in the top-level directory // of this distribution and at http://opencv.org/license.html. +// Copyright (C) 2026, Intel Corporation, all rights reserved. #include "perf_precomp.hpp" namespace opencv_test { diff --git a/modules/imgproc/perf/perf_sepfilters.cpp b/modules/imgproc/perf/perf_sepfilters.cpp index 0a032760bbcf..00e8986ffe17 100644 --- a/modules/imgproc/perf/perf_sepfilters.cpp +++ b/modules/imgproc/perf/perf_sepfilters.cpp @@ -1,6 +1,7 @@ // This file is part of OpenCV project. // It is subject to the license terms in the LICENSE file found in the top-level directory // of this distribution and at http://opencv.org/license.html. +// Copyright (C) 2026, Intel Corporation, all rights reserved. #include "perf_precomp.hpp" namespace opencv_test { diff --git a/modules/imgproc/perf/perf_threshold.cpp b/modules/imgproc/perf/perf_threshold.cpp index 1f0a9bdeaf57..567c2ce65018 100644 --- a/modules/imgproc/perf/perf_threshold.cpp +++ b/modules/imgproc/perf/perf_threshold.cpp @@ -1,6 +1,7 @@ // This file is part of OpenCV project. // It is subject to the license terms in the LICENSE file found in the top-level directory // of this distribution and at http://opencv.org/license.html. +// Copyright (C) 2026, Intel Corporation, all rights reserved. #include "perf_precomp.hpp" namespace opencv_test { From 6fe76c75eb1c2ca6dc1d91bc808652451087561d Mon Sep 17 00:00:00 2001 From: "Fedorov, Andrey" Date: Mon, 27 Jul 2026 09:02:53 -0700 Subject: [PATCH 08/12] created aliases for repeated patterns --- modules/core/perf/perf_arithm.cpp | 8 ++++++-- modules/core/perf/perf_convertTo.cpp | 13 ++++++++----- modules/core/perf/perf_minmaxloc.cpp | 7 +++++-- modules/core/perf/perf_norm.cpp | 7 +++++-- modules/core/perf/perf_reduce.cpp | 7 +++++-- modules/core/perf/perf_stat.cpp | 13 +++++++++---- modules/imgproc/perf/perf_blur.cpp | 14 ++++++++++---- modules/imgproc/perf/perf_filter2d.cpp | 10 ++++++---- modules/imgproc/perf/perf_morph.cpp | 2 +- modules/imgproc/perf/perf_resize.cpp | 11 +++++++---- 10 files changed, 62 insertions(+), 30 deletions(-) diff --git a/modules/core/perf/perf_arithm.cpp b/modules/core/perf/perf_arithm.cpp index 9200f5fadf56..7bc93abc2ab8 100644 --- a/modules/core/perf/perf_arithm.cpp +++ b/modules/core/perf/perf_arithm.cpp @@ -457,6 +457,10 @@ PERF_TEST_P_(BinaryOpTest, transpose2d) SANITY_CHECK_NOTHING(); } +// 8U/16U/32F x C1/C3/C4 (matches IPP transpose coverage; shared by the +// multichannel and in-place transpose tests below). +#define TRANSPOSE_TYPES CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, CV_32FC1, CV_32FC3, CV_32FC4 + // Multichannel transpose (matches IPP perf coverage: 8U/16U/32F x C1/C3/C4) typedef Size_MatType TransposeMultiChannelTest; @@ -477,7 +481,7 @@ PERF_TEST_P_(TransposeMultiChannelTest, transpose2d_multichannel) INSTANTIATE_TEST_CASE_P(/*nothing*/ , TransposeMultiChannelTest, testing::Combine( testing::Values(szVGA, sz720p, sz1080p), - testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, CV_32FC1, CV_32FC3, CV_32FC4) + testing::Values(TRANSPOSE_TYPES) ) ); @@ -507,7 +511,7 @@ PERF_TEST_P_(TransposeInplaceTest, transpose2d_inplace) INSTANTIATE_TEST_CASE_P(/*nothing*/ , TransposeInplaceTest, testing::Combine( testing::Values(cv::Size(1280, 1280), cv::Size(1920, 1920)), - testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, CV_32FC1, CV_32FC3, CV_32FC4) + testing::Values(TRANSPOSE_TYPES) ) ); diff --git a/modules/core/perf/perf_convertTo.cpp b/modules/core/perf/perf_convertTo.cpp index e473b4e1ef73..c810614626e6 100644 --- a/modules/core/perf/perf_convertTo.cpp +++ b/modules/core/perf/perf_convertTo.cpp @@ -5,6 +5,9 @@ namespace opencv_test { using namespace perf; +// Full depth sweep exercised by convertTo (src and dst independently). +#define CONVERT_TO_DEPTHS CV_8U, CV_8S, CV_16U, CV_16S, CV_32S, CV_32F, CV_64F + typedef tuple Size_DepthSrc_DepthDst_Channels_alpha_t; typedef perf::TestBaseWithParam Size_DepthSrc_DepthDst_Channels_alpha; @@ -12,8 +15,8 @@ PERF_TEST_P( Size_DepthSrc_DepthDst_Channels_alpha, convertTo, testing::Combine ( testing::Values(szVGA, sz1080p), - testing::Values(CV_8U, CV_8S, CV_16U, CV_16S, CV_32S, CV_32F, CV_64F), - testing::Values(CV_8U, CV_8S, CV_16U, CV_16S, CV_32S, CV_32F, CV_64F), + testing::Values(CONVERT_TO_DEPTHS), + testing::Values(CONVERT_TO_DEPTHS), testing::Values(1, 4), testing::Values(1.0, 1./255) ) @@ -44,8 +47,8 @@ PERF_TEST_P( Size_DepthSrc_DepthDst_Channels_alpha, convertTo_scale_shift, testing::Combine ( testing::Values(szVGA, sz1080p), - testing::Values(CV_8U, CV_8S, CV_16U, CV_16S, CV_32S, CV_32F, CV_64F), - testing::Values(CV_8U, CV_8S, CV_16U, CV_16S, CV_32S, CV_32F, CV_64F), + testing::Values(CONVERT_TO_DEPTHS), + testing::Values(CONVERT_TO_DEPTHS), testing::Values(1, 4), testing::Values(1.0, 1./255) ) @@ -80,7 +83,7 @@ PERF_TEST_P( Size_Depth_alpha, convertTo_scale_shift_inplace, testing::Combine ( testing::Values(szVGA, sz1080p), - testing::Values(CV_8U, CV_8S, CV_16U, CV_16S, CV_32S, CV_32F, CV_64F), + testing::Values(CONVERT_TO_DEPTHS), testing::Values(1.0, 1./255) ) ) diff --git a/modules/core/perf/perf_minmaxloc.cpp b/modules/core/perf/perf_minmaxloc.cpp index 84fdf178c17c..a4d716b0ab1f 100644 --- a/modules/core/perf/perf_minmaxloc.cpp +++ b/modules/core/perf/perf_minmaxloc.cpp @@ -47,12 +47,15 @@ enum }; CV_ENUM(MinMaxType, MMI_ALL, MMI_MIN_MAX, MMI_MIN_IDX, MMI_MAX_IDX) +// 8U/16U/16S/32F C1 (matches IPP minMaxIdx coverage; shared by the plain and masked tests). +#define MINMAXIDX_TYPES CV_8UC1, CV_16UC1, CV_16SC1, CV_32FC1 + typedef tuple Size_MatType_MinMaxType_t; typedef perf::TestBaseWithParam Size_MatType_MinMaxType; PERF_TEST_P(Size_MatType_MinMaxType, minMaxIdx, testing::Combine( testing::Values(TYPICAL_MAT_SIZES), - testing::Values(CV_8UC1, CV_16UC1, CV_16SC1, CV_32FC1), + testing::Values(MINMAXIDX_TYPES), MinMaxType::all() ) ) @@ -81,7 +84,7 @@ PERF_TEST_P(Size_MatType_MinMaxType, minMaxIdx, testing::Combine( PERF_TEST_P(Size_MatType_MinMaxType, minMaxIdx_mask, testing::Combine( testing::Values(TYPICAL_MAT_SIZES), - testing::Values(CV_8UC1, CV_16UC1, CV_16SC1, CV_32FC1), + testing::Values(MINMAXIDX_TYPES), MinMaxType::all() ) ) diff --git a/modules/core/perf/perf_norm.cpp b/modules/core/perf/perf_norm.cpp index 8e561705e242..8819288f1d61 100644 --- a/modules/core/perf/perf_norm.cpp +++ b/modules/core/perf/perf_norm.cpp @@ -8,6 +8,9 @@ using namespace perf; #define HAMMING_NORM_SIZES cv::Size(640, 480), cv::Size(1920, 1080) #define HAMMING_NORM_TYPES CV_8UC1 +// Masked norm coverage widened to match IPP (adds C3 + 16U; shared by norm_mask/norm2_mask). +#define NORM_MASK_TYPES CV_8UC1, CV_8UC3, CV_8UC4, CV_8SC1, CV_16UC1, CV_16UC3, CV_16SC1, CV_32SC1, CV_32FC1, CV_32FC3, CV_64FC1 + CV_FLAGS(NormType, NORM_HAMMING2, NORM_HAMMING, NORM_INF, NORM_L1, NORM_L2, NORM_TYPE_MASK, NORM_RELATIVE, NORM_MINMAX) typedef tuple Size_MatType_NormType_t; typedef perf::TestBaseWithParam Size_MatType_NormType; @@ -37,7 +40,7 @@ PERF_TEST_P(Size_MatType_NormType, norm, PERF_TEST_P(Size_MatType_NormType, norm_mask, testing::Combine( testing::Values(TYPICAL_MAT_SIZES), - testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_8SC1, CV_16UC1, CV_16UC3, CV_16SC1, CV_32SC1, CV_32FC1, CV_32FC3, CV_64FC1), + testing::Values(NORM_MASK_TYPES), testing::Values((int)NORM_INF, (int)NORM_L1, (int)NORM_L2, (int)NORM_L2SQR) ) ) @@ -83,7 +86,7 @@ PERF_TEST_P(Size_MatType_NormType, norm2, PERF_TEST_P(Size_MatType_NormType, norm2_mask, testing::Combine( testing::Values(TYPICAL_MAT_SIZES), - testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_8SC1, CV_16UC1, CV_16UC3, CV_16SC1, CV_32SC1, CV_32FC1, CV_32FC3, CV_64FC1), + testing::Values(NORM_MASK_TYPES), testing::Values((int)NORM_INF, (int)NORM_L1, (int)NORM_L2, (int)NORM_L2SQR, (int)(NORM_RELATIVE|NORM_INF), (int)(NORM_RELATIVE|NORM_L1), (int)(NORM_RELATIVE|NORM_L2), (int)(NORM_RELATIVE|NORM_L2SQR)) ) ) diff --git a/modules/core/perf/perf_reduce.cpp b/modules/core/perf/perf_reduce.cpp index 22bf6bf396b8..390220976546 100644 --- a/modules/core/perf/perf_reduce.cpp +++ b/modules/core/perf/perf_reduce.cpp @@ -9,11 +9,14 @@ CV_ENUM(ROp, REDUCE_SUM, REDUCE_AVG, REDUCE_MAX, REDUCE_MIN, REDUCE_SUM2) typedef tuple Size_MatType_ROp_t; typedef perf::TestBaseWithParam Size_MatType_ROp; +// C1/C3/C4 over 8U/16U/16S/32F (widened from TYPICAL_MAT_TYPES to match IPP MAX/MIN coverage). +#define TYPICAL_MAT_TYPES_REDUCE CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, \ + CV_16SC1, CV_16SC3, CV_16SC4, CV_32FC1, CV_32FC3, CV_32FC4 PERF_TEST_P(Size_MatType_ROp, reduceR, testing::Combine( testing::Values(TYPICAL_MAT_SIZES), - testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, CV_16SC1, CV_16SC3, CV_16SC4, CV_32FC1, CV_32FC3, CV_32FC4), + testing::Values(TYPICAL_MAT_TYPES_REDUCE), ROp::all() ) ) @@ -51,7 +54,7 @@ PERF_TEST_P(Size_MatType_ROp, reduceR, PERF_TEST_P(Size_MatType_ROp, reduceC, testing::Combine( testing::Values(TYPICAL_MAT_SIZES), - testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, CV_16SC1, CV_16SC3, CV_16SC4, CV_32FC1, CV_32FC3, CV_32FC4), + testing::Values(TYPICAL_MAT_TYPES_REDUCE), ROp::all() ) ) diff --git a/modules/core/perf/perf_stat.cpp b/modules/core/perf/perf_stat.cpp index 6b7e532302c4..6069b3124892 100644 --- a/modules/core/perf/perf_stat.cpp +++ b/modules/core/perf/perf_stat.cpp @@ -5,8 +5,13 @@ namespace opencv_test { using namespace perf; +// Masked variants: 8U/16U/32F x C1/C3/C4 (matches IPP mean_mask/meanStdDev_mask). +#define TYPICAL_MAT_TYPES_STAT_MASK CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, CV_32FC1, CV_32FC3, CV_32FC4 +// sum/mean/meanStdDev additionally cover 16S. +#define TYPICAL_MAT_TYPES_STAT TYPICAL_MAT_TYPES_STAT_MASK, CV_16SC1, CV_16SC3, CV_16SC4 + PERF_TEST_P(Size_MatType, sum, testing::Combine( testing::Values( TYPICAL_MAT_SIZES ), - testing::Values( CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, CV_16SC1, CV_16SC3, CV_16SC4, CV_32FC1, CV_32FC3, CV_32FC4 ) )) + testing::Values( TYPICAL_MAT_TYPES_STAT ) )) { Size sz = get<0>(GetParam()); int type = get<1>(GetParam()); @@ -22,7 +27,7 @@ PERF_TEST_P(Size_MatType, sum, testing::Combine( testing::Values( TYPICAL_MAT_SI } PERF_TEST_P(Size_MatType, mean, testing::Combine( testing::Values( TYPICAL_MAT_SIZES ), - testing::Values( CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, CV_16SC1, CV_16SC3, CV_16SC4, CV_32FC1, CV_32FC3, CV_32FC4 ) )) + testing::Values( TYPICAL_MAT_TYPES_STAT ) )) { Size sz = get<0>(GetParam()); int type = get<1>(GetParam()); @@ -38,7 +43,7 @@ PERF_TEST_P(Size_MatType, mean, testing::Combine( testing::Values( TYPICAL_MAT_S } PERF_TEST_P(Size_MatType, mean_mask, testing::Combine( testing::Values( TYPICAL_MAT_SIZES ), - testing::Values( CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, CV_32FC1, CV_32FC3, CV_32FC4 ) )) + testing::Values( TYPICAL_MAT_TYPES_STAT_MASK ) )) { Size sz = get<0>(GetParam()); int type = get<1>(GetParam()); @@ -55,7 +60,7 @@ PERF_TEST_P(Size_MatType, mean_mask, testing::Combine( testing::Values( TYPICAL_ } PERF_TEST_P(Size_MatType, meanStdDev, testing::Combine( testing::Values( TYPICAL_MAT_SIZES ), - testing::Values( CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, CV_32FC1, CV_32FC3, CV_32FC4 ) )) + testing::Values( TYPICAL_MAT_TYPES_STAT_MASK ) )) { Size sz = get<0>(GetParam()); int matType = get<1>(GetParam()); diff --git a/modules/imgproc/perf/perf_blur.cpp b/modules/imgproc/perf/perf_blur.cpp index 5558acf497ff..9a59e9965bf2 100644 --- a/modules/imgproc/perf/perf_blur.cpp +++ b/modules/imgproc/perf/perf_blur.cpp @@ -6,13 +6,19 @@ namespace opencv_test { +// 8U/16U/16S x C1/C3/C4 + 32FC1 (matches IPP medianBlur coverage; ksize 3/5 for +// all types — shared by the out-of-place and in-place median tests). +#define MEDIAN_BLUR_TYPES CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, CV_16SC1, CV_16SC3, CV_16SC4, CV_32FC1 +// 3x3 / 5x5 GaussianBlur type coverage (matches IPP; shared by both fixed-kernel tests). +#define GAUSSIAN_BLUR_TYPES CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16SC1, CV_16SC3, CV_32FC1, CV_32FC3 + typedef tuple Size_MatType_kSize_t; typedef perf::TestBaseWithParam Size_MatType_kSize; PERF_TEST_P(Size_MatType_kSize, medianBlur, testing::Combine( testing::Values(szODD, szQVGA, szVGA, sz720p), - testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, CV_16SC1, CV_16SC3, CV_16SC4, CV_32FC1), + testing::Values(MEDIAN_BLUR_TYPES), testing::Values(3, 5) ) ) @@ -64,7 +70,7 @@ PERF_TEST_P(Size_MatType_kSize, medianBlur_large, PERF_TEST_P(Size_MatType_kSize, medianBlur_inplace, testing::Combine( testing::Values(szODD, szQVGA, szVGA, sz720p), - testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, CV_16SC1, CV_16SC3, CV_16SC4, CV_32FC1), + testing::Values(MEDIAN_BLUR_TYPES), testing::Values(3, 5) ) ) @@ -110,7 +116,7 @@ typedef perf::TestBaseWithParam Size_MatType_Bo PERF_TEST_P(Size_MatType_BorderType3x3, gaussianBlur3x3, testing::Combine( testing::Values(szODD, szQVGA, szVGA, sz720p), - testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16SC1, CV_16SC3, CV_32FC1, CV_32FC3), + testing::Values(GAUSSIAN_BLUR_TYPES), BorderType3x3::all() ) ) @@ -257,7 +263,7 @@ PERF_TEST_P(Size_MatType_BorderType_ksize, box_inplace, PERF_TEST_P(Size_MatType_BorderType, gaussianBlur5x5, testing::Combine( testing::Values(szODD, szQVGA, szVGA, sz720p), - testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16SC1, CV_16SC3, CV_32FC1, CV_32FC3), + testing::Values(GAUSSIAN_BLUR_TYPES), BorderType::all() ) ) diff --git a/modules/imgproc/perf/perf_filter2d.cpp b/modules/imgproc/perf/perf_filter2d.cpp index c87f1f381e12..6905a2ac3d30 100644 --- a/modules/imgproc/perf/perf_filter2d.cpp +++ b/modules/imgproc/perf/perf_filter2d.cpp @@ -8,6 +8,10 @@ namespace opencv_test { CV_ENUM(BorderMode, BORDER_CONSTANT, BORDER_REPLICATE, BORDER_REFLECT_101) +// 8U/16U/16S/32F x C1/C3/C4 (matches IPP filter2D/sepFilter2D coverage). +#define FILTER2D_TYPES CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, \ + CV_16SC1, CV_16SC3, CV_16SC4, CV_32FC1, CV_32FC3, CV_32FC4 + typedef TestBaseWithParam< tuple > TestFilter2d; typedef TestBaseWithParam< tuple > Image_KernelSize; @@ -47,8 +51,7 @@ typedef TestBaseWithParam< tuple > TestFilter2dType PERF_TEST_P( TestFilter2dTypes, Filter2d_types, Combine( Values( sz1080p ), - Values( CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, - CV_16SC1, CV_16SC3, CV_16SC4, CV_32FC1, CV_32FC3, CV_32FC4 ), + Values( FILTER2D_TYPES ), Values( 3, 5, 7, 21 ), Values( CV_16SC1, CV_32FC1 ) // kernel type ) @@ -82,8 +85,7 @@ PERF_TEST_P( TestFilter2dTypes, Filter2d_types, PERF_TEST_P( TestFilter2dTypes, sepFilter2D_types, Combine( Values( sz1080p ), - Values( CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, - CV_16SC1, CV_16SC3, CV_16SC4, CV_32FC1, CV_32FC3, CV_32FC4 ), + Values( FILTER2D_TYPES ), Values( 3, 5, 7, 21 ), Values( CV_32FC1 ) // separable kernels are float ) diff --git a/modules/imgproc/perf/perf_morph.cpp b/modules/imgproc/perf/perf_morph.cpp index 8943829eee4c..30a9060199b8 100644 --- a/modules/imgproc/perf/perf_morph.cpp +++ b/modules/imgproc/perf/perf_morph.cpp @@ -106,7 +106,7 @@ typedef perf::TestBaseWithParam Size_MatTyp PERF_TEST_P(Size_MatType_MorphExOp_kSize_iter, morphologyEx, testing::Combine( MORPH_KERNEL_SIZES, - testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16SC1, CV_32FC1, CV_32FC3, CV_32FC4), + testing::Values(TYPICAL_MAT_TYPES_MORPH), MorphExOp::all(), testing::Values(3, 5, 7), testing::Values(1, 3) diff --git a/modules/imgproc/perf/perf_resize.cpp b/modules/imgproc/perf/perf_resize.cpp index aac71e637c49..907161e6daf5 100644 --- a/modules/imgproc/perf/perf_resize.cpp +++ b/modules/imgproc/perf/perf_resize.cpp @@ -16,6 +16,11 @@ typedef TestBaseWithParam MatInfo_SizePair; CV_16UC1, CV_16UC2, CV_16UC3, CV_16UC4, \ CV_32FC1, CV_32FC2, CV_32FC3, CV_32FC4 +// 8U/16U/16S/32F x C1/C3/C4 (matches IPP CUBIC/LANCZOS4/affine coverage; +// shared by the resizeCubicLanczos and resizeAffine tests below). +#define RESIZE_INTER_TYPES CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, \ + CV_16SC1, CV_16SC3, CV_16SC4, CV_32FC1, CV_32FC3, CV_32FC4 + // For gradient-ish testing of the other matrix formats template static void fillFPGradient(Mat& img) @@ -290,8 +295,7 @@ typedef TestBaseWithParam MatInfo_Size_Scale_Inter; PERF_TEST_P(MatInfo_Size_Scale_Inter, resizeCubicLanczos, testing::Combine( - testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, - CV_16SC1, CV_16SC3, CV_16SC4, CV_32FC1, CV_32FC3, CV_32FC4), + testing::Values(RESIZE_INTER_TYPES), testing::Values(sz1080p), testing::Values(0.777, 1.333, 2.0, 0.5, 0.25), ResizeInterCubicLanczos::all() @@ -321,8 +325,7 @@ typedef TestBaseWithParam MatInfo_Size_Scale_I PERF_TEST_P(MatInfo_Size_Scale_InterAffine, resizeAffine, testing::Combine( - testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, - CV_16SC1, CV_16SC3, CV_16SC4, CV_32FC1, CV_32FC3, CV_32FC4), + testing::Values(RESIZE_INTER_TYPES), testing::Values(sz1080p), testing::Values(0.777, 1.333, 2.0, 0.5, 0.25), ResizeInterAffine::all() From db56733e630ad892c0bff24cf5e877310f18391c Mon Sep 17 00:00:00 2001 From: "Fedorov, Andrey" Date: Tue, 28 Jul 2026 07:30:17 -0700 Subject: [PATCH 09/12] macros for each lists --- modules/calib3d/perf/perf_filterspeckles.cpp | 5 ++++- modules/core/perf/perf_arithm.cpp | 16 ++++++++++++---- modules/core/perf/perf_bitwise.cpp | 3 ++- modules/core/perf/perf_channels.cpp | 7 +++++-- modules/core/perf/perf_compare.cpp | 8 ++++++-- modules/core/perf/perf_dot.cpp | 5 ++++- modules/core/perf/perf_flip.cpp | 4 +++- modules/core/perf/perf_lut.cpp | 4 +++- modules/core/perf/perf_mat.cpp | 12 ++++++++++-- modules/core/perf/perf_stat.cpp | 8 +++++--- modules/imgproc/perf/perf_blur.cpp | 13 ++++++++++--- modules/imgproc/perf/perf_copymakeborder.cpp | 14 ++++++++------ modules/imgproc/perf/perf_filter2d.cpp | 11 ++++++++--- modules/imgproc/perf/perf_getrectsubpix.cpp | 7 +++++-- modules/imgproc/perf/perf_threshold.cpp | 8 ++++++-- 15 files changed, 91 insertions(+), 34 deletions(-) diff --git a/modules/calib3d/perf/perf_filterspeckles.cpp b/modules/calib3d/perf/perf_filterspeckles.cpp index 531063cf69ab..d18ed895a2d9 100644 --- a/modules/calib3d/perf/perf_filterspeckles.cpp +++ b/modules/calib3d/perf/perf_filterspeckles.cpp @@ -8,13 +8,16 @@ namespace opencv_test { using namespace perf; +// Disparity-map types accepted by filterSpeckles (matches IPP coverage). +#define FILTERSPECKLES_TYPES CV_8UC1, CV_16SC1 + typedef tuple Size_MatType_t; typedef perf::TestBaseWithParam Size_MatType_FilterSpeckles; PERF_TEST_P(Size_MatType_FilterSpeckles, filterSpeckles, testing::Combine( testing::Values(szVGA, sz720p, sz1080p), - testing::Values(CV_8UC1, CV_16SC1) + testing::Values(FILTERSPECKLES_TYPES) )) { Size sz = get<0>(GetParam()); diff --git a/modules/core/perf/perf_arithm.cpp b/modules/core/perf/perf_arithm.cpp index 7bc93abc2ab8..a9c82cc241d6 100644 --- a/modules/core/perf/perf_arithm.cpp +++ b/modules/core/perf/perf_arithm.cpp @@ -7,6 +7,14 @@ namespace opencv_test { using namespace perf; +// Shared BinaryOpTest coverage (matches IPP add/subtract/multiply/absdiff/min/max/transpose). +#define BINARY_OP_TYPES CV_8UC1, CV_8UC3, CV_8UC4, CV_8SC1, CV_16UC1, CV_16SC1, CV_16SC2, \ + CV_16SC3, CV_16SC4, CV_32SC1, CV_32FC1, CV_64FC1 +// Integer types accepting a scale factor (matches IPP add/subtract _Scale). +#define ARITHM_SCALE_TYPES (perf::MatType)CV_8UC1, (perf::MatType)CV_16UC1, (perf::MatType)CV_16SC1 +// Floating-point-only ops (cv::pow / sqrt). +#define ARITHM_FLOAT_TYPES CV_32FC1, CV_64FC1 + using BroadcastTest = perf::TestBaseWithParam, perf::MatType, std::vector>>; typedef Size_MatType BinaryOpTest; @@ -605,7 +613,7 @@ PERF_TEST_P_(BinaryOpTest, transposeND_generic_move_tail_order) INSTANTIATE_TEST_CASE_P(/*nothing*/ , BinaryOpTest, testing::Combine( testing::Values(szVGA, sz720p, sz1080p), - testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_8SC1, CV_16UC1, CV_16SC1, CV_16SC2, CV_16SC3, CV_16SC4, CV_32SC1, CV_32FC1, CV_64FC1) + testing::Values(BINARY_OP_TYPES) ) ); @@ -899,7 +907,7 @@ PERF_TEST_P_(ArithmScaleTest, subtract_scale) INSTANTIATE_TEST_CASE_P(/*nothing*/ , ArithmScaleTest, testing::Combine( testing::Values(szVGA, sz720p, sz1080p), - testing::Values((perf::MatType)CV_8UC1, (perf::MatType)CV_16UC1, (perf::MatType)CV_16SC1) + testing::Values(ARITHM_SCALE_TYPES) ) ); @@ -920,7 +928,7 @@ PERF_TEST_P_(SqrtFixture, Sqrt) { INSTANTIATE_TEST_CASE_P(/*nothing*/ , SqrtFixture, testing::Combine( testing::Values(TYPICAL_MAT_SIZES), - testing::Values(CV_32FC1, CV_64FC1), + testing::Values(ARITHM_FLOAT_TYPES), testing::Bool() ) ); @@ -943,7 +951,7 @@ PERF_TEST_P_(PowFixture, Pow) { INSTANTIATE_TEST_CASE_P(/*nothing*/ , PowFixture, testing::Combine( testing::Values(sz1080p), - testing::Values(CV_32FC1, CV_64FC1), + testing::Values(ARITHM_FLOAT_TYPES), testing::Values(-6.0, -5.0, -4.5, -4.0, -3.0, -2.0, -1.0, -0.7, -0.5, 0.0, 0.5, 0.7, 1.0, 2.0, 3.0, 4.0, 4.5, 5.0, 6.0) ) diff --git a/modules/core/perf/perf_bitwise.cpp b/modules/core/perf/perf_bitwise.cpp index f8b84013aeca..b8f670d8d05a 100644 --- a/modules/core/perf/perf_bitwise.cpp +++ b/modules/core/perf/perf_bitwise.cpp @@ -10,7 +10,8 @@ using namespace perf; #define TYPICAL_MATS_BITW_ARITHM testing::Combine(testing::Values(TYPICAL_MAT_SIZES_BITW_ARITHM), testing::Values(TYPICAL_MAT_TYPES_BITW_ARITHM)) // Scalar-operand bitwise tests also cover CV_16U (matches IPP ippBitwise*_Const: 8U,16U,32S) -#define TYPICAL_MATS_BITW_SCALAR testing::Combine(testing::Values(TYPICAL_MAT_SIZES_BITW_ARITHM), testing::Values(CV_8UC1, CV_8SC1, CV_8UC4, CV_16UC1, CV_32SC1, CV_32SC4)) +#define TYPICAL_MAT_TYPES_BITW_SCALAR CV_8UC1, CV_8SC1, CV_8UC4, CV_16UC1, CV_32SC1, CV_32SC4 +#define TYPICAL_MATS_BITW_SCALAR testing::Combine(testing::Values(TYPICAL_MAT_SIZES_BITW_ARITHM), testing::Values(TYPICAL_MAT_TYPES_BITW_SCALAR)) PERF_TEST_P(Size_MatType, bitwise_not, TYPICAL_MATS_BITW_ARITHM) { diff --git a/modules/core/perf/perf_channels.cpp b/modules/core/perf/perf_channels.cpp index 7275d3042dd0..9f39b18805f6 100644 --- a/modules/core/perf/perf_channels.cpp +++ b/modules/core/perf/perf_channels.cpp @@ -8,13 +8,16 @@ namespace opencv_test { using namespace perf; +// Multichannel types (matches IPP extractChannel/insertChannel coverage). +#define CHANNELS_TYPES CV_8UC3, CV_8UC4, CV_16UC3, CV_16UC4, CV_32FC3, CV_32FC4 + typedef tuple Size_MatType_t; typedef perf::TestBaseWithParam Size_MatType_Channels; PERF_TEST_P(Size_MatType_Channels, extractChannel, testing::Combine( testing::Values(TYPICAL_MAT_SIZES), - testing::Values(CV_8UC3, CV_8UC4, CV_16UC3, CV_16UC4, CV_32FC3, CV_32FC4) + testing::Values(CHANNELS_TYPES) )) { Size sz = get<0>(GetParam()); @@ -34,7 +37,7 @@ PERF_TEST_P(Size_MatType_Channels, extractChannel, PERF_TEST_P(Size_MatType_Channels, insertChannel, testing::Combine( testing::Values(TYPICAL_MAT_SIZES), - testing::Values(CV_8UC3, CV_8UC4, CV_16UC3, CV_16UC4, CV_32FC3, CV_32FC4) + testing::Values(CHANNELS_TYPES) )) { Size sz = get<0>(GetParam()); diff --git a/modules/core/perf/perf_compare.cpp b/modules/core/perf/perf_compare.cpp index c836e953f8d2..81ee2e6674af 100644 --- a/modules/core/perf/perf_compare.cpp +++ b/modules/core/perf/perf_compare.cpp @@ -7,13 +7,17 @@ using namespace perf; CV_ENUM(CmpType, CMP_EQ, CMP_GT, CMP_GE, CMP_LT, CMP_LE, CMP_NE) +#define COMPARE_TYPES CV_8UC1, CV_8UC4, CV_8SC1, CV_16UC1, CV_16SC1, CV_32SC1, CV_32FC1 +// Scalar-operand compare adds 16U/16S (matches IPP ippCompareScalar: 8U,16U,16S,32F). +#define COMPARE_SCALAR_TYPES CV_8UC1, CV_8UC4, CV_16UC1, CV_16SC1, CV_32FC1 + typedef tuple Size_MatType_CmpType_t; typedef perf::TestBaseWithParam Size_MatType_CmpType; PERF_TEST_P( Size_MatType_CmpType, compare, testing::Combine( testing::Values(::perf::szVGA, ::perf::sz1080p), - testing::Values(CV_8UC1, CV_8UC4, CV_8SC1, CV_16UC1, CV_16SC1, CV_32SC1, CV_32FC1), + testing::Values(COMPARE_TYPES), CmpType::all() ) ) @@ -36,7 +40,7 @@ PERF_TEST_P( Size_MatType_CmpType, compare, PERF_TEST_P( Size_MatType_CmpType, compareScalar, testing::Combine( testing::Values(TYPICAL_MAT_SIZES), - testing::Values(CV_8UC1, CV_8UC4, CV_16UC1, CV_16SC1, CV_32FC1), + testing::Values(COMPARE_SCALAR_TYPES), CmpType::all() ) ) diff --git a/modules/core/perf/perf_dot.cpp b/modules/core/perf/perf_dot.cpp index e25908ca3f90..7c90024d38f6 100644 --- a/modules/core/perf/perf_dot.cpp +++ b/modules/core/perf/perf_dot.cpp @@ -5,12 +5,15 @@ namespace opencv_test { using namespace perf; +// Adds CV_64F over the mainline list (matches IPP ippDotProd coverage). +#define DOT_TYPES CV_8UC1, CV_8SC1, CV_16SC1, CV_16UC1, CV_32SC1, CV_32FC1, CV_64FC1 + typedef tuple MatType_Length_t; typedef TestBaseWithParam MatType_Length; PERF_TEST_P( MatType_Length, dot, testing::Combine( - testing::Values( CV_8UC1, CV_8SC1, CV_16SC1, CV_16UC1, CV_32SC1, CV_32FC1, CV_64FC1 ), + testing::Values( DOT_TYPES ), testing::Values( 32, 64, 128, 256, 512, 1024 ) )) { diff --git a/modules/core/perf/perf_flip.cpp b/modules/core/perf/perf_flip.cpp index 23bf1e9f5fc4..f6941578e43b 100644 --- a/modules/core/perf/perf_flip.cpp +++ b/modules/core/perf/perf_flip.cpp @@ -18,6 +18,8 @@ enum #define FLIP_SIZES szQVGA, szVGA, sz1080p #define FLIP_TYPES CV_8UC1, CV_8UC2, CV_8UC3, CV_8UC4, CV_8SC1, CV_16UC1, CV_16UC3, CV_16UC4, CV_16SC1, CV_16SC2, CV_16SC3, CV_16SC4, CV_32SC1, CV_32FC1, CV_32FC3, CV_32FC4 #define FLIP_CODES FLIP_X, FLIP_Y, FLIP_XY +// In-place flip sweeps the IPP-relevant subset (8U/16U/32F x C1/C3/C4). +#define FLIP_INPLACE_TYPES CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, CV_32FC1, CV_32FC3, CV_32FC4 CV_FLAGS(FlipCode, FLIP_X, FLIP_Y, FLIP_XY); typedef tuple Size_MatType_FlipCode_t; @@ -47,7 +49,7 @@ PERF_TEST_P(Size_MatType_FlipCode, PERF_TEST_P(Size_MatType_FlipCode, flip_inplace, testing::Combine(testing::Values(FLIP_SIZES), - testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, CV_32FC1, CV_32FC3, CV_32FC4), + testing::Values(FLIP_INPLACE_TYPES), testing::Values(FLIP_CODES))) { Size sz = get<0>(GetParam()); diff --git a/modules/core/perf/perf_lut.cpp b/modules/core/perf/perf_lut.cpp index ac6156875bdb..9623d43a9f75 100644 --- a/modules/core/perf/perf_lut.cpp +++ b/modules/core/perf/perf_lut.cpp @@ -46,12 +46,14 @@ PERF_TEST_P( SizePrm, LUT_multi, // Channel + output-depth sweep (matches IPP perf coverage: // 8U->8U C1/C3/C4 and 8U->32S C1). +#define LUT_TYPES CV_8UC1, CV_8UC3, CV_8UC4, CV_32SC1 + typedef perf::TestBaseWithParam< tuple > Size_MatType_LUT; PERF_TEST_P( Size_MatType_LUT, LUT_types, testing::Combine( testing::Values(szVGA, sz1080p), - testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_32SC1) + testing::Values(LUT_TYPES) ) ) { diff --git a/modules/core/perf/perf_mat.cpp b/modules/core/perf/perf_mat.cpp index 228b8393860f..9e8115464668 100644 --- a/modules/core/perf/perf_mat.cpp +++ b/modules/core/perf/perf_mat.cpp @@ -5,6 +5,14 @@ namespace opencv_test { using namespace perf; +// Full type sweep for the masked copy (matches IPP ippCopy_Mask coverage). +#define MAT_COPYTO_MASK_TYPES CV_8UC1, CV_8UC2, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC2, CV_16UC3, CV_16UC4, \ + CV_16SC1, CV_16SC2, CV_16SC3, CV_16SC4, CV_32SC1, CV_32SC2, CV_32SC3, CV_32SC4, \ + CV_32FC1, CV_32FC2, CV_32FC3, CV_32FC4, CV_64FC1, CV_64FC2 +// Masked set-to (matches IPP ippSet_Mask coverage). +#define MAT_SETTO_MASK_TYPES CV_8UC1, CV_8UC2, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, \ + CV_32SC1, CV_32SC3, CV_32SC4, CV_32FC1, CV_32FC3, CV_32FC4 + PERF_TEST_P(Size_MatType, Mat_Eye, testing::Combine(testing::Values(TYPICAL_MAT_SIZES), testing::Values(TYPICAL_MAT_TYPES)) @@ -100,7 +108,7 @@ PERF_TEST_P(Size_MatType, Mat_Clone_Roi, PERF_TEST_P(Size_MatType, Mat_CopyToWithMask, testing::Combine(testing::Values(::perf::sz1080p, ::perf::szODD), - testing::Values(CV_8UC1, CV_8UC2, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC2, CV_16UC3, CV_16UC4, CV_16SC1, CV_16SC2, CV_16SC3, CV_16SC4, CV_32SC1, CV_32SC2, CV_32SC3, CV_32SC4, CV_32FC1, CV_32FC2, CV_32FC3, CV_32FC4, CV_64FC1, CV_64FC2)) + testing::Values(MAT_COPYTO_MASK_TYPES)) ) { const Size_MatType_t params = GetParam(); @@ -120,7 +128,7 @@ PERF_TEST_P(Size_MatType, Mat_CopyToWithMask, PERF_TEST_P(Size_MatType, Mat_SetToWithMask, testing::Combine(testing::Values(TYPICAL_MAT_SIZES), - testing::Values(CV_8UC1, CV_8UC2, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, CV_32SC1, CV_32SC3, CV_32SC4, CV_32FC1, CV_32FC3, CV_32FC4)) + testing::Values(MAT_SETTO_MASK_TYPES)) ) { const Size_MatType_t params = GetParam(); diff --git a/modules/core/perf/perf_stat.cpp b/modules/core/perf/perf_stat.cpp index 6069b3124892..bed29b6cd9e7 100644 --- a/modules/core/perf/perf_stat.cpp +++ b/modules/core/perf/perf_stat.cpp @@ -9,6 +9,8 @@ using namespace perf; #define TYPICAL_MAT_TYPES_STAT_MASK CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, CV_32FC1, CV_32FC3, CV_32FC4 // sum/mean/meanStdDev additionally cover 16S. #define TYPICAL_MAT_TYPES_STAT TYPICAL_MAT_TYPES_STAT_MASK, CV_16SC1, CV_16SC3, CV_16SC4 +// Single-channel-only reductions (shared by countNonZero/hasNonZero). +#define TYPICAL_MAT_TYPES_NONZERO CV_8UC1, CV_8SC1, CV_16UC1, CV_16SC1, CV_32SC1, CV_32FC1, CV_64FC1 PERF_TEST_P(Size_MatType, sum, testing::Combine( testing::Values( TYPICAL_MAT_SIZES ), testing::Values( TYPICAL_MAT_TYPES_STAT ) )) @@ -78,7 +80,7 @@ PERF_TEST_P(Size_MatType, meanStdDev, testing::Combine( testing::Values( TYPICAL } PERF_TEST_P(Size_MatType, meanStdDev_mask, testing::Combine( testing::Values( TYPICAL_MAT_SIZES ), - testing::Values( CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, CV_32FC1, CV_32FC3, CV_32FC4 ) )) + testing::Values( TYPICAL_MAT_TYPES_STAT_MASK ) )) { Size sz = get<0>(GetParam()); int matType = get<1>(GetParam()); @@ -96,7 +98,7 @@ PERF_TEST_P(Size_MatType, meanStdDev_mask, testing::Combine( testing::Values( TY SANITY_CHECK(dev, 1e-5); } -PERF_TEST_P(Size_MatType, countNonZero, testing::Combine( testing::Values( TYPICAL_MAT_SIZES ), testing::Values( CV_8UC1, CV_8SC1, CV_16UC1, CV_16SC1, CV_32SC1, CV_32FC1, CV_64FC1 ) )) +PERF_TEST_P(Size_MatType, countNonZero, testing::Combine( testing::Values( TYPICAL_MAT_SIZES ), testing::Values( TYPICAL_MAT_TYPES_NONZERO ) )) { Size sz = get<0>(GetParam()); int matType = get<1>(GetParam()); @@ -112,7 +114,7 @@ PERF_TEST_P(Size_MatType, countNonZero, testing::Combine( testing::Values( TYPIC SANITY_CHECK(cnt); } -PERF_TEST_P(Size_MatType, hasNonZero, testing::Combine( testing::Values( TYPICAL_MAT_SIZES ), testing::Values( CV_8UC1, CV_8SC1, CV_16UC1, CV_16SC1, CV_32SC1, CV_32FC1, CV_64FC1 ) )) +PERF_TEST_P(Size_MatType, hasNonZero, testing::Combine( testing::Values( TYPICAL_MAT_SIZES ), testing::Values( TYPICAL_MAT_TYPES_NONZERO ) )) { Size sz = get<0>(GetParam()); int matType = get<1>(GetParam()); diff --git a/modules/imgproc/perf/perf_blur.cpp b/modules/imgproc/perf/perf_blur.cpp index 9a59e9965bf2..9e62bad9a92c 100644 --- a/modules/imgproc/perf/perf_blur.cpp +++ b/modules/imgproc/perf/perf_blur.cpp @@ -11,6 +11,13 @@ namespace opencv_test { #define MEDIAN_BLUR_TYPES CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, CV_16SC1, CV_16SC3, CV_16SC4, CV_32FC1 // 3x3 / 5x5 GaussianBlur type coverage (matches IPP; shared by both fixed-kernel tests). #define GAUSSIAN_BLUR_TYPES CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16SC1, CV_16SC3, CV_32FC1, CV_32FC3 +// Large Gaussian kernels (7/21) drop the C4 variants. +#define GAUSSIAN_BLUR_LARGE_TYPES CV_8UC1, CV_8UC3, CV_16UC1, CV_16UC3, CV_16SC1, CV_16SC3, CV_32FC1, CV_32FC3 +// cv::medianBlur supports aperture > 5 for CV_8U only. +#define MEDIAN_BLUR_LARGE_TYPES CV_8UC1, CV_8UC3, CV_8UC4 +// Full boxFilter type sweep (matches IPP ippFilterBox coverage). +#define BOX_FILTER_TYPES CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, \ + CV_16SC1, CV_16SC3, CV_16SC4, CV_32SC1, CV_32FC1, CV_32FC3, CV_32FC4 typedef tuple Size_MatType_kSize_t; typedef perf::TestBaseWithParam Size_MatType_kSize; @@ -45,7 +52,7 @@ PERF_TEST_P(Size_MatType_kSize, medianBlur, PERF_TEST_P(Size_MatType_kSize, medianBlur_large, testing::Combine( testing::Values(szODD, szQVGA, szVGA, sz720p), - testing::Values(CV_8UC1, CV_8UC3, CV_8UC4), + testing::Values(MEDIAN_BLUR_LARGE_TYPES), testing::Values(7, 21) ) ) @@ -185,7 +192,7 @@ PERF_TEST_P(Size_MatType_BorderType, blur16x16, PERF_TEST_P(Size_MatType_BorderType_ksize, box, testing::Combine( testing::Values(szODD, szQVGA, szVGA, sz720p), - testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, CV_16SC1, CV_16SC3, CV_16SC4, CV_32SC1, CV_32FC1, CV_32FC3, CV_32FC4), + testing::Values(BOX_FILTER_TYPES), BorderType::all(), testing::Values(3, 5, 7, 21) ) @@ -286,7 +293,7 @@ PERF_TEST_P(Size_MatType_BorderType, gaussianBlur5x5, PERF_TEST_P(Size_MatType_BorderType_ksize, gaussianBlur, testing::Combine( testing::Values(szVGA, sz720p), - testing::Values(CV_8UC1, CV_8UC3, CV_16UC1, CV_16UC3, CV_16SC1, CV_16SC3, CV_32FC1, CV_32FC3), + testing::Values(GAUSSIAN_BLUR_LARGE_TYPES), BorderType::all(), testing::Values(7, 21) ) diff --git a/modules/imgproc/perf/perf_copymakeborder.cpp b/modules/imgproc/perf/perf_copymakeborder.cpp index f781e329b4cb..1b55f443edca 100644 --- a/modules/imgproc/perf/perf_copymakeborder.cpp +++ b/modules/imgproc/perf/perf_copymakeborder.cpp @@ -10,15 +10,19 @@ using namespace perf; CV_ENUM(BorderTypeCopy, BORDER_CONSTANT, BORDER_REPLICATE, BORDER_REFLECT_101) +// 8U/16U/16S/32S/32F x C1/C3/C4 (matches IPP copyMakeBorder coverage; +// shared by copyMakeBorder/copyMakeBorder_inplace). +#define COPYMAKEBORDER_TYPES CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, \ + CV_16SC1, CV_16SC3, CV_16SC4, CV_32SC1, CV_32SC3, CV_32SC4, \ + CV_32FC1, CV_32FC3, CV_32FC4 + typedef tuple Size_MatType_Border_BorderSize_t; typedef perf::TestBaseWithParam Size_MatType_Border_BorderSize; PERF_TEST_P(Size_MatType_Border_BorderSize, copyMakeBorder, testing::Combine( testing::Values(szVGA, sz720p, sz1080p), - testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, - CV_16SC1, CV_16SC3, CV_16SC4, CV_32SC1, CV_32SC3, CV_32SC4, - CV_32FC1, CV_32FC3, CV_32FC4), + testing::Values(COPYMAKEBORDER_TYPES), BorderTypeCopy::all(), testing::Values(1, 2, 6) )) @@ -45,9 +49,7 @@ PERF_TEST_P(Size_MatType_Border_BorderSize, copyMakeBorder, PERF_TEST_P(Size_MatType_Border_BorderSize, copyMakeBorder_inplace, testing::Combine( testing::Values(szVGA, sz720p, sz1080p), - testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, - CV_16SC1, CV_16SC3, CV_16SC4, CV_32SC1, CV_32SC3, CV_32SC4, - CV_32FC1, CV_32FC3, CV_32FC4), + testing::Values(COPYMAKEBORDER_TYPES), BorderTypeCopy::all(), testing::Values(1, 2, 6) )) diff --git a/modules/imgproc/perf/perf_filter2d.cpp b/modules/imgproc/perf/perf_filter2d.cpp index 6905a2ac3d30..4be107d2a714 100644 --- a/modules/imgproc/perf/perf_filter2d.cpp +++ b/modules/imgproc/perf/perf_filter2d.cpp @@ -11,6 +11,11 @@ CV_ENUM(BorderMode, BORDER_CONSTANT, BORDER_REPLICATE, BORDER_REFLECT_101) // 8U/16U/16S/32F x C1/C3/C4 (matches IPP filter2D/sepFilter2D coverage). #define FILTER2D_TYPES CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, \ CV_16SC1, CV_16SC3, CV_16SC4, CV_32FC1, CV_32FC3, CV_32FC4 +// filter2D accepts both integer and float kernels; separable kernels are float only. +#define FILTER2D_KERNEL_TYPES CV_16SC1, CV_32FC1 +#define SEPFILTER2D_KERNEL_TYPES CV_32FC1 +// Common types for the tiled parallel FilterEngine path. +#define FILTER2D_PARALLEL_TYPES CV_8UC1, CV_8UC3, CV_32FC1 typedef TestBaseWithParam< tuple > TestFilter2d; typedef TestBaseWithParam< tuple > Image_KernelSize; @@ -53,7 +58,7 @@ PERF_TEST_P( TestFilter2dTypes, Filter2d_types, Values( sz1080p ), Values( FILTER2D_TYPES ), Values( 3, 5, 7, 21 ), - Values( CV_16SC1, CV_32FC1 ) // kernel type + Values( FILTER2D_KERNEL_TYPES ) // kernel type ) ) { @@ -87,7 +92,7 @@ PERF_TEST_P( TestFilter2dTypes, sepFilter2D_types, Values( sz1080p ), Values( FILTER2D_TYPES ), Values( 3, 5, 7, 21 ), - Values( CV_32FC1 ) // separable kernels are float + Values( SEPFILTER2D_KERNEL_TYPES ) // separable kernels are float ) ) { @@ -175,7 +180,7 @@ typedef TestBaseWithParam< tuple > ImgProc_Parallel PERF_TEST_P( ImgProc_ParallelFilter_Perf, filter2D_parallel, Combine( Values( Size(1280, 1024), sz1080p ), - Values( CV_8UC1, CV_8UC3, CV_32FC1 ), + Values( FILTER2D_PARALLEL_TYPES ), Values( BORDER_DEFAULT, BORDER_CONSTANT ), Values( false, true ) // false = filter2D, true = sepFilter2D ) diff --git a/modules/imgproc/perf/perf_getrectsubpix.cpp b/modules/imgproc/perf/perf_getrectsubpix.cpp index 9e0c0e5c52c7..de2607cb4e5b 100644 --- a/modules/imgproc/perf/perf_getrectsubpix.cpp +++ b/modules/imgproc/perf/perf_getrectsubpix.cpp @@ -8,14 +8,17 @@ namespace opencv_test { using namespace perf; +// src/dst depths swept independently (matches IPP getRectSubPix coverage). +#define GETRECTSUBPIX_TYPES CV_8UC1, CV_32FC1 + typedef tuple Size_SrcType_DstType_t; typedef perf::TestBaseWithParam Size_SrcType_DstType; PERF_TEST_P(Size_SrcType_DstType, getRectSubPix, testing::Combine( testing::Values(szVGA, sz720p, sz1080p), - testing::Values(CV_8UC1, CV_32FC1), - testing::Values(CV_8UC1, CV_32FC1) + testing::Values(GETRECTSUBPIX_TYPES), + testing::Values(GETRECTSUBPIX_TYPES) )) { Size sz = get<0>(GetParam()); diff --git a/modules/imgproc/perf/perf_threshold.cpp b/modules/imgproc/perf/perf_threshold.cpp index 567c2ce65018..48325a50c565 100644 --- a/modules/imgproc/perf/perf_threshold.cpp +++ b/modules/imgproc/perf/perf_threshold.cpp @@ -8,13 +8,17 @@ namespace opencv_test { CV_ENUM(ThreshType, THRESH_BINARY, THRESH_BINARY_INV, THRESH_TRUNC, THRESH_TOZERO, THRESH_TOZERO_INV) +#define THRESHOLD_TYPES CV_8UC1, CV_16SC1, CV_32FC1, CV_64FC1 +// In-place variant matches IPP ippThreshold_Inplace coverage (no 64F). +#define THRESHOLD_INPLACE_TYPES CV_8UC1, CV_16SC1, CV_32FC1 + typedef tuple Size_MatType_ThreshType_t; typedef perf::TestBaseWithParam Size_MatType_ThreshType; PERF_TEST_P(Size_MatType_ThreshType, threshold, testing::Combine( testing::Values(TYPICAL_MAT_SIZES), - testing::Values(CV_8UC1, CV_16SC1, CV_32FC1, CV_64FC1), + testing::Values(THRESHOLD_TYPES), ThreshType::all() ) ) @@ -42,7 +46,7 @@ PERF_TEST_P(Size_MatType_ThreshType, threshold, PERF_TEST_P(Size_MatType_ThreshType, threshold_inplace, testing::Combine( testing::Values(TYPICAL_MAT_SIZES), - testing::Values(CV_8UC1, CV_16SC1, CV_32FC1), + testing::Values(THRESHOLD_INPLACE_TYPES), ThreshType::all() ) ) From c1da90ffae81de0150f59e88a760bd3ee46ad073 Mon Sep 17 00:00:00 2001 From: "Fedorov, Andrey" Date: Tue, 28 Jul 2026 08:22:35 -0700 Subject: [PATCH 10/12] reuse others type lists --- modules/core/perf/perf_mat.cpp | 6 ++++-- modules/imgproc/perf/perf_blur.cpp | 21 ++++++++++++--------- modules/imgproc/perf/perf_threshold.cpp | 2 +- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/modules/core/perf/perf_mat.cpp b/modules/core/perf/perf_mat.cpp index 9e8115464668..992ad37136b9 100644 --- a/modules/core/perf/perf_mat.cpp +++ b/modules/core/perf/perf_mat.cpp @@ -5,12 +5,14 @@ namespace opencv_test { using namespace perf; +// 8U x C1..C4 — leading block common to both masked-operation sweeps below. +#define MAT_MASK_8U_TYPES CV_8UC1, CV_8UC2, CV_8UC3, CV_8UC4 // Full type sweep for the masked copy (matches IPP ippCopy_Mask coverage). -#define MAT_COPYTO_MASK_TYPES CV_8UC1, CV_8UC2, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC2, CV_16UC3, CV_16UC4, \ +#define MAT_COPYTO_MASK_TYPES MAT_MASK_8U_TYPES, CV_16UC1, CV_16UC2, CV_16UC3, CV_16UC4, \ CV_16SC1, CV_16SC2, CV_16SC3, CV_16SC4, CV_32SC1, CV_32SC2, CV_32SC3, CV_32SC4, \ CV_32FC1, CV_32FC2, CV_32FC3, CV_32FC4, CV_64FC1, CV_64FC2 // Masked set-to (matches IPP ippSet_Mask coverage). -#define MAT_SETTO_MASK_TYPES CV_8UC1, CV_8UC2, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, \ +#define MAT_SETTO_MASK_TYPES MAT_MASK_8U_TYPES, CV_16UC1, CV_16UC3, CV_16UC4, \ CV_32SC1, CV_32SC3, CV_32SC4, CV_32FC1, CV_32FC3, CV_32FC4 PERF_TEST_P(Size_MatType, Mat_Eye, diff --git a/modules/imgproc/perf/perf_blur.cpp b/modules/imgproc/perf/perf_blur.cpp index 9e62bad9a92c..7e6554179761 100644 --- a/modules/imgproc/perf/perf_blur.cpp +++ b/modules/imgproc/perf/perf_blur.cpp @@ -6,18 +6,21 @@ namespace opencv_test { -// 8U/16U/16S x C1/C3/C4 + 32FC1 (matches IPP medianBlur coverage; ksize 3/5 for -// all types — shared by the out-of-place and in-place median tests). -#define MEDIAN_BLUR_TYPES CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, CV_16SC1, CV_16SC3, CV_16SC4, CV_32FC1 +// 8U x C1/C3/C4 — depth/channel base shared by the type sweeps below. +#define BLUR_8U_TYPES CV_8UC1, CV_8UC3, CV_8UC4 +// 8U/16U/16S x C1/C3/C4 — integer coverage shared by medianBlur and boxFilter. +#define BLUR_INT_TYPES BLUR_8U_TYPES, CV_16UC1, CV_16UC3, CV_16UC4, CV_16SC1, CV_16SC3, CV_16SC4 +// + 32FC1 (matches IPP medianBlur coverage; ksize 3/5 for all types — shared by +// the out-of-place and in-place median tests). +#define MEDIAN_BLUR_TYPES BLUR_INT_TYPES, CV_32FC1 +// cv::medianBlur supports aperture > 5 for CV_8U only. +#define MEDIAN_BLUR_LARGE_TYPES BLUR_8U_TYPES +// Full boxFilter type sweep (matches IPP ippFilterBox coverage). +#define BOX_FILTER_TYPES BLUR_INT_TYPES, CV_32SC1, CV_32FC1, CV_32FC3, CV_32FC4 // 3x3 / 5x5 GaussianBlur type coverage (matches IPP; shared by both fixed-kernel tests). -#define GAUSSIAN_BLUR_TYPES CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16SC1, CV_16SC3, CV_32FC1, CV_32FC3 +#define GAUSSIAN_BLUR_TYPES BLUR_8U_TYPES, CV_16UC1, CV_16UC3, CV_16SC1, CV_16SC3, CV_32FC1, CV_32FC3 // Large Gaussian kernels (7/21) drop the C4 variants. #define GAUSSIAN_BLUR_LARGE_TYPES CV_8UC1, CV_8UC3, CV_16UC1, CV_16UC3, CV_16SC1, CV_16SC3, CV_32FC1, CV_32FC3 -// cv::medianBlur supports aperture > 5 for CV_8U only. -#define MEDIAN_BLUR_LARGE_TYPES CV_8UC1, CV_8UC3, CV_8UC4 -// Full boxFilter type sweep (matches IPP ippFilterBox coverage). -#define BOX_FILTER_TYPES CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, \ - CV_16SC1, CV_16SC3, CV_16SC4, CV_32SC1, CV_32FC1, CV_32FC3, CV_32FC4 typedef tuple Size_MatType_kSize_t; typedef perf::TestBaseWithParam Size_MatType_kSize; diff --git a/modules/imgproc/perf/perf_threshold.cpp b/modules/imgproc/perf/perf_threshold.cpp index 48325a50c565..a874f7c4bd04 100644 --- a/modules/imgproc/perf/perf_threshold.cpp +++ b/modules/imgproc/perf/perf_threshold.cpp @@ -8,9 +8,9 @@ namespace opencv_test { CV_ENUM(ThreshType, THRESH_BINARY, THRESH_BINARY_INV, THRESH_TRUNC, THRESH_TOZERO, THRESH_TOZERO_INV) -#define THRESHOLD_TYPES CV_8UC1, CV_16SC1, CV_32FC1, CV_64FC1 // In-place variant matches IPP ippThreshold_Inplace coverage (no 64F). #define THRESHOLD_INPLACE_TYPES CV_8UC1, CV_16SC1, CV_32FC1 +#define THRESHOLD_TYPES THRESHOLD_INPLACE_TYPES, CV_64FC1 typedef tuple Size_MatType_ThreshType_t; typedef perf::TestBaseWithParam Size_MatType_ThreshType; From 4217c8b1f25b0c254eb9351da64e9fcc55c8eb0b Mon Sep 17 00:00:00 2001 From: "Fedorov, Andrey" Date: Wed, 29 Jul 2026 06:18:15 -0700 Subject: [PATCH 11/12] remove some comments --- modules/calib3d/perf/perf_filterspeckles.cpp | 1 - modules/core/perf/perf_arithm.cpp | 14 ++------------ modules/core/perf/perf_bitwise.cpp | 3 --- modules/core/perf/perf_channels.cpp | 1 - modules/core/perf/perf_compare.cpp | 2 +- modules/core/perf/perf_convertTo.cpp | 3 --- modules/core/perf/perf_dot.cpp | 2 +- modules/core/perf/perf_flip.cpp | 1 - modules/core/perf/perf_lut.cpp | 2 -- modules/core/perf/perf_mat.cpp | 3 +-- modules/core/perf/perf_minmaxloc.cpp | 1 - modules/core/perf/perf_reduce.cpp | 2 -- modules/core/perf/perf_sort.cpp | 1 - modules/core/perf/perf_stat.cpp | 2 +- modules/imgproc/perf/perf_blur.cpp | 11 ++--------- modules/imgproc/perf/perf_canny.cpp | 2 -- modules/imgproc/perf/perf_copymakeborder.cpp | 5 +---- modules/imgproc/perf/perf_corners.cpp | 2 -- modules/imgproc/perf/perf_filter2d.cpp | 6 +----- modules/imgproc/perf/perf_getrectsubpix.cpp | 1 - modules/imgproc/perf/perf_histogram.cpp | 2 -- modules/imgproc/perf/perf_laplacian.cpp | 6 ------ modules/imgproc/perf/perf_matchTemplate.cpp | 1 - modules/imgproc/perf/perf_morph.cpp | 4 ---- modules/imgproc/perf/perf_resize.cpp | 8 -------- modules/imgproc/perf/perf_sepfilters.cpp | 3 --- modules/imgproc/perf/perf_threshold.cpp | 3 --- 27 files changed, 10 insertions(+), 82 deletions(-) diff --git a/modules/calib3d/perf/perf_filterspeckles.cpp b/modules/calib3d/perf/perf_filterspeckles.cpp index d18ed895a2d9..40c188d92d44 100644 --- a/modules/calib3d/perf/perf_filterspeckles.cpp +++ b/modules/calib3d/perf/perf_filterspeckles.cpp @@ -8,7 +8,6 @@ namespace opencv_test { using namespace perf; -// Disparity-map types accepted by filterSpeckles (matches IPP coverage). #define FILTERSPECKLES_TYPES CV_8UC1, CV_16SC1 typedef tuple Size_MatType_t; diff --git a/modules/core/perf/perf_arithm.cpp b/modules/core/perf/perf_arithm.cpp index a9c82cc241d6..bad71d006cff 100644 --- a/modules/core/perf/perf_arithm.cpp +++ b/modules/core/perf/perf_arithm.cpp @@ -7,10 +7,10 @@ namespace opencv_test { using namespace perf; -// Shared BinaryOpTest coverage (matches IPP add/subtract/multiply/absdiff/min/max/transpose). +// Shared BinaryOpTest coverage. #define BINARY_OP_TYPES CV_8UC1, CV_8UC3, CV_8UC4, CV_8SC1, CV_16UC1, CV_16SC1, CV_16SC2, \ CV_16SC3, CV_16SC4, CV_32SC1, CV_32FC1, CV_64FC1 -// Integer types accepting a scale factor (matches IPP add/subtract _Scale). +// Integer types accepting a scale factor. #define ARITHM_SCALE_TYPES (perf::MatType)CV_8UC1, (perf::MatType)CV_16UC1, (perf::MatType)CV_16SC1 // Floating-point-only ops (cv::pow / sqrt). #define ARITHM_FLOAT_TYPES CV_32FC1, CV_64FC1 @@ -403,7 +403,6 @@ PERF_TEST_P_(BinaryOpTest, multiplyScale) SANITY_CHECK_NOTHING(); } -// Scalar-operand multiply (matches IPP ippMultiply_Const: multiply(mat, Scalar)) PERF_TEST_P_(BinaryOpTest, multiplyScalar) { Size sz = get<0>(GetParam()); @@ -465,11 +464,8 @@ PERF_TEST_P_(BinaryOpTest, transpose2d) SANITY_CHECK_NOTHING(); } -// 8U/16U/32F x C1/C3/C4 (matches IPP transpose coverage; shared by the -// multichannel and in-place transpose tests below). #define TRANSPOSE_TYPES CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, CV_32FC1, CV_32FC3, CV_32FC4 -// Multichannel transpose (matches IPP perf coverage: 8U/16U/32F x C1/C3/C4) typedef Size_MatType TransposeMultiChannelTest; PERF_TEST_P_(TransposeMultiChannelTest, transpose2d_multichannel) @@ -493,8 +489,6 @@ INSTANTIATE_TEST_CASE_P(/*nothing*/ , TransposeMultiChannelTest, ) ); -// In-place transpose (matches IPP ippTranspose_Inplace: transpose(dst, dst)). -// In-place transpose requires a square matrix. typedef Size_MatType TransposeInplaceTest; PERF_TEST_P_(TransposeInplaceTest, transpose2d_inplace) @@ -871,9 +865,6 @@ INSTANTIATE_TEST_CASE_P(/*nothing*/ , ArithmMixedTest, ) ); -// add/subtract with two mixed input depths + explicit output depth -// (matches IPP ippAdd_Scale / ippSubtract_Scale: add(src1{8U/16U/16S}, src2{16U}, -// dst, noArray(), CV_32F)). typedef perf::TestBaseWithParam> ArithmScaleTest; PERF_TEST_P_(ArithmScaleTest, add_scale) @@ -933,7 +924,6 @@ INSTANTIATE_TEST_CASE_P(/*nothing*/ , SqrtFixture, ) ); -// Full power sweep (matches IPP perf coverage: cv::pow over a range of exponents) typedef perf::TestBaseWithParam> PowFixture; PERF_TEST_P_(PowFixture, Pow) { Size sz = get<0>(GetParam()); diff --git a/modules/core/perf/perf_bitwise.cpp b/modules/core/perf/perf_bitwise.cpp index b8f670d8d05a..b0170709cebe 100644 --- a/modules/core/perf/perf_bitwise.cpp +++ b/modules/core/perf/perf_bitwise.cpp @@ -9,7 +9,6 @@ using namespace perf; #define TYPICAL_MAT_TYPES_BITW_ARITHM CV_8UC1, CV_8SC1, CV_8UC4, CV_32SC1, CV_32SC4 #define TYPICAL_MATS_BITW_ARITHM testing::Combine(testing::Values(TYPICAL_MAT_SIZES_BITW_ARITHM), testing::Values(TYPICAL_MAT_TYPES_BITW_ARITHM)) -// Scalar-operand bitwise tests also cover CV_16U (matches IPP ippBitwise*_Const: 8U,16U,32S) #define TYPICAL_MAT_TYPES_BITW_SCALAR CV_8UC1, CV_8SC1, CV_8UC4, CV_16UC1, CV_32SC1, CV_32SC4 #define TYPICAL_MATS_BITW_SCALAR testing::Combine(testing::Values(TYPICAL_MAT_SIZES_BITW_ARITHM), testing::Values(TYPICAL_MAT_TYPES_BITW_SCALAR)) @@ -77,8 +76,6 @@ PERF_TEST_P(Size_MatType, bitwise_xor, TYPICAL_MATS_BITW_ARITHM) SANITY_CHECK(c); } -// Scalar-operand bitwise ops (matches IPP ippBitwise{And,Or,Xor}_Const: -// bitwise_*(mat, Scalar)). PERF_TEST_P(Size_MatType, bitwise_and_scalar, TYPICAL_MATS_BITW_SCALAR) { Size sz = get<0>(GetParam()); diff --git a/modules/core/perf/perf_channels.cpp b/modules/core/perf/perf_channels.cpp index 9f39b18805f6..51b10d4f36fe 100644 --- a/modules/core/perf/perf_channels.cpp +++ b/modules/core/perf/perf_channels.cpp @@ -8,7 +8,6 @@ namespace opencv_test { using namespace perf; -// Multichannel types (matches IPP extractChannel/insertChannel coverage). #define CHANNELS_TYPES CV_8UC3, CV_8UC4, CV_16UC3, CV_16UC4, CV_32FC3, CV_32FC4 typedef tuple Size_MatType_t; diff --git a/modules/core/perf/perf_compare.cpp b/modules/core/perf/perf_compare.cpp index 81ee2e6674af..2ea947e8520c 100644 --- a/modules/core/perf/perf_compare.cpp +++ b/modules/core/perf/perf_compare.cpp @@ -8,7 +8,7 @@ using namespace perf; CV_ENUM(CmpType, CMP_EQ, CMP_GT, CMP_GE, CMP_LT, CMP_LE, CMP_NE) #define COMPARE_TYPES CV_8UC1, CV_8UC4, CV_8SC1, CV_16UC1, CV_16SC1, CV_32SC1, CV_32FC1 -// Scalar-operand compare adds 16U/16S (matches IPP ippCompareScalar: 8U,16U,16S,32F). +// Scalar-operand compare adds 16U/16S. #define COMPARE_SCALAR_TYPES CV_8UC1, CV_8UC4, CV_16UC1, CV_16SC1, CV_32FC1 typedef tuple Size_MatType_CmpType_t; diff --git a/modules/core/perf/perf_convertTo.cpp b/modules/core/perf/perf_convertTo.cpp index c810614626e6..ab130251a3a2 100644 --- a/modules/core/perf/perf_convertTo.cpp +++ b/modules/core/perf/perf_convertTo.cpp @@ -42,7 +42,6 @@ PERF_TEST_P( Size_DepthSrc_DepthDst_Channels_alpha, convertTo, SANITY_CHECK(dst, eps); } -// Scale + shift (matches IPP perf coverage: convertTo with a nonzero beta/shift) PERF_TEST_P( Size_DepthSrc_DepthDst_Channels_alpha, convertTo_scale_shift, testing::Combine ( @@ -74,8 +73,6 @@ PERF_TEST_P( Size_DepthSrc_DepthDst_Channels_alpha, convertTo_scale_shift, SANITY_CHECK_NOTHING(); } -// In-place convertTo with scale+shift (matches IPP ippConvertTo_ScaleInplace: -// dst.convertTo(dst, sameType, scale, shift)). In-place requires src type==dst type. typedef tuple Size_Depth_alpha_t; typedef perf::TestBaseWithParam Size_Depth_alpha; diff --git a/modules/core/perf/perf_dot.cpp b/modules/core/perf/perf_dot.cpp index 7c90024d38f6..7e2bffe020e9 100644 --- a/modules/core/perf/perf_dot.cpp +++ b/modules/core/perf/perf_dot.cpp @@ -5,7 +5,7 @@ namespace opencv_test { using namespace perf; -// Adds CV_64F over the mainline list (matches IPP ippDotProd coverage). +// Adds CV_64F over the mainline list. #define DOT_TYPES CV_8UC1, CV_8SC1, CV_16SC1, CV_16UC1, CV_32SC1, CV_32FC1, CV_64FC1 typedef tuple MatType_Length_t; diff --git a/modules/core/perf/perf_flip.cpp b/modules/core/perf/perf_flip.cpp index f6941578e43b..18d04514c2ab 100644 --- a/modules/core/perf/perf_flip.cpp +++ b/modules/core/perf/perf_flip.cpp @@ -45,7 +45,6 @@ PERF_TEST_P(Size_MatType_FlipCode, SANITY_CHECK_NOTHING(); } -// In-place flip (matches IPP ippFlip_Inplace: flip(dst, dst, ...)) PERF_TEST_P(Size_MatType_FlipCode, flip_inplace, testing::Combine(testing::Values(FLIP_SIZES), diff --git a/modules/core/perf/perf_lut.cpp b/modules/core/perf/perf_lut.cpp index 9623d43a9f75..dc15b7d55b05 100644 --- a/modules/core/perf/perf_lut.cpp +++ b/modules/core/perf/perf_lut.cpp @@ -44,8 +44,6 @@ PERF_TEST_P( SizePrm, LUT_multi, SANITY_CHECK_NOTHING(); } -// Channel + output-depth sweep (matches IPP perf coverage: -// 8U->8U C1/C3/C4 and 8U->32S C1). #define LUT_TYPES CV_8UC1, CV_8UC3, CV_8UC4, CV_32SC1 typedef perf::TestBaseWithParam< tuple > Size_MatType_LUT; diff --git a/modules/core/perf/perf_mat.cpp b/modules/core/perf/perf_mat.cpp index 992ad37136b9..b662968b71c8 100644 --- a/modules/core/perf/perf_mat.cpp +++ b/modules/core/perf/perf_mat.cpp @@ -7,11 +7,10 @@ using namespace perf; // 8U x C1..C4 — leading block common to both masked-operation sweeps below. #define MAT_MASK_8U_TYPES CV_8UC1, CV_8UC2, CV_8UC3, CV_8UC4 -// Full type sweep for the masked copy (matches IPP ippCopy_Mask coverage). +// Full type sweep for the masked copy. #define MAT_COPYTO_MASK_TYPES MAT_MASK_8U_TYPES, CV_16UC1, CV_16UC2, CV_16UC3, CV_16UC4, \ CV_16SC1, CV_16SC2, CV_16SC3, CV_16SC4, CV_32SC1, CV_32SC2, CV_32SC3, CV_32SC4, \ CV_32FC1, CV_32FC2, CV_32FC3, CV_32FC4, CV_64FC1, CV_64FC2 -// Masked set-to (matches IPP ippSet_Mask coverage). #define MAT_SETTO_MASK_TYPES MAT_MASK_8U_TYPES, CV_16UC1, CV_16UC3, CV_16UC4, \ CV_32SC1, CV_32SC3, CV_32SC4, CV_32FC1, CV_32FC3, CV_32FC4 diff --git a/modules/core/perf/perf_minmaxloc.cpp b/modules/core/perf/perf_minmaxloc.cpp index a4d716b0ab1f..efdf084ce6ff 100644 --- a/modules/core/perf/perf_minmaxloc.cpp +++ b/modules/core/perf/perf_minmaxloc.cpp @@ -47,7 +47,6 @@ enum }; CV_ENUM(MinMaxType, MMI_ALL, MMI_MIN_MAX, MMI_MIN_IDX, MMI_MAX_IDX) -// 8U/16U/16S/32F C1 (matches IPP minMaxIdx coverage; shared by the plain and masked tests). #define MINMAXIDX_TYPES CV_8UC1, CV_16UC1, CV_16SC1, CV_32FC1 typedef tuple Size_MatType_MinMaxType_t; diff --git a/modules/core/perf/perf_reduce.cpp b/modules/core/perf/perf_reduce.cpp index 390220976546..ab6085d1662f 100644 --- a/modules/core/perf/perf_reduce.cpp +++ b/modules/core/perf/perf_reduce.cpp @@ -85,8 +85,6 @@ PERF_TEST_P(Size_MatType_ROp, reduceC, SANITY_CHECK_NOTHING(); } -// Explicit src->dst depth reduce (matches IPP ippReduce_Diff perf coverage: -// SUM/AVG with an explicit output depth over src/dst depth pairs x C1/C3/C4). CV_ENUM(ROpDiff, REDUCE_SUM, REDUCE_AVG) typedef tuple, ROpDiff, int> Size_SrcType_DstDepth_ROp_Dim_t; typedef perf::TestBaseWithParam Size_SrcType_DstDepth_ROp_Dim; diff --git a/modules/core/perf/perf_sort.cpp b/modules/core/perf/perf_sort.cpp index 282303801377..41f8ec1f29a0 100644 --- a/modules/core/perf/perf_sort.cpp +++ b/modules/core/perf/perf_sort.cpp @@ -28,7 +28,6 @@ PERF_TEST_P(sortFixture, sort, TYPICAL_MATS_SORT) SANITY_CHECK(b); } -// In-place sort (matches IPP ippSort_Inplace: sort(dst, dst, flags)) PERF_TEST_P(sortFixture, sort_inplace, TYPICAL_MATS_SORT) { const sortParams params = GetParam(); diff --git a/modules/core/perf/perf_stat.cpp b/modules/core/perf/perf_stat.cpp index bed29b6cd9e7..33fbc20d7ca9 100644 --- a/modules/core/perf/perf_stat.cpp +++ b/modules/core/perf/perf_stat.cpp @@ -5,7 +5,7 @@ namespace opencv_test { using namespace perf; -// Masked variants: 8U/16U/32F x C1/C3/C4 (matches IPP mean_mask/meanStdDev_mask). +// Masked variants: 8U/16U/32F x C1/C3/C4. #define TYPICAL_MAT_TYPES_STAT_MASK CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, CV_32FC1, CV_32FC3, CV_32FC4 // sum/mean/meanStdDev additionally cover 16S. #define TYPICAL_MAT_TYPES_STAT TYPICAL_MAT_TYPES_STAT_MASK, CV_16SC1, CV_16SC3, CV_16SC4 diff --git a/modules/imgproc/perf/perf_blur.cpp b/modules/imgproc/perf/perf_blur.cpp index 7e6554179761..8bf0e0f090d4 100644 --- a/modules/imgproc/perf/perf_blur.cpp +++ b/modules/imgproc/perf/perf_blur.cpp @@ -10,14 +10,12 @@ namespace opencv_test { #define BLUR_8U_TYPES CV_8UC1, CV_8UC3, CV_8UC4 // 8U/16U/16S x C1/C3/C4 — integer coverage shared by medianBlur and boxFilter. #define BLUR_INT_TYPES BLUR_8U_TYPES, CV_16UC1, CV_16UC3, CV_16UC4, CV_16SC1, CV_16SC3, CV_16SC4 -// + 32FC1 (matches IPP medianBlur coverage; ksize 3/5 for all types — shared by -// the out-of-place and in-place median tests). #define MEDIAN_BLUR_TYPES BLUR_INT_TYPES, CV_32FC1 // cv::medianBlur supports aperture > 5 for CV_8U only. #define MEDIAN_BLUR_LARGE_TYPES BLUR_8U_TYPES -// Full boxFilter type sweep (matches IPP ippFilterBox coverage). +// Full boxFilter type sweep. #define BOX_FILTER_TYPES BLUR_INT_TYPES, CV_32SC1, CV_32FC1, CV_32FC3, CV_32FC4 -// 3x3 / 5x5 GaussianBlur type coverage (matches IPP; shared by both fixed-kernel tests). +// 3x3 / 5x5 GaussianBlur type coverage. #define GAUSSIAN_BLUR_TYPES BLUR_8U_TYPES, CV_16UC1, CV_16UC3, CV_16SC1, CV_16SC3, CV_32FC1, CV_32FC3 // Large Gaussian kernels (7/21) drop the C4 variants. #define GAUSSIAN_BLUR_LARGE_TYPES CV_8UC1, CV_8UC3, CV_16UC1, CV_16UC3, CV_16SC1, CV_16SC3, CV_32FC1, CV_32FC3 @@ -50,8 +48,6 @@ PERF_TEST_P(Size_MatType_kSize, medianBlur, SANITY_CHECK(dst); } -// Large median kernels (matches IPP perf coverage: ksize 7, 21). -// cv::medianBlur only supports aperture > 5 for CV_8U, so this is 8-bit only. PERF_TEST_P(Size_MatType_kSize, medianBlur_large, testing::Combine( testing::Values(szODD, szQVGA, szVGA, sz720p), @@ -75,8 +71,6 @@ PERF_TEST_P(Size_MatType_kSize, medianBlur_large, SANITY_CHECK_NOTHING(); } -// In-place median blur (matches IPP ippMedianBlur_Inplace: medianBlur(dst, dst, k)). -// ksize 3/5 for all listed types (ksize > 5 is 8-bit only, covered by _large above). PERF_TEST_P(Size_MatType_kSize, medianBlur_inplace, testing::Combine( testing::Values(szODD, szQVGA, szVGA, sz720p), @@ -292,7 +286,6 @@ PERF_TEST_P(Size_MatType_BorderType, gaussianBlur5x5, SANITY_CHECK(dst, 1); } -// Larger Gaussian kernels (matches IPP perf coverage: kernel sizes 7 and 21) PERF_TEST_P(Size_MatType_BorderType_ksize, gaussianBlur, testing::Combine( testing::Values(szVGA, sz720p), diff --git a/modules/imgproc/perf/perf_canny.cpp b/modules/imgproc/perf/perf_canny.cpp index 3f6e7652dfbb..ef1645995315 100644 --- a/modules/imgproc/perf/perf_canny.cpp +++ b/modules/imgproc/perf/perf_canny.cpp @@ -38,8 +38,6 @@ PERF_TEST_P(Img_Aperture_L2_thresholds, canny, SANITY_CHECK(edges); } -// Pre-computed-gradient Canny overload Canny(dx, dy, edges, ...) — matches IPP -// ippCannyDeriv. No OSS perf test existed for this overload. typedef tuple Img_L2_t; typedef perf::TestBaseWithParam Img_L2; diff --git a/modules/imgproc/perf/perf_copymakeborder.cpp b/modules/imgproc/perf/perf_copymakeborder.cpp index 1b55f443edca..e02cbde5427d 100644 --- a/modules/imgproc/perf/perf_copymakeborder.cpp +++ b/modules/imgproc/perf/perf_copymakeborder.cpp @@ -10,8 +10,7 @@ using namespace perf; CV_ENUM(BorderTypeCopy, BORDER_CONSTANT, BORDER_REPLICATE, BORDER_REFLECT_101) -// 8U/16U/16S/32S/32F x C1/C3/C4 (matches IPP copyMakeBorder coverage; -// shared by copyMakeBorder/copyMakeBorder_inplace). +// 8U/16U/16S/32S/32F x C1/C3/C4. #define COPYMAKEBORDER_TYPES CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, \ CV_16SC1, CV_16SC3, CV_16SC4, CV_32SC1, CV_32SC3, CV_32SC4, \ CV_32FC1, CV_32FC3, CV_32FC4 @@ -44,8 +43,6 @@ PERF_TEST_P(Size_MatType_Border_BorderSize, copyMakeBorder, SANITY_CHECK_NOTHING(); } -// In-place-style: source is an ROI of the destination (matches IPP -// ippCopyMakeBorder_Inplace: copyMakeBorder into the surrounding border of src). PERF_TEST_P(Size_MatType_Border_BorderSize, copyMakeBorder_inplace, testing::Combine( testing::Values(szVGA, sz720p, sz1080p), diff --git a/modules/imgproc/perf/perf_corners.cpp b/modules/imgproc/perf/perf_corners.cpp index 5191a6648091..d9b2280b58b4 100644 --- a/modules/imgproc/perf/perf_corners.cpp +++ b/modules/imgproc/perf/perf_corners.cpp @@ -37,7 +37,6 @@ PERF_TEST_P(Img_BlockSize_ApertureSize_k_BorderType, cornerHarris, SANITY_CHECK(dst, 2e-5, ERROR_RELATIVE); } -// 32F source (matches IPP perf coverage: cornerHarris also runs on CV_32FC1 input) PERF_TEST_P(Img_BlockSize_ApertureSize_k_BorderType, cornerHarris_32f, testing::Combine( testing::Values( "stitching/a1.png", "cv/shared/pic5.png"), @@ -120,7 +119,6 @@ PERF_TEST_P(Img_BlockSize_ApertureSize_BorderType, cornerMinEigenVal, SANITY_CHECK(dst, 2e-5, ERROR_RELATIVE); } -// 32F source (matches IPP perf coverage: cornerMinEigenVal also runs on CV_32FC1 input) PERF_TEST_P(Img_BlockSize_ApertureSize_BorderType, cornerMinEigenVal_32f, testing::Combine( testing::Values( "stitching/a1.png", "cv/shared/pic5.png"), diff --git a/modules/imgproc/perf/perf_filter2d.cpp b/modules/imgproc/perf/perf_filter2d.cpp index 4be107d2a714..0478f80c4155 100644 --- a/modules/imgproc/perf/perf_filter2d.cpp +++ b/modules/imgproc/perf/perf_filter2d.cpp @@ -8,7 +8,7 @@ namespace opencv_test { CV_ENUM(BorderMode, BORDER_CONSTANT, BORDER_REPLICATE, BORDER_REFLECT_101) -// 8U/16U/16S/32F x C1/C3/C4 (matches IPP filter2D/sepFilter2D coverage). +// 8U/16U/16S/32F x C1/C3/C4. #define FILTER2D_TYPES CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, \ CV_16SC1, CV_16SC3, CV_16SC4, CV_32FC1, CV_32FC3, CV_32FC4 // filter2D accepts both integer and float kernels; separable kernels are float only. @@ -49,8 +49,6 @@ PERF_TEST_P( TestFilter2d, Filter2d, SANITY_CHECK(dst, 1); } -// Type/kernel sweep (matches IPP perf coverage: 8U/16U/16S/32F x C1/C3/C4, -// kernels 3/5/7/21, kernel type {16S, 32F}). typedef TestBaseWithParam< tuple > TestFilter2dTypes; PERF_TEST_P( TestFilter2dTypes, Filter2d_types, @@ -85,8 +83,6 @@ PERF_TEST_P( TestFilter2dTypes, Filter2d_types, SANITY_CHECK_NOTHING(); } -// sepFilter2D type/kernel sweep (matches IPP ippSepFilter2D perf coverage: -// 8U/16U/16S/32F x C1/C3/C4, kernels 3/5/7/21, same-depth output). PERF_TEST_P( TestFilter2dTypes, sepFilter2D_types, Combine( Values( sz1080p ), diff --git a/modules/imgproc/perf/perf_getrectsubpix.cpp b/modules/imgproc/perf/perf_getrectsubpix.cpp index de2607cb4e5b..a86d1776e9ad 100644 --- a/modules/imgproc/perf/perf_getrectsubpix.cpp +++ b/modules/imgproc/perf/perf_getrectsubpix.cpp @@ -8,7 +8,6 @@ namespace opencv_test { using namespace perf; -// src/dst depths swept independently (matches IPP getRectSubPix coverage). #define GETRECTSUBPIX_TYPES CV_8UC1, CV_32FC1 typedef tuple Size_SrcType_DstType_t; diff --git a/modules/imgproc/perf/perf_histogram.cpp b/modules/imgproc/perf/perf_histogram.cpp index 9377eaab3388..6653e0d549eb 100644 --- a/modules/imgproc/perf/perf_histogram.cpp +++ b/modules/imgproc/perf/perf_histogram.cpp @@ -42,8 +42,6 @@ PERF_TEST_P(Size_Source, calcHist1d, SANITY_CHECK(hist); } -// Non-uniform ranges + accumulate (matches IPP perf coverage: calcHist sweeps -// uniform ∈ {true,false} × accumulate ∈ {true,false}). typedef tuple Size_Source_Uniform_Accum_t; typedef TestBaseWithParam Size_Source_Uniform_Accum; diff --git a/modules/imgproc/perf/perf_laplacian.cpp b/modules/imgproc/perf/perf_laplacian.cpp index 68de1f45f395..ea6ad75032b1 100644 --- a/modules/imgproc/perf/perf_laplacian.cpp +++ b/modules/imgproc/perf/perf_laplacian.cpp @@ -39,9 +39,6 @@ PERF_TEST_P(Perf_Laplacian, Laplacian, SANITY_CHECK(dst); } -// Float source + scale/delta sweep (matches IPP perf coverage: 32F src -> 32F dst, -// scaled∈{0,1}: scale=1.333, delta=2). cv::Laplacian requires ddepth >= sdepth, -// so a 32F source cannot produce a 16S output. typedef tuple LaplacianParams32f; typedef perf::TestBaseWithParam Perf_Laplacian32f; @@ -75,9 +72,6 @@ PERF_TEST_P(Perf_Laplacian32f, Laplacian, SANITY_CHECK_NOTHING(); } -// 8U source + scale/delta sweep (matches IPP: 8U src -> 8U/16S/32F dst, scaled). -// The base Perf_Laplacian test above keeps its SANITY_CHECK baseline (scale=1); -// this variant adds the scaled path without disturbing that baseline. typedef tuple LaplacianParamsScaled; typedef perf::TestBaseWithParam Perf_Laplacian_scaled; diff --git a/modules/imgproc/perf/perf_matchTemplate.cpp b/modules/imgproc/perf/perf_matchTemplate.cpp index f70081b5bd8a..22735774d47f 100644 --- a/modules/imgproc/perf/perf_matchTemplate.cpp +++ b/modules/imgproc/perf/perf_matchTemplate.cpp @@ -48,7 +48,6 @@ PERF_TEST_P(ImgSize_TmplSize_Method, matchTemplateSmall, SANITY_CHECK(result, eps); } -// 32F source (matches IPP perf coverage: matchTemplate also runs on CV_32FC1 input) PERF_TEST_P(ImgSize_TmplSize_Method, matchTemplateSmall_32f, testing::Combine( testing::Values(cv::Size(320, 240), cv::Size(640, 480), diff --git a/modules/imgproc/perf/perf_morph.cpp b/modules/imgproc/perf/perf_morph.cpp index 30a9060199b8..c2057c95c847 100644 --- a/modules/imgproc/perf/perf_morph.cpp +++ b/modules/imgproc/perf/perf_morph.cpp @@ -44,8 +44,6 @@ PERF_TEST_P(Size_MatType, dilate, TYPICAL_MATS_MORPH) SANITY_CHECK(dst); } -// Parameterized kernel size + iterations (matches IPP perf coverage: -// rect structuring element of size 3/5/7/21, 1 and 3 iterations). typedef tuple Size_MatType_kSize_iter_t; typedef perf::TestBaseWithParam Size_MatType_kSize_iter; @@ -97,8 +95,6 @@ PERF_TEST_P(Size_MatType_kSize_iter, dilate_kernel, SANITY_CHECK_NOTHING(); } -// morphologyEx (matches IPP ippMorphEx: OPEN/CLOSE/GRADIENT/TOPHAT/BLACKHAT, -// rect kernel of size 3/5/7/21, 1 and 3 iterations). No CPU OSS perf test existed. CV_ENUM(MorphExOp, MORPH_OPEN, MORPH_CLOSE, MORPH_GRADIENT, MORPH_TOPHAT, MORPH_BLACKHAT) typedef tuple Size_MatType_MorphExOp_kSize_iter_t; typedef perf::TestBaseWithParam Size_MatType_MorphExOp_kSize_iter; diff --git a/modules/imgproc/perf/perf_resize.cpp b/modules/imgproc/perf/perf_resize.cpp index 907161e6daf5..d38d392a1cdc 100644 --- a/modules/imgproc/perf/perf_resize.cpp +++ b/modules/imgproc/perf/perf_resize.cpp @@ -16,8 +16,6 @@ typedef TestBaseWithParam MatInfo_SizePair; CV_16UC1, CV_16UC2, CV_16UC3, CV_16UC4, \ CV_32FC1, CV_32FC2, CV_32FC3, CV_32FC4 -// 8U/16U/16S/32F x C1/C3/C4 (matches IPP CUBIC/LANCZOS4/affine coverage; -// shared by the resizeCubicLanczos and resizeAffine tests below). #define RESIZE_INTER_TYPES CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16UC3, CV_16UC4, \ CV_16SC1, CV_16SC3, CV_16SC4, CV_32FC1, CV_32FC3, CV_32FC4 @@ -286,9 +284,6 @@ PERF_TEST_P(MatInfo_Size_Scale_NN, ResizeNNExact, SANITY_CHECK_NOTHING(); } -// CUBIC / LANCZOS4 interpolation over the wide type set + scale-factor form -// (matches IPP ippResize_General / ippResize_Affine, which OSS did not cover: -// no CUBIC/LANCZOS4, no 16U/16S/64F, no scale sweep). CV_ENUM(ResizeInterCubicLanczos, INTER_CUBIC, INTER_LANCZOS4) typedef tuple MatInfo_Size_Scale_Inter_t; typedef TestBaseWithParam MatInfo_Size_Scale_Inter; @@ -316,9 +311,6 @@ PERF_TEST_P(MatInfo_Size_Scale_Inter, resizeCubicLanczos, SANITY_CHECK_NOTHING(); } -// Scale-factor (fx/fy) form (matches IPP ippResize_Affine: resize(src,dst,Size(),fx,fy,inter)). -// IPP's Affine test used LINEAR+CUBIC; LINEAR at these types/scales is not otherwise -// covered, so include it here alongside CUBIC. CV_ENUM(ResizeInterAffine, INTER_LINEAR, INTER_CUBIC) typedef tuple MatInfo_Size_Scale_InterAffine_t; typedef TestBaseWithParam MatInfo_Size_Scale_InterAffine; diff --git a/modules/imgproc/perf/perf_sepfilters.cpp b/modules/imgproc/perf/perf_sepfilters.cpp index 00e8986ffe17..5d6f88a45139 100644 --- a/modules/imgproc/perf/perf_sepfilters.cpp +++ b/modules/imgproc/perf/perf_sepfilters.cpp @@ -244,9 +244,6 @@ PERF_TEST_P(Size_MatType_dx_dy_Border3x3ROI, scharrViaSobelFilter, } /**************** Sobel / Scharr with 16S and 32F source ********************/ -// Matches IPP perf coverage: Sobel/Scharr also run on CV_16SC1 and CV_32FC1 -// input (src -> same-depth dst), with a scale/delta sweep (IPP scaled∈{0,1}: -// scale=1.333, delta=2). 8U source is covered by the tests above. // Extra tuple slot for ksize {3,5} (IPP ippSobel swept both). typedef tuple, BorderType3x3, bool, int> Size_MatType_dx_dy_Border3x3_scale_ksize_t; diff --git a/modules/imgproc/perf/perf_threshold.cpp b/modules/imgproc/perf/perf_threshold.cpp index a874f7c4bd04..6491c0c13020 100644 --- a/modules/imgproc/perf/perf_threshold.cpp +++ b/modules/imgproc/perf/perf_threshold.cpp @@ -8,7 +8,6 @@ namespace opencv_test { CV_ENUM(ThreshType, THRESH_BINARY, THRESH_BINARY_INV, THRESH_TRUNC, THRESH_TOZERO, THRESH_TOZERO_INV) -// In-place variant matches IPP ippThreshold_Inplace coverage (no 64F). #define THRESHOLD_INPLACE_TYPES CV_8UC1, CV_16SC1, CV_32FC1 #define THRESHOLD_TYPES THRESHOLD_INPLACE_TYPES, CV_64FC1 @@ -42,7 +41,6 @@ PERF_TEST_P(Size_MatType_ThreshType, threshold, SANITY_CHECK(dst); } -// In-place threshold (matches IPP ippThreshold_Inplace: threshold(dst, dst, ...)) PERF_TEST_P(Size_MatType_ThreshType, threshold_inplace, testing::Combine( testing::Values(TYPICAL_MAT_SIZES), @@ -74,7 +72,6 @@ PERF_TEST_P(Size_MatType_ThreshType, threshold_inplace, SANITY_CHECK_NOTHING(); } -// In-place OTSU threshold (matches IPP ippThreshold_Inplace GT_OTSU case; OTSU is 8U-only). typedef perf::TestBaseWithParam Size_ThreshInplaceOtsu; PERF_TEST_P(Size_ThreshInplaceOtsu, threshold_inplace_otsu, testing::Values(TYPICAL_MAT_SIZES)) { From 4156c04e36cbf2e46be3b207a9e27ad1884bc38e Mon Sep 17 00:00:00 2001 From: Andrei Fedorov Date: Fri, 7 Aug 2026 14:29:37 +0200 Subject: [PATCH 12/12] Update perf_arithm.cpp --- modules/core/perf/perf_arithm.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/core/perf/perf_arithm.cpp b/modules/core/perf/perf_arithm.cpp index bad71d006cff..18ce03858c37 100644 --- a/modules/core/perf/perf_arithm.cpp +++ b/modules/core/perf/perf_arithm.cpp @@ -1,3 +1,6 @@ +// This file is part of OpenCV project. +// It is subject to the license terms in the LICENSE file found in the top-level directory +// of this distribution and at http://opencv.org/license.html. // Copyright (C) 2026, Intel Corporation, all rights reserved. #include "perf_precomp.hpp" #include