Implemen the algorithm of background subtraction

algorithm 2
algorithm 4