Advertisement
lambda_

Untitled

Aug 27th, 2019
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | None | 0 0
  1. import numpy as np
  2. from skimage import transform as tf
  3. from PIL import Image
  4.  
  5. def shear(t, img):
  6.     image = np.asarray(img)
  7.     print(image)
  8.     a = tf.AffineTransform(shear=t)
  9.     m = tf.warp(image, inverse_map=a)
  10.     print(m)
  11.     print(np.uint8(m*255))
  12.     return Image.fromarray(np.uint8(m*255))
  13.  
  14. i = Image.open("b.jpg")
  15. mI = shear(0.3, i)
  16. mI.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement