Describe the feature and motivation
Approximate nearest-neighbor search is very important research and development area of today’s AI technologies. Besides computer vision (e.g. in face or scene recognition applications), they are actively used for recommendation systems, e.g. Approximate Nearest Neighbours for Recommender Systems.
There are high-profile specialized packages for this task, mentioned in the above paper, such as Annoy, NMSLib, Faiss.
By comparison, FLANN, a fork of it integrated into OpenCV, looks very old and it not maintained. It is suggested that in OpenCV 5, since we have an opportunity to clean the library, we will remove a separate module FLANN.
We can replace FLANN with 1 of the 2 options:
- use single-header BSD-licensed nanoflann: nanoflann/include at master · jlblancoc/nanoflann · GitHub. It implements essential subset of FLANN functionality, so it should be smooth replacement.
- use Apache-2 licensed Spotify’s Annoy library: GitHub - spotify/annoy: Approximate Nearest Neighbors in C++/Python optimized for memory usage and loading/saving to disk. Annoy contains just a few files and so it can also be put directly to OpenCV, without creating explicit opencv/3rdparty entry.
The current opencv_flann API can be moved to features2d where it logically belongs.
Probably, features2d should be renamed to features to reflect that it cannot be used just for features extracted from 2D images. The current modern way to compute features is to run a deep learning model.