perf_domain_transform.cpp 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. CV_ENUM(GuideMatType, CV_8UC1, CV_8UC3, CV_32FC1, CV_32FC3) //reduced set
  7. CV_ENUM(SourceMatType, CV_8UC1, CV_8UC3, CV_8UC4, CV_32FC1, CV_32FC3) //reduced set
  8. CV_ENUM(DTFMode, DTF_NC, DTF_IC, DTF_RF)
  9. typedef tuple<GuideMatType, SourceMatType, Size, double, double, DTFMode> DTTestParams;
  10. typedef TestBaseWithParam<DTTestParams> DomainTransformTest;
  11. PERF_TEST_P( DomainTransformTest, perf,
  12. Combine(
  13. GuideMatType::all(),
  14. SourceMatType::all(),
  15. Values(szVGA, sz720p),
  16. Values(10.0, 80.0),
  17. Values(30.0, 50.0),
  18. DTFMode::all()
  19. )
  20. )
  21. {
  22. int guideType = get<0>(GetParam());
  23. int srcType = get<1>(GetParam());
  24. Size size = get<2>(GetParam());
  25. double sigmaSpatial = get<3>(GetParam());
  26. double sigmaColor = get<4>(GetParam());
  27. int dtfType = get<5>(GetParam());
  28. Mat guide(size, guideType);
  29. Mat src(size, srcType);
  30. Mat dst(size, srcType);
  31. declare.in(guide, src, WARMUP_RNG).out(dst);
  32. TEST_CYCLE_N(5)
  33. {
  34. dtFilter(guide, src, dst, sigmaSpatial, sigmaColor, dtfType);
  35. }
  36. SANITY_CHECK_NOTHING();
  37. }
  38. }} // namespace