How to set gates to count objects in your video?

How to count each kind of object in one or both directions and get advanced analysis such as O-D matrix, gaptime or average speed?

DataFromSky avatar
Written by DataFromSky
Updated over a week ago

Do you want to count vehicles in your video? Sure, no problem, first you have to set your own Gates. Gates are virtual lines that are crossed by vehicles and other tracked objects. You can set your own gates at any place in the video and you can change them any time you want. Gates are used to counting each kind of object in one or both directions or you can set gates to get more advanced analysis such as O-D matrix, gap time, time to follow, or average speed of the object within two gates and others.

If this is your first time working with DataFromSky Viewer, check the article How to export data from DataFromSky Viewer in 5 minutes

For setting the gate you have to open the tracking log with your video through DataFromSky Viewer and Configure a new Annotation. To get to Annotations, click on Tracking Log and then on Manage Annotation Configurations.

There you clone the current one, activate the newly created one after cloning, and click on Edit to start configuring gates and zones in a configuration window.

Now you can set gates for your O-D matrix. Gates are virtual lines that are crossed by vehicles and other tracked objects. They are in the form of a line consisting of straight segments connecting points, so you need at least 2 points to create them. Set the characteristics of the gate in the right menu:

  • Gate Type – Sets whether the gate is an entry, exit, or neutral. Set Entry Gate to places where vehicles enter the intersection, roundabout, or the traffic. Set Exit Gate to places where vehicles exit the intersection, roundabout, or the traffic. Entry and Exit gates are used for the export of the O-D matrix. Neutral Gates are not used for O-D Matrix, but you can export gate crossing data for these gates.

  • Gate Direction – Sets the direction in which passing objects should be tracked by the gate. Positive direction points up, negative direction points down. The bi-Directional option counts objects in both directions. To be sure, see arrow-direction by each gate. 

  • Angular Sensitivity – Adjusts the sensitivity of the gate depending on the angle of the passing object.

  • Allowed Objects – After clicking on this menu you can choose what kind of object the gate will count. (Car, Medium Vehicle, Heavy Vehicle, etc.).

  • Allowed Colors – Only in LIGHT mode. Sets which object colors the gate will count.

  • Tag – This field is used to set the gate name.

After setting the desired properties, confirm the gate settings with the Finish Editing button. In this menu, you can choose Edit Annotation and change the line shape as well. You can move the created point by clicking and dragging the mouse. Point can be removed by right-clicking and selecting Remove Control Point. 

By repeating positioning and setting gates set the whole network of virtual gates. Once you are done with gates, click Confirm Annotation Redefinition in the left bottom corner. In Annotation Configuration Manager selects the new configuration as Active and press the Apply button.

Now you can display all traffic gates by pressing the button Show Traffic Gates in the top menu and the list of gates in the right-bottom corner, where you can go through the statistics per each selected gate (including the possibility to export data to .CSV file).

If you want to see the number of gate crossing, you can change it in section View – Switch Gate Label – Show Gate Crossings.

Congrats! You have set your gates! Now check the article How to export gate crossing data. If you are looking for export of the OD matrix, see an article How to export the Origin-Destination matrix. For visual exports check the article How to make a visual export from DataFromSky Viewer.

We will be happy to answer any questions you may have. Contact us!

Did this answer your question?