## 3 AdViSED Fast Measuring System
### Motion Detection  
A Kalman filter is used and a simplification of the theory regarding this filter is reported, where the information is obtained through an estimate and the prediction of the background. The background prediction is given by Equation (1), where \(\widetilde{BG}_{k}\) is the background prediction of the current frame \(I\), \(\widetilde{BG}_{k-1}\) is the background estimation at the previous frame, and \(a=A/(1-\beta)\) with \(\beta=1/\Big{(}1+\tau_{\beta}fr\Big{)}\). The \(fr\) coefficient represents the frame rate in fps of the processed video, \(\tau_{\beta}\) is a time constant set to 10s, and A is a constant set to 0.618. \[\left[ \begin{array}{c}\widetilde{BG}_{k}\\ \widetilde{BG}_{k}\end{array} \right]=\left[ \begin{array}{cc}1&a\\ 0&a\end{array} \right]\left[ \begin{array}{c}\widetilde{BG}_{k-1}\\ \widetilde{BG}_{k-1}\end{array} \right] \tag{1}\]  
The background estimation \(\widetilde{BG}_{k}\) of the frame \(I\) is obtained from Equation (2), where \(\widetilde{BG}_{k}\) is known in Equation (1), and \(K_{1}\) and \(K_{2}\) are defined in Equation (3). \[\left[ \begin{array}{c}\widetilde{BG}_{k}\\ \widetilde{BG}_{k}\end{array} \right]=\left[ \begin{array}{c}\widetilde{BG}_ {k}\\ \widetilde{BG}_{k}\end{array} \right]+\left[ \begin{array}{c}K_{1}\\ K_{2}\end{array} \right]\left(I-\left[ \begin{array}{cc}1&0\end{array} \right] \right[ \begin{array}{c}\widetilde{BG}_{k}\\ \widetilde{\widetilde{BG}}_{k}\end{array} \right]\right) \tag{2}\]  
\[K_{1}=K_{2}=\Lambda\cdot FG_{k}+\beta\cdot(1-FG_{k}) \tag{3}\]  
\[FG_{k}=\left|I-\widetilde{BG}_{k-1}\right| \tag{4}\]  
The above formulas work at pixel level. During the initialization, we set \(\widetilde{BG}_{k}\) equal to initial frame \(I\) and \(\widetilde{BG}_{k}\) equal to zero. Obviously, the initialization is performed the first time when the first frame is received. According to Figure 1, the pixel-wise logic AND with the color segmentation is activated by the motion-estimation block only when the pixel of the foreground \(FG_{k}\) is higher than a proper threshold \(THR_{forg}\). In the above equations, \(FG_{k}\) is the foreground of the frame \(I\), \(\Lambda=1/(1+\tau_{\alpha}\cdot fr)\), where \(\tau_{\alpha}\) is a time constant set to 16 s. The empirical threshold \(THR_{forg}\) is set to 0.08. It is noted that the Kalman estimator proposed in [19] has the variable \(a=0.7\) fixed, while our variable \(a=A/(1-\beta)\) depends on \(\beta\), which in turn depends on constants A and \(\tau_{\beta}\) and on the frame rate \(fr\). In the proposed algorithm, the frame rate is extracted from the input processed video, so the variable \(a\) and hence the matrix in Equation (1) depend on the value of the video frame rate. It is noted that in the test videos considered in this work, \(fr\) ranges from 10 to 60 \(fps\). The coefficient \(K_{1}=K_{2}\) depends on the coefficients \(\Lambda\) and \(\beta\), selected to allow filtering out quickly in the background the objects that are faster than the smoke (like people in movements) and to filter out in the background static objects that are slower than the smoke. The value of A = 0.618 has been found, in case of high frame rate values (with \(fr=60\), then \(\beta\sim 0\) and \(a\sim 0.618\)), starting from the value of 0.7 proposed in [19] and refining it to maximize the accuracy performance with the test video set considered in Sections 4 and 5. The values of \(\tau_{\alpha}\) and \(\tau_{\beta}\) influence the values of \(\Lambda\) and \(\beta\) and determine the observation times of foreground and background scenes. Because we aim at an early detection of smoke, their value is limited in the order of few seconds (i.e., 300 frames observed with a typical \(fr=30\)\(fps\)).