perf_bilateral.cpp 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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 {
  6. CV_ENUM(Mat_Type, CV_8UC1, CV_8UC3, CV_32FC1, CV_32FC3)
  7. typedef TestBaseWithParam< tuple<Size, int, Mat_Type, double> > TestBilateralFilter;
  8. PERF_TEST_P( TestBilateralFilter, BilateralFilter,
  9. Combine(
  10. Values( szVGA, sz1080p ), // image size
  11. Values( 3, 5 ), // d
  12. Mat_Type::all(), // image type
  13. Values(1., 5.)
  14. )
  15. )
  16. {
  17. Size sz;
  18. int d, type;
  19. double sigmaColor, sigmaSpace;
  20. sz = get<0>(GetParam());
  21. d = get<1>(GetParam());
  22. type = get<2>(GetParam());
  23. sigmaColor = sigmaSpace = get<3>(GetParam());
  24. Mat src(sz, type);
  25. Mat dst(sz, type);
  26. declare.in(src, WARMUP_RNG).out(dst).time(20);
  27. TEST_CYCLE() bilateralFilter(src, dst, d, sigmaColor, sigmaSpace, BORDER_DEFAULT);
  28. SANITY_CHECK(dst, .01, ERROR_RELATIVE);
  29. }
  30. } // namespace