Commit a08044d6 authored by Alexander Alekhin's avatar Alexander Alekhin

Merge pull request #8833 from terfendail:resizenn_perftest

parents aea25e7f 22fcbaed
......@@ -120,3 +120,31 @@ PERF_TEST_P(MatInfo_Size_Scale_Area, ResizeArea,
//difference equal to 1 is allowed because of different possible rounding modes: round-to-nearest vs bankers' rounding
SANITY_CHECK(dst, 1);
}
typedef MatInfo_Size_Scale_Area MatInfo_Size_Scale_NN;
PERF_TEST_P(MatInfo_Size_Scale_NN, ResizeNN,
testing::Combine(
testing::Values(CV_8UC1, CV_8UC2, CV_8UC4),
testing::Values(szVGA, szqHD, sz720p, sz1080p, sz2160p),
testing::Values(2.4, 3.4, 1.3)
)
)
{
int matType = get<0>(GetParam());
Size from = get<1>(GetParam());
double scale = get<2>(GetParam());
cv::Mat src(from, matType);
Size to(cvRound(from.width * scale), cvRound(from.height * scale));
cv::Mat dst(to, matType);
declare.in(src, WARMUP_RNG).out(dst);
declare.time(100);
TEST_CYCLE() resize(src, dst, dst.size(), 0, 0, INTER_NEAREST);
EXPECT_GT(countNonZero(dst.reshape(1)), 0);
SANITY_CHECK_NOTHING();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment