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
X = Image.open('im.jpg')
# resize image
X = X.resize((200, 200))
# convert to grayscale
X = numpy.array(X.convert('L'))
# define a crop region
crop = (slice(50, 150), slice(0, 100))
# generate a deformation grid of 0
displacement = numpy.zeros((2, 3, 3))
# displacement[0, 1, 1] = 25
# deform full image
X_deformed = elasticdeform.deform_grid(X, displacement)
# compute only the cropped region
X_deformed_crop = elasticdeform.deform_grid(X, displacement, crop=crop)
# the deformation is the same
![output](https://user-images.githubusercontent.com/53420011/215512271-65317d8b-3022-403d-b570-e1c32c7ac899.svg)
numpy.testing.assert_equal(X_deformed[crop], X_deformed_crop)
even while setting the displacement to 0, the result is very noisy and there are random patches in the picture
The text was updated successfully, but these errors were encountered:
I was using the following code:
even while setting the displacement to 0, the result is very noisy and there are random patches in the picture
The text was updated successfully, but these errors were encountered: