mirror of
https://github.com/opencv/opencv.git
synced 2026-11-21 00:35:35 -06:00
Porting of perf tests extension from 4.x to 5.x - #30663 Following PRs are being ported: * #29908 * #29922 * #29972 No more changes are introduced. PR for opencv-extra: https://github.com/opencv/opencv_extra/pull/1458 ### 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 - [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [ ] The feature is well documented and sample code can be built with the project CMake
41 lines
1.1 KiB
C++
41 lines
1.1 KiB
C++
// 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 {
|
|
|
|
CV_ENUM(Mat_Type, CV_8UC1, CV_8UC3, CV_32FC1, CV_32FC3)
|
|
|
|
typedef TestBaseWithParam< tuple<Size, int, Mat_Type, double> > TestBilateralFilter;
|
|
|
|
PERF_TEST_P( TestBilateralFilter, BilateralFilter,
|
|
Combine(
|
|
Values( szVGA, sz1080p ), // image size
|
|
Values( 3, 5, 7, 21 ), // d
|
|
Mat_Type::all(), // image type
|
|
Values(1., 5.)
|
|
)
|
|
)
|
|
{
|
|
Size sz;
|
|
int d, type;
|
|
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);
|
|
|
|
declare.in(src, WARMUP_RNG).out(dst).time(20);
|
|
|
|
TEST_CYCLE() bilateralFilter(src, dst, d, sigmaColor, sigmaSpace, BORDER_DEFAULT);
|
|
|
|
SANITY_CHECK(dst, .01, ERROR_RELATIVE);
|
|
}
|
|
|
|
} // namespace
|