An underwater image enhancement method, system and device incorporating an attenuation channel correction
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGZHOU MARITIME INST
- Filing Date
- 2025-01-14
- Publication Date
- 2026-05-12
AI Technical Summary
Existing underwater image enhancement methods do not fully consider image noise, resulting in mediocre enhancement effects and difficulty in adapting to complex underwater environments.
White balance technology is used for color correction. Combined with local block nonlocal mean denoising algorithm and adaptive stretching method, the image is enhanced by bilateral weight fusion strategy to highlight details and edge texture.
It effectively enhances underwater image quality, highlights details and edge textures, improves color distortion, low contrast and noise issues, and adapts to complex underwater environments.
Smart Images

Figure CN119991479B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the technical field of underwater image processing, and specifically to an underwater image enhancement method, system, and device that combines attenuation channel correction. Background Technology
[0002] In recent years, underwater imaging has played a crucial role in underwater vehicles, deep-sea exploration, and underwater target identification. Underwater images are an important information carrier for acquiring marine resource information. However, due to the complex and diverse underwater imaging environment, coupled with wavelength-dependent light absorption and scattering, underwater images suffer from problems such as color deviation, low contrast, and blurred details.
[0003] Specifically, when light travels through water, it undergoes varying degrees of attenuation. Generally, blue and green light travel relatively well in water, while red light and other wavelengths are more easily absorbed. Therefore, the light reflected from underwater objects contains a relatively high proportion of blue-green components, resulting in a distinctive blue-green appearance in underwater images. Simultaneously, particles and suspended matter in the aquatic medium cause light scattering, leading to light diverging in multiple directions. This ultimately reduces the contrast of underwater images, impairing the overall image quality.
[0004] Existing technologies for improving underwater image quality mainly focus on four areas: hardware-based, restoration-based, deep learning-based, and enhancement-based approaches. However, due to the instability of the aquatic environment and the high cost of equipment, hardware-based improvements are difficult and expensive. Restoration-based methods are limited by their inability to adapt to complex underwater environments and their heavy reliance on prior knowledge and parameter selection. Deep learning-based methods suffer from limited generalization ability, complex parameter settings, and high computational complexity.
[0005] Compared with the three methods mentioned above, enhancement-based improvements have the advantages of being easy to implement and highly efficient. However, enhancement-based methods are difficult to fully address various problems in underwater images, which can easily lead to over-enhancement or under-enhancement in the enhanced images.
[0006] For example, Chinese patent application number "202310657636.2" discloses "a multi-scale fusion underwater image enhancement method combining adaptive gamma correction." This method performs color correction and contrast enhancement on the image through white balance and adaptive gamma correction, respectively, and then uses a fusion algorithm to obtain the final enhanced image. While this method can perform color correction and contrast enhancement on the original image, it does not consider the noise present in the original image. Therefore, the final enhanced image lacks detail due to the presence of noise.
[0007] In summary, existing underwater image enhancement methods do not adequately consider image noise, resulting in mediocre enhancement effects. Summary of the Invention
[0008] To address the problems existing in the prior art, the present invention aims to provide an underwater image enhancement method, system, and device that combines attenuation channel correction. The present invention corrects the color of the original image using white balance technology to solve the color cast problem. It employs a fast nonlocal mean algorithm based on local blocks to denoise the color-corrected image, while simultaneously using an adaptive stretching method based on histogram local features to enhance contrast. Finally, a bilateral weighted fusion strategy is introduced to combine the complementary advantages of the denoised image and the contrast-enhanced image, effectively enhancing the underwater image while highlighting image details and edge textures.
[0009] The underwater image enhancement method combining attenuation channel correction according to the present invention includes the following steps:
[0010] S01. Obtain the original image, perform white balance processing on the original image to perform color correction, and obtain the color-corrected image as the first enhanced image I1;
[0011] S02. The first enhanced image I1 is processed by a nonlocal mean denoising algorithm to obtain a denoised image, which is denoised as the second enhanced image I2. The contrast of the first enhanced image I1 is enhanced by an adaptive stretching method to obtain a contrast-enhanced image, which is denoted as the third enhanced image I3.
[0012] S03. Calculate and obtain the saliency weight map, contrast weight map, and gradient weight map for the second enhanced map I2, and perform weight normalization processing to obtain the first normalized weight map; calculate and obtain the saliency weight map, noise weight map, and gradient weight map for the third enhanced map I3, and perform weight normalization processing to obtain the second normalized weight map.
[0013] S04. Decompose the second enhanced image I2 and the third enhanced image I3 into Laplacian pyramid structures, and decompose the first normalized weight image and the second normalized weight image into Gaussian pyramid structures. Perform bilateral weight fusion on the decomposed Laplacian pyramid structure and Gaussian pyramid structure to obtain the enhanced image.
[0014] Preferably, step S01 includes the following steps:
[0015] S011. Calculate the index parameters of the RGB channels of the original image according to the following formula, wherein the index parameters include information entropy H, interval length DR, and average difference ADD:
[0016]
[0017] ADD c = (|n2-n1|+|n3-n2|+…+|ni+1 -n i |) / L,
[0018] Where c = R or G or B, H c This represents the information entropy of channel c. This represents the probability of the i-th pixel level in channel c;
[0019] DR c The n represents the length of the interval where the number of pixels in the c channel is greater than or equal to μ. i Min(n) represents the number of pixels at the i-th pixel level. i ≥μ) and max(n i ≥μ) respectively represent when n i The minimum and maximum values of i when ≥μ, where L represents the total number of pixels;
[0020] ADD c This represents the average difference in the c channel;
[0021] S012. Assign weights to the index parameters and construct compensation parameters cp for each channel in the original image:
[0022] cp c =δ H H c +δ DR DR c +δ ADD (1 / ADD c ),
[0023] Among them, cp c δ represents the compensation parameter for channel c. H δ DR and δ ADD These represent the weighting coefficients for information entropy H, interval length DR, and average difference ADD, respectively.
[0024] S013. Sort the RGB channels according to the value of the obtained compensation parameter cp, and record them in descending order of value as: First channel C first Second Channel C second and the third channel C third Based on the compensation parameters cp of each channel obtained c Assign values to each channel, and construct compensation factors and compensation formulas based on the sorting and assignment results:
[0025]
[0026] Where cf1 and cf2 represent the first compensation factor and the second compensation factor, respectively, and C′ second and C′ thirdThese represent the compensated second and third channels, respectively.
[0027] S014. The compensated image is processed by the grayscale world algorithm to obtain the first enhanced image I1 after color correction.
[0028] Preferably, in step S02, the first enhanced image I1 is processed by a non-local means denoising algorithm to obtain a denoised image, denoted as the second enhanced image I2, which specifically includes the following steps:
[0029] S021a. Read the first enhanced image I1 and define the length of the local block as p and the width as q.
[0030] S022a. Initialize an image of the same size as the first enhanced image I1 and record it as a blank image;
[0031] S023a. Calculate the similarity weight within the local block using the following formula:
[0032]
[0033] Where w(i,j,m,n) represents the similarity weight between the target pixel (i,j) and the similar pixel (m,n), I(i,j) represents the pixel value of the target pixel (i,j) in the local block, I(m,n) represents the pixel value of the similar pixel (m,n) in the local block, and h is a weight parameter that controls the degree of influence of the similarity weight.
[0034] S024a. Calculate the weighted average of similar pixels within a local block based on the similarity weight to obtain the denoising result FNLM(i,j):
[0035]
[0036] S025a. Read the three channels R, G, and B in parallel, and calculate the denoising result FNLM(i,j) for each channel. Store the denoising result FNLM(i,j) for each channel in the blank image to obtain the second enhanced image I2.
[0037] Preferably, in step S02, the contrast of the first enhanced image I1 is enhanced by an adaptive stretching method to obtain an image with enhanced contrast, denoted as the third enhanced image I3. This specifically includes the following steps:
[0038] S021b: Read the RGB channel histogram of the first enhanced image I1, and calculate the exposure value and exposure threshold of the obtained RGB channel histogram:
[0039]
[0040] ET = (1-EX)(MAX-MIN)+MIN,
[0041] Where EX represents the exposure value and ET represents the exposure threshold, ET is used as the dividing point to divide the RGB channel histogram into two sub-histograms: a first sub-histogram and a second sub-histogram. The first sub-histogram is distributed in the underexposure region [MIN, ET], and the second sub-histogram is distributed in the overexposure region [ET, MAX]. i represents the number of pixels at the i-th pixel level, and μ represents the pixel number threshold;
[0042] S022b. The median of the RGB channel histogram is used as the cropping threshold to crop the first sub-histogram and the second sub-histogram. The portion with a total number of pixels greater than the cropping threshold is cropped, while the portion with a total number of pixels less than or equal to the cropping threshold remains unchanged. The cropped total number of pixels is redistributed throughout the entire range of the sub-histogram, preserving image information. The calculation formula for the cropping process is as follows:
[0043]
[0044] Where Hist(i) represents the cropped sub-histogram, Q represents the total number of cropped pixels, M represents the median of the sub-histogram, and l represents the interval length of the sub-histogram;
[0045] S023b. Based on the ratio of interval lengths of the sub-histograms before and after stretching, construct a stretching factor, and obtain the stretched sub-histogram according to the proportional stretching rule:
[0046]
[0047] Where, θ low and θ high Hist′ represents the stretching factor of the first sub-histogram and the second sub-histogram, respectively. low (i) and Hist′ high (i) represent the stretched sub-histograms, with the corresponding stretching ranges being [0, ET] and [ET, L], respectively;
[0048] S024b. Combine the two sub-histograms after stretching to obtain the image with enhanced contrast, which is the third enhanced image I3.
[0049] Preferably, step S03 includes the following steps:
[0050] S031. Calculate the significance weights of the second enhanced graph I2 and the third enhanced graph I3 according to the following formula:
[0051] W S,k (i, j) = (Lk (i, j)-ML k ) 2 +(A k (i, j)-MA k ) 2 +(B k (i,j)-MB k ) 2 ,
[0052] Where (i, j) represents the target position, W S,k L represents the saliency weight of the k-th input image. k A k and B k These represent the lightness channel, red-green channel, and yellow-blue channel in the CIELAB color space, respectively. k MA k and MB k These are the average values for the brightness channel, red-green channel, and yellow-blue channel, respectively.
[0053] The gradient weights of the second augmented map I2 and the third augmented map I3 are calculated using the following formula:
[0054]
[0055] Where (i, j) represents the target position, W G,k G represents the gradient weights of the image. x and G y These represent the gradients of the image in the horizontal and vertical directions, respectively.
[0056] The noise weights of the third enhancement map I3 are calculated using the following formula:
[0057]
[0058] Where (i, j) represents the target position, W N For noise weights, W N (i, j) represents the local noise level at location (i, j), W H and W w These are the height and width of the local window, hW H The value represents the size of the half-window, I(is, j-t) represents the pixel value of pixel (is, j-t) in the local window, and μ ij This represents the mean of a local window;
[0059] S032. Normalize each augmentation graph by dividing the sum of the weights of each augmentation graph by the sum of the weights of all augmentation graphs. The calculation formula is as follows:
[0060]
[0061] Among them, W nor,k W represents the normalized weight map of the k-th input image. k This represents the cumulative weight sum of the k-th input image. This represents the regularization term.
[0062] Preferably, in step S04, the decomposed Laplacian pyramid structure and Gaussian pyramid structure are fused using bilateral weighting to obtain the enhanced image, specifically as follows:
[0063]
[0064] Among them, I enhanced (x, y) represents the enhanced image. This represents the weight map of the q-th layer of the k-th input image after Gaussian pyramid decomposition. Let N represent the q-th layer image of the k-th input image after decomposition of the Laplacian pyramid, where N represents the number of layers in the decomposition.
[0065] Preferably, the number of decomposition layers N = 3.
[0066] An underwater image enhancement system combining attenuation channel correction according to the present invention includes:
[0067] The color correction module is used to acquire the original image, perform white balance processing on the original image to perform color correction, and obtain the color-corrected image, which is denoted as the first enhanced image I1.
[0068] An enhancement module is used to process the first enhanced image I1 using a nonlocal mean denoising algorithm to obtain a denoised image denoised as the second enhanced image I2, and to enhance the contrast of the first enhanced image I1 using an adaptive stretching method to obtain a contrast-enhanced image denoted as the third enhanced image I3.
[0069] The normalization processing module is used to calculate and obtain the saliency weight map, contrast weight map and gradient weight map for the second enhanced map I2 and perform weight normalization processing to obtain the first normalized weight map; and to calculate and obtain the saliency weight map, noise weight map and gradient weight map for the third enhanced map I3 and perform weight normalization processing to obtain the second normalized weight map.
[0070] The fusion module is used to decompose both the second enhanced image I2 and the third enhanced image I3 into Laplacian pyramid structures, decompose both the first normalized weight image and the second normalized weight image into Gaussian pyramid structures, and perform bilateral weight fusion of the decomposed Laplacian pyramid structure and Gaussian pyramid structure to obtain the enhanced image.
[0071] A computer device according to the present invention includes a processor and a memory connected by a signal, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program executes the underwater image enhancement method combined with attenuation channel correction as described above when loaded by the processor.
[0072] The present invention provides a computer-readable storage medium having stored thereon at least one instruction or at least one program that, when loaded by a processor, executes the underwater image enhancement method combined with attenuation channel correction as described above.
[0073] The underwater image enhancement method, system, and device combining attenuation channel correction described in this invention have the advantages of addressing four problems in underwater images: color distortion, low contrast, increased noise, and blurred details. First, an adaptive white balance algorithm with attenuation channel correction is used to perform color balancing on the original image. Next, the color-corrected image is processed using a non-local mean denoising algorithm based on local blocks to remove local noise. Then, an adaptive stretching method based on histogram local characteristics is used to improve contrast. Finally, a bilateral weighted fusion strategy is employed to combine the complementary advantages of the denoised image and the contrast-enhanced image, effectively enhancing the underwater image while highlighting details and edge textures.
[0074] Unlike restoration-based and deep learning-based methods, the method of this invention does not require the establishment of complex physical models or the processing of large amounts of data. Furthermore, compared to existing underwater image enhancement methods, this invention fully considers the noise in the original image, employing non-local mean denoising based on local blocks to effectively remove noise. It then calculates gradient weights, contrast weights, and saliency weights based on the characteristics of the denoised image for subsequent normalization and bilateral fusion. In another direction, it adaptively stretches the first enhanced image in parallel, and calculates noise weights for the stretched third enhanced image. This ensures that image noise is fully considered in the subsequent bilateral fusion process, resulting in underwater image enhancement performance far superior to existing algorithms, particularly in highlighting image details and edge textures. Extensive experimental results on multiple benchmark underwater image datasets demonstrate the efficiency and robustness of the proposed method. Moreover, the method of this invention also exhibits significant enhancement effects on low-light and foggy images. Attached Figure Description
[0075] Figure 1 This is a flowchart of the underwater image enhancement method described in this embodiment;
[0076] Figure 2 This is the original image processed in this embodiment;
[0077] Figure 3These are enhanced diagrams after processing by various methods in this embodiment, where... Figure 3-1 This represents the first enhancement map I1 after adaptive correction of the attenuation channel; Figure 3-2 The first image represents the second enhanced image I2 after processing with the nonlocal means denoising algorithm; the other two images represent the third enhanced image I3, which is adaptively stretched based on the local features of the histogram, and the enhanced image represented by the bilateral weight fusion algorithm, respectively.
[0078] Figure 4 It is the second enhanced graph I2 and its weight graphs, where, Figure 4-1 This represents the second enhanced image I2. Figure 4-2 The significance weight plot representing I2. Figure 4-3 This represents the contrast weighting map of I2. Figure 4-4 This represents the gradient weights graph of I2. Figure 4-5 This is the first normalized weighted graph of I2;
[0079] Figure 5 It is the third enhanced graph I3 and its weight graphs, where, Figure 5-1 This represents the third enhanced graph I3. Figure 5-2 The significance weight plot of I3 is shown. Figure 5-3 Represents the noise weighting plot of I3. Figure 5-4 This represents the gradient weights graph of I3. Figure 5-5 This is the second normalized weighted graph of I3;
[0080] Figure 6 This is a comparison image showing the color and contrast enhancement of the method in this embodiment with other typical water degradation images, wherein... Figure 6-1 Represents the original underwater image. Figure 6-2 This is a graph showing the results of HLRP processing. Figure 6-3 This is a graph showing the results of PCDE processing. Figure 6-4 This image shows the result of processing with FUnIE-GAN. Figure 6-5 This is a graph showing the results of processing using UIEC^2-Net. Figure 6-6 This image shows the result of processing with CBAF. Figure 6-7 This is a graph showing the result of MMLE processing. Figure 6-8 This diagram shows the result of processing using the method described in this embodiment.
[0081] Figure 7 This is a comparison image of the method in this embodiment with other typical water degradation image detail enhancement methods, wherein... Figure 7-1 Represents the original underwater image. Figure 7-2 This is a graph showing the results of HLRP processing. Figure 7-3 This is a graph showing the results of PCDE processing. Figure 7-4 This image shows the result of processing with FUnIE-GAN. Figure 7-5This is a graph showing the results of processing using UIEC^2-Net. Figure 7-6 This image shows the result of processing with CBAF. Figure 7-7 This is a graph showing the result of MMLE processing. Figure 7-8 This diagram shows the result of processing using the method described in this embodiment.
[0082] Figure 8 This is a schematic diagram of the structure of the computer device described in this embodiment.
[0083] Figure labeling: 101 - Processor, 102 - Memory. Detailed Implementation
[0084] like Figure 1 As shown, the underwater image enhancement method combining attenuation channel correction according to the present invention includes the following steps:
[0085] S01. Acquire the original image and use the white balance technique with attenuation channel adaptive correction to perform color correction on the original underwater image to solve the color cast problem. The specific steps are as follows:
[0086] S011. Calculate the index parameters of the RGB channels of the original image according to the following formula, wherein the index parameters include information entropy H, interval length DR, and average difference ADD:
[0087]
[0088] ADD c = (|n2-n1|+|n3-n2|+…+|n i+1 -n i |) / L,
[0089] Where c = R or G or B, H c This represents the information entropy of channel c. This represents the probability of the i-th pixel level in channel c;
[0090] DR c The n represents the length of the interval where the number of pixels in the c channel is greater than or equal to μ. i Min(n) represents the number of pixels at the i-th pixel level. i ≥μ) and max(n i ≥μ) respectively represent when n i The minimum and maximum values of i when ≥μ, where L represents the total number of pixels;
[0091] ADD c This represents the average difference in the c channel;
[0092] S012. Assign weights to the index parameters and construct compensation parameters cp for each channel in the original image:
[0093] cp c =δ H H c +δ DR DR c +δ ADD (1 / ADD c ),
[0094] Among them, cp c This represents the compensation parameter for channel c; δ H δ DR and δ ADD These represent the weighting coefficients of information entropy H, interval length DR, and average difference ADD, respectively; for example, the weighting coefficients of the three indicators are assigned the value δ. H =0.0908, δ DR =0.0009, δ ADD =0.9083.
[0095] S013. Sort the RGB channels according to the value of the obtained compensation parameter cp, and record them in descending order of value as: First channel C first Second Channel C second and the third channel C third Based on the compensation parameters cp of each channel obtained c Assign values to each channel, for example, such as cp. R >cp G >cp B Then let C R =C first cp R =Cp first And so on.
[0096] Construct compensation factors and compensation formulas based on the sorting and assignment results:
[0097]
[0098] Where cf1 and cf2 represent the first compensation factor and the second compensation factor, respectively, and C′ second and C′ third These represent the compensated second and third channels, respectively.
[0099] S014. The compensated image is processed using a grayscale world algorithm, such as... Figure 3-1 As shown, the first enhanced image I1 after color correction is obtained.
[0100] S02. The first enhanced image I1 is processed by a nonlocal mean denoising algorithm to obtain a denoised image, which is denoised as the second enhanced image I2. The contrast of the first enhanced image I1 is enhanced by an adaptive stretching method to obtain a contrast-enhanced image, which is denoted as the third enhanced image I3.
[0101] In step S02, the first enhanced image I1 is processed using a nonlocal means denoising algorithm based on local blocks to eliminate local noise and highlight image details, resulting in a denoised image denoised as the second enhanced image I2. This process specifically includes the following steps:
[0102] S021a. Read the first enhanced image I1 and define the length of the local block as p and the width as q;
[0103] S022a. Initialize an image of the same size as the first enhanced image I1 and record it as a blank image;
[0104] S023a. Calculate the similarity weight within the local block using the following formula:
[0105]
[0106] Where w(i,j,m,n) represents the similarity weight between the target pixel (i,j) and the similar pixel (m,n), I(i,j) represents the pixel value of the target pixel (i,j) in the local block, I(m,n) represents the pixel value of the similar pixel (m,n) in the local block, and h is a weight parameter that controls the degree of influence of the similarity weight.
[0107] S024a. Calculate the weighted average of similar pixels within a local block based on the similarity weight to obtain the denoising result FNLM(i,j):
[0108]
[0109] S025a. Use the parfor function to read the R, G, and B channels in parallel, and calculate the denoising result FNLM(i,j) for each channel. Store the denoising result FNLM(i,j) for each channel in the blank image, as shown. Figure 3-2 As shown, the second enhanced image I2 is obtained.
[0110] In step S02, an adaptive stretching method based on local histogram features is used to enhance the contrast of the first enhanced image I1, resulting in an image with enhanced contrast, denoted as the third enhanced image I3. This specifically includes the following steps:
[0111] S021b: Read the RGB channel histogram of the first enhanced image I1, and calculate the exposure value and exposure threshold of the obtained RGB channel histogram:
[0112]
[0113] ET = (1-EX)(MAX-MIN)+MIN,
[0114] Where EX represents the exposure value, ET represents the exposure threshold, and ET is used as the dividing point to divide the RGB channel histogram into two sub-histograms: the first sub-histogram and the second sub-histogram. The distribution range of the first sub-histogram is in the low exposure region of [MIN, ET], and the distribution range of the second sub-histogram is in the overexposure region of [ET, MAX]. ni represents the number of pixels at the i-th pixel level, and μ represents the pixel number threshold.
[0115] S022b. The median of the RGB channel histograms is used as the clipping threshold to clip the first sub-histogram and the second sub-histogram. The clipping rules are as follows:
[0116] Cropping is performed on portions of the image whose total number of pixels exceeds a cropping threshold, in order to remove overly bright or dark areas from the image.
[0117] Leave the portion of pixels whose total number of pixels is less than or equal to the cropping threshold unchanged;
[0118] The total number of pixels after cropping is redistributed across the entire range of the sub-histogram, preserving image information. The calculation formula for the cropping process is as follows:
[0119]
[0120] Where Hist(i) represents the cropped sub-histogram, Q represents the total number of cropped pixels, M represents the median of the sub-histogram, and l represents the interval length of the sub-histogram;
[0121] S023b. Based on the ratio of the interval lengths of the sub-histograms before and after stretching, construct a stretching factor, and obtain the stretched sub-histogram according to the proportional stretching rules:
[0122]
[0123] Where, θ low and θ high Hist′ represents the stretching factor of the first sub-histogram and the second sub-histogram, respectively. low (i) and Hist′ high (i) represent the stretched sub-histograms, with the corresponding stretching ranges being [0, ET] and [ET, L], respectively;
[0124] S024b. Using a direct overlay method, the two stretched sub-histograms are combined to obtain an image with enhanced contrast, such as... Figure 3The third image shown is the third enhanced image I3. S03: Calculate the saliency weight map, contrast weight map, and gradient weight map for the second enhanced image I2 and perform weight normalization processing to obtain the first normalized weight map; calculate the saliency weight map, noise weight map, and gradient weight map for the third enhanced image I3 and perform weight normalization processing to obtain the second normalized weight map;
[0125] Step S03 includes the following steps:
[0126] S031. Calculate the significance weights of the second enhanced graph I2 and the third enhanced graph I3 according to the following formula:
[0127] W s,k (i, j) = (L k (i, j)-ML k ) 2 +(A k (i, j)-MA k ) 2 +(B k (i,j)-MB k ) 2 ,
[0128] Where (i, j) represents the target position, W S,k L represents the saliency weight of the k-th input image. k A k and s k These represent the lightness channel, red-green channel, and yellow-blue channel in the CIELAB color space, respectively. k MA k and MB k These are the average values for the brightness channel, red-green channel, and yellow-blue channel, respectively.
[0129] The gradient weights of the second augmented map I2 and the third augmented map I3 are calculated using the following formula:
[0130]
[0131] Where (i, j) represents the target position, W G,k G represents the gradient weights of the image. x and G y These represent the gradients of the image in the horizontal and vertical directions, respectively.
[0132] The noise weights of the third enhancement map I3 are calculated using the following formula:
[0133]
[0134] Where (i, j) represents the target position, WN For noise weights, W N (i, j) represents the local noise level at location (i, j), W H and W w These are the height and width of the local window, hW H The value represents the size of the half-window, I(is, jt) represents the pixel value of the pixel (is, jt) in the local window, and μ ij This represents the mean of a local window;
[0135] The contrast weights of the second enhanced image I2 are calculated using a weighting method based on global contrast. An example of this method is as follows:
[0136]
[0137] Among them, W C (i, j) represents the contrast weight, (i, j) represents the target position, and I(i, j) represents the pixel value at the target position. This represents the global average gray value of the image. This represents the maximum absolute value of the difference between all pixels in the entire image and the global average gray value, and is used for normalization calculations.
[0138] S032. Normalize each augmentation graph by dividing the sum of the weights of each augmentation graph by the sum of the weights of all augmentation graphs. The first normalized weight graph and the second normalized weight graph are shown below. Figure 4-5 As shown in Figure 5-5, the calculation formula is as follows:
[0139]
[0140] Among them, W nor,k W represents the normalized weight map of the k-th input image. k This represents the cumulative weights of the k-th input image. This represents a regularization term, designed to ensure that each input contributes to the output.
[0141] S04. Decompose the second enhanced image I2 and the third enhanced image I3 into Laplacian pyramid structures, and decompose the first normalized weight image and the second normalized weight image into Gaussian pyramid structures. Perform bilateral weight fusion on the decomposed Laplacian pyramid structure and Gaussian pyramid structure to obtain the enhanced image.
[0142] In step S04, the decomposed Laplacian pyramid structure and Gaussian pyramid structure are fused using bilateral weighting to obtain the enhanced image, specifically:
[0143]
[0144] Among them, I enhanced (x, y) represents the enhanced image. This represents the weight map of the q-th layer of the k-th input image after Gaussian pyramid decomposition. This represents the q-th layer of the k-th input image after Laplacian pyramid decomposition, where N represents the number of decomposition layers. In this specific embodiment, N = 3, meaning both the Gaussian pyramid and the Laplacian pyramid decomposition have 3 layers. The final enhanced underwater image is shown below. Figure 3 As shown in the fourth image.
[0145] Experimental Example
[0146] To verify the efficiency of this invention in underwater image enhancement, three typical sets of underwater degraded images from different scenario benchmark datasets were selected for experiments, and the following algorithms from existing technologies were selected for comparative experiments:
[0147] HLRP (Underwater Image Enhancement With Hyper-Laplacian ReflectancePriors),
[0148] PCDE (Underwater image Enhancement via Piecewise Color Correction andDual Prior Optimized Contrast Enhancement),
[0149] FUnlE-GAN (Fast Underwater image Enhancement for Improved VisualPerception),
[0150] UIEC^2-Net (UIEC^2-Net: CNN-based underwater image enhancement using two color space),
[0151] CBAF (Color Balance and Fusion for Underwater Image Enhancement), MMLE (Underwater Image Enhancement via Minimal Color Loss and Locally AdaptiveContrast Enhancement).
[0152] like Figure 6As shown in the figure, this embodiment provides experimental results after processing typical water degradation images with other algorithms. Figure 6-1 The original image shows typical water degradation. From Figure 6-2 As can be seen from 6-3, the HLRP and PCDE algorithms failed to solve the problem of color cast in the image, and some areas also exhibited over-enhancement; from Figure 6-4 It can be seen that the FUnie-GAN algorithm introduces unnecessary red artifacts into the processing results of blue images; from Figure 6-5 It can be seen that although the UIEC^2-Net algorithm corrects some color cast issues, it does not enhance image contrast; from Figure 6-6 It can be seen that while the CBAF algorithm enhances image contrast, it also results in the loss of image details; from Figure 6-7 It can be seen that the MMLE algorithm produces localized blue artifacts, and the image contrast is not significant. Conversely, from Figure 6-8 As can be seen, the algorithm proposed in this embodiment can enhance image contrast and brightness while eliminating image color cast.
[0153] At the same time, from Figure 7 The results show that the algorithm proposed in this invention highlights local details of the image and produces an enhanced image with better visual effects.
[0154] To avoid biases caused by subjective qualitative evaluation, this embodiment uses five representative image quality assessment indicators for quantitative analysis: AG, IE, PCQI, UIQM, and UCIQE. AG reflects the richness of image information and subtle changes in image detail; IE quantitatively describes the richness of image colors; higher AG or IE scores indicate better visual quality. PCQI describes the contrast and structural information of an image; higher values indicate better contrast. UIQM and UCIQE are comprehensive indicators describing multiple aspects of image quality; higher UIQM or UCIQE scores indicate higher overall quality of the enhanced image. Table 1 shows... Figure 6 and Figure 7 The average results for AG, IE, PCQI, UIQM, and UCIQE for all images, where bold indicates the maximum value of the corresponding index.
[0155] Table 1
[0156]
[0157] Table 1 shows that the method proposed in this embodiment outperforms other algorithms in all five metrics. The combined qualitative and quantitative results demonstrate that the method proposed in this embodiment effectively addresses the four problems in underwater images: color distortion, low contrast, noise enhancement, and blurred details. The enhanced image exhibits no color cast and possesses good visual effects and prominent local details.
[0158] This invention addresses four problems in underwater images: color distortion, low contrast, increased noise, and blurred details. First, it employs a white balance algorithm with adaptive attenuation channel correction to perform color balancing on the original image. Next, the color-corrected image undergoes a non-local means denoising algorithm based on local blocks to remove local noise. Then, an adaptive stretching method based on histogram local characteristics is used to enhance contrast. Finally, a bilateral weighted fusion strategy is utilized to combine the complementary advantages of the denoised and contrast-enhanced images, effectively enhancing the underwater image while highlighting details and edge textures.
[0159] Unlike restoration-based and deep learning-based methods, the method of this invention does not require the establishment of complex physical models or the processing of large amounts of data. Furthermore, compared to existing underwater image enhancement methods, this invention fully considers the noise in the original image, employing non-local mean denoising based on local blocks to effectively remove noise. It then calculates gradient weights, contrast weights, and saliency weights based on the characteristics of the denoised image for subsequent normalization and bilateral fusion. In another direction, it adaptively stretches the first enhanced image in parallel, and calculates noise weights for the stretched third enhanced image. This ensures that image noise is fully considered in the subsequent bilateral fusion process, resulting in underwater image enhancement performance far superior to existing algorithms, particularly in highlighting image details and edge textures. Extensive experimental results on multiple benchmark underwater image datasets demonstrate the efficiency and robustness of the proposed method. Moreover, the method of this invention also exhibits significant enhancement effects on low-light and foggy images.
[0160] This embodiment also provides an underwater image enhancement system that combines attenuation channel correction, including:
[0161] The color correction module is used to acquire the original image, perform white balance processing on the original image to perform color correction, and obtain the color-corrected image, which is denoted as the first enhanced image I1.
[0162] An enhancement module is used to process the first enhanced image I1 using a nonlocal mean denoising algorithm to obtain a denoised image denoised as the second enhanced image I2, and to enhance the contrast of the first enhanced image I1 using an adaptive stretching method to obtain a contrast-enhanced image denoted as the third enhanced image I3.
[0163] The normalization processing module is used to calculate and obtain the saliency weight map, contrast weight map and gradient weight map for the second enhanced map I2 and perform weight normalization processing to obtain the first normalized weight map; and to calculate and obtain the saliency weight map, noise weight map and gradient weight map for the third enhanced map I3 and perform weight normalization processing to obtain the second normalized weight map.
[0164] The fusion module is used to decompose both the second enhanced image I2 and the third enhanced image I3 into Laplacian pyramid structures, decompose both the first normalized weight image and the second normalized weight image into Gaussian pyramid structures, and perform bilateral weight fusion of the decomposed Laplacian pyramid structure and Gaussian pyramid structure to obtain the enhanced image.
[0165] The underwater image enhancement system of this embodiment and the aforementioned underwater image enhancement method belong to the same inventive concept and can be understood with reference to the above description, and will not be repeated here.
[0166] like Figure 8 As shown, this embodiment also provides a computer device, including a processor 101 and a memory 102 connected via a bus signal. The memory 102 stores at least one instruction or at least one program segment. When the at least one instruction or the at least one program segment is loaded by the processor 101, it executes the underwater image enhancement method described above. The memory 102 can be used to store software programs and modules. The processor 101 executes various functional applications by running the software programs and modules stored in the memory 102. The memory 102 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for the functions, etc.; the data storage area may store data created according to the use of the device, etc. In addition, the memory 102 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 102 may also include a memory controller to provide the processor 101 with access to the memory 102.
[0167] The method embodiments provided in this invention can be executed in a computer terminal, server, or similar computing device; that is, the aforementioned computer device may include a computer terminal, server, or similar computing device. The internal structure of the computer device may include, but is not limited to, a processor, a network interface, and a memory. The processor, network interface, and memory within the computer device can be connected via a bus or other means.
[0168] The processor 101 (or CPU, Central Processing Unit) is the computing and control core of the computer device. The network interface may optionally include a standard wired interface or a wireless interface (such as Wi-Fi, mobile communication interface, etc.). The memory 102 is the storage device in the computer device used to store programs and data. It is understood that the memory 102 here can be a high-speed RAM storage device, or a non-volatile storage device, such as at least one disk storage device; optionally, it can also be at least one storage device located remotely from the processor 101. The memory 102 provides storage space that stores the operating system of the electronic device, which may include, but is not limited to: Windows (an operating system), Linux (an operating system), Android (a mobile operating system), iOS (a mobile operating system), etc., and this invention does not limit this; furthermore, the storage space also stores one or more instructions suitable for being loaded and executed by the processor 101, which may be one or more computer programs (including program code). In the embodiments of this specification, the processor 101 loads and executes one or more instructions stored in the memory 102 to implement the underwater image enhancement method described in the above method embodiments.
[0169] This invention also provides a computer-readable storage medium storing at least one instruction or at least one program segment, which, when loaded by processor 101, executes the underwater image enhancement method described above. The aforementioned computer-readable storage medium carries one or more programs, which, when executed, implement the method according to embodiments of the invention.
[0170] According to embodiments of the present invention, a computer-readable storage medium may be a non-volatile computer-readable storage medium. Examples include, but are not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0171] In the description of this invention, it should be understood that the orientation or positional relationship indicated by directional terms such as "front, back, up, down, left, right", "horizontal, vertical, horizontal" and "top, bottom" is generally based on the orientation or positional relationship shown in the accompanying drawings, and is only for the convenience of describing this invention and simplifying the description. Unless otherwise stated, these directional terms do not indicate or imply that the device or element referred to must have a specific orientation or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation on the scope of protection of this invention.
[0172] For those skilled in the art, various other corresponding changes and modifications can be made based on the technical solutions and concepts described above, and all such changes and modifications should fall within the protection scope of the claims of this invention.
Claims
1. An underwater image enhancement method combining attenuation channel correction, characterized in that, Includes the following steps: S01. Obtain the original image, perform white balance processing on the original image to perform color correction, and obtain the color-corrected image as the first enhanced image I1; S02. The first enhanced image I1 is processed by a nonlocal mean denoising algorithm to obtain a denoised image, which is denoised as the second enhanced image I2. The contrast of the first enhanced image I1 is enhanced by an adaptive stretching method to obtain a contrast-enhanced image, which is denoted as the third enhanced image I3. S03. Calculate and obtain the saliency weight map, contrast weight map and gradient weight map for the second enhancement map I2, and perform weight normalization processing to obtain the first normalized weight map. The saliency weight map, noise weight map, and gradient weight map of the third enhanced map I3 are calculated and normalized to obtain the second normalized weight map. S04. Decompose the second enhanced image I2 and the third enhanced image I3 into Laplacian pyramid structures, and decompose the first normalized weight image and the second normalized weight image into Gaussian pyramid structures. Perform bilateral weight fusion on the decomposed Laplacian pyramid structure and Gaussian pyramid structure to obtain the enhanced image.
2. The underwater image enhancement method combining attenuation channel correction according to claim 1, characterized in that, Step S01 includes the following steps: S011. Calculate the index parameters of the RGB channels of the original image according to the following formula, wherein the index parameters include information entropy. Interval length and average difference : , , , in, , express Information entropy of the channel, express Channel 1 The probability at the pixel level; express The number of pixels in the channel is greater than or equal to The length of the interval, Indicates the first Pixel count at the pixel level and They represent when hour The minimum and maximum values, This represents the total number of pixels. Indicates the pixel count threshold; express The average difference between the channels; S012. Assign weights to the index parameters and construct compensation parameters for each channel in the original image. : , in, express Channel compensation parameters, , and Representing information entropy respectively Interval length and average difference Weighting coefficients; S013, Based on the obtained compensation parameters The RGB channels are sorted by their numerical values, and designated as follows: First Channel Second Channel and the third channel Based on the compensation parameters obtained for each channel Assign values to each channel, and construct compensation factors and compensation formulas based on the sorting and assignment results: , , in, and These represent the first compensation factor and the second compensation factor, respectively. and These represent the compensated second and third channels, respectively. S014. The compensated image is processed by the grayscale world algorithm to obtain the first enhanced image I1 after color correction.
3. The underwater image enhancement method combining attenuation channel correction according to claim 1, characterized in that, In step S02, the first enhanced image I1 is processed using a nonlocal means denoising algorithm to obtain the denoised image, denoted as the second enhanced image I2. Specifically, this includes the following steps: S021a. Read the first enhanced image I1 and define the length of the local block as... Width is ; S022a. Initialize an image of the same size as the first enhanced image I1 and record it as a blank image; S023a. Calculate the similarity weight within the local block using the following formula: , in, Represents target pixel Similar pixels Similarity weights between them Represents the target pixel in the local block pixel values, Represents similar pixels in a local block pixel values, Weight parameters are used to control the degree of influence of similarity weights; S024a. Calculate the weighted average of similar pixels within a local block based on the similarity weight to obtain the denoising result. : , S025a. Parallel reading of the R, G, and B channels, and calculation of the denoising result on each channel. The denoising results for each channel All are stored in the blank image to obtain the second enhanced image I2.
4. The underwater image enhancement method combining attenuation channel correction according to claim 3, characterized in that, In step S02, the contrast of the first enhanced image I1 is enhanced by an adaptive stretching method to obtain an image with enhanced contrast, denoted as the third enhanced image I3. This specifically includes the following steps: S021b: Read the RGB channel histogram of the first enhanced image I1, and calculate the exposure value and exposure threshold of the obtained RGB channel histogram: , , in, Indicates the exposure value. Indicates the exposure threshold, using As a dividing point, the RGB channel histogram is divided into two sub-histograms: a first sub-histogram and a second sub-histogram. The distribution range of the first sub-histogram is within... The low-exposure area, the distribution range of the second sub-histogram is in Overexposed areas Indicates the first Pixel count at the pixel level Indicates the pixel count threshold; S022b. The median of the RGB channel histogram is used as the cropping threshold to crop the first sub-histogram and the second sub-histogram. The portion with a total number of pixels greater than the cropping threshold is cropped, while the portion with a total number of pixels less than or equal to the cropping threshold remains unchanged. The cropped total number of pixels is redistributed throughout the entire range of the sub-histogram, preserving image information. The calculation formula for the cropping process is as follows: , in, This represents the sub-histogram after clipping. This indicates the total number of pixels cropped. This represents the median of the sub-histogram. Indicates the interval length of the sub-histogram; S023b. Based on the ratio of the interval lengths of the sub-histograms before and after stretching, construct a stretching factor, and obtain the stretched sub-histogram according to the proportional stretching rules: , , in, and Let represent the stretching factors of the first sub-histogram and the second sub-histogram, respectively. and These represent the stretched sub-histograms, with corresponding stretching ranges of 1 / 2 and 2 / 3 respectively. and ; S024b. Combine the two sub-histograms after stretching to obtain the image with enhanced contrast, which is the third enhanced image I3.
5. The underwater image enhancement method combining attenuation channel correction according to claim 4, characterized in that, Step S03 includes the following steps: S031. Calculate the significance weights of the second enhanced graph I2 and the third enhanced graph I3 according to the following formula: , in, Indicates the target location. Indicates the first The saliency weights of each input image. , and They represent the first The luminance channel, red-green channel, and yellow-blue channel of the input image in the CIELAB color space. , and The first The average values of the brightness channel, red-green channel, and yellow-blue channel of each input image; The gradient weights of the second augmented map I2 and the third augmented map I3 are calculated using the following formula: , in, Indicates the target location. Indicates the first Gradient weights of each input image. and They represent the first The gradients of the input image in the horizontal and vertical directions; The noise weights of the third enhancement map I3 are calculated using the following formula: , , in, Indicates the target location. For noise weights, Indicates position The local noise level at that location and These are the height and width of the local window, respectively. Indicates the size of half the window. Represents pixels in a local window pixel values, This represents the mean of a local window; S032. Normalize each augmentation graph by dividing the sum of the weights of each augmentation graph by the sum of the weights of all augmentation graphs. The calculation formula is as follows: , in, Indicates the first Normalized weight map of each input image. Indicates the first The cumulative sum of weights for each input image. This represents the regularization term.
6. The underwater image enhancement method combining attenuation channel correction according to claim 5, characterized in that, In step S04, the decomposed Laplacian pyramid structure and Gaussian pyramid structure are fused using bilateral weighting to obtain the enhanced image, specifically: , in, Indicates an enhanced image. Represents the first decomposition of the Gaussian pyramid. The first input image Layer weight graph This represents the first decomposition of the Laplace pyramid. The first input image Layer image, Indicates the number of layers in the decomposition.
7. The underwater image enhancement method combining attenuation channel correction according to claim 6, characterized in that, Number of decomposition levels .
8. An underwater image enhancement system incorporating attenuation channel correction, characterized in that, include: The color correction module is used to acquire the original image, perform white balance processing on the original image to perform color correction, and obtain the color-corrected image, which is denoted as the first enhanced image I1. An enhancement module is used to process the first enhanced image I1 using a nonlocal mean denoising algorithm to obtain a denoised image denoised as the second enhanced image I2, and to enhance the contrast of the first enhanced image I1 using an adaptive stretching method to obtain a contrast-enhanced image denoted as the third enhanced image I3. The normalization processing module is used to calculate and obtain the saliency weight map, contrast weight map and gradient weight map with respect to the second enhanced map I2, and perform weight normalization processing to obtain the first normalized weight map. The saliency weight map, noise weight map, and gradient weight map of the third enhanced map I3 are calculated and normalized to obtain the second normalized weight map. The fusion module is used to decompose both the second enhanced image I2 and the third enhanced image I3 into Laplacian pyramid structures, decompose both the first normalized weight image and the second normalized weight image into Gaussian pyramid structures, and perform bilateral weight fusion of the decomposed Laplacian pyramid structure and Gaussian pyramid structure to obtain the enhanced image.
9. A computer device comprising a processor and a memory connected by signals, characterized in that, The memory stores at least one instruction or at least one program segment, which, when loaded by the processor, executes the underwater image enhancement method combined with attenuation channel correction as described in any one of claims 1-7.
10. A computer-readable storage medium having stored thereon at least one instruction or at least one program, characterized in that, When the at least one instruction or the at least one program segment is loaded by the processor, the underwater image enhancement method combined with attenuation channel correction as described in any one of claims 1-7 is executed.