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