This function calculates the mean of all previous frames and obtains the #'foreground by subtracting the mean from the current frame. All n-1 frames are #'taken into consideration at nth iteration.
meanbgs(b, thresh)
3-D matrix containing grayscaled video frames.
threshold required to obtain foreground images.Its value can lie between 30 40 or more depending upon accuracy of results.
A 3-D matrix of frames containing foreground obtained after background #'subtraction is applied(binary images).