tueimage / gryds

A Python package for geometric transformations of images for data augmentation in deep learning
https://tue-image.nl
GNU General Public License v3.0
63 stars 14 forks source link

Is there any IO for nearest interpolation? #3

Closed Barnonewdm closed 4 years ago

Barnonewdm commented 4 years ago

We want to perform augmentation on the image label. Therefore, it requires the nearest interpolation. We wonder whether there is the IO for this operation.

keppenhof commented 4 years ago

Yes there is! You can assign an interpolation order to an Interpolator object, for example order=0 for nearest neighbor interpolation. For example, given image (some_image of type np.ndarray) and a Gryds transformation object some_transformation:

interpolator = gryds.Interpolator(some_image, order=0)
transformed_image = interpolator.transform(some_transformation)