Phash::FFI - FFI-based pHash interface.
Phash::FFI is the library adaptor for pHash, which allows you to generate a hash value from media files (image, video, audio). It is designed so that if 2 media files have identical hash value if they are perceptually the same.
This subroutine takes a path name and returns a 64-bit phash. For example:
my $hash = Phash::FFI::dct_imagehash("Lenna.png"); printf "%064b\t%s\n", $hash, $file; # output 1100100100011100101100100110001001110111010110101001010110110001 Lenna.png
- ph_hamming_distance($hash1, $hash2)
The similary of hash can be calculated by Hamming distance of bits.
When 2 hash values have only 1 or 2 bits that are different, it is very likely that the corresponding 2 images look the same.
Phash::FFI is released under MIT License.
pHash is released under GPLv3 license.