Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Faster thinning implementation #3689

Merged
merged 2 commits into from
Mar 27, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Added performance test for cv::thining.
asmorkalov committed Mar 27, 2024
commit 85589dd12e95d9a3ce9222d4bafb574857de9ede
36 changes: 36 additions & 0 deletions modules/ximgproc/perf/perf_thining.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html.

#include "perf_precomp.hpp"

namespace opencv_test { namespace {

typedef tuple<Size, int> ThinningPerfParam;
typedef TestBaseWithParam<ThinningPerfParam> ThinningPerfTest;

PERF_TEST_P(ThinningPerfTest, perf,
Combine(
Values(sz1080p, sz720p, szVGA),
Values(THINNING_ZHANGSUEN, THINNING_GUOHALL)
)
)
{
ThinningPerfParam params = GetParam();
Size size = get<0>(params);
int type = get<1>(params);

Mat src = Mat::zeros(size, CV_8UC1);
for (int x = 50; x < src.cols - 50; x += 50)
cv::circle(src, Point(x, x/2), 30 + x/2, Scalar(255), 5);

Mat dst;
TEST_CYCLE()
{
thinning(src, dst, type);
}

SANITY_CHECK_NOTHING();
}

}} // namespace