It would be best if someone could explain the numbers/values in the cascade.xml entirely. Example in:
<!-- stage 0 -->
<_>
<maxWeakCount>3</maxWeakCount>
<stageThreshold>-8.8384145498275757e-001</stageThreshold>
<weakClassifiers>
<_>
<internalNodes>
0 -1 66 5.1593100652098656e-003</internalNodes>
<leafValues>
-8.0555558204650879e-001 8.0694979429244995e-001</leafValues></_>
<_>
<internalNodes>
0 -1 108 1.5044789761304855e-002</internalNodes>
<leafValues>
-6.2940740585327148e-001 7.5122624635696411e-001</leafValues></_>
<_>
<internalNodes>
0 -1 99 -4.7172707127174363e-005</internalNodes>
<leafValues>
5.5112153291702271e-001 -8.6111217737197876e-001</leafValues></_></weakClassifiers></_>
What are the meanings of these values
<internalNodes>
0 -1 99 -4.7172707127174363e-005</internalNodes>
Another question is, how does the program know which feature to use for a particular stage? As far as I know, features are in the form as below
<_>
<rects>
<_>
21 6 3 5 -1.</_>
<_>
22 6 1 5 3.</_></rects>
<tilted>0</tilted></_>
Whereby it's the coordinates of two rectangles, forming something like below:
=-= = Black colored rectangle
=-= - White colored rectangle
=-=
=-=
=-=
What are the values -1. and 3. mean? I know it's weights but how is it used to calculate the feature?
Summary
<internalNodes>
?<rects>
use?Thanks!
Haar Cascade Classifiers : We will implement our use case using the Haar Cascade classifier. Haar Cascade classifier is an effective object detection approach which was proposed by Paul Viola and Michael Jones in their paper, “ Rapid Object Detection using a Boosted Cascade of Simple Features ” in 2001.
If you are familiar with OpenCV library, you know what Haar Cascade image object detection is. By image object detection I mean, like human face detection or something else. I have some Haar Cascade XMLs for face detection, but I don't know how to create my own.
Cascade Classifier Architecture A cascade classifier refers to the concatenation of several classifiers arranged in successive order. It makes large numbers of small decisions as to whether its the object or not. The structure of the cascade classifier is of a degenerate decision tree.
Because of the versatility of Haar cascades, they can be applied virtually anywhere. Haar cascades are machine learning object detection algorithms. They use use Haar features to determine the likelihood of a certain point being part of an object.
After digging into OpenCV's source code, I finally obtain answers to my own questions.
node.left node.right node.featureIdx node.threshold
I'm not sure what's node.left and node.right are for as I can't see them being called anywhere.
float ret = rect[0].weight * CALC_SUM(p[0], _offset) + rect[1].weight * CALC_SUM(p[1], _offset);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With