Road Geometry Reconstruction The binary image is thinned and scanned row by row in order to build chains of non-zero pixels. Each chain is approximated with a polyline made of one or more segments, by means of an iterative process; at first the two extrema of the polyline are determined At each step of the process the segment being considered is kept as a part of the polyline if the horizontal distance between its middle point and the chain is sufficiently small; otherwise two consecutive segments are examined in its place. To get rid of possible occlusions or errors caused by noise, two or more polylines are joined into longer ones if they satisfy some criteria such as small distance between the nearest extrema and similar orientation of the ending segments. When more solutions are possible in joining the polylines, all of them are considered. A road model is used to select the polyline which most likely matches the center road line. Initially the vehicle is assumed to be a specific position (center of the lane) on the road, which, at the same time, is assumed to be almost straight. In this situation the road center line in the remapped image is a straight vertical line that is expected to be found in a circumscribed area of the remapped image. Each computed polyline is matched against this model using several parameters such as distance, parallelism, orientation, and length. The polyline that fits better these required parameters is selected (figure 3.e). Finally a new road model is computed using the selected polyline, thus enabling the system to track the road in image sequences and to adapt the road model also to non-straight roads.   Figure 3: The different steps of Lane Detection: (a) enhanced image; (b) binarized image; (c) concatenation of pixels; (d) segmentation and construction of polylines (e) identification of the centre of the lane; (f) superimposition of the previous result onto a brighter version of the original image for displaying purposes only   Since the model assumed for the external environment (flat road) allows to determine the spatial relationship between image pixels and the 3D world[4], from the previous result it is possible to derive both the road geometry and the vehicle position within the lane. Fig. 3 shows the steps of lane detection for the image shown in figure 2. Thanks to the IPM transform, the approach has demonstrated its robustness also in the case of shadows, which represents a typical critical condition[9].