mirror of
https://github.com/opencv/opencv.git
synced 2025-01-12 15:49:32 +08:00
use downscaled frames in FGDStatModel test
(cherry picked from commit 599f5ef51b
)
This commit is contained in:
parent
2205b2f5bc
commit
86c1babd03
@ -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…
Reference in New Issue
Block a user