Skip to content

Commit c451a64

Browse files
committed
Fix uninitialized output parameter error
1 parent 3cd6cf7 commit c451a64

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

modules/cudawarping/perf/perf_warping.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,14 +207,23 @@ PERF_TEST_P(Sz_Depth_Cn_Inter_Scale, ResizeLanczos,
207207
{
208208
const cv::cuda::GpuMat d_src(src);
209209
cv::cuda::GpuMat dst;
210+
cv::Size dsize(cv::saturate_cast<int>(src.cols * f), cv::saturate_cast<int>(src.rows * f));
211+
cv::Mat host_dst(dsize, type);
212+
213+
declare.out(host_dst);
210214

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

217+
dst.download(host_dst);
218+
213219
CUDA_SANITY_CHECK(dst, 1e-3, ERROR_RELATIVE);
214220
}
215221
else
216222
{
217-
cv::Mat dst;
223+
cv::Size dsize(cv::saturate_cast<int>(src.cols * f), cv::saturate_cast<int>(src.rows * f));
224+
cv::Mat dst(dsize, type);
225+
226+
declare.out(dst);
218227

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

0 commit comments

Comments
 (0)