转换后的single component person model检测效果不错,而VOC2007 2009中的three-component person model的检测效果则非常差,可能是OpenCV对混合模型的加载不太支持。(我只关心person的检测,所以只测试了person的model转换后的效果)
% jelly 2013-08-12
% Convert *.mat format model in the source example in
% Discriminatively Trained Deformable Part Models "voc-release4.01"
% to opencv's latentSVM detect input format *.xml
function MAT2XMLmodel_401(matmodel, xmlfile)
matmodel = 'INRIA/inriaperson_final';
xmlfile = 'INRIA/inriaperson_final.xml';
load(matmodel);
fid = fopen(xmlfile, 'w');
fprintf(fid, '<Model>\n');
%%
%获取组件数
ncom = length(model.rules{model.start});
fprintf(fid, '\t<!-- Number of components -->\n');
fprintf(fid, '\t<NumComponents>%d</NumComponents>\n', ncom);
%获取特征维数,固定值31维。model中没有记录
nfeature = 31;
fprintf(fid, '\t<!-- Number