perf_bilateral.cpp 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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> > 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. )
  14. )
  15. {
  16. Size sz;
  17. int d, type;
  18. const double sigmaColor = 1., sigmaSpace = 1.;
  19. sz = get<0>(GetParam());
  20. d = get<1>(GetParam());
  21. type = get<2>(GetParam());
  22. Mat src(sz, type);
  23. Mat dst(sz, type);
  24. declare.in(src, WARMUP_RNG).out(dst).time(20);
  25. TEST_CYCLE() bilateralFilter(src, dst, d, sigmaColor, sigmaSpace, BORDER_DEFAULT);
  26. SANITY_CHECK(dst, .01, ERROR_RELATIVE);
  27. }
  28. } // namespace