I recently tried out pHash and it seemed to be a good tool for detecting nearly duplicate images. Certainly superior to calculating md5 for images and comparing those.
However, if the images have different cropping, slight rotation or different brightness/contrast setting pHash didn't seem to work well enough. I got better results with http://www.imgseek.net/ for my image set.
I was searching for some methods to get a fingerprint for an image and this was basically the only lib I found. Otherwise, most often, I got recommendations about using OpenCV and collecting SIFT/SURF (and maybe other) features - although I never saw a ready and working implementation.
However, if the images have different cropping, slight rotation or different brightness/contrast setting pHash didn't seem to work well enough. I got better results with http://www.imgseek.net/ for my image set.