## 3 Method
### Shadow Compensation  
#### 3.3.1 Multi-Exposure Fusion  
Based on the shadow detection result, the shadowed and non-shadowed areas can be represented as \(R_{s}\) and \(R_{ns}\), respectively. By calculating the average spectral values of the two areas, we obtain the ratio of spectral reflectance \(\rho\), which serves as a basic parameter for exposure, representing the average spectral reflectance difference between non-shadowed and shadowed areas. Due to the gradual decrease in shadow components at the edges of the shadowed area, when generating exposure sequences, different exposure coefficients are adaptively generated by considering the spatial differences of shadow components. By performing \(k\) times erosion operations on \(R_{s}\), the average spectrum of each changed region is represented as \(\tau_{i},i=1,...,k\), and thus we obtain exposure reference image \(\gamma\)  
\[\gamma=\frac{\rho}{\tau_{i}},i=1,...,k \tag{3}\]  
The final exposure sequence is created by multiplying elements in the exposure base map \(\gamma\) with corresponding pixels in the original hyperspectral image \(I\). The exposure sequence at stage \(k\) is represented as  
\[l_{k}=\gamma_{k}\cdot I \tag{4}\]  
After obtaining the exposure sequence \(l_{k}\), the shadowed areas can be compensated by weighting these sequences. The weights are composed of the exposure, contrast, and spectral variance of each exposure sequence. The exposure \(E_{k}(x,y)\) is calculated by applying a Gaussian function to each spectral band  
\[E_{k}(x,y)=\exp\left(-\frac{(l_{k}(x,y)-\mu_{0})^{2}}{2\sigma_{0}^{2}}\right) \tag{5}\]  
where \((x,y)\) denotes the pixel location, \(\mu_{0}\) is 0.5, and \(\sigma_{0}\) is 0.2. The contrast \(C_{k}(x,y)\) can be expressed as the absolute value of the output by applying a Laplacian filter to each spectral band  
\[C_{k}(x,y)=|LF_{k}(x,y)| \tag{6}\]where \(LF_{k}(x,y)\) is the result of applying the Laplacian filter to the image \(I_{k}\) at the pixel coordinates \((x,y)\). Spectral variance \(V_{k}(x,y)\) is used to quantify the spectral intensity variation of each pixel  
\[V_{k}(x,y)=\sqrt{\frac{1}{n}\sum_{i=1}^{n}(I_{k,b_{i}}(x,y)-\mu)^{2}} \tag{7}\]  
where \(I_{k,b_{i}}(x,y)\) represents the value at pixel coordinates \((x,y)\) for the \(i\)-th band, and \(n\) is the total number of bands considered. Considering the correlation between bands, we assign higher weights to bands with large variations in the spectral dimension based on spectral variance. The final calculation formula for the weights is  
\[W_{k}=C_{k}\cdot E_{k}\cdot V_{k}. \tag{8}\]  
After normalization, \(\hat{W}_{k}\) is obtained  
\[\hat{W}_{k}(x,y)=[\sum_{k^{\prime}=1}^{k}W_{k^{\prime}}(x,y)]^{-1}W_{k}(x,y) \tag{9}\]  
Inspired by the work of [PERSON] et al. (2016), we utilize an algorithm that combines two key components: the Laplacian pyramid, which is constructed based on the exposure sequence \(I_{k}\) and the Gaussian pyramid, which is constructed based on the weight map \(\hat{W}_{k}\). By integrating these elements, we generate a weighted average exposure image within the framework of a Laplacian pyramid. The formula is  
\[L\{I_{\text{Exposure}}(x,y)\}^{l}=\sum_{k^{\prime}=1}^{k}G\{\hat{W}_{k^{\prime }}(x,y)\}^{l}\cdot L\{I_{k^{\prime}}(x,y)\}^{l} \tag{10}\]  
Applying the inverse Laplacian transform to \(L\{I_{\text{Exposure}}\}\) yields the shadow-compen sated image \(I_{\text{Exposure}}\). Based on the binary shadow detection map \(A\) obtained in Section 3.2, we replace the shadow-compensated areas into the original image \(I\)  
\[I_{Output1}=A\cdot I_{\text{Exposure}}+(1-A)\cdot I \tag{11}\]