Reputation: 131
When I try to implement Keras ImageDataGenerator apply_transform
method to shift the image in the horizontal direction, the image is translated in the opposite direction.
I've seen its source code but not sure why implementation is like this. Below is the code
datagen = ImageDataGenerator()
translate = datagen.apply_transform(x=img, transform_parameters={'ty':20})
Output:
Upvotes: 2
Views: 1254
Reputation: 8527
try -20 instead of 20
datagen = ImageDataGenerator()
translate = datagen.apply_transform(x=img, transform_parameters={'ty':-20})
Upvotes: 2