# Robust Background Subtraction via the Local Similarity Statistical Descriptor
## 2 Local Similarity Statistical Descriptor
### Local Similarity Statistical Descriptor  
Similar to the illumination invariant feature proposed in Equation (4), the Local Similarity Statistical Descriptor (LSSD) is a texture feature which calculates the number of pixels in the neighborhood window \(E\) with intensity values fall in a similarity interval with the center pixel. Let a pixel \(p\) be in a certain location of image \(\mathbf{I}\), the coordinate of the pixel is \((x_{p},y_{p})\), and the size of the neighborhood window \(E\) is measured in \(c\) columns and \(r\) rows. The LSSD operator applied to \(p(x_{p},y_{p})\) can be expressed as:  
\[LSSD_{c,r}(p)=\sum_{q\in\mathbf{I}_{q}}S(\mathbf{I}_{q},\mathbf{I}_{p}) \tag{7}\]  
where \(\mathbf{I}_{p}\) is the intensity value of center pixel \(p\), \(\mathbf{I}_{q}\) is the intensity value of the pixel \(q\) which is in the neighborhood window \(E\), and \(S\) is a thresholding function which is defined as:  
\[S(\mathbf{I}_{q},\mathbf{I}_{p})= \begin{cases}1,&\text{if }(1-\tau)\mathbf{I}_{p}\leq\mathbf{I}_ {q}\leq(1+\tau)\mathbf{I}_{p};\\ 0,&\text{otherwise}.\end{cases}  \tag{8}\]  
Figure 2: Foreground detection results with IIF and Local Similarity Statistical Descriptor (LSSD) on the sequences of highway. First row: input image and the corresponding ground-truth. Second row: foreground detection results with the original illumination invariant feature image and the segmentation results of the proposed method. where \(\tau\) is a interval factor affecting the similarity. An LSSD encoding example is presented in Figure 3. This operator is calculated on a neighborhood window of size \(5\times 5\) and the interval factor \(\tau\) is set to 0.14. The parameter values set here are for demonstration purposes only, and are not the final values used in our experiment. As shown in Figure 3, (a\({}_{1}\)) and (b\({}_{1}\)) are the first and 56 th frames selected from the PETS2006 sequence, and (a\({}_{3}\)) and (b\({}_{3}\)) are the corresponding LSSD feature images (for display purposes, the feature values are rescaled to [0, 255]). In order to simplify the calculation process and make it easier to understand, we convert the color images to gray images and choose a special pixel \(p\) with the coordinate of (512, 391) to demonstrate how to get its LSSD feature. First, a image patch with the size of \(5\times 5\) centered at \(p\) is cropped out from the input image (the small red box in (a\({}_{1}\)) and (b\({}_{1}\))); the patch intensity values are shown in (a\({}_{2}\)) and (b\({}_{2}\)). Then, all of the neighborhood pixels are compared with the central pixel \(p\). If the intensity difference falls within a similarity interval \([-\tau\mathbf{I}_{p},\tau\mathbf{I}_{p}]\), the neighboring pixel is considered similar to the central pixel, (see Equation (8)). As we can see in (a\({}_{2}\)), the central pixel value is 172, the similarity threshold \(\tau\mathbf{I}_{p}\) equals 24, and finally we get the LSSD feature of 19, which is the value of \(p(512,391)\) in (a\({}_{3}\)). In the same way, the LSSD feature value of (b\({}_{2}\)) is obtained as 19. One of the most important properties of the LSSD feature is its tolerance against illumination variations. As we can see, in most cases when the illumination changes, the pixel values in a localized region decrease or increase proportionally. thus, there will be little change in the difference between the central pixel and its neighboring pixels. In Figure 3(b\({}_{1}\)), the pixel values near \(p\) are decreased by the shadow of the moving person; the intensity value of \(p\) dropped from 172 to 136, it is a drastic changes. However, due to the robustness of LSSD against illumination changes, the feature values have no changes. One of the other most important properties of the LSSD feature is its flexibility in dealing with dynamic backgrounds, as shown in Figure 4. Two frames contain moving tree branches are selected  
Figure 3: An LSSD encoding example under illumination changes. First column: input images.