perf_split.cpp 831 B

123456789101112131415161718192021222324252627282930313233
  1. #include "perf_precomp.hpp"
  2. namespace opencv_test
  3. {
  4. using namespace perf;
  5. typedef tuple<Size, MatType, int> Size_Depth_Channels_t;
  6. typedef perf::TestBaseWithParam<Size_Depth_Channels_t> Size_Depth_Channels;
  7. PERF_TEST_P( Size_Depth_Channels, split,
  8. testing::Combine
  9. (
  10. testing::Values(TYPICAL_MAT_SIZES),
  11. testing::Values(CV_8U, CV_16S, CV_32F, CV_64F),
  12. testing::Values(2, 3, 4)
  13. )
  14. )
  15. {
  16. Size sz = get<0>(GetParam());
  17. int depth = get<1>(GetParam());
  18. int channels = get<2>(GetParam());
  19. Mat m(sz, CV_MAKETYPE(depth, channels));
  20. randu(m, 0, 255);
  21. vector<Mat> mv;
  22. int runs = (sz.width <= 640) ? 8 : 1;
  23. TEST_CYCLE_MULTIRUN(runs) split(m, (vector<Mat>&)mv);
  24. SANITY_CHECK(mv, 2e-5);
  25. }
  26. } // namespace