Being able to analyze traffic for longer time periods and getting statistics out of them has been one of the main goals driving FLOW's development. Thanks to this, our clients all over the world can gain insights into how traffic flows in their particular area, feed the resulting data into their traffic models, design better solutions and better infrastructure for everyone. All of this from a video camera feed—without any induction loops. This article explains how to set up your FLOW device for a survey and how to obtain its results after it's finished.
However, this guide is quite advanced and there's some prerequisite knowledge that's expected in order to understand it well. Please read the following articles first if you're not familiar with them:
This is the bare minimum, but reading all articles in the operators and widgets section in our help center will certainly help you design the perfect analytics for your needs.
First, set up a camera to oversee a scene you want to survey. Then create and publish an RTSP stream from the camera.
Next, make sure you have your FLOW device up and running, launch FLOW Insights and log in as a user with Analyst or higher user privileges. Create an analytic with a valid source RTSP stream address (see Adding IP cameras to FLOW for details), or select an existing analytic.
While in the analytics definition screen, set up the operators and widgets to capture the information that you need. If you'd like any data that have something to do with the speed, it's recommended to also configure the georegistration so that the resulting speeds will be in km/h instead of kilopixels per hour.
We'll show a simple example of a traffic survey setup. If you ever need more explanation or illustration, check out our OD matrix how-to guide, which features a very similar example in a video.
In this example, let's say our scene contains an intersection and we want to find out how much traffic crosses it in each hour for 24 hours, divide the traffic participants into categories and get their entry and exit point data for the intersection. This will be easy to do with Distribution and OD matrix widgets. However, widgets need to be attached to an operator. Since we're interested in the whole area of the intersection, we need one that selects all trajectories in the scene. In our case, we use the Category filter that includes all categories except pedestrians, because our survey is interested only in road users.
Now we can attach the Distribution and OD matrix widgets to it.
(The number under the operator shows how many traffic objects the operator has registered for the duration of its existence.)
Now, to be of any use, the OD matrix requires the user to designate gates as origin and destination points. Let's set up a gate at each road leading to the intersection.
Now we can set up the OD matrix widget properly. First, let's check all the origin and destination gates.
Then let's select the time mode. Time modes are explained in detail in a dedicated article. We'll keep the Time mode set to Whole history, because we want the OD matrix' results for the whole duration of its existence.
Now we set up the Distribution widget. We check the boxes for all the categories we're interested in.
And we select the Time mode. Let's say that we'd like the resulting data separated into five-minute time blocks. This way, we'll see how much traffic was in the scene for each five-minute interval and for each category. Finally, we select that the Current time block will be displayed on the Dashboard. Please note that because of the fact that we are using the current time block we will get data right away but it will always be incomplete in the dashboard (an always open time block) but this does not bother us at the time of export.
And we can look at our setup on the Dashboard.
Everything seems to be okay. The only thing left to do before leaving the survey to collect data is to check the Analytic settings, which are explained in-depth here. In general, you'll want to pay attention at least to the autosave settings, but other settings can also be useful for your specific scene or use case.
Once you've checked and tweaked the settings to your needs, you can close FLOW Insights and leave the FLOW Node and Block to collect your data for as long as you need. (However, if you launched FLOW as a Demokit, then the FLOW Node and Block will close together with Insights. In this case, you need to leave it open.)
There's one more thing to keep in mind when leaving FLOW running for an extended period of time—its limited trajectory cache capacity. You can check the cache status on the Diagnostics screen of the analytics.
If you'd like to clear the cache before your survey starts, you can do so in the Analytics settings in the Reset section.
Now there's nothing left to do but wait for the data collection.
Once enough time has passed, you can launch FLOW Insights again and download the survey's results. You can do so in the analytics' Dashboard. For each widget, select the "..." in the upper right corner, then select Export to .csv or Export to .xlsx. The output format depends on the widget type.
You'll see a window where you can set details of the export—the time window, timestamp format, and the target path of the resulting file.
The trajectories that will be included in the results are determined by whether their closing time falls within the time interval that you select.
Whole history includes everything that's in the trajectory cache.
Offset window allows you to define the size of the time window and the offset of its end from the present into the past. Only trajectories that have been closed within this window will be included.
From → to allows you to define the time window in absolute time. You can also edit the Duration field to alter the contents of To based on From.
Timestamp format determines the format of all timestamps in the resulting file.
Milliseconds since epoch simply shows how many milliseconds have passed since the Unix epoch, which is 00:00:00 UTC on 1st January 1970. This format is suitable for further processing by computers but isn't very useful to humans.
ISO 8601 is a standard DateTime format that is easily understood by humans, but somewhat harder to process by computers.
Custom format is here for the cases where none of the previous DateTime formats are suitable. It requires you to input a so-called format string which serves as a template for FLOW to fill the DateTime information in. You can find more information by hovering over the "i" symbol with your mouse.
Once you have selected your preferences, the file can then be exported.
Not all widgets currently support such export customization, however.
Value, statistical value, and distribution widgets are exported as .csv and support the customization mentioned earlier.
Table and OD matrix widgets are exported as .xlsx and allow you to select only the destination path. Their export time window is the same as what you set as their time mode in their widget setting. Beware that if you set the time mode to Time blocks, only the selected block (Current, Previous...) will be exported.
Heatmap and the trajectory view widgets can't be exported.
Now that we exported our results, let's open them. We'll start with the OD matrix.
The resulting information is the same as what you would see in the Dashboard, including the row and column arrangement.
The distribution widget's output looks like this:
Since the widget's Time mode was set to 5-minute time blocks, each row corresponds to one block, as reflected in the start and end timestamps. The Data validity status tells you whether the time block has been finished, or whether it's incomplete (cropped). Here we see that the last block was cropped because we exported the result before it could be finished.
And that's it! We hope that after reading this article you have a good basic understanding with which you can conduct traffic survey that allows you to get precise knowledge about any traffic situation.
If you need further clarification or help, click the button on the bottom right to chat with us or contact us here. We're happy to help!