The code below selects a frame from a video which is than subtracted with a background frame selected from the same video. It is then converted to grayscale, blurred, and th