perf_abs.cpp 622 B

1234567891011121314151617181920212223242526
  1. #include "perf_precomp.hpp"
  2. namespace opencv_test
  3. {
  4. using namespace perf;
  5. #define TYPICAL_MAT_SIZES_ABS TYPICAL_MAT_SIZES
  6. #define TYPICAL_MAT_TYPES_ABS CV_8SC1, CV_8SC4, CV_32SC1, CV_32FC1
  7. #define TYPICAL_MATS_ABS testing::Combine( testing::Values( TYPICAL_MAT_SIZES_ABS), testing::Values( TYPICAL_MAT_TYPES_ABS) )
  8. PERF_TEST_P(Size_MatType, abs, TYPICAL_MATS_ABS)
  9. {
  10. Size sz = get<0>(GetParam());
  11. int type = get<1>(GetParam());
  12. cv::Mat a = Mat(sz, type);
  13. cv::Mat c = Mat(sz, type);
  14. declare.in(a, WARMUP_RNG).out(c);
  15. TEST_CYCLE() c = cv::abs(a);
  16. SANITY_CHECK(c);
  17. }
  18. } // namespace