资源简介

adaboost法人脸检测,图象库自己添加。

资源截图

代码片段和文件信息

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%修改权值
%%变量结果:ht                                            弱分离器的判决结果
%%        Zt                                      归一化参数
%%        W                                       权值结果
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



function [WhtalphZt] = changeweight(BClassifierdatalocatWnum)


alph = log((1-BClassifier.error)/BClassifier.error)/2;
feature = extract_features(datalocatnum);
sample_num = length(data.labels);
Zt = 0;
threshold_matrix = zeros(1length(data.images)); 
threshold_matrix(::) = BClassifier.threshold;
if BClassifier.Ori == 1
   
    ht = (feature >= threshold_matrix);
    ht = ht + ht - 1;
else
    ht = (feature <= threshold_matrix);
    ht = ht + ht - 1;
end
for i = 1 : sample_num
    Zt=W(i)*exp(-alph*data.labels(i)*ht(i))+Zt;
end
for i = 1 : sample_num
    W(i) = W(i)*exp(-alph*data.labels(i)*ht(i))/Zt;
end

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       1021  2010-04-16 16:47  adaboost\changeweight.m

     文件       2164  2010-04-16 16:36  adaboost\extract_features.m

     文件       1750  2010-04-16 16:47  adaboost\judgment.m

     文件        292  2010-04-16 17:11  adaboost\manual.txt

     文件       3172  2010-04-16 16:34  adaboost\Preprocess.m

     文件       2576  2010-04-16 17:06  adaboost\Runme2.m

     文件        889  2010-04-10 15:10  adaboost\threshold.m

     文件       3116  2010-08-07 14:13  adaboost\Preprocess.asv

     目录          0  2012-11-05 21:27  adaboost

----------- ---------  ---------- -----  ----

                14980                    9


评论

共有 条评论