From b5c4355c13c35de242c23d284886fc9e17589b9e Mon Sep 17 00:00:00 2001 From: Seon-Wook Park Date: Fri, 19 Jun 2015 04:29:28 +0200 Subject: [PATCH] spatialGradient: Add basic perf test --- modules/imgproc/perf/perf_spatialgradient.cpp | 34 +++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 modules/imgproc/perf/perf_spatialgradient.cpp diff --git a/modules/imgproc/perf/perf_spatialgradient.cpp b/modules/imgproc/perf/perf_spatialgradient.cpp new file mode 100644 index 0000000..31219a3 --- /dev/null +++ b/modules/imgproc/perf/perf_spatialgradient.cpp @@ -0,0 +1,34 @@ +#include "perf_precomp.hpp" + +using namespace std; +using namespace cv; +using namespace perf; +using namespace testing; +using std::tr1::make_tuple; +using std::tr1::get; + +typedef std::tr1::tuple Size_Ksize_t; +typedef perf::TestBaseWithParam Size_Ksize; + +PERF_TEST_P( Size_Ksize, spatialGradient, + Combine( + SZ_ALL_HD, + Values( 3 ) + ) +) +{ + Size size = std::tr1::get<0>(GetParam()); + int ksize = std::tr1::get<1>(GetParam()); + + Mat src(size, CV_8UC1); + Mat dx(size, CV_16SC1); + Mat dy(size, CV_16SC1); + + declare.in(src, WARMUP_RNG).out(dx, dy); + + TEST_CYCLE() spatialGradient(src, dx, dy, ksize); + + SANITY_CHECK(dx); + SANITY_CHECK(dy); +} + -- 2.7.4