queryType="zone"
)figures/shape is a required parameter. It sets the zone the object to be within as the list of polygon apexes. Coordinates are set in fractions of frame width/height (values from 0 to 1). It allows not to be tied to specific camera resolution.
The simplest request looks like this:
{ "queryType": "zone", "figures": [ { "shape": [ [0.3, 0.3], [0.7, 0.3], [0.7, 0.7], [0.3, 0.7] ] } ] }
Here the zone describes the rectangular in the centre of camera field of view.
queryProperties/action is an optional parameter of the request:
queryProperties/action="enter"
− objects entering the zone are searched.queryProperties/action="exit"
− objects exiting the zone are searched.Here is an example of request for objects entering the zone:
{ "queryType": "zone", "figures": [ { "shape": [ [0.3, 0.3], [0.7, 0.3], [0.7, 0.7], [0.3, 0.7] ] } ], "queryProperties": { "action": "enter" } }
(queryType="transition"
)There is one required parameter − figures. It has to contain two zones describing start and end zones.
There are no optional parameters.
Search for objects that moved from the left part of the frame to the right one:
{ "queryType": "transition", "figures": [ { "shape": [ [0, 0], [0.45, 0], [0.45, 1], [0, 1] ] }, { "shape": [ [0.55, 0], [1, 0], [1, 1], [0.55, 1] ] } ] }
queryType="line"
)Required parameter figures defines a segment crossing of which triggers the condition. The segment is to be set by two points.
{ "queryType": "line", "figures": [ { "shape": [ [0.5, 0.8], [0.5, 0.2] ] } ] }
Optional parameter queryProperties/direction sets direction of line crossing.
{ "queryType": "line", "figures": [ { "shape": [ [0.5, 0.8], [0.5, 0.2] ] } ], "queryProperties": { "direction": "left" } }