perf_spatialgradient.cpp 925 B

1234567891011121314151617181920212223242526272829303132333435
  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. typedef tuple<Size, int, int> Size_Ksize_BorderType_t;
  7. typedef perf::TestBaseWithParam<Size_Ksize_BorderType_t> Size_Ksize_BorderType;
  8. PERF_TEST_P( Size_Ksize_BorderType, spatialGradient,
  9. Combine(
  10. SZ_ALL_HD,
  11. Values( 3 ),
  12. Values( BORDER_DEFAULT, BORDER_REPLICATE )
  13. )
  14. )
  15. {
  16. Size size = get<0>(GetParam());
  17. int ksize = get<1>(GetParam());
  18. int borderType = get<2>(GetParam());
  19. Mat src(size, CV_8UC1);
  20. Mat dx(size, CV_16SC1);
  21. Mat dy(size, CV_16SC1);
  22. declare.in(src, WARMUP_RNG).out(dx, dy);
  23. TEST_CYCLE() spatialGradient(src, dx, dy, ksize, borderType);
  24. SANITY_CHECK(dx);
  25. SANITY_CHECK(dy);
  26. }
  27. } // namespace