Underwater image enhancement method based on local contrast optimization

By dynamically adjusting the color and contrast of underwater images based on local contrast optimization, and improving the brightness in the HSV color space, the problems of medium color shift and low contrast in the underwater image processing in the prior art are solved, and a higher quality image enhancement effect is achieved.

CN120088177APending Publication Date: 2025-06-03DALIAN MARITIME UNIVERSITY +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510011043.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-03
Publication Date
2025-06-03

AI Technical Summary

Technical Problem

Existing underwater image processing methods face the problem of color shift and low contrast caused by light attenuation, and it is difficult to maintain a stable treatment effect under various water quality and lighting conditions, which limits its practical application.

Method used

Using an underwater image enhancement method based on local contrast optimization, the color mean and local contrast around each pixel are calculated through a sliding window, the parameters of the green and blue channels are dynamically adjusted to compensate for color deviation, and smoothed by nonlinear adjustment factors. At the same time, by calculating the A and B percentiles of each channel, the saturation and contrast of the image are adjusted, and brightness enhancement is performed on the HSV color space to obtain the final enhanced image.

Benefits of technology

It effectively improves the brightness and contrast of underwater non-uniform light images, provides more details enhancement, and maintains a stable treatment effect under a variety of water quality and lighting conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120088177A_ABST
    Figure CN120088177A_ABST
Patent Text Reader

Abstract

The invention discloses an underwater image enhancement method based on local contrast optimization. The method comprises the following steps: acquiring an underwater non-uniform illumination image I to be processed; calculating a color mean value and a local contrast around each pixel of the underwater non-uniform illumination image I through a sliding window, dynamically adjusting parameters of a green channel and a blue channel according to a local contrast result to compensate color deviation, and smoothing the compensated color deviation through a nonlinear adjustment factor; the boundary threshold value of the image is obtained by calculating the A percentile and the B percentile of each of the green channel, the blue channel and the red channel, and the image saturation and the contrast ratio of the underwater non-uniform illumination are adjusted through the boundary threshold value of the image; and a final enhanced image E is obtained in an HSV color space through a brightness improvement algorithm based on the underwater non-uniform illumination image with adjusted saturation and contrast by adopting a global self-adaptive principle. According to the invention, the brightness and contrast of the underwater non-uniform illumination image can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of digital image processing, and relates to an underwater image enhancement method based on local contrast optimization. Background Art

[0002] In an underwater environment, images usually suffer from problems such as blurring and color distortion due to physical phenomena such as light absorption, scattering, and refraction. These phenomena cause significant changes in the propagation path and intensity of light in water, and are further affected by water quality, suspended solid concentration, and environmental light source distribution, resulting in an image with uneven illumination intensity. Such complex optical characteristics severely limit the quality of underwater imaging, posing challenges to underwater image processing and analysis. Existing underwater image processing methods face problems of color deviation and low contrast caused by light attenuation, as well as difficulty in maintaining stable processing effects under various water qualities and lighting conditions, restricting their practical applications. Summary of the Invention

[0003] To solve the above problems, the technical solution adopted by the present invention is: an underwater image enhancement method based on local contrast optimization, comprising the following steps:

[0004] Step 1, obtain an underwater non-uniform illumination image I to be processed;

[0005] Step 2, calculate the color mean and local contrast around each pixel of the underwater non-uniform illumination image I through a sliding window, and dynamically adjust the parameters of the green channel and the blue channel according to the local contrast result to compensate for color deviation, and perform smoothing processing on the compensated color deviation through a non-linear adjustment factor;

[0006] Step 3, obtain the boundary threshold of the image by calculating the A-th and B-th percentiles of each of the green channel, the blue channel, and the red channel, and adjust the image saturation and contrast of the underwater non-uniform illumination through the boundary threshold of the image;

[0007] Step 4, adopt the global adaptive principle, and based on the underwater non-uniform illumination image with adjusted saturation and contrast, obtain the final enhanced image E through a brightness enhancement algorithm in the HSV color space (H represents hue, S represents saturation, and V represents brightness).

[0008] Further: 5% ≤ A ≤ 10%, 90% ≤ B ≤ 95%.

[0009] Further: The sliding window calculation formula is as follows:

[0010] localContrast1 = stdfilt(g,ones(w)) (1)

[0011] localContrast2 = stdfilt(b, ones(w)) (2)

[0012] Where: g and b are the pixel values of the green and blue channels respectively, and w is the sliding window size.

[0013] Furthermore: The parameters of the green channel and the blue channel are dynamically adjusted according to the local contrast result to compensate for color deviation. The compensation formula is used to dynamically adjust the parameters, and the compensation formula is as follows:

[0014] I rc = r + a rc ·(g mean - r mean )·(1 - r)·g + b rc ·(b mean - r mean )·(1 - r)·b (3)

[0015] a rc = 0.5 + α·localContrast1

[0016] b rc = 0.5 + α·localContrast2

[0017] Wherein, r, g, and b respectively represent the pixel values of the red, green, and blue channels; r mean , g mean , b mean are the color means respectively; α is a non-linear adjustment factor, and the dynamic parameters a rc and b rc are calculated through α, and are used to adjust the compensation effect of each channel according to the local contrast; a rc is the dynamic parameter of the green channel, and b rc is the dynamic parameter of the blue channel.

[0018] Furthermore: The process of obtaining the boundary threshold of the image by calculating the A-th and B-th percentiles of each of the green channel, the blue channel, and the red channel, and adjusting the image saturation and contrast of the underwater non-uniform illumination through the boundary threshold of the image is as follows:

[0019] Step 3.1, Process the image I through quantiles g The pixel values of each channel, limit the pixel values within a suitable range, calculate the A%-th and B%-th percentiles of the given vector, and use the A%-th and B%-th percentiles as the new image boundary threshold. The formula is as follows:

[0020]

[0021] Step 3.2. Crop the pixel values, and crop the pixel values of each channel to the range according to formula (6):

[0022] temp i = max(percentile A , min(percentile B , temp i )) (6)

[0023] where temp i represents the i-th pixel value;

[0024] Step 3.3. According to formula (7), stretch the pixel values to the range [0, 255] in two cases. The formula is as follows:

[0025]

[0026] where, when P B < 100, linearly map the pixel values from [p min , 105] to [0, 255], and when P B ≥ 100, linearly map the pixel values from [p min , 1.2·p max to [0, 255];

[0027] Step 3.4. Output the image I after color balance processing g .

[0028] Furthermore: In the process of obtaining the final enhanced image E by using the global adaptive principle based on the underwater non-uniform illumination image with adjusted saturation and contrast in the HSV color space (H represents hue, S represents saturation, and V represents brightness), the process is as follows:

[0029] According to the Weber-Fechner law, the human perception of the change in stimuli is not proportional to the absolute change in physical intensity, but is approximately logarithmic. The specific formula of the logarithmic function is as follows:

[0030]

[0031] where: I g represents the output result of global adaptive processing, I w (x, y) represents the brightness value of the input image, I wmax represents the maximum value of the brightness of the input image, represents the logarithmic average value of the brightness of the input image, which is obtained by formula (9):

[0032]

[0033] Among them, m*n represents the image size, and the value of σ is 10 -6 to 10 -3 to prevent the situation of black dots with brightness 0 in the image. A common value is 10 -6 to 10 -3 , and the value here is 10 -6 .

[0034] An underwater image enhancement device based on local contrast optimization, including

[0035] An acquisition module: used to acquire the underwater non-uniform illumination image I to be processed;

[0036] A color deviation adjustment module: used to calculate the color mean and local contrast around each pixel of the underwater non-uniform illumination image I through a sliding window, and dynamically adjust the parameters of the green channel and the blue channel according to the local contrast result to compensate for color deviation, and smooth the compensated color deviation through a non-linear adjustment factor;

[0037] A saturation and contrast adjustment module: used to calculate the A-th and B-th percentiles of each of the green channel, the blue channel, and the red channel to obtain the boundary threshold of the image, and adjust the saturation and contrast of the underwater non-uniform illumination image through the boundary threshold of the image;

[0038] A brightness adjustment module: used to adopt the global adaptive principle, based on the underwater non-uniform illumination image with adjusted saturation and contrast, and obtain the final enhanced image E through a brightness enhancement algorithm in the HSV color space (H represents hue, S represents saturation, and V represents brightness).

[0039] An underwater image enhancement method based on local contrast optimization provided by the present invention, by acquiring the captured underwater non-uniform illumination image, first performing color equalization operations on three channels in the RGB color space, adding color compensation to the blue and green channels, and smoothing the result through a non-linear adjustment factor. Then, by performing quantile processing on the pixel values of each channel, the pixel values are restricted within a suitable range, thereby enhancing the overall contrast and visual effect of the image. Finally, adopting the global adaptive principle, the V channel (brightness) is adjusted in the HSV color space to effectively enhance the brightness of the image while maintaining its details. The present invention can effectively improve the brightness and contrast of the underwater non-uniform illumination image and provide more detailed enhancement. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the accompanying drawings required for the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can be obtained based on these drawings.

[0041] Figure 1 It is the flowchart of the method of the present invention;

[0042] Figure 2 It is the underwater non-uniform illumination image input for the present invention;

[0043] Figure 3 It is the image output after compensating for color deviation using the present invention;

[0044] Figure 4 It is the image output after color balancing using the present invention;

[0045] Figure 5 It is the image output using the brightness enhancement algorithm of the present invention. Specific embodiments

[0046] It should be noted that, without conflict, the embodiments in the present invention and the features in the embodiments can be combined with each other. The following will refer to the accompanying drawings and combine the embodiments to detail the present invention.

[0047] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the following will combine the accompanying drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, rather than all embodiments. The following description of at least one exemplary embodiment is actually only illustrative and in no way restricts the present invention and its application or use. Based on the embodiments in the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.

[0048] Figure 1 It is the flowchart of the method of the present invention;

[0049] An underwater image enhancement method based on local contrast optimization includes the following steps:

[0050] Step 1, obtain the underwater non-uniform illumination image I to be processed; Figure 2 It is the underwater non-uniform illumination image input for the present invention;

[0051] Step 2: Calculate the color mean and local contrast around each pixel of the underwater non-uniform illumination image I through a sliding window, dynamically adjust the parameters of the green channel and the blue channel according to the local contrast result to compensate for color deviation, and smooth the compensated color deviation through a non-linear adjustment factor;

[0052] Step 3: Obtain the boundary threshold of the image by calculating the A-th and B-th percentiles of each of the green channel, the blue channel, and the red channel, and adjust the image saturation and contrast of the underwater non-uniform illumination through the boundary threshold of the image;

[0053] Step 4: Adopt the global adaptive principle, and based on the underwater non-uniform illumination image with adjusted saturation and contrast, obtain the final enhanced image E through a brightness enhancement algorithm in the HSV color space (H represents hue, S represents saturation, and V represents value).

[0054] The steps S1 / S2 / S3 / S4 are executed in sequence;

[0055] 5% ≤ A ≤ 10%, 90% ≤ B ≤ 95%, the optimal value of A is 5%, and the optimal value of B is 95%;

[0056] Figure 3 is the image output after compensating for color deviation using the present invention;

[0057] The process of calculating the color mean and local contrast around each pixel of the underwater non-uniform illumination image I through a sliding window, dynamically adjusting the parameters of the green channel and the blue channel according to the local contrast result to compensate for color deviation, and smoothing the compensated color deviation through a non-linear adjustment factor is as follows:

[0058] Step 2.1: Calculate the color mean around each pixel and the local contrast of the adjacent region through the sliding window formula. The expression of the sliding window formula is as follows:

[0059] localContrast1 = stdfilt(g,ones(w)) (1)

[0060] localContrast2 = stdfilt(b,ones(w)) (2)

[0061] where: g and b are the pixel values of the green and blue channels respectively, and w is the sliding window size;

[0062] Step 2.2: Dynamically adjust the parameters of the green channel and the blue channel according to the local contrast result to compensate for color deviation. The compensation formula is as follows:

[0063] I rc = r + a rc·(g mean -r mean )·(1 - r)·g + b rc ·(b mean -r mean )·(1 - r)·b (3)

[0064] a rc =0.5 + α·localContrast1

[0065] b rc =0.5 + α·localContrast2

[0066] Among them, r, g, and b respectively represent the pixel values of the red, green, and blue channels; r mean , g mean , b mean are the color means respectively; α is a non - linear adjustment factor, and the dynamic parameters a rc and b rc are calculated through α, which are used to adjust the compensation effect of each channel according to the local contrast. a rc is the dynamic parameter of the green channel, and b rc is the dynamic parameter of the blue channel;

[0067] Step 2.3, Smooth the compensated result through the non - linear adjustment factor to enhance the overall color and contrast performance of the image,

[0068]

[0069] Step 2.4, Merge the adjusted red, green, and blue channels, and output the processed image I g .

[0070] Figure 4 is the image output after color balancing using the present invention;

[0071] The process of obtaining the boundary threshold of the image by calculating the A - th and B - th percentiles of each of the green, blue, and red channels, and adjusting the image saturation and contrast of the underwater non - uniform illumination through the boundary threshold of the image is as follows:

[0072] Step 3.1, Process the image I g for the pixel values of each channel, limit the pixel values within a suitable range, calculate the A - th and B - th percentiles of the given vector, and use the A - th and B - th percentiles as the new image boundary threshold. The formula is as follows:

[0073]

[0074] Step 3.2. Crop the pixel values, and crop the pixel values of each channel to the range according to formula (6):

[0075] temp i =max(percentile A ,min(percentile B ,temp i )) (6)

[0076] where temp i represents the i-th pixel value;

[0077] Step 3.3. According to formula (7), stretch the pixel values to the range of [0, 255] in two cases. The formula is as follows:

[0078]

[0079] where, when P B <100, linearly map the pixel values from [p min , 105] to [0, 255], and when P B ≥100, linearly map the pixel values from [p min , 1.2·p max to [0, 255];

[0080] Step 3.4. Output the image I g .

[0081] The process of obtaining the final enhanced image E by using the global adaptive principle, based on the underwater non-uniform illumination image with adjusted saturation and contrast, on the HSV color space (H represents hue, S represents saturation, and V represents value) through the brightness enhancement algorithm is as follows:

[0082] According to the Weber-Fechner law, the human perception of the change of stimuli is not proportional to the absolute change of physical intensity, but approximately a logarithmic relationship. The specific formula of the logarithmic function is as follows:

[0083]

[0084] where: I g represents the output result of the global adaptive processing, I w (x, y) represents the brightness value of the input image, I wmax represents the maximum value of the brightness of the input image, represents the logarithmic average value of the brightness of the input image, which is obtained by formula (9):

[0085]

[0086] Among them, m*n represents the image size, and σ is a very small value to prevent the situation of black dots with brightness 0 in the image. A common value is 10 -6 to 10 -3 , and here the value is taken as 10 -6 .

[0087] Merge the processed red, green, and blue channels to obtain the final enhanced RGB image; Figure 5 It is the image output by using the brightness enhancement algorithm of the present invention;

[0088] An underwater image enhancement device based on local contrast optimization includes

[0089] An acquisition module: used to acquire the underwater non-uniform illumination image I to be processed;

[0090] A color deviation adjustment module: used to calculate the color mean and local contrast around each pixel of the underwater non-uniform illumination image I through a sliding window, and dynamically adjust the parameters of the green channel and the blue channel according to the local contrast result to compensate for the color deviation, and smooth the compensated color deviation through a non-linear adjustment factor;

[0091] A saturation and contrast adjustment module: used to obtain the boundary threshold of the image by calculating the A-th and B-th percentiles of each of the green channel, the blue channel, and the red channel, and adjust the saturation and contrast of the underwater non-uniform illumination image through the boundary threshold of the image;

[0092] A brightness adjustment module: used to adopt the global adaptive principle, based on the underwater non-uniform illumination image with adjusted saturation and contrast, obtain the final enhanced image E through a brightness enhancement algorithm in the HSV color space (H represents hue, S represents saturation, and V represents brightness).

[0093] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. An underwater image enhancement method based on local contrast optimization, characterized in that: The following steps are involved: Step 1, obtaining an underwater non-uniform illumination image I to be processed; Step 2: Calculate the color mean and local contrast around each pixel of the underwater non-uniform illumination image I through a sliding window, and dynamically adjust the parameters of the green channel and the blue channel according to the local contrast result to compensate for the color deviation, and smooth the compensated color deviation through a nonlinear adjustment factor; Step 3, by calculating the Ath and Bth percentiles of each channel in the green channel, the blue channel and the red channel, the boundary threshold of the image is obtained, and the image saturation and contrast of the underwater non-uniform illumination are adjusted by the boundary threshold of the image; Step 4: Using the global adaptive principle, based on the underwater non-uniform illumination image with adjusted saturation and contrast, a brightness enhancement algorithm is used in the HSV color space to obtain the final enhanced image E.

2. The underwater image enhancement method based on local contrast optimization according to claim 1, characterized in that: 5%≤A≤10%, 90%≤B≤95%.

3. The underwater image enhancement method based on local contrast optimization according to claim 1, characterized in that: The sliding window calculation formula is as follows: localContrast1=stdfilt(g,ones(w)) (1) localContrast2=stdfilt(b,ones(w)) (2) Where: g and b are the pixel values ​​of the green and blue channels respectively, and w is the sliding window size.

4. The underwater image enhancement method based on local contrast optimization according to claim 1, characterized in that: The parameters of the green channel and the blue channel are dynamically adjusted according to the local contrast result to compensate for the color deviation using a compensation formula to dynamically adjust the parameters. The compensation formula is as follows: I rc =r+a rc ·(g mean -r mean )·(1-r)·g+b rc ·(b mean -r mean )·(1-r)·b (3) a rc =0.5+α·localContrast1 b rc =0.5+α·localContrast2 Among them, r, g, and b represent the pixel values ​​of the red, green, and blue channels respectively; mean , g mean 、b mean are the color mean values ​​respectively; α is the nonlinear adjustment factor, and the dynamic parameter a is calculated by α rc and b rc , used to adjust the compensation effect of each channel according to the local contrast; a rc is the dynamic parameter of the green channel, b rc Dynamics parameter for the blue channel.

5. The underwater image enhancement method based on local contrast optimization according to claim 2, characterized in that: The process of obtaining the boundary threshold of the image by calculating the Ath and Bth percentiles of each of the green channel, the blue channel, and the red channel, and adjusting the saturation and contrast of the image under underwater non-uniform illumination by the boundary threshold of the image is as follows: Step 3.1: Process image I by quantiles g The pixel values ​​of each channel are restricted to a suitable range, the A% and B% percentiles of the given vector are calculated, and the A% and B% percentiles are used as the new image boundary thresholds. The formula is as follows: Step 3.2: Clip pixel values. According to formula (6), the pixel values ​​of each channel are clipped to the range: temp i =max(percentile A ,min(percentile B ,temp i )) (6) Among them, temp i represents the i-th pixel value; Step 3.3: According to formula (7), the pixel value is stretched to the range of [0.255] in two cases. The formula is as follows: Among them, P B When <100, the pixel value is changed from [p min , 105] linearly mapped to [0, 255], P B ≥100, the pixel value is changed from [p min , 1.2·p max ] linearly mapped to [0, 255]; Step 3.4: Output the color-balanced image I g .

6. The underwater image enhancement method based on local contrast optimization according to claim 1, characterized in that: The process of obtaining the final enhanced image E by using the global adaptive principle and adjusting the saturation and contrast of the underwater non-uniform illumination image through the brightness enhancement algorithm in the HSV color space is as follows: According to the Weber-Fechner law, human perception of stimulus changes is not proportional to the absolute change in physical intensity, but is approximately logarithmic. The specific formula of the logarithmic function is as follows: Where: I g Represents the output result of global adaptive processing, I w (x, y) represents the brightness value of the input image, I wmax Indicates the maximum value of the input image brightness, Represents the logarithmic mean of the input image brightness value, which is obtained by formula (9): Among them, m*n represents the image size, and the value of σ is 10 -6 to 10 -3 In order to prevent the situation where there are black spots with brightness of 0 in the image.

7. An underwater image enhancement device based on local contrast optimization, characterized in that: include Acquisition module: used to acquire the underwater non-uniform illumination image I to be processed; Color deviation adjustment module: used to calculate the color mean and local contrast around each pixel of the underwater non-uniform illumination image I through a sliding window, and dynamically adjust the parameters of the green channel and the blue channel according to the local contrast result to compensate for the color deviation, and smooth the compensated color deviation through a nonlinear adjustment factor; Saturation and contrast adjustment module: used to obtain the boundary threshold of the image by calculating the Ath and Bth percentiles of each channel in the green channel, the blue channel and the red channel, and adjust the image saturation and contrast of underwater non-uniform illumination through the boundary threshold of the image; Brightness adjustment module: It is used to adopt the global adaptive principle, adjust the saturation and contrast of the underwater non-uniform illumination image, and obtain the final enhanced image E through the brightness enhancement algorithm in the HSV color space.