如何了解人脸检测xml [英] How to understand face detection xml

查看:108
本文介绍了如何了解人脸检测xml的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用opencv_trainedcascade.exe训练了面孔.我有一系列针对不同阶段的xml文件. 对于每个xml文件,都有内部节点和leafVlaues,其中一个如下所示.

I have trained faces using opencv_trainedcascade.exe. I have a series of xml files for different stages. For each xml file has internal nodes and leafVlaues and one of them is shown below.

<?xml version="1.0"?>
<opencv_storage>
<stage0>
  <maxWeakCount>3</maxWeakCount>
  <stageThreshold>-1.3019366264343262e+000</stageThreshold>
  <weakClassifiers>
    <_>
      <internalNodes>
        0 -1 2711 -2099201 -2623493 -774797061 -2162625 -827343685
        -5535541 -1163949377 -21761</internalNodes>
      <leafValues>
        -9.2679738998413086e-001 6.0445684194564819e-001</leafValues></_>
    <_>
      <internalNodes>
        0 -1 1533 -252379683 -203697739 1410462197 1435881947 -74449473
        -1147414357 1510080511 -1</internalNodes>
      <leafValues>
        -9.1606438159942627e-001 6.2200444936752319e-001</leafValues></_>
    <_>
      <internalNodes>
        0 -1 917 -42468780 -11479728 -745548289 -2371181 -23070497
        -552607093 -74777633 -536871937</internalNodes>
      <leafValues>
        -9.2716777324676514e-001 5.4092508554458618e-001</leafValues></_></weakClassifiers></stage0>
</opencv_storage>

我的查询是 (1)那些stageThreshold,internalNodes和leafValues是什么意思? (2)在实际的人脸检测中,如何在级联分类器中使用它们,我读了几篇关于Adaboost算法的论文.但是我不太了解. 谢谢

My queries are (1)What do those stageThreshold, internalNodes and leafValues mean? (2)In actual face detection, how are they used in cascaded classifier, I read a few paper for Adaboost algorithm. But I don't understand quite well. Thanks

推荐答案

在挖掘了detection_based_tracker.cpp之后,现在我了解了internalNodes,leafValues和stagethreshold是什么以及如何使用它们.当我们查看lbpcascade_frontalface.xml时,我们看到一个矩形列表.这些是经过训练的人脸图像的矩形(即这些区域具有明显的特征,可用于区分人脸和非人脸图像).对于lbpcascade_frontalface.xml,它具有139个矩形. 每个矩形的x,y点都乘以一个常数,以形成另外三个矩形,因此一个矩形实际上代表了四个矩形.

After digging the detection_based_tracker.cpp, now I understood what are the internalNodes, leafValues, and stagethreshold and how they are used. When we look at the lbpcascade_frontalface.xml, we see a list of rectangles. These are the rectangles of trained face images (i.e. these areas have distinct features and can be used to differentiate faces from non-face images). For lbpcascade_frontalface.xml has 139 rectangles. Each rectangle's x,y points are multiplied with a constant number to make additional three rectangels, so one rectangle represents four rectangles actually.

然后我将解释什么是internalNode.

Then I will explain what is internalNode.

<internalNodes>
            0 -1 13 -163512766 -769593758 -10027009 -262145 -514457854
            -193593353 -524289 -1</internalNodes>

前两个数字0 -1代表左右.我认为它们代表左leafValue和右leafValue.第三个是特征索引.如果我们将这139个矩形放入数组中,则特征索引就是数组索引.这意味着要代表哪个矩形.最后八个数字表示从四个矩形中减去角点.这些是根据积分图像计算得出的,因此数量很大.

The first two numbers 0 -1 represents left and right. I think they represent left leafValue and right leafValue. The third one is the feature index. If we put those 139 rectangles into an array, that feature index refers to the array index. That means which rectangle to represent. The last eight numbers represents corner point subtractions from four rectangles. These are calculated from the integral images, so the numbers are quite big.

但是我不确定如何计算leafValues,但是将这些leafValues的总和与stageThreshold进行比较,以做出人脸还是非人脸的决定.

But I am not quite sure how leafValues are computed, but summation of these leafValues are compared with stageThreshold to make decision of face or non-face.

这是我从调试代码中了解的内容. 如果有人解释leafValues的计算方式,那将是我查询的完整解决方案. 谢谢

That is what I understood from debugging the code. If somebody explains how leafValues are computed, that will be a complete solution for my query. Thanks

这篇关于如何了解人脸检测xml的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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