Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. import scipy.ndimage as ndimage
  2. import matplotlib.pyplot as plt
  3. import matplotlib.image as mpimg
  4. import numpy as np
  5.  
  6. p1 = np.array([[8,10,10,10,0],[0,10,10,10,5], [5,8,8,8,5]])
  7.  
  8. ll = np.array([[-1, 1, 1, 1, -1]])
  9.  
  10. for i in range(3):
  11.     print (i+1, p1[i,:])
  12.     plt.imshow([p1[i,:]])
  13.     plt.show()
  14.  
  15. print ("Найди похожее",ll)
  16. plt.imshow(ll)
  17. plt.show()
  18.  
  19. print (ndimage.convolve(p1, ll, mode = 'constant'))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement