# Accurate and Detailed Transversal Road Section Characteristics Extraction Using Laser Scanner
## 2 Algorithm
### Lane Lines Detection Function  
From this first detection of the roadway, we proceed to the determination of the number of lanes, the lane through which the vehicle moves, and the lateral position of the vehicle in the lane. This function can be divided into the following steps:  
Step 1: On the area definition belonging to the roadway, it is possible to fit mathematical curves at each of the intersections of the layers of the laser scanner with the ground. The intersections of laser scanner layers and the ground form conics (in general, ellipses, parabolas and hyperbolas). Considering the common positioning of the scanner on vehicles, the intersection uses ellipses, so a least-square fitting method is applied to obtain the conical parameters. The points that fall away from this curve cannot be considered to belong to the roadway, but to obstacles on it, which allows them to be removed from the points set (Figure 4). Step 2: Then, on the filtered point set, those points that show a greater reflectivity are extracted, having checked experimentally the remarkable contrast in this variable between the asphalt and the lines that delimit the lanes. Step 3: On these points, geometric considerations are applied in order to eliminate false signals due to irregularities on the asphalt with high reflectivity that do not correspond to the road markings of lane delimitation. In this way, it is considered that, for the same layer, the dispersion of valid contiguous points must be small in the longitudinal direction, and large in transverse, if they are detected in front or behind the vehicle, and vice versa if they are located on the sides, due to the shape of the intersection curve of the layer with the ground. Figure 5 shows the output of steps 2 and 3 on a scanner frame. In most cases, a filtering process for this last step is not necessary because step 1 provides quite a good set of selected points, so few false points are considered after Step 2. Step 4: The points clustering belonging to the same lane delimitation is done using knowledge of the relative orientation of the road with the vehicle (extracted from the previous function of road boundaries detection), and regions of interest are established around each set of points that, by proximity criteria, are considered to correspond to the same line. These regions of interest maintain the longitudinal direction of the points set, and extend a distance such that, considering the regulations about horizontal road markings, they must intersect if they correspond to the same line (Figure 6a). Step 5: When points that may belong to the delimitation of lanes are detected but there is not enough data to establish the orientation of the area of interest, we proceed to generating new areas with the average orientation of those areas in which the density of nearby points allowed for the  
Figure 4: Example of curve fitting to points of intersection of the layers of the laser scanner and the ground. (**a**) Total set of points (yellow); (**b**) Filtered points (red). calculation (green areas in Figure 6b). It must be taken into account that, with the knowledge of the expected lane width, it is possible to determine if those isolated points can be part of a lane line or not. Additionally, the lane where the ego-vehicle is usually provides more information, although this is not necessarily true, due to possible occlusions of obstacles on the roadway. Step 6: Then, we proceed to adjust the sets of points corresponding to lane delimitation lines. To do this, we proceed to a fitting process using quadratic polynomials, since they are considered to approximate reality [30]. Additionally, conditions of parallelism between the lines are considered, so equality conditions are imposed on linear and quadratic terms of the polynomials, as shown in Equation (1) for the curve equation representing lane line \(i\) (only coefficient \(a_{i}\) varies from one line to another, but \(b\) and \(c\) are equal for all of them).