Search code examples
opencvface-detectionfeature-detectionfeature-extraction

Extracting features using MB-LBP for multi-view face detection


I am working for multi-view face detection. I have two steps in developing face-detection,

(1)decision tree makes decision of which classifier to run and

(2) running a selected classifier for detecting the specific orientation of face.

I have 9 classifiers trained with Ada-boost algorithm for 9 face views.

Now my problem is training the decision tree with MB-LBP (Multi-Scale Block Local Binary Pattern) features. I have selected 100 of rectangles for different x,y position and different rectangle sizes. I like to use those rectangle to extract feature using MB-LBP. I understood that we can have a label of 0-255 for a rectangle if we use MB-LBP concept. In OpenCV, it is implemented as (at line 217, cascadedetect.hpp)

inline int Feature :: calc( int _offset ) const
{
    int cval = CALC_SUM_(p[5], p[6], p[9], p[10], _offset);
    return (CALC_SUM_( p[0], p[1], p[4], p[5], _offset ) >= cval ? 128 : 0) |   // 0
           (CALC_SUM_( p[1], p[2], p[5], p[6], _offset ) >= cval ? 64 : 0) |    // 1
           (CALC_SUM_( p[2], p[3], p[6], p[7], _offset ) >= cval ? 32 : 0) |    // 2
           (CALC_SUM_( p[6], p[7], p[10], p[11], _offset ) >= cval ? 16 : 0) |  // 5
           (CALC_SUM_( p[10], p[11], p[14], p[15], _offset ) >= cval ? 8 : 0)|  // 8
           (CALC_SUM_( p[9], p[10], p[13], p[14], _offset ) >= cval ? 4 : 0)|   // 7
           (CALC_SUM_( p[8], p[9], p[12], p[13], _offset ) >= cval ? 2 : 0)|    // 6
           (CALC_SUM_( p[4], p[5], p[8], p[9], _offset ) >= cval ? 1 : 0);
}

This code can extract the label. From there, I can't figure out how to proceed to get a meaningful feature for each rectangle. I checked OpenCV's code at CascadeTraining. It is really complicated. May I have a clue how to produce a useful feature using MB-LBP? Thanks


Solution

  • After reading this paper and this paper, understood that I can use MB-LBP features directly. If we use MB-LBP features, for each rectangle we can have values between 0~255. These values are the features and can be used to recognize images. In Cascaded classifier, each step of strong classifier is a summation of weak classifiers. Each weak classifier is derived from these MB-LBP features and how it is derived, we can learn from this paper. Thanks