# A Low Cost Vision-Based Road-Following System for Mobile Robots
## 4 Road Detection System
### Fusion Module with UKF  
The borders detected by the color-based and the texture line detector are fused by a weighted average algorithm. From both modules, metrics are calculated to estimate a value of trust. The detected borders have more confidence and therefore a larger weight when the value of trust is high. The weight that every border will take is computed from metrics and it is updated in every cycle. (1) Metrics of the color-based road detector  
There is a fixed number of rows in every image, and we expect to find a border of the road in every row. The border is represented as a black circle in the following image; see Figure 9. The black circles are computed in the segmentation process. The trust value \(T_{color}\) of the color-based road detector is computed using (5). \[T_{color}=\frac{\text{Number of circles}\times 100}{2\times\text{Number of rows}} \tag{5}\]  
As indicated in (3), if the number of circles is the same as the number of rows in an image; the road is 100% detected in that image. Therefore, it will have a high trust value. On the other hand, if the number of circles is very low in an image, it means that the road is hardly detected. In this case, the trust value will be low, see Figure 10.  
Figure 8: Texture line detector. (**a**) IPM image. (**b**) Lines obtained from the Hough transform after canny edge detector. (**c**) Detected road borders. Figure 7: Computed camera parameters from the pattern in the image. (2) Metrics of the texture line detector  
After the IPM mapping and the canny edge detection, the Hough transform will compute the more likely vertical lines. These lines will be distributed over the image and will be grouped into left and right. The distribution of these lines will tell us the quality of the borders and therefore the trust value. Since the input image for line detection is the IPM image, which is scaled to 1 pixel (1 cm), the lines can have a maximum distribution of 320 pixels. Therefore, the line distribution means the number of lines that are detected by canny edge detection. The trust value \(T_{texture}\) of the texture line detector is computed by using (6). There will be two weights: one weight for the left border and the other one for the right border. Both weights are computed with (6). \[T_{texture}=100\%-\frac{\text{Lines distribution}\times 100}{\text{Number of columns}/2} \tag{6}\]  
in which the number of columns is 640. A greater distribution of the lines in the image will have a low trust value, and a small distribution of the lines will have a high trust value, see Figure 11.  
After having computed the weights of the color-based road detector and texture line detector, the detection results are fused together. The fusion algorithm is a weighted average. The algorithm is expressed by using (7). \[F=\beta\times\frac{T_{color}}{T_{color}+T_{texture}}+\gamma\times\frac{T_{ texture}}{T_{color}+T_{texture}} \tag{7}\]  
in which \(F\) is the fusion line, \(\beta\) is the color-based line, \(\gamma\) is the texture line. Figure 11: Lines used to compute the metrics. Left lines (orange), high distribution, low confidence. Right lines (green), low distribution, high confidence. Figure 9: Black circles are used to compute the metrics. The UKF is implemented to estimate and track the road borders. In the Kalman filter, two main steps rule the process. One is the measurement update step, where the measured signal is the combination of both modules, and a time update state, where the borders are estimated based on the motion model of the robot. The estimation of the road borders is governed by the estimation of UKF [25]. The main idea behind the UKF is to obtain the best estimation of the borders from the measure and the movement of the robot. In the presented approach, the motion model of the lines is a non-linear function. It has been demonstrated that the UKF has a substantial performance gain in the context of state estimation for nonlinear systems compare with the Extended Kalman Filter (EKF).