Skip to content

Instantly share code, notes, and snippets.

@msly
msly / phash.cpp
Last active November 14, 2016 08:45
图片相似算法phash
string pHashValue(Mat &src) {
// gray
assert(src.channels() == 1);
string hash(64, '\0');
Mat img, dst;
resize(src, img, Size(32, 32));
img = Mat_<double>(img);