aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThéo de la Hogue2023-08-30 20:15:48 +0200
committerThéo de la Hogue2023-08-30 20:15:48 +0200
commitbc23a436adc66560cae6e36ae4266bc43ab612d5 (patch)
tree236a8dfe54a74222333e8bfbc5c28e3b7a11f34b
parent7ffb244289cef6d0fabee80dd369396ac845203c (diff)
downloadargaze-bc23a436adc66560cae6e36ae4266bc43ab612d5.zip
argaze-bc23a436adc66560cae6e36ae4266bc43ab612d5.tar.gz
argaze-bc23a436adc66560cae6e36ae4266bc43ab612d5.tar.bz2
argaze-bc23a436adc66560cae6e36ae4266bc43ab612d5.tar.xz
Updating ar_feature_demo with new drawing features.
-rw-r--r--src/argaze/utils/demo_ar_features_run.py15
-rw-r--r--src/argaze/utils/demo_environment/demo_ar_features_setup.json86
2 files changed, 86 insertions, 15 deletions
diff --git a/src/argaze/utils/demo_ar_features_run.py b/src/argaze/utils/demo_ar_features_run.py
index 0df81c5..25d4083 100644
--- a/src/argaze/utils/demo_ar_features_run.py
+++ b/src/argaze/utils/demo_ar_features_run.py
@@ -74,8 +74,8 @@ def main():
# Detect and project environment
detection_time, exceptions = ar_environment.detect_and_project(video_image)
- # Create environment image
- environment_image = ar_environment.image
+ # Get environment image
+ environment_image = ar_environment.image()
# Write detection fps
cv2.rectangle(environment_image, (0, 0), (420, 50), (63, 63, 63), -1)
@@ -88,23 +88,14 @@ def main():
cv2.rectangle(environment_image, (0, (i+1)*50), (720, (i+2)*50), (127, 127, 127), -1)
cv2.putText(environment_image, f'{scene_name} error: {e}', (20, (i+1)*90), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 255, 255), 1, cv2.LINE_AA)
- # Draw environment info
- ar_environment.draw(environment_image)
-
# Display environment
cv2.imshow(ar_environment.name, environment_image)
# Draw and display each frames
for frame in ar_environment.frames:
- # Create frame image
- frame_image = frame.image
-
- # Draw frame info
- frame.draw(frame_image)
-
# Display frame
- cv2.imshow(f'{frame.parent.name}:{frame.name}', frame_image)
+ cv2.imshow(f'{frame.parent.name}:{frame.name}', frame.image())
# Stop by pressing 'Esc' key
if cv2.waitKey(10) == 27:
diff --git a/src/argaze/utils/demo_environment/demo_ar_features_setup.json b/src/argaze/utils/demo_environment/demo_ar_features_setup.json
index 39ace44..b1c0696 100644
--- a/src/argaze/utils/demo_environment/demo_ar_features_setup.json
+++ b/src/argaze/utils/demo_environment/demo_ar_features_setup.json
@@ -14,21 +14,101 @@
},
"camera_frame": {
"layers": {
- "_": {}
+ "Camera_layer": {}
+ },
+ "image_parameters": {
+ "background_weight": 1,
+ "draw_layers": {
+ "Camera_layer": {
+ "draw_aoi_scene": {
+ "draw_aoi": {
+ "color": [255, 255, 255],
+ "border_size": 1
+ }
+ }
+ }
+ },
+ "draw_gaze_position": {
+ "color": [0, 255, 255],
+ "size": 4
+ }
}
},
"scenes": {
"ArScene Demo" : {
"aruco_scene": "aruco_scene.obj",
"layers": {
- "_" : {
+ "Camera_layer" : {
"aoi_scene": "aoi_3d_scene.obj"
}
},
"frames": {
"GrayRectangle": {
"size": [640, 383],
- "background": "frame_background.jpg"
+ "background": "frame_background.jpg",
+ "gaze_movement_identifier": {
+ "DispersionThresholdIdentification": {
+ "deviation_max_threshold": 25,
+ "duration_min_threshold": 200
+ }
+ },
+ "scan_path": {
+ "duration_max": 10000
+ },
+ "layers": {
+ "GrayRectangle": {
+ "aoi_scene": "aoi_3d_scene.obj",
+ "aoi_matcher": {
+ "FocusPointInside": {}
+ }
+ }
+ },
+ "heatmap": {
+ "size": [320, 240]
+ },
+ "image_parameters": {
+ "background_weight": 1,
+ "heatmap_weight": 0.5,
+ "draw_scan_path": {
+ "draw_fixations": {
+ "deviation_circle_color": [0, 255, 255],
+ "duration_border_color": [0, 127, 127],
+ "duration_factor": 1e-2
+ },
+ "draw_saccades": {
+ "line_color": [0, 255, 255]
+ }
+ },
+ "draw_layers": {
+ "GrayRectangle": {
+ "draw_aoi_scene": {
+ "draw_aoi": {
+ "color": [255, 255, 255],
+ "border_size": 1
+ }
+ },
+ "draw_aoi_matching": {
+ "draw_matched_fixation": {
+ "deviation_circle_color": [255, 255, 255]
+ },
+ "draw_matched_fixation_positions": {
+ "position_color": [0, 255, 255],
+ "line_color": [0, 0, 0]
+ },
+ "draw_looked_aoi": {
+ "color": [0, 255, 0],
+ "border_size": 2
+ },
+ "looked_aoi_name_color": [255, 255, 255],
+ "looked_aoi_name_offset": [10, 10]
+ }
+ }
+ },
+ "draw_gaze_position": {
+ "color": [0, 255, 255],
+ "size": 2
+ }
+ }
}
},
"aruco_axis": {