简体   繁体   English

用于Viola-jones的haar级联XML

[英]haar cascade XML for Viola-jones

<!-- tree 0 -->
-<_>
**<!-- root node -->**
-<feature>
    -<rects>
        <_>2 7 16 4 -1.</_>
        <_>2 9 16 2 2.</_>
    </rects>
    <tilted>0</tilted>
</feature>
<threshold>4.3272329494357109e-003</threshold>
<left_val>0.0383819006383419</left_val>
<right_node>1</right_node>
</_>
-<_>
    **<!-- node 1 -->**
-<feature>
    -<rects>
        <_>8 4 3 14 -1.</_>
        <_>8 11 3 7 2.</_>
    </rects>
    <tilted>0</tilted>    
</feature>
<threshold>0.0130761601030827</threshold>
<left_val>0.8965256810188294</left_val>            
<right_val>0.2629314064979553</right_val>

What are <root node> and <node 1> respectively? <root node><node 1>分别是什么?

I thougth that each weak classifier matches with one haar-like feature 我认为每个弱分类器都具有一个类似haar的特征

but when I see this XML code, there are two nodes and I am confused. 但是当我看到这个XML代码时,有两个节点,我很困惑。

end I don't get what right/left_node or right/left_val means also. 结束我也没有得到right / left_node或right / left_val的意思。

There are different ways you train the samples. 训练样本有不同的方法。 One way is to have "nsplits" option to be less than 2, where only root nodes are generated, with ,each root node corresponding to a haar feature, but if "nsplits" is greater than 1 you have root node split into leaf nodes such that the root node + leaf nodes = nsplits value and having 1 haar feature associated with each "node" arranged in a regression decision tree form (CART). 一种方法是使“ nsplits”选项小于2,其中仅生成根节点,每个根节点对应于一个haar特征,但是如果“ nsplits”大于1,则将根节点分为叶节点这样,根节点+叶节点= nsplits值,并具有1个与以回归决策树形式(CART)排列的“节点”相关联的haar特征。

To answer your question short, even here each classifier is a haar feature but are arranged in a desision tree form having more than 1 leaf. 为了简短地回答您的问题,即使在这里每个分类器都是haar特征,但以具有多个叶子的目标树形式排列。 For this particular example the training was done with nsplits = 2. 对于此特定示例,使用nsplits = 2进行训练。

OpenCV code is generic not for Viola-Jones particular algorithm, so the XML file has a tree like structure while the Viola-Jones has linear structure of multiple stages. OpenCV代码不是Viola-Jones特定算法的通用代码,因此XML文件具有树状结构,而Viola-Jones具有多个阶段的线性结构。 In short you will find that each root node is a stage, and of course inner nodes are the features while each feature has 2 or 3 rectangles. 简而言之,您会发现每个根节点都是一个阶段,而内部节点当然是要素,而每个要素都有2或3个矩形。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM