1st, for doing that you’ll have to develop an application that reads the data from the TCP (or Web) socket, and updates a counter for each alley by adding people going  IN and subtracting people going OUT. That means, at least,  2 gates per alley, 1 at each end.

The 2 ways that can be used to retrieve the information are:

1.       - Message type GATE_COUNT_MSG: Sent every 15 minutes, it gives the number of In and Out during the last 15 minutes, for each gate

2.       - Message type GATE_SNAPSHOT_MSG: Sent Every time a gate is crossed, it gives the total number of In and Out for that gate since a given starting time (usually the last time that VidiGates was restarted)

The documents describing the socket protocol (TCP or Web) are in the technical documents section of your VidiSupport account. There is some sample code (but for viewers mode only) in the SDK directory of the VidiReports installation.

How to place the gates:

1st, you need to define the area that will be covered by each cameras. For that, you need to know the viewing angle of the camera, and the video resolution.  Then, at which height each camera can be placed. If we take for example a height of 5 meters, with a diagonal field of view of 120° an aspect ratio of 16:9, we’ll have, in theory,  a rectangle covering 15.1x8.4 meters. The same camera placed at 8 meters high will cover, in theory,  24.1x13.5 meters.


Each camera could theoretically handle 8 gates, thus 4 alleys. But, you have to take into account that the borders of the image are useless, and that the effective width and length of your rectangles should be reduced by about 20%. That’ll give you 12x6.7 meters for 5m high, and 19x11 meters for 8m high.


If you have maps including the precise dimensions of all the alleys that you want to measure, you can then draw on the map the effective rectangles first, and, second,  the gates that will be needed to monitor all INs and OUTs.

When you'll draw the gates in VidiGates, don't forget to orient the direction of your gates, and to give them meaningful names.