This functions creates a gaussian background model using the previous grayscale frames. gaussian parameters (i.e mean and variance) are updated after every new frame is encountered.
guassianbgs(b, thresh)
3-D matrix containing grayscaled video frames.
threshold required to obtain foreground images. Its value can be set around 3.5 - 4.5 depending upon the accuracy.
A 3-D matrix of frames containing foreground obtained after background subtraction is applied(binary images).