Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Tetragramm
GitHub Repository: Tetragramm/opencv
Path: blob/master/modules/imgproc/perf/perf_bilateral.cpp
16339 views
1
// This file is part of OpenCV project.
2
// It is subject to the license terms in the LICENSE file found in the top-level directory
3
// of this distribution and at http://opencv.org/license.html.
4
#include "perf_precomp.hpp"
5
6
namespace opencv_test {
7
8
CV_ENUM(Mat_Type, CV_8UC1, CV_8UC3, CV_32FC1, CV_32FC3)
9
10
typedef TestBaseWithParam< tuple<Size, int, Mat_Type> > TestBilateralFilter;
11
12
PERF_TEST_P( TestBilateralFilter, BilateralFilter,
13
Combine(
14
Values( szVGA, sz1080p ), // image size
15
Values( 3, 5 ), // d
16
Mat_Type::all() // image type
17
)
18
)
19
{
20
Size sz;
21
int d, type;
22
const double sigmaColor = 1., sigmaSpace = 1.;
23
24
sz = get<0>(GetParam());
25
d = get<1>(GetParam());
26
type = get<2>(GetParam());
27
28
Mat src(sz, type);
29
Mat dst(sz, type);
30
31
declare.in(src, WARMUP_RNG).out(dst).time(20);
32
33
TEST_CYCLE() bilateralFilter(src, dst, d, sigmaColor, sigmaSpace, BORDER_DEFAULT);
34
35
SANITY_CHECK(dst, .01, ERROR_RELATIVE);
36
}
37
38
} // namespace
39
40