Is local sensitive hashing algorithm only compatible with binary descriptors?
Hi,
I am trying to use local sensitive hashing algorithm in flann in opencv 2.4.4. Here is my code.
Ptr<IplImage> cluster_image = cvLoadImage("C:\\Users\\Administrator\\Pictures\\1.jpg");
vector<KeyPoint> cluster_keypoint;
Mat des;
description_detect(cluster_image,cluster_keypoint,des,SIFT_DESCRIPTION);//My function to extract the sift feature from image.//Descriptions are stored at variable des.
flann::Index my_index(des, flann::LshIndexParams(10, 10, 2));
When running this code to build the index of flann by lsh algo. The code assert that
"Opencv Error,unsupported format or combination of formats type=5"
I check code in miniflann.cpp. It seems that local sensitive hashing algorithm in flann are only compatible with CV_8U Mat type,other than CV_32F which is generated by sift.
However, other binary descriptors detected from ORB, Brief, BRISK, FREAK can produce CV_8U Mat type.
So my question is: Is local sensitive hashing algorithm only compatible with binary descriptors in opencv?
ran into the similar problem trying to feed descriptors into ml algos, which want float features as well.
you can
des.convertTo(des_float, CV_32F);
// there's also scaling and offset paramsbut it seems, those binary descriptor are optimised for something like hamming distance, while the flann::Index might be using some totally different distance scheme here.
so converting might work, but might be not optimal.