Track Line Recognition Based on Morphological Thinning Algorithm †
Abstract
:Featured Application
Abstract
1. Introduction
2. Related Work
3. Methods
3.1. Image Preprocessing
3.2. Improved ZS Thinning Algorithm
- (1)
- In the binary image obtained after the preprocessing described in Section 3.1, the algorithm looks for 8-neighborhoods centered on the boundary point, denotes the center point as P1, and the adjacent points in the clockwise direction as P2, P3,..., P9, where P2 is directly above P1, as shown in Figure 6a.
0 | 1 | * | * | 1 | 0 | * | 0 | 0 | 0 | 0 | * | |||
1 | 1 | 0 | 0 | 1 | 1 | 1 | 1 | 0 | 0 | 1 | 1 | |||
* | 0 | 0 | 0 | 0 | * | 0 | 1 | * | * | 1 | 0 |
- (2)
- Extraction of redundant points. In order to facilitate the extraction of redundant points, the 8-neighborhood points of P1 are binary coded in clockwise order in Step (1). P2, P3,..., P9 correspond to one binary bit. If the neighborhood point value is 1, the corresponding binary bit is 1. If the neighborhood point value is 0, the corresponding binary bit is 0. As shown in Figure 8, the binary code corresponding to the eight neighborhoods of P1 is shown in Table 1.
- (3)
- Mark the points that meet all the following conditions:
- (4)
- Follow Step (3) and mark the points that meet all the following conditions:
- (5)
- Steps (3) and (4) constitute an iteration until no boundary points satisfy the marking conditions, and the area composed of the remaining points is the final result.
3.3. Denoising Algorithm
- (1)
- According to the length and area differences in track profile and side interference, find the minimum circumscribed rectangle of all profiles in , as shown in Figure 12a. The blue parts in the figure represent the generated rectangular boxes. It can be seen from the figure that there are various large and small rectangular boxes. By setting the threshold, we screen out the rectangular boxes that meet the conditions, and all the pixel values in the rectangular boxes in this part will be retained; the remaining pixels are then set to zero. This method can eliminate most noise points. The specific steps are as follows: The length of each minimum circumscribed rectangle in is . If is less than the threshold parameter λ1, all pixels in its domain are set to 0. If it is larger than the parameter, the first λ2 bits are reserved in order from large to small. Many experiments demonstrated that most noise points can be eliminated when λ1 ∈ (40, 50) and λ2 ∈ (12, 15), and the processed image is recorded as .
- (2)
- Morphological dilation is performed on using 3 × 3 structural elements to eliminate small patches, holes, small discontinuities, etc. The processed result is recorded as .
- (3)
- Remember that λ is the length-screening coefficient of the minimum circumscribed rectangle, and δ is the area-screening coefficient of the minimum circumscribed rectangle. According to the geometric properties of image , a filtering rule is defined:
3.4. Track Region Extraction Algorithm
- (1)
- Search for new pixels on the track line and match left and right in the transverse direction. After the initial point is determined in the first step, the new pixels satisfying the conditions are searched upward in the connected area of each track line Li (i = 1, 2, 3…) in the f(x,y) image, and all the points (match points) on the same transverse surface with the point are found on the left and right sides. At the same time, according to the trapezoidal characteristic of “near wide and far narrow” of the distance between the track lines, the maximum Dmax and minimum Dmin distance between the track lines are set, and the distance between the matching points is constantly updated in the process of matching from bottom to top, so as to reduce the mismatching rate. Considering the matching situation of track lines in complex side roads, this paper sets the limit that when the number of matching points on the same lateral surface exceeds the limit T number, the leftmost point is directly matched with the rightmost point to delimit the track area. By analogy, the track line is traversed from bottom to top, searching for all matching track lines.
- (2)
- Elimination of interference track lines. Not all the tracks in the image can match each other, and there will be tracks of different lengths. When searching for matching points on the track line, based on a large number of experiments, the track lines that can be fully matched are two or four matching points with little difference in the number of matching points (in the case of turnoff). Therefore, the most complete track lines are selected according to the number of matching points for the track area extraction.
- (3)
- The matching points on the track line are obtained, which is the complete track running area of the train.
4. Experiments and Results
5. Discussion
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Punekar, N.S.; Raut, A.A. Improving railway safety with obstacle detection and tracking system using GPS-GSM model. Int. J. Sci. Eng. Res. 2013, 4, 282–288. [Google Scholar]
- Kazanskiy, N.L.; Popov, S.B. Integrated design technology for computer vision systems in railway transportation. Pattern Recognit. Image Anal. 2015, 25, 215–219. [Google Scholar] [CrossRef]
- Liu, W.; Anguelov, D.; Erhan, D.; Szegedy, C.; Reed, S.; Fu, C.Y.; Berg, A.C. SSD: Single shot multibox detector. In Proceedings of the European Conference on Computer Vision, Amsterdam, The Netherlands, 11–14 October 2016. [Google Scholar]
- Redmon, J.; Divvala, S.; Girshick, R.; Farhadi, A. You only look once: Unified, real-time object detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Las Vegas, NV, USA, 26 June–1 July 2016. [Google Scholar]
- Uijlings, J.R.R.; Van De Sande, K.E.A.; Gevers, T.; Smeulders, A.W.M. Selective search for object recognition. Int. J. Comput. Vis. 2013, 104, 154–171. [Google Scholar] [CrossRef] [Green Version]
- He, Y.; Zhang, X.; Sun, J. Channel pruning for accelerating very deep neural networks. In Proceedings of the IEEE international Conference on Computer Vision, Venice, Italy, 22–29 October 2017. [Google Scholar]
- Hu, P.; Ramanan, D. Finding tiny faces. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Honolulu, HI, USA, 21–26 July 2017. [Google Scholar]
- Singh, B.; Najibi, M.; Davis, L.S. Sniper: Efficient multi-scale training. In Proceedings of the Advances in Neural Information Processing Systems, Montréal, QC, Canada, 3–8 December 2018; Volume 31. [Google Scholar]
- Shen, Y.; Dai, W.; Li, C.; Zou, J.; Xiong, H. Multi-Scale Graph Convolutional Network With Spectral Graph Wavelet Frame. IEEE Trans. Signal Inf. Process. Over Netw. 2021, 7, 595–610. [Google Scholar] [CrossRef]
- Huang, B.; Lin, H.; Hu, Z.; Xiang, X.; Yao, J. An improved YOLOv3-tiny algorithm for vehicle detection in natural scenes. IET Cyber-Syst. Robot. 2021, 3, 256–264. [Google Scholar] [CrossRef]
- Ren, M.; Triantafillou, E.; Ravi, S.; Snell, J.; Swersky, K.; Tenenbaum, J.B.; Larochelle, H.; Zemel, R.S. Meta-learning for semi-supervised few-shot classification. In Proceedings of the 6th International Conference on Learning Representations, Vancouver, BC, Canada, 30 April–3 May 2018. [Google Scholar]
- Rahman, S.; Khan, S.; Porikli, F. Zero-shot object detection: Learning to simultaneously recognize and localize novel concepts. In Proceedings of the Asian Conference on Computer Vision, Perth, Australia, 2–6 December 2018. [Google Scholar]
- Demirel, B.; Cinbis, R.G.; Ikizler-Cinbis, N. Zero-shot object detection by hybrid region embedding. In Proceedings of the British Machine Vision Conference 2018, Newcastle, UK, 3–6 September 2018. [Google Scholar]
- Ye, T.; Wang, B.; Song, P.; Li, J. Automatic railway traffic object detection system using feature fusion refine neural network under shunting mode. Sensors 2018, 18, 1916. [Google Scholar] [CrossRef] [PubMed] [Green Version]
- Sinha, D.; Feroz, F. Obstacle detection on railway tracks using vibration sensors and signal filtering using Bayesian analysis. IEEE Sens. J. 2015, 16, 642–649. [Google Scholar] [CrossRef]
- Kaleli, F.; Akgul, Y.S. Vision-based railroad track extraction using dynamic programming. In Proceedings of the 12th International IEEE Conference on Intelligent Transportation Systems, St. Louis, MO, USA, 4–7 October 2009. [Google Scholar]
- Gschwandtner, M.; Pree, W.; Uhl, A. Track detection for autonomous trains. In International Symposium on Visual Computing; Springer: Berlin/Heidelberg, Germany, 2010; pp. 19–28. [Google Scholar]
- Nassu, B.T.; Ukai, M. Rail extraction for driver support in railways. In Proceedings of the 2011 IEEE Intelligent Vehicles Symposium (IV), Baden-Baden, Germany, 5–9 June 2011. [Google Scholar]
- Qi, Z.; Tian, Y.; Shi, Y. Efficient railway tracks detection and turnouts recognition method using HOG features. Neural Comput. Appl. 2013, 23, 245–254. [Google Scholar] [CrossRef]
- Wohlfeil, J. Vision based rail track and switch recognition for self-localization of trains in a rail network. In Proceedings of the 2011 IEEE Intelligent Vehicles Symposium (IV), Baden-Baden, Germany, 5–9 June 2011. [Google Scholar]
- Berg, A.; Öfjäll, K.; Ahlberg, J.; Felsberg, M. Detecting rails and obstacles using a train-mounted thermal camera. In Proceedings of the Scandinavian Conference on Image Analysis, Copenhagen, Denmark, 15–17 June 2015. [Google Scholar]
- Espino, J.C.; Stanciulescu, B. Rail extraction technique using gradient information and a priori shape model. In Proceedings of the 15th International IEEE Conference on Intelligent Transportation Systems, Anchorage, AK, USA, 16–19 September 2012. [Google Scholar]
- Wu, H.; Siu, W.C. Real time railway extraction by angle alignment measure. In Proceedings of the 2015 IEEE International Conference on Image Processing (ICIP), Quebec City, QC, Canada, 27–30 September 2015. [Google Scholar]
- Nassu, B.T.; Ukai, M. A vision-based approach for rail extraction and its application in a camera pan–tilt control system. IEEE Trans. Intell. Transp. Syst. 2012, 13, 1763–1771. [Google Scholar] [CrossRef]
- Bettemir, Ö.H. Detection of railway track from image by heuristic method. In Proceedings of the 2015 23nd Signal Processing and Communications Applications Conference, Malatya, Turkey, 16–19 May 2015. [Google Scholar]
- Dong, Y.; Guo, B. Railway track detection algorithm based on Hu invariant moment feature. J. China Railw. Soc. 2018, 40, 64–70. [Google Scholar]
- Zou, R.; Fan, X.; Qian, C.; Ye, W.; Zhao, P.; Tang, J.; Liu, H. An efficient and accurate method for different configurations railway extraction based on mobile laser scanning. Remote Sens. 2019, 11, 2929. [Google Scholar] [CrossRef] [Green Version]
- Qiang, X.; Zhang, Z.; Chen, Q.; Wu, C.; Wang, Y. Video-based adaptive railway recognition in complex scene. In Proceedings of the 2016 International Conference on Audio, Language and Image Processing (ICALIP), Shanghai, China, 11–12 July 2016. [Google Scholar]
- Cai, S. Railway recognition based on edge detection. Railw. Comput. Appl. 2009, 25, 20. [Google Scholar]
- Otsu, N. A threshold selection method from gray-level histograms. IEEE Trans. Syst. Man Cybern. 1979, 9, 62–66. [Google Scholar] [CrossRef]
- Zhang, T.Y.; Suen, C.Y. A fast parallel algorithm for thinning digital patterns. Commun. ACM 1984, 27, 236–239. [Google Scholar] [CrossRef]
- Chen, W.; Sui, L.; Xu, Z.; Lang, Y. Improved Zhang-Suen thinning algorithm in binary line drawing applications. In Proceedings of the 2012 International Conference on Systems and Informatics, Yantai, China, 19–20 May 2012. [Google Scholar]
- Abu-Ain, T.; Abdullah, S.N.H.S.; Bataineh, B.; Omar, K. A Fast and Efficient Thinning Algorithm for Binary Images. J. ICT Res. Appl. 2013, 7, 205–216. [Google Scholar] [CrossRef]
- Boudaoud, L.B.; Sider, A.; Tari, A. A new thinning algorithm for binary images. In Proceedings of the International Conference on Control, Engineering & Information Technology (CEIT), Tlemcen, Algeria, 25–27 May 2015. [Google Scholar]
- Ben Boudaoud, L.; Solaiman, B.; Tari, A. A modified ZS thinning algorithm by a hybrid approach. Vis. Comput. 2018, 34, 689–706. [Google Scholar] [CrossRef]
- Prakash, R.P.; Prakash, K.S.; Binu, V.P. Thinning algorithm using hypergraph based morphological operators. In Proceedings of the IEEE International Advance Computing Conference, Banglore, India, 12–13 June 2015. [Google Scholar]
P2 | P3 | P4 | P5 | P6 | P7 | P8 | P9 |
---|---|---|---|---|---|---|---|
1 | 1 | 0 | 0 | 0 | 1 | 1 | 0 |
Scenes | TNF | GNF | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
Sobel | Skeleton | ZS | Ours | |||||||
Good Frames | Accuracy Rate | Good Frames | Accuracy Rate | Good Frames | Accuracy Rate | Good Frames | Accuracy Rate | |||
Video 1 | rain, straights | 445 | 331 | 74.38% | 399 | 89.66% | 387 | 86.96% | 410 | 90.11% |
Video 2 | evening, turnouts, curves | 331 | 156 | 47.12% | 273 | 82.47% | 281 | 83.63% | 286 | 86.40% |
Video 3 | sunny, turnouts, curves | 476 | 367 | 77.10% | 432 | 90.75% | 434 | 91.17% | 451 | 94.74% |
Video 4 | evening, turnouts, straights | 273 | 244 | 89.37% | 236 | 86.44% | 243 | 89.01% | 245 | 89.74% |
Video 5 | sunny, straights turnouts, curves | 281 | 215 | 76.51% | 251 | 89.32% | 244 | 86.83% | 262 | 93.23% |
Video 6 | cloudy, turnouts, curves | 479 | 435 | 90.81% | 424 | 88.51% | 438 | 91.44% | 441 | 92.06% |
Video 7 | rain, curves | 396 | 297 | 75.42% | 340 | 86.03% | 356 | 90.16% | 364 | 92.02% |
Video 8 | evening, turnouts, | 366 | 289 | 79.01% | 322 | 88.65% | 318 | 87.24% | 329 | 90.23% |
Video 9 | sunny, straights turnouts, | 421 | 374 | 89.24% | 357 | 85.02% | 378 | 90.16% | 391 | 93.24% |
Video 10 | evening turnouts, curves | 356 | 306 | 86.21% | 316 | 89.19% | 320 | 90.16% | 327 | 92.65% |
Scenes | Track Line Extraction Time (ms) | Track Region Extraction Time (ms) | Total Time (ms) |
---|---|---|---|
Simple track line (daytime) | 40.3 | 110.5 | 150.8 |
Complex track line (daytime) | 44.6 | 120.3 | 164.9 |
Simple track line (cloudy and rainy weather) | 41.2 | 108.4 | 149.6 |
Complex track line (cloudy and rainy weather) | 46.0 | 120.0 | 166.0 |
Multiple turnout track line (night) | 39.7 | 107.2 | 146.9 |
Multiple turnout track line (headlights at night) | 40.1 | 112.5 | 152.6 |
Video 1 | Video 2 | Video 3 | Video 4 | |||||
---|---|---|---|---|---|---|---|---|
Scenes | straight (Uphill, Downhill) | straights, Curves | straight (Different Light) | straight, turnouts | ||||
TNF | 498 | 486 | 524 | 516 | ||||
GNF | good frames | accuracy rate | good frames | accuracy rate | good frames | accuracy rate | good frames | accuracy rate |
Result | 464 | 93.17% | 443 | 91.15% | 492 | 93.89% | 465 | 90.11% |
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |
© 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Niu, W.; Chen, Z.; Zhu, Y.; Sun, X.; Li, X. Track Line Recognition Based on Morphological Thinning Algorithm. Appl. Sci. 2022, 12, 11320. https://doi.org/10.3390/app122211320
Niu W, Chen Z, Zhu Y, Sun X, Li X. Track Line Recognition Based on Morphological Thinning Algorithm. Applied Sciences. 2022; 12(22):11320. https://doi.org/10.3390/app122211320
Chicago/Turabian StyleNiu, Weilong, Zan Chen, Yihui Zhu, Xiaoguang Sun, and Xuan Li. 2022. "Track Line Recognition Based on Morphological Thinning Algorithm" Applied Sciences 12, no. 22: 11320. https://doi.org/10.3390/app122211320
APA StyleNiu, W., Chen, Z., Zhu, Y., Sun, X., & Li, X. (2022). Track Line Recognition Based on Morphological Thinning Algorithm. Applied Sciences, 12(22), 11320. https://doi.org/10.3390/app122211320