Underwater image enhancement method based on color correction and wavelet fusion
By using color correction and wavelet fusion technology in underwater image processing, the color offset and clarity problems of underwater images are solved, and high-quality underwater image enhancement effect is achieved, which is suitable for underwater robot applications.
Patent Information
- Application Number
- CN202510149298.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-11
- Publication Date
- 2025-05-30
AI Technical Summary
In the prior art, underwater images often have obvious blue-green color casts, and the clarity is insufficient, which affects the quality of the image.
Underwater image enhancement method based on color correction and wavelet fusion is adopted, color compensation is performed by defining the brightness channel, white balance processing is performed using the improved grayscale world algorithm, contrast enhancement is performed in combination with the CLAHE-Gamma algorithm, and image details are integrated through wavelet decomposition and fusion strategies.
Effectively remove the color shift of underwater images, improve the contrast and clarity of images, and improve image quality. It is suitable for applications such as path navigation and data acquisition of underwater robots.
Smart Images

Figure CN120070293A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of underwater image processing, and particularly to an underwater image enhancement method based on color correction and wavelet fusion. Background Art
[0002] In the context of the increasing pressure on land space and resources today, it has become particularly urgent to develop underwater space. The ocean contains rich resources, including oil, natural gas, minerals, and marine organisms. Effective exploration technologies can help identify and evaluate the distribution and reserves of these resources. Traditional marine resource exploration methods, such as sonar detection and geological sampling, although effective, often cannot provide high-resolution information, so optical image technology is needed.
[0003] However, the underwater environment is complex and variable, affected by various uncertain factors. The absorption of light by water causes the energy of light to gradually decay during propagation, resulting in obvious blue-green color cast in underwater images. In addition, a large number of suspended particles in water also cause light absorption and scattering, which in turn affects the contrast of underwater images, blurs edge texture details, and reduces clarity. Summary of the Invention
[0004] In view of this, the purpose of the present invention is to propose an underwater image enhancement method based on color correction and wavelet fusion to solve the problems of color cast and insufficient clarity in underwater images in the prior art.
[0005] Based on the above purpose, the present invention provides an underwater image enhancement method based on color correction and wavelet fusion, including the following steps:
[0006] S1. By defining the luminance channel, compensate the red, blue, and green channels of the color-distorted underwater image to obtain a color-compensated image;
[0007] S2: Perform white balance processing on the color-compensated image obtained in step S1 using an improved gray world algorithm to remove the color cast caused by underwater light scattering and obtain a color-corrected image;
[0008] S3: Enhance the contrast of the color-corrected image obtained in step S2 using the CLAHE-Gamma algorithm to increase the brightness of the image and improve the image clarity;
[0009] S4: Use the wavelet decomposition method for the two images obtained in steps S2 and S3 to obtain the low-frequency and high-frequency components of the image;
[0010] S5: Adopt a wavelet fusion strategy, perform inverse wavelet transform by setting weight values, and integrate the low-frequency and high-frequency components at different scales to obtain a high-quality underwater image.
[0011] Preferably, in step S1, the process of color compensation through the luminance channel does not include: calculating the pixel average values of the red, green, and blue channels of the image, comparing the magnitudes of their average values, defining the channel with the larger value as the luminance channel, and then compensating the red, blue, and green channels through the luminance channel compensation formula to obtain the color compensation image.
[0012] Preferably, in step S2, white balance processing is performed through an improved gray world algorithm, which specifically includes:
[0013] Calculating the average gray values of the red, blue, and green channels in the color image;
[0014] Dividing the sum of the average values of the three channels by the number of channels to obtain the average gray value;
[0015] Dividing the average gray value by the average values of the red, blue, and green channels to obtain the gain coefficients for the three channels respectively;
[0016] Multiplying the gain coefficients by the pixel gray values of the three channels in the input image to obtain the gain-adjusted channels;
[0017] Appropriately reducing the obtained gain coefficients for each channel as the quantile P x , finding P x and 1 - P x The corresponding quantile values for each channel are
[0018] Setting the values in each channel that are less than to and setting the values that are greater than to
[0019] Performing linear stretching processing on each channel to obtain the color correction image.
[0020] Preferably, in step S3, the CLAHE-Gamma algorithm is used for contrast enhancement to improve the brightness of the image and enhance the image clarity, which specifically includes:
[0021] Converting the color space of the original image to the LAB space and dividing the L channel into non-overlapping sub-blocks;
[0022] Performing histogram equalization on each small block, cropping the part exceeding the threshold and evenly distributing it to other gray levels, and then mapping the original pixel values to the enhanced values and synthesizing the complete image;
[0023] The CLAHE-Gamma algorithm is based on the CLAHE algorithm. By introducing gamma correction operation, it compares the pixel means of the red, blue, and green channels of the image to determine different γ values for gamma correction processing. Finally, it performs weighted fusion on the image processed by the CLAHE algorithm and the image after gamma transformation to obtain a contrast-enhanced image.
[0024] Preferably, in step S4, using the wavelet decomposition strategy, each component is decomposed into a four-layer pyramid through downsampling operation, and approximate low-frequency components, vertical high-frequency components, horizontal high-frequency components, and diagonal high-frequency components are extracted from the gray-world and contrast-enhanced processed images.
[0025] Preferably, in step S5, a weighting factor is introduced for each high-frequency component, and the average gradient is used to design the weighting factor.
[0026] Preferably, in step S5, inverse wavelet transform is used to upsample the decomposed low-frequency components and high-frequency components to obtain an enhanced underwater image.
[0027] Advantages of the present invention:
[0028] (1) Good image color deviation correction effect: By defining the luminance channel and using an adaptive color channel compensation method to perform color compensation on the underwater image, it has universality and achieves a very good color deviation correction effect, improving the quality of the underwater image. And an improved gray-world algorithm matching this method is used. By setting parameters to limit the pixels of each channel of the image, linear stretching is performed on this basis, improving the graying problem of the image after gray-world processing.
[0029] (2) High image contrast and clear details: Select the L channel in the LAB color space for CHALE operation, which hardly affects the color components. Then, combined with adaptive gamma correction, while limiting the image contrast, it can excellently restore the details of the image and reduce the noise in the smooth areas. After that, wavelet fusion is used to obtain an underwater image with relatively rich detail information.
[0030] (3) Strong practicability: This method is simple, requires no prior knowledge, and has good effects. It can be applied to path navigation, data acquisition, etc. of underwater robots, providing convenience for the recognition and positioning of underwater robots and having high practical value. Description of the Drawings
[0031] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following will briefly introduce the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only those of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0032] Figure 1 Flowchart of the underwater image enhancement method based on color correction and wavelet fusion according to an embodiment of the present invention;
[0033] Figure 2 Flowchart of the CLAHE-Gamma algorithm according to an embodiment of the present invention;
[0034] Figure 3 Comparison chart of the original image and the image processed by the method according to an embodiment of the present invention. Detailed implementation manners
[0035] To make the objectives, technical solutions and advantages of the present invention clearer and more understandable, the present invention will be further described in detail below with reference to specific embodiments.
[0036] It should be noted that unless otherwise defined, the technical terms or scientific terms used in the present invention shall have the ordinary meanings understood by those of ordinary skill in the field to which the present invention belongs. The "first", "second" and similar terms used in the present invention do not denote any order, quantity or importance, but are only used to distinguish different components. The terms such as "including" or "comprising" mean that the elements or items appearing before this word cover the elements or items listed after this word and their equivalents, without excluding other elements or items. The terms such as "connected" or "coupled" are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The terms such as "upper", "lower", "left" and "right" are only used to indicate relative positional relationships, and when the absolute position of the object being described changes, the relative positional relationship may also change accordingly.
[0037] Referring to Figure 1 , an underwater image enhancement method based on color correction and wavelet fusion includes the following steps.
[0038] S1: By defining a luminance channel, compensating the blue and green channels of the color-distorted underwater image to obtain a color-compensated image. The definition formula of the luminance channel is:
[0039]
[0040] wherein, and are the average values of the red, green and blue channels respectively, is the average value of the luminance channel.
[0041] Compensating the red, green and blue channels through the luminance channel. The color compensation method is:
[0042]
[0043] Among them, f l (i,j) is the luminance channel, and are the red, green, and blue channels after luminance channel compensation.
[0044] S2: To remove the color cast caused by underwater light scattering, the improved gray world algorithm is used to further process the image:
[0045] Step 1: Calculate the average gray values of the red, blue, and green channels in the color image;
[0046] Step 2: Divide the sum of the averages of the three channels by the number of channels to obtain the average gray value; divide the average gray value by the respective averages of the red, blue, and green channels to obtain the respective gain coefficients K x ;
[0047] Step 3: Multiply K x by the pixel gray values of the three channels in the input image to obtain
[0048] After that, to solve the problem of numerical overflow in the image after traditional gray world processing and improve the brightness of the image, the obtained gain coefficients of each channel are appropriately reduced as the quantile P x , find P x and the corresponding quantile values of each channel for 1 - P x are Set the values in the channel less than to and the values greater than to After that, perform linear stretching processing on each channel to obtain the white balance image. The determination of the quantile is as follows:
[0049] P x = a × K x , x ∈ {r, g, b};
[0050] Among them, P x is the x color channel, K x is the gain coefficient of the x color channel, and a is the reduction coefficient. After multiple experiments, a = 0.001 is taken.
[0051] The formula for linear stretching is:
[0052]
[0053] Among them, is the x color channel of the image after preliminary gray world processing, is the x color channel after linear stretching.
[0054] S3: Apply the CLAHE-Gamma algorithm to enhance the contrast of the image obtained in S2. In this paper, the CLAHE algorithm is combined with gamma correction to propose the CLAHE-Gamma enhancement method, which improves the image clarity while increasing the image brightness. The process of the CLAHE-Gamma enhancement method is as follows Figure 2 shown, and the steps in this embodiment are as follows
[0055] Convert the color space of the original image to the LAB space, and divide the L channel into non-overlapping sub-blocks; perform histogram equalization on each small block, and evenly distribute the part exceeding the threshold to other gray levels after cropping, and then map the original pixel values to the enhanced values and synthesize the complete image
[0056] After that, introduce gamma correction. By calculating and comparing the pixel means of the red, blue, and green channels of the image, take the gamma values as 0.8, 1, and 1.2 in order of magnitude. The gamma correction method is as follows
[0057] f γ =(l) γ ;
[0058] where l is the image processed by the CLAHE algorithm, f γ is the corrected image, and γ is the gamma value, which controls the intensity of the correction
[0059] Then perform weighted fusion on the image processed by the CLAHE algorithm and the image after gamma transformation. The process is as follows
[0060] y = m×f γ +n×l;
[0061] where m and n are two parameters, and both determine the degree of emphasis on each image. In this example, both m and n are taken as 0.5
[0062] S4: Apply the wavelet decomposition method to the two images obtained in S2 and S3, and decompose each component into a four-layer pyramid through downsampling operation to extract the approximate low-frequency component, vertical high-frequency component, horizontal high-frequency component, and diagonal high-frequency component from the image
[0063] S5: Adopt the weighted wavelet fusion strategy, and design the weight factor for each high-frequency component through the average gradient. Its definition is
[0064]
[0065] where H and L are the height and width of the image respectively, and Z is the average gradient
[0066] After that, design the weight factor
[0067] Z s = Z v + Z h + Z d ;
[0068]
[0069] where Z v , Z h and Z d respectively represent the average gradients of the vertical, horizontal, and diagonal components of the reconstructed image. β v , β h and β d respectively represent the weight factors of the vertical, horizontal, and diagonal components of the reconstructed image.
[0070] Furthermore, the inverse wavelet transform is used to upsample the decomposed low-frequency and high-frequency components to reconstruct the enhanced underwater image, expressed as:
[0071]
[0072] where WIT l () is the inverse wavelet transform function, U d is the upsampling operator for the factor d = 2 l―1 , l is the number of layers in the wavelet pyramid, and are the approximate low-frequency component obtained by the first-order wavelet transform and the vertical, horizontal, and diagonal high-frequency components of each enhanced version, respectively. f F is the enhanced underwater image obtained by weighted wavelet fusion.
[0073] To verify the performance of the present invention in image enhancement, the open-source real underwater image dataset UIEB is selected for testing, and qualitative and quantitative evaluations are carried out.
[0074] 1. Qualitative evaluation
[0075] For qualitative evaluation, the present invention first selects some underwater images from UIEB, and the comparison effects of the processing are as Figure 3 shown.
[0076] 2. Quantitative evaluation
[0077] In quantitative evaluation, four image quality evaluation metrics, namely information entropy (IE), average gradient (AG), underwater image quality measure (UIQM), and underwater color image quality evaluation index (UCIQE), are used to quantitatively evaluate this method.
[0078] Table 1 Experimental comparison of image enhancement effects
[0079] Image IE AG UIQM UCIQE Original image 3.8367 2.3229 1.0795 0.2927 After processing 7.7421 6.9454 4.7679 0.6293
[0080] The data in Table 1 show that the values of various indicators of the original image are relatively low, indicating poor image quality. After being processed by the method of the present invention, all indicators of the image are significantly improved, indicating that the method has a good effect in improving the information content, sharpness and overall quality of underwater images.
[0081] Those of ordinary skill in the art should understand that the discussion of any of the above embodiments is merely exemplary and is not intended to imply that the scope of the present invention is limited to these examples; under the concept of the present invention, the technical features in the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations in different aspects of the present invention as described above, which are not provided in detail for the sake of brevity. Any omission, modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. An underwater image enhancement method based on color correction and wavelet fusion, characterized in that: The following steps are involved: S1, by defining a brightness channel, compensating the red, blue and green channels of the color-distorted underwater image to obtain a color-compensated image; S2: performing white balance processing on the color-compensated image obtained in step S1 using an improved gray-world algorithm to remove the color cast caused by underwater light scattering, thereby obtaining a color-corrected image; S3: using the CLAHE-Gamma algorithm to perform contrast enhancement on the color-corrected image obtained in step S2, thereby increasing the brightness of the image and improving the image clarity; S4: using a wavelet decomposition method on the two images obtained in steps S2 and S3 to obtain low-frequency and high-frequency components of the images; S5: Using the wavelet fusion strategy, we perform inverse wavelet transform by setting weight values, integrate high and low frequency components of different scales, and obtain high-quality underwater images.
2. The underwater image enhancement method based on color correction and wavelet fusion according to claim 1 is characterized in that: In step S1, the process of color compensation through the brightness channel does not include: calculating the pixel averages of the red, green and blue channels of the image, comparing the averages, defining the larger value as the brightness channel, and then compensating the red, blue and green channels through the brightness channel compensation formula to obtain a color compensated image.
3. The underwater image enhancement method based on color correction and wavelet fusion according to claim 1, characterized in that: In step S2, white balance processing is performed using an improved gray world algorithm, specifically including: Calculate the average grayscale value of the red, blue and green channels in a color image; Divide the sum of the average values of the three channels by the number of channels to get the grayscale average value; The grayscale average is divided by the average of the red, blue, and green channels to obtain the gain coefficients of each of the three channels; The gain coefficient is multiplied by the pixel grayscale values of the three channels in the input image to obtain the channels after gain; The obtained gain coefficients of each channel are appropriately reduced as quantiles P x ,beg P x and 1 ― P x The corresponding quantile values of each channel are In each channel, The value is set to Greater than The value is set to Each channel is linearly stretched to obtain a color-corrected image.
4. The underwater image enhancement method based on color correction and wavelet fusion according to claim 1, characterized in that: In step S3, the CLAHE-Gamma algorithm is used to perform contrast enhancement to increase the brightness of the image and improve the image clarity, which specifically includes: Convert the color space of the original image to LAB space and divide the L channel into non-overlapping sub-blocks; Perform histogram equalization on each small block, crop the part exceeding the threshold and evenly distribute it to other gray levels, then correspond the original pixel value to the enhanced value and synthesize the complete image; The CLAHE-Gamma algorithm introduces a gamma correction operation on the basis of the CLAHE algorithm. By comparing the pixel means of the red, blue and green channels of the image, different γ values are determined for gamma correction processing. Finally, the image processed by the CLAHE algorithm and the image after the gamma transformation are weightedly fused to obtain a contrast enhanced image.
5. The underwater image enhancement method based on color correction and wavelet fusion according to claim 1, characterized in that: In step S4, a wavelet decomposition strategy is used to decompose each component into a four-layer pyramid through a downsampling operation, and approximate low-frequency components, vertical high-frequency components, horizontal high-frequency components, and diagonal high-frequency components are extracted from the grayscale world and the image after contrast enhancement processing.
6. The underwater image enhancement method based on color correction and wavelet fusion according to claim 1, characterized in that: In step S5, a weighting factor is introduced into each high frequency component, and the average gradient is used to design the weighting factor.
7. The underwater image enhancement method based on color correction and wavelet fusion according to claim 1, characterized in that: In step S5, the decomposed low-frequency components and high-frequency components are up-sampled using inverse wavelet transform to obtain an enhanced underwater image.
Citation Information
Cited By
Image preprocessing neural network model, training method, near-eye display method, device, equipment and medium
CN120852207A