# A Line Segment Detector for Space Target Images Robust to Complex Illumination
## 4 Discussion
### The Complexity of ST_LSD  
For the ST_LSD algorithm, the computational cost mainly includes image preprocessing, anchor map extraction, active grouping, line segment validation, and line segment aggregation. We discuss the complexity by testing the computation time of the four algorithms. The computation times of LSD, EDlines, AG3 line, and ST_LSD are compared using the MNS-LS dataset. Linelet is only available for the MATLAB vision, while ST_LSD and the other three algorithms are implemented by Visual C ++ Compiler. It is unfair to use the C ++ version of ST_LSD to compare with Linelet. Therefore, in the comparison of computation time, ST_LSD only considers LSD, EDlines, and AG3 line running on the same hardware environment and the same compiler. The tests were performed on the same laptop with a Win10 system (Intel Core i7-8750H, 2.20 GHz CPU, and 16 GB RAM). To further reduce the error, we employed 30 tests for each image and took the average computation time as the final result. Figure 15 shows the computation times of the four methods on the MNS-LS dataset, where it can be seen that all of them processed each image within about 80 milliseconds (ms). AG3 line is the fastest, and the computation time is stable within 20-30 ms because its active grouping method reduces the computation time. ST_LSD ranks second, and its time distribution is also relatively stable. There are two reasons why ST_LSD is slower than AG3 line. First, ST_LSD introduces bilateral filtering to replace the original Gaussian filtering processing method. Bilateral filtering can keep image edge information well, but it also takes more time than Gaussian filtering. Second, the anchor map extraction method combined with Otsu adopted by ST_LSD also requires a certain computation time. But in general, ST_LSD achieves good performance in computation time, which is faster than the classical linear-time detector LSD and the optimized EDlines. The difference between the computation time of optimized EDlines and LSD is not very large, but their time distributions are not as stable as ST_LSD. The optimized EDlines has a significantimprovement in the detection effect, which overtakes the traditional LSD, but it does not maintain the advantage of fast and real-time computing time, and, on the other hand, it is a little slower than LSD. Our experimental results demonstrate that ST_LSD can perform well under complex illumination conditions and noise interference. The introduced bilateral filtering method can maintain the edge information of the image well, the anchor map extraction method combined with Otsu can be applied to complex illumination, and the aggregation method also has a certain effect on ensuring the integrity of line segments. Compared with traditional line segment detection methods, ST_LSD achieves a good balance in extracting complete line segments and controlling false positives. Moreover, it performs well in computation time. Of course, the traditional line detection method cannot avoid false alarms, and ST_LSD also produces certain false alarms in complex space environments. The causes of false alarms are mainly the following three: (1) the dramatic change in illumination affects the extraction of anchor points, resulting in too few anchor points; (2) a change in anchor density in the line segment validation phase; and (3) some fixed threshold parameters in the line segment aggregation phase. In general, ST_LSD has a good improvement in detection precision and visual effects. In addition, it cannot be ignored that other traditional detectors have their own advantages: (1) LSD does not need parameter adjustment and can control certain false positives; (2) EDlines has a fast computation time and can run in real time.