Class ANNIndex
- Namespace
- OpenCvSharp
- Assembly
- OpenCvSharp.dll
Approximate nearest neighbor index backed by Annoy (OpenCV 5), a modern alternative to FLANN.
public class ANNIndex : CvPtrObject, IDisposable
- Inheritance
-
ANNIndex
- Implements
- Inherited Members
Methods
- AddItems(InputArray)
Adds feature vectors to the index.
- Build(int)
Builds the index.
- Create(int, ANNIndexDistance)
Creates an instance of the Annoy index with the given parameters.
- GetItemNumber()
Returns the number of feature vectors in the index.
- GetTreeNumber()
Returns the number of trees in the index.
- KnnSearch(InputArray, OutputArray, OutputArray, int, int)
Performs a K-nearest neighbor search for the given query vector(s) using the index.
- Load(string, bool)
Loads (mmaps) an index from disk.
- Save(string, bool)
Saves the index to disk. After saving, no more vectors can be added.
- SetOnDiskBuild(string)
Prepares to build the index in the specified file instead of in RAM (call before adding items; no need to save after build).
- SetSeed(int)
Initializes the random number generator with the given seed. Only effective before adding items / calling build() or load().