This code was written in response to Assignment 1, available at http://www.cse.iitd.ernet.in/~sumantra/courses/ml/assignment_1.html
It uses adaptive gaussian mixture model for background substraction. Literature for the algorithm is available at http://www.ai.mit.edu/projects/vsam/Publications/stauffer_cvpr98_track.pdf
Unhappy with the implementation in python (https://github.com/vinaym815/Python-Grimson-Stauffer) I wrote this script in c++ for better performance.