Underwater image processing method, device, equipment and storage medium

By performing enhanced correction processing and defogging imaging model on underwater images, the chromatic aberration and blur problems of underwater images are solved, and a clearer image processing effect is achieved.

CN115205200BActive Publication Date: 2025-09-23BEIJING INST OF TECH ZHUHAI CAMPUS
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210501007.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-10
Publication Date
2025-09-23
Estimated Expiration
2042-05-10

AI Technical Summary

Technical Problem

Images of underwater environments have severe chromatic aberration and blurring due to the different attenuation of light of different wavelengths in water and the scattering of light by plankton and suspended particles in the water, which affects the research results.

Method used

By acquiring underwater images, performing enhancement and correction processing, calculating channel differences to determine the ambient background light, and using the defogging imaging model and gray world algorithm to calculate the target image.

Benefits of technology

Reduce the severe chromatic aberration of underwater images, improve the deblurring effect of images, and enhance the visual effect of images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115205200B_ABST
    Figure CN115205200B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, device, equipment and storage medium for processing underwater images. The present invention acquires an underwater image and performs enhancement and correction processing on the underwater image to obtain a corrected image, thereby reducing severe chromatic aberration of the underwater image. The present invention acquires a first channel value of a G channel of the corrected image, a second channel value of a B channel of the corrected image and a third channel value of a R channel of the corrected image, calculates a first channel difference between the first channel value and the third channel value, and calculates a second channel difference between the second channel value and the third channel value, determines ambient background light based on the maximum value of the first channel difference and the second channel difference, and thereby determines the maximum value of fog concentration in the corrected image. This improves the deblurring effect of a target image calculated by a defogging imaging model based on the ambient background light and the corrected image, and enables processing of underwater images. The present invention can be widely applied to the field of image processing technology.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing, and in particular to a method, device, equipment and storage medium for processing underwater images. Background Art

[0002] At present, research on underwater environments usually involves taking images of underwater environments. However, due to the different attenuation of light of different wavelengths in water and the scattering of light by plankton and suspended particles in the water, images of underwater environments will have serious chromatic aberration and blurring problems. Using images of underwater environments with severe chromatic aberration and blur for underwater environment research will affect the research results. Therefore, a solution that can effectively process underwater environment images is needed. Summary of the Invention

[0003] In view of this, in order to solve the above technical problems, an object of the present invention is to provide a method, device, equipment and storage medium for processing underwater images.

[0004] The technical solution adopted in the embodiment of the present invention is:

[0005] A method for processing underwater images, comprising:

[0006] Acquire underwater images;

[0007] Performing enhancement and correction processing on the underwater image to obtain a corrected image; the pixels of the corrected image include a G channel, a B channel, and an R channel;

[0008] Obtaining a first channel value of the G channel of the corrected image, a second channel value of the B channel of the corrected image, and a third channel value of the R channel of the corrected image, calculating a first channel difference between the first channel value and the third channel value, and calculating a second channel difference between the second channel value and the third channel value;

[0009] determining the ambient background light according to a maximum value of the first channel difference and the second channel difference;

[0010] A target image is obtained by calculating a defogging imaging model according to the ambient background light and the corrected image.

[0011] Furthermore, the enhancing and correcting the underwater image to obtain a corrected image includes:

[0012] performing enhancement processing on the underwater image to obtain an enhanced image;

[0013] Performing chromatic aberration correction processing on the enhanced image to obtain a corrected image.

[0014] Furthermore, the enhancing process of the underwater image to obtain an enhanced image includes:

[0015] respectively extracting channel images corresponding to the G channel of the underwater image, the B channel of the underwater image, and the R channel of the underwater image;

[0016] Calculating a color restoration factor according to a preset nonlinear strength, the channel image, and a preset gain constant;

[0017] An enhanced image is obtained according to the color restoration factor and the underwater image.

[0018] Furthermore, performing chromatic aberration correction on the enhanced image to obtain a corrected image includes:

[0019] The enhanced image is subjected to chromatic aberration correction processing by using a gray world algorithm to obtain a corrected image.

[0020] Furthermore, determining the ambient background light according to the maximum value of the first channel difference and the second channel difference includes:

[0021] Determine a pixel position where a maximum value of the first channel difference and the second channel difference is located;

[0022] Ambient background light is determined according to the first channel value of the pixel position, the second channel value of the pixel position, and the third channel value of the pixel position.

[0023] Furthermore, the target image is obtained by calculating the defogging imaging model according to the ambient background light and the corrected image, including:

[0024] Determining a transmission rate target value according to the ambient background light, and determining a transmission rate image according to the transmission rate target value;

[0025] A target image is calculated based on the transmission rate image, the corrected image, the ambient background light, and a defogging imaging model; the defogging imaging model is used to characterize the relationship between the transmission rate image, the corrected image, the ambient background light, and the target image.

[0026] Furthermore, determining the transmission rate target value according to the ambient background light includes:

[0027] Calculating a first difference between the corrected image and the ambient background light and calculating a second difference between a preset channel maximum value and the ambient background light;

[0028] determining a first target value according to a first ratio of the first difference to the negative ambient background light, and determining a second target value according to a second ratio of the first difference to the second difference;

[0029] A transmission rate target value is determined according to a maximum value of the first target value and the second target value.

[0030] An embodiment of the present invention further provides an underwater image processing device, comprising:

[0031] An acquisition module, used for acquiring underwater images;

[0032] A processing module, configured to perform enhancement and correction processing on the underwater image to obtain a corrected image; the pixels of the corrected image include a G channel, a B channel, and an R channel;

[0033] a first calculation module, configured to obtain a first channel value of the G channel of the corrected image, a second channel value of the B channel of the corrected image, and a third channel value of the R channel of the corrected image, calculate a first channel difference between the first channel value and the third channel value, and calculate a second channel difference between the second channel value and the third channel value;

[0034] a determining module, configured to determine the ambient background light according to a maximum value of the first channel difference and the second channel difference;

[0035] The second calculation module is used to calculate the target image through a defogging imaging model according to the ambient background light and the corrected image.

[0036] An embodiment of the present invention also provides an electronic device, comprising a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set, or an instruction set, and the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by the processor to implement the method.

[0037] An embodiment of the present invention also provides a computer-readable storage medium, in which at least one instruction, at least one program, a code set or an instruction set is stored. The at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by a processor to implement the method.

[0038] The beneficial effects of the present invention are as follows: by acquiring an underwater image, performing enhancement and correction processing on the underwater image to obtain a corrected image, severe chromatic aberration of the underwater image can be reduced; obtaining a first channel value of the G channel of the corrected image, a second channel value of the B channel of the corrected image, and a third channel value of the R channel of the corrected image, calculating a first channel difference between the first channel value and the third channel value, and calculating a second channel difference between the second channel value and the third channel value, determining the ambient background light according to the maximum value of the first channel difference and the second channel difference, thereby determining the maximum value of the fog concentration in the corrected image, improving the deblurring effect of the target image calculated by a defogging imaging model according to the ambient background light and the corrected image, and realizing the processing of the underwater image. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 1 is a schematic flow chart of the steps of the underwater image processing method of the present invention;

[0040] Figure 2 Schematic diagram of the functional relationship between the ideal image and the corrected image according to a specific embodiment of the present invention. DETAILED DESCRIPTION

[0041] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.

[0042] The terms "first," "second," "third," and "fourth," etc., in the specification and claims of this application and the accompanying drawings are used to distinguish between different objects, rather than to describe a specific order. In addition, the terms "including," "having," and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or elements is not limited to the listed steps or elements, but may optionally include steps or elements not listed, or may optionally include other steps or elements inherent to the process, method, product, or apparatus.

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

[0044] like Figure 1 As shown, an embodiment of the present invention provides a method for processing underwater images, including steps S100-S500:

[0045] S100: Acquire underwater images.

[0046] Optionally, the underwater image includes but is not limited to being acquired by a LUCID polarization camera. For example, an underwater target may be illuminated by an active light source, and then the underwater target may be photographed by a LUCID polarization camera to obtain an underwater image.

[0047] S200: Perform enhancement and correction processing on the underwater image to obtain a corrected image.

[0048] In the embodiment of the present invention, images such as underwater images and corrected images all include three color channels, namely, a G channel, a B channel, and an R channel. That is, each pixel in the image has a value corresponding to the G channel, the B channel, and the R channel.

[0049] Optionally, step S200 includes steps S210-S220:

[0050] S210: Perform enhancement processing on the underwater image to obtain an enhanced image.

[0051] In the embodiment of the present invention, the enhancement process is used to enhance the underwater image as a whole, improve the brightness of the underwater image, and solve the problem of the underwater image being dark as a whole. Specifically, step S210 includes steps S2101-S2103:

[0052] S2101 , respectively extracting channel images corresponding to the G channel of the underwater image, the B channel of the underwater image, and the R channel of the underwater image.

[0053] S2102: Calculate a color restoration factor according to a preset nonlinear strength, the channel image, and a preset gain constant.

[0054] Specifically, the formula is:

[0055]

[0056] Among them, I i (x,y) is the channel image corresponding to the i-th channel, C i (x, y) is the color restoration factor of the i-th channel, α is the controlled preset nonlinear intensity, β is the preset gain constant, f() function represents the mapping of color space, I j (x,y) is the jth pixel, N is the total number of pixels,

[0057] In an embodiment of the present invention, a color restoration factor is used to adjust the proportional relationship between the three color channels in an underwater image, so that the information in the relatively dark areas of the underwater image is enhanced, thereby reducing or even eliminating color distortion caused by excessive image chromatic aberration. The overall color of the underwater image obtained after such processing is closer to the real scene, thereby achieving a better visual effect.

[0058] S2103: Obtain an enhanced image according to the color restoration factor and the underwater image.

[0059]

[0060]

[0061] Combining formula (11) and formula (21) we get:

[0062]

[0063] in, is the output of Retinex of the i-th channel, F n (x,y) represents the Gaussian surround function, W n Indicates that F n (x, y) related weight coefficient, N1 represents the number of scales, the input image is a color image, so N1 = 3, To enhance the image.

[0064] S220: Perform chromatic aberration correction on the enhanced image to obtain a corrected image.

[0065] In an embodiment of the present invention, based on the different attenuation of red light, green light, and blue light in water, the gray world algorithm is used to perform chromatic aberration correction on the enhanced image, thereby adjusting the ratio of the R channel, G channel, and B channel of the enhanced image, correcting the chromatic aberration of the enhanced image, and obtaining a color-corrected corrected image.

[0066] S300: Obtain a first channel value of the G channel of the corrected image, a second channel value of the B channel of the corrected image, and a third channel value of the R channel of the corrected image, calculate a first channel difference between the first channel value and the third channel value, and calculate a second channel difference between the second channel value and the third channel value.

[0067] Specifically, the calculation formula is:

[0068] E g,b (x,y)-E r (x,y)

[0069] Among them, E g,b(x, y) represents the first channel value of the G channel and the second channel value of the B channel at the pixel (x, y) of the rectified image, E r (x, y) represents the third channel value of the R channel at the pixel (x, y) of the corrected image. Therefore, the first channel difference can be calculated based on the difference between the first channel value and the third channel value, and the second channel difference can be calculated based on the difference between the second channel value and the third channel value.

[0070] S400: Determine the ambient background light according to the maximum value of the first channel difference and the second channel difference.

[0071] (x0, y0) = argmax(E g,b (x, y)-E r (x, y)

[0072] A=E(x0,y0)

[0073] Specifically, determine E g,b (x,y)-E r The maximum value of (x, y) is determined, that is, the maximum value of the first channel difference and the second channel difference is determined, which is also equivalent to the difference between the larger value of the first channel value and the second channel value and the third channel value; the argmax function is then used to calculate the pixel position (x0, y0) where the maximum value is located, and the pixel value E(x0, y0) (including the first channel value, the second channel value, and the third channel value) at the pixel position (x0, y0) in the corrected image is then determined as the ambient background light A. It should be noted that the embodiment of the present invention discusses and proposes a new method for calculating the ambient background light A in the RGB color space based on the physical model and the relationship between each color channel. Referring to the dark channel prior, the brightest point in the dark channel image corresponds to the point with the highest fog concentration in the image. The light intensity of this point is very close to the intensity of the atmospheric background light. In this embodiment of the present invention, the light intensity of the point in the image most affected by scattering is used as the ambient background light intensity, thereby extracting the pixel value of the point with the highest brightness in the image as the value of the ambient background light (atmospheric background light) A, which can well reflect the ambient background light.

[0074] S500 : Obtain a target image by calculating a defogging imaging model according to the ambient background light and the corrected image.

[0075] In an embodiment of the present invention, the defogging imaging model is used to characterize the relationship between the transmission rate image, the corrected image, the ambient background light, and the target image. Optionally, the defogging imaging model is:

[0076] E(x,y)=D(x,y)t(x,y)+(1-t(x,y))A (1)

[0077] Where E(x,y) is the corrected image, D(x,y) is the ideal image (i.e., the ideal target image), t(x,y) is the transmission rate image, which decays exponentially with increasing distance, and A represents the ambient background light. From formula (1), we can see that as distance increases, D(x,y) decreases and A increases, indicating that the farther the target scene is from the camera, the greater the impact of scattering.

[0078] Optionally, step S500 includes steps S510-S520:

[0079] S510: Determine a transmission rate target value according to the ambient background light, and determine a transmission rate image according to the transmission rate target value.

[0080] In the embodiment of the present invention, since the contrast of underwater images and corrected images in areas severely affected by scattering is low, the mean square error is introduced to reflect the degree to which the data deviates from the true value, and is promoted to reflect the contrast of the image.

[0081]

[0082] in, represents the average size of the pixel values ​​of the ideal image, D(x,y) represents the size of the pixel value at (x,y) in the ideal image, N represents the total number of pixels, and Contrst represents the contrast level of the ideal image. Compared with underwater images, corrected images, and other images, the contrast of the ideal image will be greater.

[0083] From formula (1), we can get:

[0084]

[0085] Combining formula (2) and formula (3) we get:

[0086]

[0087]

[0088] in, represents the average pixel value of the rectified image, and E(x,y) represents the pixel value at (x,y) in the rectified image. In this embodiment of the present invention, the goal is to make the value of Contrst as large as possible. That is, when E(x,y) is fixed, the smaller |t(x,y)| is, the better, and 0<|t(x,y)|<1.

[0089] Alternatively, based on formula (1), t(x,y) and A are considered constants, and the relationship between the ideal image D(x,y) and E(x,y) is obtained as follows: Figure 2 As shown. Among them, from Figure 2We can know that the pixel value range of the ideal image D(x,y) and the corrected image E(x,y) is between [0, 255]. When a pixel value greater than 255 appears in the image, the computer defaults the pixel value to 255. When a pixel value less than 0 appears in the image, the computer defaults the pixel value to 0. Figure 2 The shaded area shown represents the range of data overflow during the mapping of E(x, y) to the ideal image D(x, y), i.e., image data loss. In this embodiment of the present invention, based on the aforementioned features, to effectively map more data and minimize data loss, the ideal image pixel value range is controlled to be between [0, 255], i.e., the preset channel maximum value is set to 255. It should be noted that in other embodiments, the preset channel maximum value can be set to other values ​​based on actual needs and is not specifically limited.

[0090] Optionally, determining a target transmission rate value according to the ambient background light includes the following steps S5101-S5103:

[0091] S5101 , calculating a first difference between the corrected image and the ambient background light, and calculating a second difference between a preset channel maximum value and the ambient background light.

[0092] S5102: Determine a first target value according to a first ratio of the first difference to the negative ambient background light, and determine a second target value according to a second ratio of the first difference to the second difference.

[0093] Specifically, the calculation formula of the first target value is:

[0094]

[0095] The calculation formula for the second target value is:

[0096]

[0097] Among them, A is the ambient background light, C∈{R,G,B}, for example, E G (x,y) represents the G channel image of the rectified image.

[0098] S5103. Determine a transmission rate target value according to the maximum value of the first target value and the second target value.

[0099] Specifically, the transmission rate target value t C (x,y):

[0100]

[0101] In the embodiment of the present invention, during the actual image acquisition process, due to the influence of suspended particles and plankton in the water on the propagation path, the transmission rate image of each color channel is not a constant, and there are differences between each element. Based on the derivation of the above formula (4), an approximate estimate of the transmission rate target value is obtained as follows:

[0102]

[0103] Among them, C∈{R,G,B}, for example, when C is G, t G (x, y) is the target transmission rate value for the G channel. Therefore, according to formula (5), the target transmission rate values ​​for each of the three channels can be determined, resulting in a transmission rate image t(x, y) in which all three channel values ​​for each pixel are the target transmission rate values. This embodiment of the present invention uses the corrected image as a guide image for the transmission rate image and optimizes the transmission rate image t(x, y) using guided filtering, thereby obtaining a highly effective and accurate transmission rate image t(x, y).

[0104] S520 , calculating and obtaining a target image according to the transmission rate image, the corrected image, the ambient background light, and the defogging imaging model.

[0105] Specifically, by substituting the corrected image E(x, y), the transmission rate image t(x, y), and the ambient background light A into formula (1), the real target image corresponding to the ideal image D(x, y) can be calculated, and the calculation result of the final target image can be obtained.

[0106] In addition, the embodiment of the present invention selects image information entropy (Eentropy), peak signal-to-noise ratio (PSNR), structural similarity (SSIM) and the existing dark channel prior of Kaiming He [1], underwater video image enhancement based on fusion principle of Ancuti C [2] and relative global histogram stretching method of adaptive parameter acquisition of Huang [3] for quantitative analysis:

[0107]

[0108] The corresponding papers for [1], [2], and [3] are as follows:

[0109] [1] Kaiming He, Jian Sun, Xiaoou Tang. single image haze removal using dark channel prior. IEEE Conference on Computer Vision and Pattern Recognition, 2009.

[0110] [2]Ancuti C, AncutiC O, Haber T, et al.Enhancing underwater images and videos by fusion[C] / / IEEE Conference on Computer Vision&PatternRecognition.IEEE, 2012.

[0111] [3] DHuang, Yan W, Wei S, et al. Shallow-water Image Enhancement Using Relative Global Histogram Stretching Based on Adaptive Parameter Acquisition[C] / / International Conference on Multimedia Modeling. Springer, Cham, 2018.

[0112] The image's information entropy (Eentropy) reflects the amount of information contained in the image, the peak signal-to-noise ratio (PSNR) reflects the degree of image distortion or noise, and the structural similarity (SSIM) indicates the similarity between the processed image and the original. As can be seen in the table above, the proposed method improves the information entropy of underwater images better than other algorithms, while the PSNR and structural similarity are comparable, demonstrating excellent results in underwater image processing.

[0113] An embodiment of the present invention further provides an underwater image processing device, comprising:

[0114] An acquisition module, used for acquiring underwater images;

[0115] A processing module, configured to perform enhancement and correction processing on the underwater image to obtain a corrected image; the pixels of the corrected image include a G channel, a B channel, and an R channel;

[0116] a first calculation module, configured to obtain a first channel value of the G channel of the corrected image, a second channel value of the B channel of the corrected image, and a third channel value of the R channel of the corrected image, calculate a first channel difference between the first channel value and the third channel value, and calculate a second channel difference between the second channel value and the third channel value;

[0117] a determining module, configured to determine the ambient background light according to a maximum value of the first channel difference and the second channel difference;

[0118] The second calculation module is used to calculate the target image through a defogging imaging model according to the ambient background light and the corrected image.

[0119] The contents of the above method embodiments are all applicable to the present device embodiments. The functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0120] An embodiment of the present invention further provides an electronic device comprising a processor and a memory, wherein the memory stores at least one instruction, at least one program, code set, or instruction set, and the at least one instruction, at least one program, code set, or instruction set is loaded and executed by the processor to implement the underwater image processing method of the aforementioned embodiment. The electronic device of the embodiment of the present invention includes, but is not limited to, any intelligent terminal such as a mobile phone, tablet computer, computer, or vehicle-mounted computer.

[0121] The contents of the above method embodiments are all applicable to the present device embodiments. The functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0122] An embodiment of the present invention also provides a computer-readable storage medium, which stores at least one instruction, at least one program, code set or instruction set, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by a processor to implement the underwater image processing method of the aforementioned embodiment.

[0123] An embodiment of the present invention further provides a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the underwater image processing method of the aforementioned embodiment.

[0124] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0125] It should be understood that in this application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0126] In the several embodiments provided herein, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of units is merely a logical functional division. In actual implementation, other division methods may be used, such as combining or integrating multiple units or components into another system, or omitting or disabling certain features. Furthermore, the coupling or direct coupling or communication connection shown or discussed between each other may be through interfaces, or indirect coupling or communication connection between devices or units, which may be electrical, mechanical, or other forms. Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, i.e., they may be located in one place or distributed across multiple network units. Some or all of the units may be selected to achieve the objectives of the present embodiments according to actual needs. Furthermore, the functional units in the various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in either hardware or software functional units.

[0127] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes multiple instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store programs.

[0128] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for processing underwater images, characterized in that: include: Acquire underwater images; Performing enhancement and correction processing on the underwater image to obtain a corrected image; the pixels of the corrected image include a G channel, a B channel, and an R channel; Obtaining a first channel value of the G channel of the corrected image, a second channel value of the B channel of the corrected image, and a third channel value of the R channel of the corrected image, calculating a first channel difference between the first channel value and the third channel value, and calculating a second channel difference between the second channel value and the third channel value; determining the ambient background light according to a maximum value of the first channel difference and the second channel difference; Obtaining a target image by calculating a defogging imaging model according to the ambient background light and the corrected image; The step of calculating a target image using a defogging imaging model according to the ambient background light and the corrected image includes: Determining a transmission rate target value according to the ambient background light, and determining a transmission rate image according to the transmission rate target value; Calculating a target image based on the transmission rate image, the corrected image, the ambient background light, and a defogging imaging model; the defogging imaging model is used to characterize the relationship between the transmission rate image, the corrected image, the ambient background light, and the target image; The determining of the transmission rate target value according to the ambient background light includes: Calculating a first difference between the corrected image and the ambient background light and calculating a second difference between a preset channel maximum value and the ambient background light; determining a first target value according to a first ratio of the first difference to the negative ambient background light, and determining a second target value according to a second ratio of the first difference to the second difference; A transmission rate target value is determined according to a maximum value of the first target value and the second target value.

2. The underwater image processing method according to claim 1, characterized in that: The performing enhancement and correction processing on the underwater image to obtain a corrected image includes: performing enhancement processing on the underwater image to obtain an enhanced image; Performing chromatic aberration correction processing on the enhanced image to obtain a corrected image.

3. The underwater image processing method according to claim 2, characterized in that: The step of performing enhancement processing on the underwater image to obtain an enhanced image includes: respectively extracting channel images corresponding to the G channel of the underwater image, the B channel of the underwater image, and the R channel of the underwater image; Calculating a color restoration factor according to a preset nonlinear strength, the channel image, and a preset gain constant; An enhanced image is obtained according to the color restoration factor and the underwater image.

4. The underwater image processing method according to claim 2, characterized in that: The performing chromatic aberration correction processing on the enhanced image to obtain a corrected image includes: The enhanced image is subjected to chromatic aberration correction processing by using a gray world algorithm to obtain a corrected image.

5. The underwater image processing method according to claim 1, characterized in that: The determining of the ambient background light according to the maximum value of the first channel difference and the second channel difference includes: Determine a pixel position where a maximum value of the first channel difference and the second channel difference is located; Ambient background light is determined according to the first channel value of the pixel position, the second channel value of the pixel position, and the third channel value of the pixel position.

6. A device for implementing the underwater image processing method according to any one of claims 1 to 5, It is characterized by: include: An acquisition module, used for acquiring underwater images; A processing module, configured to perform enhancement and correction processing on the underwater image to obtain a corrected image; the pixels of the corrected image include a G channel, a B channel, and an R channel; a first calculation module, configured to obtain a first channel value of the G channel of the corrected image, a second channel value of the B channel of the corrected image, and a third channel value of the R channel of the corrected image, calculate a first channel difference between the first channel value and the third channel value, and calculate a second channel difference between the second channel value and the third channel value; a determining module, configured to determine the ambient background light according to a maximum value of the first channel difference and the second channel difference; The second calculation module is used to calculate the target image through a defogging imaging model according to the ambient background light and the corrected image.

7. An electronic device, characterized in that: The electronic device includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set, or an instruction set, and the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by the processor to implement the method according to any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that The storage medium stores at least one instruction, at least one program, a code set, or an instruction set, and the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by the processor to implement the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Background light statistical model and transmission map optimization-based underwater image enhancement method

    CN108596853A

  • Underwater image defogging and color cast correction method based on bright channel transmissivity compensation

    CN110322410A