~paparazzi-uav/paparazzi/v5.0-manual

« back to all changes in this revision

Viewing changes to sw/ext/opencv_bebop/opencv/modules/photo/perf/perf_inpaint.cpp

  • Committer: Paparazzi buildbot
  • Date: 2016-05-18 15:00:29 UTC
  • Revision ID: felix.ruess+docbot@gmail.com-20160518150029-e8lgzi5kvb4p7un9
Manual import commit 4b8bbb730080dac23cf816b98908dacfabe2a8ec from v5.0 branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
 
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
}