Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from PIL import Image, ImageChops
- import imagehash
- from matplotlib import pyplot as plt
- import numpy as np
- hash1 = imagehash.average_hash(Image.open('313377.jpg'))
- print(hash1)
- hash2 = imagehash.average_hash(Image.open('313377c.jpg'))
- print(hash2)
- diff=hash1!=hash2
- print(diff)
- if diff==True:
- im1=Image.open('313377.jpg')
- im2=Image.open('313377c.jpg')
- images=ImageChops.difference(im1, im2)
- plt.subplot(),plt.imshow(images)
- plt.title('result')
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement