2.2.2. Weight Coefficients

The weight coefficient is determined by the similarity between the current target image and the previously saved image. Here, we use a perceptual Hash algorithm to judge the similarity [33]. We know that the high-frequency information in an image can provide details, and the low-frequency information can describe the frame. Hash algorithm is a method to detect the similarity between images with the low-frequency information of images. First, the image is down-sampled to 8 × 8 to remove high-frequency information and discard the difference caused by different sizes. Next, the image is converted into a gray-scale image, and its gray-scale average value is calculated. Further, the gray value of each pixel in the image is compared with the average gray value. If the gray value is greater than or equal to the average value, it is recorded as 1, and if the gray value is less than the average value, it is recorded as 0. Finally, these 64 values are combined to form the Hash fingerprint of this image. This method is fast and efficient and is not affected by image size or scale. The main process of determining the weight coefficient with Hash algorithm is as follows:

Step 1: calculate the Hash fingerprint of the initial target image and each predicted image. Step 2: calculate the number *Num* of different points of the Hash fingerprint between the target image and the predicted image.

Step 3: determine the weight coefficients *a*<sup>1</sup> and *a*<sup>2</sup> according to the value of *Num*. There are several situations. If *Num* < 5, the current target is considered to be similar to the initial target image, replace the initial target with the current target, and set *a*<sup>1</sup> = 0, *a*<sup>2</sup> = 1. If 5 < *Num* < 10, perform image fusion and set *a*<sup>1</sup> = 0.5, *a*<sup>2</sup> = 0.5. If *Num* > 10, there is a large difference between the current target and the initial target image, the current image is discarded and set *a*<sup>1</sup> = 1, *a*<sup>2</sup> = 0, that is, the initial target image will not be updated. The reasonable threshold (5 and 10 or other number) can be determined by manual test.
