Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions modules/cudawarping/perf/perf_warping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,57 @@ PERF_TEST_P(Sz_Depth_Cn_Inter_Scale, Resize,
}
}

//////////////////////////////////////////////////////////////////////
// ResizeLanczos

PERF_TEST_P(Sz_Depth_Cn_Inter_Scale, ResizeLanczos,
Combine(CUDA_TYPICAL_MAT_SIZES,
Values(CV_8U, CV_32F),
CUDA_CHANNELS_1_3_4,
Values(Interpolation(cv::INTER_LANCZOS4)),
Values(0.5, 1.5, 2.0)))
{
declare.time(20.0);

const cv::Size size = GET_PARAM(0);
const int depth = GET_PARAM(1);
const int channels = GET_PARAM(2);
const int interpolation = GET_PARAM(3);
const double f = GET_PARAM(4);

const int type = CV_MAKE_TYPE(depth, channels);

cv::Mat src(size, type);
declare.in(src, WARMUP_RNG);

if (PERF_RUN_CUDA())
{
const cv::cuda::GpuMat d_src(src);
cv::cuda::GpuMat dst;
cv::Size dsize(cv::saturate_cast<int>(src.cols * f), cv::saturate_cast<int>(src.rows * f));
cv::Mat host_dst(dsize, type);

declare.out(host_dst);

TEST_CYCLE() cv::cuda::resize(d_src, dst, cv::Size(), f, f, interpolation);

dst.download(host_dst);

CUDA_SANITY_CHECK(dst, 1e-3, ERROR_RELATIVE);
}
else
{
cv::Size dsize(cv::saturate_cast<int>(src.cols * f), cv::saturate_cast<int>(src.rows * f));
cv::Mat dst(dsize, type);

declare.out(dst);

TEST_CYCLE() cv::resize(src, dst, cv::Size(), f, f, interpolation);

CPU_SANITY_CHECK(dst);
}
}

//////////////////////////////////////////////////////////////////////
// ResizeArea

Expand Down
Loading
Loading