From: Alexander Karsakov Date: Wed, 16 Apr 2014 09:01:49 +0000 (+0400) Subject: Added perf test for cv::buildPyramid X-Git-Tag: submit/tizen_ivi/20141117.190038~2^2~450^2~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ef2f5999ed0666d9b8c06fa02f2a511ed0fad4ce;p=profile%2Fivi%2Fopencv.git Added perf test for cv::buildPyramid --- diff --git a/modules/imgproc/perf/perf_pyramids.cpp b/modules/imgproc/perf/perf_pyramids.cpp index 66ea6d8..1310239 100644 --- a/modules/imgproc/perf/perf_pyramids.cpp +++ b/modules/imgproc/perf/perf_pyramids.cpp @@ -8,7 +8,7 @@ using std::tr1::get; PERF_TEST_P(Size_MatType, pyrDown, testing::Combine( testing::Values(sz1080p, sz720p, szVGA, szQVGA, szODD), - testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_16SC1, CV_16SC3, CV_16SC4) + testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_16SC1, CV_16SC3, CV_16SC4, CV_32FC1, CV_32FC3, CV_32FC4) ) ) { @@ -27,7 +27,7 @@ PERF_TEST_P(Size_MatType, pyrDown, testing::Combine( PERF_TEST_P(Size_MatType, pyrUp, testing::Combine( testing::Values(sz720p, szVGA, szQVGA, szODD), - testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_16SC1, CV_16SC3, CV_16SC4) + testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_16SC1, CV_16SC3, CV_16SC4, CV_32FC1, CV_32FC3, CV_32FC4) ) ) { @@ -43,3 +43,30 @@ PERF_TEST_P(Size_MatType, pyrUp, testing::Combine( SANITY_CHECK(dst); } + +PERF_TEST_P(Size_MatType, buildPyramid, testing::Combine( + testing::Values(sz2160p, sz1080p, sz720p, szVGA, szQVGA, szODD), + testing::Values(CV_8UC1, CV_8UC3, CV_8UC4, CV_32FC1, CV_32FC3, CV_32FC4) + ) + ) +{ + Size sz = get<0>(GetParam()); + int matType = get<1>(GetParam()); + int maxLevel = 5; + const double eps = CV_MAT_DEPTH(matType) <= CV_32S ? 1 : 1e-5; + + Mat src(sz, matType); + std::vector dst(maxLevel); + + declare.in(src, WARMUP_RNG); + + TEST_CYCLE() buildPyramid(src, dst, maxLevel); + + Mat dst0 = dst[0], dst1 = dst[1], dst2 = dst[2], dst3 = dst[3], dst4 = dst[4]; + + SANITY_CHECK(dst0, eps); + SANITY_CHECK(dst1, eps); + SANITY_CHECK(dst2, eps); + SANITY_CHECK(dst3, eps); + SANITY_CHECK(dst4, eps); +}