Search code examples
javaopencvopencv3.0knnflann

Flann index in OpenCV Java API


How do I create a Flann index with OpenCV in Java?

I am trying to do a KNN search of feature descriptors. I cannot find the equivalent class in Java API. Or is the official Java binding incomplete?

The C++ class is documented here: http://docs.opencv.org/2.4/modules/flann/doc/flann_fast_approximate_nearest_neighbor_search.html#flann-index


Solution

  • You can instantiate Flann matcher in Java using this construction:

    FlannBasedMatcher matcher = FlannBasedMatcher.create();
    

    Please ensure you are using OpenCV 3.2 or higher version.