## 3 Methods
### The Process of the ADMTCF
#### 3.1.4 The Mechanism of Multi-Template with Adaptive Size Change for the Process of Tracking
If the current adaptive adjustment template changes size to obtain greater similarity than the No. 1 template's similarity and the similarity difference is greater than the threshold, we make four operations. Firstly, we add a new No. 1 template. Secondly, we set the image of the original No. 1 template to the No. 2 template and set the image of the original No. 3 template to the No. 4 template. Thirdly, we set the current template as the No. 1 template to calculate the response according to Equations (4)-(7). If not, the algorithm will use the No. 1 template to calculate the response according to Equations (4)-(7) and fetch the next frame of the image. If the total number of templates is equal to 4, we make three operations. Firstly, we use No. 1-4 templates to calculate the similarity in sequence. Secondly, we reorder the templates and set the template with the largest similarity as the No. 1 template. Thirdly, we set the current adaptive adjustment template as the No. 1 template. Thirdly, we set the current adaptive adjustment template as the No. 1 template and the similarity difference is greater than the threshold, we set the No. 1 template as the current adaptive adjustment template to calculate the response according to Equations (4)-(7). If not, the algorithm will use the original No. 1 template to calculate the response according to Equations (4)-(7) and fetch the next frame of the image. If there is no next frame of the image, the tracking ends. We use the current adaptive adjustment template adaptively resizing to track the target that changes shape. Before resizing the template, we record the current target location, target size and its image features as a reference for the current adaptive adjustment template resizing. When the template is resizing, we check the top, the bottom, the left, and the right edges of the expanded or reduced template in order. We extend the top side of the current template upwards and re-compare the similarity with the new frame of the target image. If the similarity between the current template and the temporary target increases, we continue to expand the top side of the current template until the similarity is no longer improved, as in Figure 4a. If the similarity between the current template and the temporary target decreases, we reduce the scope of the bottom side of the current template upward until the similarity no longer increases, as in Figure 5b. We extend the left side of the current template to the left and re-compare the similarity with the new frame of the target image. If the similarity between the current template and the temporary target increases, we continue to expand the left side of the current template leftward until the similarity no longer increases, as in Figure 6a. If the similarity between the current template and the temporary target decreases, we reduce the range of the left side of the current template to the right until the similarity no longer increases, as in Figure 6b. We extend the right side of the current template to the right and re-compare the similarity with the new frame of the target image. If the similarity between the current template and the temporary target increases, we continue to expand the range of the right side of the current template to the right until the similarity is no longer improved, as in Figure 6c. If the similarity between the current template and the temporary target decreases, we reduce the scope of the right side of the current template to the left until the similarity no longer increases, as in Figure 6d. After updating the current template and calculating the response value between the adaptively dynamically adjusted template and the target, we obtain the new response value, the fine-tuned target's position, and the correct target's image. It is a very important  
Figure 4: Adaptive adjustment of the top side of the template in the ADMTCF algorithm: (**a**) expanding upward; (**b**) shrinking downward.