This paper presents a disparity calculation algorithm based on stereo-vision for obstacle detection and free space calculation. This algorithm incorporates line segmentation, multi-pass aggregation and efficient local optimisation in order to produce accurate disparity values. It is specifically designed for traffic scenes where most of the objects can be represented by planes in the disparity domain. The accurate horizontal disparity gradient for the side planes are also extracted during the disparity optimisation stage. Then, an obstacle detection algorithm based on the U–V-disparity is introduced. Instead of using the Hough transform for line detection which is extremely sensitive to the parameter settings, the G-disparity image is proposed for the detection of side planes. Then, the vertical planes are detected separately after removing all the side planes. Faster detection speed, lower parameter sensitivity and improved performance are achieved comparing with the Hough transform based detection. After the obstacles are located and removed from the disparity map, most of the remaining pixels are projections from the road surface. Using a spline as the road model, the vertical profile of the road surface is estimated. Finally, the free-space is calculated based on the vertical road profile which is not restricted by the planar road surface assumption. 
Robust obstacle detection based on a novel disparity calculation method and G-disparity