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

C# | Visual Basic | Visual C++ |
public void FindFeatures( SURFFeature[] features, out Matrix<int> results, out Matrix<double> dist, int k, int emax )
Public Sub FindFeatures ( _ features As SURFFeature(), _ <OutAttribute> ByRef results As Matrix(Of Integer), _ <OutAttribute> ByRef dist As Matrix(Of Double), _ k As Integer, _ emax As Integer _ )
public: void FindFeatures( array<SURFFeature^>^ features, [OutAttribute] Matrix<int>^% results, [OutAttribute] Matrix<double>^% dist, int k, int emax )

- features (array< SURFFeature >[]()[])
- The m features to be searched from the feature tree
- results ( Matrix<(Of <(Int32>)>) %)
- The results of the best k matched from the feature tree. A m x k matrix. Contains -1 in some columns if fewer than k neighbors found. For each row the k neareast neighbors are not sorted. To findout the closet neighbour, look at the output matrix dist.
- k (Int32)
- The number of neighbors to find
- emax (Int32)
- The maximum number of leaves to visit