Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Tetragramm
GitHub Repository: Tetragramm/opencv
Path: blob/master/modules/imgproc/perf/perf_morph.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
#define TYPICAL_MAT_TYPES_MORPH CV_8UC1, CV_8UC4
9
#define TYPICAL_MATS_MORPH testing::Combine(SZ_ALL_GA, testing::Values(TYPICAL_MAT_TYPES_MORPH))
10
11
PERF_TEST_P(Size_MatType, erode, TYPICAL_MATS_MORPH)
12
{
13
Size sz = get<0>(GetParam());
14
int type = get<1>(GetParam());
15
16
Mat src(sz, type);
17
Mat dst(sz, type);
18
19
declare.in(src, WARMUP_RNG).out(dst);
20
21
int runs = (sz.width <= 320) ? 15 : 1;
22
TEST_CYCLE_MULTIRUN(runs) erode(src, dst, noArray());
23
24
SANITY_CHECK(dst);
25
}
26
27
PERF_TEST_P(Size_MatType, dilate, TYPICAL_MATS_MORPH)
28
{
29
Size sz = get<0>(GetParam());
30
int type = get<1>(GetParam());
31
32
Mat src(sz, type);
33
Mat dst(sz, type);
34
35
declare.in(src, WARMUP_RNG).out(dst);
36
37
TEST_CYCLE() dilate(src, dst, noArray());
38
39
SANITY_CHECK(dst);
40
}
41
42
} // namespace
43
44