# Semi-Automatic Method of Extracting Road Networks from High-Resolution Remote-Sensing Images
## 2 Materials and Methods
### Methodology
#### 2.2.1 Interactive Single-Road Extraction
The intersection connection algorithm is shown in Algorithm 3:  
Input: **Lines** Roads  
Output: **addLines** Newly added connection roads  
```
1:functionaddJunctionLines(Lines, addLines)
2:BEGIN
3:Ver = FindVertex(Lines);
4:Ver_theta = FindVertexAzimuth(Lines);
5:for i \(\gets\) 0 to Ver.size()
6:BEGIN
7:extendline.push_back(Ver(i));
8:extendpoint = cal_coordinate(Ver(i), Ver_theta(i), dt);
9:extendline.push_back(extendpoint);
10:for j \(\gets\) 0 to Lines.size()
11:BEGIN
12:if (intersects(Lines(j), extendline))
13:BEGIN
14:intersect_geo = intersection(Lines(j), extendline);
15:intersect = intersect_geo-> asPoint();
16:if (Ver(i)\(\
eq\)intersect)
17:BEGIN
18:temp_polyline.push_back(Ver(i));
19:temp_polyline.push_back(intersect);
20:addLines.pushback(temp_polyline);





The function cal_coordinate(Ver(i), Ver_theta(i), dt) is used to calculate the vertex of the extension line of limited length; intersects(Lines (j), extendline) is used to determine whether there is an intersection; and intersection(Lines (j), extendline) is used to calculate the intersection. After multiple roads are extracted separately and all road endpoints are judged and connected, a buffer zone with a radius that is one-half the width of the road is generated to obtain the road network (see Figure 14). #### 2.2.3 Evaluation of the Extraction Results

In this method, the precision, accuracy, recall, and intersection over union (IoU) [50; 51] are used to evaluate extraction performance, see Equations (10)-(14). In the formulas, TP, FP, FN, and TN are the number of true positives, false positives, false negatives, and true negatives for the road predictions. Figure 3:1

Figure 3:2

Figure 3:3

The IoU is the ratio of the intersection and the union of two bounding boxes. If A is the resulting extracted road and B is the corresponding ground truth, then the IoU is:

Figure 3:4

TP, FP, and FN are used to re-state the formula as follows:

If the extraction result is identical to the ground truth, then IoU is equal to 1. Figure 3:5

## 3 Results

### Parameter Settings

In this study, only three parameters need to be set in the workflow of road network extraction: the image resolution, regional growth threshold, and simplifying threshold. The image resolution can be obtained directly from the data source. Since the difference in gray value between urban buildings and roads is small, the regional growth threshold needs to be determined by the user according to the number of buildings shown in the

Figure 3:6 A road network obtained through a buffer zone. image. After a large number of experiments, the regional growth threshold was set to 40 in suburbs with fewer buildings, and 20 in cities with more buildings. As shown in Equation (8), the simplifying parameter k has a significant impact on the simplified result. Based on experiments, the simplifying parameter k is set to 3. Figure 15 shows the results of different simplifying thresholds for an image with the same type as Data 2; (a) is the tracking result, and (b-d) are the simplified results when the simplifying parameter k is 1, 3, and 5, respectively. When k = 1, redundant points remain in the circle. When k = 5, some key points are missing, and the centerline in the circle deviates from the road. When k = 3, the result fits the road centerline well. Hence, the simplifying parameter k is set to 3 here. ### Road Extraction Results for the Four Datasets

Figure 16 shows a comparison between the road extraction result and the ground truth, where (a,e) correspond to Data 1, (b,f) correspond to Data 2, (c,g) correspond to Data 3, and (d,h) correspond to Data 4; (a-d) are extracted by the developed method to generate road networks, and (e-h) are ground truths that are manually labeled. The evaluation results are shown in Figure 3:7 These extraction results have high accuracy and precision of Data 1-3, showing that the method applies well in extracting roads from images at different resolutions.