OpenCV for Unity  2.6.0
Enox Software / Please refer to OpenCV official document ( http://docs.opencv.org/4.9.0/index.html ) for the details of the argument of the method.
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
OpenCVForUnity.MlModule.NormalBayesClassifier Class Reference

Bayes classifier for normally distributed data. More...

Inheritance diagram for OpenCVForUnity.MlModule.NormalBayesClassifier:
OpenCVForUnity.MlModule.StatModel OpenCVForUnity.CoreModule.Algorithm OpenCVForUnity.DisposableOpenCVObject OpenCVForUnity.DisposableObject

Public Member Functions

float predictProb (Mat inputs, Mat outputs, Mat outputProbs, int flags)
 Predicts the response for sample(s). More...
 
float predictProb (Mat inputs, Mat outputs, Mat outputProbs)
 Predicts the response for sample(s). More...
 
- Public Member Functions inherited from OpenCVForUnity.MlModule.StatModel
int getVarCount ()
 Returns the number of variables in training samples. More...
 
override bool empty ()
 Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read. More...
 
bool isTrained ()
 Returns true if the model is trained. More...
 
bool isClassifier ()
 Returns true if the model is classifier. More...
 
bool train (TrainData trainData, int flags)
 Trains the statistical model. More...
 
bool train (TrainData trainData)
 Trains the statistical model. More...
 
bool train (Mat samples, int layout, Mat responses)
 Trains the statistical model. More...
 
float calcError (TrainData data, bool test, Mat resp)
 Computes error on the training or test dataset. More...
 
virtual float predict (Mat samples, Mat results, int flags)
 Predicts response(s) for the provided sample(s) More...
 
virtual float predict (Mat samples, Mat results)
 Predicts response(s) for the provided sample(s) More...
 
virtual float predict (Mat samples)
 Predicts response(s) for the provided sample(s) More...
 
- Public Member Functions inherited from OpenCVForUnity.CoreModule.Algorithm
IntPtr getNativeObjAddr ()
 
virtual void clear ()
 Clears the algorithm state. More...
 
void save (string filename)
 
virtual string getDefaultName ()
 
- Public Member Functions inherited from OpenCVForUnity.DisposableObject
void Dispose ()
 
void ThrowIfDisposed ()
 

Static Public Member Functions

static new NormalBayesClassifier __fromPtr__ (IntPtr addr)
 
static NormalBayesClassifier create ()
 
static NormalBayesClassifier load (string filepath, string nodeName)
 Loads and creates a serialized NormalBayesClassifier from a file. More...
 
static NormalBayesClassifier load (string filepath)
 Loads and creates a serialized NormalBayesClassifier from a file. More...
 
- Static Public Member Functions inherited from OpenCVForUnity.MlModule.StatModel
static new StatModel __fromPtr__ (IntPtr addr)
 
- Static Public Member Functions inherited from OpenCVForUnity.CoreModule.Algorithm
static Algorithm __fromPtr__ (IntPtr addr)
 
- Static Public Member Functions inherited from OpenCVForUnity.DisposableObject
static IntPtr ThrowIfNullIntPtr (IntPtr ptr)
 

Protected Member Functions

override void Dispose (bool disposing)
 
- Protected Member Functions inherited from OpenCVForUnity.MlModule.StatModel
override void Dispose (bool disposing)
 
- Protected Member Functions inherited from OpenCVForUnity.DisposableOpenCVObject
 DisposableOpenCVObject ()
 
 DisposableOpenCVObject (IntPtr ptr)
 
 DisposableOpenCVObject (bool isEnabledDispose)
 
 DisposableOpenCVObject (IntPtr ptr, bool isEnabledDispose)
 
- Protected Member Functions inherited from OpenCVForUnity.DisposableObject
 DisposableObject ()
 
 DisposableObject (bool isEnabledDispose)
 

Additional Inherited Members

- Public Attributes inherited from OpenCVForUnity.MlModule.StatModel
const int UPDATE_MODEL = 1
 
const int RAW_OUTPUT = 1
 
const int COMPRESSED_INPUT = 2
 
const int PREPROCESSED_INPUT = 4
 
- Properties inherited from OpenCVForUnity.DisposableObject
bool IsDisposed [get, protected set]
 
bool IsEnabledDispose [get, set]
 

Detailed Description

Bayes classifier for normally distributed data.

See also
ml_intro_bayes

Member Function Documentation

◆ __fromPtr__()

static new NormalBayesClassifier OpenCVForUnity.MlModule.NormalBayesClassifier.__fromPtr__ ( IntPtr  addr)
static

◆ create()

static NormalBayesClassifier OpenCVForUnity.MlModule.NormalBayesClassifier.create ( )
static

Creates empty model Use StatModel::train to train the model after creation.

◆ Dispose()

override void OpenCVForUnity.MlModule.NormalBayesClassifier.Dispose ( bool  disposing)
protectedvirtual

◆ load() [1/2]

static NormalBayesClassifier OpenCVForUnity.MlModule.NormalBayesClassifier.load ( string  filepath,
string  nodeName 
)
static

Loads and creates a serialized NormalBayesClassifier from a file.

Use NormalBayesClassifier::save to serialize and store an NormalBayesClassifier to disk. Load the NormalBayesClassifier from this file again, by calling this function with the path to the file. Optionally specify the node for the file containing the classifier

Parameters
filepathpath to serialized NormalBayesClassifier
nodeNamename of node containing the classifier

◆ load() [2/2]

static NormalBayesClassifier OpenCVForUnity.MlModule.NormalBayesClassifier.load ( string  filepath)
static

Loads and creates a serialized NormalBayesClassifier from a file.

Use NormalBayesClassifier::save to serialize and store an NormalBayesClassifier to disk. Load the NormalBayesClassifier from this file again, by calling this function with the path to the file. Optionally specify the node for the file containing the classifier

Parameters
filepathpath to serialized NormalBayesClassifier
nodeNamename of node containing the classifier

◆ predictProb() [1/2]

float OpenCVForUnity.MlModule.NormalBayesClassifier.predictProb ( Mat  inputs,
Mat  outputs,
Mat  outputProbs,
int  flags 
)

Predicts the response for sample(s).

The method estimates the most probable classes for input vectors. Input vectors (one or more) are stored as rows of the matrix inputs. In case of multiple input vectors, there should be one output vector outputs. The predicted class for a single input vector is returned by the method. The vector outputProbs contains the output probabilities corresponding to each element of result.

◆ predictProb() [2/2]

float OpenCVForUnity.MlModule.NormalBayesClassifier.predictProb ( Mat  inputs,
Mat  outputs,
Mat  outputProbs 
)

Predicts the response for sample(s).

The method estimates the most probable classes for input vectors. Input vectors (one or more) are stored as rows of the matrix inputs. In case of multiple input vectors, there should be one output vector outputs. The predicted class for a single input vector is returned by the method. The vector outputProbs contains the output probabilities corresponding to each element of result.


The documentation for this class was generated from the following file: