From 8fc18a434da400f0fe82707e23838d6cc40a787d Mon Sep 17 00:00:00 2001 From: Théo de la Hogue Date: Wed, 3 Jul 2024 17:14:43 +0200 Subject: Rewriting eye tracking context and gaze analysis sections. --- docs/user_guide/utils/demonstrations_scripts.md | 16 +++-- .../utils/estimate_aruco_markers_pose.md | 60 +++++++++++++++++++ docs/user_guide/utils/main_commands.md | 56 ++++++++++++++++++ docs/user_guide/utils/ready-made_scripts.md | 69 ---------------------- 4 files changed, 128 insertions(+), 73 deletions(-) create mode 100644 docs/user_guide/utils/estimate_aruco_markers_pose.md create mode 100644 docs/user_guide/utils/main_commands.md delete mode 100644 docs/user_guide/utils/ready-made_scripts.md (limited to 'docs/user_guide/utils') diff --git a/docs/user_guide/utils/demonstrations_scripts.md b/docs/user_guide/utils/demonstrations_scripts.md index f293980..dd1b8e0 100644 --- a/docs/user_guide/utils/demonstrations_scripts.md +++ b/docs/user_guide/utils/demonstrations_scripts.md @@ -11,18 +11,26 @@ Collection of command-line scripts for demonstration purpose. ## Random context -Load **random_context.json** file to analyze random gaze positions: +Load **random_context.json** file to process random gaze positions: ```shell python -m argaze load ./src/argaze/utils/demo/random_context.json ``` -## OpenCV window context +## OpenCV cursor context -Load **opencv_window_context.json** file to analyze mouse pointer positions over OpenCV window: +Load **opencv_cursor_context.json** file to process cursor pointer positions over OpenCV window: ```shell -python -m argaze load ./src/argaze/utils/demo/opencv_window_context.json +python -m argaze load ./src/argaze/utils/demo/opencv_cursor_context.json +``` + +## OpenCV movie context + +Load **opencv_movie_context.json** file to process movie pictures and also cursor pointer positions over OpenCV window: + +```shell +python -m argaze load ./src/argaze/utils/demo/opencv_movie_context.json ``` ## Tobii Pro Glasses 2 diff --git a/docs/user_guide/utils/estimate_aruco_markers_pose.md b/docs/user_guide/utils/estimate_aruco_markers_pose.md new file mode 100644 index 0000000..3d34972 --- /dev/null +++ b/docs/user_guide/utils/estimate_aruco_markers_pose.md @@ -0,0 +1,60 @@ +Estimate ArUco markers pose +=========================== + +This **ArGaze** application detects ArUco markers inside a movie frame then, export pose estimation as .obj file into a folder. + +Firstly, edit **utils/estimate_markers_pose/context.json** file as to select a movie *path*. + +```json +{ + "argaze.utils.contexts.OpenCV.Movie" : { + "name": "ArUco markers pose estimator", + "path": "./src/argaze/utils/demo/tobii_record/segments/1/fullstream.mp4", + "pipeline": "pipeline.json" + } +} +``` + +Sencondly, edit **utils/estimate_markers_pose/pipeline.json** file to setup ArUco camera *size*, ArUco detector *dictionary*, *pose_size* and *pose_ids* attributes. + +```json +{ + "argaze.ArUcoMarker.ArUcoCamera.ArUcoCamera": { + "name": "Full HD Camera", + "size": [1920, 1080], + "aruco_detector": { + "dictionary": "DICT_APRILTAG_16h5", + "pose_size": 4, + "pose_ids": [], + "parameters": { + "useAruco3Detection": 1 + }, + "observers":{ + "observers.ArUcoMarkersPoseRecorder": { + "output_folder": "_export/records/aruco_markers_group" + } + } + }, + "sides_mask": 420, + "image_parameters": { + "background_weight": 1, + "draw_gaze_positions": { + "color": [0, 255, 255], + "size": 4 + }, + "draw_detected_markers": { + "color": [255, 255, 255], + "draw_axes": { + "thickness": 4 + } + } + } + } +} +``` + +Then, launch the application. + +```shell +python -m argaze load ./src/argaze/utils/estimate_markers_pose/context.json +``` \ No newline at end of file diff --git a/docs/user_guide/utils/main_commands.md b/docs/user_guide/utils/main_commands.md new file mode 100644 index 0000000..4dd3434 --- /dev/null +++ b/docs/user_guide/utils/main_commands.md @@ -0,0 +1,56 @@ +Main commands +============= + +The **ArGaze** package comes with top-level commands. + +!!! note + *Use -h option to get command arguments documentation.* + +## Load + +Load and execute any [ArContext](../../argaze.md/#argaze.ArFeatures.ArContext) from a JSON CONFIGURATION file + +```shell +python -m argaze load CONFIGURATION +``` + +This command should open a GUI window to display the image of the context's pipeline. + +![ArGaze load GUI](../../img/argaze_load_gui.png) + +### Send command + +Use -p option to enable pipe communication at given address: + +```shell +python -m argaze load CONFIGURATION -p /tmp/argaze +``` + +Open another tab in the **same** Terminal window then, you can send any Python command into the pipe. + +For example: + +* Print context: +```shell +echo "print(context)" > /tmp/argaze +``` + +* Pause context processing: + +```shell +echo "context.pause()" > /tmp/argaze +``` + +* Resume context processing: + +```shell +echo "context.resume()" > /tmp/argaze +``` + +## Edit + +Modify the content of JSON CONFIGURATION file with another JSON CHANGES file then, save the result into an OUTPUT file + +```shell +python -m argaze edit CONFIGURATION CHANGES OUTPUT +``` diff --git a/docs/user_guide/utils/ready-made_scripts.md b/docs/user_guide/utils/ready-made_scripts.md deleted file mode 100644 index 892fef8..0000000 --- a/docs/user_guide/utils/ready-made_scripts.md +++ /dev/null @@ -1,69 +0,0 @@ -Ready-made scripts -================== - -Collection of command-line scripts to provide useful features. - -!!! note - *Consider that all inline commands below have to be executed at the root of ArGaze package folder.* - -!!! note - *Use -h option to get command arguments documentation.* - -## Load ArContext JSON configuration - -Load and execute any [ArContext](../../argaze.md/#argaze.ArFeatures.ArContext) from a JSON CONFIGURATION file - -```shell -python -m argaze load CONFIGURATION -``` - -### Send command - -Use -p option to enable pipe communication at given address: - -```shell -python -m argaze load CONFIGURATION -p /tmp/argaze -``` - -Open another tab in the **same** Terminal window then, you can send any Python command into the pipe. - -For example: - -* Print context: -```shell -echo "print(context)" > /tmp/argaze -``` - -* Pause context processing: - -```shell -echo "context.pause()" > /tmp/argaze -``` - -* Resume context processing: - -```shell -echo "context.resume()" > /tmp/argaze -``` - -## Edit JSON configuration - -Modify the content of JSON CONFIGURATION file with another JSON CHANGES file then, save the result into an OUTPUT file - -```shell -python -m argaze edit CONFIGURATION CHANGES OUTPUT -``` - -## Estimate ArUco markers pose - -This application detects ArUco markers inside a movie frame then, export pose estimation as .obj file into a folder. - -Firstly, edit **utils/estimate_markers_pose/context.json** file as to select a movie *path*. - -Sencondly, edit **utils/estimate_markers_pose/pipeline.json** file to setup ArUco detector *dictionary*, *pose_size* and *pose_ids* attributes. - -Then, launch the application. - -```shell -python -m argaze load ./src/argaze/utils/estimate_markers_pose/context.json -``` \ No newline at end of file -- cgit v1.1