原文如下:
/* * cvBoostNextWeakClassifier * * The cvBoostNextWeakClassifier function performs next training * iteration and caluclates response values and weights for the next weak * classifier training. * * Parameters * weakEvalVals * Vector of values obtained by evaluation of each sample with * the last trained weak classifier (iteration i). Must be of CV_32FC1 type. * trainClasses * Vector of classes of training samples. Each element must be 0 or 1, * and of type CV_32FC1. * weakTrainVals * Vector of response values for the next weak classifier training * (iteration i+1). Must be of type CV_32FC1. * weights * Weight vector of training samples for the next weak classifier training * (iteration i+1). Must be of type CV_32FC1. * trainer * A pointer to internal trainer returned by the cvBoostStartTraining * function call. * * Return Values * The return value is the coefficient for the last trained weak classifier. * * Remarks * weakTrainVals and weights must be exactly the same vectors as used in * the cvBoostStartTraining function call and should not be modified. * The function calculates response values and weights for the next weak * classifier training and stores them into weakTrainVals and weights * respectively. * Note, the training of the weak classifier of iteration i+1 using * weakTrainVals, weight, trainingData is outside of this function. */ CV_BOOST_API float cvBoostNextWeakClassifier( CvMat* weakEvalVals, CvMat* trainClasses, CvMat* weakTrainVals, CvMat* weights, CvBoostTrainer* trainer );
翻译如下:
/* * cvBoostNextWeakClassifier *这个函数的作用是为了训练下一个弱分类器,进行下一个迭代训练,计算响应值和权重 * * 参数含义: * weakEvalVals * 用上一个迭代训练的弱分类器(第i次迭代)来计算每一个样本的响应值的向量, 必须是 CV_32FC1 的类型 * trainClasses * 训练样本类的向量 0 or 1,类型必须为 CV_32FC1. * weakTrainVals * 下一个弱分类器(第i+1次迭代)所需要的的响应值向量,类型也必须为CV_32FC1. * weights * 下一个弱分类器(第i+1次迭代)所需要的的权重向量,类型也必须为CV_32FC1. * trainer * 内部trainer的指针,它由cvBoostStartTraining函数回调 * * 返回值 * 返回值是上一个训练的弱分类器的系数 * * 注: * weakTrainVals and weights 必须与在cvBoostStartTraining函数回调 的向量严格一致,而且不能修改 ; * 这个函数计算响应值和权重,并分别存储在 weakTrainVals and weights里,下一个弱分类器的训练需要这两个参数。 * 注意,第i+1次迭代过程的弱分类器的训练所使用的 weakTrainVals, weight, trainingData 在这个函数之外。 */ CV_BOOST_API float cvBoostNextWeakClassifier( CvMat* weakEvalVals, CvMat* trainClasses, CvMat* weakTrainVals, CvMat* weights, CvBoostTrainer* trainer );
时间: 2024-10-25 19:47:16