码迷,mamicode.com
首页 > 其他好文 > 详细

icvSetWeightsAndClasses

时间:2017-05-05 23:11:22      阅读:176      评论:0      收藏:0      [点我收藏+]

标签:训练   class   cvs   stat   void   nbsp   content   oid   pre   



/*
 *icvSetWeightsAndClasses
 *作用:给训练样本的权重和类别赋值
 */
static void icvSetWeightsAndClasses( CvHaarTrainingData* training_data,
                              int num1, float weight1, float cls1,
                              int num2, float weight2, float cls2 )
{
    int j;

    assert( num1 + num2 <= training_data->maxnum );
    //把训练样本前num1个样本的权重更新为weight1。类别更新为cls1
    for( j = 0; j < num1; j++ )
    {
        training_data->weights.data.fl[j] = weight1;
        training_data->cls.data.fl[j] = cls1;
    }
      //把训练样本前num1~num2个样本的权重更新为weight2,类别更新为cls2
     for( j = num1; j < num1 + num2; j++ )
    {
        training_data->weights.data.fl[j] = weight2;
        training_data->cls.data.fl[j] = cls2;
    }
}


icvSetWeightsAndClasses

标签:训练   class   cvs   stat   void   nbsp   content   oid   pre   

原文地址:http://www.cnblogs.com/yutingliuyl/p/6815083.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!