undouble
undouble copied to clipboard
whash-db4 and crop-resistant-hash not working
Hello,
I've seen in the docs on readthedocs that in addition to ahash, phash, dhash and whash-haar, there are also whash-db4 and crop-resistant-hash. I'm really interested in the latest but it appears to be not working. I get a "cannot compute hash" error Is it not implemented yet ?
And i've also notice that I get this error on whash-haar when using hash_sizes that are not exponentiations of 2. (Although it works for other hashing methods)
I added the crop-resistant-hash functionality into the library and to the documentation pages.
Update with: pip install -U undouble
However, this functionality is slightly different compared to the others because the algorithm partitions the image into bright and dark segments, using a watershed-like algorithm, and then does an image hash on each segment. Or in other words, I basically get 2 hashes instead of 1. This is a problem because all of the code is designed to receive a single hash function. I now randomly selected the dark-segments. Not sure how to deal with this.
Regarding the whash-haar, l show an error message if the hash_size is not power of 2, and then return with None.
Thank you very much for your answers, regarding the crop resistant problem, a solution could be to use both hashes separatly ? like two differents images in the dataset, but referencing the same file ?