A general optical flow based terrain