Skip to content

Commit 85589dd

Browse files
committed
Added performance test for cv::thining.
1 parent ca90d3e commit 85589dd

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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+
5+
#include "perf_precomp.hpp"
6+
7+
namespace opencv_test { namespace {
8+
9+
typedef tuple<Size, int> ThinningPerfParam;
10+
typedef TestBaseWithParam<ThinningPerfParam> ThinningPerfTest;
11+
12+
PERF_TEST_P(ThinningPerfTest, perf,
13+
Combine(
14+
Values(sz1080p, sz720p, szVGA),
15+
Values(THINNING_ZHANGSUEN, THINNING_GUOHALL)
16+
)
17+
)
18+
{
19+
ThinningPerfParam params = GetParam();
20+
Size size = get<0>(params);
21+
int type = get<1>(params);
22+
23+
Mat src = Mat::zeros(size, CV_8UC1);
24+
for (int x = 50; x < src.cols - 50; x += 50)
25+
cv::circle(src, Point(x, x/2), 30 + x/2, Scalar(255), 5);
26+
27+
Mat dst;
28+
TEST_CYCLE()
29+
{
30+
thinning(src, dst, type);
31+
}
32+
33+
SANITY_CHECK_NOTHING();
34+
}
35+
36+
}} // namespace

0 commit comments

Comments
 (0)