## 5 Conclusions  
This paper proposes a method for positioning a fastener-nut disassembly and assembly robot in complex environments of ballasted railways, aiming to achieve the intelligent maintenance of fasteners. Firstly, the working mechanism of the robot was described, and it was established that spiral rail spikes would serve as the positioning targets. Then, by improving the Canny algorithm, the edge details of the abnormal surface state of the road stands were better captured, resulting in a road stud circular fitting success rate higher than 98%. Finally, by analyzing the texture and shape features of the rail spike area, a method combining HOG feature vectors and SED to determine the similarity of shape features for rail spike area screening was proposed, which eliminated the interference of background, such as ballast, during the localization process. The algorithm has a correct screening rate higher than 98%, with an average positioning error of 0.9 mm, making it suitable for on-site nut and bolt removal robot operations.  
This paper presents a method that can provide solutions for the intelligent operation of railway-related robots, but it still has certain limitations. In the next phase of research, it is necessary to consider the positioning effect when there is partial occlusion on the surface of spiral nails and the phenomenon where the image becomes blurred due to camera or robot movement, leading to a decrease in positioning accuracy.  
Figure 17: Railway environment rail spike center positioning results: (a) railway ballast interference; (b) water stain interference; (c) water stain interference, shifted to the right; (d) rust interference; (e) rust interference, uneven lighting; (f) oil stain interference, shifted to the left; (g) oil stain interference, background noise; (h) special environment.  
**Author Contributions:** Conceptualization, M.Z. and X.C.; methodology, M.Z.; software, M.Z.; validation, G.C., X.W., P.W. and Y.L.; formal analysis, M.Z.; investigation, M.Z.; resources, X.W.; data curation, M.Z.; writing--original draft preparation, M.Z.; writing--review and editing, [PERSON] and X.W.; visualization, M.Z.; supervision, P.W.; project administration, X.C.; funding acquisition, X.C. All authors have read and agreed to the published version of this manuscript.  
**Funding:** The research was supported by the Shaanxi Provincial Natural Science Basic Research Program (2023-JC-YB-362), the Natural Science Research Project of the Department of Education of Shaanxi Province (23 JK0548) and the Key Research and Development Program of Shaanxi Province (2024 GX-YBX-524).  
**Institutional Review Board Statement:** Not applicable.  
**Informed Consent Statement:** Not applicable.  
**Data Availability Statement:** The datasets presented in this article are not readily available because the data are part of an ongoing study, and it requires a significant amount of time and labor to collect data in the railway engineering section. Requests to access the datasets should be directed to [PERSON] at [EMAIL_ADDRESS].  
**Acknowledgments:** The authors would like to acknowledge the Shaanxi Provincial Natural Science Basic Research Program, the Natural Science Research Project of the Department of Education of Shaanxi Province and the Key Research and Development Program of Shaanxi Province.  
**Conflicts of Interest:** The authors declare no conflicts of interest.