Method KnnSearch
- Namespace
- OpenCvSharp
- Assembly
- OpenCvSharp.dll
KnnSearch(InputArray, OutputArray, OutputArray, int, int)
Performs a K-nearest neighbor search for the given query vector(s) using the index.
public void KnnSearch(InputArray query, OutputArray indices, OutputArray dists, int knn, int searchK = -1)
Parameters
queryInputArrayThe query vector(s).
indicesOutputArrayOutput matrix that will contain the indices of the K-nearest neighbors found.
distsOutputArrayOutput matrix that will contain the distances to the K-nearest neighbors found.
knnintNumber of nearest neighbors to search for.
searchKintThe maximum number of nodes to inspect; defaults to trees x knn when -1.