## 2 Materials and Methods
#### 2.1.1 Establishment and Update of Background Model  
The steps of establishment and update:  
Step 1: The video cache window of traffic flow was built and the images were extracted from the traffic flow video, in which 16-frame images were cached for extracting subsequent background models. The average gray value of the pixels in the same position was calculated as the pixel value of this point in the background image. \[B_{n+1}(x,y)=\sum_{n}^{g}I_{n-1}(x,y), \tag{1}\]  
where \(n\) represents the number of image frames and \(g\) represents the threshold value. Step 2: Each frame was read in turn and the threshold \(g\) was extracted, whose calculation formula is:  
\[g=n\cdot\frac{k}{I(x,y)-B(x,y)} \tag{2}\]  
The binary image of the frame in the traffic flow video image was calculated according to the threshold \(g\):  
\[E(x,y)= \begin{cases}1&\left|I(x,y)-B(x,y)\right|\geq g\\ 0&\left|I(x,y)-B(x,y)\right|<g\end{cases}  \tag{3}\]Step 3: The background model \(B(x,y)\) was updated by the calculated binary difference image \(E(x,y)\):  
\[B_{n+1}(x,y)=\left\{ \begin{array}{cc}B_{n}(x,y)&B_{n}(x,y)=1\\ \alpha B_{n+1}(x,y)+(1-\alpha)B_{n}(x,y)&B_{n}(x,y)=0\end{array} \right., \tag{4}\]  
where \(B_{n}\) is the gray value of the background image of the traffic flow video at the pixel point \((x,y)\), \(E_{n}\) is the gray value of the binary difference image at pixel point \((x,y)\), \(I_{n}\) is the \(n\)-th frame input image, and \(\alpha\) is the coefficient of iterative speed and its value is 0.02. Step 4: The number of iterations was \(j\). The minimum value was 1 and the maximum value was the total number of pixels in the traffic flow video image. \(j\) was accumulated once, and then we returned to Step 3 and executed the cycle. When the number of iterations was the same as the maximum number, the iteration ended. In conclusions, the specific steps are shown in Figure 1.  
1.2 Autonomous Detection of Traffic Flow Parameters Based on the Fusion of Multiple Symmetric Differences and Background Subtraction Target Extraction  
The flow chart of autonomous detection for the traffic flow parameter based on the fusion of multiple symmetric differences and background subtraction target extraction is shown in Figure 2.  
When the traffic flow scene changed slowly or the target moved in or out of the background, the basic idea of the background updated: In each cycle, the methods of multi-symmetry difference and background subtraction were used to find the moving area of the traffic flow parameter. The background pixels in the traffic flow parameter moving area were unchanged, while the background of the fixed area was updated by current pixels. The specific steps:  
Step 1: Each frame was preprocessed by denoising, graying, and histogram equalization. Figure 1: Background model update flow chart. Step 2: Seven consecutive frames were read to find out the middle frame \(I_{k}(x,y)\), following three frames, \(I_{k-3}(x,y)\), \(I_{k-2}(x,y)...\)\(I_{k+3}(x,y)\), and the difference image TD of the background frame \(B_{k}(x,y)\), TD stands for differential image. \[ \begin{array}{l}TD_{14}(x,y)=\left|I_{k}(x,y)-I_{k-3}(x,y)\right|\\ TD_{24}(x,y)=\left|I_{k}(x,y)-I_{k-2}(x,y)\right|\\ \vdots\ \ \vdots\ \ \vdots\\ TD_{74}(x,y)=\left|I_{k}(x,y)-I_{k+3}(x,y)\right|\\ BD_{4b}(x,y)=\left|I_{k}(x,y)-B_{k}(x,y)\right|\\ \end{array}  \tag{5}\]  
Step 3: Six symmetrical differences and the background subtraction results of Step 2, were filtered and binarized and then a morphological opening operation was carried out. After that, a small area and burr were removed, and the holes in the target area were filled so as to improve the spatial connectivity of video objects. Step 4: The operation was performed on six symmetrical differences in Step 3 to get the target regions of the traffic flow parameter movement. Meanwhile, the operation was performed on the background subtraction difference image to get the traffic flow parameter movement, namely \(CD_{1}\), \(CD_{2}\), \(CD_{3}\):  
\[\left\{