From da307162ca85bcd6433058528b9bd48de2ccaf93 Mon Sep 17 00:00:00 2001 From: Théo de la Hogue Date: Mon, 11 Mar 2024 12:11:08 +0100 Subject: Making timestamp as an optional PipelineStepMethod parameter required if the first parameter is not a TimestampedObject. --- .../advanced_topics/scripting.md | 2 +- .../aruco_markers_pipeline/aoi_3d_frame.md | 4 ++-- .../configuration_and_execution.md | 2 +- .../configuration_and_execution.md | 2 +- .../timestamped_gaze_positions_edition.md | 20 +++++++------------- 5 files changed, 12 insertions(+), 18 deletions(-) (limited to 'docs/user_guide') diff --git a/docs/user_guide/aruco_markers_pipeline/advanced_topics/scripting.md b/docs/user_guide/aruco_markers_pipeline/advanced_topics/scripting.md index 99f52ee..30787b5 100644 --- a/docs/user_guide/aruco_markers_pipeline/advanced_topics/scripting.md +++ b/docs/user_guide/aruco_markers_pipeline/advanced_topics/scripting.md @@ -81,7 +81,7 @@ for name, aruco_scene in aruco_camera.scenes.items(): try: # Watch image with ArUco camera - aruco_camera.watch(timestamp, image) + aruco_camera.watch(image, timestamp=timestamp) # Do something with pipeline exception except Exception as e: diff --git a/docs/user_guide/aruco_markers_pipeline/aoi_3d_frame.md b/docs/user_guide/aruco_markers_pipeline/aoi_3d_frame.md index 53d1ddb..cf4a07e 100644 --- a/docs/user_guide/aruco_markers_pipeline/aoi_3d_frame.md +++ b/docs/user_guide/aruco_markers_pipeline/aoi_3d_frame.md @@ -105,10 +105,10 @@ After camera image is passed to [ArUcoCamera.watch](../../argaze.md/#argaze.ArFe ...: # Detect ArUco markers, estimate scene pose then, project 3D AOI into camera frame - aruco_camera.watch(timestamp, image) + aruco_camera.watch(image, timestamp=timestamp) # Map watched image into ArUcoScenes frames background - aruco_camera.map(timestamp) + aruco_camera.map(timestamp=timestamp) ``` ### Analyse timestamped gaze positions into ArUcoScenes frames diff --git a/docs/user_guide/aruco_markers_pipeline/configuration_and_execution.md b/docs/user_guide/aruco_markers_pipeline/configuration_and_execution.md index 4f05beb..0349a91 100644 --- a/docs/user_guide/aruco_markers_pipeline/configuration_and_execution.md +++ b/docs/user_guide/aruco_markers_pipeline/configuration_and_execution.md @@ -110,7 +110,7 @@ Pass each camera image to [ArUcoCamera.watch](../../argaze.md/#argaze.ArFeatures try: # Detect ArUco markers, estimate scene pose then, project 3D AOI into camera frame - aruco_camera.watch(timestamp, image) + aruco_camera.watch(image, timestamp=timestamp) # Do something with pipeline exception except Exception as e: diff --git a/docs/user_guide/gaze_analysis_pipeline/configuration_and_execution.md b/docs/user_guide/gaze_analysis_pipeline/configuration_and_execution.md index de23713..633b736 100644 --- a/docs/user_guide/gaze_analysis_pipeline/configuration_and_execution.md +++ b/docs/user_guide/gaze_analysis_pipeline/configuration_and_execution.md @@ -110,7 +110,7 @@ Timestamped gaze positions have to be passed one by one to [ArFrame.look](../../ try: # Look ArFrame at a timestamped gaze position - ar_frame.look(timestamp, gaze_position) + ar_frame.look(gaze_position) # Do something with pipeline exception except Exception as e: diff --git a/docs/user_guide/gaze_analysis_pipeline/timestamped_gaze_positions_edition.md b/docs/user_guide/gaze_analysis_pipeline/timestamped_gaze_positions_edition.md index 2156f3b..4c53258 100644 --- a/docs/user_guide/gaze_analysis_pipeline/timestamped_gaze_positions_edition.md +++ b/docs/user_guide/gaze_analysis_pipeline/timestamped_gaze_positions_edition.md @@ -5,7 +5,7 @@ Whatever eye data comes from a file on disk or from a live stream, timestamped g ![Timestamped gaze positions](../../img/timestamped_gaze_positions.png) -## Import gaze positions from CSV file +## Import timestamped gaze positions from CSV file It is possible to load timestamped gaze positions from a [Pandas DataFrame](https://pandas.pydata.org/docs/getting_started/intro_tutorials/01_table_oriented.html#min-tut-01-tableoriented) object which can be loaded from a CSV file. @@ -20,13 +20,13 @@ dataframe = pandas.read_csv('gaze_positions.csv', delimiter=",", low_memory=Fals ts_gaze_positions = GazeFeatures.TimeStampedGazePositions.from_dataframe(dataframe, timestamp = 'Recording timestamp [ms]', x = 'Gaze point X [px]', y = 'Gaze point Y [px]') # Iterate over timestamped gaze positions -for timestamp, gaze_position in ts_gaze_positions.items(): +for gaze_position in ts_gaze_positions: # Do something with each timestamped gaze position ... ``` -## Edit gaze positions from live stream +## Edit timestamped gaze positions from live stream When gaze positions comes from a real time input, gaze position can be edited thanks to [GazePosition](../../argaze.md/#argaze.GazeFeatures.GazePosition) class. Besides, timestamps can be edited from the incoming data stream or, if not available, they can be edited thanks to the python [time package](https://docs.python.org/3/library/time.html). @@ -37,11 +37,8 @@ from argaze import GazeFeatures # Assuming to be inside the function where timestamp_µs, gaze_x and gaze_y values are catched ... - # Edit a second timestamp from a microsecond second timestamp - timestamp = timestamp_µs * 1e-6 - - # Define a basic gaze position - gaze_position = GazeFeatures.GazePosition((gaze_x, gaze_y)) + # Define a basic gaze position converting microsecond timestamp into second timestamp + gaze_position = GazeFeatures.GazePosition((gaze_x, gaze_y), timestamp=timestamp_µs * 1e-6) # Do something with each timestamped gaze position ... @@ -58,11 +55,8 @@ start_time = time.time() # Assuming to be inside the function where only gaze_x and gaze_y values are catched (no timestamp) ... - # Edit a millisecond timestamp - timestamp = int((time.time() - start_time) * 1e3) - - # Define a basic gaze position - gaze_position = GazeFeatures.GazePosition((gaze_x, gaze_y)) + # Define a basic gaze position with millisecond timestamp + gaze_position = GazeFeatures.GazePosition((gaze_x, gaze_y), timestamp=int((time.time() - start_time) * 1e3)) # Do something with each timestamped gaze position ... -- cgit v1.1