Skip to content

Commit 31d04f8

Browse files
author
Rostislav Vasilikhin
committed
5x5 added for boxfilter perf tests
1 parent 89c19f1 commit 31d04f8

File tree

1 file changed

+22
-12
lines changed

1 file changed

+22
-12
lines changed

modules/imgproc/perf/perf_blur.cpp

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ typedef perf::TestBaseWithParam<Size_MatType_BorderType_t> Size_MatType_BorderTy
4545
typedef tuple<Size, int, BorderType3x3> Size_ksize_BorderType_t;
4646
typedef perf::TestBaseWithParam<Size_ksize_BorderType_t> Size_ksize_BorderType;
4747

48+
typedef tuple<Size, MatType, BorderType, int> Size_MatType_BorderType_ksize_t;
49+
typedef perf::TestBaseWithParam<Size_MatType_BorderType_ksize_t> Size_MatType_BorderType_ksize;
50+
51+
4852
PERF_TEST_P(Size_MatType_BorderType3x3, gaussianBlur3x3,
4953
testing::Combine(
5054
testing::Values(szODD, szQVGA, szVGA, sz720p),
@@ -114,24 +118,27 @@ PERF_TEST_P(Size_MatType_BorderType, blur16x16,
114118
SANITY_CHECK(dst, eps);
115119
}
116120

117-
PERF_TEST_P(Size_MatType_BorderType3x3, box3x3,
121+
PERF_TEST_P(Size_MatType_BorderType_ksize, box,
118122
testing::Combine(
119123
testing::Values(szODD, szQVGA, szVGA, sz720p),
120124
testing::Values(CV_8UC1, CV_16SC1, CV_32SC1, CV_32FC1, CV_32FC3),
121-
BorderType3x3::all()
125+
BorderType::all(),
126+
testing::Values(3, 5)
122127
)
123128
)
124129
{
125-
Size size = get<0>(GetParam());
126-
int type = get<1>(GetParam());
127-
BorderType3x3 btype = get<2>(GetParam());
130+
auto p = GetParam();
131+
Size size = get<0>(p);
132+
int type = get<1>(p);
133+
BorderType btype = get<2>(p);
134+
int ksize = get<3>(p);
128135

129136
Mat src(size, type);
130137
Mat dst(size, type);
131138

132139
declare.in(src, WARMUP_RNG).out(dst);
133140

134-
TEST_CYCLE() boxFilter(src, dst, -1, Size(3,3), Point(-1,-1), false, btype);
141+
TEST_CYCLE() boxFilter(src, dst, -1, Size(ksize, ksize), Point(-1,-1), false, btype);
135142

136143
SANITY_CHECK(dst, 1e-6, ERROR_RELATIVE);
137144
}
@@ -158,17 +165,20 @@ PERF_TEST_P(Size_ksize_BorderType, box_CV8U_CV16U,
158165
SANITY_CHECK(dst, 1e-6, ERROR_RELATIVE);
159166
}
160167

161-
PERF_TEST_P(Size_MatType_BorderType3x3, box3x3_inplace,
168+
PERF_TEST_P(Size_MatType_BorderType_ksize, box_inplace,
162169
testing::Combine(
163170
testing::Values(szODD, szQVGA, szVGA, sz720p),
164171
testing::Values(CV_8UC1, CV_16SC1, CV_32SC1, CV_32FC1, CV_32FC3),
165-
BorderType3x3::all()
172+
BorderType::all(),
173+
testing::Values(3, 5)
166174
)
167175
)
168176
{
169-
Size size = get<0>(GetParam());
170-
int type = get<1>(GetParam());
171-
BorderType3x3 btype = get<2>(GetParam());
177+
auto p = GetParam();
178+
Size size = get<0>(p);
179+
int type = get<1>(p);
180+
BorderType btype = get<2>(p);
181+
int ksize = get<3>(p);
172182

173183
Mat src(size, type);
174184
Mat dst(size, type);
@@ -179,7 +189,7 @@ PERF_TEST_P(Size_MatType_BorderType3x3, box3x3_inplace,
179189
{
180190
src.copyTo(dst);
181191
startTimer();
182-
boxFilter(dst, dst, -1, Size(3,3), Point(-1,-1), false, btype);
192+
boxFilter(dst, dst, -1, Size(ksize, ksize), Point(-1,-1), false, btype);
183193
stopTimer();
184194
}
185195

0 commit comments

Comments
 (0)