对于opencv级联分类器,stage.xml和cascade.xml中的值是什么意思 [英] What is the meaning of values in stage.xml and cascade.xml for opencv cascade classifier

查看:314
本文介绍了对于opencv级联分类器,stage.xml和cascade.xml中的值是什么意思的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图从教程中检测到某些东西.训练完成后,将创建舞台文件和级联文件.我了解算法,但不知道这些文件中信息的含义.

I have tried to detect something from a tutorial. When training have finished, stage files and cascade file is created. I have knowledge about the algorithm but I don't know meaning of information inside these file.

<internalNodes>
        0 -1 13569 2.8149113059043884e-003</internalNodes>
      <leafValues>
        9.8837211728096008e-002 -8.5897433757781982e-001</leafValues></_>  

<rects>
        <_>
          0 0 3 1 -1.</_>
        <_>
          1 0 1 1 3.</_></rects>
      <tilted>0</tilted></_>

这些值的含义是什么?

推荐答案

让我们从第一个块开始:

Let's start with first block:

<internalNodes>
        0 -1 13569 2.8149113059043884e-003</internalNodes>
<leafValues>
        9.8837211728096008e-002 -8.5897433757781982e-001</leafValues></_> 

它描述了弱分类器之一.在这种情况下,它是基于树桩的,即它的最大深度等于1的树.0-1是根节点的左子节点和右子节点的索引.如果索引小于或等于零,则表明它是叶节点.请注意,要计算叶子索引,您需要将其取反.下一个数字(13569)是<features>部分中的功能部件索引.下一个数字(2.8149113059043884e-003)是节点阈值.在leafValues部分,介绍了级联树中叶子的权重.

It describes one of the weak classifier. In such case it's stump based, i.e. it's tree with max depth is equal to 1. 0 and -1 it's indexes of left and right child of root node. If indexes less or equal to zero it indicates that it's leaf nodes. Note that to calculate leaf index you need to negate it. Next number (13569) is index of feature in <features> section. And next number (2.8149113059043884e-003) is node threshold. In leafValues section presented weights of leafs in cascade tree.

例如,在此弱分类器中,我们需要计算13569个特征的值.接下来,将此值与阈值(2.8149113059043884e-003)进行比较,如果该阈值小于您需要添加第一叶子值(9.8837211728096008e-002)的阈值,则需要添加第二叶子值(-8.5897433757787781982e-001)

For example, in this weak classifier we need to calculate value of 13569 feature. Next, compare this value with threshold (2.8149113059043884e-003) and if it less that threshold than you need to add the first leaf value (9.8837211728096008e-002) else you need to add the second leaf value (-8.5897433757781982e-001).

下一部分描述了Haar功能之一:

Next section describes one of the Haar feature:

<rects>
        <_>
          0 0 3 1 -1.</_>
        <_>
          1 0 1 1 3.</_></rects>
<tilted>0</tilted></_>

它显然描述了矩形的参数(x,y,宽度,高度)和矩形的权重.它也可能是倾斜的,由<tilted>0</tilted>标志指示.

It obviously describes parameters of rectangle (x, y, width, height) and the weight of rectangle. It also may be tilted, that indicates by <tilted>0</tilted> flag.

我希望它会有所帮助.

这篇关于对于opencv级联分类器,stage.xml和cascade.xml中的值是什么意思的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆