aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThéo de la Hogue2023-05-09 12:09:11 +0200
committerThéo de la Hogue2023-05-09 12:09:11 +0200
commitb7aa0ea39a0cfe1e99835b7da34f4af4f165a2bc (patch)
treef924c3d8efb8c4277e82c3ddfe9e02a6c5797a5c /src
parent3aa72812a5f45dce412f2f355dcac430e440564b (diff)
downloadargaze-b7aa0ea39a0cfe1e99835b7da34f4af4f165a2bc.zip
argaze-b7aa0ea39a0cfe1e99835b7da34f4af4f165a2bc.tar.gz
argaze-b7aa0ea39a0cfe1e99835b7da34f4af4f165a2bc.tar.bz2
argaze-b7aa0ea39a0cfe1e99835b7da34f4af4f165a2bc.tar.xz
Changing circlecast interface.
Diffstat (limited to 'src')
-rw-r--r--src/argaze/AreaOfInterest/AOI2DScene.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/argaze/AreaOfInterest/AOI2DScene.py b/src/argaze/AreaOfInterest/AOI2DScene.py
index d1f7fa0..6930613 100644
--- a/src/argaze/AreaOfInterest/AOI2DScene.py
+++ b/src/argaze/AreaOfInterest/AOI2DScene.py
@@ -58,7 +58,7 @@ class AOI2DScene(AOIFeatures.AOIScene):
# Draw form
aoi.draw(frame, color)
- def circlecast(self, gaze_position: GazeFeatures.GazePosition) -> Tuple[str, "AOIFeatures.AreaOfInterest", numpy.array, float, float]:
+ def circlecast(self, center:tuple, radius:float) -> Tuple[str, "AOIFeatures.AreaOfInterest", numpy.array, float, float]:
"""Iterate over areas to know which aoi is looked considering gaze position value and its precision.
* **Returns:**
- aoi name
@@ -70,14 +70,14 @@ class AOI2DScene(AOIFeatures.AOIScene):
for name, aoi in self.items():
- looked_region, aoi_ratio, gaze_ratio = aoi.circle_intersection(gaze_position.value, gaze_position.precision)
+ looked_region, aoi_ratio, gaze_ratio = aoi.circle_intersection(center, radius)
yield name, aoi, looked_region, aoi_ratio, gaze_ratio
- def draw_circlecast(self, frame, gaze_position: GazeFeatures.GazePosition, exclude=[], base_color=(0, 0, 255), looked_color=(0, 255, 0)):
+ def draw_circlecast(self, frame, center:tuple, radius:float, exclude=[], base_color=(0, 0, 255), looked_color=(0, 255, 0)):
"""Draw AOIs with their looked status and looked region."""
- for name, aoi, looked_region, aoi_ratio, gaze_ratio in self.circlecast(gaze_position):
+ for name, aoi, looked_region, aoi_ratio, gaze_ratio in self.circlecast(center, radius):
if name in exclude:
continue