# Multi-Exposure Image Fusion Based on Weighted Average Adaptive Factor and Local Detail Enhancement
## 3 Proposed Methods
### Well-Exposure Evaluation Weight
We define a new weighted-average-adaptation factor \(\delta\) defined as follows:  
\[\delta=\left|\hat{I}(x,y)-q(x,y)\right| \tag{3}\]  
where \(\hat{I}(x,y)\) represents the average brightness of \(N\) input images at \((x,\,y)\), and \(q(x,\,y)\) is the expected brightness value, respectively, defined as follows:  
Figure 1:0  
Figure 1:1  
\(\theta\) is the weight value of 0.5. If \(\theta\) is too large or too small, the local contrast will be reduced in the fused image. In order to keep the brightness distribution consistent with the input image and obtain better exposure, we set \(\theta\) to 0.5; \(Y_{D}\) and \(Y_{B}\) represent the darkest and brightest pixel values of \(N\) input images at \((x,\,y)\), defined as follows:  
Figure 1:2  
Figure 1:3  
Therefore, the specific implementation method of the exposure evaluation function based on the weighted-average-adaptive factor proposed in this paper is as follows: the brightness value near the expected brightness should be given a larger weight and the pixels near the two ends should be given a lower weight. If \(\hat{I}\) is smaller than the expected brightness, the input pixel is dark and the weight of the darker area should be appropriately increased. In this way, a small number of pixels in the brighter area will not obtain a higher weight, so more details in the brighter area will be obtained on the fused image. At this time, the exposure evaluation function is defined as follows:  
\[W_{e}^{k}(x,y)=\left\{ \begin{array}{lr}\frac{1-\delta}{4(x,y)}Y_{k}(x,y)+ \delta,&Y_{k}(x,y)\in[0,q(x,y)]\\ \frac{1-\delta-Y_{k}(x,y)}{1-\delta-q(x,y)},&Y_{k}(x,y)\in(q(x,y),1-\delta]\\ 0,&Y_{k}(x,y)\in(1-\delta,1]\end{array} \right. \tag{8}\]  
If \(\hat{I}\) is larger than the expected brightness, the input pixel is brighter. In this case, the weight of the brighter area should be appropriately increased, so the fused image will obtain more details in the darker area. At this time, the exposure evaluation function is defined as follows:  
\[W_{e}^{k}(x,y)=\left\{ \begin{array}{lr}0,&Y_{k}(x,y)\in[0,\delta]\\ \frac{Y_{k}(x,y)-\delta}{q_{k}(x,y)-\delta}&Y_{k}(x,y)\in(\delta,\,q(x,y)]\\ \frac{(1-\delta)(1-\gamma_{k}(x,y))}{1-q(x,y)}+\delta,&Y_{k}(x,y)\in(q(x,y), 1]\end{array} \right. \tag{9}\]  
Figure 2b shows the exposure evaluation function proposed in this paper. Therefore, the final well-exposure of the two groups of pixels in Figure 3 calculated by Formulas (8) and (9) is shown in Figure 5. According to the new well-exposure weights, the two-pixel values in the fused image are as follows:  
\[F(A)=\frac{0.2\times 0.377+0.55\times 0.830+0.75\times 0.482}{0.377+0.830+0.48 2}=0.529\]  
\[F(B)=\frac{0.35\times 0.530+0.7\times 0.782+0.95\times 0.17}{0.530+0.782+0.17}=0.603\]Now, the brightness values of pixel A and pixel B in the fused image are close to the average brightness. The brightness of pixel B is more pronounced than that of pixel A, which is consistent with the brightness in the input image, indicating that the exposure evaluation is based on the weighted average adaptive factor. The scheme can effectively avoid the problem of local contrast reduction. In addition, we use the new as well as [PERSON]'s exposure weights to fuse the image sequences in the MEF dataset, then use the non-reference quality metric (NIQE) [23] to evaluate the fused images objectively. The lower the NIQE value, the better the fused image quality. The results are shown in Figure 6. As can be seen in Figure 6, although some of the NIQE values obtained by the proposed scheme are slightly higher than [PERSON]'s, as shown in the enlarged area in the figure, most of the fused images achieve better performance in the NIQE index, indicating that the proposed algorithm can better preserve image structure and features.