mexopencv  3.4.1
MEX interface for OpenCV library
Public Member Functions | Static Public Member Functions | List of all members
anonymous_namespace{SVM_.cpp}::MatlabFunction Class Reference

Represents custom kernel implemented as a MATLAB function. More...

Inheritance diagram for anonymous_namespace{SVM_.cpp}::MatlabFunction:
cv::ml::SVM::Kernel cv::Algorithm

Public Member Functions

 MatlabFunction (const string &func)
 Constructor. More...
 
void calc (int vcount, int n, const float *vecs, const float *another, float *results)
 Evaluates MATLAB kernel function. More...
 
int getType () const
 Return type of SVM formulation. More...
 
- Public Member Functions inherited from cv::Algorithm
 Algorithm ()
 
virtual ~Algorithm ()
 
virtual void clear ()
 
virtual bool empty () const
 
virtual String getDefaultName () const
 
virtual void read (const FileNode &fn)
 
virtual void save (const String &filename) const
 
virtual void write (FileStorage &fs) const
 
void write (const Ptr< FileStorage > &fs, const String &name=String()) const
 

Static Public Member Functions

static Ptr< MatlabFunctioncreate (const string &func)
 Factory function. More...
 
- Static Public Member Functions inherited from cv::Algorithm
static Ptr< _Tp > load (const String &filename, const String &objname=String())
 
static Ptr< _Tp > loadFromString (const String &strModel, const String &objname=String())
 
static Ptr< _Tp > read (const FileNode &fn)
 

Additional Inherited Members

- Protected Member Functions inherited from cv::Algorithm
void writeFormat (FileStorage &fs) const
 

Detailed Description

Represents custom kernel implemented as a MATLAB function.

Definition at line 105 of file SVM_.cpp.

Constructor & Destructor Documentation

◆ MatlabFunction()

anonymous_namespace{SVM_.cpp}::MatlabFunction::MatlabFunction ( const string func)
inlineexplicit

Constructor.

Parameters
funcname of an M-file function that implements an SVM kernel

Definition at line 111 of file SVM_.cpp.

Member Function Documentation

◆ calc()

void anonymous_namespace{SVM_.cpp}::MatlabFunction::calc ( int  vcount,
int  n,
const float *  vecs,
const float *  another,
float *  results 
)
inlinevirtual

Evaluates MATLAB kernel function.

Parameters
[in]vcountnumber of samples
[in]nlength of each sample
[in]vecsinput array of length vcount*n
[in]anotherinput array of length n
[out]resultsoutput array of length vcount

Calculates results(i) = K(vecs(i,:), another), for i=1:vcount (where each sample is of length n).

Implements cv::ml::SVM::Kernel.

Definition at line 126 of file SVM_.cpp.

◆ create()

static Ptr<MatlabFunction> anonymous_namespace{SVM_.cpp}::MatlabFunction::create ( const string func)
inlinestatic

Factory function.

Parameters
funcMATLAB function name.
Returns
smart pointer to newly created instance

Definition at line 169 of file SVM_.cpp.

◆ getType()

int anonymous_namespace{SVM_.cpp}::MatlabFunction::getType ( ) const
inlinevirtual

Return type of SVM formulation.

Returns
SVM type (custom)

Implements cv::ml::SVM::Kernel.

Definition at line 160 of file SVM_.cpp.


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