1 #include "perf_precomp.hpp"
2 
3 using namespace std;
4 using namespace cv;
5 using namespace perf;
6 using std::tr1::make_tuple;
7 using std::tr1::get;
8 
9 #define TYPICAL_MAT_TYPES_MORPH  CV_8UC1, CV_8UC4
10 #define TYPICAL_MATS_MORPH       testing::Combine(SZ_ALL_GA, testing::Values(TYPICAL_MAT_TYPES_MORPH))
11 
PERF_TEST_P(Size_MatType,erode,TYPICAL_MATS_MORPH)12 PERF_TEST_P(Size_MatType, erode, TYPICAL_MATS_MORPH)
13 {
14     Size sz = get<0>(GetParam());
15     int type = get<1>(GetParam());
16 
17     Mat src(sz, type);
18     Mat dst(sz, type);
19 
20     declare.in(src, WARMUP_RNG).out(dst);
21 
22     int runs = (sz.width <= 320) ? 15 : 1;
23     TEST_CYCLE_MULTIRUN(runs) erode(src, dst, noArray());
24 
25     SANITY_CHECK(dst);
26 }
27 
PERF_TEST_P(Size_MatType,dilate,TYPICAL_MATS_MORPH)28 PERF_TEST_P(Size_MatType, dilate, TYPICAL_MATS_MORPH)
29 {
30     Size sz = get<0>(GetParam());
31     int type = get<1>(GetParam());
32 
33     Mat src(sz, type);
34     Mat dst(sz, type);
35 
36     declare.in(src, WARMUP_RNG).out(dst);
37 
38     TEST_CYCLE() dilate(src, dst, noArray());
39 
40     SANITY_CHECK(dst);
41 }
42