## 3 Face Recognition System
### Face Recognition Algorithms
#### 3.2.5 Local Binary Patterns Histograms (LBPH)  
Local binary patterns histograms (LBPH) [18] differs from the above-mentioned algorithms because of the approach it takes on processing the images. Eigenfaces and Fisherfaces treat the image as a whole, thus being sensitive to the effect of lighting and other environment factors in image variance. As a result, variance in images caused by secondary factors is likely to yield unwanted results from the face-recognition system. LBPH concentrates on extracting local features of the image. The purpose of this is not in representing the image as a multi-dimensional vector, but rather in the description of local characteristics of objects in the image. In order to extract a summary of the local structure of an image, every pixel is compared to its neighboring pixels. First, the image is separated into several square cells or regions within which pixel comparisons are done. As described in Figure 5, when a pixel's value is being calculated, a comparison is made of each neighboring pixel's value to the one of the central pixel. Based on the result of the comparison, binary values are assigned next to each neighbor indicating whether its value is greater than the central pixel (the binary digit 1 is assigned) or not (the binary digit 0 is assigned). The binary value formed from the concatenation of all the binary digits of the surrounding neighbors characterizes the central pixel. Thus, each image pixel is characterized by a binary number. These binary numbers represent features of the region of the image they're calculated in.  
The LBP operator has been extended to use neighborhoods of different sizes. This can be done by changing the radius R of the neighborhood and the number of sampling points P used to represent the neighborhood of the central pixel. For a neighborhood of radius R and P neighbors, the texture of the region surrounding the center pixel can be described as:  
\[\mathrm{T}\approx(\mathrm{s}(\mathrm{v}_{0}-\mathrm{v}_{\mathrm{c}}),\mathrm{ s}(\mathrm{v}_{1}-\mathrm{v}_{\mathrm{c}}),\dots,\mathrm{s}(\mathrm{v}_{\mathrm{p-1}}- \mathrm{v}_{\mathrm{c}})) \tag{1}\]  
where \(\mathrm{v}_{0}\), \(\mathrm{v}_{1}\), \(\dots\), and \(\mathrm{v}_{\mathrm{p-1}}\) represent the values of the corresponding neighbors of the central pixel, whereas \(\mathrm{v}_{\mathrm{c}}\) is the value of the central pixel.  
Figure 5: Local Binary Pattern calculation for a 3 \(\times\) 3 area of 8 neighbors.  
For each sign \(s(v_{P}-v_{c})\) a binomial weight is assigned. The sum of the binomial weights represents the LBP value for the central pixel:  
\[LBP_{P,R(\chi_{c},\chi_{c})}=\sum_{i-0}^{P-1}s(v_{i}-v_{c})2^{i} \tag{2}\]  
where \(x_{c}\), and \(y_{c}\) are the coordinates of the central pixel, \(P\) is the number of neighboring pixels, \(R\) is the radius of the neighborhood, \(v_{i}\) is the value of the i-th neighbor and \(v_{c}\) is the value of the central pixel. After calculation of the local binary pattern for every pixel, using Equation (2), the feature vector of the whole image is constructed. For each square cell the image was separated in, a histogram of LBP values' frequency is built. This means that for each cell, the characteristic histogram contains all the possible LBP values the pixels can have as bins, and each bin contains the frequency of its occurrence in the cell. The feature vector is constructed by the concatenation of the frequency histograms of all the cells the image consists of. The feature vector of LBP characteristics can be used for classification of the images for the purpose of face recognition. The ability of LBPH to describe in detail the texture of an image has made this method attractive for research in the field of face recognition [19].