title: Difference between foreground-background segmentation methods in OpenCV
body: <p>OpenCV version 2.4.5 offers several different implementations that can be used for tracking moving objects that use statistical methods to estimate background. OpenCV has <code>BackgroundSubtractorMOG</code>, <code>BackgroundSubtractorMOG2</code> classes implemented on CPU. In addition, it has GPU implementations of <code>BackgroundSubtractorMOG</code> and <code>BackgroundSubtractorMOG2</code>, namely <code>gpu::MOG_GPU</code> and <code>gpu::MOG2_GPU</code> respectively. There are also two other algorithms <code>gpu::GMG_GPU</code> and <code>gpu::FGDStatModel</code>. </p>
  
  <p>In my application I want to segment out moving objects as soon as they enter the scene. I'd like to avoid false positives such as shadows. These 4 algorithms seem to focus on the same goal -- they separate background from foreground by creating a model of the background over time. I was wandering if someone who had experience with these implementations can help me to decide which (GPU) implementation to use. How these algorithms -- MOG, MOG2, GMG and FGDStatModel -- differ from each other? What are the advantages of using one or the other algorithm? How do these implementations compare in terms of speed, ability to configure their parameters, accuracy, shadow detection (false positive), etc? </p>