added dedicated <modname>_init.cpp files with initModule_<modname>() functions and all the relevant structures; made BackgroundSubtractorMOG/MOG2 derivatives from Algorithm; cleaned up MOG2 implementation and made it multi-threaded.

This commit is contained in:
Vadim Pisarevsky
2012-04-20 15:32:54 +00:00
parent 3d108958e7
commit 5b6b30ba0e
19 changed files with 1042 additions and 1199 deletions

View File

@@ -1,4 +1,5 @@
#include "opencv2/core/core.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/video/background_segm.hpp"
#include "opencv2/highgui/highgui.hpp"
#include <stdio.h>
@@ -17,7 +18,7 @@ void help()
const char* keys =
{
"{c |camera |false | use camera or not}"
"{c |camera |true | use camera or not}"
"{fn|file_name|tree.avi | movie file }"
};
@@ -49,7 +50,8 @@ int main(int argc, const char** argv)
namedWindow("foreground image", CV_WINDOW_NORMAL);
namedWindow("mean background image", CV_WINDOW_NORMAL);
BackgroundSubtractorMOG2 bg_model;
BackgroundSubtractorMOG2 bg_model;//(100, 3, 0.3, 5);
Mat img, fgmask, fgimg;
for(;;)
@@ -59,6 +61,8 @@ int main(int argc, const char** argv)
if( img.empty() )
break;
//cvtColor(_img, img, COLOR_BGR2GRAY);
if( fgimg.empty() )
fgimg.create(img.size(), img.type());