mirror of
https://github.com/opencv/opencv.git
synced 2024-12-13 16:09:23 +08:00
b5e9eb742c
imgproc: add basic IntelligentScissorsMB performance test #23698 Adding basic performance test that can be used before and after the #21959 changes etc. as per @asmorkalov's https://github.com/opencv/opencv/pull/21959#issuecomment-1565240926 comment. ### Pull Request Readiness Checklist See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [X] I agree to contribute to the project under Apache 2 License. - [X] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [X] The PR is proposed to the proper branch - [ ] There is a reference to the original bug report and related work - [X] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [ ] The feature is well documented and sample code can be built with the project CMake
35 lines
873 B
C++
35 lines
873 B
C++
// 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 perf::TestBaseWithParam<int> TestIntelligentScissorsMB;
|
|
|
|
PERF_TEST_P(TestIntelligentScissorsMB, buildMap, testing::Values( IMREAD_GRAYSCALE, IMREAD_COLOR ))
|
|
{
|
|
const int flags = GetParam();
|
|
|
|
const Mat image = imread(findDataFile("cv/shared/lena.png"), flags);
|
|
ASSERT_TRUE(!image.empty());
|
|
|
|
const Point source_point(275, 63);
|
|
|
|
segmentation::IntelligentScissorsMB tool;
|
|
tool.applyImage(image);
|
|
|
|
PERF_SAMPLE_BEGIN()
|
|
for (size_t idx = 1; idx <= 100; ++idx)
|
|
{
|
|
tool.buildMap(source_point);
|
|
}
|
|
PERF_SAMPLE_END()
|
|
|
|
SANITY_CHECK_NOTHING();
|
|
}
|
|
|
|
|
|
}} // namespace
|