added GMG background segmentation algorithm by Andrew Godbehere, ticket #2065
[profile/ivi/opencv.git] / modules / video / src / video_init.cpp
index 91c215b..04b9a8d 100644 (file)
@@ -64,11 +64,28 @@ CV_INIT_ALGORITHM(BackgroundSubtractorMOG2, "BackgroundSubtractor.MOG2",
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////////////
 
+CV_INIT_ALGORITHM(BackgroundSubtractorGMG, "BackgroundSubtractor.GMG",
+                  obj.info()->addParam(obj, "maxFeatures", obj.maxFeatures,false,0,0,
+                                       "Maximum number of features to store in histogram. Harsh enforcement of sparsity constraint.");
+                  obj.info()->addParam(obj, "learningRate", obj.learningRate,false,0,0,
+                                       "Adaptation rate of histogram. Close to 1, slow adaptation. Close to 0, fast adaptation, features forgotten quickly.");
+                  obj.info()->addParam(obj, "initializationFrames", obj.numInitializationFrames,false,0,0,
+                                       "Number of frames to use to initialize histograms of pixels.");
+                  obj.info()->addParam(obj, "quantizationLevels", obj.quantizationLevels,false,0,0,
+                                       "Number of discrete colors to be used in histograms. Up-front quantization.");
+                  obj.info()->addParam(obj, "backgroundPrior", obj.backgroundPrior,false,0,0,
+                                       "Prior probability that each individual pixel is a background pixel.");
+                  obj.info()->addParam(obj, "smoothingRadius", obj.smoothingRadius,false,0,0,
+                                       "Radius of smoothing kernel to filter noise from FG mask image.");
+                  obj.info()->addParam(obj, "decisionThreshold", obj.decisionThreshold,false,0,0,
+                                       "Threshold for FG decision rule. Pixel is FG if posterior probability exceeds threshold."));
+    
 bool initModule_video(void)
 {
     bool all = true;
     all &= !BackgroundSubtractorMOG_info_auto.name().empty();
     all &= !BackgroundSubtractorMOG2_info_auto.name().empty();
+    all &= !BackgroundSubtractorGMG_info_auto.name().empty();
 
     return all;
 }