features ： A result of a pixel operation .

<>Harr features

haar The characteristics are mainly divided into the following categories ：

features = Whole area weight 1 + Black weight weight 2
= （ black + white ）1+ black （-2）
= black + white - black 2
= white - black

Ergodic process
Traverse from top to bottom, left to right , Consider the image and template size .
When the picture size=100100 Template size=1010, need 100 Only one template can be covered. After many times of scaling, the amount of computation will be very large . The integral graph is introduced .

The main idea of integral graph ： The sum of pixels in the rectangular area formed by the image starting from the starting point to each point is saved in memory as an array element , When you want to calculate the sum of pixels in a region, you can index the elements of the array directly , There is no need to recalculate the sum of pixels in this region , Thus, the calculation is speeded up （ There is a corresponding title , It's called a dynamic programming algorithm ）. The integral graph can be used in many scales , Use the same time （ Constant time ） To calculate different characteristics , Therefore, the detection speed is greatly improved .

Adaboost It is an iterative algorithm , Its core idea is to train different classifiers for the same training set ( Weak classifier ), Then these weak classifiers are put together , Form a stronger final classifier （ Strong Classifier ）.
Strong Classifier （ cascade ）<– Weak classifier （ Computing strong classifier features ）<–node node
At most 3 individual haar The feature corresponds to one node node .

Training termination conditions ：
1, Maximum number of cycles
2, Minimum detection probability

Training steps
1, Initialization data weight distribution - Each data is assigned an equal weight
2, Ergodic threshold p Find the minimum threshold
3,
4, Weight distribution update
#1 load xml ; 2 load jpg ; 3 haar gray ; 4 detect 5 ;draw import cv2 import