The situation is: I want to augment a satellite image and its corresponding mask.
For the image, I want to use "Warp" mode. This image is zoomed out and the new pixels are filled using "warp" mode:
However, by default, the mask will NOT be filled the same way. IMO, this leads to the incorrectness of the mask (i.e. the newly created pixels of the image have pieces from "road" and "background" classes, but on the mask it's all filled with zeros). The masks looks like this:
There is a workaround. When defining an instance of Affine, you need to set the _mode_segmentation_maps variable:
This has been already discussed here: https://github.com/aleju/imgaug/issues/499 https://github.com/aleju/imgaug/issues/710
The situation is: I want to augment a satellite image and its corresponding mask. For the image, I want to use "Warp" mode. This image is zoomed out and the new pixels are filled using "warp" mode:
However, by default, the mask will NOT be filled the same way. IMO, this leads to the incorrectness of the mask (i.e. the newly created pixels of the image have pieces from "road" and "background" classes, but on the mask it's all filled with zeros). The masks looks like this:
There is a workaround. When defining an instance of
Affine
, you need to set the_mode_segmentation_maps
variable:And then you can use it like this:
This workaround works, but it would be better to have a clean solution in the library. The corresponding mask now looks like this: