Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
31
Добавлен:
15.06.2014
Размер:
815.62 Кб
Скачать

Features

Example of features, used in base Viola-Jones detector is shown on figure.

Figure.Rectangular (a, b, c, d) and triangular (f) types of features.

The sign used for the analysis of image can be represented by the cortege

where T - type of sign, O - the coordinate of the left upper angle of sign, S - the size of sign on the horizontal and the vertical line in pixels. The value of sign is calculated by the following formula:

where - the sum of the intensities of all of the pixels of image in the white and black regions of sign respectively, and the coefficients of their normalization on the area. These features are calculated for every analyzed part of input image. Integral image allows calculate this features for bigger images using already calculated features for smaller images (subimages).

Training

Within any image sub-window the total number of Haar-like features is very large, far larger than the number of pixels. In order to ensure fast classification, the learning process must exclude a large majority of the available features, and focus on a small set of critical features. AdaBoost is used both to select the features and to train the classifier. In the language of boosting the simple learning algorithm is called a weak learner. The final strong classifier takes the form of weighted combination of weak classifiers followed by a threshold.

Cascades

The key insight is that smaller, and therefore more efficient, boosted classifiers can be constructed which reject many of the negative sub-windows while detecting almost all positive instances. Simpler classifiers are used to reject the majority of sub-windows before more complex classifiers are called upon to achieve low false positive rates. Stages in the cascade are constructed by training classifiers using AdaBoost

Main idea of the algorithm is following. Firstly those features are chosen, which are the easiest to compute and have a great importance. Then more complex and of less important features are chosen etc. Such a scheme is used to quicker detect non-faces. Example of face detection process is shown on the figure. Input image is considered as face only if all features (weak classifiers) return positive value.

Realized face detection subsystem

As it was said above, Viola-Jones detector, realized in OpenCV library is used as main face detection algorithm in our system. It has several parameters which are to be set. Let’s consider main of these parameters:

cascade – cascades of weak classifiers trained with adaboost algorithm for detection of different objects (faces – fullface, in profile, eyes, lips, nose, body etc.);

size of input image (width*height);

min_size - initial size of scanning window (~20×20 for face detection);

scale factor - the factor by which the search window is scaled between the subsequent scans, for example, 1.1 means increasing window by 10%.

flags

For face detection we used cascade file haarcascade_frontalface_alt.xml. It is stump-based 20x20 gentle adaboost frontal face detector, created by Rainer Lienhart. For eye detection we used cascade files ojoD.xml and ojol.xml (18x12 detectors computed with 7000 positive samples). As size of cascade files is rather large (appr. 1 megabyte) we load them only one time when our face recognition system is initialized.

Size of input image we set to 640×480 from the camera resolution.

Min_size = 20×20 for face detection and 18×12 for eye detection. Min_size could be set to possible face size (for example, ~1/4 to 1/16 of the image area in case of video conferencing).

Scale_factor = 1.1. This value gives good accuracy of face detection. For very good accuracy this value could be set to 1.05 or smaller. Parameters Min_size and Scale_factor should be changed together (bigger value of Min_size and smaller value of Scale_factor or smaller value of Min_size and bigger value of Scale_factor). Otherwise face detection procedure will take too much time.

When face detection procedure is finished eye detection procedure begins. Each estimated face region is modified and passed to eye detection routine. For right eye we chose right upper part of face and for left eye left upper part of face respectively. If eyes on face are not detected, we think that this is non-face. It allows filtering of some false patterns which pass through base Viola-Jones detector.

Соседние файлы в папке Распознавание лиц