From e7108f48ab4c10f215006e57f2b101459da11bac Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Wed, 19 Jun 2024 15:29:07 +0300 Subject: [PATCH] Extended bilateralFilter test to cover more branches. --- modules/imgproc/perf/perf_bilateral.cpp | 8 +++++--- modules/imgproc/test/test_bilateral_filter.cpp | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/imgproc/perf/perf_bilateral.cpp b/modules/imgproc/perf/perf_bilateral.cpp index ed6a741e08..38f2a503d3 100644 --- a/modules/imgproc/perf/perf_bilateral.cpp +++ b/modules/imgproc/perf/perf_bilateral.cpp @@ -7,23 +7,25 @@ namespace opencv_test { CV_ENUM(Mat_Type, CV_8UC1, CV_8UC3, CV_32FC1, CV_32FC3) -typedef TestBaseWithParam< tuple > TestBilateralFilter; +typedef TestBaseWithParam< tuple > TestBilateralFilter; PERF_TEST_P( TestBilateralFilter, BilateralFilter, Combine( Values( szVGA, sz1080p ), // image size Values( 3, 5 ), // d - Mat_Type::all() // image type + Mat_Type::all(), // image type + Values(1., 5.) ) ) { Size sz; int d, type; - const double sigmaColor = 1., sigmaSpace = 1.; + double sigmaColor, sigmaSpace; sz = get<0>(GetParam()); d = get<1>(GetParam()); type = get<2>(GetParam()); + sigmaColor = sigmaSpace = get<3>(GetParam()); Mat src(sz, type); Mat dst(sz, type); diff --git a/modules/imgproc/test/test_bilateral_filter.cpp b/modules/imgproc/test/test_bilateral_filter.cpp index badd879a8a..0f92836808 100644 --- a/modules/imgproc/test/test_bilateral_filter.cpp +++ b/modules/imgproc/test/test_bilateral_filter.cpp @@ -243,7 +243,7 @@ namespace opencv_test { namespace { rng.fill(_src, RNG::UNIFORM, 0, 256); - _sigma_color = _sigma_space = 1.; + _sigma_color = _sigma_space = rng.uniform(0., 10.); return 1; }