An underwater image enhancement method based on cascade correction and multi-scale fusion
By employing a cascaded correction and multi-scale fusion underwater image enhancement method, the problems of color distortion and detail blurring in complex underwater environments are solved, achieving efficient underwater image enhancement and improving image clarity and color fidelity.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NORTHEAST DIANLI UNIVERSITY
- Filing Date
- 2026-04-20
- Publication Date
- 2026-06-26
AI Technical Summary
Existing underwater image enhancement methods suffer from color distortion, low contrast, and blurred details in complex underwater environments, and lack robustness and generalization ability, making it difficult to adapt to various complex image degradation types.
An underwater image enhancement model is constructed using a method based on cascaded correction and multi-scale fusion, including an improved dehazing module, a color correction module, a contrast enhancement module, a detail enhancement module, and a weight map extraction and normalization module. Through techniques such as frequency domain saliency analysis, multi-scale dark channel fusion, adaptive white balance, and PCA normalization, a model is built.
It effectively removes fogging and color distortion in underwater images, improves image clarity and color fidelity, enhances the robustness and generalization ability of underwater image enhancement, and enables reliable perception in complex underwater environments.
Smart Images

Figure CN122289003A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to an underwater image enhancement method, specifically an underwater image enhancement method based on cascaded correction and multi-scale fusion, belonging to the field of computer vision image enhancement technology. Background Technology
[0002] With the continuous development of underwater detection and imaging technologies, high-quality underwater visual information plays an increasingly crucial role in tasks such as marine resource exploration, ecological monitoring, and target identification. However, due to the absorption and scattering effects of water on light, underwater images generally suffer from problems such as fogging, color cast, low contrast, and blurred details, severely limiting the performance of subsequent visual tasks. Especially in my country's nearshore and deep-sea operating scenarios, turbid water, dense suspended matter, and complex and dynamically changing lighting conditions further exacerbate the degradation of underwater images, making it difficult for existing image processing methods to effectively restore image quality. Underwater image enhancement technology, as an important means to solve the above problems, has significant practical implications for improving the perception capabilities of underwater vision systems.
[0003] In recent years, significant progress has been made in underwater image enhancement methods, providing various technical pathways to improve image clarity and color fidelity. However, existing methods still face numerous technical challenges when applied to complex underwater environments: on the one hand, some methods heavily rely on accurate water quality parameter estimation or prior environmental information. Under complex water conditions such as uneven lighting and drastic changes in water turbidity, inaccurate parameter estimation can easily lead to color distortion in underwater images, and the algorithms lack robustness in dynamic and complex scenarios. On the other hand, existing methods generally suffer from poor generalization ability and poor adaptability to various complex image degradation types. Therefore, new image enhancement methods are urgently needed to address the severe degradation problems of underwater images in complex environments, in order to support reliable perception and operation of intelligent equipment such as underwater robots in real underwater scenarios. Summary of the Invention
[0004] To address the problems existing in the prior art, this invention provides an underwater image enhancement method based on cascaded correction and multi-scale fusion, which solves the problems of fogging, color distortion, low contrast and blurred details in underwater images.
[0005] The technical solution provided by this invention includes the following steps: Step 1: Acquire underwater images to form the first dataset; Step 2: Construct an underwater image enhancement model based on cascaded correction and multi-scale fusion. The model includes an improved dehazing module, an improved color correction module, an improved contrast enhancement module, a detail enhancement module, an improved weight map extraction and normalization module, and a multi-scale decomposition and fusion module. The construction of the model further includes steps 2.1 to 2.5. Step 2.1: The improved defogging module is based on an underwater imaging model and includes two parts: improved underwater background light and transmittance solution. The underwater images in the first dataset are used as input to the improved dehazing module, and the dehazed underwater images form the second dataset. Step 2.2: The improved color correction module includes two parts: improved channel color mean guidance and adaptive white balance; The dehazed images from the second dataset are used as input to the improved color correction module, and the color-corrected underwater images form the third dataset. Step 2.3: The improved contrast enhancement module introduces RGF filtering to optimize the CLAHE algorithm and enhances the contrast of the color-corrected image in Lab space; at the same time, the detail enhancement module uses an adaptive unsharpening mask algorithm to enhance the details of the color-corrected image. The color-corrected images in the third dataset are used as input to the improved contrast enhancement module, and also as input to the detail enhancement module. The contrast-enhanced and detail-enhanced underwater images form the fourth and fifth datasets. Step 2.4: The improved weight map extraction and normalization module includes five weight maps: Laplacian contrast, saliency, exposure, sharpness, and saturation. The normalization method uses PCA normalization instead of the traditional weighted fusion method. The contrast-enhanced and detail-enhanced images in the fourth and fifth datasets are used as inputs to the improved weight map extraction and normalization module, and the normalized weight maps are used to form the sixth and seventh datasets, respectively. Step 2.5: The multi-scale decomposition and fusion module consists of a Laplace pyramid and a Gaussian pyramid; The fourth and fifth datasets are input into the Laplacian pyramid for decomposition, and the sixth and seventh datasets are input into the Gaussian pyramid for decomposition. Then, the corresponding levels of the Laplacian pyramid and the Gaussian pyramid are fused to obtain the final enhanced underwater image. Step 3: Subjectively evaluate and objectively evaluate the enhanced underwater image, and compare it with other mainstream underwater image enhancement algorithms. If the evaluation criteria are met, the final underwater image enhancement model based on cascaded correction and multi-scale fusion is obtained.
[0006] Furthermore, in step 1, the images in the first dataset can be collected and acquired through a network or captured by an underwater robot; Furthermore, the improved defogging module in step 2.1 is based on an underwater imaging model to achieve defogging. The underwater imaging model needs to solve for two parts: background light and transmittance. The solution method further includes steps 2.1.1 to 2.1.2: Step 2.1.1: To solve the problem of the background light being too high in the traditional dark channel prior algorithm and the background light being easily affected by foreground objects in the traditional quadtree search algorithm, the frequency domain saliency analysis method is introduced to improve the quadtree search algorithm, and the scoring criteria of the traditional quadtree search are improved. The method for solving the background light further includes steps 2.1.1.1 to 2.1.1.7. Step 2.1.1.1: To effectively separate the underwater background and underwater target, a Discrete Fourier Transform is first performed on the input image of the first dataset to transform the image from the spatial domain to the frequency domain. The low-frequency components include smooth regions and background information of the image, while the high-frequency components include texture and detail information of the image. The Discrete Fourier Transform formula is as follows: ; In equation (1), x represents the horizontal coordinate of the image; y represents the vertical coordinate of the image; gray(x,y) represents the pixel gray value at position (x,y); M represents the width of the image; N represents the height of the image; u represents the index of the frequency component in the horizontal direction; v represents the index of the frequency component in the vertical direction; -j2π is the complex sine basis function, representing waveforms of different frequencies and directions; F(u,v) represents the frequency domain diagram after Fourier transform. Step 2.1.1.2: To effectively capture low-frequency information, the frequency domain graph is centered to center low-frequency information and high-frequency information at the edges. The formula for centered spectrum is as follows: ; In equation (2), F shift (u,v) represents the frequency domain graph after the spectrum is centered; Step 2.1.1.3: Perform frequency domain analysis on the frequency domain image after spectral centering, and calculate the two basic attributes of the frequency domain information: amplitude spectrum and phase spectrum; the amplitude spectrum contains the contrast and brightness distribution information of the image, and the phase spectrum contains the structure and shape information of the image. The formulas for calculating the amplitude spectrum and phase spectrum are as follows: ; ; In equations (3) to (4), M(u,v) represents the amplitude spectrum; P(u,v) represents the phase spectrum; and ε represents the stability value. Step 2.1.1.4: To analyze the regularity of the background spectrum and the anomalous spectrum of the target, the spectral residuals are calculated. Since the amplitude spectrum of natural images is usually smoothly changing and adjacent frequencies typically have similar amplitude values, the spectral residuals are calculated to identify frequency components that do not conform to this pattern. The formula for calculating the spectral residuals is as follows: ; ; In equations (5) and (6), A(u,v) is the average amplitude value, representing the average value of M(u,v) in its local neighborhood; G 3×3 R represents a 3×3 mean filter kernel; R(u,v) represents the spectral residual. R≈0 indicates that it conforms to the pattern and may be the background, while R>0 indicates that it deviates from the pattern and may be the foreground target. Step 2.1.1.5: To map the saliency information detected in the frequency domain to a specific location in the spatial domain, inverse Fourier reconstruction is performed. The formula for calculating the reconstructed saliency map is as follows: ; In equation (7), s(x,y) represents the saliency spectrum; j represents the imaginary unit; Step 2.1.1.6: To address the issues of high-frequency noise and discontinuities in the saliency region introduced by inverse Fourier reconstruction, Gaussian smoothing and normalization are performed on the saliency spectrum. The formulas for Gaussian smoothing and normalization are as follows: ; ; In equations (8) to (9), G σ=2.5 σ represents the Gaussian filter kernel; σ=2.5 represents the standard deviation of the Gaussian function; min(s) smooth ) represents the minimum pixel value in the entire saliency map; max(s) smooth ) represents the maximum pixel value in the entire saliency map; Represents the final significance map; Step 2.1.1.7: Use the quadtree search algorithm in conjunction with the obtained saliency map to determine the background light, specifically including steps 2.1.1.7.1 to 2.1.1.7.6; Step 2.1.1.7.1: Initialize the current candidate region to the entire image; Step 2.1.1.7.2: Divide the current candidate region evenly into 4 sub-regions; Step 2.1.1.7.3: Calculate the comprehensive score for each sub-region. The improved score calculation formula is as follows: ; In equation (10), μR Indicates the average brightness of the area; σ R The standard deviation of regional brightness is represented by λ; the weighting coefficient is represented by μ. S To indicate the significance of the regional average, if μ S The higher the value, the more significant the target is in the area; Step 2.1.1.7.4: Select the region with the highest score as the candidate region for the next iteration; Step 2.1.1.7.5: If the size of the current candidate region is less than or equal to the set threshold, stop the iteration; otherwise, return to step 2.1.1.7.2 to continue the iteration. Step 2.1.1.7.6: Select the average value of the brightest 0.1% of pixels in the dark channel in the finally selected candidate area as the global background light; Step 2.1.2: The transmittance is calculated using a method based on multi-scale dark channel fusion combined with channel attenuation. The transmittance calculation method further includes steps 2.1.2.1 to 2.1.2.5. Step 2.1.2.1: To address the issue that traditional single sliding windows cannot simultaneously handle underwater image details and noise, a multi-scale dark channel calculation and fusion method is adopted. Three sliding windows of different scales (5×5, 15×15, and 25×25) are selected, and the fusion method uses arithmetic mean fusion. The multi-scale dark channel calculation formula is as follows: ; In equation (11), s represents the window size; Ω s (x) represents a local region centered at x and of size s; I c (y) represents the pixel value of color channel c at position y; Step 2.1.2.2: To mitigate the loss of edge details in underwater images caused by dehazing, the underwater image gradient is used as the weight for calculating edge details. High gradient regions represent edges and textured areas, while low gradient regions represent smooth areas. The Sobel operator is used to calculate the horizontal and vertical gradients of the image, which are then normalized to [0,1]. The gradient calculation formula is as follows: ; In equation (12), I gray Represents a grayscale image of an underwater image; S x and S y These represent the Sobel kernels in the x-direction and y-direction, respectively. Step 2.1.2.3: Perform edge protection based on the underwater image gradient to preserve more details in the edge regions. The calculation formula for transmittance map edge protection is as follows: ; ; In equations (13) to (14), Indicates the multi-scale dark channel fusion value; t base Indicates the basic transmittance; Indicates the transmittance after edge protection; Step 2.1.2.4: To address the issue of rapid red light decay and slow blue-green light decay underwater, which leads to color distortion in underwater images after defogging, the following steps will be taken: The transmittance of the red channel is used as a reference transmittance, and the transmittance of the green and blue channels is estimated by using the ratio of the attenuation coefficients. The formulas for calculating the transmittance of the green and blue channels are as follows: ; ; In equations (15) to (16), t G t R t B ρ represents the transmittance of the green, red, and blue channels, respectively; G ρ R ρ B The attenuation coefficients for green, red, and blue are shown below. Based on the inherent properties of water, the relationship between the attenuation coefficients of different color channels and wavelength and global background light is as follows: ; ; In equations (17) to (18), A R A G A B λ represents the global background light for the red, green, and blue channels, respectively; G , λ B , λ R These represent the wavelengths of the green, blue, and red channels, respectively, with values of 540nm, 450nm, and 620nm. Step 2.1.2.5: To address the issues of blocky effects and artifacts in the original transmittance map, a guided filter is used to optimize the transmittance map. The guided filter optimization formula is shown below: ; In equation (19), q i Indicates the optimized transmittance; a k b k Represents the local linear coefficients, within the window ω k constants within; I i This represents the original transmittance.
[0007] Furthermore, the improved color correction module in step 2.2 includes an improved channel-wise color mean guidance and adaptive white balance method, which further includes steps 2.2.1 to 2.2.4: Step 2.2.1: Separate the RGB image into three independent channels, and then calculate the mean of each color channel; Step 2.2.2: To address the overcompensation issue in underwater images caused by the gray world hypothesis algorithm, a color compensation intensity coefficient is introduced. A method is proposed that uses the green channel color information as a baseline to calculate the color compensation intensity of the red and blue channels, and then uses the color compensation intensity of the red and blue channels to inversely calculate the green channel color compensation intensity. The color compensation intensity calculation formula is shown below: ; ; ; In equations (20) to (22), S R S G S B These represent the compensation intensity of the three RGB channels respectively; α R α G α B These represent the enhancement compensation coefficients for the three RGB channels, set to 2.0, 2.0, and 0.3 respectively; μ R μ G μ B These represent the color mean values of the RGB three channels respectively; Step 2.2.3: Perform color compensation for each channel based on the calculated color compensation intensity. The color compensation formula is as follows: ; In equation (23), C(i,j) represents the compensated RGB three channels; C n (i,j) represents the original RGB three channels; S C Indicates color compensation intensity; G n (i,j) represents the original green channel; Step 2.2.4: Based on color channel compensation, and combined with an adaptive white balance algorithm, adjust the intensity distribution of each color channel to further correct color cast: First, calculate the brightness distribution of each color channel and crop out the overly bright and underly dark parts according to the set percentage; Then, the remaining portion is linearly stretched to the range of 0~255 to obtain the color-compensated underwater image. The linear stretching formula is as follows: ; In equation (24), C old (x,y) represents the pixel value of the original image at position (x,y); v min This represents the minimum value obtained by percentage cropping; v max This represents the maximum value obtained through percentage cropping; C new (x,y) represents the image after linear stretching.
[0008] Furthermore, the improved contrast and detail enhancement module in step 2.3 includes an improved CLAHE algorithm and an adaptive unsharpening mask algorithm, wherein the algorithm further includes steps 2.3.1 to 2.3.2; Step 2.3.1: To address the issues of unnatural color transitions, block artifacts, and amplified underwater noise in the enhanced image caused by the traditional CLAHE algorithm in RGB space enhancement, RGF filtering and enhancement in Lab space are introduced. The method further includes steps 2.3.1.1 to 2.3.1.4. Step 2.3.1.1: Convert the RGB image to the Lab color space; Step 2.3.1.2: Perform contrast enhancement on the L channel using the CLAHE algorithm; Step 2.3.1.3: Introduce RGF filtering to guide optimization of the enhanced image. RGF filtering iteratively performs edge-preserving filtering on the image, using the output of the previous iteration as guidance in each iteration. The filter guidance optimization formula is as follows: ; In equation (25), G t (x) represents the output of the t-th iteration; I(y) represents the brightness of the input image; f s (||xy||) represents the spatial weight; f r (|I(y)-G t (x)|), representing the intensity difference weight; W(x) represents the normalization coefficient; Ω=max(3,2×σ) S +1) indicates the size of the filter window; Step 2.3.1.4: Merge the enhanced luminance channel L, the original a and b channels, and then convert it back to an RGB image to achieve underwater image contrast enhancement; Step 2.3.2: The adaptive unsharpened mask algorithm further includes steps 2.3.2.1 to 2.3.2.3; Step 2.3.2.1: Calculate and normalize the local coefficient of variation. The formula for calculating the local coefficient of variation is as follows: ; In equation (26), x cThis represents the pixel value of channel c at position x. ; and d c (m,n) represent the mean and standard deviation of the pixel at position (m,n) in channel c within a 3×3 neighborhood, respectively; CV c (m,n) represents the coefficient of variation of the pixel at position (m,n) in channel c; The normalization calculation formula is as follows: ; In equation (27), f c (m,n) represents the normalized coefficient of variation; max{CV R ,CV G ,CV B} represents the maximum value of the three-channel coefficient of variation; Step 2.3.2.2: Calculate the adaptive enhancement amplitude. Divide the range of the normalized coefficient of variation into four regions: [0, 0.25], [0.25, 0.5], [0.5, 0.75], and [0.75, 1], representing the four regions of image flatness, detail, edge, and noise, respectively. The adaptive enhancement amplitude adopts a piecewise continuous function, and the formula for the adaptive enhancement amplitude is as follows: ; In equation (28), ;λ max f represents the maximum gain coefficient; c Indicates the normalized coefficient of variation; Step 2.3.2.3: Use guided filtering to process the original image to obtain the low-frequency components. Then, subtract the low-frequency components from the original image to obtain the high-frequency components, and add them back to the original image according to an adaptive enhancement magnitude. The detail enhancement formula is as follows: ; In equation (29), This represents the enhanced image; This represents the image after color correction by the color correction module; G represents guided filtering; λ c This indicates the adaptive enhancement magnitude.
[0009] Furthermore, the improved weight map extraction and normalization module in step 2.4 extracts five weight maps from the contrast enhancement map and the detail enhancement map respectively and normalizes them. The method further includes steps 2.4.1 to 2.4.6. Step 2.4.1: Laplacian contrast weights. Global contrast is estimated by performing convolution filtering on the luminance channel of the image using a Laplacian filter in the Lab color space. The formula for calculating the Laplacian contrast weights is as follows: ; In equation (30), W represents the Laplace filter value. L Indicates the Laplacian contrast weight; Step 2.4.2: Saliency Weighting. By enhancing the contrast between bright and dark areas, targets with low recognition rates in underwater scenes are highlighted. This weighting combines color and brightness features to calculate salient regions in the image. The saliency weighting calculation formula is as follows: ; In equation (31), L, a, and b are the three channels of the Lab space; W S Indicates significance weight; Step 2.4.3: Exposure weighting. By increasing the proportion of highly visible areas in the fused image, the pixels in the image are all in a well-exposed state to retain more detailed information. The exposure weighting calculation formula is as follows: ; In equation (32), I is the normalized value of the image pixels; σ is the standard deviation of the exposure; W E Indicates exposure weight; Step 2.4.4: Sharpness weight, used to enhance the sharpness of underwater images and reduce the impact of blurred areas. The formula for calculating the sharpness weight is as follows: ; In equation (33), This is the image brightness channel after high-pass filtering; W sharp Indicates the sharpness weight; Step 2.4.5: Saturation weighting. This step uses the deviation between the color channel and the luminance channel to calculate and assign a larger weight to pixels with high saturation intensity in the image to preserve and emphasize the color information in the input image. The formula for calculating saturation weighting is as follows: ; In equation (34), μ represents the color value of pixel (i,j) in channel k. i Indicates image brightness; W sat (i,j) represents the saturation weight; Step 2.4.6: To address the problem that the traditional weighted fusion normalization method cannot reasonably and dynamically allocate weights, the PCA normalization method is used to replace the traditional weighted fusion method to normalize the five weight maps extracted above, thus obtaining their respective normalized weight maps.
[0010] Furthermore, the multi-scale decomposition and fusion module in step 2.5 inputs the contrast enhancement map and detail enhancement map into the Laplacian pyramid for decomposition, inputs the contrast normalized weight map and detail normalized weight map into the Gaussian pyramid for decomposition, and then fuses the corresponding levels of the Laplacian pyramid and the Gaussian pyramid to form a new Laplacian pyramid. The fusion formula is as follows: ; In equation (35), W k,l L represents the l-th level of the weighted Gaussian pyramid of the k-th image; k,l This represents the l-th layer of the Laplacian pyramid in the k-th image. Starting from the highest layer of the fusion pyramid, the superposition of adjacent layers is achieved by interpolation and magnification from top to bottom, thus obtaining the final underwater image enhancement map.
[0011] Furthermore, step 3 further includes steps 3.1 to 3.2; Step 3.1: Objective evaluation metrics include underwater color image quality assessment (UCIQE), information entropy (IE), structural similarity (SSIM), and fog perception density estimation (FADE). The calculation formulas for each evaluation metric are as follows: ; ; ; ; In equations (36) to (39), σ c Indicates the standard deviation of chromaticity, con l Indicates brightness contrast, μ c c represents the average saturation value, and c1, c2, and c3 represent weighting coefficients, which are 0.4680, 0.2745, and 0.2576, respectively; p i μ represents the probability of a pixel with grayscale value i appearing; x and y represent images of the same dimension. x and μ y This represents the mean of x and y. and σ represents the variance of x and y. x σ y D represents the covariance between x and y, where a1 and a2 are constants; fog D represents the Mahalanobis distance between the fog-perceiving features of the test image and the fog-perceiving features of the MVG model extracted from a large number of fog images; fog-free The Mahalanobis distance represents the fog-perceived features of the test image and the fog-perceived features of the MVG model extracted from a large number of fog-free images. Step 3.2: Evaluate and objectively assess the enhanced underwater image to meet the index requirements and obtain the final underwater image enhancement model based on cascaded correction and multi-scale fusion.
[0012] Compared with the prior art, the beneficial effects of the present invention are: This invention discloses an improved defogging module. This module improves the quadtree search scoring criterion by introducing a frequency domain saliency analysis method, enabling precise location and selection of the optimal background light region, effectively avoiding color distortion caused by background light estimation bias in existing methods. Simultaneously, it employs multi-scale dark channel fusion combined with channel attenuation ratios to calculate the transmittance of each channel, significantly improving the accuracy of transmittance estimation in complex underwater environments. This defogging module achieves effective defogging in complex underwater environments.
[0013] This invention discloses an improved color correction module. This module introduces a color compensation enhancement coefficient, using the green channel color information as a benchmark to calculate the color compensation intensity of the red and blue channels. Then, it calculates the green channel color compensation intensity based on the red and blue channel color compensation intensities, effectively solving the color distortion problem caused by wavelength-dependent absorption of light in underwater environments. Furthermore, an adaptive white balance algorithm is employed to dynamically stretch each color channel, ultimately achieving a color enhancement effect for underwater images with uniform color and clear details.
[0014] This invention discloses an improved contrast and detail enhancement module. This module enhances underwater image contrast in Lab space by introducing RGF filtering to improve the CLAHE algorithm, effectively suppressing noise amplification while accurately preserving the image's edge structure information. Simultaneously, it employs an adaptive unsharpened mask algorithm combined with guided filtering to construct a high-frequency component extractor, which dynamically adjusts the sharpening intensity according to the texture features of different regions of the image, achieving a clear, natural, and artifact-free underwater image detail enhancement effect. This invention discloses an improved weighted map extraction and normalization module. This module overcomes the limitation of existing technologies where a single indicator cannot comprehensively reflect the quality of underwater images by constructing a weighted map containing five weights: Laplacian contrast, saliency, exposure, sharpness, and saturation. It also employs PCA principal component analysis normalization to adaptively fuse the weighted maps, avoiding the subjectivity and uncertainty of preset fusion weights, and further improving detail preservation and color restoration capabilities during underwater image enhancement. Attached Figure Description
[0015] Figure 1 This is a schematic diagram of the underwater image enhancement method based on cascaded correction and multi-scale fusion of the present invention; Figure 2 This is a schematic diagram of the underwater image dehazing system based on the underwater imaging model of the present invention. Figure 3 This is a subjective comparison chart of different algorithms on the UIEB dataset. Detailed Implementation
[0016] To make the technical solution, structural features, achieved objectives and advantages of the present invention clearer, the present invention will be further described in detail below with reference to specific embodiments and accompanying drawings. It should be noted that the specific embodiments described herein are only used to explain the present invention more clearly and are not intended to limit the present invention.
[0017] Figure 1 This is a flowchart of an underwater image enhancement method based on cascaded correction and multi-scale fusion disclosed in this invention. The implementation process is as follows: Step 1: Acquire underwater images to form the first dataset; the underwater images in the first dataset can be collected through the network or captured by an underwater robot; In this embodiment, in order to better evaluate the detection effect of the underwater image enhancement method based on cascaded correction and multi-scale fusion disclosed in this invention, the publicly available UIEB dataset was used to form the first dataset; Step 2: Construct an underwater image enhancement model based on cascaded correction and multi-scale fusion. The model structure is as follows: Figure 1 As shown, the model includes an improved dehazing module, an improved color correction module, an improved contrast enhancement module, a detail enhancement module, an improved weight map extraction and normalization module, and a multi-scale decomposition and fusion module. The construction of the model further includes steps 2.1 to 2.5. Step 2.1: The improved defogging module is based on an underwater imaging model and includes two parts: improved underwater background light and transmittance solution. The underwater images in the first dataset are used as input to the improved dehazing module, and the dehazed underwater images form the second dataset. Step 2.2: The improved color correction module includes two parts: improved channel color mean guidance and adaptive white balance; The dehazed images from the second dataset are used as input to the improved color correction module, and the color-corrected underwater images form the third dataset. Step 2.3: The improved contrast enhancement module introduces RGF filtering to optimize the CLAHE algorithm and enhances the contrast of the color-corrected image in Lab space; at the same time, the detail enhancement module uses an adaptive unsharpening mask algorithm to enhance the details of the color-corrected image. The color-corrected images in the third dataset are used as input to the improved contrast enhancement module, and also as input to the detail enhancement module. The contrast-enhanced and detail-enhanced underwater images form the fourth and fifth datasets. Step 2.4: The improved weight map extraction and normalization module includes five weight maps: Laplacian contrast, saliency, exposure, sharpness, and saturation. The normalization method uses PCA normalization instead of the traditional weighted fusion method. The contrast-enhanced and detail-enhanced images in the fourth and fifth datasets are used as inputs to the improved weight map extraction and normalization module, and the normalized weight maps are used to form the sixth and seventh datasets, respectively. Step 2.5: The multi-scale decomposition and fusion module consists of a Laplace pyramid and a Gaussian pyramid; The fourth and fifth datasets are input into the Laplacian pyramid for decomposition, and the sixth and seventh datasets are input into the Gaussian pyramid for decomposition. Then, the corresponding levels of the Laplacian pyramid and the Gaussian pyramid are fused to obtain the final enhanced underwater image. Furthermore, the improved defogging module in step 2.1 is based on an underwater imaging model. The underwater imaging model needs to solve for both background light and transmittance. A schematic diagram of its structure is shown below. Figure 2 As shown, the solution method further includes steps 2.1.1 to 2.1.2; Step 2.1.1: To solve the problem of the background light being too high in the traditional dark channel prior algorithm and the background light being easily affected by foreground objects in the traditional quadtree search algorithm, the frequency domain saliency analysis method is introduced to improve the quadtree search algorithm, and the scoring criteria of the traditional quadtree search are improved. The method for solving the background light further includes steps 2.1.1.1 to 2.1.1.7. Step 2.1.1.1: To effectively separate the underwater background and underwater target, a Discrete Fourier Transform is first performed on the input image of the first dataset to transform the image from the spatial domain to the frequency domain. The low-frequency components include smooth regions and background information of the image, while the high-frequency components include texture and detail information of the image. The Discrete Fourier Transform formula is as follows: ; In equation (1), x represents the horizontal coordinate of the image; y represents the vertical coordinate of the image; gray(x,y) represents the pixel gray value at position (x,y); M represents the width of the image; N represents the height of the image; u represents the index of the frequency component in the horizontal direction; v represents the index of the frequency component in the vertical direction; -j2π is the complex sine basis function, representing waveforms of different frequencies and directions; F(u,v) represents the frequency domain diagram after Fourier transform. Step 2.1.1.2: To effectively capture low-frequency information, the frequency domain graph is centered to center low-frequency information and high-frequency information at the edges. The formula for centered spectrum is as follows: ; In equation (2), F shift (u,v) represents the frequency domain graph after the spectrum is centered; Step 2.1.1.3: Perform frequency domain analysis on the frequency domain image after spectral centering, and calculate the two basic attributes of the frequency domain information: amplitude spectrum and phase spectrum; the amplitude spectrum contains the contrast and brightness distribution information of the image, and the phase spectrum contains the structure and shape information of the image. The formulas for calculating the amplitude spectrum and phase spectrum are as follows: ; ; In equations (3) to (4), M(u,v) represents the amplitude spectrum; P(u,v) represents the phase spectrum; and ε represents the stability value. Step 2.1.1.4: To analyze the regularity of the background spectrum and the anomalous spectrum of the target, the spectral residuals are calculated. Since the amplitude spectrum of natural images is usually smoothly changing and adjacent frequencies typically have similar amplitude values, the spectral residuals are calculated to identify frequency components that do not conform to this pattern. The formula for calculating the spectral residuals is as follows: ; ; In equations (5) and (6), A(u,v) is the average amplitude value, representing the average value of M(u,v) in its local neighborhood; G 3×3 R represents a 3×3 mean filter kernel; R(u,v) represents the spectral residual. R≈0 indicates that it conforms to the pattern and may be the background, while R>0 indicates that it deviates from the pattern and may be the foreground target. Step 2.1.1.5: To map the saliency information detected in the frequency domain to a specific location in the spatial domain, inverse Fourier reconstruction is performed. The formula for calculating the reconstructed saliency map is as follows: ; In equation (7), s(x,y) represents the saliency spectrum; j represents the imaginary unit; Step 2.1.1.6: To address the issues of high-frequency noise and discontinuities in the saliency region introduced by inverse Fourier reconstruction, Gaussian smoothing and normalization are performed on the saliency spectrum. The formulas for Gaussian smoothing and normalization are as follows: ; ; In equations (8) to (9), G σ=2.5σ represents the Gaussian filter kernel; σ=2.5 represents the standard deviation of the Gaussian function; min(s) smooth ) represents the minimum pixel value in the entire saliency map; max(s) smooth ) represents the maximum pixel value in the entire saliency map; Represents the final significance map; Step 2.1.1.7: Use the quadtree search algorithm in conjunction with the obtained saliency map to determine the background light, specifically including steps 2.1.1.7.1 to 2.1.1.7.6; Step 2.1.1.7.1: Initialize the current candidate region to the entire image; Step 2.1.1.7.2: Divide the current candidate region evenly into 4 sub-regions; Step 2.1.1.7.3: Calculate the comprehensive score for each sub-region. The improved score calculation formula is as follows: ; In equation (10), μ R Indicates the average brightness of the area; σ R The standard deviation of regional brightness is represented by λ; the weighting coefficient is represented by μ. S To indicate the significance of the regional average, if μ S The higher the value, the more significant the target is in the area; Step 2.1.1.7.4: Select the region with the highest score as the candidate region for the next iteration; Step 2.1.1.7.5: If the size of the current candidate region is less than or equal to the set threshold, stop the iteration; otherwise, return to step 2.1.1.7.2 to continue the iteration. Step 2.1.1.7.6: Select the average value of the brightest 0.1% of pixels in the dark channel in the finally selected candidate area as the global background light; Step 2.1.2: The transmittance is calculated using a method based on multi-scale dark channel fusion combined with channel attenuation. The transmittance calculation method further includes steps 2.1.2.1 to 2.1.2.5. Step 2.1.2.1: To address the issue that traditional single sliding windows cannot simultaneously handle underwater image details and noise, a multi-scale dark channel calculation and fusion method is adopted. Three sliding windows of different scales (5×5, 15×15, and 25×25) are selected, and the fusion method uses arithmetic mean fusion. The multi-scale dark channel calculation formula is as follows: ; In equation (11), s represents the window size; Ω s (x) represents a local region centered at x and of size s; I c(y) represents the pixel value of color channel c at position y; Step 2.1.2.2: To mitigate the loss of edge details in underwater images caused by dehazing, the underwater image gradient is used as the weight for calculating edge details. High gradient regions represent edges and textured areas, while low gradient regions represent smooth areas. The Sobel operator is used to calculate the horizontal and vertical gradients of the image, which are then normalized to [0,1]. The gradient calculation formula is as follows: ; In equation (12), I gray Represents a grayscale image of an underwater image; S x and S y These represent the Sobel kernels in the x-direction and y-direction, respectively. Step 2.1.2.3: Perform edge protection based on the underwater image gradient to preserve more details in the edge regions. The calculation formula for transmittance map edge protection is as follows: ; ; In equations (13) to (14), Indicates the multi-scale dark channel fusion value; t base Indicates the basic transmittance; Indicates the transmittance after edge protection; Step 2.1.2.4: To address the issue of rapid red light decay and slow blue-green light decay underwater, which leads to color distortion in underwater images after defogging, the following steps will be taken: The transmittance of the red channel is used as a reference transmittance, and the transmittance of the green and blue channels is estimated by using the ratio of the attenuation coefficients. The formulas for calculating the transmittance of the green and blue channels are as follows: ; ; In equations (15) to (16), t G t R t B ρ represents the transmittance of the green, red, and blue channels, respectively; G ρ R ρ B The attenuation coefficients for green, red, and blue are shown below. Based on the inherent properties of water, the relationship between the attenuation coefficients of different color channels and wavelength and global background light is as follows: ; ; In equations (17) to (18), A R A G AB λ represents the global background light for the red, green, and blue channels, respectively; G , λ B , λ R These represent the wavelengths of the green, blue, and red channels, respectively, with values of 540nm, 450nm, and 620nm. Step 2.1.2.5: To address the issues of blocky effects and artifacts in the original transmittance map, a guided filter is used to optimize the transmittance map. The guided filter optimization formula is shown below: ; In equation (19), q i Indicates the optimized transmittance; a k b k Represents the local linear coefficients, within the window ω k constants within; I i This represents the original transmittance.
[0018] Furthermore, the improved color correction module in step 2.2 includes an improved channel-wise color mean guidance and adaptive white balance method, which further includes steps 2.2.1 to 2.2.4: Step 2.2.1: Separate the RGB image into three independent channels, and then calculate the mean of each color channel; Step 2.2.2: To address the overcompensation issue in underwater images caused by the gray world hypothesis algorithm, a color compensation intensity coefficient is introduced. A method is proposed that uses the green channel color information as a baseline to calculate the color compensation intensity of the red and blue channels, and then uses the color compensation intensity of the red and blue channels to inversely calculate the green channel color compensation intensity. The color compensation intensity calculation formula is shown below: ; ; ; In equations (20) to (22), S R S G S B These represent the compensation intensity of the three RGB channels respectively; α R α G α B These represent the enhancement compensation coefficients for the three RGB channels, set to 2.0, 2.0, and 0.3 respectively; μ R μ G μ B These represent the color mean values of the RGB three channels respectively; Step 2.2.3: Perform color compensation for each channel based on the calculated color compensation intensity. The color compensation formula is as follows: ; In equation (23), C(i,j) represents the compensated RGB three channels; C n (i,j) represents the original RGB three channels; S C Indicates color compensation intensity; G n (i,j) represents the original green channel; Step 2.2.4: Based on color channel compensation, and combined with an adaptive white balance algorithm, adjust the intensity distribution of each color channel to further correct color cast: First, calculate the brightness distribution of each color channel and crop out the overly bright and underly dark parts according to the set percentage; Then, the remaining portion is linearly stretched to the range of 0~255 to obtain the color-compensated underwater image. The linear stretching formula is as follows: ; In equation (24), C old (x,y) represents the pixel value of the original image at position (x,y); v min This represents the minimum value obtained by percentage cropping; v max This represents the maximum value obtained through percentage cropping; C new (x,y) represents the image after linear stretching.
[0019] Furthermore, the improved contrast and detail enhancement module in step 2.3 includes an improved CLAHE algorithm and an adaptive unsharpening mask algorithm, wherein the algorithm further includes steps 2.3.1 to 2.3.2; Step 2.3.1: To address the issues of unnatural color transitions, block artifacts, and amplified underwater noise in the enhanced image caused by the traditional CLAHE algorithm in RGB space enhancement, RGF filtering and enhancement in Lab space are introduced. The method further includes steps 2.3.1.1 to 2.3.1.4. Step 2.3.1.1: Convert the RGB image to the Lab color space; Step 2.3.1.2: Perform contrast enhancement on the L channel using the CLAHE algorithm; Step 2.3.1.3: Introduce RGF filtering to guide optimization of the enhanced image. RGF filtering iteratively performs edge-preserving filtering on the image, using the output of the previous iteration as guidance in each iteration. The filter guidance optimization formula is as follows: ; In equation (25), G t (x) represents the output of the t-th iteration; I(y) represents the brightness of the input image; fs (||xy||) represents the spatial weight; f r (|I(y)-G t (x)|), representing the intensity difference weight; W(x) represents the normalization coefficient; Ω=max(3,2×σ) S +1) indicates the size of the filter window; Step 2.3.1.4: Merge the enhanced luminance channel L, the original a and b channels, and then convert it back to an RGB image to achieve underwater image contrast enhancement; Step 2.3.2: The adaptive unsharpened mask algorithm further includes steps 2.3.2.1 to 2.3.2.3; Step 2.3.2.1: Calculate and normalize the local coefficient of variation. The formula for calculating the local coefficient of variation is as follows: ; In equation (26), x c This represents the pixel value of channel c at position x. ; and d c (m,n) represent the mean and standard deviation of the pixel at position (m,n) in channel c within a 3×3 neighborhood, respectively; CV c (m,n) represents the coefficient of variation of the pixel at position (m,n) in channel c; The normalization calculation formula is as follows: ; In equation (27), f c (m,n) represents the normalized coefficient of variation; max{CV R ,CV G ,CV B} represents the maximum value of the three-channel coefficient of variation; Step 2.3.2.2: Calculate the adaptive enhancement amplitude. Divide the range of the normalized coefficient of variation into four regions: [0, 0.25], [0.25, 0.5], [0.5, 0.75], and [0.75, 1], representing the four regions of image flatness, detail, edge, and noise, respectively. The adaptive enhancement amplitude adopts a piecewise continuous function, and the formula for the adaptive enhancement amplitude is as follows: ; In equation (28), ;λ max f represents the maximum gain coefficient; c Indicates the normalized coefficient of variation; Step 2.3.2.3: Use guided filtering to process the original image to obtain the low-frequency components. Then, subtract the low-frequency components from the original image to obtain the high-frequency components, and add them back to the original image according to an adaptive enhancement magnitude. The detail enhancement formula is as follows: ; In equation (29), This represents the enhanced image; This represents the image after color correction by the color correction module; G represents guided filtering; λ c This indicates the adaptive enhancement magnitude.
[0020] Furthermore, the improved weight map extraction and normalization module in step 2.4 extracts five weight maps from the contrast enhancement map and the detail enhancement map respectively and normalizes them. The method further includes steps 2.4.1 to 2.4.6. Step 2.4.1: Laplacian contrast weights. Global contrast is estimated by performing convolution filtering on the luminance channel of the image using a Laplacian filter in the Lab color space. The formula for calculating the Laplacian contrast weights is as follows: ; In equation (30), W represents the Laplace filter value. L Indicates the Laplacian contrast weight; Step 2.4.2: Saliency Weighting. By enhancing the contrast between bright and dark areas, targets with low recognition rates in underwater scenes are highlighted. This weighting combines color and brightness features to calculate salient regions in the image. The saliency weighting calculation formula is as follows: ; In equation (31), L, a, and b are the three channels of the Lab space; W S Indicates significance weight; Step 2.4.3: Exposure weighting. By increasing the proportion of highly visible areas in the fused image, the pixels in the image are all in a well-exposed state to retain more detailed information. The exposure weighting calculation formula is as follows: ; In equation (32), I is the normalized value of the image pixels; σ is the standard deviation of the exposure; W E Indicates exposure weight; Step 2.4.4: Sharpness weight, used to enhance the sharpness of underwater images and reduce the impact of blurred areas. The formula for calculating the sharpness weight is as follows: ; In equation (33), This is the image brightness channel after high-pass filtering; W sharp Indicates the sharpness weight; Step 2.4.5: Saturation weighting. This step uses the deviation between the color channel and the luminance channel to calculate and assign a larger weight to pixels with high saturation intensity in the image to preserve and emphasize the color information in the input image. The formula for calculating saturation weighting is as follows: ; In equation (34), μ represents the color value of pixel (i,j) in channel k. i Indicates image brightness; W sat (i,j) represents the saturation weight; Step 2.4.6: To address the problem that the traditional weighted fusion normalization method cannot reasonably and dynamically allocate weights, the PCA normalization method is used to replace the traditional weighted fusion method to normalize the five weight maps extracted above, thus obtaining their respective normalized weight maps.
[0021] Furthermore, the multi-scale decomposition and fusion module in step 2.5 inputs the contrast enhancement map and detail enhancement map into the Laplacian pyramid for decomposition, inputs the contrast normalized weight map and detail normalized weight map into the Gaussian pyramid for decomposition, and then fuses the corresponding levels of the Laplacian pyramid and the Gaussian pyramid to form a new Laplacian pyramid. The fusion formula is as follows: ; In equation (35), W k,l L represents the l-th level of the weighted Gaussian pyramid of the k-th image; k,l This represents the l-th layer of the Laplacian pyramid in the k-th image. Starting from the highest layer of the fusion pyramid, the superposition of adjacent layers is achieved by interpolation and magnification from top to bottom, thus obtaining the final underwater image enhancement map.
[0022] Step 3: Input the underwater images from the first dataset into the model, and perform subjective evaluation and objective evaluation index evaluation on the enhanced underwater images, specifically including steps 3.1 to 3.2; Step 3.1: Objective evaluation metrics include underwater color image quality assessment (UCIQE), information entropy (IE), structural similarity (SSIM), and fog perception density estimation (FADE). The calculation formulas for each evaluation metric are as follows: ; ; ; ; In equations (36) to (39), σ c Indicates the standard deviation of chromaticity, con l Indicates brightness contrast, μc c represents the average saturation value, and c1, c2, and c3 represent weighting coefficients, which are 0.4680, 0.2745, and 0.2576, respectively; p i μ represents the probability of a pixel with grayscale value i appearing; x and y represent images of the same dimension. x and μ y This represents the mean of x and y. and σ represents the variance of x and y. x σ y D represents the covariance between x and y, where a1 and a2 are constants; fog D represents the Mahalanobis distance between the fog-perceiving features of the test image and the fog-perceiving features of the MVG model extracted from a large number of fog images; fog-free The Mahalanobis distance represents the fog-perceived features of the test image and the fog-perceived features of the MVG model extracted from a large number of fog-free images. Step 3.2: Perform subjective and objective evaluations on the enhanced underwater image to meet the index requirements and obtain the final underwater image enhancement model based on cascaded correction and multi-scale fusion.
[0023] In this embodiment, to verify the effectiveness of the recognition model disclosed in this invention, MLLE, MIP, ULAP, RGHS, UDnet, and USUIR methods were compared with the underwater image enhancement model based on cascaded correction and multi-scale fusion disclosed in this invention on the UIEB dataset. Eight images from the UIEB dataset were selected for comparison. The objective evaluation results are shown in Tables 1 to 4, and the subjective evaluation results are as follows: Figure 3 As shown; Table 1 Comparison of UCIQE Indicators for Different Methods ; Table 2 Comparison of IE metrics using different methods ; Table 3 Comparison of SSIM metrics for different methods ; Table 4 Comparison of FADE indices for different methods ; As shown in Tables 1 to 4, the method disclosed in this invention achieves the best enhancement effect on the UIEB dataset compared to other methods, and exhibits significant superiority in most evaluation metrics across the majority of images; Figure 3 It is evident that the method disclosed in this invention exhibits superior performance in terms of defogging effect, color correction accuracy, contrast enhancement, and detail enhancement, thereby significantly improving the visual quality of underwater images.
[0024] The above description is merely one embodiment of the present invention and does not limit the scope of protection of the present invention. For those skilled in the art, the present invention can have various modifications and variations. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. An underwater image enhancement method based on cascaded correction and multi-scale fusion, characterized in that, Specifically, the following steps are included: Step 1: Acquire underwater images to form the first dataset; the images in the first dataset can be collected through the network or captured by an underwater robot; Step 2: Construct an underwater image enhancement model based on cascaded correction and multi-scale fusion. The model includes an improved dehazing module, an improved color correction module, an improved contrast and detail enhancement module, an improved weight map extraction and normalization module, and a multi-scale decomposition and fusion module. The construction of the model further includes steps 2.1 to 2.
5. Step 2.1: The improved defogging module is based on an underwater imaging model and includes two parts: improved underwater background light and transmittance solution. The first dataset is used as input to the improved dehazing module, and the dehazed underwater images form the second dataset; Step 2.2: The improved color correction module includes two parts: improved channel color mean guided compensation and adaptive white balance; The second dataset is used as input to the improved color correction module, and the underwater images processed by the improved color correction module form the third dataset. Step 2.3: The improved contrast and detail enhancement module enhances the contrast of the images in the third dataset using the improved CLAHE algorithm in Lab space; simultaneously, the detail enhancement module enhances the details of the images in the third dataset using an adaptive unsharpening mask algorithm. The third dataset is used as input to the improved contrast and detail enhancement module, and the underwater images after contrast enhancement and detail enhancement are used to form the fourth and fifth datasets, respectively. Step 2.4: In the improved weighted graph extraction and normalization module, the weighted graph extraction includes five weighted graphs: Laplacian contrast, saliency, exposure, sharpness, and saturation. The normalization adopts the PCA normalization method instead of the traditional weighted fusion method. The fourth and fifth datasets are used as inputs to the improved weight graph extraction and normalization module, and the normalized weight graphs form the sixth and seventh datasets, respectively. Step 2.5: The multi-scale decomposition and fusion module consists of a Laplace pyramid and a Gaussian pyramid; The fourth and fifth datasets are input into the Laplacian pyramid for decomposition, and the sixth and seventh datasets are input into the Gaussian pyramid for decomposition. Then, the corresponding levels of the Laplacian pyramid and the Gaussian pyramid are fused to obtain the final enhanced underwater image. Step 3: Subjectively evaluate and objectively evaluate the enhanced underwater image to ensure it meets the requirements and obtain the final underwater image enhancement model based on cascaded correction and multi-scale fusion.
2. The underwater image enhancement method based on cascaded correction and multi-scale fusion according to claim 1, characterized in that, The improved defogging module in step 2.1 is based on an underwater imaging model to achieve defogging. The underwater imaging model needs to solve for two parts: background light and transmittance. The solution method further includes steps 2.1.1 to 2.1.2: Step 2.1.1: The solution for the background light introduces a frequency domain saliency analysis method to improve the scoring criteria of the traditional quadtree search. The solution method for the background light further includes steps 2.1.1.1 to 2.1.1.
7. Step 2.1.1.1: To effectively separate the underwater background and underwater target, a Discrete Fourier Transform is first performed on the input image to transform it from the spatial domain to the frequency domain. The low-frequency components include smooth regions and background information, while the high-frequency components include texture and detail information. The Discrete Fourier Transform formula is as follows: ; In equation (1), x represents the horizontal coordinate of the image; y represents the vertical coordinate of the image; gray(x,y) represents the pixel gray value at position (x,y); M represents the width of the image; N represents the height of the image; u represents the index of the frequency component in the horizontal direction; v represents the index of the frequency component in the vertical direction; -j2π is the complex sine basis function, representing waveforms of different frequencies and directions; F(u,v) represents the frequency domain diagram after Fourier transform. Step 2.1.1.2: To effectively capture low-frequency information, the frequency domain graph is centered to center low-frequency information and high-frequency information at the edges. The formula for centered spectrum is as follows: ; In equation (2), F shift (u,v) represents the frequency domain graph after the spectrum is centered; Step 2.1.1.3: Perform frequency domain analysis on the frequency domain image after spectral centering, and calculate the two basic attributes of the frequency domain information: amplitude spectrum and phase spectrum; the amplitude spectrum contains the contrast and brightness distribution information of the image, and the phase spectrum contains the structure and shape information of the image. The formulas for calculating the amplitude spectrum and phase spectrum are as follows: ; ; In equations (3) to (4), M(u,v) represents the amplitude spectrum; P(u,v) represents the phase spectrum; and ε represents the stability value. Step 2.1.1.4: To analyze the regularity of the background spectrum and the anomalous spectrum of the target, the spectral residuals are calculated. Based on the fact that the amplitude spectrum of natural images is usually smoothly changing and adjacent frequencies often have similar amplitude values, the spectral residuals are calculated to identify frequency components that do not conform to the above patterns. The formula for calculating the spectral residuals is as follows: ; ; In equations (5) and (6), A(u,v) is the average amplitude value, representing the average value of M(u,v) in its local neighborhood; G 3×3 R represents a 3×3 mean filter kernel; R(u,v) represents the spectral residual. R≈0 indicates that it conforms to the pattern and may be the background, while R>0 indicates that it deviates from the pattern and may be the foreground target. Step 2.1.1.5: To map the saliency information detected in the frequency domain to a specific location in the spatial domain, inverse Fourier reconstruction is performed. The formula for calculating the reconstructed saliency map is as follows: ; In equation (7), s(x,y) represents the saliency spectrum; j represents the imaginary unit; Step 2.1.1.6: To address the issues of high-frequency noise and discontinuities in the saliency region introduced after inverse Fourier reconstruction, Gaussian smoothing and normalization are performed on the saliency spectrum. The formulas for Gaussian smoothing and normalization are as follows: ; ; In equations (8) to (9), G σ=2.5 σ represents the Gaussian filter kernel; σ=2.5 represents the standard deviation of the Gaussian function; min(s) smooth ) represents the minimum pixel value in the entire saliency map; max(s) smooth () represents the maximum pixel value in the entire saliency map; Represents the final significance map; Step 2.1.1.7: Use the quadtree search algorithm in conjunction with the obtained saliency map to determine the background light, specifically including steps 2.1.1.7.1 to 2.1.1.7.6; Step 2.1.1.7.1: Initialize the current candidate region to the entire image; Step 2.1.1.7.2: Divide the current candidate region evenly into 4 sub-regions; Step 2.1.1.7.3: Calculate the comprehensive score for each sub-region. The improved score calculation formula is as follows: ; In equation (10), μ R Indicates the average brightness of the area; σ R The standard deviation of regional brightness is represented by λ; the weighting coefficient is represented by μ. S To indicate the significance of the regional average, if μ S The higher the value, the more significant the target is in the area; Step 2.1.1.7.4: Select the region with the highest score as the candidate region for the next iteration; Step 2.1.1.7.5: If the size of the current candidate region is less than or equal to the set threshold, stop the iteration; otherwise, return to step 2.1.1.7.2 to continue the iteration. Step 2.1.1.7.6: Select the average value of the brightest 0.1% of pixels in the dark channel in the finally selected candidate area as the global background light; Step 2.1.2: The transmittance is calculated using a method based on multi-scale dark channel fusion combined with channel attenuation. The solution method further includes steps 2.1.2.1 to 2.1.2.
5. Step 2.1.2.1: To address the issue that traditional single sliding windows cannot simultaneously handle underwater image details and noise, a multi-scale dark channel calculation and fusion method is adopted. Three sliding windows of different scales (5×5, 15×15, and 25×25) are selected, and the fusion method uses arithmetic mean fusion. The multi-scale dark channel calculation formula is as follows: ; In equation (11), s represents the window size; Ω s (x) represents a local region centered at x and of size s; I c (y) represents the pixel value of color channel c at position y; Step 2.1.2.2: To mitigate the loss of edge details in underwater images caused by dehazing, the underwater image gradient is used as the weight for calculating edge details. High gradient regions represent edges and textured areas, while low gradient regions represent smooth areas. The Sobel operator is used to calculate the horizontal and vertical gradients of the image, which are then normalized to [0,1]. The gradient calculation formula is as follows: ; In equation (12), I gray Represents a grayscale image of an underwater image; S x and S y These represent the Sobel kernels in the x-direction and y-direction, respectively. Step 2.1.2.3: Perform edge protection based on the underwater image gradient to preserve more details in the edge regions. The calculation formula for transmittance map edge protection is as follows: ; ; In equations (13) to (14), Indicates the multi-scale dark channel fusion value; t base Indicates the basic transmittance; Indicates the transmittance after edge protection; Step 2.1.2.4: To address the issue of rapid red light decay and slow blue-green light decay underwater, which leads to color distortion in underwater images after defogging, the following steps will be taken: The transmittance of the red channel is used as a reference transmittance, and the transmittance of the green and blue channels is estimated by using the ratio of the attenuation coefficients. The formulas for calculating the transmittance of the green and blue channels are as follows: ; ; In equations (15) to (16), t G t R t B ρ represents the transmittance of the green, red, and blue channels, respectively; G ρ R ρ B The attenuation coefficients for green, red, and blue are shown below. Based on the inherent properties of water, the relationship between the attenuation coefficients of different color channels and wavelength and global background light is as follows: ; ; In equations (17) to (18), A R A G A B λ represents the global background light for the red, green, and blue channels, respectively; G , λ B , λ R These represent the wavelengths of the green, blue, and red channels, respectively. Step 2.1.2.5: To address the issues of blocky effects and artifacts in the original transmittance map, a guided filter is used to optimize the transmittance map. The guided filter optimization formula is shown below: ; In equation (19), q i Indicates the optimized transmittance; a k b k Represents the local linear coefficients, within the window ω k constants within; I i This represents the original transmittance.
3. The underwater image enhancement method based on cascaded correction and multi-scale fusion according to claim 1, characterized in that, The improved color correction module in step 2.2 includes an improved channel-wise color mean guidance and adaptive white balance method, which further includes steps 2.2.1 to 2.2.4: Step 2.2.1: Separate the RGB image into three independent channels, and then calculate the mean of each color channel; Step 2.2.2: Introduce a color compensation intensity coefficient. Using the color information of the green channel as a reference, calculate the color compensation intensity of the red and blue channels. Then, use the color compensation intensity of the red and blue channels to calculate the color compensation intensity of the green channel in reverse. The color compensation intensity calculation formula is shown below: ; ; ; In equations (20) to (22), S R S G S B These represent the compensation intensity of the three RGB channels respectively; α R α G α B These represent the enhancement compensation coefficients for the three RGB channels; μ R μ G μ B These represent the color mean values of the RGB three channels respectively; Step 2.2.3: Perform color compensation for each channel based on the calculated color compensation intensity. The color compensation formula is as follows: ; In equation (23), C(i,j) represents the compensated RGB three channels; C n (i,j) represents the original RGB three channels; S C Indicates color compensation intensity; G n (i,j) represents the original green channel; Step 2.2.4: Based on color channel compensation, and combined with an adaptive white balance algorithm, adjust the intensity distribution of each color channel to further correct color cast: First, calculate the brightness distribution of each color channel and crop out the overly bright and underly dark parts according to the set percentage; Then, the remaining portion is linearly stretched to the range of 0~255 to obtain the color-compensated underwater image. The linear stretching formula is as follows: ; In equation (24), C old (x,y) represents the pixel value of the original image at position (x,y); v min This represents the minimum value obtained by percentage cropping; v max This represents the maximum value obtained through percentage cropping; C new (x,y) represents the image after linear stretching.
4. The underwater image enhancement method based on cascaded correction and multi-scale fusion according to claim 1, characterized in that, The improved contrast and detail enhancement module in step 2.3 includes an improved CLAHE algorithm and an adaptive unsharpening mask algorithm, the algorithm further including steps 2.3.1 to 2.3.2; Step 2.3.1: The improved CLAHE algorithm, the method further includes steps 2.3.1.1 to 2.3.1.4: Step 2.3.1.1: Convert the RGB image to the Lab color space; Step 2.3.1.2: Perform contrast enhancement on the L channel using the CLAHE algorithm; Step 2.3.1.3: Introduce RGF filtering to guide optimization of the enhanced image. RGF filtering iteratively performs edge-preserving filtering on the image, using the output of the previous iteration as guidance in each iteration. The filter guidance optimization formula is as follows: ; In equation (25), G t+1 (x) represents the output of the (t+1)th iteration; G t (x) represents the output of the t-th iteration; I(y) represents the brightness of the input image; f s (||xy||) represents the spatial weight; f r (|I(y)-G t (x)|), representing the intensity difference weight; W(x) represents the normalization coefficient; Ω=max(3,2×σ) S +1), which represents the size of the filter window; Step 2.3.1.4: Merge the enhanced luminance channel L, the original a and b channels, and then convert it back to an RGB image to achieve underwater image contrast enhancement; Step 2.3.2: The adaptive unsharpened mask algorithm further includes steps 2.3.2.1 to 2.3.2.3; Step 2.3.2.1: Calculate and normalize the local coefficient of variation. The formula for calculating the local coefficient of variation is as follows: ; In equation (26), x c This represents the pixel value of channel c at position x. ; and d c (m,n) represent the mean and standard deviation of the pixel at position (m,n) in channel c within a 3×3 neighborhood, respectively; CV c (m,n) represents the coefficient of variation of the pixel at position (m,n) in channel c; The normalization formula is as follows: ; In equation (27), f c (m,n) represents the normalized coefficient of variation; max{CV R ,CV G ,CV B } represents the maximum value of the three-channel coefficient of variation; Step 2.3.2.2: Calculate the adaptive enhancement amplitude. Divide the range of the normalized coefficient of variation into four regions: [0, 0.25], [0.25, 0.5], [0.5, 0.75], and [0.75, 1], representing the four regions of image flatness, detail, edge, and noise, respectively. The adaptive enhancement amplitude adopts a piecewise continuous function, and the formula for the adaptive enhancement amplitude is as follows: ; In equation (28), ;λ max f represents the maximum gain coefficient; c λ represents the normalized coefficient of variation; c (m,n) represents the adaptive enhancement magnitude; Step 2.3.2.3: Use guided filtering to process the original image to obtain the low-frequency components. Then, subtract the low-frequency components from the original image to obtain the high-frequency components, and add them back to the original image according to an adaptive enhancement magnitude. The detail enhancement formula is as follows: ; In equation (29), This represents the enhanced image; This represents the image after color correction by the color correction module; G represents guided filtering; λ c This indicates the adaptive enhancement magnitude.
5. The underwater image enhancement method based on cascaded correction and multi-scale fusion according to claim 1, characterized in that, The improved weight map extraction and normalization module in step 2.4 extracts five weight maps from the contrast enhancement map and the detail enhancement map respectively and normalizes them. The method further includes steps 2.4.1 to 2.4.
6. Step 2.4.1: Laplacian contrast weights. Global contrast is estimated by performing convolution filtering on the luminance channel of the image using a Laplacian filter in the Lab color space. The formula for calculating the Laplacian contrast weights is as follows: ; In equation (30), W represents the Laplace filter value. L Indicates the Laplacian contrast weight; Step 2.4.2: Saliency Weighting. By enhancing the contrast between bright and dark areas, targets with low recognition rates in underwater scenes are highlighted. This weighting combines color and brightness features to calculate salient regions in the image. The saliency weighting calculation formula is as follows: ; In equation (31), L, a, and b are the three channels of the Lab space; W S Indicates significance weight; Step 2.4.3: Exposure weighting. By increasing the proportion of highly visible areas in the fused image, the pixels in the image are all in a well-exposed state to retain more detailed information. The exposure weighting calculation formula is as follows: ; In equation (32), I is the normalized value of the image pixels; σ is the standard deviation of the exposure; W E Indicates exposure weight; Step 2.4.4: Sharpness weight, used to enhance the sharpness of underwater images and reduce the impact of blurred areas. The formula for calculating the sharpness weight is as follows: ; In equation (33), This is the image brightness channel after high-pass filtering; W sharp Indicates the sharpness weight; Step 2.4.5: Saturation weighting. This step uses the deviation between the color channel and the luminance channel to calculate and assign a larger weight to pixels with high saturation intensity in the image to preserve and emphasize the color information in the input image. The formula for calculating saturation weighting is as follows: ; In equation (34), μ represents the color value of pixel (i,j) in channel k. i Indicates image brightness; W sat (i,j) represents the saturation weight; Step 2.4.6: To address the problem that the traditional weighted fusion normalization method cannot reasonably and dynamically allocate weights, the PCA normalization method is used to replace the traditional weighted fusion method to normalize the five weight maps extracted above, thus obtaining their respective normalized weight maps.
6. The underwater image enhancement method based on cascaded correction and multi-scale fusion according to claim 1, characterized in that, The multi-scale decomposition and fusion module in step 2.5 inputs the contrast enhancement map and detail enhancement map into the Laplacian pyramid for decomposition, and inputs the contrast normalized weight map and detail normalized weight map into the Gaussian pyramid for decomposition. Then, the corresponding levels of the Laplacian pyramid and the Gaussian pyramid are fused to form a new Laplacian pyramid. The fusion formula is as follows: ; In equation (35), W k,l L represents the l-th level of the weighted Gaussian pyramid of the k-th image; k,l This represents the l-th layer of the Laplacian pyramid in the k-th image. Starting from the highest layer of the fusion pyramid, the superposition of adjacent layers is achieved by interpolation and magnification from top to bottom, thus obtaining the final underwater image enhancement map.
7. The underwater image enhancement method based on cascaded correction and multi-scale fusion according to claim 1, characterized in that, Step 3 further includes steps 3.1 to 3.2; Step 3.1: Objective evaluation metrics include underwater color image quality assessment (UCIQE), information entropy (IE), structural similarity (SSIM), and fog perception density estimation (FADE). The calculation formulas for each evaluation metric are as follows: ; ; ; ; In equations (36) to (39), σ c Indicates the standard deviation of chromaticity, con l Indicates brightness contrast, μ c c1, c2, and c3 represent the average saturation value, and c1, c2, and c3 represent the weighting coefficients; p i μ represents the probability of a pixel with grayscale value i appearing; x and y represent images of the same dimension. x and μ y This represents the mean of x and y. and σ represents the variance of x and y. x σ y D represents the covariance between x and y, where a1 and a2 are constants; fog D represents the Mahalanobis distance between the fog-perceiving features of the test image and the fog-perceiving features of the MVG model extracted from a large number of fog images; fog-free The Mahalanobis distance represents the fog-perceived features of the test image and the fog-perceived features of the MVG model extracted from a large number of fog-free images. Step 3.2: Perform subjective and objective evaluations on the enhanced underwater image to meet the index requirements and obtain the final underwater image enhancement model based on cascaded correction and multi-scale fusion.