Closed RuwanT closed 7 years ago
Thanks for the excellent bug report ; )
scikit-image performs a linear interpolation per default when rotating. There is an 'order' parameter to change the interpolation and order=0 solves the problem.
As a temporary workaround:
import skimage.transform as skt
def myrotate(image, angle):
return skt.rotate(image, angle, preserve_range=True, order=0).astype('uint8')
TransformImage.register('myrotate', myrotate)
augment_2 = (AugmentImage((1,)).by('myrotate', 1.0, [10, 50]))
@maet3608, thanks for the quick response.
Fixed in nutsml-1.0.26 release. Default for transformations such as rotate, resize, translate and shear is now to NOT perform any interpolation of pixels. A kwargs parameter has been added allowing to set order=1 (or higher) to re-enable linear interpolation.
The resulting mask image, after transforming a ground-truth mask (for multi-class segmentation) with AugmentImage will contain label values that were not present in the original mask. Looks like it happens due to interpolation.