Saturday, October 4, 2014

opencv flann problems

here is a very good solution of a problem in flann opencv

http://stackoverflow.com/questions/10336568/how-to-use-opencv-flannindex

here is another example might be helpful:

int cluster_number = 4000;
int feat_size = 192;
Mat indexMat( cluster_number, feat_size, CV_32FC1);
flann::Index flann_index( indexMat, flann::SavedIndexParams( argv[1]), cvflann::FLANN_DIST_EUCLIDEAN);

you will keep getting runtime errors when you call knnSearch(). instead you might do :

#define CLUSTER_NUMBER 4000
#define FEAT_SIZE 192
Mat indexMat( CLUSTER_NUMBER, FEAT_SIZE, CV_32FC1);
flann::Index flann_index( indexMat, flann::SavedIndexParams( argv[1]), cvflann::FLANN_DIST_EUCLIDEAN);

No comments:

Post a Comment