An underwater color cast image color correction method based on a directional solution Retinex model
Patent Information
- Application Number
- CN202410797306.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-20
- Publication Date
- 2026-09-18
- Estimated Expiration
- 2044-06-20
AI Technical Summary
[0004]本发明提供一种可以妥善校正水下光学图像偏色问题的方法,旨在解决当前基于成像模型的方法无法准确估计出透射图和全局背景光以及基于学习的方法鲁棒性不佳的问题
[0044] This invention employs a strategy that simultaneously considers information from the original reflection and light source components, aiming at a specific goal to directionally solve for the new reflection and light source components. This invention treats the new reflection component as an expression of detailed texture information and global brightness, and the new light source component as the final expression of color. Under Gaussian blur conditions with minimal standard deviation, it effectively corrects various color cast problems, improves the quality of underwater optical images, and is the optimal white balance method for underwater scenes.
Smart Images

Figure CN118799239B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing, specifically to a color correction method for underwater color-distorted images based on directional solving of the Retinex model. Background Technology
[0002] Abundant marine resources have attracted countries to compete in marine development. This manifests in various fields, including marine biological research, marine ecological environment research, underwater archaeology, underwater facility inspection, and military applications, involving detection, identification, monitoring, and investigation, primarily using optical and acoustic methods. Optical imaging, compared to acoustic imaging, offers advantages such as higher information readability, less noise, and the ability to provide color and texture information, thus gaining increasing recognition and attention. However, the complex underwater imaging environment causes visible light to be unevenly absorbed as it propagates in water, resulting in four main color casts in the images: blue, green, blue-green, and yellow.
[0003] Complex color casts significantly reduce the practical effectiveness of mainstream underwater optical image quality improvement algorithms. Specifically, imaging model-based methods cannot accurately estimate the image's transmission map and global background light, while deep learning-based methods cannot train robust models under conditions of complex color casts and scarce available datasets. Currently, not only are sophisticated underwater optical image quality improvement algorithms unable to solve the color cast problem, but various white balance algorithms also fall into this predicament. Summary of the Invention
[0004] This invention provides a method for effectively correcting color cast in underwater optical images, aiming to address the limitations of current imaging model-based methods in accurately estimating transmission maps and global background light, as well as the poor robustness of learning-based methods. Furthermore, this invention contributes to exploring domain adaptation issues for images from different underwater and land scenes.
[0005] This invention proposes a method for directionally solving the Retinex model that simultaneously considers the reflection component and the light source component information. The aim is to properly eliminate various color cast problems that are common in underwater optical images, and it is the best alternative to existing white balance algorithms.
[0006] The technical solution adopted by the present invention to achieve the above objectives is as follows:
[0007] A color correction method for underwater color-distorted images based on directional solution of the Retinex model includes the following steps:
[0008] 1) Based on the Retinex model I(x,y)=R(x,y)×L(x,y), with the help of Gaussian blur, the original image I(x,y) is decomposed in the logarithmic domain to obtain the reflection component R(x,y) and the light source component L(x,y);
[0009] 2) Based on the pixel intensity mean of the reflection component R(x,y), determine whether the decomposed reflection component contains enough effective information. If so, proceed to step 3). Otherwise, directly apply the solution strategy of the light source component to the original image to obtain the improved result.
[0010] 3) Targetedly solve for the new reflection component and light source component, and determine whether the pixel intensity of any channel in the new reflection component meets the threshold. If it meets the threshold, the solution strategy for the light source component is directly applied to the original image to obtain the improved result; otherwise, proceed to step 4).
[0011] 4) Combine the new reflection component and the light source component, and obtain the improved image through gamma correction.
[0012] Step 1) specifically refers to:
[0013]
[0014] Where σ represents the standard deviation of the intensity of all pixels in the neighborhood, and i(x,y), r(x,y), and l(x,y) represent I(x,y), R(x,y), and L(x,y) in the logarithmic domain.
[0015] Step 2) specifically refers to:
[0016] If the average pixel intensity is greater than or equal to the first threshold, it is considered that the reflection component provides sufficient effective information, and a new reflection component and light source component are solved in a directional manner.
[0017] If the average pixel intensity is less than the first threshold, it is considered that the reflection component provides too little information, and the solution strategy for the light source component is directly applied to the original image to obtain improved results.
[0018] The directional solution for the reflection component includes the following steps:
[0019] a) Obtain the clear reflection component R without haze. clear ;
[0020] R clear =R2(x,y)-β[F3(x,y)*R1(x,y)]
[0021] Where R1(x,y) and R2(x,y) are the reflection components obtained based on the standard deviation values σ1 and σ2, F3(x,y) is the Gaussian blur with a standard deviation value of σ3, and β is a constant;
[0022] b) Scale R using the ratio of 180 to the average pixel intensity of each channel. clear Pixel values for each channel;
[0023]
[0024] Among them, R ′ clear For the scaled reflection components, avg c is the pixel mean of channel c, and r, g, b are the three channels;
[0025] c) Based on R ′ clear The channel with the median average pixel intensity among the three channels is c3, c3∈{r,g,b}. ′ clear Convert to a light grayscale image with consistent pixel density across three channels and detailed texture.
[0026] d) Use the light gray image as a new reflection component with appropriate global brightness and containing texture information.
[0027] e) Calculate the new reflection component The percentage of pixels whose pixel intensity is below the second threshold in any channel:
[0028] If the proportion is greater than or equal to the third threshold, the information provided by the new reflection component is considered invalid. The light source component is then solved in a directional manner, and the solution strategy for the light source component is directly applied to the original image to obtain improved results.
[0029] If the proportion is less than the third threshold, then the information provided by the newly obtained reflection component is considered valid, and step 4 is executed.
[0030] The targeted solution for the light source components, i.e., the strategy for solving the light source components, includes the following steps:
[0031] a) Obtain the luminance component l of the original light source component L0, i.e., L(x,y), in the CIE Lab color space;
[0032]
[0033] Where l represents the luminance component of the original image in the CIE Lab color space;
[0034] b) Based on different judgment conditions, use linear compensation to compensate for the missing information in the color-distorted image;
[0035]
[0036] Where ω1, ω2, ω3, and ω4 are all linear compensation weights;
[0037] c) Obtain a new light source component containing the correct color distribution based on the gain factor f.
[0038]
[0039] in, `median` is used to calculate the median, and `avg(c1,c2)` represents the overall mean of channels c1 and c2. The light source component to be gained is the light source component after the missing information has been compensated.
[0040] Step 4) specifically involves:
[0041]
[0042] Among them, I ′ (x,y) represents the improved image.
[0043] The present invention has the following beneficial effects and advantages:
[0044] This invention employs a strategy that simultaneously considers information from the original reflection and light source components, aiming at a specific goal to directionally solve for the new reflection and light source components. This invention treats the new reflection component as an expression of detailed texture information and global brightness, and the new light source component as the final expression of color. Under Gaussian blur conditions with minimal standard deviation, it effectively corrects various color cast problems, improves the quality of underwater optical images, and is the optimal white balance method for underwater scenes. Attached Figure Description
[0045] Figure 1 This is a flowchart of the method of the present invention. Detailed Implementation
[0046] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments.
[0047] like Figure 1 As shown, the technical solution adopted by the present invention is to provide a method for preprocessing color cast in underwater optical images, including the following steps:
[0048] Step 1: Based on the Retinex model I(x,y)=R(x,y)×L(x,y), use Gaussian blur... The reflection component R(x,y) and the light source component L(x,y) are obtained by decomposing the input image I(x,y) in the logarithmic domain.
[0049]
[0050] Step 2: Based on the global pixel mean of the reflection component R(x,y), determine whether the decomposed reflection component contains sufficient effective information.
[0051] Step 2.1: If the average intensity of the pixel is greater than or equal to a certain threshold, it is considered that the reflection component provides sufficient effective information, and step 3 is executed.
[0052] Step 2.2: If the average intensity of the pixel is less than a given threshold, it is considered that the reflection component provides too little information. In this case, the solution strategy for the light source component is directly applied to the original image to obtain an improved result.
[0053] Step 3, the core content of the present invention: simultaneously considering the information of the reflection component and the light source component, directionally solving for the new reflection component and the light source component, the new reflection component is used to directionally characterize the image's detailed texture and global brightness information, and the new light source component is used to directionally characterize the image's color distribution;
[0054] Step 3.1, directional solution for reflection components;
[0055] Step 3.1.1: Obtain the clear reflection component R without haze. clear ;
[0056] R clear =R2(x,y)-β[F3(x,y)*R1(x,y)]
[0057] Step 3.1.2, scale R using the ratio of 180 to the average pixel intensity of each channel. clear Pixel values for each channel;
[0058]
[0059] Step 3.1.3, based on R ′ clear The channel with the median average pixel intensity among the three channels is c3, c3∈{r,g,b}. ′ clear Converted into a light grayscale image with consistent pixel density across three channels, containing detailed textures;
[0060]
[0061] Step 3.1.4: Obtain a new reflection component with appropriate global brightness, containing texture information.
[0062]
[0063] Step 3.1.5, calculate the new reflection component. The percentage of low-intensity pixels in any channel;
[0064] (1) If the value is greater than or equal to the threshold, the information provided by the newly obtained reflection component is considered invalid, and the solution strategy of the light source component is directly used to obtain the improved result in the original image.
[0065] (2) If the value is below the threshold, the information provided by the newly obtained reflection component is considered valid, and step 3.2 continues.
[0066] Step 3.2, directional solution of light source components;
[0067] Step 3.2.1: Obtain the luminance component l of the original light source component L0 in the CIE Lab color space;
[0068]
[0069] Step 3.2.2: Based on different judgment conditions, use linear compensation to compensate for the missing information in the color-distorted image;
[0070]
[0071] Step 3.2.3: By using the gain factor, a new light source component containing the correct color distribution can be obtained.
[0072]
[0073] Step 4: Combine the new reflection component and the light source component, and obtain the improved image through gamma correction;
[0074]
[0075] Example
[0076] (1) Select the parameters required for the calculation and processing:
[0077] The standard deviations of the Gaussian blur are σ1 = 1, σ2 = 2, and σ3 = 20.
[0078] The calculation weight β = 0.25 and the scaling reference pixel value 180 are used in the process of directionally solving the reflection component.
[0079] The linear compensation weights in the process of directional solution of light source components are ω2 = 0.46, ω2 = 0.74, ω3 = 0.1, and ω4 = 0.6.
[0080] (2) Input image, based on Gaussian blur with standard deviation σ2=2, decompose the input image to obtain reflection component R0 and light source component L0;
[0081] (3) Determine the global pixel mean of the reflection component:
[0082] When this value is less than 38, the orientation solution strategy of the light source layer (step 3.2) is directly applied to the input image to obtain the output result;
[0083] When this value is greater than or equal to 38, the new reflection component R is solved separately in different orientations.t (Step 3.1) and the new light source component L t (Step 3.2);
[0084] (4) For the new reflection component R t The proportion of low-value pixels (grayscale value less than 5) is used for secondary discrimination:
[0085] When the value is greater than or equal to 0.001, the orientation solution strategy of the light source layer (step 3.2) is directly applied to the input image to obtain the output result;
[0086] When the value is less than 0.001, proceed to step (5);
[0087] (5) Based on Gaussian blur with standard deviation σ² = 2, merge the new reflection components R. t and new light source component L t ;
[0088] I(x,y)=R t ×L t
[0089] (6) Perform Gamma correction on the merged result to obtain the output image I. ′ (x,y).
[0090] I ′ (x,y)=Gamma correction(I(x,y),1.15)
[0091] By comparing the intuitive effects of white balance algorithms such as Max RGB, Gray World, Shade of Gray, Grey-Edge, and 3C with those of our invention, and using eight objective evaluation metrics including PSNR, SSIM, PCQI, Entropy, NIQE, UCIQE, UIQM, and PIQE, we affirmed the excellent correction capabilities of our method. This invention effectively corrects the colors of various color-biased images, resulting in images that better match human visual perception, with vivid colors and high clarity.
Claims
1. A color correction method for underwater color-distorted images based on directional solution of the Retinex model, characterized in that, Includes the following steps: 1) Based on the Retinex model By using Gaussian blur, the original image is transformed in the logarithmic domain. Decompose the components to obtain the reflection component. and light source components ; 2) Based on reflection components The average pixel intensity is used to determine whether the decomposed reflection component contains sufficient effective information. If it does, step 3 is executed; otherwise, the solution strategy for the light source component is directly applied to the original image to obtain improved results. 3) Targetedly solve for the new reflection component and light source component, and determine whether the pixel intensity of any channel in the new reflection component meets the threshold. If it meets the threshold, the solution strategy for the light source component is directly applied to the original image to obtain the improved result; otherwise, proceed to step 4). 4) Combine the new reflection component and the light source component, and obtain the improved image through gamma correction; Step 2) specifically refers to: If the average pixel intensity is greater than or equal to the first threshold, it is considered that the reflection component provides sufficient effective information, and a new reflection component and light source component are solved in a directional manner. If the average pixel intensity is less than the first threshold, it is considered that the reflection component provides too little information, and the solution strategy for the light source component is directly applied to the original image to obtain improved results.
2. The underwater color correction method for color-distorted images based on directional solution of the Retinex model according to claim 1, characterized in that, Step 1) specifically refers to: ; ; in, This represents the standard deviation of the intensity of all pixels in the neighborhood. Represents the logarithm field .
3. The underwater color correction method for color-distorted images based on directional solution of the Retinex model according to claim 1, characterized in that, The directional solution for the reflection component includes the following steps: a) Obtain the clear reflection component without haze. ; ; in, and Values based on standard deviation and The reflection component obtained from the decomposition The standard deviation takes the value of Gaussian blur, It is a constant; b) Scaling by using the ratio of 180 to the average pixel intensity of each channel Pixel values for each channel; ; in, This is the scaled reflection component. For channel The average pixel value, It has 3 channels; c) Based on The channel with the median average pixel intensity among the three channels ,Will Convert to a light grayscale image with consistent pixel density across three channels and detailed texture. ; d) Use the light gray image as a new reflection component with appropriate global brightness and containing texture information. ; e) Calculate the new reflection components The percentage of pixels whose pixel intensity is below the second threshold in any channel: If the proportion is greater than or equal to the third threshold, the information provided by the new reflection component is considered invalid. The light source component is then solved in a directional manner, and the solution strategy for the light source component is directly applied to the original image to obtain improved results. If the proportion is less than the third threshold, then the information provided by the newly obtained reflection component is considered valid, and step 4 is executed.
4. A color correction method for underwater color-distorted images based on directional solution of the Retinex model according to any one of claims 1 or 3, characterized in that, The targeted solution for the light source components, i.e., the strategy for solving the light source components, includes the following steps: a) Obtaining the original light source components Right now Luminance component in CIE Lab color space ; ; in, The luminance component of the original image in the CIE Lab color space; b) Based on different judgment conditions, using... Linear compensation for missing information in color-distorted images; ; in, , , , All are linear compensation weights; c) Based on gain factor The gain yields a new light source component containing the correct color distribution. ; ; in, Calculated for the median. express , The overall mean of the two channels, The light source component to be gained is the light source component after the missing information has been compensated.
5. The underwater color correction method for color-distorted images based on directional solution of the Retinex model according to claim 1, characterized in that, Step 4) specifically involves: ; in, The improved image.
Citation Information
Patent Citations
Color enhancement method and color enhancement device
CN103236040A
Adaptive brightness unevenness variation correction method based on variation framework
CN106981052A