1. A method for estimating free space near a moving object from a sequence of images in a video acquired of a scene by a camera system arranged on the moving object, comprising for each image in the video the steps of: constructing a one-dimensional graph, wherein each node in the graph corresponds to a column of pixels in the image; determining features in the image; constructing an energy function on the graph based on the features; and using dynamic programming to maximize the energy function to obtain a curve, wherein an area under the curve defines the free space, and wherein the steps are performed in a processor.