In FLOW, spatial filters select only trajectories that intersect them in the video view. There are two buttons dedicated to creating them:
Selecting the upper button lets you create zones and gates, the lower button is for movements.
Gates
Let's create a gate! Select Create a Zone/Gate, then click and hold down the mouse button in the video view and draw a line. The line doesn't have to be perfectly straight. After releasing the button, you'll see the gate has been created.
Select Create a Zone/Gate again to exit the creation mode. Then select the new gate to enter editing mode. You can drag its endpoints to adjust its position. The bottom bar lets you edit its name or delete it. You can also change the positive direction of the gate here with the Change direction button. The positive direction is indicated by white arrows, whereas dark arrows stand for a negative direction.
If you drag the middle of the gate, you can move the whole gate around the video view, or you can drop it onto the canvas on the right, where it transforms into a canvas instance of the corresponding gate. Then you can connect it to any other operator.
So what does a gate filter actually do? It selects only trajectories that cross it. If you double-click the gate's representation on the canvas, you can set its name, and direction, or change it into a "Now" mode, in which it selects only objects with trajectories crossing the gate right now.
Directional control gives you a powerful tool to focus on trajectories crossing the gate in a specified direction. This option needs to be defined in the gate properties window. By default, gates are bi-directional, which means that trajectories crossing them in any direction are passed to their output.
The Calculate gap checkbox is for calculating both the time and distance between two objects that pass through the gate after each other and this data can then be used in the table widget, statistical value widget, or gap operator.
Zones
To create a zone:
Select Create zones/gates.
2. Draw a freehand shape on the road.
3. When you’re done, the shape will automatically be closed. Select Create zones/gates again to exit the creation mode.
Select the new zone to enter editing mode. You can drag its vertices to adjust its shape. Double-click a line to add a vertex, or double-click a vertex, then confirm with another click to remove it. The bottom bar lets you edit the zone's name or delete it.
If you drag the middle of the zone, you grab a representation of it that you can drop onto the canvas on the right. Then you can connect it to any other operator.
Zone filters select only trajectories that intersect them. In the filter's dialog window, you can switch it into "Now" mode, in which it selects only objects that are in the zone right now.
Adding another zone with the "Now" mode on into the chain deactivates this mode in all preceding zones.
Zone filters’ masks
Zone filters create a mask that crops selected trajectories to the part that lies inside the zone.
This cropping then applies to all values related to the trajectory, like average speed or time of passage. This effect can be seen by examining the following two example configurations, where ZONE 1 refers to the zone displayed in the above image.
Let’s consider a trajectory whose duration of occurrence (previously called time of passage) in the whole scene is 30 seconds. The vehicle that this trajectory belongs to passed through ZONE 1 in 3 seconds. Such a trajectory wouldn’t pass through the left analytic, because it first selects trajectories with the duration of occurrence of 5 seconds or less. The trajectory, however, would pass through the right analytic, because ZONE 1 would first crop the trajectory to the 3-second window of the vehicle passing through it.
Likewise, for example, the trajectory’s average speed calculation only considers data from inside ZONE 1.
The mask propagates through all operators that follow the zone filter. If more zone filters are in the operator chain, the cropping mask is decided by the last zone filter. Unions of cropping masks can be created with set operators.
Movements
To create a movement, select the Create movements button and draw a curved line in the video view. It should intersect some existing gates and zones. Select the button again to exit the creation mode.
Movements make sense only in conjunction with gates and zones. They select only trajectories that intersect all gates and zones that the movement intersects, and only in the same sequence.
Select the new movement to enter editing mode. You can drag its vertices to adjust its shape. Double-click on a line to add a vertex, or double-click a vertex, then confirm with another click to remove it. The bottom bar lets you edit the movement's name, change its direction, or delete it.
If you drag the part of the movement where there is no vertex, you grab a representation of it that you can drop onto the canvas on the right. Then you can connect it to any other operator.
Beware: If you create a gate or a zone over an existing movement, they will not be automatically paired. You can pair them manually by selecting the movement to go into its editing mode, then double click the gate or zone you want to pair it with, then click once more to confirm.
What next?
Check out property filters and set operators in more detail.
We will be happy to answer any questions you may have. Contact us!