A perceptual hash is a fingerprint of a multimedia file derived from various features from its content. You can use it to find simillar image. The main C++ code is from pHash,and I deleted some code that will not be used.Such as the code of trying to load image by built-in jpeglib ,and the code that deal with text and video.etc. This module mainly deals with images .And I removed the error that throw out by 'CImg.h',This change avoids the crash of your process when the CImg Object try to throw an error!
npm install image_phash
var image_phash=;var hash1=image_phash//return the DCT Image Hashhash2=image_phash;//maybe you need to storage//it for searchvar hamming_distance=image_phash;//maybe you want//use a different threshold to judge the imagesvar is_similar=image_phash;//Threshold set to 26.00. this//function return a boolean value,while 'true' means these two image is similar!