@@ -6,8 +6,10 @@ using namespace perf;
6
6
using std::tr1::make_tuple;
7
7
using std::tr1::get;
8
8
9
+ #define HAMMING_NORM_SIZES cv::Size (640 , 480 ), cv::Size(1920 , 1080 )
10
+ #define HAMMING_NORM_TYPES CV_8UC1
9
11
10
- CV_FLAGS (NormType, NORM_INF, NORM_L1, NORM_L2, NORM_TYPE_MASK, NORM_RELATIVE, NORM_MINMAX)
12
+ CV_FLAGS (NormType, NORM_HAMMING2, NORM_HAMMING, NORM_INF, NORM_L1, NORM_L2, NORM_TYPE_MASK, NORM_RELATIVE, NORM_MINMAX)
11
13
typedef std::tr1::tuple<Size, MatType, NormType> Size_MatType_NormType_t;
12
14
typedef perf::TestBaseWithParam<Size_MatType_NormType_t> Size_MatType_NormType;
13
15
@@ -103,6 +105,60 @@ PERF_TEST_P(Size_MatType_NormType, norm2_mask,
103
105
SANITY_CHECK (n, 1e-5 , ERROR_RELATIVE);
104
106
}
105
107
108
+ namespace {
109
+ typedef std::tr1::tuple<NormType, MatType, Size> PerfHamming_t;
110
+ typedef perf::TestBaseWithParam<PerfHamming_t> PerfHamming;
111
+
112
+ PERF_TEST_P (PerfHamming, norm,
113
+ testing::Combine (
114
+ testing::Values (NORM_HAMMING, NORM_HAMMING2),
115
+ testing::Values(HAMMING_NORM_TYPES),
116
+ testing::Values(HAMMING_NORM_SIZES)
117
+ )
118
+ )
119
+ {
120
+ Size sz = get<2 >(GetParam ());
121
+ int matType = get<1 >(GetParam ());
122
+ int normType = get<0 >(GetParam ());
123
+
124
+ Mat src (sz, matType);
125
+ double n;
126
+
127
+ declare.in (src, WARMUP_RNG);
128
+
129
+ TEST_CYCLE () n = norm (src, normType);
130
+
131
+ (void )n;
132
+ SANITY_CHECK_NOTHING ();
133
+ }
134
+
135
+ PERF_TEST_P (PerfHamming, norm2,
136
+ testing::Combine (
137
+ testing::Values (NORM_HAMMING, NORM_HAMMING2),
138
+ testing::Values(HAMMING_NORM_TYPES),
139
+ testing::Values(HAMMING_NORM_SIZES)
140
+ )
141
+ )
142
+ {
143
+ Size sz = get<2 >(GetParam ());
144
+ int matType = get<1 >(GetParam ());
145
+ int normType = get<0 >(GetParam ());
146
+
147
+ Mat src1 (sz, matType);
148
+ Mat src2 (sz, matType);
149
+ double n;
150
+
151
+ declare.in (src1, src2, WARMUP_RNG);
152
+
153
+ TEST_CYCLE () n = norm (src1, src2, normType);
154
+
155
+ (void )n;
156
+ SANITY_CHECK_NOTHING ();
157
+ }
158
+
159
+ }
160
+
161
+
106
162
PERF_TEST_P (Size_MatType_NormType, normalize,
107
163
testing::Combine (
108
164
testing::Values (TYPICAL_MAT_SIZES),
0 commit comments