added some things to the optical flow to have it work in grayscale