# Line-Detection Based on the Sum of Gradient Angle Differences
## 4 Line-Detection Experiments with Simulated Images
### Special Simulation Tests  
In the experiments conducted with the simulation images, line pixels were detected using the SD-, EC-, and SGAD-based methods from the pixels located within half of each line width from the true center lines of the simulation line features. For implementing the SD-based method, SD values at the pixels were calculated, and the pixels were classified as ridge or valley according to their \(RV\) values calculated using (15). Then, non-maxima suppression was applied to the image containing the SD values, as described in Section 3.3, where SD values were used instead of SGAD values. The experiment with the SGAD-based method followed the procedure described in Section 3. The only parameter to be set for implementing SGAD is the SGAD threshold. In the present study, the threshold value was set to \(\pi\). Thus, line pixels were detected when the SGAD value was greater than \(\pi\). Experiments with the EC-based method counted the cases of maximum and minimum of each pixel as compared to the intensities of its neighborhood pixels in four pairs of directions. Further, if the count of the number of maximum or minimum cases of each pixel was greater than or equal to 2, the pixel was classified as ridge or valley, respectively. Thus, the EC-based method classified certain pixels as both ridge and valley. Non-maxima suppression was not applied to the EC images in the EC-based method because EC is not a good measure for non-maxima suppression. Figure 5 shows the typical line-detection results obtained with varying \(\sigma_{n}\), \(w\), and \(\theta\). As shown in Figure 5a-c, the SD-, EC-, and SGAD-based methods produce accurate line-detection results for \(\sigma_{n}=10/255\), \(w=2\), and \(\theta=30^{\circ}\). However, as shown in Figure 5d-l, the EC- and SGAD-based methods produce more accurate line-detection results than the SD-based method. Furthermore, as shown in Figure 5g,j, the SD-based method bifurcates the line location when \(w=8\). By contrast, as shown in Figure 5h,i,k,l, the EC- and SGAD-based methods are not affected by the bifurcation problem. Based on a detailed comparison of the performance of the EC- and SGAD-based methods, according to Figure 5e,f,h,i,k,l, the SGAD-based method produces more accurate line-detection results than the EC-based method in terms of the detected line locations and the number of fragmentations. Figure 6 compares the performance of the SD-, EC-, and SGAD-based methods in terms of the root mean square error (RMSE) of the detected positions for varying \(\theta\), \(w\), and \(\sigma_{n}\). The graphs have different scales depending on \(w\). However, the graphs for \(w=6\) and \(w=8\) have the same scale. As shown in Figure 6a-d, the performance of the SD-, EC-, and SGAD-based methods are comparable for \(w=2\) with \(\sigma_{n}=10/255,30/255\), and \(60/255\) and for \(w=4\) with \(\sigma_{n}=10/255\). However, as shown in the rest of the panels of Figure 6, the SD-based method yielded line-detection  
Figure 5: Detection results of second-derivatives (SD)-, extremity-count (EC)-, and sum of gradient angle differences (SGAD)-based methods for simulated images with (**a–c**) noise strength \(\sigma_{n}=10/255\), line width \(w=2\), and line normal angle \(\theta=30^{\circ}\); (**d–f**) \(\sigma_{n}=30/255\), \(w=6\), and \(\theta=25^{\circ}\); (**g–i**) \(\sigma_{n}=30/255\), \(w=8\), and \(\theta=75^{\circ}\); and (**j–l**) \(\sigma_{n}=60/255\), \(w=8\), and \(\theta=15^{\circ}\). (column 1) SD-, (column 2) EC-, and (column 3) SGAD-based line-detection approaches. The red lines indicate the true center lines of the simulated line features. results with RMSEs greater than those of the results yielded by the EC- and SGAD-based methods. This limitation of the SD-based method is ascribed to bifurcation of the SD values when the line width is relatively large.