1. CvNormalBayesClassifier的 类 定 义
在ml.hpp中有以下类定义:
-
class CV_EXPORTS_W CvNormalBayesClassifier : public CvStatModel
-
{
-
public:
-
CV_WRAP CvNormalBayesClassifier();
-
virtual ~CvNormalBayesClassifier();
-
-
CvNormalBayesClassifier( const CvMat* trainData, const CvMat* responses,
-
const CvMat* varIdx=0, const CvMat* sampleIdx=0 );
-
-
virtual bool train( const CvMat* trainData, const CvMat* responses,
-
const CvMat* varIdx = 0, const CvMat* sampleIdx=0, bool update=false );
-
-
virtual float predict( const CvMat* samples, CV_OUT CvMat* results=0 ) const;
-
CV_WRAP virtual void clear();
-
-
CV_WRAP CvNormalBayesClassifier( const cv::Mat& trainData, const cv::Mat& responses,
-
const cv::Mat& varIdx=cv::Mat(), const cv::Mat& sampleIdx=cv::Mat() );
-
CV_WRAP virtual bool train( const cv::Mat& trainData, const cv::Mat& responses,
-
const cv::Mat& varIdx = cv::Mat(), const cv::Mat& sampleIdx=cv::Mat(),
-
bool update=false );
-
CV_WRAP virtual float predict( const cv::Mat& samples, CV_OUT cv::Mat* results=0 ) const;
-
-
virtual void write( CvFileStorage* storage, const char* name ) const;
-
virtual void read( CvFileStorage* storage, CvFileNode* node );
-
-
protected:
-
int var_count, var_all;
-
CvMat* var_idx;
-
CvMat* cls_labels;
-
CvMat** count;
-
CvMat** sum;
-
CvMat** productsum;
-
CvMat** avg;
-
CvMat** inv_eigen_values;
-
CvMat** cov_rotate_mats;
-
CvMat* c;
-
};
2.类的实现文件
OpenCV Machine Learning 之正态贝叶斯分类器源代码分析(Normal Bayes Classifier),布布扣,bubuko.com
OpenCV Machine Learning 之正态贝叶斯分类器源代码分析(Normal Bayes Classifier)
原文:http://blog.csdn.net/zhjm07054115/article/details/28441087