Railway Fastener Positioning Method Based on Improved Census Transform.
Railway fastener is an important part of railway; fastener defects will cause great safety risks. Therefore, it is urgent to strengthen safety check for fasteners [1, 2]. In recent years, image processing technology has been applied to fastener detection instead of manual inspection [3, 4], but because the types of fasteners at home and abroad are not consistent, many foreign methods cannot be directly applied to domestic fastener detection. Therefore, it is imminent to develop a set of independent automatic detection system. In this article, the fastener image is collected by the track inspection vehicle carrying the linear array Charge Coupled Device (CCD) camera, and the image is returned in time. The linear array CCD camera has the following advantages: Firstly, the linear array camera has higher resolution and simple structure; secondly, it is more suitable for continuous acquisition of linear moving objects. The important technical parameter of linear array camera is line frequency, which indicates the number of lines of images that can be captured by linear array camera per second. At present, there are many linear array cameras on the market, which have enough precision and acquisition speed to meet the needs of high-speed real-time acquisition of track images.
Because of the smaller proportion of the fastener parts in the fastener images in actual collection, searching for fasteners in the original image will inevitably lead to a larger amount of calculation. So in order to reduce the computation time and the interference of the ballast area in the image, it is necessary to locate fasteners quickly and accurately before the fastener recognition. Wu Meng [5, 6] adopted the "crossover" position method. Firstly, histogram equalization and vertical edge detection of the Sobel operator are performed on the image. Then, the left boundary of rail and the upper boundary of sleeper are determined by the regional highlight statistics, so as to confirm the position of fastener. However, the surface characteristics of the sleeper and rail differ greatly under different illumination, which is not conducive to the positioning of the fasteners. Wu Lushen [7, 8] improved the "crossover" positioning method. Firstly, the portion of the fastener is truncated as small as possible in the original image to reduce the range of subsequent processing, and then locate it through median filtering, Canny operator edge extraction, and gray projection. This method improves the location accuracy to a certain extent, but the Canny operator is very sensitive to the selection of threshold in different illumination conditions and increases the complexity of the algorithm. Feng  could quickly detect the boundary of rail and sleeper by using the LSD straight line detection method, and realize the positioning according to the prior knowledge of the fastener, the rail, and sleeper. However, the rail and sleeper edge are worn out greatly due to the long-term operation of the railway, so the boundary characteristics are not continuous, resulting in a lower positioning accuracy. Hang Yuanyuan  put forward a two-step method to realize the accurate positioning of fastener region by coarse positioning and precise positioning of the fastener. This method can effectively reduce the influence of light and line bending factors. Compared with other positioning methods, the method can be located in a smaller area.
In view of the above problems, it is proposed to locate the fastener by using the linear feature of the contact boundary between the baffle seat and sleeper in this article. This feature is relatively stable in different illumination conditions and is more conducive to the precise positioning of the fastener than the edge feature of the rail and sleeper. The specific positioning process is shown in Figure 1.
2. Filtering Denoising
Because the fastener images on the spot are inevitably disturbed by various noise, so the image is denoised before the fastener is positioned to weaken the effect of noise on the subsequent image processing. The median filter [11, 12] is adopted; it can overcome the blurred image details brought by the mean filtering under certain conditions and can preserve the edge information well. In this article, the fastener image of two kinds of natural condition and the median filter of 5 x 5 are selected. The filtering results are shown in Figure 2.
3. Edge Feature Enhancement Based on Improved Census Transform
3.1. Traditional Census Transform
Traditional Census transform [13, 14, 15] is a nonparametric transformation for local stereo matching. The basic principle is to select a window with pixel (u, v) as the center and then compare the size of each neighborhood pixel with center pixel gray value in the window; if it is less than the center pixel, it corresponds to the pixel position 1; otherwise, it will be represented by 0. The expression is as follows:
[mathematical expression not reproducible] Eq. (1)
C is the result of transformation, p1 is the center pixel, and p2 is the neighborhood pixel in the window; then the Census transformation expression is shown as
[mathematical expression not reproducible] Eq. (2)
The operator [cross product] represents a bit connection operation; Icensus(u, v) represents the Census transform bit string of the central pixel.
3.2. Improved Census Transform
The traditional Census transform can effectively weaken the effect of light intensity change on the image, but there are the following defects: Firstly, the traditional Census transform relies heavily on the center pixel; it will have great impact on the transformation result when the center pixel is distorted by noise interference. Secondly, it does not make full use of the relevant information between pixels, which can easily lead to mismatch when the illumination is not ideal. In order to overcome the above problems, the robustness of illumination change is further improved by improved Census transform.
As shown in Figure 3, the gray distribution uniformity of the four directions of the central pixel is calculated in the transformation window, and the subdomain pixel mean of the least homogeneity is selected instead of the center pixel. The expression is as follows:
V = Z[(I(i, j) - [bar.I](u, v)).sup.2] Eq. (3)
I(i, j) is the subdomain pixel gray value; [bar.I](u, v) is the subdomain pixel mean.
Then, the mean value of the subdomain pixels in four directions is obtained, [[bar.I].sub.1] = 86, [[bar.I].sub.2] = 113, [[bar.I].sub.3] = 114, [[bar.I].sub.4] = 126; according to formula (3), [V.sub.1] = 2385, [V.sub.2] = 894, [V.sub.3] = 2137, [V.sub.4] = 877. So the mean value 126 of the lower right pixel is selected as the center pixel. This method reduces the dependence on the gray value of the center pixel and avoids the problem of inaccuracy of the transformation result caused by the distortion of the center pixel gray value when the illumination is not ideal, but it does not consider the cross-correlation information between pixels.
Therefore, the contrast value of local texture based on the image texture measurement is introduced on the basis of the above; Am reflects the change of gray level between pixels; the expression is shown as (4). The improved center pixel is expressed in I' (u, v ) = [bar.I] (u,v ) + [DELTA]m:
[DELTA]m = 1/32 x (S1/n1 - S2/n2) Eq. (4)
S1 indicates that the gray value greater than or equal to [bar.I] in the window is accumulative, and the number is n1. S2 indicates that the gray value less than [bar.I] is accumulative, and the number is n2. If one of the denominators is 0, the pixel (u, v) is in a single area of the texture.
In order to verify the validity of the method, the method is compared with the Sobel operator and the Canny operator. In Figure 4, the left is sunny images and the right is rainy images. As can be seen from Figure 4, the Sobel operator and the Canny operator are very sensitive to the selection of the threshold. The effect of edge detection is different greatly in different illumination conditions, and also the linear feature of the extracted baffle is broken. This article method does not need to consider the problem of threshold, the edge features can be extracted steadily under different illumination conditions, and the extracted edge features are more clear than other methods, which is more conducive to the subsequent line detection.
4. Linear Feature Extraction by Improved Hough Transform
4.1. Introduction of Mean-Shift Algorithm
Mean-shift algorithm [16, 17] is a simple and effective nonparametric iterative pattern search algorithm based on kernel density estimation. The process of image segmentation is to estimate probability density firstly, then search for convergent point by pattern search and filter the image through convergent point, and finally finish image segmentation.
Assuming that the initial point x has n samples in the window, the kernel function of initial point x is G(x), and the error threshold is [epsilon]; then the process of finding maximum density by mean-shift algorithm is as follows:
Step1: A search area circle is selected randomly in the sample, and the average value m(x) of all the sample points in the search area is calculated.
Step2: The difference between the mean and the center is recorded as [m.sub.h,G](x); if [parallel][m.sub.h,G](x)[parallel] < [epsilon], find a local maximum probability density and the algorithm terminates; otherwise, execute step3.
Step3: The [m.sub.h,G](x) + x is given to x; execute step1 with the new x window as the current window. Repeat the above step until the density change is less than [epsilon] and then converges to the density maximum point.
The mean-shift clustering algorithm can divide the image into many small areas according to the content, and remove some small-scale details while protecting the large-scale boundary information of the image, which is beneficial to subsequent line detection.
4.2. The Baffle Seat Linear Feature Extraction
The Hough transform [18, 19] completes line detection through the dual characteristics of points and lines based on the image domain and the parameter domain. As the slope does not exist, the parameter space coordinates are usually expressed in polar coordinates [rho] = x cos [theta] + y sin [theta]; [rho] is the distance between the origin and the straight line; [theta] is the angle between the straight line and the horizontal axis. In practical applications, the parameter space is usually dispersed into an accumulator array A([rho], [theta]). Then according to the polar coordinate equation, each point (x, y) in the image space is mapped to a series of accumulators corresponding to the parameter space and the corresponding accumulator is added 1. If there is a straight line in the image space, a corresponding accumulator will appear local maximum in the parameter space. By detecting the local maximum, a pair of parameters ([rho], [theta]) corresponding to the straight line can be determined, so as to detect the straight line.
It is known from the prior knowledge that the length of the baffle seat edge is about 120 pixels, so only the linear features between 110 and 130 pixels are searched during the detection process. In addition, the two fasteners are symmetrical about the rail, and the two straight lines are apart about 320 pixels. So only detect a straight line to determine the position of the fastener. The test results are shown in Figure 5.
5. Experimental Results and Analysis
This article collects some fasteners from Jilin to Changchun railway line and selects 1000 images as samples, including 500 images on sunny days and rainy days. Simulation experiments are carried out by 2.5 GHZ computer and MATLAB2015b. According to the prior knowledge, the fastener range is about 120 x 80 pixels. The position of the fastener is realized by this method, and the positioning result is shown in Figure 6.
In the actual situation, the area of baffle seat will inevitably be obstructed in the fastener image. As shown in Figure 7, in the case of only one baffle seat, the boundary of the baffle seat reinforced by the improved Census transform is still clearly visible, so the location of the other fastener can be realized according to the symmetry of the upper and lower two baffles. However, when the two edges of the baffle seat are blocked, this method is no longer applicable. This kind of image is set as a problem image and is detected by manual inspection, but the proportion of this kind of image is very small.
In order to embody the superiority of this method, this method is compared with the position method in References [5, 7, 10]. The comparison results are shown in Table 1. Reference  uses the crossing characteristics of rail and sleeper to reduce the influence of inhomogeneous illumination by histogram equalization, and then regional highlight statistics to locate the rail and fastener edges, thus determining the fastener area. The method is simple and has certain accuracy, but the accuracy is low when the light is strong and dark, and the anti-interference ability is poor. Reference  improves crossing method and extracts the fastener area by gray projection. The accuracy is improved, but there is a large error in the position of the fastener under different illumination conditions. Although the Reference  positioning method is superior to the previous methods in recognition rate, there are also disadvantages of larger deviation in rainy days. In this article, the positioning effect of this method is relatively stable and the accuracy is higher, which is more suitable for the fastener positioning under natural conditions.
In addition, the abovementioned positioning methods are achieved through the rail and sleeper edge and position relationship. The location of the fastener region is too large, so it contains a lot of irrelevant information, which interferes with the subsequent feature extraction. The fastener and baffle seat are tied together, the line length of baffle seat is almost the same as that the width of fastener. Therefore, this article determines the fastener area according to the edge line of the baffle seat, which can reduce the proportion of many unrelated areas in the fastener image, greatly reducing the redundant information. It can be seen that this method not only improves the positioning accuracy but also locates the fastener area smaller, thus reducing the subsequent feature extraction calculation.
In this article, enhance the image through the Census transform that has the characteristics of relative grayscale invariance. The limitation of the traditional Census transformation is overcome by computing the pixel mean of the minimum evenness subdomain instead of the center pixel and introducing the contrast value of local texture to increase the correlation between pixels. Then, extract the baffle seat edge features through Hough line detection based on mean-shift algorithm, combined with the size of fastener and the symmetrical relationship of two fasteners to realize the precise position of fasteners. Experimental results show that this method has higher positioning accuracy and could adapt to the fastener positioning under different weather conditions. In addition, the scope of the fastener positioned is relatively small in this method; a lot of redundant information has been removed, which reduces the calculation amount of subsequent feature extraction, thereby reducing the false detection rate of fastener detection.
College of Information Engineering, Northeast Electric Power University, Jilin, Jilin, 132012, China
[1.] Jin, S., "Problems and Strategies in the Safety Management of Railway Transportation," Science and Technology 27(08):163, 2017.
[2.] NN, L. and YL, W., "Design and Application of Intelligent Testing System of Rail Fastener," High Speed Railway Technology 7(04):55-59, 2016.
[3.] Marion, F., Distante, A., Mazzeo, P.L. et al., "A Real-Time Visual Inspection System for Railway Maintenance: Automatic Hexagonal-Headed Bolts Detection," IEEE Transactions on System, Man and Cybernetics, Part C: Applications and Reviews 37(3):418-428, 2007.
[4.] Dai, X.X., Yang, E.H., Ding, S.H. et al., "Automatic Defect Inspection Algorithm of Railway Fasteners Based on 3D Images," Journal of the China Railway Society 39(10):89-96, 2017.
[5.] Wu, M., Chen, J.Z., and Lin, S., "Track Fastener State Detection Based on Image Processing," China Computer & Communication (Theoretical Edition) (01):46-47, 2013.
[6.] Wu, M., Research on Image Processing Technology of Automatic Rail Defect Detection System (China: Southwest Jiaotong University, 2013).
[7.] Wu, L.S., Wan, C., Chen, H.W. et al., "An Improved Cross Rail Fastener Positioning Method," Railway Standard Design 60(12):49-53, 2016.
[8.] Wu, L.S., Zhu, L., and Chen, H.W., "Design of Track Image Acquisition System Based on Linear-Array CCD Camera," Railway Standard Design 58(8):55-59, 2014.
[9.] Feng, H., Jiang, Z., Xie, F. et al., "Automatic Fastener Classification and Defect Detection in Vision-Based Railway Inspection Systems," IEEE Transactions on Instrumentation and Measurement 63(4):877-888, 2014.
[10.] Hang, Y.Y., Research on the Detection Algorithm of Railway Fastener Based on Computer Vision (China: Southwest Jiaotong University, 2014).
[11.] Tian, Y.Y. and Tan, Q.C., "Analysis of Subpixel Edge Location Algorithm for Filtering Noise," Journal of Northeast Electric Power University 36(05):43-47, 2016.
[12.] Tang, R., Zhou, X., and Wang, D., "Improved Adaptive Median Filter Algorithm for Removing Impulse Noise from Grayscale Images," International Journal of Engineering 1503-1509, 2017.
[13.] Wang, J.Z., Zhu, H.J., and Li, J., "A Census Transform Based Stereo Matching Algorithm Using Variable Support-Weight," Transaction of Beijing Institute of Technology 33(7):704-710, 2013.
[14.] Wang, Q., Jiang, X.L., Yuan, J.Y. et al., "Regional Stereo Matching Algorithm Based on Improved Census Transform," Application Research of Computers 32(10):3164-3167, 2015.
[15.] Men, Y.B., Ma, N., Zhang, G.Y. et al., "A Stereo Matching Algorithm Based on Census Transform and Improved Dynamic Programming," Journal of Harbin Institute of Technology 47(3):60-65, 2015.
[16.] Wang, Y., Yu, L.L., Xie, H.Q. et al., "Line Detection Algorithm Based on Adaptive Gradient Threshold and Weighted Mean-Shift," Multimedia Tools and Applications 16665-16682, 2016.
[17.] Wang, L.Q., Guo, S.Q., and Guo, X.L., "Color Image Segmentation Method Based on Color Constancy," Journal of Northeast Electric Power University 35(01):78-82, 2015.
[18.] Wang, C.F., "Fast Line Extraction Algorithm Based on Improved Hough Transformation," Advanced Materials Research 3612-3615, 2014.
[19.] Li, H.P., Zhu, W.W., Tan, M.X. et al., "Line Detection Algorithm Based on Improved Hough Transform," Semiconductor Optoelectronics 38(04):603-608, 2017.
Chunming Wu and Hongkuo Zheng, Northeast Electric Power University, China
Received: 21 Apr 2018
Revised: 29 Aug 2018
Accepted: 10 Sep 2018
e-Available: 31 Oct 2018
Wu, C. and Zheng, H., "Railway Fastener Positioning Method Based on Improved Census Transform," SAE Int. J. Trans. Safety 6(2):163-171, 2018, doi:10.4271/09-06-02-0011.
TABLE 1 Comparison results of position accuracy. An image of a sunny day (%) An image of a rainy day (%) Reference  85.1 82.5 Reference  90.3 87.2 Reference  92.2 87.4 This article method 96.5 95.4
|Printer friendly Cite/link Email Feedback|
|Author:||Wu, Chunming; Zheng, Hongkuo|
|Publication:||SAE International Journal of Transportation Safety|
|Date:||Jul 1, 2018|
|Previous Article:||Detection of Lane-Changing Behavior Using Collaborative Representation Classifier-Based Sensor Fusion.|