From 86c1babd03857d968002ad6c69f3905f61a6bf1b Mon Sep 17 00:00:00 2001 From: Vladislav Vinogradov Date: Fri, 15 Aug 2014 13:42:25 +0400 Subject: [PATCH] use downscaled frames in FGDStatModel test (cherry picked from commit 599f5ef51bfb7a9e71a8c4e50a5f942fb2898cdb) --- modules/gpu/test/test_bgfg.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) 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);