Commit 487ff4f3 authored by Andrey Pavlenko's avatar Andrey Pavlenko Committed by OpenCV Buildbot

Merge pull request #1151 from jet47:gpubgsegm-refactoring

parents 4ed9b1ca 77373751
......@@ -6,4 +6,4 @@ set(the_description "GPU-accelerated Background Segmentation")
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4127 /wd4324 /wd4512 -Wundef -Wmissing-declarations)
ocv_define_module(gpubgsegm opencv_video opencv_imgproc opencv_legacy opencv_gpuarithm opencv_gpufilters opencv_gpuimgproc)
ocv_define_module(gpubgsegm opencv_video OPTIONAL opencv_legacy opencv_imgproc opencv_gpuarithm opencv_gpufilters opencv_gpuimgproc)
......@@ -41,7 +41,14 @@
//M*/
#include "perf_precomp.hpp"
#include "opencv2/legacy.hpp"
#ifdef HAVE_OPENCV_LEGACY
# include "opencv2/legacy.hpp"
#endif
#ifdef HAVE_OPENCV_GPUIMGPROC
# include "opencv2/gpuimgproc.hpp"
#endif
using namespace std;
using namespace testing;
......@@ -59,6 +66,13 @@ using namespace perf;
# define BUILD_WITH_VIDEO_INPUT_SUPPORT 0
#endif
//////////////////////////////////////////////////////
// FGDStatModel
#if BUILD_WITH_VIDEO_INPUT_SUPPORT
#ifdef HAVE_OPENCV_LEGACY
namespace cv
{
template<> void Ptr<CvBGStatModel>::delete_obj()
......@@ -67,10 +81,7 @@ namespace cv
}
}
//////////////////////////////////////////////////////
// FGDStatModel
#if BUILD_WITH_VIDEO_INPUT_SUPPORT
#endif
DEF_PARAM_TEST_1(Video, string);
......@@ -90,10 +101,10 @@ PERF_TEST_P(Video, FGDStatModel,
if (PERF_RUN_GPU())
{
cv::gpu::GpuMat d_frame(frame);
cv::gpu::GpuMat d_frame(frame), foreground;
cv::gpu::FGDStatModel d_model(4);
d_model.create(d_frame);
cv::Ptr<cv::gpu::BackgroundSubtractorFGD> d_fgd = cv::gpu::createBackgroundSubtractorFGD();
d_fgd->apply(d_frame, foreground);
for (int i = 0; i < 10; ++i)
{
......@@ -103,18 +114,22 @@ PERF_TEST_P(Video, FGDStatModel,
d_frame.upload(frame);
startTimer(); next();
d_model.update(d_frame);
d_fgd->apply(d_frame, foreground);
stopTimer();
}
const cv::gpu::GpuMat background = d_model.background;
const cv::gpu::GpuMat foreground = d_model.foreground;
GPU_SANITY_CHECK(foreground, 1e-2, ERROR_RELATIVE);
#ifdef HAVE_OPENCV_GPUIMGPROC
cv::gpu::GpuMat background3, background;
d_fgd->getBackgroundImage(background3);
cv::gpu::cvtColor(background3, background, cv::COLOR_BGR2BGRA);
GPU_SANITY_CHECK(background, 1e-2, ERROR_RELATIVE);
GPU_SANITY_CHECK(foreground, 1e-2, ERROR_RELATIVE);
#endif
}
else
{
#ifdef HAVE_OPENCV_LEGACY
IplImage ipl_frame = frame;
cv::Ptr<CvBGStatModel> model(cvCreateFGDStatModel(&ipl_frame));
......@@ -135,6 +150,9 @@ PERF_TEST_P(Video, FGDStatModel,
CPU_SANITY_CHECK(background);
CPU_SANITY_CHECK(foreground);
#else
FAIL_NO_CPU();
#endif
}
}
......@@ -176,11 +194,12 @@ PERF_TEST_P(Video_Cn_LearningRate, MOG,
if (PERF_RUN_GPU())
{
cv::Ptr<cv::BackgroundSubtractor> d_mog = cv::gpu::createBackgroundSubtractorMOG();
cv::gpu::GpuMat d_frame(frame);
cv::gpu::MOG_GPU d_mog;
cv::gpu::GpuMat foreground;
d_mog(d_frame, foreground, learningRate);
d_mog->apply(d_frame, foreground, learningRate);
for (int i = 0; i < 10; ++i)
{
......@@ -200,7 +219,7 @@ PERF_TEST_P(Video_Cn_LearningRate, MOG,
d_frame.upload(frame);
startTimer(); next();
d_mog(d_frame, foreground, learningRate);
d_mog->apply(d_frame, foreground, learningRate);
stopTimer();
}
......@@ -273,13 +292,13 @@ PERF_TEST_P(Video_Cn, MOG2,
if (PERF_RUN_GPU())
{
cv::gpu::MOG2_GPU d_mog2;
d_mog2.bShadowDetection = false;
cv::Ptr<cv::BackgroundSubtractorMOG2> d_mog2 = cv::gpu::createBackgroundSubtractorMOG2();
d_mog2->setDetectShadows(false);
cv::gpu::GpuMat d_frame(frame);
cv::gpu::GpuMat foreground;
d_mog2(d_frame, foreground);
d_mog2->apply(d_frame, foreground);
for (int i = 0; i < 10; ++i)
{
......@@ -299,7 +318,7 @@ PERF_TEST_P(Video_Cn, MOG2,
d_frame.upload(frame);
startTimer(); next();
d_mog2(d_frame, foreground);
d_mog2->apply(d_frame, foreground);
stopTimer();
}
......@@ -307,8 +326,8 @@ PERF_TEST_P(Video_Cn, MOG2,
}
else
{
cv::Ptr<cv::BackgroundSubtractor> mog2 = cv::createBackgroundSubtractorMOG2();
mog2->set("detectShadows", false);
cv::Ptr<cv::BackgroundSubtractorMOG2> mog2 = cv::createBackgroundSubtractorMOG2();
mog2->setDetectShadows(false);
cv::Mat foreground;
......@@ -359,8 +378,9 @@ PERF_TEST_P(Video_Cn, MOG2GetBackgroundImage,
if (PERF_RUN_GPU())
{
cv::Ptr<cv::BackgroundSubtractor> d_mog2 = cv::gpu::createBackgroundSubtractorMOG2();
cv::gpu::GpuMat d_frame;
cv::gpu::MOG2_GPU d_mog2;
cv::gpu::GpuMat d_foreground;
for (int i = 0; i < 10; ++i)
......@@ -380,12 +400,12 @@ PERF_TEST_P(Video_Cn, MOG2GetBackgroundImage,
d_frame.upload(frame);
d_mog2(d_frame, d_foreground);
d_mog2->apply(d_frame, d_foreground);
}
cv::gpu::GpuMat background;
TEST_CYCLE() d_mog2.getBackgroundImage(background);
TEST_CYCLE() d_mog2->getBackgroundImage(background);
GPU_SANITY_CHECK(background, 1);
}
......@@ -460,10 +480,10 @@ PERF_TEST_P(Video_Cn_MaxFeatures, GMG,
cv::gpu::GpuMat d_frame(frame);
cv::gpu::GpuMat foreground;
cv::gpu::GMG_GPU d_gmg;
d_gmg.maxFeatures = maxFeatures;
cv::Ptr<cv::BackgroundSubtractorGMG> d_gmg = cv::gpu::createBackgroundSubtractorGMG();
d_gmg->setMaxFeatures(maxFeatures);
d_gmg(d_frame, foreground);
d_gmg->apply(d_frame, foreground);
for (int i = 0; i < 150; ++i)
{
......@@ -488,7 +508,7 @@ PERF_TEST_P(Video_Cn_MaxFeatures, GMG,
d_frame.upload(frame);
startTimer(); next();
d_gmg(d_frame, foreground);
d_gmg->apply(d_frame, foreground);
stopTimer();
}
......@@ -499,9 +519,8 @@ PERF_TEST_P(Video_Cn_MaxFeatures, GMG,
cv::Mat foreground;
cv::Mat zeros(frame.size(), CV_8UC1, cv::Scalar::all(0));
cv::Ptr<cv::BackgroundSubtractor> gmg = cv::createBackgroundSubtractorGMG();
gmg->set("maxFeatures", maxFeatures);
//gmg.initialize(frame.size(), 0.0, 255.0);
cv::Ptr<cv::BackgroundSubtractorGMG> gmg = cv::createBackgroundSubtractorGMG();
gmg->setMaxFeatures(maxFeatures);
gmg->apply(frame, foreground);
......
......@@ -57,6 +57,8 @@
#include "opencv2/gpubgsegm.hpp"
#include "opencv2/video.hpp"
#include "opencv2/opencv_modules.hpp"
#ifdef GTEST_CREATE_SHARED_LIBRARY
#error no modules except ts should have GTEST_CREATE_SHARED_LIBRARY defined
#endif
......
......@@ -53,7 +53,7 @@
using namespace cv::gpu;
using namespace cv::gpu::cudev;
namespace bgfg
namespace fgd
{
////////////////////////////////////////////////////////////////////////////
// calcDiffHistogram
......
......@@ -45,7 +45,7 @@
#include "opencv2/core/gpu_types.hpp"
namespace bgfg
namespace fgd
{
struct BGPixelStat
{
......
......@@ -47,7 +47,7 @@
#include "opencv2/core/cuda/limits.hpp"
namespace cv { namespace gpu { namespace cudev {
namespace bgfg_gmg
namespace gmg
{
__constant__ int c_width;
__constant__ int c_height;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -46,10 +46,21 @@
#include <limits>
#include "opencv2/gpubgsegm.hpp"
#include "opencv2/gpuarithm.hpp"
#include "opencv2/gpufilters.hpp"
#include "opencv2/gpuimgproc.hpp"
#include "opencv2/core/private.gpu.hpp"
#include "opencv2/opencv_modules.hpp"
#ifdef HAVE_OPENCV_GPUARITHM
# include "opencv2/gpuarithm.hpp"
#endif
#ifdef HAVE_OPENCV_GPUFILTERS
# include "opencv2/gpufilters.hpp"
#endif
#ifdef HAVE_OPENCV_GPUIMGPROC
# include "opencv2/gpuimgproc.hpp"
#endif
#endif /* __OPENCV_PRECOMP_H__ */
......@@ -41,7 +41,10 @@
//M*/
#include "test_precomp.hpp"
#include "opencv2/legacy.hpp"
#ifdef HAVE_OPENCV_LEGACY
# include "opencv2/legacy.hpp"
#endif
#ifdef HAVE_CUDA
......@@ -62,7 +65,7 @@ using namespace cvtest;
//////////////////////////////////////////////////////
// FGDStatModel
#if BUILD_WITH_VIDEO_INPUT_SUPPORT
#if BUILD_WITH_VIDEO_INPUT_SUPPORT && defined(HAVE_OPENCV_LEGACY)
namespace cv
{
......@@ -72,11 +75,10 @@ namespace cv
}
}
PARAM_TEST_CASE(FGDStatModel, cv::gpu::DeviceInfo, std::string, Channels)
PARAM_TEST_CASE(FGDStatModel, cv::gpu::DeviceInfo, std::string)
{
cv::gpu::DeviceInfo devInfo;
std::string inputFile;
int out_cn;
virtual void SetUp()
{
......@@ -84,8 +86,6 @@ PARAM_TEST_CASE(FGDStatModel, cv::gpu::DeviceInfo, std::string, Channels)
cv::gpu::setDevice(devInfo.deviceID());
inputFile = std::string(cvtest::TS::ptr()->get_data_path()) + "video/" + GET_PARAM(1);
out_cn = GET_PARAM(2);
}
};
......@@ -102,15 +102,10 @@ GPU_TEST_P(FGDStatModel, Update)
cv::Ptr<CvBGStatModel> model(cvCreateFGDStatModel(&ipl_frame));
cv::gpu::GpuMat d_frame(frame);
cv::gpu::FGDStatModel d_model(out_cn);
d_model.create(d_frame);
cv::Mat h_background;
cv::Mat h_foreground;
cv::Mat h_background3;
cv::Mat backgroundDiff;
cv::Mat foregroundDiff;
cv::Ptr<cv::gpu::BackgroundSubtractorFGD> d_fgd = cv::gpu::createBackgroundSubtractorFGD();
cv::gpu::GpuMat d_foreground, d_background;
std::vector< std::vector<cv::Point> > foreground_regions;
d_fgd->apply(d_frame, d_foreground);
for (int i = 0; i < 5; ++i)
{
......@@ -121,32 +116,23 @@ GPU_TEST_P(FGDStatModel, Update)
int gold_count = cvUpdateBGStatModel(&ipl_frame, model);
d_frame.upload(frame);
int count = d_model.update(d_frame);
ASSERT_EQ(gold_count, count);
d_fgd->apply(d_frame, d_foreground);
d_fgd->getBackgroundImage(d_background);
d_fgd->getForegroundRegions(foreground_regions);
int count = (int) foreground_regions.size();
cv::Mat gold_background = cv::cvarrToMat(model->background);
cv::Mat gold_foreground = cv::cvarrToMat(model->foreground);
if (out_cn == 3)
d_model.background.download(h_background3);
else
{
d_model.background.download(h_background);
cv::cvtColor(h_background, h_background3, cv::COLOR_BGRA2BGR);
}
d_model.foreground.download(h_foreground);
ASSERT_MAT_NEAR(gold_background, h_background3, 1.0);
ASSERT_MAT_NEAR(gold_foreground, h_foreground, 0.0);
ASSERT_MAT_NEAR(gold_background, d_background, 1.0);
ASSERT_MAT_NEAR(gold_foreground, d_foreground, 0.0);
ASSERT_EQ(gold_count, count);
}
}
INSTANTIATE_TEST_CASE_P(GPU_BgSegm, FGDStatModel, testing::Combine(
ALL_DEVICES,
testing::Values(std::string("768x576.avi")),
testing::Values(Channels(3), Channels(4))));
testing::Values(std::string("768x576.avi"))));
#endif
......@@ -193,7 +179,7 @@ GPU_TEST_P(MOG, Update)
cap >> frame;
ASSERT_FALSE(frame.empty());
cv::gpu::MOG_GPU mog;
cv::Ptr<cv::BackgroundSubtractorMOG> mog = cv::gpu::createBackgroundSubtractorMOG();
cv::gpu::GpuMat foreground = createMat(frame.size(), CV_8UC1, useRoi);
cv::Ptr<cv::BackgroundSubtractorMOG> mog_gold = cv::createBackgroundSubtractorMOG();
......@@ -211,7 +197,7 @@ GPU_TEST_P(MOG, Update)
cv::swap(temp, frame);
}
mog(loadMat(frame, useRoi), foreground, (float)learningRate);
mog->apply(loadMat(frame, useRoi), foreground, learningRate);
mog_gold->apply(frame, foreground_gold, learningRate);
......@@ -267,8 +253,8 @@ GPU_TEST_P(MOG2, Update)
cap >> frame;
ASSERT_FALSE(frame.empty());
cv::gpu::MOG2_GPU mog2;
mog2.bShadowDetection = detectShadow;
cv::Ptr<cv::BackgroundSubtractorMOG2> mog2 = cv::gpu::createBackgroundSubtractorMOG2();
mog2->setDetectShadows(detectShadow);
cv::gpu::GpuMat foreground = createMat(frame.size(), CV_8UC1, useRoi);
cv::Ptr<cv::BackgroundSubtractorMOG2> mog2_gold = cv::createBackgroundSubtractorMOG2();
......@@ -287,7 +273,7 @@ GPU_TEST_P(MOG2, Update)
cv::swap(temp, frame);
}
mog2(loadMat(frame, useRoi), foreground);
mog2->apply(loadMat(frame, useRoi), foreground);
mog2_gold->apply(frame, foreground_gold);
......@@ -312,8 +298,8 @@ GPU_TEST_P(MOG2, getBackgroundImage)
cv::Mat frame;
cv::gpu::MOG2_GPU mog2;
mog2.bShadowDetection = detectShadow;
cv::Ptr<cv::BackgroundSubtractorMOG2> mog2 = cv::gpu::createBackgroundSubtractorMOG2();
mog2->setDetectShadows(detectShadow);
cv::gpu::GpuMat foreground;
cv::Ptr<cv::BackgroundSubtractorMOG2> mog2_gold = cv::createBackgroundSubtractorMOG2();
......@@ -325,13 +311,13 @@ GPU_TEST_P(MOG2, getBackgroundImage)
cap >> frame;
ASSERT_FALSE(frame.empty());
mog2(loadMat(frame, useRoi), foreground);
mog2->apply(loadMat(frame, useRoi), foreground);
mog2_gold->apply(frame, foreground_gold);
}
cv::gpu::GpuMat background = createMat(frame.size(), frame.type(), useRoi);
mog2.getBackgroundImage(background);
mog2->getBackgroundImage(background);
cv::Mat background_gold;
mog2_gold->getBackgroundImage(background_gold);
......@@ -372,16 +358,15 @@ GPU_TEST_P(GMG, Accuracy)
cv::Mat frame = randomMat(size, type, 0, 100);
cv::gpu::GpuMat d_frame = loadMat(frame, useRoi);
cv::gpu::GMG_GPU gmg;
gmg.numInitializationFrames = 5;
gmg.smoothingRadius = 0;
gmg.initialize(d_frame.size(), 0, 255);
cv::Ptr<cv::BackgroundSubtractorGMG> gmg = cv::gpu::createBackgroundSubtractorGMG();
gmg->setNumFrames(5);
gmg->setSmoothingRadius(0);
cv::gpu::GpuMat d_fgmask = createMat(size, CV_8UC1, useRoi);
for (int i = 0; i < gmg.numInitializationFrames; ++i)
for (int i = 0; i < gmg->getNumFrames(); ++i)
{
gmg(d_frame, d_fgmask);
gmg->apply(d_frame, d_fgmask);
// fgmask should be entirely background during training
ASSERT_MAT_NEAR(zeros, d_fgmask, 0);
......@@ -389,7 +374,7 @@ GPU_TEST_P(GMG, Accuracy)
frame = randomMat(size, type, 160, 255);
d_frame = loadMat(frame, useRoi);
gmg(d_frame, d_fgmask);
gmg->apply(d_frame, d_fgmask);
// now fgmask should be entirely foreground
ASSERT_MAT_NEAR(fullfg, d_fgmask, 0);
......
......@@ -59,4 +59,6 @@
#include "opencv2/gpubgsegm.hpp"
#include "opencv2/video.hpp"
#include "opencv2/opencv_modules.hpp"
#endif
......@@ -18,10 +18,10 @@ using namespace cv::gpu;
enum Method
{
FGD_STAT,
MOG,
MOG2,
GMG
GMG,
FGD_STAT
};
int main(int argc, const char** argv)
......@@ -29,7 +29,7 @@ int main(int argc, const char** argv)
cv::CommandLineParser cmd(argc, argv,
"{ c camera | | use camera }"
"{ f file | 768x576.avi | input video file }"
"{ m method | mog | method (fgd, mog, mog2, gmg) }"
"{ m method | mog | method (mog, mog2, gmg, fgd) }"
"{ h help | | print help message }");
if (cmd.has("help") || !cmd.check())
......@@ -43,18 +43,18 @@ int main(int argc, const char** argv)
string file = cmd.get<string>("file");
string method = cmd.get<string>("method");
if (method != "fgd"
&& method != "mog"
if (method != "mog"
&& method != "mog2"
&& method != "gmg")
&& method != "gmg"
&& method != "fgd")
{
cerr << "Incorrect method" << endl;
return -1;
}
Method m = method == "fgd" ? FGD_STAT :
method == "mog" ? MOG :
Method m = method == "mog" ? MOG :
method == "mog2" ? MOG2 :
method == "fgd" ? FGD_STAT :
GMG;
VideoCapture cap;
......@@ -75,11 +75,10 @@ int main(int argc, const char** argv)
GpuMat d_frame(frame);
FGDStatModel fgd_stat;
MOG_GPU mog;
MOG2_GPU mog2;
GMG_GPU gmg;
gmg.numInitializationFrames = 40;
Ptr<BackgroundSubtractor> mog = gpu::createBackgroundSubtractorMOG();
Ptr<BackgroundSubtractor> mog2 = gpu::createBackgroundSubtractorMOG2();
Ptr<BackgroundSubtractor> gmg = gpu::createBackgroundSubtractorGMG(40);
Ptr<BackgroundSubtractor> fgd = gpu::createBackgroundSubtractorFGD();
GpuMat d_fgmask;
GpuMat d_fgimg;
......@@ -91,20 +90,20 @@ int main(int argc, const char** argv)
switch (m)
{
case FGD_STAT:
fgd_stat.create(d_frame);
break;
case MOG:
mog(d_frame, d_fgmask, 0.01f);
mog->apply(d_frame, d_fgmask, 0.01);
break;
case MOG2:
mog2(d_frame, d_fgmask);
mog2->apply(d_frame, d_fgmask);
break;
case GMG:
gmg.initialize(d_frame.size());
gmg->apply(d_frame, d_fgmask);
break;
case FGD_STAT:
fgd->apply(d_frame, d_fgmask);
break;
}
......@@ -128,24 +127,23 @@ int main(int argc, const char** argv)
//update the model
switch (m)
{
case FGD_STAT:
fgd_stat.update(d_frame);
d_fgmask = fgd_stat.foreground;
d_bgimg = fgd_stat.background;
break;
case MOG:
mog(d_frame, d_fgmask, 0.01f);
mog.getBackgroundImage(d_bgimg);
mog->apply(d_frame, d_fgmask, 0.01);
mog->getBackgroundImage(d_bgimg);
break;
case MOG2:
mog2(d_frame, d_fgmask);
mog2.getBackgroundImage(d_bgimg);
mog2->apply(d_frame, d_fgmask);
mog2->getBackgroundImage(d_bgimg);
break;
case GMG:
gmg(d_frame, d_fgmask);
gmg->apply(d_frame, d_fgmask);
break;
case FGD_STAT:
fgd->apply(d_frame, d_fgmask);
fgd->getBackgroundImage(d_bgimg);
break;
}
......
......@@ -1271,14 +1271,14 @@ TEST(FGDStatModel)
{
const std::string inputFile = abspath("768x576.avi");
cv::VideoCapture cap(inputFile);
VideoCapture cap(inputFile);
if (!cap.isOpened()) throw runtime_error("can't open 768x576.avi");
cv::Mat frame;
Mat frame;
cap >> frame;
IplImage ipl_frame = frame;
cv::Ptr<CvBGStatModel> model(cvCreateFGDStatModel(&ipl_frame));
Ptr<CvBGStatModel> model(cvCreateFGDStatModel(&ipl_frame));
while (!TestSystem::instance().stop())
{
......@@ -1297,8 +1297,10 @@ TEST(FGDStatModel)
cap >> frame;
cv::gpu::GpuMat d_frame(frame);
cv::gpu::FGDStatModel d_model(d_frame);
gpu::GpuMat d_frame(frame), d_fgmask;
Ptr<BackgroundSubtractor> d_fgd = gpu::createBackgroundSubtractorFGD();
d_fgd->apply(d_frame, d_fgmask);
while (!TestSystem::instance().stop())
{
......@@ -1307,7 +1309,7 @@ TEST(FGDStatModel)
TestSystem::instance().gpuOn();
d_model.update(d_frame);
d_fgd->apply(d_frame, d_fgmask);
TestSystem::instance().gpuOff();
}
......@@ -1346,10 +1348,10 @@ TEST(MOG)
cap >> frame;
cv::gpu::GpuMat d_frame(frame);
cv::gpu::MOG_GPU d_mog;
cv::Ptr<cv::BackgroundSubtractor> d_mog = cv::gpu::createBackgroundSubtractorMOG();
cv::gpu::GpuMat d_foreground;
d_mog(d_frame, d_foreground, 0.01f);
d_mog->apply(d_frame, d_foreground, 0.01);
while (!TestSystem::instance().stop())
{
......@@ -1358,7 +1360,7 @@ TEST(MOG)
TestSystem::instance().gpuOn();
d_mog(d_frame, d_foreground, 0.01f);
d_mog->apply(d_frame, d_foreground, 0.01);
TestSystem::instance().gpuOff();
}
......@@ -1399,13 +1401,13 @@ TEST(MOG2)
cap >> frame;
cv::Ptr<cv::BackgroundSubtractor> d_mog2 = cv::gpu::createBackgroundSubtractorMOG2();
cv::gpu::GpuMat d_frame(frame);
cv::gpu::MOG2_GPU d_mog2;
cv::gpu::GpuMat d_foreground;
cv::gpu::GpuMat d_background;
d_mog2(d_frame, d_foreground);
d_mog2.getBackgroundImage(d_background);
d_mog2->apply(d_frame, d_foreground);
d_mog2->getBackgroundImage(d_background);
while (!TestSystem::instance().stop())
{
......@@ -1414,8 +1416,8 @@ TEST(MOG2)
TestSystem::instance().gpuOn();
d_mog2(d_frame, d_foreground);
d_mog2.getBackgroundImage(d_background);
d_mog2->apply(d_frame, d_foreground);
d_mog2->getBackgroundImage(d_background);
TestSystem::instance().gpuOff();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment