Open CV计算机视觉中的haar级联分类器内部是什么? [英] What's inside a haar cascade classifier in Open CV computer vision?

查看:193
本文介绍了Open CV计算机视觉中的haar级联分类器内部是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将.xml OpenCV haar级联转换为txt文件.

I need to translate an .xml OpenCV haar cascade to a txt file.

(Open CV具有用于对象检测的基于Haar特征的级联分类器.)

(Open CV has a Haar Feature-based Cascade Classifier for Object Detection.)

所以我需要了解xml. 我想知道什么是阶段"和树".一棵树代表弱分类器吗? 同一阶段的树木是否合并在一起成为强分类器?阶段是级联的吗?

So I need to understand the 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???

在haarcascade_frontalface_alt.xml中的树中,它说:

In a tree from haarcascade_frontalface_alt.xml, it says:

<!-- 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.

推荐答案

我将尝试解释级联xml的含义.

I'll try explain the cascade xml meaning.

<_>
<!-- 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></_></_>
<_>

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

3,7是您要使用平方和矩阵求和的矩形的坐标(整数图像) 14 4是矩形的长度和高度 -1是矩形的宽度(根据viola-johnes原始文章,这不是权重)

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)

请注意,将rects标准化为您的探测器尺寸

please denote that the rects are should be normalize to your detector size

如果rects总和超过阈值,则将right_val用于将来求和,否则将left_sum求和

if the rects sum passes the threashold value , then the right_val is sumed for the future, otherwise the left_sum is sumed

祝你好运

S

这篇关于Open CV计算机视觉中的haar级联分类器内部是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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