## 3 Weighted Wavelet Fusion Approach
### Color and Brightness Correction  
Underwater imaging follows markedly different optical principles from terrestrial photography [26]. On land, light travels mainly through air; underwater, it is repeatedly reflected, refracted, scattered, and absorbed by the water column. Absorption is wavelength-dependent: the longer the wavelength, the faster the attenuation. Consequently, red light is lost within a few meters, while blue-green components persist, giving raw underwater photographs a characteristic cyan tint and severely distorting color fidelity.  
Color compensation schemes for underwater scenes fall into two broad classes: (i) white-balance algorithms, grounded in the gray-world assumption, scale the RGB channels so that their means converge to a neutral gray. In shallow, turbid rivers and reservoirs, this assumption rarely holds, because illumination is highly non-uniform and the average scene brightness is well below that of open-ocean imagery; white balance therefore overcompensates or undercompensates individual channels. (ii) Retinex-based methods, inspired by human visual adaptation, decompose an image into illumination and reflectance components and then restore color by normalizing the former. MSRCR is especially suitable for hydraulic infrastructure inspection: it tolerates spatially varying lighting, suppresses the blue-green cast, and simultaneously boosts local contrast.  
The formula for the MSRCR color correction method is as follows:  
\[R(x,y)=\sum_{i=1}^{N}\omega_{i}[\log(I(x,y))-\log(G_{i}(x,y*I(x,y))]\times C(x,y) \tag{1}\]  
where \(R(x,y)\) is the image after color correction, \(\omega_{i}\) is the weight of the \(i\)th scale, \(N\) is the number of scales, \(I(x,y)\) denotes the original image, \(G_{i}(x,y)\) is a Gaussian filter used to simulate the lighting components at different scales, and \(C(x,y)\) is the color recovery factor.  
Figure 1: The complete processing pipeline of the proposed WWSF algorithm.  
Nevertheless, MSRCR processing can over-sharpen an image, causing edge regions to appear either excessively bright or unnaturally dark. To mitigate this artifact, we apply nonlinear gamma correction to rebalance the image brightness. The transformation is defined as follows:  
\[I_{out}=I_{input}^{\gamma} \tag{2}\]  
where \(I_{input}\) is the input image, \(I_{out}\) is the output image, and \(\gamma\) is the correction exponent. Setting \(\gamma<1\) expands low-intensity values and therefore brightens the image, whereas \(\gamma>1\) compresses them and makes the image darker. In this study, \(\gamma\) was set to 0.8, based on empirical analysis of the luminance histogram. This value enhances midtone details while avoiding overexposure in bright regions.  
To verify that the color bias is removed, we analyze the cumulative distribution functions (CDFs) of the RGB channels before and after enhancement (Figure 2). In the raw frame (Figure 2a), the three CDFs (Figure 2b) rise steeply as the normalized gray level goes from 0.6 to 0.9 and almost overlap, indicating low global contrast and a narrow tonal range. The right-shifted green curve reveals a marked green cast. After MSRCR, followed by \(\gamma\)-correction, the CDFs (Figure 2d) become smoother, extend across the full 0-1 range, and separate from one another, showing that the pixel intensities have been redistributed and the chromatic balance improved. The corrected image (Figure 2c) consequently exhibits higher contrast, suppressed overexposure, and clearer structural details, confirming the effectiveness of the proposed workflow.