OpenCV_4.2.0/opencv_contrib-4.2.0/modules/ximgproc/perf/perf_l0_smooth.cpp

42 lines
1.0 KiB
C++
Raw Normal View History

2024-07-25 16:47:56 +08:00
// 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, MatType, int> L0SmoothTestParam;
typedef TestBaseWithParam<L0SmoothTestParam> L0SmoothTest;
PERF_TEST_P(L0SmoothTest, perf,
Combine(
SZ_TYPICAL,
Values(CV_8U, CV_16U, CV_32F, CV_64F),
Values(1, 3))
)
{
L0SmoothTestParam params = GetParam();
Size sz = get<0>(params);
int depth = get<1>(params);
int srcCn = get<2>(params);
Mat src(sz, CV_MAKE_TYPE(depth, srcCn));
Mat dst(sz, src.type());
declare.in(src, WARMUP_RNG).out(dst);
RNG rnd(sz.height + depth + srcCn);
double lambda = rnd.uniform(0.01, 0.05);
double kappa = rnd.uniform(1.0, 3.0);
TEST_CYCLE_N(1)
{
l0Smooth(src, dst, lambda, kappa);
}
SANITY_CHECK_NOTHING();
}
}} // namespace