Computer Vision for Train Tracking System Using Discrete Wavelet Transform

Majid Memarian Sorkhabi, Sadegh Bakhshi, Saeid Bashirian

  Open Access OPEN ACCESS  Peer Reviewed PEER-REVIEWED

Computer Vision for Train Tracking System Using Discrete Wavelet Transform

Majid Memarian Sorkhabi1,, Sadegh Bakhshi1, Saeid Bashirian1

1Tabriz Urban Railway Organization (TURO), Tabriz, Iran


Modern Mass Transit Systems must attract travelers in competition with other modes of urban transport such as private cars. In order to be successful, the transit system must be easy to access, give short waiting time for trains, provide a fast and comfortable journey and be safe and reliable. For the system control and operator, knowledge of train position provides the means to supervise and control traffic in the whole line, with a high degree of automation. Using video processing for train position estimation can reduce the cost of system implementation. It can also reduce operating costs by easy support to maintenance activities. In order to improve the vehicle tracking quality in the Tabriz urban railway area, digital video processing and discrete wavelet transform are utilized for detection train position and entry in stations. Firstly all real video frames, which extracted from CCTV system, are decomposed to red, green and blue images. Secondly differences of five consecutive frames are calculated. Then wavelet transform of these images are calculated with symlets wavelet. Finally Wavelet Coefficient Energy of each pixel is compared with pre-selected threshold for estimation of train position. We reach the accuracy of 94.3% in train position estimation when it is entered in stations, and 93.7% accuracy for determination of train entry in real area experience.

At a glance: Figures

Cite this article:

  • Sorkhabi, Majid Memarian, Sadegh Bakhshi, and Saeid Bashirian. "Computer Vision for Train Tracking System Using Discrete Wavelet Transform." American Journal of Computing Research Repository 2.3 (2014): 53-57.
  • Sorkhabi, M. M. , Bakhshi, S. , & Bashirian, S. (2014). Computer Vision for Train Tracking System Using Discrete Wavelet Transform. American Journal of Computing Research Repository, 2(3), 53-57.
  • Sorkhabi, Majid Memarian, Sadegh Bakhshi, and Saeid Bashirian. "Computer Vision for Train Tracking System Using Discrete Wavelet Transform." American Journal of Computing Research Repository 2, no. 3 (2014): 53-57.

Import into BibTeX Import into EndNote Import into RefMan Import into RefWorks

1. Introduction

The growing demands for transportation of passengers with subway vehicles Emphasis the importance of railways around the world as indicate the increasing investments in countries. Besides economical importance involved in railroad maintenance, another motivation for this type of researches in this area is related to passengers' safety. There are many reports of accidents due to train position tracking problems. These kinds of accidents could be avoided with the use of health monitoring techniques for trains.

In the modern subway system, accurate real time information of the train position in station is essential for safe, stable and efficient train operation. Iran, Tabriz City Railways Project is located towards east to west of this city and it is 17.2 km. long from ELGOLI Depot to LALEH Depot. It is comprised of the main route 18 stations plus the 2 depot stations.

Most object control centers (OCC) currently in use with fixed block signalling technology for train tracking system. When trains enter or leave fixed lengths of track, they are detected by infrastructure-based systems such as track circuits or axle counters. The entry of the train into the block section is controlled by color light signals. Figure 1 shows this type of signalling monitor. This technology is costly to install and maintain, and limits the capacity of the railway network (as irrespective of train speed, only one train can typically be in a track at any time).

Figure 1. Signalling system in subway OCC

The signalling system is one of the expensive methods in subway organization. The signalling system must receive reliable, accurate, sufficient, and up-to-date information regarding the position and movement of the vehicle necessary for the safe control of the train movement system.

In Europe, much R&D effort has gone into a specifying a new generation of signal technology, particularly the European Rail Traffic Management System (ERTMS) defined under the European Directive 98/48/EC on the interoperability of the trans-European high speed rail system [1].

Due to complex circuits, modules and implantation of signalling systems, many researches are accomplished for find best replacing, which can satisfy subway requirements [2].

In some researches, the localization methods that employed in the traditional system, such as track circuits, axle counters and tachometers were replaced with GPS technology. It is being investigated as a lower cost approach, but this has its limitations in deep cuttings and tunnels [3].

Digital video processing is one of the best alternatives for signalling systems [4]. There is provided a system for measuring train position which uses an image capture device to take a sequence of timed images from the front or rear or margins of the train. The images are then processed to determine train position. By comparing the scenes from images taken a short time apart, the distance that the train has moved can be concluded.

The video are also processed to identify specific markers placed at the trackside at fixed known locations (called balise), such as vehicle position in stations. When the system recognizes that a particular marker has been passed, the position of the front or rear of the train is known. The markers can be used to correct built-up position in the system and to provide sufficient certainty of position for safety critical operation of switches and crossings [5]. So the system that proposed in this paper can read markers and visual balise. It can be low cost alternative to the conventional balise equipment for precise spot location.

2. Image Acquisition from Train Position

All around of stations in Tabriz subway is covered with CCTV cameras. Color IP based fixed box cameras are mounted in stations for monitoring stations platform. Figure 2 shows one frame of videos, which depicts train entering in El-gholy station. These videos are very useful for signalling purpose, because this video make it possible to extract location of train.

The invention in this paper is extended to a system for determining train position and entry in stations. Processing of CCTV videos is a major step forward for the signalling industry and a powerful catalyst for change in this sector.

3. Method

After acquisition video from CCTV cameras, recorded files are imported to the MATLAB software. Then each frame of this video are extracted. Figure 3 shows some frames of video trails.

Next step is decomposing each frame. It deals with dividing the image to red, green and blue. Color of an image can carry much more information than gray level. Color is the most prominent feature of any image. Extracting color information from any image has many applications related to computer vision algorithms. Figure 4 depicts one sample of frames decomposing.

After decomposition of each frame, discrete wavelet transform for red, green and blue frames had calculated. The mother wavelet function is given as:


Where a, b, a>0 and R is the wavelet space. Parameters ‘a’ and ‘b’ are the scaling factor and the shifting factor, respectively, since choosing a prototype function as the mother wavelet should always satisfy the admissibility condition (Equation 2):


Where is the Fourier transform of .

For any image with NxM pixels, discrete wavelet transform is calculated as equation (3).


where f(x,y) is the pixel of image at x and y coordination, and g(x,y) is the wavelet wave. U and V indicate the wavelet space. We can use difference wavelet wave for this transform. Figure 5 exhibits the symlets wave. The symlets are nearly symmetrical wavelets proposed by Daubechies as modifications to the db family. The properties of the two wavelet families are similar.

After wavelet transform, two type of coefficient is produced; approximation Coefficients Matrix and details coefficients matrix.

For estimation of train position in stations, differences of five consecutive frames are calculated. Then wavelet transform of this difference is computed with symlets. Figure 6 presents approximation matrix and Figure 7 presents vertical, horizontal and diagonal details coefficient matrix of frames.

Figure 8. Percentage of energy for approximation wavelet coefficient
Figure 9. Percentage of energy for horizontal detail wavelet coefficient

It is clear that edge and sharp change in the image have a considerable wavelet coefficient and vice versa. Energy of each coefficient can calculate with equation (4) and (5):


where Coefs. is the wavelet transform coefficient and SC is the percentage of energy for etch wavelet coefficient. Figure 8 shows percentage of energy for approximation wavelet coefficient and Figure 9 shows percentage of energy for horizontal detail wavelet coefficient. So train detection will be possible with wavelet coefficient energy comparison. Figure 10 shows summery of what we propose in this paper.

Figure 10. Summary of proposed algorithm for train tracking

4. Train Tracking Algorithm

After calculation of wavelet coefficient energy for each pixel, it is compare with pre-selected threshold. In this paper, this value is set to 1.54x10-4. So if wavelet energy of each pixel is under this threshold; not any emotion detected at there, and if wavelet energy of pixel is equal or over the threshold, it will be train at this point. For avoidance of wrong estimation of every movement as a train, like passenger movement at station platform, at least 40 pixels' energy should be changed to determine this movement as a train.

A train state could have 4 positions in the station:

1. There is no train in station.

2. Train is entering to station.

3. Train is stopped in station.

4. Train is departure of the monitoring area.

So the proposed algorithm has four different transitions. It uses motion of train in each station to determine the state change. The transitions will be determined when more than five consecutive motion frames are changed. State diagram for each state of train motion is shown in Figure 11.

5. Experimental Result

We capture color images from Color IP based fixed box camera in a subway station. Video has a RGB frame at a resolution of 1070x1920 pixels at 25 [frames/s] to produce a visibly continuous and Bits per pixel of 24 (8 bits for red, 8 bits for green and 8 bits for blue components). We develop and debug our vision algorithms using MATLAB software for execution on the vision computer.

The subway section between El-goli station and Shahriyar station was used for analysis and verification the proposed digital video processing algorithm to track the train position.

Proposed algorithm was tested for 200 video trails. It can reach the accuracy of 94.3% in train position estimation in stations, and 93.7% accuracy for determination of train entry in real area.

6. Conclusion

This paper has presented an overview of a train position tracking system that uses video and image processing technology. The work was undertaken in response to the perceived need in the signalling industry to save cost and increase innovation in this sector. In particular, it is targeted at reducing the cost and time of implantation of train tracking system.

Our approach is to track trains in the CCTV videos from one frame wavelet coefficient energy to the next 5 consecutive video frames.

Our experimentation in this paper confirmed that we can successfully extract train position in stations from CCTV videos. We considered that this technique is sufficiently valid to use in OCC room. The trials allowed us to gain our first indication of the accuracy of the system in real operation condition.

The CCTV videos are recorded by an IP base fixed camera. Due to existence of these cameras for other purposes, suggested system had the advantage of being low cost and straightforward to install and maintain. In addition it is lack of active components and operation in a relatively benign environment will contribute to high reliability and availability.

Accuracy of 94.3% in train position estimation in stations, and 93.7% accuracy for determination of train entry in real area were obtained with wavelet transform of frames. This transform had used symlets wave. Running test results in real area examined that our train tracking system method is accurate in all train stations of phase one of Tabriz subway.


We would like to thank Mr. Pashmineh Azar, head of Tabriz urban railway organization (TURO), for his support and leadership was invaluable in the production of this research.


[1]  Simon, Iwnicki, Handbook of Railway Vehicle Dynamics (Eds), Taylor & Francis, 2006, 11-19.
In article      
[2]  C.-Y, Qian, Z.-Z, Han, W.-D, Xie, “Application of FPGA to absolute positioning system of maglev vehicles”. Chinese Journal of Scientific Instrument, vol, 27, no. 6, pp. 884-886, 2006.
In article      
[3]  I. Yoda, "Image processing technology for advanced safety to people in railroad transportation - For railroad crossing and station platform," IPSJ Magazine Vol. 48, No. 1, pp. 10-16, Jan. 2007.
In article      
[4]  M-S, Kim, “Design of the Active Steering Fuzzy Controller with the Degree of Non-uniformity for a Scaled Railway Vehicle,” The 9th WSEAS International Conference on Robotics, Control and Manufacturing Technology (ROCOM '09), Hangzhou, China, May 20-22, 2009.
In article      
[5]  S. Shen, T. X. Mei, Active Steering of Railway Vehicles: A Feed forward Strategy, European Control Conference, 2003.
In article      
  • CiteULikeCiteULike
  • MendeleyMendeley
  • StumbleUponStumbleUpon
  • Add to DeliciousDelicious
  • FacebookFacebook
  • TwitterTwitter
  • LinkedInLinkedIn