diff options
author | Theo De La Hogue | 2023-09-26 10:42:41 +0200 |
---|---|---|
committer | Theo De La Hogue | 2023-09-26 10:42:41 +0200 |
commit | 08791230814241baf2283c07cc6b16b00dcccca4 (patch) | |
tree | af94ba74c0c39a9fa107bb742c830d4144084ffb | |
parent | 217d7ffb68ea4ebbc22cd914cf37d24ce3bcc566 (diff) | |
download | argaze-08791230814241baf2283c07cc6b16b00dcccca4.zip argaze-08791230814241baf2283c07cc6b16b00dcccca4.tar.gz argaze-08791230814241baf2283c07cc6b16b00dcccca4.tar.bz2 argaze-08791230814241baf2283c07cc6b16b00dcccca4.tar.xz |
Changing JSON description schema.
-rw-r--r-- | src/argaze/AreaOfInterest/AOIFeatures.py | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/argaze/AreaOfInterest/AOIFeatures.py b/src/argaze/AreaOfInterest/AOIFeatures.py index debf1fa..dfbb165 100644 --- a/src/argaze/AreaOfInterest/AOIFeatures.py +++ b/src/argaze/AreaOfInterest/AOIFeatures.py @@ -51,24 +51,26 @@ class AreaOfInterest(numpy.ndarray): working_directory: folder path where to load files when a dictionary value is a relative filepath. """ - shape = aoi_data.pop('shape') + # Get first and unique shape + # TODO: allow multiple shapes to describe more complex AOI + shape, shape_data = aoi_data.popitem() - if shape == 'rectangle': + if shape == 'Rectangle': - x = aoi_data.pop('x') - y = aoi_data.pop('y') - width = aoi_data.pop('width') - height = aoi_data.pop('height') + x = shape_data.pop('x') + y = shape_data.pop('y') + width = shape_data.pop('width') + height = shape_data.pop('height') points = [[x, y], [x+width, y], [x+width, y+height], [x, y+height]] return AreaOfInterest(points) - elif shape == 'circle': + elif shape == 'Circle': - cx = aoi_data.pop('cx') - cy = aoi_data.pop('cy') - radius = aoi_data.pop('radius') + cx = shape_data.pop('cx') + cy = shape_data.pop('cy') + radius = shape_data.pop('radius') # TODO: Use pygeos N = 32 @@ -462,7 +464,7 @@ class AOIScene(): @property def dimension(self) -> int: - """Dimension of the AOIs in scene.""" + """Dimension of the AOI in scene.""" return self.__dimension |