You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When applying a rotation with symmetric mode (i.e. padding mode) the segmentation map is not mirrored accordingly. The rotation of the map is fine, just its padding is missing.
Reproduction
I modified one of your examples to demonstrate the problem:
importnumpyasnpimportimgaugasiaimportimgaug.augmentersasiaafromimgaug.augmentables.segmapsimportSegmentationMapsOnImageimportmatplotlib.pyplotasplt# Load an example image (uint8, 128x128x3).image=ia.quokka(size=(128, 128), extract="square")
# Define an example segmentation map (int32, 128x128).# Here, we arbitrarily place some squares on the image.# Class 0 is our intended background class.segmap=np.zeros((128, 128, 1), dtype=np.int32)
segmap[28:71, 35:85, 0] =1segmap[10:25, 30:45, 0] =2segmap[10:25, 70:85, 0] =3segmap[10:110, 5:10, 0] =4segmap[118:123, 10:110, 0] =5segmap=SegmentationMapsOnImage(segmap, shape=image.shape)
# Define our augmentation pipeline.seq=iaa.Sequential([
iaa.Affine(rotate=-45, mode="symmetric"), # if we don't use mode="symmetric", the final result is correct.
])
image_aug, segmaps_aug=seq(image=image, segmentation_maps=segmap)
overlay=segmaps_aug.draw_on_image(image_aug)[0]
plt.imshow(overlay)
plt.show()
Result
Expected result
The text was updated successfully, but these errors were encountered:
When applying a rotation with symmetric mode (i.e. padding mode) the segmentation map is not mirrored accordingly. The rotation of the map is fine, just its padding is missing.
Reproduction
I modified one of your examples to demonstrate the problem:
Result
Expected result
The text was updated successfully, but these errors were encountered: