# Robust Background Subtraction via the Local Similarity Statistical Descriptor
## 2 Local Similarity Statistical Descriptor
### Illumination-Invariant Feature  
Before introducing the Local Similarity Statistical Descriptor (LSSD) feature, we make a brief review of the illumination-invariant feature (IIF). The conventional image histogram is a 1D array. Each of its values indicates the frequency of occurrence of the intensity value. Let \(\mathbf{I}\) denote an image, and then the image histogram can be calculated as:  
\[\mathbf{H}(b)=\sum_{q=1}^{W}Q(I_{q},b),\qquad b=1,\dots,B \tag{1}\]  
where \(W\) is the number of pixels, \(B\) is the number of bins, and \(Q(I_{q},b)\) is zero except when the pixel value of \(I_{q}\) belongs to bin \(b\). In [27], [PERSON] et al. proposed a novel locality-sensitive histogram (LSH) which computes a local histogram at each pixel location. Instead of counting the frequency of occurrences of each intensity value by adding ones to the corresponding bin, a floating-point value is added to the bin for each occurrence of the intensity value. The LSH at pixel \(p\) can be computed by:  
\[\mathbf{H}_{p}^{E}(b)=\sum_{q=1}^{W}\alpha^{|p-q|}\cdot Q(\mathbf{I}_{q},b),\quad b=1, \ldots,B \tag{2}\]  
where \(\alpha\in(0,1)\) is a constant parameter controlling the deceasing weight as a neighboring pixel moves away from \(p\), and \(E\) is the window centered at pixel \(p\). Let \(\mathbf{I}_{p}\) and \(\mathbf{I}_{p}^{\prime}\) denote the intensity values of \(p\) before and after an affine illumination change. Then, we have:  
\[\mathbf{I}_{p}^{\prime}=\mathcal{A}_{p}(\mathbf{I}_{p})=a_{1,p}\mathbf{I}_{p}+a_{2,p} \tag{3}\]  
where \(a_{1,p}\) and \(a_{2,p}\) are affine parameters. Now, the number of pixels in the window \(E\) with intensity values falling in the interval \([b_{p}-r_{p},b_{p}+r_{p}]\) is:  
\[\mathcal{I}_{p}=\sum_{b=b_{p}-r_{p}}^{b_{p}+r_{p}}\mathbf{H}_{p}^{E}(b) \tag{4}\]  
where \(b_{p}\) denotes the bin corresponding to the intensity value \(\mathbf{I}_{p}\), and \(r_{p}\) controls the size of the interval. If \(r_{p}\) scales linearly with the illumination change:  
\[r_{p}^{\prime}=a_{1,p}r_{p} \tag{5}\]  
After the affine illumination change, the value of Equation (4) can be calculated as follows:  
\[\mathcal{I}_{p}^{\prime}=\sum_{b=b_{p}^{\prime}-r_{p}^{\prime}}^{b_{p}^{\prime} +r_{p}^{\prime}}\mathbf{H}_{p}^{E}(b) \tag{6}\]  
Using Equations (3) and (5), then \([b_{p}^{\prime}-r_{p}^{\prime},b_{p}^{\prime}+r_{p}^{\prime}]=[a_{1,p}b_{p}+a_ {2,p}-a_{1,p}r_{p},a_{1,p}b_{p}+a_{2,p}+a_{1,p}r_{p}=[a_{1,p}(b_{p}-r_{p})+a_ {2,p},a_{1,p}(b_{p}+r_{p})+a_{2,p}]=[\mathcal{A}_{p}(b_{p}-r_{p}),\mathcal{A} _{p}(b_{p}+r_{p})]\), if we ignore the quantization error \(a_{2,p}\), the value of \(\mathcal{I}_{p}^{\prime}\) is equal to \(\mathcal{I}_{p}\). Thus, we can notice that \(\mathcal{I}_{p}\) is independent of illumination changes and can be used as an illumination invariant feature. In Figure 1, two gray images with different illuminations and their corresponding illumination invariant feature images are presented. We can see that although the input images are different, their illumination-invariant feature images remain almost the same. Figure 1: Illumination-invariant features (IIF). First row: input images with different illuminations. Second row: the corresponding illumination invariant feature images. Now, we may consider taking the illumination invariant feature images for background subtraction. Unfortunately, the experimental results fall short of satisfaction (see Figure 2). On one hand, the illumination-invariant features are too sensitive to image noises, while the background subtraction method must be robust enough to deal with the noises and dynamic changes in the background. On the other hand, background substraction is always considered as a preprocessing step in many computer vision applications. Computational efficiency is very important; obtaining getting the illumination- invariant feature images is a time-consuming process.