A method for underwater active optical image color correction
By counting the gray mean value of the channel in the underwater image, selecting the green channel as a reference, establishing an adaptive compensation relationship, and combining guide filtering and Retinex theory for multi-scale enhancement processing, the color distortion problem of underwater image is solved and the color Effective correction and noise reduction significantly improve image clarity and contrast.
Patent Information
- Application Number
- CN202210584569.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-27
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2042-05-27
AI Technical Summary
The prior art is difficult to effectively restore the color of the underwater surface landforms and make it closer to the landform color style of natural scenes, especially in underwater optical images, where color distortion and noise amplification are problems.
By counting the grayscale mean of each channel of the input image, selecting the green channel as a reference, establishing an adaptive compensation relationship, using guide filtering and Retinex theory to calculate the illumination estimation, performing multi-scale image enhancement processing, refinely estimating the irradiation component, and correcting the color deviation , generate RGB three-channel image.
It effectively corrects the color shift problem of underwater images, restores the true color of the image, has good adaptability and practicality, and significantly improves the color correction effect of underwater images, and is suitable for processing of different images.
Smart Images

Figure CN114926362B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of image enhancement, and in particular to an underwater active optical image color correction method. Background Art
[0002] Due to the different absorption of light of different wavelengths by water during underwater imaging, there will be great differences between underwater images and atmospheric imaging images. In underwater environments, since the attenuation of light by seawater is related to the wavelength, short-wave scattering is relatively strong and absorption is relatively weak, while long-wave scattering is relatively weak but absorption is strong. The red component in the image is seriously lost, which is the main factor causing the color distortion of underwater optical images, resulting in the color of underwater optical images generally being blue-green. Therefore, the study of underwater image color correction algorithms is helpful to optimize the visual effects of underwater images and improve the efficiency of underwater observation, which is of great significance to underwater exploration and subsequent applications.
[0003] At present, many methods have been developed, such as histogram transformation, Retinex theory, and deep learning. The histogram transformation method has the advantages of simple algorithm and high efficiency. By setting the histogram grayscale transformation function, the histogram has a specific distribution, thereby improving the image quality. Although the visual quality of underwater images has been improved, obvious artifact areas often appear due to excessive enhancement in certain areas, which amplifies the noise in the image. Retinex theory is used to separate the illumination component and the reflection component from the observed image, or according to specific processing goals and requirements, the influence of illumination is eliminated and the relationship between the illumination component and the reflection component is changed, thereby specifically enhancing the image. Although Retinex theory has a certain improvement on the overall brightness and contrast of the image, the restored image often has problems such as halo and unnaturalness. Convolutional neural networks have achieved ideal results in the field of image enhancement. Scholars have mapped the neural network from underwater degraded images to restored images end-to-end, and achieved good enhancement results. However, due to the diverse characteristics of the water environment, the generalization ability of the training model is not strong when dealing with specific problems, and reliable restored images cannot be obtained. Since network training requires a large number of data samples, it is difficult to obtain high-quality and rich data sets for training in underwater environments. Summary of the invention
[0004] The technical problem to be solved by the present invention is to provide an underwater active optical image color correction method, which can effectively restore the color of underwater surface objects and make them closer to the landform color style of natural scenes.
[0005] In order to solve the above technical problems, the present invention provides an underwater active optical image color correction method, comprising the following steps:
[0006] Step 1: Count the channels I obtained by separating the input image I(x, y) R (x, y), IG (x, y), I B (x, y) grayscale mean The channel compensation gain is calculated using the following formula:
[0007]
[0008] in, Represents the grayscale mean of the channel to be corrected, c∈{R, G, B};
[0009] Step 2: Select the green channel image as a reference and use the image information to establish an adaptive compensation relationship between channels;
[0010] Step 3: Use W k is the filtering window, and the compensated single-channel image I′ c is the image to be processed p i , input channel image I ci is the guide graph, q j is the output image, a k , b k All are coefficient variables to be calculated within the filter window, and the calculation formula is as follows
[0011]
[0012] Where |W n | is the local window W k The total number of pixels in μ k and are the mean and variance respectively, and are given by k The internal calculation guide graph is obtained. is the input image p i Average value in a local window;
[0013] Step 4: By coefficient a k , b k , input image p i and Guide Map I ci , and get the output image q after guided filtering c , the calculation formula is as follows
[0014]
[0015] Step 5: According to the Retinex theory, calculate the illumination estimate based on the guided filter;
[0016] Step 6: Calculate the enhanced channel image as R c (x, y);
[0017] Step 7: Calculate the output image r cThe exponential value of (x, y) is calculated as follows
[0018]
[0019] Step 8: Get the color-corrected images of each channel and synthesize them into an RGB three-channel image R(x, y) again.
[0020] Preferably, in step 2, the green channel image is selected as a reference, and the adaptive compensation relationship between channels is established using the image information itself. The calculation formula is as follows:
[0021] I′ c (x, y) = G c ×(I c (x,y)+(I GM (x, y)-I cM (x, y))×(1-I c (x, y))×I G (x, y)
[0022] Where I′ c (x, y) represents the compensated single-channel image, I GM (x, y) and I cM (x, y) represent respectively the mean of the N×N neighborhood around the pixel point (x, y) in the image to be compensated.
[0023] Preferably, in step 5, set I c (x, y) represents the observed image, N is the number of Gaussian filter scales, G(x, y, σ) is a two-dimensional Gaussian surround function with a scale of σ, and f is a guided filter function. The calculation formula for the illumination estimation based on guided filtering is as follows;
[0024]
[0025] in, For the convolution operation, the specific calculation formula of G(x, y, σ) is as follows, which is a two-dimensional Gaussian surround function:
[0026]
[0027] Preferably, in step 6, let i c (x, y) = log(I c (x,y)), r c (x, y) = log(R c (x,y)), l c (x, y) = log(L cMSR (x, y)), the enhanced image r(x, y) is calculated by the following formula
[0028] r c (x, y) = i c (x, y)-l c (x, y).
[0029] The beneficial effects of the present invention are as follows: (1) in view of the particularity of underwater optical images, channel pre-compensation is introduced, and multi-scale Retinex enhancement processing based on guided filtering is performed on the image, so as to further refine the estimated illumination component, effectively correct the color cast problem of the underwater image, and restore the true color of the image. The method has good adaptability and practicality, and has obvious enhancement effect, and can be widely used in color correction of underwater images; (2) in the transformation process, the relevant transformation parameters are automatically calculated according to the characteristics of the image itself, thereby ensuring the adaptability of the method of the present invention to different images. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 It is a schematic diagram of the method flow of the present invention.
[0031] Figure 2 This is a color-shifted underwater image of the present invention.
[0032] Figure 3 This is a result diagram processed using the method of the present invention. DETAILED DESCRIPTION
[0033] like Figure 1 As shown, an underwater active optical image color correction method comprises the following steps:
[0034] Step 1: Count the channels I obtained by separating the input image I(x, y) R (x, y), I G (x, y), I B (x, y) grayscale mean , use the following formula to calculate the channel compensation gain
[0035]
[0036] in, Represents the grayscale mean of the channel to be corrected, c∈{R, G, B};
[0037] Step 2: Select the green channel image as a reference and use the image information to establish an adaptive compensation relationship between channels. The calculation formula is as follows:
[0038] I′ c (x, y) = G c ×(I c (x,y)+(I GM (x, y)-I cM (x, y))×(1-I c(x, y))×I G (x, y)
[0039] Where I′ c Represents the compensated single-channel image, I GM (x, y) and I cM (x, y) represent the mean of the N×N neighborhood around the pixel (x, y) in the image to be compensated;
[0040] Step 3: W k is the filtering window, and the compensated single-channel image I′ c is the image to be processed p i , input channel image I c is the guide graph, q j is the output image, a k , b k All are coefficient variables to be calculated within the filter window. The calculation formula is as follows
[0041]
[0042] Where |W n | is the local window W k The total number of pixels in μ k and are the mean and variance respectively, and are given by k The internal calculation guide graph is obtained. is the input image p i Average value in a local window;
[0043] Step 4: By coefficient a k , b k , input image p i and Guide Map I c , and get the output image q after guided filtering c , the calculation formula is as follows
[0044]
[0045] Step 5: According to Retinex theory, let I c (x, y) represents the observed image, N is the number of Gaussian filter scales, G(x, y, σ) is a two-dimensional Gaussian surround function with a scale of σ, and f is a guided filter function. The calculation formula for the illumination estimation based on guided filtering is as follows;
[0046]
[0047] in, For the convolution operation, the specific calculation formula of G(x, y, σ) is as follows, which is a two-dimensional Gaussian surround function:
[0048]
[0049] Step 6: Let the enhanced channel image be R c (x, y), for the sake of simplicity, let i c (x, y) = log(I c (x,y)), r c (x, y) = log(R c (x,y)), l c (x, y) = log(L cMSR (x, y)), the enhanced image r(x, y) can be calculated by the following formula
[0050] r c (x, y) = i c (x, y)-l c (x, y);
[0051] Step 7: Calculate the output image r c The exponential value of (x, y) is calculated as follows
[0052]
[0053] Step 8: Get the color-corrected images of each channel and synthesize them into an RGB three-channel image R(x, y) again.
[0054] In step 1, the gray world theory is used for adaptive compensation between channels. The gray world theory defines a standard value. When the average value of the channel approaches a certain fixed value after the light imaged by the reflection and transmission of the object in nature, the value can be approximately defined as "gray". Explained from the fundamental optical physics sense, the gray world theory defines a standard value. When the average value of the channel approaches a certain fixed value after the light imaged by the reflection and transmission of the object in nature, the value can be approximately defined as "gray". If the gray world hypothesis theory is met, the calculated pixel value mean of the RGB channel should be almost the same. In color correction, a color channel is usually selected according to certain conditions, and it is set as the reference channel. The proportional relationship between other color channels and the reference channel is calculated by formula, and the other two channels are corrected respectively. Among the three RGB channels of underwater images, red light is more absorbed by the water body due to its wavelength, blue light is more scattered by the water body due to its short wavelength, and green light retains better reflection information in comparison. Green, as one of the three primary colors, has relatively good independence as a reference channel for channel compensation and will not interfere with the compensation calculation of other channels. Therefore, the green channel image is selected as a reference to calculate the channel compensation gain. The calculation formula is as follows:
[0055]
[0056] in, Represents the grayscale mean of the channel to be corrected, c∈R,G,B, Represents the input channel image I R (x, y), I G (x, y), I B The grayscale mean of (x, y).
[0057] In step 3, the coefficients of the guided filter are calculated.
[0058] Guided filtering is a local linear filtering method that has the characteristics of edge-preserving smoothness and is not affected by gradients. When using this filtering method to operate on an image, other images must be used to assist in the calculation, which is often called a guide map in filtering. This map can be selected to include the input image itself or any other image. Guided filtering has three variables, and the linear model of the local area to be processed is defined as follows: c =a k I c +b k , Where W k is the filter window, a k , b k are all coefficient variables to be calculated within the filter window, and the input channel image I c is the guide graph, q c is the output image. It can be found that the guide image I c The boundary characteristics of the output image determine the edge characteristics of the output image. At the same time, if we assume that the expected output image q c The input image p is c and the noise or texture we don't need c By subtracting, we get q c =p c -n c In order to solve the coefficient a that satisfies such conditional assumptions k , b k , so that q c and p c The difference is as small as possible, maintaining the local linear model, and establishing an optimization objective with a regularization term:
[0059]
[0060] Solving the above equation gives the coefficient a k , b k In the local calculation formula, since a pixel may be included in multiple filter windows, taking the average can get a k , b k The calculation formula is as follows:
[0061]
[0062] Figure 2 The reference image is shown, with an overall color cast. Figure 3 This is the processing result of the method of the present invention. Compared with the original image, it can be found that the overall color correction effect is obvious, the original underwater color is restored, and the clarity and contrast are significantly improved. The underwater image color correction effect is good and the clarity is high. Comprehensively comparing the results of the two images, it is obvious that the correction effect after processing using the algorithm disclosed by the present invention is good. It provides an effective method for automatic color correction processing of underwater images.
Claims
1. An underwater active optical image color correction method, characterized in that: The steps include: Step 1: Count the channels I obtained by separating the input image I(x, y) R (x, y), I G (x, y), I B (x, y) grayscale mean Use the following formula to calculate the channel compensation gain: in, Represents the grayscale mean of the channel to be corrected, c∈{R, G, B}; Step 2: Select the green channel image as a reference and use the image information to establish an adaptive compensation relationship between channels; Step 3: Use W k is the filtering window, and the compensated single-channel image I′ c is the image to be processed p i , input channel image I ci is the guide graph, q j is the output image, a k , b k All are coefficient variables to be calculated within the filter window, and the calculation formula is as follows Where |W n | is the local window W k The total number of pixels in μ k and are the mean and variance respectively, and are given by k The internal calculation guide graph is obtained. is the input image p i Average value in a local window; Step 4: By coefficient a k , b k , input image p i and Guide Map I ci , and get the output image q after guided filtering c , the calculation formula is as follows Step 5: According to the Retinex theory, calculate the illumination estimate based on the guided filter; Step 6: Calculate the enhanced channel image as R c (x, y); Step 7: Calculate the output image r c The exponential value of (x, y) is calculated as follows Step 8: Get the color-corrected images of each channel and synthesize them into an RGB three-channel image R(x, y) again.
2. The underwater active optical image color correction method according to claim 1, characterized in that: In step 2, the green channel image is selected as a reference, and the adaptive compensation relationship between channels is established using the image information itself. The calculation formula is as follows: I′ c (x,y)=G c ×(I c (x,y)+(I GM (x,y)-I cM (x,y))×(1-I c (x,y))×I G (x,y)) Where I′ c (x, y) represents the compensated single-channel image, I GM (x, y) and I cM (x, y) represent the mean of the N×N neighborhood around the pixel point (x, y) in the image to be compensated.
3. The underwater active optical image color correction method according to claim 1, characterized in that: In step 5, let I c (x, y) represents the observed image, N is the number of Gaussian filter scales, G(x, y, σ) is a two-dimensional Gaussian surround function with a scale of σ, and f is a guided filter function. The calculation formula for the illumination estimation based on guided filtering is as follows; in, For the convolution operation, the specific calculation formula of G(x, y, σ) is as follows, which is a two-dimensional Gaussian surround function:
4. The underwater active optical image color correction method according to claim 1, characterized in that: In step 6, let i c (x, y) = log(I c (x,y)), r c (x, y) = log(R c (x,y)), l c (x, y) = log(L cMSR (x, y)), the enhanced image r(x, y) is calculated by the following formula r c (x,y)=i c (x,y)-l c (x,y)。
