3,072
edits
Efernandez (talk | contribs) No edit summary |
Efernandez (talk | contribs) |
||
Line 45: | Line 45: | ||
== Service Configuration == | == Service Configuration == | ||
The service can be configured in 2 different ways: providing a configuration file via the '''-- | The service can be configured in 2 different ways: providing a configuration file via the '''--config-file''' CLI argument or via the '''/configuration''' request (see the [service API documentation]). In both cases, the configuration will be in JSON format as follows: | ||
<syntaxhighlight lang="JSON"> | <syntaxhighlight lang="JSON"> | ||
{ | { | ||
" | "heatmap": { | ||
" | "window_seconds": 3600, | ||
"cam0", | "eps": 40, | ||
"cam1" | "min_samples": 2, | ||
"update_period": 10 | |||
}, | |||
"engagement": [ | |||
{ | |||
"id": "cam0", | |||
"roi": [ | |||
{ | |||
"x": 0, | |||
"y": 1079 | |||
}, | |||
{ | |||
"x": 1919, | |||
"y": 1079 | |||
} | |||
] | |||
}, | |||
{ | |||
"id": "cam1", | |||
"roi": [ | |||
{ | |||
"x": 0, | |||
"y": 1079 | |||
}, | |||
{ | |||
"x": 1919, | |||
"y": 1079 | |||
} | |||
] | |||
} | |||
], | ], | ||
" | "db_update_period": 5, | ||
"message_expiration": 5 | |||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
The configuration entries are as follows: | The configuration entries are as follows: | ||
*''' | *'''heatmap:''' This is the configuration for the heatmap generation. | ||
*''' | **'''window_seconds:''' This is the window of time that will be used for the heatmap generation. Any sample older than this time will be discarded. | ||
**'''eps:''' This is the maximum distance between 2 samples to be considered part of the same group. | |||
**'''min_samples:''' This is the minimum number of samples in a group to be considered. Any group with less that this number of samples will be discarded. | |||
**'''update_period:''' This is the period used to generate and update the heatmap. Data will be constantly collected but the heatmap will be calculated and posted in redis with this period in seconds. | |||
*'''engagement:''' This is the data for engagement calculation. It is an array with one element per camera. | |||
**'''id:''' The id of the camera. | |||
**'''roi:''' This is the target region for the engagement. Any person whose direction points to this defined region is considered to be engaged. It supports 1 or 2 points. In case of one point, the person is considered to be engaged if it is looking at that point. In case of 2 points, the person is considered to be engaged if it is looking at the rect defined by the 2 points. | |||
*'''db_update_period:''' This is the period of time used to update the influx database with statistics. | |||
*'''message_expiration:''' This is the amount of seconds used for engagement messages expiration. If a person is not seen for this configured amount of time, the entry will automatically disappear from redis. | |||
== Heatmap == | == Heatmap == |