cvCreateCascadeClassifier

原文如下:

/*
 * cvCreateCascadeClassifier
 *
 * Create cascade classifier
 * dirname          - directory name in which cascade classifier will be created.
 *   It must exist and contain subdirectories 0, 1, 2, ... (nstages-1).
 * vecfilename      - name of .vec file with object's images
 * bgfilename       - name of background description file
 * bg_vecfile       - true if bgfilename represents a vec file with discrete negatives
 * npos             - number of positive samples used in training of each stage
 * nneg             - number of negative samples used in training of each stage
 * nstages          - number of stages
 * numprecalculated - number of features being precalculated. Each precalculated feature
 *   requires (number_of_samples*(sizeof( float ) + sizeof( short ))) bytes of memory
 * numsplits        - number of binary splits in each weak classifier
 *   1 - stumps, 2 and more - trees.
 * minhitrate       - desired min hit rate of each stage
 * maxfalsealarm    - desired max false alarm of each stage
 * weightfraction   - weight trimming parameter
 * mode             - 0 - BASIC = Viola
 *                    1 - CORE  = All upright
 *                    2 - ALL   = All features
 * symmetric        - if not 0 vertical symmetry is assumed
 * equalweights     - if not 0 initial weights of all samples will be equal
 * winwidth         - sample width
 * winheight        - sample height
 * boosttype        - type of applied boosting algorithm
 *   0 - Discrete AdaBoost
 *   1 - Real AdaBoost
 *   2 - LogitBoost
 *   3 - Gentle AdaBoost
 * stumperror       - type of used error if Discrete AdaBoost algorithm is applied
 *   0 - misclassification error
 *   1 - gini error
 *   2 - entropy error
 */
void cvCreateCascadeClassifier( const char* dirname,
                                const char* vecfilename,
                                const char* bgfilename,
                                int npos, int nneg, int nstages,
                                int numprecalculated,
                                int numsplits,
                                float minhitrate = 0.995F, float maxfalsealarm = 0.5F,
                                float weightfraction = 0.95F,
                                int mode = 0, int symmetric = 1,
                                int equalweights = 1,
                                int winwidth = 24, int winheight = 24,
                                int boosttype = 3, int stumperror = 0 );

void cvCreateTreeCascadeClassifier( const char* dirname,
                                    const char* vecfilename,
                                    const char* bgfilename,
                                    int npos, int nneg, int nstages,
                                    int numprecalculated,
                                    int numsplits,
                                    float minhitrate, float maxfalsealarm,
                                    float weightfraction,
                                    int mode, int symmetric,
                                    int equalweights,
                                    int winwidth, int winheight,
                                    int boosttype, int stumperror,
                                    int maxtreesplits, int minpos, bool bg_vecfile = false );

翻译如下:

/*
 * cvCreateCascadeClassifier
 *创建级联分类器
 * dirname          -将创建目录分类器的目录名
 *   该目录名必须存在,其包含的子目录为 0, 1, 2, ... (nstages-1).
 * vecfilename      - .vec文件,它包括包含样本图像的文件名
 * bgfilename       - 背景描述文件名
 * bg_vecfile       - 如果bgfilename 代表一个包含离散负样本文件,那么为true
 * npos             - 在每一个强分类器训练所需要的正样本数
 * nneg             - 在每一个强分类器训练所需要的负样本数
 * nstages          - 强分类器的层数
 * numprecalculated - 预计算的特征数量,每一个预计算的特征需要的内存大小为: (number_of_samples*(sizeof( float ) + sizeof( short ))) bytes
 * numsplits        -每个弱分类器的分支数
 *   1 - stumps, 2 and more - trees.
 * minhitrate       - 每一级的最小击中率
 * maxfalsealarm    - 每一级的最大虚警率
 * weightfraction   - 剔除小样本的权重
 * mode             - 0 - BASIC = Viola
 *                    1 - CORE  = All upright
 *                    2 - ALL   = All features
 * symmetric        - 非0表示垂直对称
 * equalweights     - 非0表示所有样本的初始化权重相等
 * winwidth         - 样本的宽
 * winheight        - 样本的高
 * boosttype        - 应用的提升算法类型
 *   0 - Discrete AdaBoost
 *   1 - Real AdaBoost
 *   2 - LogitBoost
 *   3 - Gentle AdaBoost
 * stumperror       - 如果是 Discrete AdaBoost算法时使用的树桩错误率
 *   0 - 错分不纯度
 *   1 - 基尼不纯度
 *   2 - 熵不纯度
 */
void cvCreateCascadeClassifier( const char* dirname,
                                const char* vecfilename,
                                const char* bgfilename,
                                int npos, int nneg, int nstages,
                                int numprecalculated,
                                int numsplits,
                                float minhitrate = 0.995F, float maxfalsealarm = 0.5F,
                                float weightfraction = 0.95F,
                                int mode = 0, int symmetric = 1,
                                int equalweights = 1,
                                int winwidth = 24, int winheight = 24,
                                int boosttype = 3, int stumperror = 0 );

void cvCreateTreeCascadeClassifier( const char* dirname,
                                    const char* vecfilename,
                                    const char* bgfilename,
                                    int npos, int nneg, int nstages,
                                    int numprecalculated,
                                    int numsplits,
                                    float minhitrate, float maxfalsealarm,
                                    float weightfraction,
                                    int mode, int symmetric,
                                    int equalweights,
                                    int winwidth, int winheight,
                                    int boosttype, int stumperror,
                                    int maxtreesplits, int minpos, bool bg_vecfile = false );

版权声明:本文为博主原创文章,未经博主允许不得转载。

时间: 2024-11-26 04:26:44

cvCreateCascadeClassifier的相关文章

opencv源代码分析之二:cvhaartraining.cpp

我使用的是opencv2.4.9.安装后.我的cvboost..cpp文件的路径是........\opencv\sources\apps\haartraining\cvhaartraining.cpp,研究源代码那么多天,有非常多收获.opencv库真是非常强大.当中在这篇博文中我有部分凝视,其它的有关知识请參考我博客http://blog.csdn.net/ding977921830?viewmode=contents.详细内容例如以下: /*M///////////////////////

opencv源码分析:cvCreateTreeCascadeClassifier

我使用的是opencv2.4.9,cvCreateTreeCascadeClassifier的源码在......opencv\sources\apps\haartraining\cvhaartraining.cpp之中,这中间用到很多结构体,指针函数,宏等各方面的内容,请参考我博客中的文章opencv源码详细解读目录.如需转载请注明本博网址http://blog.csdn.net/ding977921830?viewmode=contents.具体内容如下: /* * cvCreateCasca

opencv源码分析之二:cvhaartraining.cpp

我使用的是opencv2.4.9,安装后,我的cvboost..cpp文件的路径是........\opencv\sources\apps\haartraining\cvhaartraining.cpp,研究源码那么多天,有很多收获,opencv库真是非常强大.其中在这篇博文中我有部分注释,其他的有关知识请参考我博客http://blog.csdn.net/ding977921830?viewmode=contents.具体内容如下: /*M///////////////////////////