简体   繁体   English

Open CV计算机视觉中的haar级联分类器里面有什么?

[英]What's inside a haar cascade classifier in Open CV computer vision?

I need to translate an .xml OpenCV haar cascade to a txt file. 我需要将.xml OpenCV haar级联转换为txt文件。

(Open CV has a Haar Feature-based Cascade Classifier for Object Detection.) (Open CV有一个基于Haar特征的级联分类器,用于对象检测。)

So I need to understand the xml. 所以我需要了解xml。 I'm wondering what are the "stages" and the "trees". 我想知道什么是“阶段”和“树”。 Does a tree stand for a weak classifier? 树是否代表弱分类器? Are the trees in the same stage combined to be a strong classifier?? 同一阶段的树木组合成一个强大的分类器吗? Are the stages cascaded??? 阶段级联???

In a tree from haarcascade_frontalface_alt.xml, it says: 在haarcascade_frontalface_alt.xml的树中,它说:

<!-- tree 0 -->
    <_>
        <!-- root node -->
        <feature>
          <rects>
            <_>3 7 14 4 -1.</_>
            <_>3 9 14 2 2.</_></rects>
          <tilted>0</tilted></feature>
        <threshold>4.0141958743333817e-003</threshold>
        <left_val>0.0337941907346249</left_val>
        <right_val>0.8378106951713562</right_val></_></_>
    <_>

I want to know what the numbers stand for. 我想知道数字代表什么。

I'll try explain the cascade xml meaning. 我将尝试解释cascade xml的含义。

<_>
<!-- root node -->
    <feature>
      <rects>
        <_>3 7 14 4 -1.</_>
        <_>3 9 14 2 2.</_></rects>
      <tilted>0</tilted></feature>
    <threshold>4.0141958743333817e-003</threshold>
    <left_val>0.0337941907346249</left_val>
    <right_val>0.8378106951713562</right_val></_></_>
<_>

In

<_>3 7 14 4 -1.</_>

3,7 are the cordinate of the rectangle you'd like to sum using the square sum matrix (the integral image) 14 4 are the length and hieght of the rectangle -1 is the wieght of the rectangle (this is NOT the weight according to viola-johnes original article) 3,7是您想要使用平方和矩阵求和的矩形的坐标(积分图像)14 4是矩形的长度和高度-1是矩形的宽度(这不是重量根据中提琴 - 约翰内斯原创文章)

please denote that the rects are should be normalize to your detector size 请表示应根据您的探测器尺寸进行标准化

if the rects sum passes the threashold value , then the right_val is sumed for the future, otherwise the left_sum is sumed 如果rects sum传递threashold值,那么right_val将被激活为未来,否则left_sum是sumed

Good luck 祝好运

S 小号

Eureka! 找到了! Page 370 of the OpenCV Reference Manual v2.1. OpenCV参考手册v2.1的第370页。

link http://picoforge.int-evry.fr/projects/svn/gpucv/opencv_doc/2.1/opencv.pdf 链接http://picoforge.int-evry.fr/projects/svn/gpucv/opencv_doc/2.1/opencv.pdf

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

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