Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Tetragramm
GitHub Repository: Tetragramm/opencv
Path: blob/master/modules/imgproc/perf/perf_spatialgradient.cpp
16354 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
typedef tuple<Size, int, int> Size_Ksize_BorderType_t;
9
typedef perf::TestBaseWithParam<Size_Ksize_BorderType_t> Size_Ksize_BorderType;
10
11
PERF_TEST_P( Size_Ksize_BorderType, spatialGradient,
12
Combine(
13
SZ_ALL_HD,
14
Values( 3 ),
15
Values( BORDER_DEFAULT, BORDER_REPLICATE )
16
)
17
)
18
{
19
Size size = get<0>(GetParam());
20
int ksize = get<1>(GetParam());
21
int borderType = get<2>(GetParam());
22
23
Mat src(size, CV_8UC1);
24
Mat dx(size, CV_16SC1);
25
Mat dy(size, CV_16SC1);
26
27
declare.in(src, WARMUP_RNG).out(dx, dy);
28
29
TEST_CYCLE() spatialGradient(src, dx, dy, ksize, borderType);
30
31
SANITY_CHECK(dx);
32
SANITY_CHECK(dy);
33
}
34
35
} // namespace
36
37