Create motion detection

motion detection code using running average background model