diff --git a/modules/gpu/test/test_bgfg.cpp b/modules/gpu/test/test_bgfg.cpp index e08bfb399b..e279bc1417 100644 --- a/modules/gpu/test/test_bgfg.cpp +++ b/modules/gpu/test/test_bgfg.cpp @@ -98,10 +98,13 @@ GPU_TEST_P(FGDStatModel, Update) cap >> frame; ASSERT_FALSE(frame.empty()); - IplImage ipl_frame = frame; + cv::Mat frameSmall; + cv::resize(frame, frameSmall, cv::Size(), 0.5, 0.5); + + IplImage ipl_frame = frameSmall; cv::Ptr model(cvCreateFGDStatModel(&ipl_frame)); - cv::gpu::GpuMat d_frame(frame); + cv::gpu::GpuMat d_frame(frameSmall); cv::gpu::FGDStatModel d_model(out_cn); d_model.create(d_frame); @@ -109,18 +112,17 @@ GPU_TEST_P(FGDStatModel, Update) cv::Mat h_foreground; cv::Mat h_background3; - cv::Mat backgroundDiff; - cv::Mat foregroundDiff; - for (int i = 0; i < 5; ++i) { cap >> frame; ASSERT_FALSE(frame.empty()); - ipl_frame = frame; + cv::resize(frame, frameSmall, cv::Size(), 0.5, 0.5); + + ipl_frame = frameSmall; int gold_count = cvUpdateBGStatModel(&ipl_frame, model); - d_frame.upload(frame); + d_frame.upload(frameSmall); int count = d_model.update(d_frame);