## 3 AdViSED Fast Measuring System
### Color Segmentation and Blob Labeling  
In this phase, the RGB color frames are converted in gray scale and next in HSV (hue, saturation, value) scale, where H is the hue, S is the saturation, and V is the value. We use only the saturation of the frames and through a saturation threshold, \(THR_{sat}\) (set to 0.2 in the range from 0 to 1), we select only those parts of the scene with \(frame_{sat}<THR_{sat}\). We choose this parameter because the smoke changes color according to the background, so a good way is to use the saturation variable. The value of the threshold 0.2 is found empirically as the value maximizing the estimation accuracy using the dataset detailed in Sections 4 and 5.  
The output pixels from motion detection (the foreground pixels) and color segmentation go inside a logic AND (pixel-wise). After this phase, the output logic mask is filtered with a median filter to remove the isolated pixels, considered as noisy pixels. We also do a labeling of the agglomerations of the pixels, called \"blob\". This labeling is used to extract the region properties in order to decide in the next sub-block which blobs have the right characteristics to pass the thresholds.  
### Color Segmentation and Blob Labeling  
After motion estimation, color segmentation, and blob labeling, the following features of the blobs are extracted inside the feature-extraction block of Figure 1:  
* Area is the number of pixels in the region studied.
* Turbulence is calculated as \(Perimeter^{2}{}_{blob}/Area_{blob}\).
* Extent is the ratio between the number of pixels in the region and in the bounding box.
* Convex area is the region inside a bounding box delimited from a polygon without concaved angles; the corners are defined from the most external pixels.
* Eccentricity is the eccentricity of the ellipse of the bounding box.  
The set of thresholds used to select the correct blobs is reported hereafter. We chose these thresholds by doing a trade-off between the video characteristics.  
\[THR_{area}=W\cdot H/2000;\quad THR_{turb}=55;\quad THR_{ext\_ min}=0.2\] \[THR_{ext\_max}=0.95;\quad THR_{eccontr}=0.99;\quad THR_{convArea}=0.5\]  
Now after setting the thresholds, for each blob we set the ranges in order to decide which blob can survive or not to the next analysis, see the following rules:  
\[Area_{blob}>THR_{area};\quad Turbulence_{blob}<THR_{turb};\] \[THR_{ext\_min}<Ext_{pixels}<THR_{ext\_max};\] \[ConvArea_{blob}>THR_{convArea};\quad Eccent_{blob}<THR_{eccontr}\]  
The turbulence factor we introduce is an amplification of the Boundary Area Roughness (BAR) factor used in other works in literature [32]. The turbulence index is determined by relating the perimeter of the region to the square root of the area, and hence it is the squared version of the BAR index. For example, the turbulence index is \(4\pi\) for a circle, 16 for a square, and about 20 for a triangle with sides L, L, and L-sqrt (2). Hence, the heuristic value of \(THR_{turb}=55\) used in this work for smoke blobs is also theoretically justified by being 3 to 4 times higher than that of \"regular\" figures like a circle. The area threshold \(THR_{area}\) is calculated so that for a VGA frame (W = \(6  
feature, but it uses together several geometric features like area, turbulence, extent, convex area, and eccentricity. This way, considering more parameters, the proposed AdViSED technique can reach better performance in terms of accuracy of the alarm prediction; see Section 5.