Click or drag to resize

KNearestFindNearest Method

Finds the neighbors and predicts responses for input vectors.

Namespace:  OpenCvSharp.ML
Assembly:  OpenCvSharp (in OpenCvSharp.dll) Version: 1.0.0
Syntax
public float FindNearest(
	InputArray samples,
	int k,
	OutputArray results,
	OutputArray neighborResponses = null,
	OutputArray dist = null
)

Parameters

samples
Type: OpenCvSharpInputArray
Input samples stored by rows. It is a single-precision floating-point matrix of `[number_of_samples] * k` size.
k
Type: SystemInt32
Number of used nearest neighbors. Should be greater than 1.
results
Type: OpenCvSharpOutputArray
Vector with results of prediction (regression or classification) for each input sample. It is a single-precision floating-point vector with `[number_of_samples]` elements.
neighborResponses (Optional)
Type: OpenCvSharpOutputArray
neighborResponses Optional output values for corresponding neighbors. It is a single-precision floating-point matrix of `[number_of_samples] * k` size.
dist (Optional)
Type: OpenCvSharpOutputArray
Optional output distances from the input vectors to the corresponding neighbors. It is a single-precision floating-point matrix of `[number_of_samples] * k` size.

Return Value

Type: Single

[Missing <returns> documentation for "M:OpenCvSharp.ML.KNearest.FindNearest(OpenCvSharp.InputArray,System.Int32,OpenCvSharp.OutputArray,OpenCvSharp.OutputArray,OpenCvSharp.OutputArray)"]

See Also