Method FindNearest
- Namespace
- OpenCvSharp.ML
- Assembly
- OpenCvSharp.dll
FindNearest(InputArray, int, OutputArray, OutputArray, OutputArray)
Finds the neighbors and predicts responses for input vectors.
public float FindNearest(InputArray samples, int k, OutputArray results, OutputArray neighborResponses = default, OutputArray dist = default)
Parameters
samplesInputArrayInput samples stored by rows. It is a single-precision floating-point matrix of
[number_of_samples] * ksize.kintNumber of used nearest neighbors. Should be greater than 1.
resultsOutputArrayVector with results of prediction (regression or classification) for each input sample. It is a single-precision floating-point vector with
[number_of_samples]elements.neighborResponsesOutputArrayneighborResponses Optional output values for corresponding neighbors. It is a single-precision floating-point matrix of
[number_of_samples] * ksize.distOutputArrayOptional output distances from the input vectors to the corresponding neighbors. It is a single-precision floating-point matrix of
[number_of_samples] * ksize.