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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
Add Heatmap
===========
Heatmap is an optional [ArFrame](../../argaze.md/#argaze.ArFeatures.ArFrame) pipeline step. It is executed at each new gaze position to update heatmap image.
![Heatmap](../../img/ar_frame_heatmap.png)
## Enable and display ArFrame heatmap
[ArFrame.heatmap](../../argaze.md/#argaze.ArFeatures.ArFrame.heatmap) can be enabled thanks to a dedicated JSON entry.
Here is the JSON ArFrame configuration file example where heatmap is enabled and displayed:
```json
{
"name": "My FullHD screen",
"size": [1920, 1080],
...
"heatmap": {
"size": [320, 180],
"sigma": 0.025,
"buffer": 0
},
...
"image_parameters": {
...
"heatmap_weight": 1
}
}
```
Then, here is how to access to heatmap object:
```python
# Assuming an ArFrame is loaded
...
print("heatmap:", ar_frame.heatmap)
```
Finally, here is what the program writes in console:
```txt
heatmap: Heatmap(size=[320, 180], buffer=0, sigma=0.025)
```
Now, let's understand the meaning of each JSON entry.
### Size
The heatmap image size in pixel. Higher size implies higher CPU load.
### Sigma
The gaussian point spreading to draw at each gaze position.
![Point spread](../../img/point_spread.png)
### Buffer
The size of point spread images buffer (0 means no buffering) to visualize only last N gaze positions.
### Heatmap weight
The weight of heatmap overlay in [ArFrame.image](../../argaze.md/#argaze.ArFeatures.ArFrame.image) between 0 and 1.
|