# Infrared and Visible Image Fusion via Feature-Oriented Dual-Module Complementary
## 3 The Proposed Method
### Spatial Gradient Capture Module
#### 3.1.3 Adaptive Contrast Estimation Operator  
In general, image contrast reflects the differences in luminance levels between the brightest white and darkest black in the light and dark areas of an image; it is also one of the important elements for measuring the structural details of the image. The magnitude of the image gradient has a low value in the blurred image because the gray-level change at the object edge is not evident. Numerically, the image contrast has a lower value in smooth regions because there are fewer high-frequency components where the grayscale values have large variations. By observing the input images, we found that the visible image often contributes to the contrast distribution of the fused image. However, relying only on the structural details of the visible image and ignoring those in the infrared image inevitably leads to low contrast and poor visual quality of the fused image. To solve this, we propose an adaptive contrast estimation operator to (i) maximize the extraction of the spatial structure details from the infrared image and (ii) preserve the spatial structure of the visible image and the target in the infrared image well, resulting in a contrast map. The specific steps are as follows. First, calculate the contrast difference map (\(CDM\)) between the source images as follows:  
\[CDM(x,y)=\frac{\max\langle\{AC[IR(x,y)]-AC[VIS(x,y)]\},0\rangle}{AC[IR(x,y)]}, \tag{11}\]where \(IR\) and \(VIS\) denote the input images, and \(AC[I(x,y)]\) is the contrast of image \(I\) at the coordinate position \((x,y)\), which is constructed from the original contrast and gradient in the source images [26] as follows:  
\[ \begin{array}{c}AC[I(x,y)]=(1-\alpha)(\max I(x^{\prime},y^{\prime})-\min I(x^{ \prime},y^{\prime}))\\ \qquad\qquad\qquad\qquad+\alpha(\max\|\
abla I(x^{\prime},y^{\prime})\|), \end{array}  \tag{12}\]  
where \((x^{\prime},y^{\prime})\) is the neighborhood pixel of \((x,y)\) within the window size \(\mathcal{N}(x,y)\), \(\
abla\) denotes the gradient operator, and \(\alpha\) is a constant with a value of 0.5. Thus, by employing \(AC\) in \(CDM\) as in Equation (11), the contrast map \(CDM\) has large values for regions with better spatial details in \(IR\) compared to \(VIS\) and low values (or zeros) for the other regions where the spatial details of \(VIS\) are better. Hence, the adaptive contrast equation inherits the goal that it was built for. Note that the \(CDM\) comprises simple yet effective calculations for assessing the spatial details of an image and does not require image decomposition via filter banks or frequency decomposition. After the three different feature maps are extracted from the input images, a fast guided filter (\(FGF\)) is used to combine them to obtain the captured map (\(CM\)) as follows:  
\[CM_{n}=FGF\{(PCA_{n}.*SAL_{n}.*CDM),\gamma\tau,\,\varepsilon,s\}, \tag{13}\]  
where \(r\), \(\varepsilon\), and \(s\) denote the local window radius, regularization parameter, and subsampling ratio, respectively. To avoid the appearance of visual artifacts and combine the different scales together, a Gaussian pyramid is constructed for the captured maps as follows:  
\[G_{n}^{i}=dg_{2}\Big{(}CM_{n}^{i}\Big{)},\ n=1,\ldots N;i=1,2,\ldots,j. \tag{14}\]  
where \(dg_{2}(*)\) corresponds to an operator that convolves an image with a Gaussian kernel and then downsamples it to half of its original dimensions; \(j\) is the sampling number, and its value is calculated as \(j=\text{floor}\ \{\log\ [\min(r,c)\ /\ \log(2)]\}\). Then, a set of progressively smaller and smoother weight maps \(\left\{G_{n}^{1},G_{n}^{2},\ldots,G_{n}^{j}\right\}\) are produced. Similarly, a Gaussian pyramid is built for each input image \(I_{n}\), and a Laplacian pyramid is constructed for each \(I_{n}\) through the following recursive formula:  
\[L_{n}^{i}=I_{n}^{i}-ug_{2}\Big{(}dg_{2}\Big{(}I_{n}^{i}\Big{)}\Big{)}, \tag{15}\]  
where \(ug_{2}(*)\) is an operator used to upsample an image to twice its original size.