blob: 855e3024c4cad8180bfd7cd1190bcb50e1c386c7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
---
title: AOI frame
---
AOI Frame
=========
[AOIFeatures](/argaze/#argaze/AreaOfInterest.AOIFeatures) provides [AOIFrame](/argaze/#argaze/AreaOfInterest.AOIFeatures.AOIFrame) class to draw into an 2D AOI.
## Point spread
The **point_spread** method draw a gaussian point spread into the frame at a given pointer position.
![Point spread](../../img/point_spread.png)
## Heatmap
Heatmap visualisation allows to show where a pointer is most of the time.
![Heatmap](../../img/heatmap.png)
```python
from argaze.AreaOfInterest import AOIFeatures
# Create an AOI
aoi = AOIFeatures.AreaOfInterest([[0, 0], [1, 0], [1, 1], [0, 1]])
# Create AOIFrame related to this AOI with 800px * 600px resolution
aoi_frame = AOIFeatures.AOIFrame(aoi, (800, 600))
# Initialize heatmap
aoi_frame.heatmap_init()
# Assuming a pointer position (x, y) is moving inside frame
...:
# Update heatmap at pointer position
aoi_frame.heatmap_update((x, y), sigma=0.05)
# Do something with heatmap picture
... aoi_frame.heatmap
```
|