I’m trying to get better understanding over the Face detection implementation by openCV.
I have seen this command over haar.cpp file:
stage_sum += classifier->alpha[sum >= t];
somehow , I can’t figure the meaning of this command, I know what += means , what does the alpha[sum >= t ] means ?
Deceleration are like this:
double t ,sum ;
float stage_sum ;
CvHidHaarClassifier* classifier;
typedef struct CvHidHaarClassifier
{
int count;
//CvHaarFeature* orig_feature;
CvHidHaarTreeNode* node;
float* alpha;
}
typedef struct CvHidHaarFeature
{
struct
{
sumtype *p0, *p1, *p2, *p3;
float weight;
}
rect[CV_HAAR_FEATURE_MAX];
}
CvHidHaarFeature;
typedef struct CvHidHaarTreeNode
{
CvHidHaarFeature feature;
float threshold;
int left;
int right;
}
CvHidHaarTreeNode;
The term
returns either 1 or 0, depending on whether the
sumis greater/equal thantor not. This value (0 or 1) is used as an index into the array classifier->alpha[] (which has only two entries).tis a threshold learned during training the (weak) classifier. During testing (i.e. classifying an image position whether it is a face or not), it is tested for each weak classifier, whether the value ofsumis greater than the thresholdt, and depending on that, a different value is added tostage_sum.