Closed zoccoler closed 2 years ago
Maybe crop_region
should be refactored to mask first and then crop? I wrote it in the other order to limit memory usage (e.g. if image were very large), but if we could keep the mask/crop as views onto the array, it would not take up so much memory.
It might fix this and #8
Alternatively, we could not worry about minimizing memory usage. Plus large arrays would probably be dask arrays, so they would not be entirely loaded into memory.
Applying crop to shapes like these:
Only works with the rectangle. For irregular shapes drawn close or over image edge, it gives an error like this: