diff options
author | Théo de la Hogue | 2023-08-30 23:15:59 +0200 |
---|---|---|
committer | Théo de la Hogue | 2023-08-30 23:15:59 +0200 |
commit | 31df32870f06460be8069c171cb032f5aa74a098 (patch) | |
tree | 56e6c37209166f526f9207cc1005ccdb26774892 /docs/user_guide/gaze_analysis_pipeline/background.md | |
parent | 6cce228412f3f3b074fdaf87775b8d62a5adb060 (diff) | |
download | argaze-31df32870f06460be8069c171cb032f5aa74a098.zip argaze-31df32870f06460be8069c171cb032f5aa74a098.tar.gz argaze-31df32870f06460be8069c171cb032f5aa74a098.tar.bz2 argaze-31df32870f06460be8069c171cb032f5aa74a098.tar.xz |
More documention about gaze analysis pipeline.
Diffstat (limited to 'docs/user_guide/gaze_analysis_pipeline/background.md')
-rw-r--r-- | docs/user_guide/gaze_analysis_pipeline/background.md | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/docs/user_guide/gaze_analysis_pipeline/background.md b/docs/user_guide/gaze_analysis_pipeline/background.md new file mode 100644 index 0000000..420dbdf --- /dev/null +++ b/docs/user_guide/gaze_analysis_pipeline/background.md @@ -0,0 +1,56 @@ +Add Background +============== + +Background is an optional [ArFrame](../../argaze.md/#argaze.ArFeatures.ArFrame) attribute to display any image. + +![Background](../../img/ar_frame_background.png) + +## Load and display ArFrame background + +[ArFrame.background](../../argaze.md/#argaze.ArFeatures.ArFrame.background) can be enabled thanks to a dedicated JSON entry. + +Here is the JSON ArFrame configuration file example where a background picture is loaded and displayed: + +```json +{ + "name": "My FullHD screen", + "size": [1920, 1080], + ... + "background": "./joconde.png", + ... + "image_parameters": { + ... + "background_weight": 1 + } +} +``` + +Now, let's understand the meaning of each JSON entry. + +### Background + +The path to an image file on disk. + +### Background weight + +The weight of background overlay in [ArFrame.image](../../argaze.md/#argaze.ArFeatures.ArFrame.image) between 0 and 1. + +## Edit ArFrame background + +It is also possible to set background image and display it from script: + +```python +import numpy + +# Assuming an ArFrame is loaded +... + +# Set ArFrame background as gray +ar_frame.background = numpy.full((ar_frame.size[1], ar_frame.size[0], 3), 127).astype(numpy.uint8) + +# Get ArFrame image with background and any other options +ar_frame_image = ar_frame.image(background_weight = 1, ...) + +# Do something with ArFrame image +... +``` |