From 01378ae467b6399a13042f02a67010dfc820aee2 Mon Sep 17 00:00:00 2001 From: Théo de la Hogue Date: Mon, 4 Sep 2023 14:49:27 +0200 Subject: Moving scripting features into a dedicated advanced chapter. --- .../gaze_analysis_pipeline/background.md | 31 +++++----------------- 1 file changed, 7 insertions(+), 24 deletions(-) (limited to 'docs/user_guide/gaze_analysis_pipeline/background.md') diff --git a/docs/user_guide/gaze_analysis_pipeline/background.md b/docs/user_guide/gaze_analysis_pipeline/background.md index 420dbdf..a7d59f6 100644 --- a/docs/user_guide/gaze_analysis_pipeline/background.md +++ b/docs/user_guide/gaze_analysis_pipeline/background.md @@ -1,7 +1,7 @@ -Add Background -============== +Add a background +================ -Background is an optional [ArFrame](../../argaze.md/#argaze.ArFeatures.ArFrame) attribute to display any image. +Background is an optional [ArFrame](../../argaze.md/#argaze.ArFeatures.ArFrame) attribute to display any image behind pipeline visualisation. ![Background](../../img/ar_frame_background.png) @@ -9,7 +9,7 @@ Background is an optional [ArFrame](../../argaze.md/#argaze.ArFeatures.ArFrame) [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: +Here is an extract from the JSON ArFrame configuration file where a background picture is loaded and displayed: ```json { @@ -25,6 +25,9 @@ Here is the JSON ArFrame configuration file example where a background picture i } ``` +!!! note + As explained in [visualisation chapter](visualisation.md), the resulting image is accessible thanks to [ArFrame.image](../../argaze.md/#argaze.ArFeatures.ArFrame.image) method. + Now, let's understand the meaning of each JSON entry. ### Background @@ -34,23 +37,3 @@ 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 -... -``` -- cgit v1.1