Optical flow and object detection