# Background Subtraction for Dynamic Scenes Using Gabor Filter Bank and Statistical Moments
## 3 Materials and Methods
### Segmentation Criteria  
Finally, a threshold is chosen to distinguish between stationary \((B_{k})\) and non-stationary objects \((O_{k})\) because the scene now exhibits the distribution shown in Figure 9.  
Figure 8: Distributions of the statistical moments in the scene. Objects \(O_{k}\) show a greater dispersion, while \(B_{k}\) remains more homogeneous. Figure 7: Scene’s texture. The texture level is expressed as an edge in this image, obtained by characterizing the image using the Gabor function. The objects that are in motion can be located from \(\pm\sigma\). In this sense, \(\sigma\) represents the threshold of stationary objects, which is between \([-\sigma,\sigma]\), and moving objects can be determined between \((\pm\sigma,\pm\infty)\). Therefore, \(k\sigma\) is a function of the confidence interval of the texture distribution we want to compare. The steps of the background subtraction algorithm are summarized in Algorithm 1. It should be noted that the analysis is based on the texture of the object, the real term of the filter is used to obtain the object's structure, and the filter's imaginary term explains the texture in detail. If there are subtle changes, they can be modeled with any Gabor filter frequency. ```
Input:\(I_{i}\), \(\lambda\), \(\sigma_{x,y}\), \(\theta\), \(\phi\) \(G(\lambda,[\sigma_{x},\sigma_{y}],\theta,\phi)\) ; /* Build Kernel */ \([h,w]\gets size(imgIn)\); \(M\gets size(h,w)\); \(P\leftarrow size(h,w)\); while\(I\in Q\)do \([Y_{r},Y_{c}]\gets I_{i}*G_{\lambda,\theta,\phi}\); \(M_{i}\leftarrow\texttt{Magnitude}(Y_{r},Y_{c})\); \(P_{i}\leftarrow\texttt{argmax}(Y_{r},Y_{c})\); \(X\gets M_{i},P_{i}\); \(\xi(X)\leftarrow[X-\bar{X}]^{2}\cdot P_{b}(X)\); if\(\xi\in[-\sigma,\sigma]\)then \(\xi\in B_{k}\); else \(



The result below corresponds to scene \(S_{2}\). Different values for \(\lambda\) are used to enhance the texture of people (Figure 10(b)), to enhance the texture of the floor (Figure 10(c)), and to enhance the edges of buildings (Figure 10(d)). The influence of these \(\lambda\) values can be seen in Figure 11. The parameters that characterize this scene are as follows: Gaussian function value \(\sigma_{x}=3.35\) and \(\sigma_{y}=1.675\), while \(\phi=0\). In addition, 24 orientations with an angular displacement of 15 degrees are used. We try to focus on the object's structure, the texture of the object's clothes, and the object's edge. The results are shown in Figure 12.

The parameter values of the Gaussian function used are \(\sigma_{x}=6.25\), \(\sigma_{y}=1.45\), and \(\phi=0\). Focusing on analyzing different scene levels can reduce the amount of data and only focus on the specific object information. According to the displayed results, adjusting the \(\lambda\) value allows the filter to attenuate light changes so that the texture of objects on different levels can be specified to segment them. Figure 11: Adjustment of the \(\lambda\) value to characterize the light changes of objects on the scene. (a) Original image, in (b) \(\lambda=0.95\), (c) \(\lambda=0.6\), (d) \(\lambda=0.367\). Figure 12: Adjustment of the \(\lambda\) value to focus on the structure, texture and edge of the object. In (a) original image, in (b) \(\lambda=3\), for (c) \(\lambda=1.2\) y and (d) \(\lambda=0.5\). Figure 10: Homogeneous region segmentation by texture analysis. We analyze sequences of 900 images for each activity, and the results from our proposal are compared with other methods, such as \(\Sigma\Delta\)[22], DMD [39], MRFMD [23], DSTEI [26], Eigen-Background [30], SOBS [33], SWCD [40], ViBe [47], GMM [51] and DEU [67].