Image Segmentation Method for Rail Track Obstacle Based on Improved Fast Binarization

The idea of recursion and limited range is introduced in the traditional fast binarization algorithm. Firstly, according to the characteristics of the fast binarization algorithm, the recursion formulas of four parameters are deduced, and the complexity of the image is calculated . Then fast threshold segmentation of image is finished within the reduced gray level range. Because of considering the four parameters formula of recursive and fully aware of the images complexity, the gray value of the image to be traversed is greatly reduced, and the redundancy of the algorithm is reduced. Finally, the improved algorithm is applied to extraction of railway track obstacle. The experimental results show that this algorithm complexity is lower than traditional algorithm and Otsu, and the computation speed can be improved by about 60%. It can meet the real-time requirement for railway track obstacle image segmentation, and the segmentation effect is almost the same as the traditional one.


Introduction
The infrastructure, train running status and the collection, transmission and real-time processing of environment information are the key to the safety of high speed railway.In complex environments, how to extract railway obstacles using machine vision instead of human eyes, and have the feature extraction and accurate recognition, is a new trend to reduce the occurrence rate of railway accidents and to adapt to the railway operation [1].Therefore, it needs to determine whether there are harmful obstacles on the railway.It ' s firstly necessary to track obstacles from the image, and then regard it as the supplementary information provided to train personnel, reduce the traditional visual obstacle detection work.Song Juan al [2] utilized the high brightness of the track to convert the complex railway images into binary image by many times, this method achieve purpose of removing the dark background and retaining the rail information.Li Shengjin al [3] in the first did the discriminant operation in the current image of all pixels, and then used the region growing method to handle the binary image and realize moving object segmentation.
The fast binarization algorithm belongs to global automatic threshold method, which uses the binarization progress and the similarity of data packets, then using the variance function as the objective function to realize automatic threshold image binarization, this traditional method becomes widely used for its clear physical meaning, obvious effect, easy realization, good real-time, and board scope of applications [4,5,6].Chen Zheng et al [7] developed a fast recursive Otsu algorithm at a narrow gray level scope to calculate the optimal threshold, combined with the characteristics of infrared image, the image segmentation effect and time efficiency is better than the Otsu method.Dong Zhongyan et al [8] proposed an improved algorithm based on image complexity, which can save memory and improve computing speed by about 40% on the basis of ensuring the segmentation effect.In view of this situation, this paper presents an improved fast binarization algorithm, the algorithm fully considers the characteristics of the original image itself while the algorithm improves the traditional fast binarization algorithm repeatability of the parameter calculation formula, thereby reducing the computational redundancy, improving the real-time of the algorithm.Finally, the improved algorithm is applied to the extraction of obstacle on railway track.

Traditional Fast Binarization Algorithm
The fast binarization algorithm is based on minimization of the objective function, the objective Now suppose that we dichotomize the pixels into two classes S 1 and S 2 (objects and background, or vice versa) by a threshold at level k, if m 1 、m 2 represent the center of two classes, therefore n l is the number of pixels in the gray level l, which is used as a weighting factor in this formula.If a gray level k in S 1 moves to S 2 , the value of m 2 at this time becomes  2 m : suppose that S 1 obtains others gray levels except k, which means According to the objective function (1) ,therefore: In the above formula, if The gray level k can be moved from S 1 to S 2 , which makes the value of objective function reduced.
From the above equation, firstly it is necessary to elect the initial threshold, and according to the threshold to judge the removal and acceptance of the two classes, and then determine the formula ( 6) is established, if established, continue to remove gray level k until ( 6) is not established, and the optimal threshold is determined by dividing the final class S 1 and S 2 .It should be noted that a reasonable choice of initial thresholds can reduce the number of iterations to ensure the real-time requirements of railway track obstacle detection.

Recursion formula of fast binarization algorithm.
From the formula(6), the traditional fast binarization algorithm requires calculating the four parameters at each iteration: m 1 、m 2 and d 1 、d 2 .Assume that the gray class k moves from S 1 to S 2 , when the value of k is increased, S 1 reduces a gray level and S 2 increases a gray level, each time only k is a newly added or reduced level, so in the calculation of the above four parameters can be used on the calculation results of the last step.In this paper, we derive the recursive formula of the four parameters for the fast binarization algorithm.Let the pixels of a given picture are represented in L gray levels [0,1,…,L-1], then there: Step1.Select the appropriate initial threshold k 0 , get initial value d 1 (0)、d 2 (0)、m 1 (0)、m 2 (0); Step2.When the value of k increased: Step3.Until ( 6) is not established, close the iteration.We can have an optimal thresholding k* that satisfies min f(m 1 ,m 2 ).

Narrowing the range of the segmentation thresholding.
Image complexity: It can be defined as a measure of the degree of difficulty in image processing and analysis, which is based on the theory of generalized set [9].Its calculation expression is: let C represents the image complexity , N denote the total number of pixels in the original image, where N ∑ .
In an image, the smaller the target area is, the smaller the difference between the pixel gray value is, the higher the complexity of the whole image is, so the faster the binarization algorithm is, the larger the traversal range will be to find the optimal threshold; on the other hand, the target area is larger, the greater difference between the gray values, and the complexity of the image is smaller, the smaller the search scope.Therefore, this paper analyses the complexity of the original image to narrow the scope of the traversal, reduces the number of cycles, and thus shortens the computing time, improves the processing efficiency even further.

Let de original pi segmentati
where thought ab as:

Experi
We con CPU.We experiment (Fig. 2).Tw and the im railway tra (b), (c), (d) has a great improvement, and in the segmentation of railway obstacle image, people in the railway track belongs to the obstacle, the track belongs to the key background, except the track background are irrelevant background.The three algorithms can distinguish the orbital background and obstacle, but Otsu algorithm selects a larger threshold, at the same time, because the histograms of the two groups do not show obvious bimodal form, the segmentation images in the detail the effect are not as good as the traditional fast binarization algorithm and the improved algorithm.
Table 1 shows the image complexity of the two sets of original images.
Table1.Two groups of the original images complexity Table 2 is the comparison of three threshold segmentation algorithms in time effect.It can be seen from Table 2, the average computational time of our method is lower than that of the other methods.Namely, this improved algorithm takes the shortest time, the traditional fast binarization algorithm followed, Otsu algorithm is the longest, in the two groups of pictures segmentation results, the computation speed of the first two methods can be improved by about 65.5% and 69.9%, respectively.

Summary
The traditional fast binarization algorithm is about 10 times faster than the Otsu algorithm in single threshold processing, but the fast binarization algorithm needs to traverse the whole image.In this paper, we introduce the idea of recursive and limited scope into the algorithm, analyze the complexity of image, and improve the efficiency of image segmentation in the case of good segmentation results.The improved algorithm is applied to the railway track obstacle image segmentation, reduces the exhaustive computing redundancy both of Otsu and the traditional algorithm, the experimental results show that our improved method gives highly satisfactory results.
Figure 2From th paper is eq subjective traditional complete a

Table 2 .
Three algorithms time comparison