Research on Obstacle Detection Method of Urban Rail Transit Based on Multisensor Technology

With the rapid development of urban rail transit, passenger traffic is increasing, and obstacle violations are more frequent, and the safety of train operation under high-density traffic conditions is becoming more and more thought provoking. In order to monitor the train operating environment in real time, this paper first adopts multisensing technology based on machine vision and lidar, which is used to collect video images and ranging data of the track area in real time, and then it performs image preprocessing and division of regions of interest on the collected video. Then, the obstacles in the region of interest are detected to obtain the geometric characteristics and position information of the obstacles. Finally, according to the danger degree of obstacles, determine the degree of impact on the train operation, and use the signal system automatic response or manual response mode to transmit the detection results to the corresponding train, so as to control the train operation. Through simulation analysis and experimental verification, the detection accuracy and control performance of the detection method are confirmed, which provides safety guarantee for the train operation.


I. INTRODUCTION
According to the latest development plan for the railways system in China, in terms of railway network planning, China's railway network will reach 150,000 km in 2020 and China's railway network will reach 175,000 km in 2025. The scale of China's railway construction has been expanding year by year, and its operating mileage has been increasing. Railway travel has also become the preferred mode of transportation for many passengers due to its comfortable, convenient, and cost-effective features. However, the accompanying safety issues have also caused great concern. Once an accident occurs, it will not only be extremely difficult to rescue, but also cause train delays, and even cause economic losses and casualties, which will seriously affect passenger travel.
During the travel of the railway, many factors will affect the safety of train operation, such as the incident of obstacles invading the railway line. Obstacles refer to all objects in the track area that are harmful to train operation, including pedestrians, debris flow, inspection and maintenance tools, windshields, etc. Once these obstacles intrude into the rail transit area, they are likely to cause train delays, and even cause serious economic losses or casualties. On February 10, 2017, a collision on a New York City subway train killed two people and seriously injured one. On December 25, 2018, Shanghai metro line 3 collided with a pedestrian who fell off a track, resulting in the death of a pedestrian. As the operation speed and traffic density of urban rail transit continue to increase, once the intrusion of obstacles occurs, it may cause huge losses to the life and property of the country and people.
At present, the main protection and monitoring methods for obstacle violations in urban rail transit are: in the case of manned trains, cameras are installed in critical areas or obstacles are judged by the driver looking ahead. For driverless trains, an obstacle detection system based on the principle of mechanical trigger is installed in the front end of the vehicle with a camera or the bottom end of the vehicle. However, in these two types of detection methods, the obstacle detection of the camera only displays the obstacle, and it cannot carry out real-time automatic detection and alarm. As for the contact obstacle detection method, the braking may not be timely or the vehicle body may be damaged, which is not conducive to the operation of the train and the safety of passengers.
Aiming at the above hazards in the operation of urban rail transit and defects in existing detection technologies, this paper adopts the noncontact multisensor technology detection method to detect the running environment of trains in real time and implement early warning. First, an obstacle detection device based on camera and lidar is installed beside the orbit to detect the obstacles in the orbit area in real time. Then, judge the obstacle information detected and determine whether the train should brake automatically or the driver should brake manually. Finally, this control command is transmitted to train control center and train driver through transponder, wireless base station, and other trackside equipment at different levels to realize train early warning and braking.

II. LITERATURE REVIEW
The most important thing in the detection of obstacles in rail transit is to divide the areas of interest related to the rail zone to be detected according to the collected video image information and ranging data, and then detect obstacles in the area of interest.
In the division of the region of interest (ROI), the most important step is the identification of orbital lines. Chinese and foreign scholars have conducted many studies and achieved certain results. Sungho Kim and others proposed an initial horizontal line detection and tracking method based on image and sensor, which can make the acquired images have a wider range of vision. Y. S. Tang and others proposed an improved Otsu threshold segmentation algorithm, which divides the gray levels into two categories according to image segmentation, thereby achieving lane line recognition. Kok Kiong Tan and others proposed a more powerful vision-based lane line detection method using a ridge detector and random sample consensus. Feng Jiao adopted a rail recognition algorithm based on Gabor edge detection operator and Hough transform, and proposed the application of a convolutional neural network algorithm to realize the recognition of rails and the division of dangerous areas. In railway operation, straight and curved tracks coexist. For different sections of railway lines, the detection methods of railway tracks are also different. After detecting the track line, the ROI is divided, and this region can be divided according to relevant safety regulations of the railway industry.
In terms of obstacle detection, the detection objects are diverse, and for static obstacles and dynamic obstacles, experts and scholars at home and abroad also have many research results. D. Sinha and others used accelerometer and Monte Carlo-based novel Bayesian analysis method to measure the vibration signal generated when an obstacle falls in the railway track, and this method could detect the instantaneous dynamic obstacle. J. J. Garcia and others used an infrared emission barrier and another receiver placed opposite the railway to establish different optical links to detect obstacles. When there is a dynamic or static obstacle, the link is interrupted. Qu Zhijian and others proposed a priority scheduling algorithm-kernel correlation filter (PSA-Kcf) algorithm for kernel-correlation filtering target tracking that integrates scale estimation, so as to achieve scaleadapted rapid tracking of foreign intrusions on railways. Wang Yao proposed a hardware design of railway foreign object detection algorithm based on field programmable gate array (FPGA), which implements image acquisition, moving object detection, single scan connected domain marking, and foreign object feature extraction. Obstacle detection can be divided into static obstacle detection and dynamic obstacle detection. The two detection methods can be fused by using specific detection methods. At present, a variety of noncontact sensor fusion methods can be used to detect obstacles and improve detection accuracy.
Therefore, this paper focuses on the research of obstacle recognition and detection methods, and then carries out subsequent information transmission and train control according to the detection results, so as to ensure the safety of train operation.

III. MODEL METHOD
This paper uses machine vision and lidar fusion technology to detect obstacles. It mainly detects obstacles in the ROI. When the obstacle reaches a certain height threshold, it is judged that the obstacle has an impact on the train operation. In the division of the region of interest, it is mainly based on the track line, and on this basis, it is divided according to the railway safety operation management regulations. In this technology, machine vision is mainly used to outline and shape the obstacles, and laser radar is mainly used to determine and locate the height information of obstacles. The integration of the two methods can detect the obstacles more accurately. It can control the train operation according to the hazard level of the obstacles by the automatic response mode or manual response mode of the signal system, so as to ensure the safety of the train operation.

A. TRACK-LINE DETECTION
The ROI is divided mainly to detect obstacles in the orbital zone and nearby dangerous areas. The division of the ROI region can reduce the detection range of obstacles and improve the detection accuracy. For the straight section and the curved section, different detection methods are adopted according to the different properties. The straight section uses the Hough transform based on the Sobel edge detection operator, and the curved section uses the Freeman chain code tracking algorithm based on Sobel operator.

HOUGH TRANSFORM BASED ON SOBEL EDGE DETECTION
ALGORITHM. The edge detection algorithm is usually used to detect edge lines, and then the Hough transform is used to identify the track lines. Common edge detection operators are Roberts, Laplace, and Sobel.
Roberts operator is also called cross-differential algorithm. It is a gradient algorithm based on cross-difference, which detects edge lines through local difference calculation. It is often used to process steep low-noise images. When the edge of the image is close to +45°or −45°, this algorithm is more ideal. The disadvantage is that the positioning of the edges is not accurate, and the extracted edge lines are thick. Roberts operator templates are divided into horizontal and vertical directions: Laplace operator is a second-order differential operator in n-dimensional Euclidean space. It is often used in image enhancement and edge extraction. The Laplace operator is divided into four neighborhoods and eight neighborhoods. The four neighborhoods are gradients of the four directions of the center pixel of the neighborhood, and the eight neighborhoods are gradients of the eight directions. The four-neighbor and eight-neighbor templates are as follows: Sobel operator is a kind of discrete differential operator for edge detection. It combines Gaussian smoothing and derivative. This operator is used to calculate the approximate value of the lightness and darkness of the image. According to the lightness and darkness of the edge of the image, a specific point in the area exceeding a certain number is recorded as an edge. Sobel operators have more accurate edge location and are often used for images with more noise and gray gradients. The algorithm template is shown in (6), where d x represents the horizontal direction, and d y represents the vertical direction: Using python simulation, the three edge detection results are shown in Fig. 1.
Each picture in Fig. 1 represents background picture, Roberts test result map, Laplace test result map, and Sobel test result map. It can be seen from the comparison that Sobel has better detection effect on edge detection. Therefore, this paper uses the Hough transform based on Sobel edge detection algorithm to identify the track straight line segment.
The Hough transform has the advantages of extracting straight lines with high accuracy and strong anti-interference ability, and can traverse all edge pixels in the image and the straight lines that pass through the edge pixels in various directions. The principle of the Hough transform is for a straight line in a plane, in the Cartesian coordinate system, it can be represented by y = kx + b, where k is the slope and b is the intercept. However, if the straight line is a vertical line, k is infinite, so we usually represent the straight line in another coordinate system, r = x* cos (θ) + y* sin (θ) in polar coordinate system, (r, θ) can be used to represent a straight line, where r is the distance from the straight line to the origin, and θ is the angle between the vertical line of the straight line and the x axis.
For a given point (x 0 , y 0 ), we draw all straight lines (r, θ) passing through it in polar coordinates, and we will get a sine curve. If all the sine curves of the nonzero points in the picture are drawn, there will be some intersection points. All sine curves passing through this intersection point indicate that they have the same (r, θ), which means that the points are on a straight line.
The three curves in Fig. 2 intersect at one point and have the same (r, θ). The Hough line transformation uses this method to find the straight line in the figure.

FREEMAN CHAIN CODE TRACKING ALGORITHM BASED ON
SOBEL OPERATOR. The track curve boundary extraction uses the Freeman chain code tracking algorithm based on the Sobel operator, which can be represented by an eight-direction Freeman chain code. The track curve is regarded as a collection of line segments with fixed length and direction. Select a pixel point on the image, and set eight pixels adjacent to it, and set them to 0∼7, as shown in Fig. 3.
Let i be the index value of a pixel on the image. If a curve is required to be pi→b7, the order of this curve can be pi→b4→ b5→b6→b7, and the corresponding Freeman chain code is 46000. The resulting chain code is the digitized curve; the order of this curve segment may also be pi→b0→b7, and its corresponding Freeman chain code becomes 06. Therefore, when using the Freeman chain code to lift the rail profile, the starting order must be specified, and then the binarization curve trajectory detected by the Sobel operator is extracted, and the extracted chain code is filtered according to the characteristics of the rail. The line segments are extracted, and the track boundary is obtained.

B. OBSTACLE DETECTION METHOD
1. COORDINATE SYSTEM FUSION. The trackside obstacle detection device mainly uses the fusion technology of machine vision and lidar. When the two are used together, the key is the fusion calibration and conversion of the coordinate system. The world coordinate system can be used as a conversion bridge to find the relationship between the two. The coordinate points (X′, Y′, Z′) of the lidar scanning point in the world coordinate system are 8 < : Among them, R represents the distance from the scanning point of the lidar to the center point; α represents the horizontal angle between the laser and the radar; ω represents the vertical angle of the emitted laser and the horizontal plane. The Y′ axis represents the direction pointed by the lidar, which is generally the direction of train   advancement; the Z′ axis represents the vertical upward direction of the train; and the X′ axis represents the other direction that meets the right-hand rule. The points (X′, Y′, Z′) in the world coordinate system can be expressed as: 2 Among them, R represents the rotation matrix relationship between the camera coordinate system and the world coordinate system; T represents the translation relationship between the two coordinate systems after rotation.

IMPROVED FRAME DIFFERENCE METHOD BASED ON
PARTIAL BACKGROUND UPDATE. For obstacle detection in ROI region, this paper adopts improved frame difference method based on partial background update. The foreground distribution interval can be obtained from the foreground distribution sequence [a i , b i ] (i ∈ (1, n)), where n is the number of intervals. For each distribution interval, the statistics of the foreground distribution along the other direction in this interval can be used to determine the rectangular position of each foreground concentrated distribution area. The set of these rectangular regions is defined as the background nonupdated region, which is described by the background mask (BM) (x, y): where F i (y) is the foreground distribution in the other direction in the interval [a i , b i ]. BM (x, y) = 1 means that pixel (x, y) participates in background calculation, and BM (x, y) = 0 means that pixel (x, y) does not participate in background calculation. After determining the area that is not involved in the background update, the current frame and the existing background are superimposed in a certain proportion to achieve the background update. The formula is as follows: where B n represents the updated background, and B n−1 represents the existing background, α is the update rate, which satisfies α ∈ (0,1). A larger value indicates that the current frame has a greater influence on the update background, that is, the faster the update speed. The above background update algorithm also requires an initial background, which is generally calculated by the following n frames: where I i (x, y) is the ith frame image. Using the background frame difference method, according to the information collected by the trackside obstacle detection device, the gray value of each frame image is subtracted from the background gray value to obtain a difference image id (x', y', i): idðx 0 ,y 0 ,iÞ = f ðx 0 ,y 0 ,iÞ − bðx,y,i0Þ, ( 1 2 ) where b (x, y, i 0 )-the initial video image of the image acquisition device near the track inside the tunnel, that is, the background model; f (x', y', i)-each current frame image; (x, y)-2D image position coordinates; i-the number of image frames; i 0 -the number of initial image frames, generally 0. By setting an image threshold T, a binary difference image can be obtained: According to the data collected by machine vision, the position and shape information of the obstacles are detected, supplemented by the height information and position information of the obstacle detected by the lidar, to determine whether the obstacle has an impact on the train operation, and judge the influence degree level, and then carry on the subsequent transmission of the test result information in grades.

C. OBSTACLE INFORMATION TRANSMISSION
The principle of the obstacle invasion limit alarm message disposal is to compress the time required for the alarm message to trigger the breaking of the first approaching dangerous train to the greatest extent possible. In order to minimize the impact of obstacle invasion limits on driving safety, and to reduce the rate of misjudgment, the detection results of obstacles are classified into danger levels.   of danger levels is judged by the location, size, height, etc., of obstacles. For obstacles with higher danger levels, the signal system direct response mode is adopted. After receiving alarm information, train control, radio block center (RBC) and other equipment approach the first. The dangerous train automatic train protection (ATP) onboard equipment sends a new driving permit (MA), or an unconditional emergency stop message. For obstacles with lower danger levels, the manual mode is used to transmit the obstacle information to the approaching trains, dispatching stations, station duty stations, etc., which are handled manually, and the trains are finally controlled. The obstacle information transmission diagram is shown in Fig. 4.

IV. APPLICATION
According to the previous model method, python is used for simulation. The main simulation contents are identifying the trajectory line, dividing the ROI, and detecting obstacles.

A. TRACK-LINE DETECTION
According to the detected track line (Fig. 5), the range of Δu can be widened to the left and right according to the railway traffic safety criteria, which is the ROI. Dividing a straight section ROI into an example is shown in Fig. 6.

B. OBSTACLE DETECTION
According to the principle of partially updating the background, obstacle detection is realized, and the results are shown in Fig. 7. When there is an obstacle in the ROI area, according to the size and position of the obstacle, the height information of the obstacle detected by the lidar is added to determine whether it exceeds the set threshold range and detect it. In the experiment, the complex environmental conditions such as sunny day, cloudy day, and windy day were collected as the experimental basis, and the environmental influence was eliminated in the image preprocessing to the maximum extent, and the interference error of environmental factors was reduced as far as possible, so that the detection accuracy was higher.
In order to facilitate the analysis of the detection results, the horizontal projection and vertical projection of the detection results of frame 159 are shown in Figs. 8 and 9.
It can be seen from the above horizontal and vertical projection images that there are many noise points in the detection results of frame difference method, which makes it impossible to accurately locate foreign bodies. However, the improved algorithm in this   paper can eliminate noise points, locate foreign bodies accurately, and achieve good detection effect.

C. OBSTACLE INFORMATION TRANSMISSION
When the obstacle information is detected in the ROI area, if the hazard level of the obstacle is high, the direct response mode of the signal system is adopted to transmit the obstacle information to the rail side equipment, and then it is transmitted to the train control or RBC through the global system for mobile communicationsrailway/general packet radio service (GSM-R/GPRS) network. And send a driving permission to the corresponding ground subsystem, the on-board subsystem, and the ground subsystem realize two-way communication, so as to control the first approaching train to achieve early warning and control. If the danger level of the obstacle is low, the manual processing mode is used to transmit the information to the driver or the dispatcher's desk for manual judgment to control the train operation. Schematic diagram of obstacle information transmission is shown in Fig. 10.

V. CONCLUSION
Obstacle detection technology of urban rail transit is an essential driving security technology in railway running system. Its detection   method, detection accuracy, and processing of detection result information are very important. This paper mainly adopted the method of multisensor technology fusion to detect and judge the obstacles in the track area, and implemented the control mode of different response modes for the train according to the danger level, in order to guarantee the driving safety. The obstacle detection method described in this paper could realize the real-time detection of obstacles with high detection accuracy and good control mode, which can provide a safe and comfortable riding environment for urban rail transit and even railway traffic. Today, urban rail transit nationwide is focusing on creating smart travel, establishing key projects such as intelligent display systems, intelligent vehicle operation and maintenance platforms, and intelligent inspections. The technology developed in this paper focused on this direction, which significantly improved the automation and intelligence of the urban rail transit system and jointly guaranteed driving safety, which had great application value.