perf_inpaint.cpp 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #include "perf_precomp.hpp"
  2. namespace opencv_test
  3. {
  4. CV_ENUM(InpaintingMethod, INPAINT_NS, INPAINT_TELEA)
  5. typedef tuple<Size, InpaintingMethod> InpaintArea_InpaintingMethod_t;
  6. typedef perf::TestBaseWithParam<InpaintArea_InpaintingMethod_t> InpaintArea_InpaintingMethod;
  7. PERF_TEST_P(InpaintArea_InpaintingMethod, inpaint,
  8. testing::Combine(
  9. testing::Values(::perf::szSmall24, ::perf::szSmall32, ::perf::szSmall64),
  10. InpaintingMethod::all()
  11. )
  12. )
  13. {
  14. Mat src = imread(getDataPath("gpu/hog/road.png"));
  15. Size sz = get<0>(GetParam());
  16. int inpaintingMethod = get<1>(GetParam());
  17. Mat mask(src.size(), CV_8UC1, Scalar(0));
  18. Mat result(src.size(), src.type());
  19. Rect inpaintArea(src.cols/3, src.rows/3, sz.width, sz.height);
  20. mask(inpaintArea).setTo(255);
  21. declare.in(src, mask).out(result).time(120);
  22. TEST_CYCLE() inpaint(src, mask, result, 10.0, inpaintingMethod);
  23. Mat inpaintedArea = result(inpaintArea);
  24. SANITY_CHECK(inpaintedArea);
  25. }
  26. } // namespace