I need to find the repeated images (exact same, this is not a image similarity problem) by hashing. So I tried something like this, but this seems not right.
Mat src = imread (inputfile, -1) ;
char* rawPtr = new char[src.step[0] * src.rows] ;
memcpy(rawPtr, (char*)src.data, src.step[0] * src.rows) ; // is this all the data ??
string rawdata(rawPtr) ;
cout << str2md5(rawPtr, strlen(rawPtr)) << endl ;
My file is CV_16UC3, 1624 by 1236 , 3 channels, src.step[0] * src.rows is the bytes number of the whole image 12043584 bytes, however strlen(rawPtr) returns 5739852 chars, and these don't match.
So the md5 value I got is not right. I would like to know how to efficiently and correctly convert cv::Mat data into a string.