|
@ -62,7 +62,7 @@ Haar 级联分类器最著名的应用是检测图像中的人脸或身体,但
|
||||||
|
|
||||||
第一步是收集 Haar 特征。可以将 Haar 特征看作检测窗口中相邻的举行区域,将各自区域的像素强度加合,然后计算它们的差值。
|
第一步是收集 Haar 特征。可以将 Haar 特征看作检测窗口中相邻的举行区域,将各自区域的像素强度加合,然后计算它们的差值。
|
||||||
|
|
||||||
![Integral Images](/img/post/Algorithm/Deep_Learning_Haar_Cascade_Explained/001.jpg)
|
![Integral Images](./img/Deep_Learning_Haar_Cascade_Explained/001.jpg)
|
||||||
|
|
||||||
“Integral Images are used to make this super fast.”
|
“Integral Images are used to make this super fast.”
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ Haar 级联分类器最著名的应用是检测图像中的人脸或身体,但
|
||||||
|
|
||||||
但是,这些特征中的很大一部分是与任务目标不相关的(没有意义的特征)。以下图为例,应用第一行的选择窗口可以得到两个好的特征:选取第一个特征,主要是由于眼部区域通常比鼻子和脸颊更黑;选取第二个特征则依赖于眼部比鼻梁更黑这一现象。但是,将同样的检测窗口应用于脸颊或其他部位则得不到有意义的特征。
|
但是,这些特征中的很大一部分是与任务目标不相关的(没有意义的特征)。以下图为例,应用第一行的选择窗口可以得到两个好的特征:选取第一个特征,主要是由于眼部区域通常比鼻子和脸颊更黑;选取第二个特征则依赖于眼部比鼻梁更黑这一现象。但是,将同样的检测窗口应用于脸颊或其他部位则得不到有意义的特征。
|
||||||
|
|
||||||
![Integral Images](/img/post/Algorithm/Deep_Learning_Haar_Cascade_Explained/002.png)
|
![Integral Images](./img/Deep_Learning_Haar_Cascade_Explained/002.png)
|
||||||
|
|
||||||
“So how do we select the best features out of 160000+ features? This is accomplished using a concept called Adaboost which both selects the best features and trains the classifiers that use them. This algorithm constructs a “strong” classifier as a linear combination of weighted simple “weak” classifiers. The process is as follows.”
|
“So how do we select the best features out of 160000+ features? This is accomplished using a concept called Adaboost which both selects the best features and trains the classifiers that use them. This algorithm constructs a “strong” classifier as a linear combination of weighted simple “weak” classifiers. The process is as follows.”
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@ Haar 级联分类器最著名的应用是检测图像中的人脸或身体,但
|
||||||
|
|
||||||
## 2. Cascade Classifier
|
## 2. Cascade Classifier
|
||||||
|
|
||||||
![Integral Images](/img/post/Algorithm/Deep_Learning_Haar_Cascade_Explained/003.png)
|
![Integral Images](./img/Deep_Learning_Haar_Cascade_Explained/003.png)
|
||||||
|
|
||||||
“The cascade classifier[b] consists of a collection of stages, where each stage is an ensemble of weak learners. The weak learners are simple classifiers called decision stumps. Each stage is trained using a technique called boosting. Boosting provides the ability to train a highly accurate classifier by taking a weighted average of the decisions made by the weak learners.”
|
“The cascade classifier[b] consists of a collection of stages, where each stage is an ensemble of weak learners. The weak learners are simple classifiers called decision stumps. Each stage is trained using a technique called boosting. Boosting provides the ability to train a highly accurate classifier by taking a weighted average of the decisions made by the weak learners.”
|
||||||
|
|
||||||
|
@ -114,7 +114,7 @@ Haar 级联分类器最著名的应用是检测图像中的人脸或身体,但
|
||||||
|
|
||||||
训练级联分类器需要一组阳性采样和一组阴性采样图像。可以提供一组包含感兴趣区的阳性图像作为阳性采样。使用 Image Labeler 标记由包围盒框选的目标。Image Labeler 输出阳性采样标签。同时,还需要一组阴性图像,算法函数将自动生成阴性采样。为了达到可接受的精度,需要设置级联深度,特征类型和其他参数。
|
训练级联分类器需要一组阳性采样和一组阴性采样图像。可以提供一组包含感兴趣区的阳性图像作为阳性采样。使用 Image Labeler 标记由包围盒框选的目标。Image Labeler 输出阳性采样标签。同时,还需要一组阴性图像,算法函数将自动生成阴性采样。为了达到可接受的精度,需要设置级联深度,特征类型和其他参数。
|
||||||
|
|
||||||
![Integral Images](/img/post/Algorithm/Deep_Learning_Haar_Cascade_Explained/004.png)
|
![Integral Images](./img/Deep_Learning_Haar_Cascade_Explained/004.png)
|
||||||
|
|
||||||
“The video below shows this in action.“
|
“The video below shows this in action.“
|
||||||
|
|
||||||
|
@ -138,7 +138,7 @@ Haar 级联分类器最著名的应用是检测图像中的人脸或身体,但
|
||||||
- 在其余的阶段中,我们能观察到分类器很好的检测出了人脸。
|
- 在其余的阶段中,我们能观察到分类器很好的检测出了人脸。
|
||||||
- 注意,随着越来越接近人脸检测结果,检测过程所消耗的时间也越来越长,这表示越接近目标分类器的工作越精细,在检测的初始阶段,分类器只要进行粗略的分类即可。
|
- 注意,随着越来越接近人脸检测结果,检测过程所消耗的时间也越来越长,这表示越接近目标分类器的工作越精细,在检测的初始阶段,分类器只要进行粗略的分类即可。
|
||||||
|
|
||||||
![Integral Images](/img/post/Algorithm/Deep_Learning_Haar_Cascade_Explained/005.gif)
|
![Integral Images](./img/Deep_Learning_Haar_Cascade_Explained/005.gif)
|
||||||
|
|
||||||
[点击查看原始视频](https://www.youtube.com/watch?v=hPCTwxF0qf4&feature=youtu.be)
|
[点击查看原始视频](https://www.youtube.com/watch?v=hPCTwxF0qf4&feature=youtu.be)
|
||||||
|
|
||||||
|
@ -174,7 +174,7 @@ This difference is then used to categorize subsections of an image. For example,
|
||||||
|
|
||||||
An integral image is summed-area table is a data structure and algorithm for quickly and efficiently generating the sum of values in a rectangular subset of a grid. To understand this look at image 1 and image 2. Image 1 is the source table, Image 2 is the summation table. Notice in Image 2 row 1, col 2 value 33 is sum of Image 1 row 1 (col 1 + col 2).
|
An integral image is summed-area table is a data structure and algorithm for quickly and efficiently generating the sum of values in a rectangular subset of a grid. To understand this look at image 1 and image 2. Image 1 is the source table, Image 2 is the summation table. Notice in Image 2 row 1, col 2 value 33 is sum of Image 1 row 1 (col 1 + col 2).
|
||||||
|
|
||||||
![Integral Images](/img/post/Algorithm/Deep_Learning_Haar_Cascade_Explained/006.png)
|
![Integral Images](./img/Deep_Learning_Haar_Cascade_Explained/006.png)
|
||||||
|
|
||||||
[3] Adaboost
|
[3] Adaboost
|
||||||
|
|
||||||
|
@ -190,11 +190,11 @@ Problems in machine learning often suffer from the curse of dimensionality — e
|
||||||
|
|
||||||
级联分类器是将一些小的分类过程组合成完整分类器的方法。以下图为例,需要将图中的“+”和“-”数据分开,仅靠一个分类过程很难实现。
|
级联分类器是将一些小的分类过程组合成完整分类器的方法。以下图为例,需要将图中的“+”和“-”数据分开,仅靠一个分类过程很难实现。
|
||||||
|
|
||||||
![Integral Images](/img/post/Algorithm/Deep_Learning_Haar_Cascade_Explained/007.png)
|
![Integral Images](./img/Deep_Learning_Haar_Cascade_Explained/007.png)
|
||||||
|
|
||||||
但将下图中的三种分类方法组合到一起就可以得到一个非常好的分类器。其中每个分类方法都是级联分类器中的一个弱分类器,它们组合成了一个强分类器。注意,每个弱分类器都只对部分数据进行了分类。
|
但将下图中的三种分类方法组合到一起就可以得到一个非常好的分类器。其中每个分类方法都是级联分类器中的一个弱分类器,它们组合成了一个强分类器。注意,每个弱分类器都只对部分数据进行了分类。
|
||||||
|
|
||||||
![Integral Images](/img/post/Algorithm/Deep_Learning_Haar_Cascade_Explained/008.png)
|
![Integral Images](./img/Deep_Learning_Haar_Cascade_Explained/008.png)
|
||||||
|
|
||||||
## 8. 外部参考资料
|
## 8. 外部参考资料
|
||||||
|
|
||||||
|
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 7.4 KiB After Width: | Height: | Size: 7.4 KiB |
Before Width: | Height: | Size: 76 KiB After Width: | Height: | Size: 76 KiB |
Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 52 KiB |
Before Width: | Height: | Size: 11 MiB After Width: | Height: | Size: 11 MiB |
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 57 KiB |
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |