Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

whash-db4 and crop-resistant-hash not working #5

Open
Tyrannas opened this issue Jun 15, 2022 · 4 comments
Open

whash-db4 and crop-resistant-hash not working #5

Tyrannas opened this issue Jun 15, 2022 · 4 comments

Comments

@Tyrannas
Copy link

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 ?

@Tyrannas
Copy link
Author

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)

@erdogant
Copy link
Owner

erdogant commented Jul 9, 2022

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.

@erdogant
Copy link
Owner

erdogant commented Jul 9, 2022

Regarding the whash-haar, l show an error message if the hash_size is not power of 2, and then return with None.

@Tyrannas
Copy link
Author

Tyrannas commented Sep 13, 2022

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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants