Optical flow for speed detect