Path: blob/master/modules/photo/perf/perf_inpaint.cpp
16337 views
#include "perf_precomp.hpp"12namespace opencv_test3{45CV_ENUM(InpaintingMethod, INPAINT_NS, INPAINT_TELEA)6typedef tuple<Size, InpaintingMethod> InpaintArea_InpaintingMethod_t;7typedef perf::TestBaseWithParam<InpaintArea_InpaintingMethod_t> InpaintArea_InpaintingMethod;8910PERF_TEST_P(InpaintArea_InpaintingMethod, inpaint,11testing::Combine(12testing::Values(::perf::szSmall24, ::perf::szSmall32, ::perf::szSmall64),13InpaintingMethod::all()14)15)16{17Mat src = imread(getDataPath("gpu/hog/road.png"));1819Size sz = get<0>(GetParam());20int inpaintingMethod = get<1>(GetParam());2122Mat mask(src.size(), CV_8UC1, Scalar(0));23Mat result(src.size(), src.type());2425Rect inpaintArea(src.cols/3, src.rows/3, sz.width, sz.height);26mask(inpaintArea).setTo(255);2728declare.in(src, mask).out(result).time(120);2930TEST_CYCLE() inpaint(src, mask, result, 10.0, inpaintingMethod);3132Mat inpaintedArea = result(inpaintArea);33SANITY_CHECK(inpaintedArea);34}3536} // namespace373839