# An Improved Kernelized Correlation Filter Algorithm for Underwater Target Tracking
## 3 Improved Kernelized Correlation Filter Algorithm
### Base Sample With Dynamically Continuous Scale  
The traditional KCF uses a fixed-size base sample for training; when the target size changes in the tracking process, it will cause the filter training effect not to be good, resulting in tracking failure. In order to solve the problem of a poor training effect with a fixed-size base sample in the KCF, a base sample with a dynamically continuous scale is proposed.  
Figure 1 is a few frames extracted from image sequences; the target marked by the red rectangle in the image (target size is 27 \(\times\) 29) has been getting larger. Figure 2 is a response diagram corresponding to Figure 1, which is tracked by the traditional KCF at a fixed-size base sample of 5.5 times the target size.  
From Figure 2, it can be seen that when the target is getting larger, the corresponding output response diagram peak increases first and then decreases. Figures 1b and 2b show that the underwater target scale is advantageous for the detection of the filter when it becomes larger. Figures 1c and 2c show that if the target scale exceeds a certain value, the detection effect of the filter will begin to decrease and the tracking accuracy will decrease.  
In order to avoid the influence of the target scale change on tracking accuracy, the base sample with a dynamically continuous scale is proposed to solve this problem. Firstly, the features of the histogram of oriented gradients are extracted for base samples of a different scale. Then, using the target feature template \(v=\left\{v_{1},v_{2},...,v_{n}\right\}\) and the base sample feature \(\tau=\left\{\tau_{1},\tau_{2},...,\tau_{n}\right\}\) in the filter model to perform the kernelized correlation operations, the result of kernelized correlation operations is:  
\[\kappa^{\tau v}=\kappa\left(\tau,v\right)=\exp\left(-\frac{1}{\sigma^{2}} \left(\parallel\tau\parallel^{2}+\parallel v\parallel^{2}-2F^{-1}\left( \hat{\tau}^{*}\odot\hat{v}\right)\right)\right) \tag{18}\]  
where \(F^{-1}\) means inverse Fourier transformation, \({}^{*}\) means complex conjugation, and \(\hat{\tau}\) is the Fourier transform of the variable \(\tau\).  
Figure 1: Tracking results at different times: (**a**) The tracking results at the 6 th frame; (**b**) the tracking results at the 12 th frame; (**c**) the tracking results at the 31 st frame.  
Figure 2: Response diagram of tracking results: (**a**) Response diagram of the 6 th frame image; (**b**) response diagram of the 12 th frame image; (**c**) response diagram of the 31 st frame image.  
The results of the kernelized correlation operations \(\kappa^{\texttt{\tiny{T}}{\texttt{U}}}=\{\kappa_{1}^{\texttt{\tiny{T}}{\texttt{U}}}, \kappa_{2}^{\texttt{\tiny{T}}{\texttt{U}}},...,\kappa_{n}^{\texttt{\tiny{T}}{ \texttt{U}}}\}\) and filter coefficients \(\alpha=\{\alpha_{1},\alpha_{2},\ldots,\alpha_{n}\}\) are converted to the frequency domain, and a plurality of response diagram \(f=\{f_{1},f_{2},\ldots,f_{n}\}\) in the spatial domain is obtained by Fourier inverse transformation, and the response diagram can be calculated by:  
\[f_{i}(\tau)=F^{-1}\left(\hat{f}_{i}\left(\tau\right)\right)=F^{-1}\left(\hat{ \kappa}^{\texttt{\tiny{T}}{\texttt{U}}}\odot\hat{\alpha}\right) \tag{19}\]  
where \(i=1,2,...,n\), \(\odot\) represents the point multiplication operation between elements. The optimal position of the target can be predicted based on the response diagram with maximum peak.