## 2 Materials and Methods
### Complex Terrain Recognition
#### 2.3.2 Image Infilling for Mixed Terrain  
After the first round of classification, both the terrain label and confidence score of the classified image are obtained. In SVM, the confidence score represents the geometric interval between the classified image and the hyperplane of each terrain type. Therefore, the confidence score needs to be normalized before conducting an analysis. The confidence score is adjusted to the interval [0, 1] to facilitate the comparison. Set \(S_{d}\) contains the confidence scores of all terrain types, and \(d_{i}\) is the confidence of the test image that corresponds to \(i\) terrain class before normalization. Set \(S_{D}\) contains confidence scores after normalization and \(D_{i}\) is normalized confidence. Therefore, after normalization we get  
\[S_{D}=\{D_{i}|D_{i}=|d_{i}|/\sum_{i=1}^{6}|d_{i}|,i=1,2,\dots,6\}. \tag{10}\]  
Moreover, a pie chart of confidence scores after normalization can clearly demonstrate the contribution of each terrain type. A pie chart of confidence scores after the first round of classification is shown in Figure 8. In the images of single terrain, the weight of single terrain is much higher than the weights of other terrains. A series of experiments demonstrated that if the highest terrain weight is larger than 30% and more than 10% higher than the second highest weight, the terrain can be considered as a single terrain. Otherwise, it is mixed terrain. For mixed terrain, it is difficult to identify the category from weights in the pie chart. In addition, it is important to note that mixed terrain usually appears at the intersection of different terrains. The traditional methods are not practical for images that contain two or more terrain types, because only one label will be notified. Obviously, some approaches can identify the boundaries of different terrains in an image and then make the decision. Actually, it is difficult to accurately determine terrain boundaries and the algorithm needs to do many computations, which causes poor real-time performance that affects the robot's outdoor walking. In the process of the robot moving in a forward direction, the terrain type is gradually changing. Different \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Images with** & **Oblack** & **Oblack** & **Oblack** & **Oblack** & **Oblack** & **Oblack** & **Oblack** \\
**Obstacle** & **Oblack** & **Oblack** & **Oblack** & **Oblack** & **Oblack** & **Oblack** & **Oblack** \\ \hline First round & Asphalt & Asphalt & Asphalt & Asphalt & Asphalt & Asphalt \\ Actual terrain & Grass & Grass & Grass & Grass & Grass & Gravel \\ White & Asphalt & Asphalt & Tile & Tile & Tile \\ Black & Asphalt & Asphalt & Asphalt & Tile & Tile \\ Terrain & Grass & Grass & Grass & Grass & Gravel \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Classification results of first round and after image local infilling (ILI). Figure 7: ILI samples: (**a**) image sample; (**b**) local white; (**c**) local black; (**d**) local terrain. types of terrain appear in up and down form in the images. Taking this into consideration, a new method for identification of mixed terrain based on super-pixel image infilling (SPI) is presented. In the field of image segmentation, super-pixel has become a fast-developing image preprocessing technology. [PERSON] et al. (2015) first proposed the concept of super-pixels, which quickly divide images into a number of subareas that have image semantics. Compared with the traditional processing method, the extraction and expression of super-pixels are more conducive to collecting local characteristics of the image information. It can greatly reduce the calculation and subsequent processing complexity. Existing segmentation algorithms generally restrict the number of pixels, the compactness, the quality of segmentation, and the practicability of algorithms. [PERSON] et al. (2016) evaluated the existing super-pixel segmentation algorithms.