mirror of
https://github.com/opencv/opencv.git
synced 2026-11-21 00:35:35 -06:00
Porting of perf tests extension from 4.x to 5.x - #30663 Following PRs are being ported: * #29908 * #29922 * #29972 No more changes are introduced. PR for opencv-extra: https://github.com/opencv/opencv_extra/pull/1458 ### 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 - [x] There is a reference to the original bug report and related work - [ ] 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
43 lines
1.1 KiB
C++
43 lines
1.1 KiB
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 {
|
|
|
|
#define TYPICAL_MAT_TYPES_MORPH CV_8UC1, CV_8UC3, CV_8UC4, CV_16UC1, CV_16SC1, CV_32FC1, CV_32FC3, CV_32FC4
|
|
#define TYPICAL_MATS_MORPH testing::Combine(SZ_ALL_GA, testing::Values(TYPICAL_MAT_TYPES_MORPH))
|
|
|
|
PERF_TEST_P(Size_MatType, erode, TYPICAL_MATS_MORPH)
|
|
{
|
|
Size sz = get<0>(GetParam());
|
|
int type = get<1>(GetParam());
|
|
|
|
Mat src(sz, type);
|
|
Mat dst(sz, type);
|
|
|
|
declare.in(src, WARMUP_RNG).out(dst);
|
|
|
|
int runs = (sz.width <= 320) ? 15 : 1;
|
|
TEST_CYCLE_MULTIRUN(runs) erode(src, dst, noArray());
|
|
|
|
SANITY_CHECK(dst);
|
|
}
|
|
|
|
PERF_TEST_P(Size_MatType, dilate, TYPICAL_MATS_MORPH)
|
|
{
|
|
Size sz = get<0>(GetParam());
|
|
int type = get<1>(GetParam());
|
|
|
|
Mat src(sz, type);
|
|
Mat dst(sz, type);
|
|
|
|
declare.in(src, WARMUP_RNG).out(dst);
|
|
|
|
TEST_CYCLE() dilate(src, dst, noArray());
|
|
|
|
SANITY_CHECK(dst);
|
|
}
|
|
|
|
} // namespace
|