aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThéo de la Hogue2023-01-31 16:12:00 +0100
committerThéo de la Hogue2023-01-31 16:12:00 +0100
commitf5eaba8165fff2a915bcffc8cf6230fd12082a69 (patch)
treee6e9068a218d57e2cc3dcdf24a2757af96378378 /src
parent837168f2f174bdb94c457601e529361b98e59101 (diff)
downloadargaze-f5eaba8165fff2a915bcffc8cf6230fd12082a69.zip
argaze-f5eaba8165fff2a915bcffc8cf6230fd12082a69.tar.gz
argaze-f5eaba8165fff2a915bcffc8cf6230fd12082a69.tar.bz2
argaze-f5eaba8165fff2a915bcffc8cf6230fd12082a69.tar.xz
Allowing to define AOI as child of another AOI.
Diffstat (limited to 'src')
-rw-r--r--src/argaze/ArScene.py21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/argaze/ArScene.py b/src/argaze/ArScene.py
index c8500fc..5e38c1e 100644
--- a/src/argaze/ArScene.py
+++ b/src/argaze/ArScene.py
@@ -262,14 +262,25 @@ class ArScene():
aoi_scene = {}
- for name, marker_corners in self.aruco_aoi.items():
+ for name, data in self.aruco_aoi.items():
- aoi_points = []
- for marker_id, corner_id in marker_corners:
+ if type(data) == list:
- aoi_points.append(self.aruco_tracker.tracked_markers[marker_id].corners[0][corner_id])
+ marker_corners = data
- aoi_scene[name] = AOIFeatures.AreaOfInterest(aoi_points)
+ aoi_points = []
+ for marker_id, corner_id in marker_corners:
+
+ aoi_points.append(self.aruco_tracker.tracked_markers[marker_id].corners[0][corner_id])
+
+ aoi_scene[name] = AOIFeatures.AreaOfInterest(aoi_points)
+
+ elif type(data) == dict:
+
+ parent_aoi = aoi_scene[data['parent']]
+ aoi_points = [numpy.array(parent_aoi.outter_axis(inner)) for inner in data['inner_points']]
+
+ aoi_scene[name] = AOIFeatures.AreaOfInterest(aoi_points)
return AOI2DScene.AOI2DScene(aoi_scene)