C# Class OpenCvSharp.ML.KNearest

K nearest neighbors classifier
Inheritance: StatModel
ファイルを表示 Open project: shimat/opencvsharp

Public Methods

Method Description
Create ( ) : KNearest

Creates the empty model

FindNearest ( InputArray samples, int k, OutputArray results, OutputArray neighborResponses = null, OutputArray dist = null ) : float

Finds the neighbors and predicts responses for input vectors.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Clean up any resources being used.

KNearest ( IntPtr p ) : System

Creates instance by raw pointer cv::ml::KNearest*

Method Details

Create() public static method

Creates the empty model
public static Create ( ) : KNearest
return KNearest

Dispose() protected method

Clean up any resources being used.
protected Dispose ( bool disposing ) : void
disposing bool /// If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. /// If false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. ///
return void

FindNearest() public method

Finds the neighbors and predicts responses for input vectors.
public FindNearest ( InputArray samples, int k, OutputArray results, OutputArray neighborResponses = null, OutputArray dist = null ) : float
samples InputArray Input samples stored by rows. /// It is a single-precision floating-point matrix of `[number_of_samples] * k` size.
k int Number of used nearest neighbors. Should be greater than 1.
results OutputArray 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 OutputArray neighborResponses Optional output values for corresponding neighbors. /// It is a single-precision floating-point matrix of `[number_of_samples] * k` size.
dist OutputArray 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 float

KNearest() protected method

Creates instance by raw pointer cv::ml::KNearest*
protected KNearest ( IntPtr p ) : System
p System.IntPtr
return System