What is a perceptual hash?
A perceptual hash is a fingerprint of an audio, video or image file that is mathematically based on the audio or visual content contained within. Unlike usual hash functions that rely on the avalanche effect of small changes in input leading to drastic changes in the output, perceptual hashes are "close" to one another if the inputs are visually or auditorily similar. As a result, perceptual hashes must also be robust enough to take into account transformations that could have been performed on the input, such as rotation, skew, altering contrast, etc. All of these properties make perceptual hashes a very interesting computer science problem to study.
What is pHash?
pHash is an open source library released under the GPLv3 license that implements several perceptual hashing algorithms and provides a C++ API to use those functions in your own programs.