From 083341344d1d76ba63ea20468939e4e353fc9745 Mon Sep 17 00:00:00 2001 From: Théo de la Hogue Date: Wed, 14 Sep 2022 15:39:55 +0200 Subject: Limiting looked_region method to AOI 2D only. --- src/argaze/AreaOfInterest/AOIFeatures.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/argaze/AreaOfInterest/AOIFeatures.py b/src/argaze/AreaOfInterest/AOIFeatures.py index 01bb484..f74920e 100644 --- a/src/argaze/AreaOfInterest/AOIFeatures.py +++ b/src/argaze/AreaOfInterest/AOIFeatures.py @@ -93,6 +93,9 @@ class AreaOfInterest(numpy.ndarray): def looked_region(self, gaze_position, gaze_radius): """Get intersection shape with gaze circle as the looked area, (looked area / AOI area) and (looked area / gaze circle area).""" + if self.dimension() != 2: + raise RuntimeError(f'Bad area dimension ({self.dimension()})') + self_polygon = Polygon(self) gaze_circle = Point(gaze_position).buffer(gaze_radius) -- cgit v1.1