## 3 Proposed Method
### EIG (Exposure Image Generator)
The value of \(R(m,p)\) is the difference between the intensity of the neighboring pixel \(m\) and the intensity of the central pixel p. We extend the intensity difference of a pixel to the intensity difference value of a pixel with nonluminosity differences that is any relationship satisfying the following properties: \(R(x,x)=0\) and \(R(x,y)=R(y,x)\). If the triangular inequality holds, then the difference value satisfies the following relationship: \(R(x,y)+R(y,z)\geq R(x,z)\). \(x,y,z\) is the pixel value of any pixel point within the \(I\) matrix. The spatial bilateral filter with pixel intensity difference values is shown in Equation (2):  
\[S(p,\theta_{1},\theta_{2})=\frac{1}{W_{p}}\sum_{m\in K_{s}}\lambda G_{\theta_ {1}}(||m-p||,\theta_{1})G_{\theta_{2}}(R(m,p),\theta_{2})I_{m} \tag{2}\]  
Among them:  
\[W_{p}=\sum_{m\in K_{s}}G_{\theta_{1}}(||m-p||,\theta_{1})G_{\theta_{2}}(R(m,p),\theta_{2}) \tag{3}\]  
\[G_{\theta}(x,\theta)=\frac{1}{\sqrt{2\pi\theta}}e^{\frac{-(x^{2}+\theta^{2})}{ 2\theta^{2}}} \tag{4}\]  
\[R(m,p)=I_{m}-I_{p} \tag{5}\]  
Figure 3: Details of the tone mapping process. \(P\) represents the pixel value of the center pixel, \(K_{s}\) denotes all pixel points in the field of the center pixel \(k\times k\), and \(m\), \(p\) is the pixel value of any pixel point within the \(K_{s}\) matrix. The variable \(\theta_{1},\theta_{2},K_{s}\) controls the operation of the bilateral filter, and \(\theta_{1}\) controls the rate of spatial Gaussian decay. \(\theta_{2}\) controls the weight of the Gaussian intensity difference values, and the attenuation is too different from the contribution of neighboring pixels. \(K_{s}\) determines the size of the range in which the pixels in the field around the central pixel are located. \(W_{p}\) normalizes the sum of the weights. \(P\) is the pixel value of the central pixel, and m is the first input pixel point within the neighborhood pixel. In this paper, the neighborhood size is \(5\times 5\). \(G_{\theta_{1}},G_{\theta_{2}}\) is the spatial domain kernel and the image pixel domain kernel, respectively, and the value of \(G_{\theta_{1}},G_{\theta_{2}}\) corresponding to each pixel is found using Equation (4). For each pixel in the neighborhood, use its corresponding \(G_{\theta_{1}},G_{\theta_{2}}\) multiplied by the exposure factor \(\lambda\) and then multiplied by the pixel value of m. These four numbers are multiplied together to obtain a result. The same calculation is performed for all pixels in the neighborhood, and when the traversal is complete, each pixel in the neighborhood is associated with the central pixel, and the results are added together to obtain the numerator of the spatial bilateral filter. Multiply \(G_{\theta_{1}}\) with \(G_{\theta_{2}}\) to obtain \(W_{p}\) for each pixel, and add \(W_{p}\) for all pixels in the neighborhood as the denominator. The numerator and denominator are divided to obtain the new pixel value corresponding to the central pixel. **Tone Mapping (TM):** The final step of the exposure generator is tone mapping, where the tone mapping algorithm compresses the brightness of the exposed image while maintaining image detail and color to avoid losing important information. In this paper, instead of explicitly generating HDR images, we vary the exposure settings of the image on a pixel-by-pixel basis, allowing each pixel's exposure to be adjusted independently, thus allowing direct tone mapping without the need to construct intermediate HDR images. We assume that PSNR varies with pixel intensity and that detail information is less accurate in dark areas than in evenly exposed areas. We associate the confidence of the tone mapper with the detail based on the luminous intensity of the pixel. The tone mapper processes the detail layer and the base layer in different pipelines, each pipeline attenuating the base layer features to achieve the desired contrast and attenuating the detail based on the estimated accuracy by local luminance. Finally, these two components are recombined to form the final output.