diff options
author | Théo de la Hogue | 2022-09-14 15:39:55 +0200 |
---|---|---|
committer | Théo de la Hogue | 2022-09-14 15:39:55 +0200 |
commit | 083341344d1d76ba63ea20468939e4e353fc9745 (patch) | |
tree | 89183f40a28bc3c2adfbbdd12b6ba38b15b3cfbe | |
parent | b3a5e45bcffee24bec1cd983ab46d2907ad07d10 (diff) | |
download | argaze-083341344d1d76ba63ea20468939e4e353fc9745.zip argaze-083341344d1d76ba63ea20468939e4e353fc9745.tar.gz argaze-083341344d1d76ba63ea20468939e4e353fc9745.tar.bz2 argaze-083341344d1d76ba63ea20468939e4e353fc9745.tar.xz |
Limiting looked_region method to AOI 2D only.
-rw-r--r-- | src/argaze/AreaOfInterest/AOIFeatures.py | 3 |
1 files changed, 3 insertions, 0 deletions
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) |