perf_l0_smooth.cpp 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. #include "perf_precomp.hpp"
  5. namespace opencv_test { namespace {
  6. typedef tuple<Size, MatType, int> L0SmoothTestParam;
  7. typedef TestBaseWithParam<L0SmoothTestParam> L0SmoothTest;
  8. PERF_TEST_P(L0SmoothTest, perf,
  9. Combine(
  10. SZ_TYPICAL,
  11. Values(CV_8U, CV_16U, CV_32F, CV_64F),
  12. Values(1, 3))
  13. )
  14. {
  15. L0SmoothTestParam params = GetParam();
  16. Size sz = get<0>(params);
  17. int depth = get<1>(params);
  18. int srcCn = get<2>(params);
  19. Mat src(sz, CV_MAKE_TYPE(depth, srcCn));
  20. Mat dst(sz, src.type());
  21. declare.in(src, WARMUP_RNG).out(dst);
  22. RNG rnd(sz.height + depth + srcCn);
  23. double lambda = rnd.uniform(0.01, 0.05);
  24. double kappa = rnd.uniform(1.0, 3.0);
  25. TEST_CYCLE_N(1)
  26. {
  27. l0Smooth(src, dst, lambda, kappa);
  28. }
  29. SANITY_CHECK_NOTHING();
  30. }
  31. }} // namespace