Two-stage adaptive underwater image color correction method based on channel compensation
By employing a two-stage adaptive underwater image color correction method, which utilizes brightness channel compensation and automatic color balance algorithms, the problem of insufficient adaptability to color shift in underwater images in existing technologies is solved, and effective color restoration and clarity enhancement are achieved for diverse underwater scenes.
Patent Information
- Application Number
- CN202511035820.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-25
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2045-07-25
AI Technical Summary
Existing underwater image color correction methods can only correct the color deviation of certain specific scenes and cannot adapt to diverse underwater color deviation situations, resulting in color errors in the restored scene.
A two-stage adaptive method based on channel compensation is adopted, including an adaptive channel compensation stage and an automatic color equalization stage. Color compensation and adjustment are performed by calculating the bright channel matrix and pixel distance weighting. Combining the ideas of grayscale world and perfect reflection, an improved automatic color equalization algorithm is used to further restore true colors.
It significantly improves the color correction generalization capability of underwater images, making it applicable to a wider range of underwater scenarios, restoring true colors and improving image clarity.
Smart Images

Figure CN120856986A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of image processing technology, specifically relating to a two-stage adaptive underwater image color correction method based on channel compensation. Background Technology
[0002] Underwater imagery is the most direct tool for exploring and developing marine resources. Through underwater images, researchers can gain a better understanding of the marine environment, which is crucial for the rational development and utilization of marine resources. However, due to the complexity of the underwater environment, the acquired images suffer from varying degrees of degradation. The different light absorption rates of the water medium lead to color distortion in the acquired images, and suspended particles in the water scatter light, causing image blurring. Therefore, the acquired underwater images not only lose the color information of the original scene but also fail to restore the original scene's details. Degraded underwater images not only severely impact human visual perception but also hinder further work based on the images. Therefore, color correction of underwater images to restore the original colors and details of the underwater scene is of great significance.
[0003] The difference between underwater and atmospheric images lies in the fundamental differences between the water and air media. The inhomogeneity and complexity of the water medium cause random changes in the propagation path of light, known as light scattering. Forward scattering results in blurred underwater images, while backscattering leads to low contrast and a foggy effect, obscuring many details in the underwater scene and affecting image quality. Typically, due to the small distance between the object and the camera, the effect of forward scattering can be ignored. A simplified underwater imaging model is given below:
[0004] I(x)=J(x)t c (x)+B c (1-t c (x))
[0005] Where I(x) represents the observed original image (or degraded image), i.e., the image actually captured in the underwater environment; J(x) represents the theoretically clear image without any attenuation or scattering effects; t c (x) represents scene transmittance, a metric that measures how much initial energy light retains as it travels from a scene point to the observer; B c Underwater ambient light refers to the light intensity that is prevalent in water. In the above formula, the first term is the direct component, which represents the light rays that travel directly from the scene point to the camera sensor; the second term is the backscattering component, which represents the portion of light rays from other directions in the environment (such as ambient light) that are scattered by the water and enter the camera sensor.
[0006] Scene transmittance t c (x) can be further expressed as:
[0007] t c (x)=e -β*d(x)
[0008] Where β is the water attenuation coefficient, which is related to wavelength. Generally, red light has the greatest attenuation, while green and blue light have smaller attenuations. Therefore, underwater images often show a green or blue color shift. d(x) is the scene depth. The deeper the depth, the smaller the scene transmittance and the smaller the overall brightness of the scene.
[0009] As can be seen from the underwater imaging formula, the degradation of underwater images mainly stems from two aspects: first, the loss of color information caused by water decay, resulting in severe color casts in the scene; and second, image blurring caused by irrelevant light sources such as background light entering the sensor. Therefore, the core task of underwater image restoration usually focuses on color restoration and deblurring.
[0010] Most existing color correction algorithms are based on assumptions such as the grayscale world hypothesis and the perfect reflection hypothesis. However, these assumptions often have specific applicable scenarios. For example, the grayscale world hypothesis is only applicable when the image has rich colors and the average color value is close to neutral gray, without significant color cast. The perfect reflection hypothesis is more suitable for images with reflective or nearly white objects. When faced with underwater scenes, which generally have significant color casts and lack high-brightness white points, both of these assumptions are difficult to apply, causing existing color correction methods to fail.
[0011] Current underwater image color correction methods can only correct color casts in certain specific scenes, such as scenes that are generally bluish or greenish. However, in reality, underwater color casts are generally diverse, and existing color correction methods often fail to identify and correct the color casts in a scene, resulting in color errors in the restored scene. Summary of the Invention
[0012] The purpose of this invention is to overcome the shortcomings of the prior art and provide a two-stage adaptive underwater image color correction method based on channel compensation. In the first stage, the color cast of the underwater scene is adaptively identified to perform preliminary channel compensation on the image, effectively removing the color cast present in most underwater scenes. In the second stage, an improved automatic color equalization algorithm is used to further restore the true color of the image. This method can also effectively improve the clarity of underwater images.
[0013] The technical problem addressed by this invention is solved as follows:
[0014] A two-stage adaptive underwater image color correction method based on channel compensation includes an adaptive channel compensation stage and an automatic color equalization stage;
[0015] The specific process of the adaptive channel compensation stage is as follows:
[0016] Calculate the brightness channel matrix ch of the image max Bright channel matrix ch max The element in the i-th row and j-th column (i,j)∈I, where I represents the set of pixels in the image, and R i,j G i,j and B i,j These represent the brightness values of the red, green, and blue channels of the pixel in the i-th row and j-th column of the image, respectively.
[0017] Perform color compensation and correction on the brightness values of each channel of the image:
[0018] ch_corrected=0.9′ch+1.1′(ch max_ave -ch ave )′(1-ch)′ch max
[0019] Where ch_corrected represents the color channel brightness value after compensation and correction, and ch represents the color channel brightness value of the original image. max_ave Represents the brightness channel matrix ch max The mean, ch ave This represents the average brightness of the color channels in the original image;
[0020] The specific process of the automatic color balance stage is as follows:
[0021] The image completed in the adaptive channel compensation stage is subjected to global or local adjustments based on pixel distance to obtain a weighted image; the weighted image is then normalized to obtain a color-corrected underwater image.
[0022] Furthermore, in the automatic color balance stage, the specific process of global or local adjustment weighted by pixel distance is as follows:
[0023] For the image completed in the adaptive channel compensation stage, all pixels are sequentially traversed as target pixels. For each color channel, the weighted sum of pixel distances between the target pixel and all its local or global neighboring pixels is calculated, expressed as:
[0024]
[0025] Among them, R c(p) represents the weighted summation of the color channel brightness value at the target pixel p in the image; Subset represents the set of pixels corresponding to a defined local neighborhood of the target pixel or the entire image; q represents any pixel in the set Subset, q≠p; r represents the relative brightness function of the pixel; I c (p) and I c (q) represents the color channel brightness values at pixel p and pixel q after the first stage of compensation and correction, respectively, and d(p,q) represents the distance between pixel p and pixel q.
[0026] Furthermore, in the automatic color balance stage, the weighted image is normalized, and the brightness values of each color channel after weighted summation are normalized to the range of 0-255.
[0027] Furthermore, normalization is achieved using a linear stretching method, which is expressed as follows:
[0028]
[0029] Among them, I out R represents the color-corrected underwater image. c This represents the image after the adaptive channel compensation stage, where c represents the color channel, and max and min represent taking the maximum and minimum values, respectively.
[0030] Furthermore, a percentage-truncation stretching method is used to achieve normalization. The percentage-truncation stretching method is expressed as follows:
[0031]
[0032] Where, p c_low Image R completed for the adaptive channel compensation stage c The low quantiles in the cumulative histogram distribution, p c_high Image R completed for the adaptive channel compensation stage c The high quantiles in the cumulative histogram distribution, clip represents the image R completed in the adaptive channel compensation stage. c The brightness value is limited to p c_low and p c_high Between them, linear indicates linear stretching operation, and c represents the color channel.
[0033] Furthermore, a histogram-based stretching method is used to achieve normalization processing. This histogram-based stretching method is implemented based on histogram equalization and adaptive histogram equalization.
[0034] The beneficial effects of this invention are:
[0035] The underwater image color correction method of the present invention can adaptively correct the color cast of the captured image according to the specific color cast of the underwater scene. It overcomes the limitation of existing underwater color correction methods that can only effectively handle a single type of color cast, making it applicable to a wider range of underwater scenes and significantly improving the generalization ability of the algorithm. Attached Figure Description
[0036] Figure 1 This is a flowchart illustrating the method described in this invention;
[0037] Figure 2 This is a flowchart illustrating the automatic color balance stage in the method described in this invention.
[0038] Figure 3 This is a schematic diagram of the process of accelerating calculation based on pyramid decomposition in the automatic color balance stage of the method described in this invention;
[0039] Figure 4 Comparison images of the original underwater image and the image after color correction using the method described in this embodiment are shown, where (a) is the first original underwater image, (b) is the color-corrected image corresponding to the first original underwater image, (c) is the second original underwater image, (d) is the color-corrected image corresponding to the second original underwater image, (e) is the third original underwater image, and (f) is the color-corrected image corresponding to the third original underwater image. Detailed Implementation
[0040] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0041] This embodiment provides a two-stage adaptive underwater image color correction method based on channel compensation, such as... Figure 1 As shown, it includes an adaptive channel compensation stage and an automatic color balance stage.
[0042] In the adaptive channel compensation stage, most of the color cast in the scene is removed. The specific process is as follows:
[0043] Calculate the brightness channel matrix ch of the image max Bright channel matrix ch max The element in the i-th row and j-th column I represents the set of pixels in the image, R i,j G i,j and B i,j These represent the brightness values of the red, green, and blue channels of the pixel in the i-th row and j-th column of the image, respectively.
[0044] The brightness values of each channel of the image are corrected for color compensation based on the following channel compensation formula:
[0045] ch_corrected=0.9′ch+1.1′(ch max_ave -ch ave )′(1-ch)′ch max
[0046] Where ch_corrected represents the color channel brightness value after compensation and correction, and ch represents the color channel brightness value of the original image. max_ave Represents the brightness channel matrix ch max The mean, ch ave This represents the average brightness of the color channels in the original image.
[0047] The first stage of the method described in this embodiment is the adaptive channel compensation stage, which uses the brightness channel to compensate and correct the R, G, and B channels. This can effectively correct underwater color shifts of various colors and make objects in the scene appear as realistically colored as possible.
[0048] Next, automatic color equalization is applied to the color-compensated image to further correct color cast and improve sharpness. A flowchart of the automatic color equalization process is shown below. Figure 2 As shown, the specific process is as follows:
[0049] In the automatic color equalization stage, chroma / space adjustment is performed first. Combining the concepts of grayscale and perfect reflection, a global / local adjustment weighted by pixel distance is executed. All pixels in the image are sequentially traversed as target pixels. For each color channel, the weighted sum of pixel distances between the target pixel and all its neighboring pixels within a local / global region is calculated, expressed as:
[0050]
[0051] Among them, R c (p) represents the weighted summation of the color channel brightness value at pixel p in the image; Subset represents the set of pixels corresponding to the defined local neighborhood of the target pixel or the entire image; q represents any pixel in the set Subset, q≠p; r represents the pixel's relative brightness function, I c (p) and I c (q) represents the color channel brightness values at pixel p and pixel q after the first stage of compensation and correction, respectively, and d(p,q) represents the distance between pixel p and pixel q.
[0052] Then, normalization is performed to normalize the weighted summation of the brightness values corresponding to each color channel to the range of 0-255. Various methods can be used, such as linear stretching, percentage truncation stretching, and histogram-based stretching.
[0053] The formula for linear stretching is as follows:
[0054]
[0055] Among them, I out R represents the output image of the second stage. c This represents the output image of the first stage, and c represents the R, G, and B channels.
[0056] The percentage cutoff stretching formula is as follows:
[0057]
[0058] Where, p c_low It refers to R c The low quantiles (typically 1%) in the cumulative histogram distribution, p c_high It refers to R c The high quantiles (typically 99%) in the cumulative histogram distribution of R, clip(g) represents the high quantiles (typically 99%) in R. c The pixel value is limited to p c_low and p c_high Between, linear(g) means to apply a linear stretch to the result.
[0059] Histogram-based stretching methods are implemented using histogram equalization (HE) and adaptive histogram equalization (CLAHE), both of which readjust the distribution of pixels to make the histogram more balanced.
[0060] The automatic color balance stage, as the second stage of the method described in this embodiment, applies an improved automatic color balance algorithm to further restore scene colors and improve clarity.
[0061] Because the automatic color balance algorithm has extremely high time complexity, the pyramid decomposition method is used to accelerate the calculation in the method described in this embodiment. The specific process is as follows: Figure 3 As shown, the input image is first Gaussian downsampled, and then automatically color equalizes (ACE) the downsampled image recursively, stopping when the image size is less than or equal to 2×2. After processing, the ACE result of the downsampled image is upsampled to the original size and then weighted and fused with the ACE result of the original image, where the upsampled result has a weight of 0.6 and the ACE difference between the original and upsampled images has a weight of 0.4. This multi-scale strategy preserves the detail enhancement effect while significantly reducing computational complexity.
[0062] Figure 4Comparison images of the original underwater image and the image after color correction using the method described in this embodiment are shown, where (a) is the first original underwater image, (b) is the color-corrected image corresponding to the first original underwater image, (c) is the second original underwater image, (d) is the color-corrected image corresponding to the second original underwater image, (e) is the third original underwater image, and (f) is the color-corrected image corresponding to the third original underwater image.
Claims
1. A two-stage adaptive underwater image color correction method based on channel compensation, characterized in that, This includes the adaptive channel compensation stage and the automatic color balance stage; The specific process of the adaptive channel compensation stage is as follows: Calculate the brightness channel matrix ch of the image max Bright channel matrix ch max The element in the i-th row and j-th column I represents the set of pixels in the image, R i,j G i,j and B i,j These represent the brightness values of the red, green, and blue channels of the pixel in the i-th row and j-th column of the image, respectively. Perform color compensation and correction on the brightness values of each channel of the image: ch_corrected=0.9′ch+1.1′(ch max_ave -ch ave )′(1-ch)′ch max Where ch_corrected represents the color channel brightness value after compensation and correction, and ch represents the color channel brightness value of the original image. max_ave Represents the brightness channel matrix ch max The mean, ch ave This represents the average brightness of the color channels in the original image; The specific process of the automatic color balance stage is as follows: The image completed in the adaptive channel compensation stage is subjected to global or local adjustments based on pixel distance to obtain a weighted image; the weighted image is then normalized to obtain a color-corrected underwater image.
2. The two-stage adaptive underwater image color correction method based on channel compensation according to claim 1, characterized in that, In the automatic color balance stage, the specific process of global or local adjustment weighted by pixel distance is as follows: For the image completed in the adaptive channel compensation stage, all pixels are sequentially traversed as target pixels. For each color channel, the weighted sum of pixel distances between the target pixel and all its local or global neighboring pixels is calculated, expressed as: Among them, R c (p) represents the weighted summation of the color channel brightness value at the target pixel p in the image; Subset represents the set of pixels corresponding to a defined local neighborhood of the target pixel or the entire image; q represents any pixel in the set Subset, q≠p; r represents the relative brightness function of the pixel; I c (p) and I c (q) represents the color channel brightness values at pixel p and pixel q after the first stage of compensation and correction, respectively, and d(p,q) represents the distance between pixel p and pixel q.
3. The two-stage adaptive underwater image color correction method based on channel compensation according to claim 1, characterized in that, In the automatic color balance stage, the weighted image is normalized, and the brightness values of each color channel after weighted summation are normalized to the range of 0-255.
4. The two-stage adaptive underwater image color correction method based on channel compensation according to claim 1, characterized in that, Normalization is achieved using linear stretching, which is expressed as follows: Among them, I out R represents the color-corrected underwater image. c This represents the image after the adaptive channel compensation stage, where c represents the color channel, and max and min represent taking the maximum and minimum values, respectively.
5. The two-stage adaptive underwater image color correction method based on channel compensation according to claim 1, characterized in that, Normalization is achieved using a percentage-truncation stretching method, which is expressed as follows: I out_c =linear(clip(R c ,p c_low ,p c_high )) Among them, p c_low Image R completed for the adaptive channel compensation stage c The low quantiles in the cumulative histogram distribution, p c_high Image R completed for the adaptive channel compensation stage c The high quantiles in the cumulative histogram distribution, clip represents the image R completed in the adaptive channel compensation stage. c The brightness value is limited to p c_low and p c_high Between them, linear indicates linear stretching operation, and c represents the color channel.
6. The two-stage adaptive underwater image color correction method based on channel compensation according to claim 1, characterized in that, Normalization is achieved using a histogram-based stretching method, which is based on histogram equalization and adaptive histogram equalization.
Citation Information
Patent Citations
Generalized attenuation image enhancement method based on adaptive color compensation and detail optimization
CN115578297A
Image defogging method based on region segmentation, storage medium and terminal equipment
CN117952864A
Underwater image enhancement method based on adaptive color equalization and multi-scale fusion
CN119863411A
Apparatus and method for enhancing images in consideration of region characteristics
US20100085361A1