1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 15:53:03 +04:00

Merge branch '2.4'

This commit is contained in:
Andrey Kamaev
2013-03-21 20:59:18 +04:00
276 changed files with 11834 additions and 5170 deletions
+29 -3
View File
@@ -15,7 +15,9 @@ enum Method
FGD_STAT,
MOG,
MOG2,
#ifdef HAVE_OPENCV_NONFREE
VIBE,
#endif
GMG
};
@@ -38,13 +40,25 @@ int main(int argc, const char** argv)
string file = cmd.get<string>("file");
string method = cmd.get<string>("method");
if (method != "fgd" && method != "mog" && method != "mog2" && method != "vibe" && method != "gmg")
if (method != "fgd"
&& method != "mog"
&& method != "mog2"
#ifdef HAVE_OPENCV_NONFREE
&& method != "vibe"
#endif
&& method != "gmg")
{
cerr << "Incorrect method" << endl;
return -1;
}
Method m = method == "fgd" ? FGD_STAT : method == "mog" ? MOG : method == "mog2" ? MOG2 : method == "vibe" ? VIBE : GMG;
Method m = method == "fgd" ? FGD_STAT :
method == "mog" ? MOG :
method == "mog2" ? MOG2 :
#ifdef HAVE_OPENCV_NONFREE
method == "vibe" ? VIBE :
#endif
GMG;
VideoCapture cap;
@@ -67,7 +81,9 @@ int main(int argc, const char** argv)
FGDStatModel fgd_stat;
MOG_GPU mog;
MOG2_GPU mog2;
#ifdef HAVE_OPENCV_NONFREE
VIBE_GPU vibe;
#endif
GMG_GPU gmg;
gmg.numInitializationFrames = 40;
@@ -93,9 +109,11 @@ int main(int argc, const char** argv)
mog2(d_frame, d_fgmask);
break;
#ifdef HAVE_OPENCV_NONFREE
case VIBE:
vibe.initialize(d_frame);
break;
#endif
case GMG:
gmg.initialize(d_frame.size());
@@ -105,8 +123,14 @@ int main(int argc, const char** argv)
namedWindow("image", WINDOW_NORMAL);
namedWindow("foreground mask", WINDOW_NORMAL);
namedWindow("foreground image", WINDOW_NORMAL);
if (m != VIBE && m != GMG)
if (m != GMG
#ifdef HAVE_OPENCV_NONFREE
&& m != VIBE
#endif
)
{
namedWindow("mean background image", WINDOW_NORMAL);
}
for(;;)
{
@@ -136,9 +160,11 @@ int main(int argc, const char** argv)
mog2.getBackgroundImage(d_bgimg);
break;
#ifdef HAVE_OPENCV_NONFREE
case VIBE:
vibe(d_frame, d_fgmask);
break;
#endif
case GMG:
gmg(d_frame, d_fgmask);