Underwater image enhancement method for complex environment

Through improved white balance algorithm, logarithmic domain gamma transformation, adaptive histogram equalization and bilateral filtering technology, combined with U-Net network for defuzzing, the existing underwater image enhancement technology has solved the problems of poor generalization ability and insufficient adaptability to light changes in complex environments, and achieved higher quality underwater image enhancement effect.

CN120219263AActive Publication Date: 2025-06-27SHANGHAI DONGXIN SOFTWARE ENG CO LTD +2

Patent Information

Application Number
CN202510695225.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-28
Publication Date
2025-06-27
Estimated Expiration
2045-05-28

AI Technical Summary

Technical Problem

The existing underwater image enhancement technology has poor generalization ability, high computational complexity, and insufficient adaptability to light changes in complex environments, making it difficult to ensure image quality.

Method used

The improved white balance algorithm is used for color offset compensation, and the pixel distribution is adjusted in combination with logarithmic domain gamma transformation. The image enhancement is performed using adaptive histogram equalization technology with limited contrast, and the noise is removed through bilateral filtering technology, and finally the U-Net network is used for defuzzing.

Benefits of technology

It effectively improves the color accuracy and brightness uniformity of underwater images, enhances dark details, reduces noise interference, and improves the sharpness and contrast of the image.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120219263A_ABST
    Figure CN120219263A_ABST
Patent Text Reader

Abstract

The invention discloses an underwater image enhancement method for a complex environment, and the method specifically comprises the following steps: firstly, correcting color cast caused by optical characteristics through an improved white balance algorithm, and effectively recovering colors; secondly, brightness distribution is adjusted and dark part details are enhanced by adopting logarithmic domain gamma transformation, so that the brightness distribution of the image is more uniform, and meanwhile, a self-adaptive histogram for limiting the contrast ratio is equalized, so that the contrast ratio and detail definition of the image are improved; and finally, noise is removed by using bilateral filtering, edge information is reserved, and deblurring processing is performed in combination with a U-Net network. According to the method, the color cast problem caused by optical characteristics is improved by using the improved white balance algorithm, a correct color basis is provided for subsequent processing, pixel distribution is adjusted by using logarithm domain gamma transformation, the importance of details of a bright part is reduced, a dark part region is further enhanced, and the overall brightness distribution is more uniform.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of ship digitization, and specifically relates to an underwater image enhancement method for complex environments. Background Art

[0002] With the rapid development of underwater detection technology, underwater image processing plays a crucial role in fields such as marine science, environmental monitoring, underwater target detection and recognition, military reconnaissance, and marine resource development. However, due to the complexity of the underwater environment, it is difficult to guarantee the image quality, which is mainly manifested in: (1) Due to the absorption and scattering characteristics of water on light, relatively more red light is absorbed, making the underwater image show a blue-green tone, resulting in color distortion and color shift phenomena; (2) The underwater environment has uneven illumination, some areas appear dim due to light attenuation, and some areas appear overexposed due to local reflection, resulting in low image contrast and missing details; (3) Suspended particles in water will cause light scattering, resulting in blurring and noise phenomena, further reducing the image clarity; (4) Under low-light conditions, underwater imaging devices are prone to generate noise, affecting the imaging quality.

[0003] Underwater image enhancement technology has mainly developed the following three research directions: physical model-based methods, image processing-based methods, and deep learning-based methods: Physical model-based methods rely on the physical model of underwater light transmission to simulate the attenuation, scattering, and color of light to correct the image quality; Image processing-based methods do not rely on physical models, but directly improve the visual quality through color correction, contrast enhancement, and filtering; Deep learning-based methods perform underwater image enhancement by training networks. Du Feiyu optimized feature extraction and output based on the U-Net framework, combined with multi-head attention mechanisms and adversarial learning to improve the effect; These methods have improved the underwater image quality to a certain extent, but there are still some deficiencies, such as poor generalization ability for complex environments, high computational complexity, and insufficient adaptability to light changes. Summary of the Invention

[0004] The purpose of the present invention is to overcome the deficiencies existing in the above-mentioned prior art, and provide an underwater image enhancement method for complex environments. The present invention uses an improved white balance algorithm to improve the color cast problem caused by optical characteristics, providing a correct color basis for subsequent processing, and then uses logarithmic domain gamma transformation to adjust the pixel distribution, reducing the importance of highlight details and further enhancing the dark area to make the overall brightness distribution more uniform.

[0005] In order to achieve the above-mentioned invention purpose, the technical solution provided by the present invention patent is as follows: An underwater image enhancement method for complex environments, which specifically includes the following steps: S1. Obtain the original underwater image, identify the color cast of the original image through an improved white balance algorithm, and perform color cast compensation on the original image; S2. Segment the original image into multiple region blocks, calculate the local histogram for each region block, extract statistical features, determine the adaptive gamma value for each region block, and determine the brightness value of each region block through adaptive log-domain gamma transformation; S3. Enhance the original image through contrast-limited adaptive histogram equalization technology. First, segment the original image into multiple small blocks, calculate the grayscale histogram for each small block, prune the grayscale histogram according to the set clip threshold, perform histogram equalization through the pruned grayscale histogram, and then splice all the processed small blocks into an output image; S4. Perform weighted averaging based on the pixel values of the output image, and eliminate the noise interference in the output image through bilateral filtering technology; S5. Extract the features of the output image through a U-Net network, perform deblurring processing on the output image to generate a clear image, and finally output the enhanced underwater image.

[0006] Further, the specific process of the improved white balance algorithm for identifying the color cast of the original image and performing color cast compensation on the original image is as follows: Obtain the red, green, and blue channels of the original image and the average values of the red, green, and blue channels, and supplement the red and blue channels through the green channel to obtain the compensated red and blue channels;

[0007] Among them, and are the compensated red and blue channels; and and are the red, green, and blue channels of the original image; and and represent the average values of each channel, represents the compensation scale and takes the value of 1.

[0008] Further, the statistical features include the mean, variance, and maximum value of the local histogram of the image. The specific process of determining the brightness value of each region block through adaptive log-domain gamma transformation is as follows:

[0009] Among them, is the brightness value of the original image at position , is the brightness value of the original image at position , c is a constant used to normalize the result of the logarithmic transformation, is the adaptive gamma value, calculated based on local contrast is the base gamma value is the adjustment coefficient is the variance of the local area is the mean of the local area

[0010] Further, the specific calculation of the grayscale histogram for each small block is as follows:

[0011] where is the small block is the number of occurrences of the grayscale value in it is the grayscale value is the indicator function, when the value is 1, otherwise it is 0 represents the position in the small block is the grayscale value is the grayscale level, with a value of 0 - 255

[0012] Further, the specific pruning of the grayscale histogram by the set shear threshold is as follows:

[0013] When the count of the small block grayscale level exceeds the shear threshold, it is pruned is the pruned histogram value, CL is the shear threshold represents the small block is the total number of pixels Calculate the total number of pruned pixels for the pruned part of the small block, specifically: , where is the total number of pruned pixels Re - distribute the pruned part according to the calculated total number of pruned pixels, and evenly distribute the pruned part to all grayscale levels: .

[0014] Further, the histogram equalization of the pruned grayscale histogram is as follows: Calculate the cumulative distribution function. For each small block, calculate the cumulative distribution function of the pruned histogram, and finally normalize the cumulative function:

[0015] where is the cumulative frequency of the grayscale level in the small block is the finally normalized cumulative function

[0016] ​Further, the specific process of stitching the processed small blocks into an output image is as follows: Bilinear interpolation is used to smooth the overlapping area of the image stitching. Interpolation is performed between four given known pixel points, and the value of the target point is calculated based on the relative distances of the input point among these known points:

[0017] Among them, is the interpolation result of the target point, are the values of the four known points, is the target point 's relative position in the horizontal direction, is the target point 's relative position in the vertical direction, , , and are the position coordinates of the four known points.

[0018] Further, the specific process of the bilateral filtering technology for eliminating noise interference in the output image is as follows: According to the spatial information and pixel intensity information of the original image, a bilateral filter is used to eliminate the noise interference in the image;

[0019] Among them, is the spatial Gaussian function, which calculates the weight based on the spatial distance, is the intensity Gaussian function, which calculates the weight based on the pixel value similarity, represents the normalization factor, which ensures that the sum of the weights is 1.

[0020] Further, the U-Net network includes two paths: an encoder and a decoder. The encoder and the decoder are connected by skip connections. The encoder extracts the high-level features of the image and reduces the resolution, and gradually obtains the abstract features through convolutional layers, ReLU activation functions, and max-pooling layers. The skip connections directly transfer the feature maps of the encoder to the decoder, combining the high-level semantic features and the low-level spatial features to generate a precise restored image.

[0021] Based on the above technical solutions, the following technical advantages have been achieved in the practical application of the underwater image enhancement method for complex environments of this invention patent: 1. The underwater image enhancement method for complex environments of this invention improves the color cast problem caused by optical characteristics by using an improved white balance algorithm, providing a correct color basis for subsequent processing. Then, logarithmic domain gamma transformation is used to adjust the pixel distribution, reducing the importance of highlight details and further enhancing the dark area, making the overall brightness distribution more uniform.

[0022] 2. The underwater image enhancement method for complex environments in the present invention divides the image into multiple small blocks and performs enhancement separately through contrast-limited adaptive histogram equalization, which can balance the overall performance of the underwater image in terms of brightness and contrast, while avoiding overstretching of overly dark or overly bright areas in the underwater image, preventing over-saturation or unnatural visual effects, and avoiding noise amplification.

[0023] 3. The underwater image enhancement method for complex environments in the present invention can effectively remove noise without the need to know the edge position in advance by using bilateral filtering, while retaining edge details, and then deblurs the underwater image based on the U-Net network architecture. Description of the Drawings

[0024] Figure 1 It is the flowchart of underwater image enhancement in the underwater image enhancement method for complex environments in the present invention.

[0025] Figure 2 It is the original underwater image and the three-color histogram in the shallow water area in the underwater image enhancement method for complex environments in the present invention.

[0026] Figure 3 It is the underwater image and the three-color histogram after red and blue channel compensation in the shallow water area in the underwater image enhancement method for complex environments in the present invention.

[0027] Figure 4 It is the original underwater image and the three-color histogram in the deep water area in the underwater image enhancement method for complex environments in the present invention.

[0028] Figure 5 It is the underwater image and the three-color histogram after red channel compensation in the deep water area in the underwater image enhancement method for complex environments in the present invention.

[0029] Figure 6 It is the original underwater image in the underwater image enhancement method for complex environments in the present invention.

[0030] Figure 7 It is the underwater image after gamma transformation of the original underwater image in the underwater image enhancement method for complex environments in the present invention.

[0031] Figure 8 It is the underwater image after histogram equalization of the original underwater image in the underwater image enhancement method for complex environments in the present invention.

[0032] Figure 9 It is the underwater image after bilateral filtering of the original underwater image in the underwater image enhancement method for complex environments in the present invention.

[0033] Figure 10It is the underwater image after deblurring the original underwater image in an underwater image enhancement method for complex environments according to the present invention by U-Net.

[0034] Figure 11 It is a schematic diagram of the linear interpolation method in an underwater image enhancement method for complex environments according to the present invention.

[0035] Figure 12 It is the U-Net structure diagram in an underwater image enhancement method for complex environments according to the present invention.

[0036] Figure 13 It is a comparison chart of the experimental results of various algorithms in an underwater image enhancement method for complex environments according to the present invention; among them, Figure 13 in (a) is the original underwater image, Figure 13 in (b) is the underwater image after DCP processing, Figure 13 in (c) is the underwater image after Retinex processing, Figure 13 in (d) is the underwater image after UWCNN processing, Figure 13 in (e) is the underwater image after FUnIE-GAN processing, Figure 13 in (f) is the underwater image after the processing of the present invention.

[0037] Figure 14 It is a comparison chart of the ablation experiment results of each module in an underwater image enhancement method for complex environments according to the present invention; among them, Figure 14 in (a) is the original underwater image, Figure 14 in (b) is the underwater image after white balance processing, Figure 14 in (c) is the underwater image after gamma processing, Figure 14 in (d) is the underwater image after Clahe processing, Figure 14 in (e) is the underwater image after bilateral filtering processing, Figure 14 in (f) is the underwater image after deblurring by U-Net. Detailed implementation manners

[0038] To make the objectives, technical solutions and advantages of the present invention clearer and more understandable, the present invention will be described below through specific examples shown in the drawings. However, it should be understood that these descriptions are only exemplary and are not intended to limit the scope of the present invention. In addition, in the following description, the descriptions of well-known structures and technologies are omitted to avoid unnecessarily confusing the concepts of the present invention.

[0039] Example 1 As Figure 1-14 shown, the underwater image enhancement method of this example specifically includes the following steps: S1. Obtain the original underwater image, identify the color cast of the original image through an improved white balance algorithm, and perform color cast compensation on the original image; S2. Divide the original image into multiple regional blocks, calculate the local histogram for each regional block, extract statistical features, determine the adaptive gamma value of each regional block, and determine the brightness value of each regional block through adaptive logarithmic domain gamma transformation; S3. Enhance the original image through contrast-limited adaptive histogram equalization technology. First, divide the original image into multiple small blocks, calculate the grayscale histogram for each small block, prune the grayscale histogram according to the set clipping threshold, perform histogram equalization through the pruned grayscale histogram, and then splice all the processed small blocks into an output image; S4. Perform weighted averaging according to the pixel values of the output image, and eliminate the noise interference of the output image through bilateral filtering technology; S5. Extract the features of the output image through the U-Net network, perform deblurring processing on the output image to generate a clear image, and finally output the enhanced underwater image.

[0040] The specific method for the improved white balance algorithm to identify the color cast of the original image and perform color cast compensation on the original image is as follows: Obtain the red, green, and blue channels of the original image and the average values of the red, green, and blue channels, and supplement the red and blue channels through the green channel to obtain the compensated red and blue channels;

[0041] Among them, 、 are the compensated red and blue channels; 、 and are the red, green, and blue channels of the original image; 、 and represent the average values of each channel, represents the compensation scale and takes the value of 1.

[0042] By using the improved white balance algorithm to improve the color cast problem caused by optical characteristics, provide a correct color basis for subsequent processing, and then use logarithmic domain gamma transformation to adjust the pixel distribution, reduce the importance of highlight details, further enhance the dark area, and make the overall brightness distribution more uniform.

[0043] The statistical features include the mean, variance, and maximum value of the local histogram of the image. The specific method for determining the brightness value of each regional block through adaptive logarithmic domain gamma transformation is as follows:

[0044] Among them, is the brightness value of the original image at position , is the brightness value of the original image at position , c is a constant used to normalize the result of the logarithmic transformation, is the adaptive gamma value, calculated based on local contrast, is the base gamma value, is the adjustment coefficient, is the variance of the local area, is the mean of the local area.

[0045] Through contrast-limited adaptive histogram equalization, the image is divided into multiple small blocks and enhanced separately, which can balance the overall performance of the underwater image in terms of brightness and contrast, while avoiding over-stretching of overly dark or overly bright areas in the underwater image, preventing over-saturation or unnatural visual effects, and avoiding noise amplification.

[0046] Specifically, the gray-level histogram of each small block is calculated as follows:

[0047] Among them, is the number of occurrences of the gray-level value in the small block , is the gray-level value, is the indicator function, which is 1 when and 0 otherwise, represents the gray-level value at position in the small block , is the gray-level, with a value of 0 - 255.

[0048] Specifically, the gray-level histogram is trimmed by the set clip threshold as follows:

[0049] When the count of the small block gray-level exceeds the clip threshold, it is trimmed, is the trimmed histogram value, CL is the clip threshold, represents the total number of pixels in the small block ; Calculate the total number of pixels to be trimmed for the trimmed part of the small block, specifically:

[0050] Among them, is the total number of trimmed pixels; Re-distribute the trimmed part according to the calculated total number of trimmed pixels, and evenly distribute the trimmed part to all gray-levels: ; Histogram equalization of the trimmed grayscale histogram is specifically as follows: Calculate the cumulative distribution function. For each small block, calculate the cumulative distribution function of the trimmed histogram, and finally normalize the cumulative function:

[0051] where, is the small block and is the cumulative frequency of the gray level is the finally normalized cumulative function.

[0052] Specifically, the processed small blocks are stitched into the output image as follows: Use bilinear interpolation to smooth the overlapping area of the image stitching, interpolate between the given four known pixel points, and calculate the value of the target point according to the relative distance of the input point among these known points:

[0053] where, is the interpolation result of the target point, are the values of the four known points, is the relative position of the target point in the horizontal direction, is the relative position of the target point in the vertical direction, , , and are the position coordinates of the four known points.

[0054] Specifically, the bilateral filtering technology eliminates the noise interference in the output image as follows: Eliminate the noise interference in the image through a bilateral filter according to the spatial information and pixel intensity information of the original image;

[0055] where, is the spatial Gaussian function, which calculates the weight based on the spatial distance, is the intensity Gaussian function, which calculates the weight based on the pixel value similarity, represents the normalization factor to ensure that the sum of the weights is 1.

[0056] By using bilateral filtering, it is not necessary to know the edge position in advance, effectively removing noise while retaining edge details. Then, based on the U-Net network architecture, the underwater image is deblurred.

[0057] The U-Net network includes two paths: an encoder and a decoder. The encoder and the decoder are connected by skip connections. The encoder extracts high-level features of the image and reduces the resolution, and obtains abstract features layer by layer through convolutional layers, ReLU activation functions, and max pooling layers. The skip connections directly transfer the feature maps of the encoder to the decoder, combining high-level semantic features and low-level spatial features to generate accurate restored images. Embodiment 2

[0058] An underwater image enhancement method for complex environments: Step 1, the color cast of underwater images affects the extraction of real color information underwater. To correct the color cast of underwater images, the present invention proposes an improved white balance algorithm; The improved white balance algorithm is based on the following four key observations and principles: (1) Strong preservation of the green channel: Compared with the red and blue channels, the green channel has relatively less attenuation underwater. This is because long-wavelength light (such as red light) disappears first in clear water, while green light attenuates more slowly. Therefore, the green channel can retain more color information in underwater images.

[0059] (2) Compensation method for red light attenuation: The green channel contains opponent color information relative to the red channel. Therefore, compensating for the attenuation of red light is particularly important. By introducing a part of the information of the green channel into the red channel, the loss of red light can be effectively compensated. Tests show that using only the information of the green channel to compensate for red light can better restore the overall color spectrum while maintaining the natural appearance of the background (water area). Although initially tried to introduce both the green and blue channels into the red channel, it was finally found that using only the green channel has the best effect.

[0060] (3) Determination of the compensation ratio: The intensity of compensation should be determined according to the difference between the average green value and the average red value. Based on the gray world assumption (i.e., in the case of no attenuation, the average values of each channel are equal), this difference reflects the imbalance between red and green attenuation. Through this proportional compensation, the distorted color information can be restored more accurately.

[0061] (4) Enhancement strategy for the red channel. To avoid over-saturation of the red channel due to compensating for the loss of red light, the enhancement of the red channel should mainly act on the pixels with smaller red channel values. That is, the information of the green channel will only be transferred to the areas with lower red channel values, without changing the pixels that already have important red components. This ensures the rationality of the overall image color balance.

[0062] In summary, the mathematical expression formula for compensation is as follows:

[0063] Among them, 、 represent the compensated red and blue channels; 、 and represent the red, green, and blue channels of the original image; 、 and represent the average value of each channel, represents the compensation scale and takes the value of 1.

[0064] In the case of poor water quality, both the red and blue channels need to be compensated, and the algorithm introduces a threshold K. When the ratio of the green channel to the blue channel is greater than K, the red and blue channels are compensated; otherwise, only the red channel is compensated. The value of K is usually selected between 1.1 and 1.5. K > 1.1 indicates that the green channel attenuation is less, and the red and blue channels need to be appropriately compensated. When K ≤ 1.1, it means that the green channel is close to the blue channel, and generally only the red channel needs to be compensated at this time. For deep water or high turbidity areas, the value of K may need to be higher, taking values from 1.5 to 2.0, because the green channel still dominates in deeper waters. Specific scenario factors: Shallow and clear water environment: The value of K is close to 1.1. Deep and turbid water environment: The value of K is 1.5 or above, because the scattering of the blue channel is more serious and the green color will dominate. This mechanism can flexibly adapt to different water quality conditions and improve the robustness of the algorithm.

[0065] Figure 2 The original underwater image in the shallow water area in shows a water body mainly dominated by light blue and green, with high light transmittance. The image color is mainly affected by suspended matter or refraction, Figure 2 The histogram in shows that the green channel increases significantly in the high pixel value range, indicating that the green component in the water is rich and the red component is less; as Figure 3 shown, the processed image makes the yellow and orange colors of the jellyfish more obvious, the background color saturation is improved, and the visual effect is enhanced. It shows that the blue channel frequency is uniform, and the red channel increases in the high pixel value range, enhancing the color performance of the jellyfish.

[0066] Figure 4 The original underwater image in the deep water area is mainly blue, reflecting the deep - sea environment, Figure 4 The histogram in shows that the blue channel increases significantly in the high pixel value range, the blue light component is rich, the green channel has a higher frequency in the medium - low intensity, indicating the presence of underwater plants or light refraction, and the red channel is lower in the low intensity, with less red component; as Figure 5 shown, the processed image is colorful and highlights the image details. It shows that the red channel has a low frequency in the low intensity but increases in the high intensity, indicating that more red light components are introduced.

[0067] Through the above improvements, when the improved white balance algorithm processes underwater images, it can not only restore accurate colors, but also maintain the naturalness of the background, achieving a more realistic visual effect.

[0068] Step 2: The underwater environment illumination is usually uneven, resulting in brightness differences, and white balance processing often makes the image too bright. Gamma transformation is widely used because of its simplicity and effectiveness. However, the traditional method of manually setting parameters cannot cope with local illumination differences, and the effect is not ideal. Logarithmic domain gamma transformation is an image enhancement technique that combines the advantages of logarithmic transformation and gamma transformation. It is mainly used to improve the dynamic range and contrast of images, especially effective in processing dark details of images. Logarithmic domain gamma transformation can be regarded as a non-linear transformation, which is based on logarithmic function and gamma function to enhance the brightness and contrast of images. Its core idea is to use logarithmic operation to process brightness information and then apply gamma transformation to the result.

[0069] The general formula for logarithmic domain gamma transformation is:

[0070] where, represents the brightness value of the input image, represents the brightness value of the output image. c is a constant used to amplify or reduce the output brightness (usually greater than zero), is the gamma value that controls the degree of non-linear transformation.

[0071] Adaptive gamma transformation is an image processing technique that dynamically adjusts the gamma value according to local features. Different from the traditional global gamma transformation, it can achieve more precise brightness and contrast adjustment. Its core idea is to apply different gamma values in different regions.

[0072] Logarithmic domain gamma transformation and adaptive gamma transformation can be combined to simultaneously utilize the detail enhancement ability of logarithmic transformation and the flexibility of adaptive gamma adjustment. This combination can apply different gamma values to different image regions, thus more effectively improving brightness and contrast.

[0073] The transformation steps are as follows: First, divide the input image into multiple small blocks, then calculate the local histogram for each small block and extract statistical features (such as mean, variance, maximum value, etc.), which will be used to determine the adaptive gamma value required for this block. ; Then, according to the local brightness histogram and features, determine the gamma value of each small block. Set a smaller gamma value in darker regions and a larger gamma value in brighter regions. Finally, apply the combined transformation formula of logarithmic domain gamma transformation to each small block: Assume the brightness value of the input image is , the formula combining logarithmic transformation and adaptive gamma transformation can be expressed as:

[0074] Wherein, represents the luminance value of the input image at position , represents the output image at position , c is a constant used to normalize the result of logarithmic transformation (usually equal to 255), is the adaptive gamma value calculated based on local contrast, is the base gamma value, is the adjustment coefficient, is the variance of the local area, the mean of the local area.

[0075] As Figure 6 shown, the color of the original image is bluish-green and lacks bright color contrast, probably due to the absorption and scattering effects of water. The image after gamma transformation is shown in Fig. 7. The contrast of the image is enhanced, the colors are more abundant, and the details are more obvious.

[0076] Step 3: The lighting conditions in the underwater environment are poor, especially in deep or turbid waters, resulting in low image contrast and difficult-to-identify details. Li Chengcheng et al. implemented histogram equalization through FPGA, optimized the implementation method of the algorithm, and achieved the goal of improving image contrast and image details; The present invention uses contrast-limited adaptive histogram equalization technology (CLAHE) to enhance underwater images. This improved adaptive histogram equalization (AHE) avoids noise amplification by limiting contrast. The calculation process of the algorithm of the present invention is as follows: (1) Divide the input image into multiple small blocks (regions), and these blocks are usually overlapping. The size of each block can be set according to specific applications, such as commonly 8x8, 16x16, etc.

[0077] (2) For each divided block, calculate its grayscale histogram and count the frequency of each gray level.

[0078]

[0079] Wherein, represents the number of occurrences of the gray value in the small block , is the indicator function, when , the value is 1, otherwise it is 0, represents the gray value at position in the small block , is the gray level, with values from 0 to 255.

[0080] (3)Contrast limit: To avoid noise caused by excessive contrast, a clip limit needs to be set , represents the total number of pixels in the small block .

[0081]

[0082] Trim the histogram: If the count of a certain gray level exceeds the clip threshold, it will be trimmed, is the value of the trimmed histogram.

[0083]

[0084] Calculate the trimmed part: The total number of trimmed pixels

[0085]

[0086] Re - distribute the trimmed part: Evenly distribute the trimmed part to all gray levels:

[0087] (4)Perform histogram equalization using the trimmed histogram.

[0088] Calculate the cumulative distribution function (CDF): For each small block, calculate the cumulative distribution function of the trimmed histogram: is for the small block in the gray level is the cumulative frequency, and the finally normalized CDF is .

[0089]

[0090] (5)Stitch all processed small blocks into the final output image, and smooth the overlapping areas using bilinear interpolation or the like to avoid obvious edges at the stitching points, as Figure 11 shown.

[0091] The basic idea of bilinear interpolation is to interpolate between four known points (pixels), and calculate the value of the target point according to the relative distances of the input point among these known points.

[0092]

[0093] Among them, is the interpolation result of the target point, are the values of the four known points, is for the target point The relative position in the horizontal direction (from 0 to 1), is the target point The relative position in the vertical direction (from 0 to 1), , , , are the position coordinates of four known points.

[0094] Step 4, Underwater images are often disturbed by noise caused by suspended particles. Using bilateral filtering technology, by combining spatial information and pixel intensity information, the edges are retained while the image is smoothed. The core idea is to perform weighted averaging on pixel values, and the weights are determined by spatial distance and pixel value similarity, ensuring that closer and more similar pixels have a greater impact on the current pixel; The output of the bilateral filter is defined as:

[0095] Among them, represents the spatial Gaussian function, which calculates weights based on spatial distance. represents the intensity Gaussian function, which calculates weights based on pixel value similarity, represents the normalization factor, ensuring that the sum of weights is 1.

[0096] Such as Figure 6 shown, the details of the original image are slightly blurred, and the influence of particles and light in the water makes the whole scene appear somewhat hazy. Through bilateral filtering processing as Figure 9 shown, the noise and noise in the image are significantly reduced, and the overall picture is clearer, but some details may be lost.

[0097] Step 5, The refractive index of water is higher than that of air. When light enters water, it will refract, resulting in the deviation of the object's position from the true position and causing out-of-focus. At the same time, water absorbs and scatters light, making the imaging blurred, especially in areas far from the light source; The present invention uses the U-Net network with excellent feature extraction ability as the basic network for underwater image enhancement, fully extracts the features of underwater images, and thus can effectively enhance underwater images in different scenarios. U-Net is a classic convolutional neural network structure, originally proposed by Olaf Ronneberger et al. in 2015 for biomedical image segmentation. Due to its efficient feature extraction ability and the design of skip connection, it is widely used in various image processing tasks, including image deblurring, segmentation, denoising, etc.

[0098] The core structure of U-Net is as Figure 12As shown, it is in a "U" shape and consists of two symmetric paths: an encoder (downsampling part) and a decoder (upsampling part). The encoder extracts high-level features of the image and reduces the resolution, obtaining abstract features layer by layer through convolutional layers, ReLU activation functions, and max pooling layers, but spatial information is lost. The decoder is responsible for restoring the image resolution and generating the output. Each layer contains upsampling and convolutional operations to fuse context features. Skip connections directly pass the feature maps of the encoder to the decoder, combining high-level semantic features with low-level spatial features to generate a more accurate restored image and effectively retain the spatial details lost during downsampling, solving the problem of gradient disappearance or feature loss in deep networks.

[0099] The present invention selects the UIEB (Under water Image Enhancement Benchmark) dataset. UIEB includes two subsets: 890 original underwater images and their corresponding high-quality reference images; 60 challenging underwater images. These images are divided into multiple scenes and provided together with the corresponding reference images for the evaluation and comparison of underwater image enhancement algorithms. 70% of the dataset is used for training and 30% for validation.

[0100] As shown in Figure 6, the details of this image are relatively blurred, affected by water scattering and insufficient lighting. The de-blurred image is shown in Figure 10. After de-blurring by U-Net, the clarity of the image is significantly improved. The color and structure of the bottom grid also become more obvious, enhancing the overall visibility.

[0101] Step six, to verify the effectiveness of the method of the present invention, the no-reference underwater color image quality evaluation metric UIQM is used as the evaluation criterion. UIQM (underwater image quality measures) linearly superimposes three independent metrics of chromaticity, saturation, and contrast to generate a comprehensive quality measurement value. The higher the UIQM value, the better the image quality and the higher the degree of conformity with human vision;

[0102] Among them, measures the color saturation of the image. usually reflects the structural information of the image, mainly looking at the texture and edge features of the image, combines the sharpness and contrast of the image. Usually, a higher value means better clarity and stronger contrast of the image. are weight coefficients, taking 0.0282, 0.2953, and 3.5753 respectively; UCIQE (Underwater Color Image Quality Evaluation Metric) is a comprehensive evaluation metric that can reflect the overall quality of an image. It is obtained through a linear combination of chromaticity, saturation, and luminance contrast. Generally speaking, a higher UCIQE value means better image quality;

[0103] Among them, is the chromaticity deviation, is the luminance contrast, is the average saturation, are the weight coefficients, taking 0.4680, 0.2745, and 0.2576 respectively.

[0104] In addition, the full-reference evaluation metrics Peak Signal-to-Noise Ratio (PSNR) and Structural Similarity Index (SSIM) are also selected for objective evaluation.

[0105] Peak Signal-to-Noise Ratio (PSNR) is an objective metric to measure the difference between a compressed image and the original image. The greater the difference, the worse the quality of the compressed image. For full-reference evaluation, PSNR is defined by the maximum pixel value (MAX) and the Mean Squared Error (MSE). The higher the PSNR, the smaller the distortion after compression. The calculation formula is:

[0106] Where, , represent the reference image and the distorted image with sizes of respectively, represents the maximum pixel value of the image. If each pixel is represented by 8-bit binary numbers, the value is 255. If it is a color image, the of the three RGB channels needs to be calculated and then divided by 3.

[0107] Structural Similarity Index (SSIM) considers the sensitivity of the human visual system to structural information by aggregating luminance similarity, contrast similarity, and structural similarity. Let x represent the reference image and y represent the distorted image to be measured. The calculation formula is:

[0108] Where, is the average value of x, is the average value of y, is the standard deviation of x, is the standard deviation of y, is the covariance of x and y, is a constant to avoid the denominator being zero.

[0109] Table 1 shows the comparative experiment results of each model on the dataset; the images are as Figure 13 shown. It can be seen from the table that the method of the present invention performs excellently in multiple image quality evaluation metrics; the UIQM score is 2.2758 (complex), which is the highest among all methods; the UCIQE scores are 0.6656 (original) and 0.6534 (complex), also leading the way. The PSNR reaches 33.0493 under complex conditions, showing a good signal-to-noise ratio. The SSIM score is 0.9513, indicating its advantage in structural similarity. Compared with other methods, especially the dark channel prior, the real-time underwater image enhancement model based on conditional generative adversarial network, and the deep underwater image and video enhancement inspired by underwater scene prior, the method of the present invention shows better image quality in various situations and is suitable for image processing challenges in practical applications. These results emphasize its effectiveness and reliability.

[0110] Table 1 Comparative experiment results of each model on the UIEB dataset

[0111] In the table, UIQM is the no-reference underwater color image quality evaluation metric, UCIQE is the comprehensive underwater color image quality evaluation metric, PSNR is the peak signal-to-noise ratio, and SSIM is the structural similarity index.

[0112] Step 7, to verify the effectiveness of the fusion of each module, an ablation experiment is carried out. The ablation experiment is carried out on the dataset in the same experimental environment as above, and the results are reported in Table 2. Some images are as Figure 14 shown.

[0113] According to Table 2, these results are the sequential superposition effects of each image processing module, showing the comprehensive performance of different methods in improving image quality. The scores of UIQM, UCIQE, PSNR, and SSIM change in different processing steps, and the combination of these methods has a significant impact on the final quality of the image. For example, the white balance processing achieves good results in the UIQM and SSIM metrics (2.0882 and 0.9913 respectively), while the logarithmic domain gamma transformation also performs better in PSNR (18.6406). This shows that sequentially superimposing each module can improve the visual quality of the image as a whole, and the utilities of different modules show different contributions in different metrics.

[0114] Table 2 Ablation experiment results of each module

[0115] Note: The above is the result of superimposing each module in sequence, not the result of a single module; in the table, UIQM is the underwater color image quality evaluation index without reference, UCIQE is the comprehensive underwater color image quality evaluation index, PSNR is the peak signal-to-noise ratio, and SSIM is the structural similarity index.

[0116] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them; although the present invention has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that it is still possible to modify the specific implementation manners of the invention or perform equivalent replacements for some technical features; without departing from the spirit of the technical solutions of the present invention, they should all be covered within the scope of the technical solutions claimed by the present invention.

Claims

1. An underwater image enhancement method for complex environments, characterized in that, The method specifically includes the following steps: S1. Obtain the original underwater image, identify the color cast of the original image through an improved white balance algorithm, and perform color cast compensation on the original image; S2. Divide the original image into multiple regional blocks, calculate the local histogram for each regional block, extract statistical features, determine the adaptive gamma value for each regional block, and determine the brightness value of each regional block through adaptive logarithmic domain gamma transformation; S3. Enhance the original image through contrast-limited adaptive histogram equalization technology. First, divide the original image into multiple small blocks, calculate the gray histogram for each small block, prune the gray histogram according to the set clip threshold, perform histogram equalization through the pruned gray histogram, and then splice all the processed small blocks into an output image; S4. Perform weighted averaging according to the pixel values of the output image, and eliminate the noise interference in the output image through bilateral filtering technology; S5. Extract the features of the output image through a U-Net network, perform deblurring processing on the output image to generate a clear image, and finally output the enhanced underwater image. The statistical features include the mean, variance, and maximum value of the local histogram of the image. The specific method for determining the brightness value of each regional block through adaptive logarithmic domain gamma transformation is as follows: , wherein, is the brightness value of the input image at the position , is the brightness value of the output image at the position , c is a constant used to normalize the result of the logarithmic transformation, is the adaptive gamma value calculated based on the local contrast, is the base gamma value, is the adjustment coefficient, is the variance of the local region, is the mean of the local region.

2. The underwater image enhancement method for complex environments according to claim 1, wherein The specific method for the improved white balance algorithm to identify the color cast of the original image and perform color cast compensation on the original image is as follows: Obtain the red, green, and blue channels of the original image and the average values of the red, green, and blue channels, and supplement the red and blue channels through the green channel to obtain the compensated red and blue channels; , Among them, , are the compensated red and blue channels; , and are the red, green, and blue channels of the original image; , and represent the average value of each channel, represents the compensation scale and takes the value of 1.

3. The underwater image enhancement method for complex environments according to claim 1, characterized in that Specifically, the calculation of the grayscale histogram for each small block is as follows: , Among them, is a small block the number of occurrences of the gray value in is the gray value, is an indicator function. When the value is 1, otherwise it is 0. represents the small block the position in the gray value of is the gray level, and the value is 0 - 255.

4. An underwater image enhancement method for complex environments according to claim 3, characterized in that, The specific method for pruning the gray histogram according to the set clip threshold is as follows: , When the count of a small block's gray level exceeds the clipping threshold, it is trimmed. is the trimmed histogram value, CL is the clipping threshold, represents the small block total number of pixels; Calculate the total number of pixels to be pruned for the part of the small block to be pruned. Specifically: , Among them, is the total number of pruned pixels; Reallocate the pruned part according to the total number of pruned pixels obtained by calculation, and evenly distribute the pruned part to all gray levels: .

5. An underwater image enhancement method for complex environments according to claim 4, characterized in that, The specific method for performing histogram equalization on the pruned gray histogram is as follows: Calculate the cumulative distribution function. For each small block, calculate the cumulative distribution function of the pruned histogram, and finally normalize the cumulative function; , wherein, is a small block in the gray level cumulative frequency, is the cumulative function after final normalization.

6. The underwater image enhancement method for complex environments according to claim 5, wherein The specific method for splicing the processed small blocks into an output image is as follows: Smooth the overlapping area of the image splicing through bilinear interpolation, interpolate between four given known pixel points, and calculate the value of the target point according to the relative distance of the input point among these known points; , Among them, is the interpolation result of the target point, are the values of four known points, is the target point 's relative position in the horizontal direction, is the target point 's relative position in the vertical direction, , , and are the position coordinates of the four known points.

7. An underwater image enhancement method for complex environments according to claim 1, characterized in that The specific method for the bilateral filtering technology to eliminate the noise interference in the output image is as follows: Eliminate the noise interference in the image through a bilateral filter according to the spatial information and pixel intensity information of the original image; , Among them, is a spatial Gaussian function that calculates weights based on spatial distance, is an intensity Gaussian function that calculates weights based on pixel value similarity, represents a normalization factor to ensure that the sum of weights is 1.

8. An underwater image enhancement method for complex environments according to claim 1, characterized in that, The U-Net network includes two paths: an encoder and a decoder. The encoder and the decoder are connected through skip connections. The encoder extracts the high-level features of the image and reduces the resolution, and obtains abstract features layer by layer through convolutional layers, ReLU activation functions, and max pooling layers. The skip connection directly transfers the feature map of the encoder to the decoder, combines the high-level semantic features and the low-level spatial features, and generates an accurate restored image.

Citation Information

Patent Citations

  • Multi-scale fusion underwater image enhancement method combined with adaptive gamma correction

    CN116630198A

  • Underwater image enhancement method based on adaptive histogram and G-MSRCR

    CN117788303A

  • Underwater image enhancement method based on Unet and multi-scale feature fusion

    CN118761923A

  • Underwater image enhancement method based on adaptive color equalization and multi-scale fusion

    CN119863411A

  • Apparatus for Correcting Visibility Distortion of Underwater Image, and Method thereof

    KR102741528B1

Cited By

  • Device and method for intelligently investigating types and quantity of fishes

    CN121074619A