perf_adaptive_manifold.cpp 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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<bool, Size, int, int, MatType> AMPerfTestParam;
  7. typedef TestBaseWithParam<AMPerfTestParam> AdaptiveManifoldPerfTest;
  8. PERF_TEST_P( AdaptiveManifoldPerfTest, perf,
  9. Combine(
  10. Values(true, false), //adjust_outliers flag
  11. Values(sz1080p, sz720p), //size
  12. Values(1, 3, 8), //joint channels num
  13. Values(1, 3), //source channels num
  14. Values(CV_8U, CV_32F) //source and joint depth
  15. )
  16. )
  17. {
  18. AMPerfTestParam params = GetParam();
  19. bool adjustOutliers = get<0>(params);
  20. Size sz = get<1>(params);
  21. int jointCnNum = get<2>(params);
  22. int srcCnNum = get<3>(params);
  23. int depth = get<4>(params);
  24. Mat joint(sz, CV_MAKE_TYPE(depth, jointCnNum));
  25. Mat src(sz, CV_MAKE_TYPE(depth, srcCnNum));
  26. Mat dst(sz, CV_MAKE_TYPE(depth, srcCnNum));
  27. declare.in(joint, src, WARMUP_RNG).out(dst);
  28. double sigma_s = 16;
  29. double sigma_r = 0.5;
  30. TEST_CYCLE_N(3)
  31. {
  32. Mat res;
  33. amFilter(joint, src, res, sigma_s, sigma_r, adjustOutliers);
  34. //at 5th cycle sigma_s will be five times more and tree depth will be 5
  35. sigma_s *= 1.38;
  36. sigma_r /= 1.38;
  37. }
  38. SANITY_CHECK_NOTHING();
  39. }
  40. }} // namespace