perf_morph.cpp 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. #define TYPICAL_MAT_TYPES_MORPH CV_8UC1, CV_8UC4
  7. #define TYPICAL_MATS_MORPH testing::Combine(SZ_ALL_GA, testing::Values(TYPICAL_MAT_TYPES_MORPH))
  8. PERF_TEST_P(Size_MatType, erode, TYPICAL_MATS_MORPH)
  9. {
  10. Size sz = get<0>(GetParam());
  11. int type = get<1>(GetParam());
  12. Mat src(sz, type);
  13. Mat dst(sz, type);
  14. declare.in(src, WARMUP_RNG).out(dst);
  15. int runs = (sz.width <= 320) ? 15 : 1;
  16. TEST_CYCLE_MULTIRUN(runs) erode(src, dst, noArray());
  17. SANITY_CHECK(dst);
  18. }
  19. PERF_TEST_P(Size_MatType, dilate, TYPICAL_MATS_MORPH)
  20. {
  21. Size sz = get<0>(GetParam());
  22. int type = get<1>(GetParam());
  23. Mat src(sz, type);
  24. Mat dst(sz, type);
  25. declare.in(src, WARMUP_RNG).out(dst);
  26. TEST_CYCLE() dilate(src, dst, noArray());
  27. SANITY_CHECK(dst);
  28. }
  29. } // namespace