c++,opencv,flann,flannbasedmatcher

FLANN chooses between the randomized kd-tree algorithm and the hierarchical k-means tree algorithm to make the optimal nearest neighbors approximation. The choice of algorithm is based on several factors such as dataset structure and search precision. Each algorithm also has a set of parameters that effects the search performance. That...

c++,opencv,visual-c++,flann,opencv3.0

According to Opencv documentation, your variable 'dists' needs to be a std::vector<float> dists(NUM_NEAREST_NEIGHBORS); not a std::vector<int> dists(NUM_NEAREST_NEIGHBORS); as declared in your code....