| 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
)
Public Function FindNearest (
samples As InputArray,
k As Integer,
results As OutputArray,
Optional neighborResponses As OutputArray = Nothing,
Optional dist As OutputArray = Nothing
) As Single
public:
float FindNearest(
InputArray^ samples,
int k,
OutputArray^ results,
OutputArray^ neighborResponses = nullptr,
OutputArray^ dist = nullptr
)
member FindNearest :
samples : InputArray *
k : int *
results : OutputArray *
?neighborResponses : OutputArray *
?dist : OutputArray
(* Defaults:
let _neighborResponses = defaultArg neighborResponses null
let _dist = defaultArg dist null
*)
-> float32
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