diff options
-rw-r--r-- | src/argaze/ArScene.py | 21 |
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) |