Add multi_hash (wip/untested)

This commit is contained in:
2019-12-26 16:58:32 -05:00
parent 514e53b934
commit 5ebbcf2845
10 changed files with 259 additions and 8 deletions

View File

@@ -29,3 +29,7 @@ fastimagehash v0.1
**ahash**
![ahash_s](results/ahash_small.png)
![ahash_l](results/ahash_large.png)
**multi_hash**
![multi_s](results/multi_small.png)
![multi_l](results/multi_large.png)

View File

@@ -36,3 +36,16 @@ print_result("ahash", timeit.timeit(
stmt="average_hash(Image.open('%s'), hash_size=%d)" % (IMAGE, SIZE),
number=COUNT
))
print_result("multi", timeit.timeit(
setup="from imagehash import average_hash,phash,whash,dhash \n"
"from PIL import Image",
stmt="im = Image.open('%s');"
"size = %d;"
"average_hash(im.copy(), hash_size=size);"
"phash(im.copy(), hash_size=size);"
"whash(im.copy(), hash_size=size, remove_max_haar_ll=False);"
"dhash(im.copy(), hash_size=size);"
% (IMAGE, SIZE),
number=COUNT
))

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@@ -34,4 +34,6 @@ for f in files:
method = "ahash"
if "whash" in m:
method = "whash"
if "multi" in m:
method = "multi"
print("%s_%s,%s" % (f, method, t))