Having previously set a goal and agreed on a plan for testing the software and hardware complex for detecting traffic violations at regulated railway crossings, we chose the Engineering Center of the Oktyabrskaya Railway as an object for testing. A full-scale model of a railway crossing was implemented there, on which a camera and a complex for fixing violations were installed:
The process of debugging and testing video analytics with the traffic light on on the layout
Objectives:
- detecting the state of a traffic light at a crossing in the camera's field of view
- fixation of vehicle passages through the crossing with recognition and recording of numbers at a red traffic light
The composition of the used hardware and software complex:
- IP camera, 2 MP
- Industrial PC Outdoor Box Micro, 2 GB RAM, CPU Intel Atom x5, VPU Movidius
- Switch
- EDGE software for detection and recognition of state registration plates of vehicles
Traffic light state detection algorithm:
- Receiving RTSP stream from a camera
- Cutting a stream into frames
- Framing the detection area of ββthe status of signal lamps
- Obtaining the brightness value for each lamp in N-frames / seconds
- Binarization of brightness values ββby threshold
- Checking the operation of lamps in antiphase over the entire analyzed interval of N-frames / seconds
- Return of traffic light state with a delay from real time in N-frames / seconds
Before binarization, the check if the lamps are in antiphase looks like this:
After binarization:
0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1
1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0
Demonstration of detector operation:
Detecting the state of a railway traffic light using object video analytics
Problems that we encountered while implementing:
- You cannot simply detect the color value or the amount of red in the area, because at night the camera turns on the IR illumination and the image becomes black and white.
- Even when measuring the brightness value, you cannot use data from only one lamp, since blinking, for example, by emergency stop signals of a vehicle or a direction indicator, will fix the reflection in the lamp and a smooth change in brightness up and down. It is clear that it is possible to be tied to the wavelength, but this does not negate the simple possibility of remotely influencing the state of the traffic light from the outside.
- Sometimes traffic lights work unpredictably and it is necessary to minimize random emissions after binarization, for example, a situation is acceptable when two lamps are lit red at the same time or the brightness values ββchange stepwise with a constant but less attenuation.
Expectation and reality in the work of railway traffic lights
Solution advantages:
- Lack of capital costs and approvals for the laying of cable routes
- No need for integration with railway automation
- Availability of the possibility of quick start-up in the field (installation of cameras, marking of zones, industrial operation)
- Availability of the possibility of post-processing data on the video archive
- Stability of operation at different times of the day (when comparing measurements of changes in brightness over a period and color detection)