mirror of
https://github.com/opencv/opencv.git
synced 2025-06-07 17:44:04 +08:00
Merge pull request #8833 from terfendail:resizenn_perftest
This commit is contained in:
commit
a08044d6f2
@ -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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user