Skip to main content
All CollectionsFLOW - real-time monitoringAdvanced settings
How to set up traffic lights state monitoring
How to set up traffic lights state monitoring

Step-by-step guide for detecting traffic lights states with FLOW 1.13 or newer version.

DataFromSky avatar
Written by DataFromSky
Updated over 2 years ago

From FLOW framework version 1.13 you are now able to detect the traffic lights states in real-time utilizing video analysis inside the built-in traffic lights detector. All you need is an IP camera and a device running FLOW. The traffic lights state data can then be used in FLOW Insights to generate condition-based statistics or for live adjustment of the traffic light signal timing. This means you can detect red-light running and increase safety through adaptive traffic control and interactive traffic signs. You can do this for as many traffic lights as you need at the same time. In this short guide, we will walk you through the setup of traffic light state detection in FLOW Insights and important details that will help you get 100% results.

How to create a traffic light detector

To start detecting traffic lights states you need to come to the Traffic lights settings section under Analytics settings and highlight the area of the different traffic lights you want to detect as shown in the GIF below.

  1. Select the tool for creating the traffic lights state detector.

  2. Draw around the traffic lights in the footage. Close the shape to finish the definition. For single/double light traffic lights that are on the side of the main traffic lights, you need to create separate detectors.

  3. A polygon will be created and you will be able to name it in the fields below the setup window. Please note that this name will be visible in the name of the automatically created widget for visualizing the current traffic light state in the dashboard.

You can create as many traffic lights state detectors as you want but make sure that each individual traffic light has more than 20px in diameter (detection resolution pixels) to get accurate results. Watch the GIF above to see how you can set up the traffic lights state detectors.

In the scheme below you can see the supported traffic lights types:

Red-Orange (red and orange traffic lights ON at the same time) are represented as orange in our traffic lights detection scheme. We are also able to interpret the car signalization lights on railroad crossings. For these lights, the white light means “good to go” and is represented by green in our scheme.

Detector state in the traffic expression widget

You can use the state of the traffic lights in the expression widget such as a simple value or statistical widget. This allows you to create a conditional evaluation based on the current state of the traffic lights which may be needed if you want to, for example, count the number of redlight runners. The traffic lights state instanced via expression widget can be communicated via Webhooks. In the expression definition, the traffic lights states are substituted by integer values. See the guide below:

Additional information

Traffic lights state detection is available from FLOW 1.13 for TrafficEnterprise, TrafficXRoads, and TrafficEmbedded. The specific configuration can differ based on the VA modules (addons). When the traffic lights start blinking the output state of detection might switch between OFF and the currently visible state. The detection of traffic lights is running in real-time and is done roughly three times a second. The delay is determined by the transmission and the camera and is usually below 300ms.

Conclusion

So now you know how to create traffic lights state detection and how to work with it inside the expression widget. To learn more about the expression widget, click on the highlighted link. We hope you found this guide helpful. In case you need support, click the button on the bottom right to chat with us or contact us here. We're happy to help!

Did this answer your question?