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

refactored FGD algorithm

This commit is contained in:
Vladislav Vinogradov
2013-05-07 12:04:21 +04:00
parent 697793090d
commit 62edeeed16
8 changed files with 459 additions and 532 deletions
+4 -5
View File
@@ -78,7 +78,7 @@ int main(int argc, const char** argv)
Ptr<BackgroundSubtractor> mog = gpu::createBackgroundSubtractorMOG();
Ptr<BackgroundSubtractor> mog2 = gpu::createBackgroundSubtractorMOG2();
Ptr<BackgroundSubtractor> gmg = gpu::createBackgroundSubtractorGMG(40);
FGDStatModel fgd_stat;
Ptr<BackgroundSubtractor> fgd = gpu::createBackgroundSubtractorFGD();
GpuMat d_fgmask;
GpuMat d_fgimg;
@@ -103,7 +103,7 @@ int main(int argc, const char** argv)
break;
case FGD_STAT:
fgd_stat.create(d_frame);
fgd->apply(d_frame, d_fgmask);
break;
}
@@ -142,9 +142,8 @@ int main(int argc, const char** argv)
break;
case FGD_STAT:
fgd_stat.update(d_frame);
d_fgmask = fgd_stat.foreground;
d_bgimg = fgd_stat.background;
fgd->apply(d_frame, d_fgmask);
fgd->getBackgroundImage(d_bgimg);
break;
}