OpenCV for Unity 2.6.5
Enox Software / Please refer to OpenCV official document ( http://docs.opencv.org/4.10.0/index.html ) for the details of the argument of the method.
Loading...
Searching...
No Matches
OpenCVForUnity.MlModule.SVMSGD Class Reference

Public Member Functions

float getInitialStepSize ()
 
float getMarginRegularization ()
 
int getMarginType ()
 
float getShift ()
 
float getStepDecreasingPower ()
 
int getSvmsgdType ()
 
TermCriteria getTermCriteria ()
 
double double double epsilon getTermCriteriaAsValueTuple ()
 
Vec3d getTermCriteriaAsVec3d ()
 
Mat getWeights ()
 
void setInitialStepSize (float InitialStepSize)
 
void setMarginRegularization (float marginRegularization)
 
void setMarginType (int marginType)
 
void setOptimalParameters ()
 Function sets optimal parameters values for chosen SVM SGD model.
 
void setOptimalParameters (int svmsgdType)
 Function sets optimal parameters values for chosen SVM SGD model.
 
void setOptimalParameters (int svmsgdType, int marginType)
 Function sets optimal parameters values for chosen SVM SGD model.
 
void setStepDecreasingPower (float stepDecreasingPower)
 
void setSvmsgdType (int svmsgdType)
 
void setTermCriteria (in Vec3d val)
 
void setTermCriteria (in(double type, double maxCount, double epsilon) val)
 
void setTermCriteria (TermCriteria val)
 
- Public Member Functions inherited from OpenCVForUnity.MlModule.StatModel
float calcError (TrainData data, bool test, Mat resp)
 Computes error on the training or test dataset.
 
override bool empty ()
 Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read.
 
int getVarCount ()
 Returns the number of variables in training samples.
 
bool isClassifier ()
 Returns true if the model is classifier.
 
bool isTrained ()
 Returns true if the model is trained.
 
virtual float predict (Mat samples)
 Predicts response(s) for the provided sample(s)
 
virtual float predict (Mat samples, Mat results)
 Predicts response(s) for the provided sample(s)
 
virtual float predict (Mat samples, Mat results, int flags)
 Predicts response(s) for the provided sample(s)
 
bool train (Mat samples, int layout, Mat responses)
 Trains the statistical model.
 
bool train (TrainData trainData)
 Trains the statistical model.
 
bool train (TrainData trainData, int flags)
 Trains the statistical model.
 
- Public Member Functions inherited from OpenCVForUnity.CoreModule.Algorithm
virtual void clear ()
 Clears the algorithm state.
 
virtual string getDefaultName ()
 
IntPtr getNativeObjAddr ()
 
void save (string filename)
 
- Public Member Functions inherited from OpenCVForUnity.DisposableObject
void Dispose ()
 
void ThrowIfDisposed ()
 

Static Public Member Functions

static new SVMSGD __fromPtr__ (IntPtr addr)
 
static SVMSGD create ()
 Creates empty model. Use StatModel.train to train the model. Since SVMSGD has several parameters, you may want to find the best parameters for your problem or use setOptimalParameters() to set some default parameters.
 
static SVMSGD load (string filepath)
 Loads and creates a serialized SVMSGD from a file.
 
static SVMSGD load (string filepath, string nodeName)
 Loads and creates a serialized SVMSGD from a file.
 
- 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)
 

Public Attributes

double double maxCount
 
double type
 

Static Public Attributes

const int ASGD = 1
 
const int HARD_MARGIN = 1
 
const int SGD = 0
 
const int SOFT_MARGIN = 0
 
- Static Public Attributes inherited from OpenCVForUnity.MlModule.StatModel
const int COMPRESSED_INPUT = 2
 
const int PREPROCESSED_INPUT = 4
 
const int RAW_OUTPUT = 1
 
const int UPDATE_MODEL = 1
 

Protected Member Functions

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

Additional Inherited Members

- Package Functions inherited from OpenCVForUnity.MlModule.StatModel
- Package Functions inherited from OpenCVForUnity.CoreModule.Algorithm
- Package Attributes inherited from OpenCVForUnity.DisposableOpenCVObject
- Properties inherited from OpenCVForUnity.DisposableObject
bool IsDisposed [get, protected set]
 
bool IsEnabledDispose [get, set]
 

Detailed Description

*************************************************************************************\ Stochastic Gradient Descent SVM Classifier * ***************************************************************************************

Member Function Documentation

◆ __fromPtr__()

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

◆ create()

static SVMSGD OpenCVForUnity.MlModule.SVMSGD.create ( )
static

Creates empty model. Use StatModel.train to train the model. Since SVMSGD has several parameters, you may want to find the best parameters for your problem or use setOptimalParameters() to set some default parameters.

◆ Dispose()

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

Reimplemented from OpenCVForUnity.MlModule.StatModel.

◆ getInitialStepSize()

float OpenCVForUnity.MlModule.SVMSGD.getInitialStepSize ( )

◆ getMarginRegularization()

float OpenCVForUnity.MlModule.SVMSGD.getMarginRegularization ( )

◆ getMarginType()

int OpenCVForUnity.MlModule.SVMSGD.getMarginType ( )
See also
setMarginType

◆ getShift()

float OpenCVForUnity.MlModule.SVMSGD.getShift ( )
Returns
the shift of the trained model (decision function f(x) = weights * x + shift).

◆ getStepDecreasingPower()

float OpenCVForUnity.MlModule.SVMSGD.getStepDecreasingPower ( )

◆ getSvmsgdType()

int OpenCVForUnity.MlModule.SVMSGD.getSvmsgdType ( )
See also
setSvmsgdType

◆ getTermCriteria()

TermCriteria OpenCVForUnity.MlModule.SVMSGD.getTermCriteria ( )
See also
setTermCriteria

◆ getTermCriteriaAsValueTuple()

double double double epsilon OpenCVForUnity.MlModule.SVMSGD.getTermCriteriaAsValueTuple ( )

◆ getTermCriteriaAsVec3d()

Vec3d OpenCVForUnity.MlModule.SVMSGD.getTermCriteriaAsVec3d ( )
See also
setTermCriteria

◆ getWeights()

Mat OpenCVForUnity.MlModule.SVMSGD.getWeights ( )
Returns
the weights of the trained model (decision function f(x) = weights * x + shift).

◆ load() [1/2]

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

Loads and creates a serialized SVMSGD from a file.

Use SVMSGD.save to serialize and store an SVMSGD to disk. Load the SVMSGD 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 SVMSGD
nodeNamename of node containing the classifier

◆ load() [2/2]

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

Loads and creates a serialized SVMSGD from a file.

Use SVMSGD.save to serialize and store an SVMSGD to disk. Load the SVMSGD 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 SVMSGD
nodeNamename of node containing the classifier

◆ setInitialStepSize()

void OpenCVForUnity.MlModule.SVMSGD.setInitialStepSize ( float InitialStepSize)

◆ setMarginRegularization()

void OpenCVForUnity.MlModule.SVMSGD.setMarginRegularization ( float marginRegularization)

◆ setMarginType()

void OpenCVForUnity.MlModule.SVMSGD.setMarginType ( int marginType)
See also
getMarginType

◆ setOptimalParameters() [1/3]

void OpenCVForUnity.MlModule.SVMSGD.setOptimalParameters ( )

Function sets optimal parameters values for chosen SVM SGD model.

Parameters
svmsgdTypeis the type of SVMSGD classifier.
marginTypeis the type of margin constraint.

◆ setOptimalParameters() [2/3]

void OpenCVForUnity.MlModule.SVMSGD.setOptimalParameters ( int svmsgdType)

Function sets optimal parameters values for chosen SVM SGD model.

Parameters
svmsgdTypeis the type of SVMSGD classifier.
marginTypeis the type of margin constraint.

◆ setOptimalParameters() [3/3]

void OpenCVForUnity.MlModule.SVMSGD.setOptimalParameters ( int svmsgdType,
int marginType )

Function sets optimal parameters values for chosen SVM SGD model.

Parameters
svmsgdTypeis the type of SVMSGD classifier.
marginTypeis the type of margin constraint.

◆ setStepDecreasingPower()

void OpenCVForUnity.MlModule.SVMSGD.setStepDecreasingPower ( float stepDecreasingPower)

◆ setSvmsgdType()

void OpenCVForUnity.MlModule.SVMSGD.setSvmsgdType ( int svmsgdType)
See also
getSvmsgdType

◆ setTermCriteria() [1/3]

void OpenCVForUnity.MlModule.SVMSGD.setTermCriteria ( in Vec3d val)
See also
getTermCriteria

◆ setTermCriteria() [2/3]

void OpenCVForUnity.MlModule.SVMSGD.setTermCriteria ( in(double type, double maxCount, double epsilon) val)
See also
getTermCriteria

◆ setTermCriteria() [3/3]

void OpenCVForUnity.MlModule.SVMSGD.setTermCriteria ( TermCriteria val)
See also
getTermCriteria

Member Data Documentation

◆ ASGD

const int OpenCVForUnity.MlModule.SVMSGD.ASGD = 1
static

◆ HARD_MARGIN

const int OpenCVForUnity.MlModule.SVMSGD.HARD_MARGIN = 1
static

◆ maxCount

double double OpenCVForUnity.MlModule.SVMSGD.maxCount

◆ SGD

const int OpenCVForUnity.MlModule.SVMSGD.SGD = 0
static

◆ SOFT_MARGIN

const int OpenCVForUnity.MlModule.SVMSGD.SOFT_MARGIN = 0
static

◆ type

double OpenCVForUnity.MlModule.SVMSGD.type
See also
setTermCriteria

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