http://www.emgu.com

Searches feature tree for k nearest neighbors of given reference points.

**Namespace:** Emgu.CV**Assembly:** Emgu.CV (in Emgu.CV.dll) Version: 2.4.2.1777 (2.4.2.1777)

# Syntax

C# |
---|

public static void cvFindFeatures( IntPtr tr, IntPtr desc, IntPtr results, IntPtr dist, int k, int emax ) |

Visual Basic |
---|

Public Shared Sub cvFindFeatures ( _ tr As IntPtr, _ desc As IntPtr, _ results As IntPtr, _ dist As IntPtr, _ k As Integer, _ emax As Integer _ ) |

Visual C++ |
---|

public: static void cvFindFeatures( IntPtr tr, IntPtr desc, IntPtr results, IntPtr dist, int k, int emax ) |

#### Parameters

- tr
- Type: System..::..IntPtr

Pointer to kd-tree index of reference vectors

- desc
- Type: System..::..IntPtr

m x d matrix of (row-)vectors to find the nearest neighbors of

- results
- Type: System..::..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
- Type: System..::..IntPtr

m x k matrix of distances to k nearest neighbors

- k
- Type: System..::..Int32

The number of neighbors to find

- emax
- Type: System..::..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