Advertisement
Guest User

Detect31337

a guest
Aug 23rd, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. from PIL import Image, ImageChops
  2. import imagehash
  3. from matplotlib import pyplot as plt
  4. import numpy as np
  5.  
  6. hash1 = imagehash.average_hash(Image.open('313377.jpg'))
  7. print(hash1)
  8. hash2 = imagehash.average_hash(Image.open('313377c.jpg'))
  9. print(hash2)
  10. diff=hash1!=hash2
  11. print(diff)
  12. if diff==True:
  13.  
  14. im1=Image.open('313377.jpg')
  15. im2=Image.open('313377c.jpg')
  16.  
  17. images=ImageChops.difference(im1, im2)
  18.  
  19. plt.subplot(),plt.imshow(images)
  20. plt.title('result')
  21.  
  22. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement