Skip to content

Instantly share code, notes, and snippets.

@laclefyoshi
Created September 8, 2012 12:24
Show Gist options
  • Save laclefyoshi/3674378 to your computer and use it in GitHub Desktop.
Save laclefyoshi/3674378 to your computer and use it in GitHub Desktop.
cpp code using phash
/**
Copyright: (c) SAEKI Yoshiyasu
License : MIT-style license
<http://www.opensource.org/licenses/mit-license.php>
last updated: 2012/09/08
**/
#include<cstdio>
#include<pHash.h>
int main(int argc, char* argv[]) {
ulong64 hash1, hash2;
int distance;
ph_dct_imagehash(argv[1], hash1);
ph_dct_imagehash(argv[2], hash2);
distance = ph_hamming_distance(hash1, hash2);
printf("distance: %d\n", distance);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment