Created
March 6, 2017 04:43
-
-
Save dmpetrov/904778d8d17a3d8550a39f99c5a4a508 to your computer and use it in GitHub Desktop.
Wavelet imagehash for Barbara image
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Code for the blogpost https://fullstackml.com/2016/07/02/wavelet-image-hash-in-python/ | |
barb = PIL.Image.open(‘barbara.jpg’) | |
w_b = imagehash.whash(barb) | |
h_b = imagehash.phash(barb) | |
a_b = imagehash.average_hash(barb) | |
(a — a_b)/len(a.hash)**2 | |
# > 0.5 | |
(h — h_b)/len(w.hash)**2 | |
# > 0.53125 | |
(w — w_b)/len(w.hash)**2 | |
# > 0.4375 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment