perf_grayworld.cpp 880 B

12345678910111213141516171819202122232425262728293031323334
  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 { namespace {
  6. typedef tuple<Size, float> Size_WBThresh_t;
  7. typedef perf::TestBaseWithParam<Size_WBThresh_t> Size_WBThresh;
  8. PERF_TEST_P( Size_WBThresh, autowbGrayworld,
  9. testing::Combine(
  10. SZ_ALL_HD,
  11. testing::Values( 0.1, 0.5, 1.0 )
  12. )
  13. )
  14. {
  15. Size size = get<0>(GetParam());
  16. float wb_thresh = get<1>(GetParam());
  17. Mat src(size, CV_8UC3);
  18. Mat dst(size, CV_8UC3);
  19. declare.in(src, WARMUP_RNG).out(dst);
  20. Ptr<xphoto::GrayworldWB> wb = xphoto::createGrayworldWB();
  21. wb->setSaturationThreshold(wb_thresh);
  22. TEST_CYCLE() wb->balanceWhite(src, dst);
  23. SANITY_CHECK(dst);
  24. }
  25. }} // namespace