Introduction - If you have any usage issues, please Google them yourself
The algorithm similar to the standard Stauffer&Grimson algorithm with additional selection of the number of the Gaussian components based on:
"Recursive unsupervised learning of finite mixture models "
Z.Zivkovic, F.van der Heijden
The code is very fast and performs also shadow detection. Number of Gausssian components is adapted per pixel.