Searches feature tree for k nearest neighbors of given reference points.
Namespace: Emgu.CVAssembly: Emgu.CV (in Emgu.CV.dll) Version: 2.2.1.1150 (2.2.1.1150)
Syntax
C# | Visual Basic | Visual C++ |
Parameters
- tr
- IntPtr
Pointer to kd-tree index of reference vectors
- desc
- IntPtr
m x d matrix of (row-)vectors to find the nearest neighbors of
- results
- IntPtr
m x k set of row indices of matching vectors (referring to matrix passed to cvCreateFeatureTree). Contains -1 in some columns if fewer than k neighbors found
- dist
- IntPtr
m x k matrix of distances to k nearest neighbors
- k
- Int32
The number of neighbors to find
- emax
- Int32
For k-d tree only: the maximum number of leaves to visit.
Remarks
In case of k-d tree: Finds (with high probability) the k nearest neighbors in tr for each of the given (row-)vectors in desc, using best-bin-first searching ([Beis97]). The complexity of the entire operation is at most O(m*emax*log2(n)), where n is the number of vectors in the tree