我用的opencv库下的正脸xml文件,此文件用的是20*20的文件训练的,训练出来的20级分类器,弱分类器下的矩形特征格式如下(x,y,w,h,weight)。
我设计的检测窗为20*20,检测窗口中的位置为x,y范围是0-19。
haar特征计算为Freature=SAT(x,y)+SAT(x+w,y+h)-SAT(x,y+h)-SAT(x+w,y);但是x,y可以取到0,x+w和y+h可以取到20,超出了检测窗口。请问问题出在了哪里?
xml文件一段
<!-- tree 5 -->
<_>
<!-- root node -->
<feature>
<rects>
<_>14 1 6 12 -1.</_> 相加为20,超出了
<_>14 1 3 12 2.</_></rects>
<tilted>0</tilted></feature>
<threshold>0.0494148582220078</threshold>
<left_node>1</left_node>
<right_val>0.8151652812957764</right_val></_>
<_>
<!-- node 1 -->
<feature>
<rects>
<_>4 4 12 6 -1.</_>
<_>8 4 4 6 3.</_></rects>
<tilted>0</tilted></feature>
<threshold>4.4891750440001488e-003</threshold>
<left_val>0.2808783054351807</left_val>
<right_val>0.6027774810791016</right_val></_></_>
<_>