2011-10-20 13:00:29 +02:00
|
|
|
#include "perf_precomp.hpp"
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
using namespace cv;
|
|
|
|
using namespace perf;
|
2011-12-29 17:46:16 +01:00
|
|
|
using std::tr1::make_tuple;
|
|
|
|
using std::tr1::get;
|
2011-10-20 13:00:29 +02:00
|
|
|
|
|
|
|
CV_ENUM(InpaintingMethod, INPAINT_NS, INPAINT_TELEA)
|
|
|
|
typedef std::tr1::tuple<Size, InpaintingMethod> InpaintArea_InpaintingMethod_t;
|
|
|
|
typedef perf::TestBaseWithParam<InpaintArea_InpaintingMethod_t> InpaintArea_InpaintingMethod;
|
|
|
|
|
|
|
|
|
2011-12-29 17:46:16 +01:00
|
|
|
PERF_TEST_P(InpaintArea_InpaintingMethod, inpaint,
|
|
|
|
testing::Combine(
|
|
|
|
SZ_ALL_SMALL,
|
|
|
|
testing::ValuesIn(InpaintingMethod::all())
|
|
|
|
)
|
|
|
|
)
|
2011-10-20 13:00:29 +02:00
|
|
|
{
|
2011-12-29 17:46:16 +01:00
|
|
|
Mat src = imread(getDataPath("gpu/hog/road.png"));
|
2011-10-20 13:00:29 +02:00
|
|
|
|
2011-12-29 17:46:16 +01:00
|
|
|
Size sz = get<0>(GetParam());
|
|
|
|
int inpaintingMethod = get<1>(GetParam());
|
2011-10-20 13:00:29 +02:00
|
|
|
|
|
|
|
Mat mask(src.size(), CV_8UC1, Scalar(0));
|
2011-12-29 17:46:16 +01:00
|
|
|
Mat result(src.size(), src.type());
|
2011-10-20 13:00:29 +02:00
|
|
|
|
|
|
|
Rect inpaintArea(src.cols/3, src.rows/3, sz.width, sz.height);
|
|
|
|
mask(inpaintArea).setTo(255);
|
|
|
|
|
2011-12-29 17:46:16 +01:00
|
|
|
declare.in(src, mask).out(result).time(30);
|
2011-10-20 13:00:29 +02:00
|
|
|
|
2011-12-29 17:46:16 +01:00
|
|
|
TEST_CYCLE() inpaint(src, mask, result, 10.0, inpaintingMethod);
|
2011-10-20 13:00:29 +02:00
|
|
|
|
2011-12-29 17:46:16 +01:00
|
|
|
Mat inpaintedArea = result(inpaintArea);
|
|
|
|
SANITY_CHECK(inpaintedArea);
|
2011-10-20 13:00:29 +02:00
|
|
|
}
|