From 7c83f0dd86add835536bb75f51987ddac4032c1f Mon Sep 17 00:00:00 2001 From: Kirill Kornyakov Date: Thu, 20 Oct 2011 11:00:29 +0000 Subject: [PATCH] inpaint perf test added --- modules/imgproc/perf/perf_inpaint.cpp | 48 +++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 modules/imgproc/perf/perf_inpaint.cpp diff --git a/modules/imgproc/perf/perf_inpaint.cpp b/modules/imgproc/perf/perf_inpaint.cpp new file mode 100644 index 0000000..ebab577 --- /dev/null +++ b/modules/imgproc/perf/perf_inpaint.cpp @@ -0,0 +1,48 @@ +#include "perf_precomp.hpp" + +#include + +using namespace std; +using namespace cv; +using namespace perf; + +CV_ENUM(InpaintingMethod, INPAINT_NS, INPAINT_TELEA) + +typedef std::tr1::tuple InpaintArea_InpaintingMethod_t; +typedef perf::TestBaseWithParam InpaintArea_InpaintingMethod; + + +/* +//! restores the damaged image areas using one of the available intpainting algorithms +CV_EXPORTS_W void inpaint( InputArray src, InputArray inpaintMask, + OutputArray dst, double inpaintRange, int flags ); +*/ +PERF_TEST_P( InpaintArea_InpaintingMethod, inpaint, + testing::Combine( + SZ_ALL_SMALL, + testing::Values( (int)INPAINT_NS, (int)INPAINT_TELEA )) + ) +{ + Mat src = imread( getDataPath("gpu/hog/road.png") ); + + Size sz = std::tr1::get<0>(GetParam()); + int inpaintingMethod = std::tr1::get<1>(GetParam()); + + Mat mask(src.size(), CV_8UC1, Scalar(0)); + + Rect inpaintArea(src.cols/3, src.rows/3, sz.width, sz.height); + mask(inpaintArea).setTo(255); + + declare.time(30); + + Mat result; + TEST_CYCLE(100) + { + inpaint(src, mask, result, 10.0, inpaintingMethod); + + //rectangle(result, inpaintArea, Scalar(255)); + //char buf[256]; + //sprintf(buf, "frame_%d_%d.jpg", sz.width, inpaintingMethod); + //imwrite(buf, result); + } +} -- 2.7.4