Computing the optical flow