Distance and velocity estimation using optical flow from a monocular camera