Underwater image enhancement method and storage medium

By separating and correcting the initial color channels of underwater images and optimizing the lighting components in combination with the Retinex model, the problem of the impact of light attenuation in different colors is solved, and the quality and authenticity of underwater images are improved.

CN114782272BActive Publication Date: 2024-11-26WUHAN INST OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210453254.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-27
Publication Date
2024-11-26
Estimated Expiration
2042-04-27

AI Technical Summary

Technical Problem

Existing underwater image enhancement methods fail to effectively consider the problem of different degrees of attenuation of light in different colors underwater, resulting in the emergence of color distortion and artifacts, making it difficult to obtain high-quality underwater images.

Method used

By acquiring the image to be processed and separating at least three initial color channels, color correction and brightness adjustment are performed according to the intensity differences between different color channels, combined with the Retinex model to decompose the illumination and reflection components, optimize the illumination components to obtain the target enhanced image.

Benefits of technology

It realizes flexible response to the attenuation conditions of different colors in different scenarios, reduces the occurrence of color distortion, and improves the quality and authenticity of underwater images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114782272B_ABST
    Figure CN114782272B_ABST
Patent Text Reader

Abstract

The present invention relates to an underwater image enhancement method and medium, the method comprising: obtaining an image to be processed, separating the image to be processed into at least three initial color channels; performing color correction on the image to be processed according to the intensity difference between any two of the at least three initial color channels to obtain a color-corrected image; and adjusting the brightness of the color-corrected image to obtain a target enhanced image. Compared with the prior art, the present invention makes adjustments based on the specific differences between the initial color channels of the image to be processed, that is, it has a priori process when processing images, and can make corrections more targeted according to the different attenuation of light of different colors during image acquisition, rather than only compensating for certain specific colors, and can flexibly and effectively deal with the problem of different light attenuation conditions of different colors in different scenes, and is more adaptive.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to an underwater image enhancement method and a storage medium. Background Art

[0002] In recent years, with the continuous growth of population and the shortage of land resources, people pay more and more attention to the development of underwater resources. The most common way for people to explore the underwater world is to take pictures with a camera. However, compared with images taken on land, the underwater lighting environment is complex, and it is relatively difficult to obtain high-quality underwater images. Therefore, it is necessary to enhance underwater images. Nowadays, people have made a lot of research results in the field of image enhancement. For example, Weidong Zhang et al. proposed a method for stretching compensation of image channels, and Azmi et al. proposed a color correction algorithm based on gain compensation.

[0003] Although the above algorithms can compensate for the color distortion of underwater images, they do not take into account the different attenuation of different colors of light underwater. For example, when analyzing images in RGB mode, the green channel attenuates the least in underwater areas where plankton gather, which causes the image to appear green, while in deep water areas, the blue channel attenuates the least, which causes the image to appear blue. Color distortion makes underwater images difficult to use. If the above algorithms are used directly for processing, it is easy to over-compensate the red channel and produce red artifacts and other defects.

[0004] Therefore, it is necessary to invent a new underwater image enhancement method to eliminate the influence of different attenuation of different color lights underwater to obtain high-quality underwater images. Summary of the invention

[0005] In view of this, it is necessary to provide an underwater image enhancement method and storage medium to solve the problem of how to avoid different attenuation of light of different colors underwater, thereby affecting the image enhancement effect.

[0006] In order to achieve the above technical objectives, the present invention adopts the following technical solutions:

[0007] In a first aspect, the present invention provides an underwater image enhancement method, comprising:

[0008] Acquire an image to be processed, and separate the image to be processed into at least three initial color channels;

[0009] Performing color correction on the image to be processed according to an intensity difference between any two of the at least three initial color channels to obtain a color-corrected image;

[0010] The brightness of the color-corrected image is adjusted to obtain a target enhanced image.

[0011] Furthermore, the number of the initial color channels is three, and the three initial color channels are respectively a strong color channel, a medium color channel, and a weak color channel; and the color correction of the image to be processed is performed according to the intensity difference between any two initial color channels of the at least three initial color channels to obtain a color-corrected image, comprising:

[0012] According to the intensity difference between the strong color channel, the medium color channel and the weak color channel, the medium color channel and the weak color channel are corrected to obtain a corrected medium color channel and a weak color channel;

[0013] Correcting the strong color channel to obtain a corrected strong color channel;

[0014] The corrected strong color channel, medium color channel and weak color channel are combined to obtain the color-corrected image.

[0015] Further, the method of correcting the medium color channel and the weak color channel according to the intensity difference between the strong color channel, the medium color channel and the weak color channel to obtain the corrected medium color channel and the weak color channel includes:

[0016] Obtaining a first correction coefficient, a second correction coefficient, and a third correction coefficient according to the intensity differences among the strong color channel, the medium color channel, and the rear color channel;

[0017] The medium color channel and the weak color channel are corrected according to the first correction coefficient, the second correction coefficient and the third correction coefficient to obtain the corrected medium color channel and the weak color channel.

[0018] Further, the obtaining of the first correction coefficient, the second correction coefficient and the third correction coefficient according to the intensity differences among the strong color channel, the medium color channel and the rear color channel comprises:

[0019] Obtaining the first correction coefficient according to the intensity difference between the strong color channel and the medium color channel;

[0020] Obtaining the second correction coefficient according to the intensity difference between the strong color channel and the weak color channel;

[0021] The third correction coefficient is obtained according to the intensity difference between the medium color channel and the weak color channel.

[0022] Further, the correcting the medium color channel and the weak color channel according to the first correction coefficient, the second correction coefficient and the third correction coefficient to obtain the corrected medium color channel and the weak color channel includes:

[0023] Correcting the middle color channel according to the first correction coefficient and the third correction coefficient to obtain the corrected middle color channel;

[0024] The weak color channel is corrected according to the second correction coefficient and the third correction coefficient to obtain the corrected weak color channel.

[0025] Furthermore, the brightness adjustment of the color-corrected image to obtain a target enhanced image includes:

[0026] According to the color-corrected image, three corrected color channels of the color-corrected image are obtained based on the RGB color space;

[0027] Decomposing the original illumination component of the color-corrected image based on a Retinex model;

[0028] Decomposing three reflection components corresponding to the three corrected color channels based on a Retinex model according to the original illumination component and the three corrected color channels;

[0029] Optimizing the contrast of the original illumination component to obtain a modified illumination component;

[0030] A target enhanced image is obtained according to the corrected illumination component and the three reflection components.

[0031] Furthermore, decomposing the original illumination component of the color-corrected image based on the Retinex model includes:

[0032] Establishing an illumination component estimation model and obtaining a gradient of the illumination component estimation model;

[0033] Obtaining a weight matrix according to the color-corrected image;

[0034] The illumination component estimation model is optimized according to the gradient of the illumination component estimation model and the weight matrix to obtain the original illumination component.

[0035] Furthermore, the step of establishing the illumination component estimation model and obtaining the gradient of the illumination component estimation model includes:

[0036] Obtaining the maximum values ​​at the same position in the matrices corresponding to the three corrected color channels, and combining them to form a matrix as a lighting component estimation model;

[0037] The maximum value of the gradients of the matrices corresponding to the three corrected color channels is obtained as the gradient of the illumination component estimation model.

[0038] Furthermore, obtaining a weight matrix according to the color-corrected image includes:

[0039] Obtaining a lightness channel of the color-corrected image based on the HSV color space;

[0040] The weight matrix is ​​obtained according to the brightness channel and preset parameters.

[0041] In a second aspect, the present invention further provides a computer-readable storage medium for storing computer-readable programs or instructions, which, when executed by a processor, can implement the steps of the underwater image enhancement method in any of the above-mentioned implementations.

[0042] The present invention first decomposes the image to be processed into at least three initial color channels that can represent different colors of light, and then performs color correction on the image to be processed according to the intensity difference between the different initial color channels, and then adjusts the brightness to obtain the corrected target enhanced image. Compared with the prior art, the present invention makes adjustments based on the specific differences between the initial color channels of the image to be processed, that is, it has a priori process when processing the image, and can make more targeted corrections based on the different attenuation of different colors of light during image acquisition, rather than only compensating for certain specific colors. It can flexibly and effectively deal with the problem of different attenuation conditions of different colors of light in different scenes, and is more adaptive. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 A method flow chart of an embodiment of an underwater image enhancement method provided by the present invention;

[0044] Figure 2 for Figure 1 A method flow chart of an embodiment of step S102;

[0045] Figure 3 for Figure 1 Flow chart of a method of an embodiment of step S103. DETAILED DESCRIPTION

[0046] The preferred embodiments of the present invention are described in detail below in conjunction with the accompanying drawings, wherein the accompanying drawings constitute a part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not used to limit the scope of the present invention.

[0047] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0048] The present invention provides an underwater image enhancement method and a storage medium, which are respectively described below.

[0049] like Figure 1 As shown, a specific embodiment of the present invention discloses an underwater image enhancement method, the method comprising:

[0050] S101, obtaining an image to be processed, and separating the image to be processed into at least three initial color channels;

[0051] S102, performing color correction on the image to be processed according to an intensity difference between any two of the at least three initial color channels to obtain a color-corrected image;

[0052] S103: Perform brightness adjustment on the color-corrected image to obtain a target enhanced image.

[0053] The present invention first decomposes the image to be processed into at least three initial color channels that can represent different color lights, and then performs color correction on the image to be processed according to the intensity difference between the different initial color channels, and then adjusts the brightness to obtain the corrected target enhanced image. For example, based on the RGB color space, the image to be processed is decomposed into R channel, G channel and B channel, representing red, green and blue light respectively, and then according to the different intensity differences of the three color lights, correction is carried out in a targeted manner. When the green channel attenuates the weakest, the image can be corrected based on the red and blue channels, and when the blue channel attenuates the weakest, the image can be corrected based on the red and green channels. After color correction, the brightness of the image is adjusted to complete the enhancement of the entire image.

[0054] Most of the existing technologies adjust images based on fixed patterns. For example, in most cases, the red channel has the weakest attenuation, so all images are enhanced by repairing the blue and green channels. Compared with the existing technologies, the present invention makes adjustments based on the specific differences between the initial color channels of the image to be processed, that is, it has a priori process when processing images, and can make more targeted corrections based on the different attenuation of light of different colors during image acquisition, rather than just compensating for certain specific colors. It can flexibly and effectively deal with the problem of different light attenuation conditions of different colors in different scenes, and is more adaptive.

[0055] The following is a more detailed description of the above steps:

[0056] In step S101 of a preferred embodiment, the image to be processed is decomposed into three initial color spaces, which best conforms to the commonly used RGB color space analysis mode, that is, the three initial color channels decomposed are respectively the red color channel, the green color channel and the blue color channel representing the three primary colors, which is more practical and easy to understand. If conditions permit, other color spaces can be used to decompose the image to be processed according to specific circumstances, as long as the color space can decompose the image to be processed into at least three initial color channels that can represent different color lights, such as CMYK color space.

[0057] The three initial color channels decomposed in this embodiment can be divided into a strong color channel, a medium color channel and a weak color channel according to their intensity. It should be noted that the intensity of the initial color channel in this embodiment refers to the average value of all elements in the matrix corresponding to the initial color channel. The larger the value, the stronger the light reflected by the initial color channel. Of course, other judgment criteria can also be used to judge the strength of the initial color channel in practice.

[0058] Combination Figure 2 As shown, as a preferred embodiment, step S102 in this embodiment, color correction is performed on the image to be processed according to the intensity difference between any two of the at least three initial color channels to obtain a color-corrected image, including:

[0059] S201, correcting the medium color channel and the weak color channel according to the intensity difference between the strong color channel, the medium color channel and the weak color channel to obtain corrected medium color channel and weak color channel;

[0060] S202, correcting the strong color channel to obtain a corrected strong color channel;

[0061] S203: Combine the corrected strong color channel, medium color channel and weak color channel to obtain the color-corrected image.

[0062] The above steps use the difference of the three initial color channels to correct only the medium color channel and the weak color channel to compensate for the defects caused by the color light with more attenuation. For the strong color channel, because its light attenuation is less, it can reflect the real information of the object, so it does not need to be corrected according to the difference of the three initial color channels. A simple correction is sufficient to retain its original characteristics to the greatest extent and improve the enhancement effect of this method.

[0063] In a preferred embodiment, step S201, correcting the medium color channel and the weak color channel according to the intensity difference between the strong color channel, the medium color channel and the weak color channel to obtain the corrected medium color channel and the weak color channel, comprises:

[0064] Obtaining a first correction coefficient, a second correction coefficient, and a third correction coefficient according to the intensity differences among the strong color channel, the medium color channel, and the rear color channel;

[0065] The medium color channel and the weak color channel are corrected according to the first correction coefficient, the second correction coefficient and the third correction coefficient to obtain the corrected medium color channel and the weak color channel.

[0066] Specifically, the specific method for obtaining the first correction coefficient, the second correction coefficient and the third correction coefficient in the step is as follows:

[0067] Obtaining the first correction coefficient according to the intensity difference between the strong color channel and the medium color channel;

[0068] Obtaining the second correction coefficient according to the intensity difference between the strong color channel and the weak color channel;

[0069] The third correction coefficient is obtained according to the intensity difference between the medium color channel and the weak color channel.

[0070] In this embodiment, the above steps are implemented by the following formula:

[0071]

[0072]

[0073]

[0074] Where L, M, and S are the matrices corresponding to the strong color channel, medium color channel, and weak color channel, respectively. and are the average values ​​of the matrices M and S respectively, that is, the average values ​​of the values ​​of all elements in the matrices, and the formula ‖*‖1 represents the L1 norm of any matrix *. Similarly, the formula ‖*‖2 represents the L2 norm of any matrix *. j, k, ω are the first correction coefficient, the second correction coefficient, and the third correction coefficient respectively.

[0075] It can be seen that the first correction coefficient is used to reflect the intensity difference between the strong color channel and the medium color channel, the second correction coefficient is used to reflect the intensity difference between the strong color channel and the weak color channel, and the third correction coefficient is used to reflect the intensity difference between the medium color channel and the weak color channel. According to the first correction coefficient, the second correction coefficient and the third correction coefficient, the three initial color channels can be corrected more specifically.

[0076] Further, in step S201, the middle color channel and the weak color channel are corrected according to the first correction coefficient, the second correction coefficient and the third correction coefficient to obtain the corrected middle color channel and the weak color channel, including:

[0077] Correcting the middle color channel according to the first correction coefficient and the third correction coefficient to obtain the corrected middle color channel;

[0078] The weak color channel is corrected according to the second correction coefficient and the third correction coefficient to obtain the corrected weak color channel.

[0079] The specific calculation process used in the above method in this embodiment is:

[0080]

[0081]

[0082] Where CM is the matrix corresponding to the corrected middle color channel, CM xy is the element in the xth row and yth column of the matrix CM, M xy is the element in the xth row and yth column of the matrix M, M max is the element with the largest value in the matrix M. min is the element with the smallest value in the matrix M. Similarly, CS is the matrix corresponding to the corrected weak color channel, CS xy is the element in the xth row and yth column of the matrix CS, S xy is the element in the xth row and yth column of the matrix S, S max is the element with the largest value in the matrix S. min is the element with the smallest value in the matrix S.

[0083] In addition, in step S202 of this embodiment, the corrected strong color channel is calculated by the following formula:

[0084]

[0085] Where CL is the matrix corresponding to the corrected strong color channel, CL xyis the element on the xth row and yth column in the matrix CL, L xy is the element in the xth row and yth column of the matrix L, L max is the element with the largest value in matrix L. min is the element with the smallest value in the matrix L.

[0086] The color-corrected image can be obtained by combining the above-corrected strong color channel, medium color channel and weak color channel, that is, executing the above-mentioned step S203. After color correction, the image needs to be adjusted in brightness to obtain the final target enhanced image.

[0087] Specifically, see Figure 3 The present invention also provides a preferred embodiment, in which step S103 of adjusting the brightness of the color-corrected image to obtain a target enhanced image includes:

[0088] S301, obtaining three corrected color channels of the color-corrected image based on the RGB color space according to the color-corrected image;

[0089] S302, decomposing the original illumination component of the color-corrected image based on a Retinex model;

[0090] S303, decomposing three reflection components corresponding to the three corrected color channels based on a Retinex model according to the original illumination component and the three corrected color channels;

[0091] S304, optimizing the contrast of the original illumination component to obtain a modified illumination component;

[0092] S305: Obtain a target enhanced image according to the corrected illumination component and the three reflection components.

[0093] Among them, the Retinex model is a model based on the Retinex theory, and its theoretical basis is the trichromatic theory and color constancy: that is, the color of an object is determined by the object's ability to reflect long-wave (red), medium-wave (green), and short-wave (blue) light, rather than the absolute value of the reflected light intensity. The color of an object is not affected by the non-uniformity of illumination and is consistent, that is, Retinex is based on color consistency (color constancy). Different from traditional linear and nonlinear methods that can only enhance a certain type of image features, Retinex can strike a balance in three aspects: dynamic range compression, edge enhancement, and color constancy, so it can adaptively enhance various types of images.

[0094] Retinex theory believes that an image is composed of an illumination component and a reflection component. The illumination component reflects the ambient light conditions of the object, that is, the information of the light irradiating the object, while the reflection component reflects the color information of the object itself. The combination of the illumination component and the reflection component is the image reflected to the human eye or devices such as cameras.

[0095] This embodiment decomposes the color-corrected image into its original illumination component and the reflection components corresponding to the three color channels, and then corrects only the original illumination component to obtain the corrected illumination component, that is, only corrects the brightness of the light irradiated on the object without destroying the color information of the object itself, thereby obtaining a high-quality target enhanced image.

[0096] Obviously, the accuracy of the original illumination component obtained will directly affect the effect of brightness adjustment. Therefore, the present invention further provides a preferred embodiment. In this embodiment, step S302, decomposing the original illumination component of the color correction image based on the Retinex model, includes:

[0097] Establishing an illumination component estimation model and obtaining a gradient of the illumination component estimation model;

[0098] Obtaining a weight matrix according to the color-corrected image;

[0099] The illumination component estimation model is optimized according to the gradient of the illumination component estimation model and the weight matrix to obtain the original illumination component.

[0100] Among them, the illumination component estimation model can be used as the basis for subsequent optimization to obtain a more accurate original illumination component. The gradient of the illumination component estimation model can be used to remove the texture details in the illumination component estimation model. The weight matrix can enable the original illumination component to maintain the original brightness characteristics and smooth texture details.

[0101] Specifically, in a preferred embodiment, the step of establishing the illumination component estimation model and obtaining the gradient of the illumination component estimation model further includes:

[0102] Obtaining the maximum values ​​at the same position in the matrices corresponding to the three corrected color channels, and combining them to form a matrix as a lighting component estimation model;

[0103] The maximum value of the gradients of the matrices corresponding to the three corrected color channels is obtained as the gradient of the illumination component estimation model.

[0104] Specifically, as a preferred embodiment, in this embodiment, the lighting component estimation model is established by the following formula:

[0105] I0=max(R(x,y),G(x,y),B(x,y))

[0106] Wherein, I0 is the illumination component estimation model, which is a preliminarily estimated matrix that can approximately represent the original illumination component of the color-corrected image. R, G, and B are matrices corresponding to the three corrected color channels decomposed in step S301, respectively, representing the information corresponding to the red channel, green channel, and blue channel of the color-corrected image, respectively. R(x, y), G(x, y), and B(x, y) are the elements on the xth row and yth column in the R, G, and B matrices, respectively. The above formula means taking the maximum value at the same position in the R, G, and B matrices, and reconstructing a new matrix I0.

[0107] In addition, this embodiment obtains the gradient of the illumination component estimation model by the following formula:

[0108]

[0109] In the formula, is the difference operator, represents the gradient of the required illumination component estimation model, They represent the gradients of matrices R, G, and B respectively. The meaning of the above formula is to take the maximum value at each position in the gradient matrix of the matrix corresponding to the three corrected color channels, and combine them as the gradient of the illumination component estimation model.

[0110] In a preferred embodiment, obtaining a weight matrix according to the color-corrected image includes:

[0111] Obtaining a lightness channel of the color-corrected image based on the HSV color space;

[0112] The weight matrix is ​​obtained according to the brightness channel and preset parameters.

[0113] Specifically, this embodiment calculates the weight matrix by the following formula:

[0114]

[0115] Where F is the required weight matrix, F(x,y) is the element on the x-th row and y-th column of the matrix F, e is the exponent, V is the matrix corresponding to the brightness channel of the color-corrected image decomposed based on the HSV color space, V(x,y) is the element on the x-th row and y-th column of the matrix V, u is the average value of all elements in the matrix V, σ1 and σ2 are preset parameters set according to the specific situation. The selection of the two values ​​will affect the calculation results of the weight matrix, and then affect the effect of subsequent image enhancement. According to experiments, it can be concluded that the image enhancement effect is best when σ1 is 0.05 and σ2 is 0.01.

[0116] The u in the above formula can be used as a threshold to separate the brightness channel into a bright foreground and a dim background. The weight matrix obtained using this threshold can be used to constrain the gradient of the illumination component so that the obtained original illumination component and the target enhanced image maintain the original brightness characteristics of the foreground and background, that is, different lighting conditions close to or far away from the imaging system light source, while smoothing the texture details, which is conducive to relevant personnel to obtain valuable information from it.

[0117] After the above steps, the illumination component estimation model can be optimized according to the gradient of the illumination component estimation model and the weight matrix to obtain the original illumination component. In a preferred embodiment, the specific calculation formula is as follows:

[0118]

[0119] Where I is the matrix corresponding to the original illumination component to be obtained, represents the gradient corresponding to the required original illumination component, α and β are both trade-off factors, where The meaning is that, under the condition that the expression * takes the minimum value, the matrix I is solved.

[0120] The original illumination component obtained by solving the above steps not only reflects the illumination conditions of the image to be processed, but also maintains the original brightness characteristics of the underwater foreground and background, effectively reflects the most realistic brightness information underwater, and ensures the accuracy of image enhancement.

[0121] The present invention also provides a preferred embodiment, in which step S303 of decomposing three reflection components corresponding to the three corrected color channels based on the Retinex model according to the original illumination component and the three corrected color channels is implemented by the following formula:

[0122] R R =R / I

[0123] G R =G / I

[0124] B R =B / I

[0125] In the formula, R R , G R , B R They are the three reflection components corresponding to the required corrected color channels.

[0126] Further, as a preferred embodiment, step S304 in this embodiment, optimizing the contrast of the original illumination component to obtain the modified illumination component, and using gamma transformation to enhance the contrast of the original illumination component, is specifically as follows:

[0127] Ig =I γ

[0128] Where I g is the matrix corresponding to the modified illumination component obtained after optimization, γ is the parameter of gamma transformation, and its value in this embodiment is 0.45. It can be understood that, according to different specific circumstances, the above gamma transformation parameters can also select other values, and similarly, it is also feasible to use other existing methods to improve the contrast of the original illumination component.

[0129] Then, step S305 may be performed to obtain a target enhanced image according to the corrected illumination component and the three reflection components, specifically:

[0130]

[0131]

[0132]

[0133] In the formula, R O , G O , B O They are three matrices obtained according to the corrected illumination component and the three reflection components, respectively representing the red color channel, green color channel and blue color channel of the target enhanced image. The target enhanced image can be obtained by combining the three.

[0134] The present invention also provides a computer-readable storage medium on which an underwater image enhancement program is stored. When the underwater image enhancement program is executed by a processor, the steps in any of the above embodiments can be implemented.

[0135] The present invention first decomposes the image to be processed into at least three initial color channels that can represent different colors of light, and then performs color correction on the image to be processed according to the intensity difference between the different initial color channels, and then adjusts the brightness to obtain the corrected target enhanced image. Compared with the prior art, the present invention makes adjustments based on the specific differences between the initial color channels of the image to be processed, that is, it has a priori process when processing the image, and can make more targeted corrections based on the different attenuation of different colors of light during image acquisition, rather than only compensating for certain specific colors. It can flexibly and effectively deal with the problem of different attenuation conditions of different colors of light in different scenes, and is more adaptive.

[0136] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0137] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by any technician familiar with the technical field within the technical scope disclosed by the present invention should be covered within the protection scope of the present invention.

Claims

1. A method for underwater image enhancement, characterized in that: include: Acquire an image to be processed, and separate the image to be processed into at least three initial color channels; Performing color correction on the image to be processed according to an intensity difference between any two of the at least three initial color channels to obtain a color-corrected image; Performing brightness adjustment on the color-corrected image to obtain a target enhanced image; The number of the initial color channels is three, and the three initial color channels are respectively a strong color channel, a medium color channel, and a weak color channel; and the color correction of the image to be processed is performed according to the intensity difference between any two initial color channels of the at least three initial color channels to obtain a color-corrected image, including: According to the intensity difference between the strong color channel, the medium color channel and the weak color channel, the medium color channel and the weak color channel are corrected to obtain a corrected medium color channel and a weak color channel; Correcting the strong color channel to obtain a corrected strong color channel; Combining the corrected strong color channel, medium color channel and weak color channel to obtain the color-corrected image; The method of correcting the medium color channel and the weak color channel according to the intensity difference between the strong color channel, the medium color channel and the weak color channel to obtain the corrected medium color channel and the weak color channel comprises: Obtaining a first correction coefficient, a second correction coefficient, and a third correction coefficient according to the intensity differences among the strong color channel, the medium color channel, and the rear color channel; Correcting the medium color channel and the weak color channel according to the first correction coefficient, the second correction coefficient, and the third correction coefficient to obtain the corrected medium color channel and the weak color channel; The obtaining of the first correction coefficient, the second correction coefficient and the third correction coefficient according to the intensity differences among the strong color channel, the medium color channel and the rear color channel comprises: Obtaining the first correction coefficient according to the intensity difference between the strong color channel and the medium color channel; Obtaining the second correction coefficient according to the intensity difference between the strong color channel and the weak color channel; Obtaining the third correction coefficient according to the intensity difference between the medium color channel and the weak color channel; The step of correcting the medium color channel and the weak color channel according to the first correction coefficient, the second correction coefficient, and the third correction coefficient to obtain the corrected medium color channel and the weak color channel includes: Correcting the middle color channel according to the first correction coefficient and the third correction coefficient to obtain the corrected middle color channel; The weak color channel is corrected according to the second correction coefficient and the third correction coefficient to obtain the corrected weak color channel.

2. The underwater image enhancement method according to claim 1, characterized in that: The step of adjusting the brightness of the color-corrected image to obtain a target enhanced image includes: According to the color-corrected image, three corrected color channels of the color-corrected image are obtained based on the RGB color space; Decomposing the original illumination component of the color-corrected image based on a Retinex model; Decomposing three reflection components corresponding to the three corrected color channels based on a Retinex model according to the original illumination component and the three corrected color channels; Optimizing the contrast of the original illumination component to obtain a modified illumination component; A target enhanced image is obtained according to the corrected illumination component and the three reflection components.

3. The underwater image enhancement method according to claim 2, characterized in that: The step of decomposing the original illumination component of the color-corrected image based on the Retinex model comprises: Establishing an illumination component estimation model and obtaining a gradient of the illumination component estimation model; Obtaining a weight matrix according to the color-corrected image; The illumination component estimation model is optimized according to the gradient of the illumination component estimation model and the weight matrix to obtain the original illumination component.

4. The underwater image enhancement method according to claim 3, characterized in that: The step of establishing the illumination component estimation model and obtaining the gradient of the illumination component estimation model includes: Obtaining the maximum values ​​at the same position in the matrices corresponding to the three corrected color channels, and combining them to form a matrix as a lighting component estimation model; The maximum value of the gradients of the matrices corresponding to the three corrected color channels is obtained as the gradient of the illumination component estimation model.

5. The underwater image enhancement method according to claim 4, characterized in that: The step of obtaining a weight matrix according to the color-corrected image comprises: Obtaining a lightness channel of the color-corrected image based on the HSV color space; The weight matrix is ​​obtained according to the brightness channel and preset parameters.

6. A computer-readable storage medium, characterized in that: Used to store computer-readable programs or instructions, which, when executed by a processor, can implement the steps of any one of the underwater image enhancement methods in claims 1 to 5.