# Multi-Exposure Image Fusion Based on Weighted Average Adaptive Factor and Local Detail Enhancement
## 3 Proposed Methods
### Well-Exposure Evaluation Weight  
The exposure ratio can measure the exposure effect of an image. The image we want should be well-exposed, neither over-exposed nor under-exposed, and contain sharp details. When fusing, if the image is under-exposed or over-exposed, the fused image weights will be suppressed, and when the pixels are well-exposed, the fusion weights should remain large. Therefore, pixel values with brightness close to 0.5 should be given greater weight, whereas those close to 0 and 1 should be given less weight. According to this principle, [PERSON] et al. [7] proposed an exposure evaluation function based on an adaptive factor to calculate the exposure weight. Figure 2a shows the exposure evaluation function, and the adaptive factor (\(\gamma\)) is defined as follows:  
\[\gamma=\left|\frac{1}{N}\sum_{k=1}^{N}\left(\frac{1}{hw}\sum_{x,y}\gamma_{k}(x, y)\right)-0.5\right| \tag{1}\]  
where \(Y_{k}(x,y)\) represents the pixel value of the \(k\)th input image at \((x,\ y)\), \(N\) represents the number of input images, and \(h\) and \(w\) represent the size of the input image. \(\gamma\) is determined by the difference between the average brightness of all input images and 0.5. We found that when the average value is more than 0.5, brighter areas are given greater weights, and when the average value is too small, \(\gamma\) is larger and pixel exposure weights in the range of \(0\sim\gamma\times 255\) are assigned 0, causing the fusion image to lose details that should be contained in darker areas. When the average value is less than 0.5, the darker area is given a higher weight. However, when the average value is too large, \(\gamma\) is larger and the pixel exposure weight in the range of \((1-\gamma)\times 255\sim 255\) is given 0, resulting in the fusion image losing details that the brighter areas should contain. Experiments show that the brightness of the fused image is lower than the average brightness of the input image, resulting in a low local brightness of the image, which can be solved by the well-exposed evaluation function proposed in this section. Figure 1: Frame diagram of fusion. Figure 2: Exposure evaluation function. (**a**) [PERSON]’s exposure evaluation function. (**b**) Our exposure evaluation function. We obtain the fusion weight \(W_{e}^{k}\) by normalizing the exposure rate, which is defined as follows:  
\[W_{e}^{k}(x,y)=\frac{E_{k}(x,y)}{\sum_{k=1}^{N}E_{k}(x,y)} \tag{2}\]  
where \(E_{k}(x,y)\) represents the exposure weight of the \(k\)th input image sequence at the \((x,y)\) position. Although a well-exposure weight can prevent the fusion image from being low-exposure or over-exposure, it often encounters contrast degradation and local brightness that does not adapt to the input image. We illustrate this phenomenon with two pixels in the Chinese garden of the MEF dataset. As shown in Figure 3, the values of Pixel A from dark to light are 0.2, 0.55, and 0.75; and the values of Pixel B are 0.35, 0.7, and 0.95. After calculation, the average brightness of the Chinese garden is 0.35, so the corresponding exposure weight is obtained from the function represented by the dotted line in Figure 2a. The result is shown in Figure 4. According to Figure 4, the values of the fused image are as follows:  
\[F(A)=\frac{0.2\times 0.49+0.55\times 0.86+0.75\times 0.29}{0.49+0.86+0. 29}=0.481\]  
\[F(B)=\frac{0.35\times 0.745+0.7\times 0.429+0.95\times 0}{0.745+0.429+0}=0.478\]  
The value of A in the fused image is greater than that of B, and the value of B is much smaller than the average value of the input pixel B. This is because the expected value of all pixels in the input image is set to 0.5 regardless of the actual value. Therefore, to maintain consistency with the input image in terms of luminance distribution, the desired luminance  
Figure 4: Exposure rates of Pixel A and B of Huang. Figure 3: Two groups of pixel parameters of Chinese Garden. of different pixels needs to be consistent with the values in the input image.