Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Tetragramm
GitHub Repository: Tetragramm/opencv
Path: blob/master/modules/photo/perf/perf_inpaint.cpp
16337 views
1
#include "perf_precomp.hpp"
2
3
namespace opencv_test
4
{
5
6
CV_ENUM(InpaintingMethod, INPAINT_NS, INPAINT_TELEA)
7
typedef tuple<Size, InpaintingMethod> InpaintArea_InpaintingMethod_t;
8
typedef perf::TestBaseWithParam<InpaintArea_InpaintingMethod_t> InpaintArea_InpaintingMethod;
9
10
11
PERF_TEST_P(InpaintArea_InpaintingMethod, inpaint,
12
testing::Combine(
13
testing::Values(::perf::szSmall24, ::perf::szSmall32, ::perf::szSmall64),
14
InpaintingMethod::all()
15
)
16
)
17
{
18
Mat src = imread(getDataPath("gpu/hog/road.png"));
19
20
Size sz = get<0>(GetParam());
21
int inpaintingMethod = get<1>(GetParam());
22
23
Mat mask(src.size(), CV_8UC1, Scalar(0));
24
Mat result(src.size(), src.type());
25
26
Rect inpaintArea(src.cols/3, src.rows/3, sz.width, sz.height);
27
mask(inpaintArea).setTo(255);
28
29
declare.in(src, mask).out(result).time(120);
30
31
TEST_CYCLE() inpaint(src, mask, result, 10.0, inpaintingMethod);
32
33
Mat inpaintedArea = result(inpaintArea);
34
SANITY_CHECK(inpaintedArea);
35
}
36
37
} // namespace
38
39