Emgu CV Library Documentation
FindNearest Method (samples, k, results, kNearestNeighbors, neighborResponses, dist)
NamespacesEmgu.CV.MLKNearestFindNearest(Matrix<(Of <(Single>)>), Int32, Matrix<(Of <(Single>)>), Matrix<(Of <(Single>)>), Matrix<(Of <(Single>)>), Matrix<(Of <(Single>)>))

www.emgu.com/wiki
For each input vector (which are rows of the matrix samples) the method finds k <= get_max_k() nearest neighbor. In case of regression, the predicted result will be a mean value of the particular vector's neighbor responses. In case of classification the class is determined by voting.
Declaration Syntax
C#Visual BasicVisual C++
public float FindNearest(
	Matrix<float> samples,
	int k,
	Matrix<float> results,
	Matrix<float> kNearestNeighbors,
	Matrix<float> neighborResponses,
	Matrix<float> dist
)
Public Function FindNearest ( _
	samples As Matrix(Of Single), _
	k As Integer, _
	results As Matrix(Of Single), _
	kNearestNeighbors As Matrix(Of Single), _
	neighborResponses As Matrix(Of Single), _
	dist As Matrix(Of Single) _
) As Single
public:
float FindNearest(
	Matrix<float>^ samples, 
	int k, 
	Matrix<float>^ results, 
	Matrix<float>^ kNearestNeighbors, 
	Matrix<float>^ neighborResponses, 
	Matrix<float>^ dist
)
Parameters
samples (Matrix<(Of <(Single>)>))
The sample matrix where each row is a sample
k (Int32)
The number of nearest neighbor to find
results (Matrix<(Of <(Single>)>))
Can be null if not needed. If regression, return a mean value of the particular vector's neighbor responses; If classification, return the class determined by voting.
kNearestNeighbors (Matrix<(Of <(Single>)>))
Should be null if not needed. Setting it to non-null values incures a performance panalty. A matrix of (k * samples.Rows) rows and (samples.Cols) columns that will be filled the data of the K nearest-neighbor for each sample
neighborResponses (Matrix<(Of <(Single>)>))
Should be null if not needed. The response of the neighbors. A vector of k*_samples->rows elements.
dist (Matrix<(Of <(Single>)>))
Should be null if not needed. The distances from the input vectors to the neighbors. A vector of k*_samples->rows elements.
Return Value
In case of regression, the predicted result will be a mean value of the particular vector's neighbor responses. In case of classification the class is determined by voting

Assembly: Emgu.CV.ML (Module: Emgu.CV.ML) Version: 1.0.0.0 (1.0.0.0)