From cc49aee04e36b01f3b775863b7b5c633f06b41b9 Mon Sep 17 00:00:00 2001 From: Rostislav Vasilikhin Date: Sat, 25 May 2024 10:25:50 +0200 Subject: [PATCH] Merge pull request #25634 from savuor:rv/boxfilter_tests Tests for cvSmooth -> tests for boxFilter #25634 fixes #25448 ### Motivation The obsolete function `cvSmooth` has two modes in which it calls `cv::boxFilter()` inside with and without normalization. This function is covered by tests exactly for that modes. This means that by replacing `cvSmooth` call by `cv::boxFilter()` we will leave the coverage untouched (but more obvious) and remove that obsolete function from tests. ### Pull Request Readiness Checklist See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [x] The PR is proposed to the proper branch - [x] There is a reference to the original bug report and related work - [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [x] The feature is well documented and sample code can be built with the project CMake --- modules/imgproc/test/test_filter.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/imgproc/test/test_filter.cpp b/modules/imgproc/test/test_filter.cpp index a0ccf4372f..a6e45709f3 100644 --- a/modules/imgproc/test/test_filter.cpp +++ b/modules/imgproc/test/test_filter.cpp @@ -772,9 +772,8 @@ void CV_BlurTest::get_test_array_types_and_sizes( int test_case_idx, void CV_BlurTest::run_func() { - cvSmooth( inplace ? test_array[OUTPUT][0] : test_array[INPUT][0], - test_array[OUTPUT][0], normalize ? CV_BLUR : CV_BLUR_NO_SCALE, - aperture_size.width, aperture_size.height ); + cv::boxFilter(inplace ? test_mat[OUTPUT][0] : test_mat[INPUT][0], test_mat[OUTPUT][0], + test_mat[OUTPUT][0].type(), aperture_size, cv::Point(-1, -1), normalize, cv::BORDER_REPLICATE); }