aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThéo de la Hogue2023-04-29 14:07:22 +0200
committerThéo de la Hogue2023-04-29 14:07:22 +0200
commit97bfe8aa03751d1bc8552277c6935b2763fa2446 (patch)
treeaa0f943aa96730a698cb5f8664c69357e4bbc294 /src
parent60f2723e1a4aa32a772782c7091ca087b50c3cbc (diff)
downloadargaze-97bfe8aa03751d1bc8552277c6935b2763fa2446.zip
argaze-97bfe8aa03751d1bc8552277c6935b2763fa2446.tar.gz
argaze-97bfe8aa03751d1bc8552277c6935b2763fa2446.tar.bz2
argaze-97bfe8aa03751d1bc8552277c6935b2763fa2446.tar.xz
Updating unconsistencies writing.
Diffstat (limited to 'src')
-rw-r--r--src/argaze/utils/environment_edit.py32
1 files changed, 26 insertions, 6 deletions
diff --git a/src/argaze/utils/environment_edit.py b/src/argaze/utils/environment_edit.py
index 1edd623..6b2c354 100644
--- a/src/argaze/utils/environment_edit.py
+++ b/src/argaze/utils/environment_edit.py
@@ -116,7 +116,7 @@ def main():
gaze_position = GazeFeatures.GazePosition(pointer, precision=2)
# Reset info frame
- info_frame = numpy.full((500, 1000, 3), 0, dtype=numpy.uint8)
+ info_frame = numpy.full((800, 1000, 3), 0, dtype=numpy.uint8)
# Select a new frame and detect markers once
if next_frame_index != current_frame_index or refresh or draw_cover:
@@ -313,7 +313,7 @@ def main():
else:
cv2.putText(info_frame, f'Left click on marker to select it', (20, 40), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 255, 255), 1, cv2.LINE_AA)
-
+
# Estimate all marker's pose
ar_environment.aruco_detector.estimate_markers_pose()
@@ -328,14 +328,34 @@ def main():
m.color = (0, 0, 255)
# Write unconsistencies
- for i, (label, value) in enumerate(unconsistencies.items()):
- cv2.putText(info_frame, f'Unconsistent {label}: {value:.3f}', (20, 120+ i*40), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 0, 255), 1, cv2.LINE_AA)
-
+ line = 0
+ for i, (label, value) in enumerate(unconsistencies['angle'].items()):
+
+ current_angle = value['current']
+ expected_angle = value['expected']
+
+ cv2.putText(info_frame, f'Unconsistent angle {label}: [{current_angle[0]:.3f} {current_angle[1]:.3f} {current_angle[2]:.3f}]', (20, 120+line*40), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 0, 255), 1, cv2.LINE_AA)
+ line += 1
+
+ cv2.putText(info_frame, f'Expected angle {label}: [{expected_angle[0]:.3f} {expected_angle[1]:.3f} {expected_angle[2]:.3f}]', (20, 120+line*40), cv2.FONT_HERSHEY_SIMPLEX, 1, (255, 255, 255), 1, cv2.LINE_AA)
+ line += 1
+
+ for i, (label, value) in enumerate(unconsistencies['distance'].items()):
+
+ current_distance = value['current']
+ expected_distance = value['expected']
+
+ cv2.putText(info_frame, f'Unconsistent distance {label}: {current_distance:.3f}', (20, 120+ line*40), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 0, 255), 1, cv2.LINE_AA)
+ line += 1
+
+ cv2.putText(info_frame, f'Expected distance {label}: {expected_distance:.3f}', (20, 120+ line*40), cv2.FONT_HERSHEY_SIMPLEX, 1, (255, 255, 255), 1, cv2.LINE_AA)
+ line += 1
+
# Force pose mode to single marker scene pose estimation
else:
pose_mode = 0
-
+
# Single marker scene pose estimation
if pose_mode == 0: