The Mixture of Gaussians approach
Before we talk about Mixture of Gaussians (MOG), let's see what a mixture model is. A mixture model is just a statistical model that can be used to represent the presence of subpopulations within our data. We don't really care about what category each data point belongs to. All we need to do is identify whether the data has multiple groups inside it. Now, if we represent each subpopulation using the Gaussian function, then it's called Mixture of Gaussians. Let's consider the following image:
Now, as we gather more frames in this scene, every part of the image will gradually become part of the background model. This is what we discussed earlier as well. If a scene is static, the model adapts itself to make sure that the background model is updated. The foreground mask, which is supposed to represent the foreground object, looks like a black image at this point because every pixel is part of the background model.
Note
OpenCV has multiple algorithms implemented...