Underwater color cast image color correction method based on directional solution Retinex model
By directional solving the Retinex model to decompose the reflection component and light source component in the underwater optical image, combined with gamma correction, the color cast problem in the underwater optical image is solved, the image quality is improved, and the optimal white balance in the underwater scene is achieved. method.
Patent Information
- Application Number
- CN202410797306.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-20
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2044-06-20
AI Technical Summary
The existing technology cannot effectively solve the color cast problem in underwater optical images, especially the transmission image and global background light cannot be accurately estimated. The deep learning-based method has poor robustness, and the white balance algorithm is not effective in underwater scenes. limited.
Using the directional solution Retinex model, the image is decomposed into reflection components and light source components in the logarithmic domain through Gaussian blur, and the validity of the information is judged based on the mean pixel intensity. New reflection components and light source components are directionally solved, and gamma correction is combined to improve the image.
It effectively eliminates the color cast problem in underwater optical images, improves image quality, becomes the optimal white balance method in underwater scenes, and significantly improves the color vividness and clarity of images.
Smart Images

Figure CN118799239A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing, and in particular to a method for color correction of underwater color cast images based on directional solution of a Retinex model. Background Art
[0002] The rich marine resources attract countries to compete for marine development. Specifically, it is the detection, identification, monitoring and detection work in the fields of marine biological research, marine ecological environment research, underwater archaeology, underwater facility detection, military applications, etc., and most of them are based on optical and acoustic means. Compared with acoustic imaging, optical imaging has the advantages of higher information readability, less noise, and can provide color and texture information, and is increasingly recognized and concerned. However, the underwater imaging environment is complex, and visible light will be unevenly absorbed when propagating in water, resulting in four types of color cast problems in the image, mainly blue, green, blue-green and yellow.
[0003] Complex color casts have greatly reduced the practical application effect of mainstream underwater optical image quality improvement algorithms. Specifically, methods based on imaging models cannot accurately estimate the transmission map and global background light of the image, and methods based on deep learning cannot train a robust model under the conditions of complex color casts and scarce available data sets. Currently, not only are perfect underwater optical image quality improvement algorithms unable to solve the color cast problem, but so are various white balance algorithms. Summary of the invention
[0004] The present invention provides a method for properly correcting the color cast problem of underwater optical images, aiming to solve the problem that the current imaging model-based method cannot accurately estimate the transmission map and global background light, and the learning-based method has poor robustness. At the same time, the present invention also helps to explore the domain adaptation problem of underwater-land different scene images.
[0005] The present invention proposes a method for solving the Retinex model in a directional manner while taking into account the information of both the reflection component and the light source component. The purpose of the method is to properly eliminate various color cast problems commonly existing in underwater optical images. The method is the best alternative to the existing white balance algorithm.
[0006] The technical solution adopted by the present invention to achieve the above-mentioned purpose is:
[0007] A color correction method for underwater color cast images based on directional solution of Retinex model, comprising 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 mean pixel intensity of the reflection component R(x,y), determine whether the decomposed reflection component contains sufficient valid information. If so, execute step 3). Otherwise, directly apply the solution strategy of the light source component to the original image to obtain an improved result.
[0010] 3) Directedly solving the new reflection component and light source component, judging whether the pixel intensity of any channel in the new reflection component meets the threshold value, if it meets the threshold value, then directly applying the solution strategy of the light source component to the original image to obtain an improved result, otherwise, executing step 4);
[0011] 4) Combine the new reflection component and the light source component and obtain an improved image through gamma correction.
[0012] The step 1) is specifically as follows:
[0013]
[0014] Among them, σ represents the standard deviation of all pixel intensities 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] The step 2) is specifically as follows:
[0016] If the pixel intensity mean 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 for orientation;
[0017] If the pixel intensity mean is less than the first threshold, it is considered that the information provided by the reflection component is too little, and the solution strategy of the light source component is directly applied to the original image to obtain an improved result.
[0018] Directional solution of the reflection component includes the following steps:
[0019] a) Get the clear reflection component R without haze clear ;
[0020] R clear =R 2 (x,y)-β[F 3 (x,y)*R 1 (x,y)]
[0021] Among them, R 1 (x,y) and R 2 (x,y) is based on the standard deviation value σ 1 and σ 2 The decomposed reflection component, F 3 (x,y) is the standard deviation and its value is σ 3 Gaussian blur, β is a constant;
[0022] b) Scale R by the ratio of 180 to the average pixel intensity of each channel clear The pixel value of each channel;
[0023]
[0024] Among them, R ′ clear is the scaled reflection component, avg c is the pixel mean of channel c, r, g, b are 3 channels;
[0025] c) Based on R ′ clear The channel c is the median of the average pixel intensity among the three channels 3 ,c 3 ∈{r,g,b}, R ′ clear Converted into a bright gray image with consistent three-channel pixels and detailed texture
[0026] d) The bright gray image is used as a new reflection component with texture information and appropriate global brightness
[0027] e) Calculate the new reflection component The percentage of pixels whose pixel intensity of any channel is lower than the second threshold:
[0028] If the proportion is greater than or equal to the third threshold, the information provided by the new reflection component is considered invalid, and a directional solution is performed on the light source component, and the solution strategy of the light source component is directly applied to the original image to obtain an improved result;
[0029] If the proportion is less than the third threshold, it is considered that the information provided by the newly solved reflection component is effective to execute step 4).
[0030] Directed solution of light source components, i.e., solution strategy of light source components, includes the following steps:
[0031] a) Get the original light source component L 0 That is, the brightness component l of L(x,y) in the CIE Lab color space;
[0032]
[0033] Where l is the brightness component of the original image in the CIE Lab color space;
[0034] b) According to different judgment conditions, the missing information of the color cast image is compensated by linear compensation;
[0035]
[0036] Among them, ω 1 ,ω 2 ,ω 3 ,ω 4 All are linear compensation weights;
[0037] c) Based on the gain factor f gain, a new light source component with the correct color distribution is obtained
[0038]
[0039] in, median is the median calculation, avg(c 1 ,c 2 ) means c 1 ,c 2 The overall mean of the two channels, is the light source component to be gained, that is, the light source component after compensating for the missing information.
[0040] The step 4) is specifically as follows:
[0041]
[0042] Among them, I ′ (x,y) is the improved image.
[0043] The present invention has the following beneficial effects and advantages:
[0044] The present invention adopts a strategy of simultaneously considering the information of the original reflection component and the light source component, and solving the new reflection component and the light source component in a directional manner with a certain goal as the guide. The present invention regards the new reflection component as the expression of the detail texture information and the global brightness, and regards the new light source component as the final expression of the color. Under the condition of Gaussian blur with extremely small standard deviation, it effectively corrects various color cast problems, improves the quality of underwater optical images, and is the best white balance method in underwater scenes. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 Flow chart of the method of the present invention. DETAILED DESCRIPTION
[0046] The present invention is further described in detail below in conjunction with 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 of underwater optical images, comprising the following steps:
[0048] Step 1: Based on the Retinex model I(x,y)=R(x,y)×L(x,y), with the help of Gaussian blur Decompose the input image I(x,y) in the logarithmic domain to obtain the reflection component R(x,y) and the light source component L(x,y);
[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 valid information;
[0051] Step 2.1: If the pixel intensity mean is greater than or equal to a certain threshold, it is considered that the reflection component provides sufficient effective information, and step 3 is continued;
[0052] Step 2.2, if the mean pixel intensity is less than a given threshold, it is considered that the information provided by the reflection component is too little, and the solution strategy of 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: considering the information of the reflection component and the light source component at the same time, directionally solving the new reflection component and the light source component, the new reflection component is used to directionally characterize the detail texture and global brightness information of the image, and the new light source component is used to directionally characterize the color distribution of the image;
[0054] Step 3.1, directional solution of reflection component;
[0055] Step 3.1.1, obtain the clear reflection component R without haze clear ;
[0056] R clear =R 2 (x,y)-β[F 3 (x,y)*R 1 (x,y)]
[0057] Step 3.1.2: Scale R by the ratio of 180 to the average pixel intensity of each channel clear The pixel value of each channel;
[0058]
[0059] Step 3.1.3, based on R ′ clear The channel c is the median of the average pixel intensity among the three channels 3 ,c 3 ∈{r,g,b}, R ′ clear Converted into a bright gray image with consistent three-channel pixels and detailed texture;
[0060]
[0061] Step 3.1.4, obtain a new reflection component containing texture information and with appropriate global brightness
[0062]
[0063] Step 3.1.5, calculate the new reflection component The proportion of low-intensity pixels in any channel;
[0064] (1) If it is greater than or equal to the threshold, the information provided by the newly solved reflection component is considered invalid, and the solution strategy of the light source component is directly applied to the original image to obtain an improved result;
[0065] (2) If it is lower than the threshold, the information provided by the newly solved reflection component is considered valid, and the process continues to step 3.2;
[0066] Step 3.2, solve the light source component in a directional manner;
[0067] Step 3.2.1, obtain the original light source component L 0 The brightness component l in the CIE Lab color space;
[0068]
[0069] Step 3.2.2, according to different judgment conditions, use l linear compensation to compensate for the missing information of the color cast image;
[0070]
[0071] Step 3.2.3, with the help of the gain factor gain, a new light source component with the correct color distribution can be obtained
[0072]
[0073] Step 4, combining the new reflection component and the light source component, and obtaining an improved image through gamma correction;
[0074]
[0075] Example
[0076] (1) Select the parameters required for calculation and processing:
[0077] The standard deviation of Gaussian blur σ 1 =1,σ 2 =2,σ 3 =20;
[0078] The calculation weight β in the process of directional solution of reflection component is 0.25 and the scaling reference pixel value is 180;
[0079] Linear compensation weight ω in the process of directional solution of light source components 2 =0.46,ω 2 =0.74,ω 3 =0.1,ω 4 =0.6;
[0080] (2) Input image, based on standard deviation σ 2 = 2 Gaussian blur, decomposing the input image to obtain the reflection component R 0 and the light source component L 0 ;
[0081] (3) Determine the global pixel mean of the reflection component:
[0082] When the value is less than 38, the directional solution strategy of the light source layer (step 3.2) is directly applied to the input image to obtain the output result;
[0083] When the value is greater than or equal to 38, the new reflection component R is solved in a directional manner. 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) in the image is used for secondary judgment:
[0085] When the value is greater than or equal to 0.001, the directional 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, execute step (5);
[0087] (5) Based on the standard deviation σ 2 = 2 Gaussian blur, merge the new reflection component R t and the 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] We compared the intuitive effects of the white balance algorithms such as Max RGB, Gray World, Shade of Gray, Grey-Edge, 3C, etc. with the present invention and eight objective evaluation indicators including PSNR, SSIM, PCQI, Entropy, NIQE, UCIQE, UIQM, PIQE, etc., and confirmed the excellent correction ability of the present method. The present invention effectively corrects the colors of various color cast images, and the corrected images can better meet people's visual perception, with bright colors and high clarity.
Claims
1. A color correction method for underwater color cast images based on directional solution of Retinex model, characterized in that: The following steps are involved: 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); 2) Based on the mean pixel intensity of the reflection component R(x,y), determine whether the decomposed reflection component contains sufficient valid information. If so, execute step 3). Otherwise, directly apply the solution strategy of the light source component to the original image to obtain an improved result. 3) Directedly solving the new reflection component and light source component, judging whether the pixel intensity of any channel in the new reflection component meets the threshold value, if it meets the threshold value, then directly applying the solution strategy of the light source component to the original image to obtain an improved result, otherwise, executing step 4); 4) Combine the new reflection component and the light source component and obtain an improved image through gamma correction.
2. According to claim 1, a method for color correction of underwater color cast images based on directional solution of Retinex model is characterized in that: The step 1) is specifically as follows: Among them, σ represents the standard deviation of all pixel intensities 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.
3. The method for color correction of underwater color cast images based on directional solution of Retinex model according to claim 1, characterized in that: The step 2) is specifically as follows: If the pixel intensity mean 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 for orientation; If the pixel intensity mean is less than the first threshold, it is considered that the information provided by the reflection component is too little, and the solution strategy of the light source component is directly applied to the original image to obtain an improved result.
4. The method for color correction of underwater color cast images based on directional solution of Retinex model according to claim 1, characterized in that: Directional solution of the reflection component includes the following steps: a) Get the clear reflection component R without haze clear ; R clear =R2(x,y)-β[F3(x,y)*R1(x,y)] Among them, R1(x, y) and R2(x, y) are the reflection components decomposed based on the standard deviation values σ1 and σ2, F3(x, y) is the Gaussian blur with the standard deviation value σ3, and β is a constant; b) Scale R by the ratio of 180 to the average pixel intensity of each channel c1ear The pixel value of each channel; Among them, R′ clear is the scaled reflection component, avg c is the pixel mean of channel c, r, g, b are 3 channels; c) Based on R′ clear The channel c3,c3∈{r,g,b} with the median average pixel intensity among the three channels is R′ clear Converted into a bright gray image with consistent three-channel pixels and detailed texture d) The bright gray image is used as a new reflection component with texture information and appropriate global brightness e) Calculate the new reflection component The percentage of pixels whose pixel intensity of any channel is lower than the second threshold: If the proportion is greater than or equal to the third threshold, the information provided by the new reflection component is considered invalid, and a directional solution is performed on the light source component, and the solution strategy of the light source component is directly applied to the original image to obtain an improved result; If the proportion is less than the third threshold, it is considered that the information provided by the newly solved reflection component is effective to execute step 4).
5. The method for color correction of underwater color cast images based on directional solution of Retinex model according to any one of claims 1, 3 or 4, characterized in that: Directed solution of light source components, i.e., solution strategy of light source components, includes the following steps: a) Obtain the brightness component l of the original light source component L0, i.e. L(x, y) in the CIE Lab color space; Where l is the brightness component of the original image in the CIE Lab color space; b) According to different judgment conditions, the missing information of the color cast image is compensated by linear compensation; Among them, ω1, ω2, ω3, and ω4 are all linear compensation weights; c) Based on the gain factor f gain, a new light source component with the correct color distribution is obtained in, median is the median calculation, avg(c1,c2) represents the overall mean of the two channels c1 and c2, is the light source component to be gained, that is, the light source component after compensating for the missing information.
6. The method for color correction of underwater color cast images based on directional solution of Retinex model according to claim 1, characterized in that: The step 4) is specifically as follows: Among them, I′(x,y) is 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
Method of enhancing underwater image based on Retinex model
CN107507138A
Underwater image enhancement method of low-coupling Retinex model based on optimization algorithm
CN117541520A
