## 2 Materials and Methods
### The Functions Required by the Visually Impaired People
#### 2.2.3 The Selection of Walking Direction  
In this study, the semantic segmentation defines the sidewalk and crosswalk with blue and green colors, respectively, as walkable areas. Since the ZED 2 is mounted on the user's cap and suppose the user's height is H (unit: m). Then the bottom width of the captured image field of view is about 3.52 \(\times\) H meters (when the user looks forward). We split the image evenly into seven divisions from left to right (see Figure 5) and number them from 0 to 6. For example, when the H is 1.7 m, each division has a width of about 3.52 \(\times\) H/7 = 0.86 m which is wide enough for a person to go through. We plan to select the most suitable division from these seven divisions to be the suggested direction for guiding the visually impaired user to walk in. The Fast-SCNN identifies the walkable areas, and the ZED 2 provides the depth map for the user. Hence, based on the seven divisions, the next task is to guide the visually impaired user to walk in a safe direction. We define two variables \(Conf_{s}\) and \(Conf_{d}\), to determine the walkability confidence index for seven divisions. \(Conf_{s}\) is the confidence from the segmentation result, and \(Conf_{d}\) is the confidence from the depth map. Now let us introduce the calculation of \(Conf_{s}\) first. Taking Figure 5 as an instance, we binaries the pixel value in the walkable area to 1 and others to 0. The closer the position is to the bottom of the image, the closer it is to the user in the actual field. We define that the pixels closer to the bottom have a higher weight value, and the weight value from the bottom to the top of the image decreases linearly from 2 to 0. Therefore, the pixel values will be weighted by the spatial distance. Since the image is divided into seven equal divisions, as shown in Figure 5, the average weighted pixel value of all pixels in each division will be within [0,1], and that will be regarded as the confidence degree \(Conf_{s}\) of that division, where \(Conf_{s}\) is computed from (3). \[Conf_{s}=\frac{1}{N}\sum\limits_{i}\sum\limits_{j}w(i,\ j)*p(i,\ j) \tag{3}\]  
where \(w(i,j)\) is the weight and \(p(i,j)\) is the pixel value of the position \((i,j)\) in a division. \(N\) is the total number of pixels in the division. For instance, the third division from the right in Figure 5 contains large green and blue areas, so its confidence degree is 0.79, the largest in the seven divisions. The rightmost division has a tiny green area, so its \(Conf_{s}\) = 0.04 is very low. In other words, the direction shown in the third division from the right is most walkable. Next, let us consider the calculation of \(Conf_{d}\). According to the openness value \(Open(i,j)\) in (2), we can calculate a confidence degree based on the depth map. In each  
Figure 5: Seven divisions with \(Conf_{s}\). division, the average weighted openness value is computed from (4) and will be regarded as the confidence degree \(Conf_{d}\) of the depth map. \[Conf_{d}=\frac{1}{N}\sum_{i}\sum_{j}Open(i,\ j) \tag{4}\]  
If there is a pixel with \(M_{d}(i,j)=-\infty\), the \(Conf_{d}\) must be \(-\infty\). For instance, in Figure 6, there is \(Conf_{d}\) value for each division, and \(Conf_{d}=-\infty\) in the middle division because there is a tree very close to the user. After we have values of \(Conf_{s}\) and \(Conf_{d}\) for each division, the walkability confidence degree \(Conf\) in each division is computed from (5). \[Conf=\text{minimum}(Conf_{s},Conf_{d}) \tag{5}\]  
Based on (5), we have three confidence degrees on the bottom of each division, as shown in Figure 7, where the first, second, and third rows denote the values of \(Conf_{s}\), \(Conf_{d}\), and \(Conf\), respectively. The \(Conf\) value will be the critical value to determine the walkability confidence index of each division. For instance, in image (a) of Figure 7, there is no sidewalk or crosswalk, almost all divisions with \(Conf_{s}=0\), and there are close balusters in front of the user, then all divisions with \(Conf_{d}=-\infty\).