Open Aliiiqbp opened 3 weeks ago
dctlowfreq is also different
and dct
Thank you for your response. The key question is whether we can reduce the hash size by half using the pHash function while maintaining the same semantics, given that the hash values are all at a 2k-bit distance.
I plotted the Hamming distance distribution for a subset of the DIV2K dataset, and there are no odd distances between any pair of images, which does not make sense while this is not the case in phash_simple or other methods like aHash or dHash.
phash:
phash_simple:
ahash:
dhash:
See also https://github.com/JohannesBuchner/imagehash/issues/13 https://github.com/JohannesBuchner/imagehash/issues/17 https://github.com/JohannesBuchner/imagehash/issues/97 Maybe from these you can get an understanding why the distances are even.
I am also not sure the hash size and the hamming distance are related such that even distances imply that the hash size can be reduced. I am also hesitant to break backwards compatibility regarding the way the hash size is stored.
I am curious about why the Hamming distance between hash values computed from arbitrary images using the "phash" method is always an even number, while this is not the case with the "phash_simple" function. The only difference between these methods is that phash uses the "median", while phash_simple uses the "mean".