## 2 Proposed Theory
### Image Fusion  
Inspired by the research hotspots including infrared and visible light images fusion and the fusion of multi-exposure images, which aim at fusing details in different images of a same scene to obtain an image with rich information, we fuse the images generated by previous steps. We adopt a method [29] with clear mathematical principles and high computational efficiency. Through the steps above, a set of enhanced images in different brightness from the original image can be generated. We regard those images as multi-exposed images. In order to maintain local details well, we block the image in the fusion. Let \(\{i_{k}^{n}\}=\{i_{k}^{m}|1<k<K\}\) be a set of column vectors of \(N^{2}\) dimensions expanded from the blocks at the identical location of the source images that contains \(K\) images in multi-brightness. \(k\) means the block is from the \(k\)th image of the set, \(n\) means the \(n\)th location. The elements of the vector are value of each pixel in the image block. \(N\) is the side length of the image block. \(n\) corresponds to the position of the patch in the entire image. In order to express, analyze, and process the feature of a block, the vector \(i_{k}^{n}\) can be decomposed into three components, including signal strength \(p_{k}^{n}\). Signal structure \(s_{k}^{n}\) and mean intensity \(\mu_{i_{k}^{n}}\). The definitions of the components are chiefly as follows. \[i_{k}^{n}=\|i_{k}^{n}-\mu_{i_{k}^{n}}\|\cdot\frac{i_{k}^{n}-\mu_{i_{k}^{n}}}{\|i _{k}^{n}-\mu_{i_{k}^{n}}\|}+\mu_{i_{k}^{n}}\ =p_{k}^{n}\cdot s_{k}^{n}+\mu_{i_{k}^{n}} \tag{14}\]  
\(\mu_{i_{k}^{n}}\) is a vector, in which all the elements equal to the mean value of \(i_{k}^{n}\). \[p_{k}^{n}=\|i_{k}^{n}-\mu_{i_{k}^{n}}\| \tag{15}\]  
\[s_{k}^{n}=\frac{i_{k}^{n}-\mu_{i_{k}^{n}}}{\|i_{k}^{n}-\mu_{i_{k}^{n}}\|} \tag{16}\]  
Obviously, the contrast of an image block can be directly reflected by the signal strength component \(p_{k}^{n}=\|i_{k}^{n}-\mu_{i_{k}^{n}}\|\). Generally speaking, the higher the contrast, the clearer the block or image. While the excessive contrast may trigger an unrealistic scene. Considering the input images (blocks) are undistorted, we could assume that the block has the largest contrast corresponds to the optimal visibility. Therefore, we choose the highest signal strength of all source image blocks as the signal strength of the fused image block:  
\[\widehat{p_{n}}=\max_{1<k<K}p_{k}^{n} \tag{17}\]  
Figure 3: (**a**) Result 1 without multiscale guided filter enhancement. (**b**) Result 1 with multiscale guided filter enhancement. (**c**) Result 2 without multiscale guided filter enhancement. (**d**) Result 2 with multiscale guided filter enhancement. Determine the structure of the set of image blocks as a series of unit length vectors \(s_{k}^{n}=\frac{\frac{\pi_{k}^{n}-\mu_{k}^{n}}{\|R_{k}^{n}-\mu_{k}^{n}\|}}{(1 \leq k\leq K)}\), and each one points to a direction in the vector space. The structure of the fused image block should represent the structures of the series of image blocks. Specifically, the relationship between the structure of fused block and the input blocks is defined in a simple but effective way:  
\[\overline{s_{n}}=\frac{\sum_{k=1}^{K}\|p_{k}^{n}\|^{\rho}\cdot s_{k}^{n}}{\sum _{k=1}^{K}\|p_{k}^{n}\|^{\rho}} \tag{18}\]  
\[\widehat{s_{n}}=\frac{\overline{s_{n}}}{\|\overline{s_{n}}\|} \tag{19}\]  
The definition of mean intensity of each block is  
\[\widehat{\mu_{n}}=\frac{\sum_{k=1}^{K}L(\mu_{k},\mu_{k}^{n})\cdot\mu_{k}^{n}}{ \sum_{k=1}^{K}L(\mu_{k},\mu_{k}^{n})} \tag{20}\]  
where \(L(\mu_{k},\mu_{k}^{n})\) is a weighting function which is controlled by the mean value of the \(k\)th whole image \(\mu_{k}\) and the mean value of the current block \(\mu_{i^{n}}\) in the \(k\)th image. \(L(\cdot)\) should be relatively large when the block \(i_{k}^{n}\) is in a well-exposed region, and vice versa.