use downscaled frames in FGDStatModel test

(cherry picked from commit 599f5ef51b)
pull/4080/head
Vladislav Vinogradov 10 years ago committed by Alexander Smorkalov
parent 2205b2f5bc
commit 86c1babd03
  1. 16
      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<CvBGStatModel> 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);

Loading…
Cancel
Save