aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThéo de la Hogue2023-07-04 10:37:00 +0200
committerThéo de la Hogue2023-07-04 10:37:00 +0200
commit7971ff326d906688ddd06043d5ce8154e418ae22 (patch)
treeb6bb341bfbc76987c46f62e8c3140acca7a86f5a /src
parent7fd88a965602a84ee4eafc3b07e974be0c83db29 (diff)
downloadargaze-7971ff326d906688ddd06043d5ce8154e418ae22.zip
argaze-7971ff326d906688ddd06043d5ce8154e418ae22.tar.gz
argaze-7971ff326d906688ddd06043d5ce8154e418ae22.tar.bz2
argaze-7971ff326d906688ddd06043d5ce8154e418ae22.tar.xz
Updating camera frame feature.
Diffstat (limited to 'src')
-rw-r--r--src/argaze/utils/demo_ar_features_run.py18
-rw-r--r--src/argaze/utils/demo_environment/demo_ar_features_setup.json10
-rw-r--r--src/argaze/utils/demo_environment/demo_gaze_features_setup.json2
-rw-r--r--src/argaze/utils/demo_gaze_features_run.py4
4 files changed, 14 insertions, 20 deletions
diff --git a/src/argaze/utils/demo_ar_features_run.py b/src/argaze/utils/demo_ar_features_run.py
index 5d03fd9..22b0d89 100644
--- a/src/argaze/utils/demo_ar_features_run.py
+++ b/src/argaze/utils/demo_ar_features_run.py
@@ -83,25 +83,11 @@ def main():
# Display environment
cv2.imshow(ar_environment.name, video_image)
- # Draw and display each frames
+ # Draw and display each frames in separate window
for scene_name, frame_name, frame in ar_environment.frames:
- image = frame.background.copy()
-
- frame.aoi_2d_scene.draw(image, color=(255, 255, 255))
- frame.current_gaze_position.draw(image, color=(255, 255, 255))
-
- frame.current_gaze_movement.draw(image, color=(0, 255, 255))
- frame.current_gaze_movement.draw_positions(image)
-
- # Check frame fixation
- if GazeFeatures.is_fixation(frame.current_gaze_movement):
-
- # Draw looked AOI
- frame.aoi_2d_scene.draw_circlecast(image, frame.current_gaze_movement.focus, frame.current_gaze_movement.deviation_max, base_color=(0, 0, 0), matching_color=(255, 255, 255))
-
# Display frame
- cv2.imshow(f'{scene_name}:{frame_name}', image)
+ cv2.imshow(f'{scene_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 5d5b139..0081ccf 100644
--- a/src/argaze/utils/demo_environment/demo_ar_features_setup.json
+++ b/src/argaze/utils/demo_environment/demo_ar_features_setup.json
@@ -16,7 +16,15 @@
"AR Scene Demo" : {
"aruco_scene": "aruco_scene.obj",
"aoi_3d_scene": "aoi_3d_scene.obj",
- "frames": {
+ "camera_frame": {
+ "gaze_movement_identifier": {
+ "DispersionThresholdIdentification": {
+ "deviation_max_threshold": 50,
+ "duration_min_threshold": 200
+ }
+ }
+ },
+ "aoi_frames": {
"GrayRectangle": {
"size": [640, 480],
"background": "frame_background.jpg",
diff --git a/src/argaze/utils/demo_environment/demo_gaze_features_setup.json b/src/argaze/utils/demo_environment/demo_gaze_features_setup.json
index c4b5cc2..634d8e4 100644
--- a/src/argaze/utils/demo_environment/demo_gaze_features_setup.json
+++ b/src/argaze/utils/demo_environment/demo_gaze_features_setup.json
@@ -3,7 +3,7 @@
"scenes": {
"AR Scene Demo" : {
"aoi_3d_scene": "aoi_3d_scene.obj",
- "frames": {
+ "aoi_frames": {
"GrayRectangle": {
"size": [1920, 1149],
"background": "frame_background.jpg",
diff --git a/src/argaze/utils/demo_gaze_features_run.py b/src/argaze/utils/demo_gaze_features_run.py
index 9cb0fb6..b9ffcf8 100644
--- a/src/argaze/utils/demo_gaze_features_run.py
+++ b/src/argaze/utils/demo_gaze_features_run.py
@@ -36,7 +36,7 @@ def main():
ar_environment = ArFeatures.ArEnvironment.from_json(args.environment)
# Select AR frame
- ar_frame = ar_environment.scenes["AR Scene Demo"].frames["GrayRectangle"]
+ ar_frame = ar_environment.scenes["AR Scene Demo"].aoi_frames["GrayRectangle"]
# Create a window to display AR environment
cv2.namedWindow(ar_frame.name, cv2.WINDOW_AUTOSIZE)
@@ -247,7 +247,7 @@ def main():
if key_pressed == 114:
ar_environment = ArFeatures.ArEnvironment.from_json(args.environment)
- ar_frame = ar_environment.scenes["AR Scene Demo"].frames["GrayRectangle"]
+ ar_frame = ar_environment.scenes["AR Scene Demo"].aoi_frames["GrayRectangle"]
# Enable heatmap buffer with 'b' key
if key_pressed == 98: