## 3 Proposed Algorithm
### Historical Frame Background Extraction Module
This is specifically achieved as follows:  
\[L_{v}(i,j)=floor\Big{(}v_{r}\times T^{1}_{ij}\Big{)}\,mod\,v_{r} \tag{7}\]  
where \(L_{v}(i,j)\) is the label of each pixel, which is an integer ranging from 0 to 9, \(floor(\cdot)\) is the downward rounding operation, and \(mod(\cdot)\) is the remainder operation. \(v_{r}\) represents the total number of gray scale range classifications. When the value of \(v_{r}\) is larger, the accuracy of pixel segmentation in the target area of the first frame \(T^{1}\) increases, and the computational complexity also rises. Conversely, a smaller value of \(v_{r}\) results in reduced segmentation precision within the target region of the initial frame, along with lower computational overhead. Experimental results indicate that setting \(v_{r}\) to 10 yields the most favorable performance. In the experiments, we tested different values of \(v_{r}\) at intervals of 5, \(v_{r}\in\{5,10,15\}\), and observed their impact on segmentation accuracy. When \(v_{r}=5\), some background pixels were misclassified as target pixels, leading to poor segmentation results and low distinction between the target and background. On the other hand, when \(v_{r}=15\), although the distinction between the target and background improved, the computational complexity increased significantly due to the need to process more grayscale categories. Considering these factors, we concluded that \(v_{r}=10\) is the optimal choice. It allows for the best possible distinction between the target and background while maintaining low computational complexity. According to the grayscale range label and grayscale range index, the spectral pixel intensity and spectral number intensity of each pixel in each band image in the target area \(T^{1}\) of the first frame are determined. This is specifically achieved as follows:  
\[S_{P}(i,j)_{l}= \begin{cases}T^{1}_{ij}&\text{if }l=L_{v}(i,j)\\ 0&\text{otherwise}\end{cases}  \tag{8}\]  
\[S_{Q}(i,j)_{l}= \begin{cases}1&\text{if }l=L_{v}(i,j)\\ 0&\text{otherwise}\end{cases}  \tag{9}\]  
where \(l\) is the grayscale range index, \(S_{P}(i,j)\) is the spectral pixel intensity, and \(S_{Q}(i,j)\) is the spectral number intensity. For each bin of \(T^{1}_{i}\), \(S_{P}(i,j)_{l}\) and \(S_{Q}(i,j)_{l}\) can be accumulated separately as:  
\[S_{P}(i)_{l}=\sum S_{P}(i,j)_{l} \tag{10}\]  
\[S_{Q}(i)_{l}=\sum S_{Q}(i,j)_{l} \tag{11}\]  
The maximum gray index number for each band is computed using the following formulation:  
\[l(i)_{m}=\underset{l}{max}\,S_{Q}(i)_{l} \tag{12}\]  
where \(l(i)_{m}\) represents the index of the target pixel set on the \(i\)-th band, given that target pixels occupy the highest proportion within the region of interest. Therefore, the local target spectral curve can be calculated as:  
\[C_{t}=\left\{C_{ti}|C_{ti}=\frac{S_{P}(i)_{l(i)_{m}}}{S_{Q}(i)_{l(i)_{m}}} \right\}_{i\in\{1,\dots,B\}} \tag{13}\]  
where \(C_{t}\) denotes the local target spectral curve, and \(C_{ti}\) indicates the value corresponding to the \(i\)-th spectral band, \(S_{P}(i)_{l(i)_{m}}\) refers to the total intensity of target pixels on band \(i\) within the region of interest at frame 1, and \(S_{Q}(i)_{l(i)_{m}}\) represents the total target pixel number of band \(i\) in the target area in the first frame. The region of the \(t\) frame search region \(S^{t}\in R^{B\times W_{S}\times H_{S}}\) that is similar to the target region of frame 1 is determined by computing the spectral angular distance between the local target spectral curve \(C_{t}\) and the search region of the \(t\)-th frame. This is specifically achieved as follows:  
\[D=\arccos\left(\frac{(C_{t})^{T}C_{g}}{\sqrt{(C_{t})^{T}C_{t}}\sqrt{(C_{g})^ {T}C_{g}}}\right) \tag{14}\]where \(D\) is the value of the spectral angular distance, while \((\cdot)^{T}\) denotes matrix transposition. To separate the target and the background, a mask is generated by spectral angular distance. This is specifically achieved as follows:  
\[Y= \begin{cases}1&\text{if }D>Thr\\ 0&\text{otherwise}\end{cases}