An underwater image enhancement method, device, equipment and medium
By employing contrast stretching, image decomposition, and red channel compensation methods, combined with color correction, the problem of poor underwater image quality has been solved, resulting in improved clarity and color accuracy of underwater images. This technology is suitable for underwater image enhancement devices and equipment.
Patent Information
- Application Number
- CN202311025604.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-14
- Publication Date
- 2025-12-26
- Estimated Expiration
- 2043-08-14
AI Technical Summary
Existing deep learning-based underwater image enhancement algorithms struggle to acquire paired underwater and real-world images in real-world environments, resulting in poor underwater image quality. In particular, under the influence of factors such as water flow and equipment vibration, image details are severely lost, and the synthesized datasets fail to reflect true features.
Underwater images are processed using methods such as contrast stretching, image decomposition, red channel compensation, and color correction. This includes contrast-limited adaptive histogram equalization, bilateral filtering, and image decomposition into a base layer and a detail layer. The green and blue channels are used to compensate for detail information in the red channel, and color correction is performed using a grayscale world algorithm.
It improves the clarity and color accuracy of underwater images, eliminates blur and color difference, enhances image details, and improves the effect of underwater target detection.
Smart Images

Figure CN117173041B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image processing, and in particular to an underwater image enhancement method, device, equipment and medium. BACKGROUND
[0002] The scattering effect of suspended particles and a large number of plankton in water on light, and the absorption effect of water on light of different wavelengths cause problems such as color attenuation, low contrast and blurring of underwater images, which seriously affect the development of the ocean.
[0003] The improvement of underwater imaging technology can provide more useful information for the development of the ocean, and the method is to process the obtained underwater information through an algorithm. One of the methods is image enhancement based on deep learning. However, the existing underwater image enhancement algorithm based on deep learning generally performs supervised learning on paired underwater images and real images on land, but in the real environment, it is difficult to obtain paired underwater images and their corresponding real images on land. It is an extremely difficult task to eliminate the effects of scattering and attenuation by means of light supplementing and other means, and to shoot images that are not affected by the underwater environment. Because of water flow, equipment jitter and manual operation, it is difficult to ensure that the two images are taken of the same scene. Researchers are almost impossible to collect corresponding real images on land that meet the standard. Most researchers synthesize underwater images based on underwater imaging models to make paired data sets, but the synthesized underwater image data sets in the current research are difficult to widely reflect the real characteristics of underwater imaging. In the actual application process, it will cause the underwater images to be overexposed or underexposed, and at the same time, the details of the images will be lost. SUMMARY
[0004] Therefore, the embodiments of the present application provide an underwater image enhancement method, device, equipment and medium, which can effectively enhance the underwater image and improve the quality of the underwater image.
[0005] In one aspect, the embodiments of the present application provide an underwater image enhancement method, comprising:
[0006] An original underwater image is obtained, and the original underwater image is subjected to contrast stretching to obtain a first image; the first image includes a red channel, a green channel and a blue channel;
[0007] The first image is subjected to image decomposition to obtain a base layer and a detail layer of each channel;
[0008] The red channel is compensated according to the detail layer of the green channel or the detail layer of the blue channel in combination with the base layer of the red channel to obtain a compensated red channel;
[0009] The compensated red channel, the green channel and the blue channel are combined to obtain a second image;
[0010] color correction is performed on the second image to obtain a target underwater image.
[0011] Optionally, the original underwater image is subjected to contrast stretching to obtain a first image, comprising:
[0012] The contrast of each channel of the original underwater image is stretched by a contrast-limited adaptive histogram equalization method to obtain a red channel, a green channel and a blue channel, respectively.
[0013] Optionally, before the step of image decomposition of the first image, the method further comprises:
[0014] The first image is subjected to denoising preprocessing by bilateral filtering to obtain a denoised first image.
[0015] Optionally, the first image is subjected to image decomposition to obtain a base layer and a detail layer of each channel, comprising:
[0016] The first image is subjected to mean filtering to obtain a base layer of each channel.
[0017] The detail layer of each channel is obtained according to the difference between each channel of the first image and the corresponding base layer of each channel.
[0018] Optionally, red channel compensation is performed according to the detail layer of the green channel or the detail layer of the blue channel in combination with the base layer of the red channel, comprising:
[0019] The green channel mean value and the blue channel mean value are sequentially determined based on the green channel and the blue channel.
[0020] When the green channel mean value is greater than the blue channel mean value, red channel compensation is performed by the detail layer of the green channel in combination with the base layer of the red channel.
[0021] When the blue channel mean value is greater than the green channel mean value, red channel compensation is performed by the detail layer of the blue channel in combination with the base layer of the red channel.
[0022] Optionally, color correction is performed on the second image to obtain a target underwater image, comprising:
[0023] The second image is subjected to color correction by a gray world algorithm to obtain a target underwater image.
[0024] Optionally, the second image is subjected to color correction by a gray world algorithm to obtain a target underwater image, comprising:
[0025] The compensated red channel mean value, the green channel mean value and the blue channel mean value are sequentially determined based on the compensated red channel, the green channel and the blue channel.
[0026] The compensation red channel mean value, the green channel mean value and the blue channel mean value are averaged to obtain a gray mean value;
[0027] According to the ratio of the gray mean value to the compensation red channel mean value, a first compensation coefficient is obtained in combination with a preset weight coefficient; and according to the ratio of the gray mean value to the green channel mean value and the blue channel mean value, a second compensation coefficient is obtained.
[0028] The compensation red channel of the second image is subjected to first compensation processing through the first compensation coefficient, and the green channel and the blue channel of the second image are subjected to second compensation processing through the second compensation coefficient, to obtain a target underwater image.
[0029] In another aspect, an embodiment of the present application provides an underwater image enhancement device, comprising:
[0030] A first module is configured to acquire an original underwater image, perform contrast stretching on the original underwater image, and obtain a first image; the first image comprises a red channel, a green channel and a blue channel.
[0031] A second module is configured to perform image decomposition on the first image to obtain a base layer and a detail layer of each channel.
[0032] A third module is configured to perform red channel compensation on the red channel in combination with the base layer of the red channel according to the detail layer of the green channel or the detail layer of the blue channel, to obtain a compensation red channel.
[0033] A fourth module is configured to combine the compensation red channel, the green channel and the blue channel to obtain a second image.
[0034] A fifth module is configured to perform color correction on the second image to obtain a target underwater image.
[0035] Optionally, before the second module performs processing, the device further comprises:
[0036] A sixth module is configured to perform denoising preprocessing on the first image by using a bilateral filter to obtain a denoised first image.
[0037] In another aspect, an embodiment of the present application provides an electronic device, comprising a processor and a memory;
[0038] The memory is configured to store a program;
[0039] The processor executes the program to implement the method as described above.
[0040] In another aspect, an embodiment of the present application provides a computer readable storage medium, which stores a program; the program is executed by a processor to implement the method as described above.
[0041] The embodiment of the present application also discloses a computer program product or computer program, which comprises computer instructions stored in a computer readable storage medium. A processor of a computer device can read the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to enable the computer device to execute the foregoing method.
[0042] The embodiment of the present application first acquires an original underwater image, performs contrast stretching on the original underwater image to obtain a first image, the first image comprises a red channel, a green channel and a blue channel, performs image decomposition on the first image to obtain a base layer and a detail layer of each channel, performs red channel compensation on the base layer of the red channel according to the detail layer of the green channel or the detail layer of the blue channel to obtain a compensated red channel, and combines the compensated red channel, the green channel and the blue channel to obtain a second image. The embodiment of the present application performs color difference attenuation compensation on the underwater image through contrast stretching, image decomposition and red channel compensation, thereby improving the quality of the underwater image. The present application can process the underwater image without relying on an underwater imaging system, thereby improving the quality of the underwater image. BRIEF DESCRIPTION OF DRAWINGS
[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative effort.
[0044] Figure 1 A flowchart of an underwater image enhancement method provided by the embodiment of the present application is shown in the figure.
[0045] Figure 2 A principle diagram of contrast limitation provided by the embodiment of the present application is shown in the figure.
[0046] Figure 3 A comparison diagram of contrast stretching before and after the contrast stretching provided by the embodiment of the present application is shown in the figure.
[0047] Figure 4 An effect comparison diagram of filtering underwater images by different templates provided by the embodiment of the present application is shown in the figure.
[0048] Figure 5 A green-tone underwater image provided by the embodiment of the present application is shown in the figure.
[0049] Figure 6 A comparison diagram of mean values of each channel of a green underwater image provided by the embodiment of the present application is shown in the figure.
[0050] Figure 7 This is a schematic diagram of an underwater image with a blue tone provided in an embodiment of the present invention;
[0051] Figure 8 This is a schematic diagram comparing the mean values of each channel in a blue underwater image provided in an embodiment of the present invention.
[0052] Figure 9 A schematic diagram of the overall architecture of the underwater image enhancement method provided in this embodiment of the invention;
[0053] Figure 10 This is a schematic diagram of the structure of an underwater image enhancement device provided in an embodiment of the present invention;
[0054] Figure 11 This is a schematic diagram of the frame of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0055] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0056] On the one hand, such as Figure 1 As shown, an embodiment of the present invention provides an underwater image enhancement method, including:
[0057] S100: Acquire the original underwater image, and perform contrast stretching on the original underwater image to obtain the first image;
[0058] The first image includes a red channel, a green channel, and a blue channel;
[0059] It should be noted that in some embodiments, the underwater environment contains a large number of suspended particles. Due to the scattering effect, the underwater image will be relatively blurry, as if shrouded in a layer of fog, with low contrast. Furthermore, in environments such as the deep sea where natural light does not reach, the use of artificial light sources or other focused lighting results in uneven illumination of the target scene. Images acquired in such environments will have some areas brighter than others. Contrast stretching of the original underwater image to obtain a first image can include: using a contrast-limited adaptive histogram equalization method to stretch the contrast of each channel of the original underwater image, obtaining the red, green, and blue channels respectively.
[0060] In some specific embodiments, a contrast-limited adaptive histogram equalization method can be used to stretch each channel of the image.
[0061]
[0062] Where C∈{R,G,B} represents the red, green, and blue channels of the image, IC C-channel image representing the original underwater image, CLAHE() represents the image processing using the contrast limited adaptive histogram equalization method, underwater image after contrast enhancement.
[0063] The contrast limited adaptive histogram equalization is an improvement of the adaptive histogram equalization mentioned in the above related work, as shown in the following formula: Figure 2 The algorithm uses a pre-set threshold to limit the maximum amplitude of the histogram, clips the histogram after calculating the mapping function, and then uniformly distributes the clipped pixel values to each gray level of the image, suppressing the noise of adaptive histogram equalization. At the same time, the bilinear interpolation is used to splice the image blocks divided in adaptive histogram equalization, and the boundaries between the equalized image blocks and the image blocks are removed. In order to better understand the underwater image, it is divided into several regions of different sizes. Then, the histogram of each region is calculated and the corresponding mapping function is used to process it. For pixels close to the edge, the mapping function of the nearest region is used to process it. For pixels not close to the edge, the mapping function of the nearest four regions is used to process it.
[0064] As shown in Figure 3 , it is the image and its channel image and the corresponding histogram before and after stretching using the CLACHE (Contrast Limited Adaptive Histogram Equalization) method. The histogram distribution of each channel before and after stretching is similar, but in the underwater image after stretching, there are more pixels in the red channel in the large pixel value range, and more pixels in the blue channel in the small pixel value range. The underwater image after stretching obviously removes the blue or green tone of the original underwater image.
[0065] S200, image decomposition is performed on the first image to obtain a base layer and a detail layer of each channel;
[0066] It should be noted that in some embodiments, before the step of performing image decomposition on the first image, the method can further include: performing denoising preprocessing on the first image using bilateral filtering to obtain a denoised first image.
[0067] In some embodiments, step S200 can include: performing mean filtering on the first image to obtain a base layer of each channel; and obtaining a detail layer of each channel according to the difference between each channel of the first image and the corresponding base layer of each channel.
[0068] In some embodiments, image decomposition refers to decomposing an image into two parts, a structure part and a texture part, where the structure part refers to the basic objects in the image with larger scales, which we call the base layer of the image, and the texture part refers to the detailed objects with smaller scales, which we call the detail layer of the image, as shown in equation (2). Before image decomposition, the image needs to be pre-processed by denoising to prevent noise from being considered as detailed information, which affects the decomposition result of the image.
[0069]
[0070] where C ∈ {R, G, B}, equation (2) shows that the image C channel with enhanced contrast is considered as the accumulation of the base layer and the detail layer.
[0071] Due to the influence of plankton and suspended particles on imaging in underwater environment, the underwater images taken are superimposed with serious noise due to too many disturbances. In order to improve the clarity of underwater images, we use the bilateral filtering technology. This technology can effectively suppress the disturbance of plankton and suspended particles on the image, thereby reducing the generation of noise. Through this method, we can retain the details of the image while minimizing the disturbance to the real information of the image. Then we take the image mean value as the threshold to decompose the image into two parts, the base layer and the detail layer, as shown in equation (3). We perform mean filtering on the C channel of the image with enhanced contrast, and consider the filtered image as the base layer of the channel.
[0072]
[0073] where Z represents the mean filter, and * represents convolution operation. The selection of the filter template size is self-adaptive to the image resolution, Figure 4 respectively, the filter template size of 4*4, the filter template size of 40*40, the minimum size of the image (i.e. filter size = max{m, n}) and the maximum size of the image (i.e. filter size = max{m, n}) as the filter template for the comparison of the filtering effect on the underwater image. A template with too small size will make the underwater image too smooth and produce a red edge. In this experiment, the maximum size of the image is selected as the filter template, which can have a good smoothing effect on the detail area of the underwater image and retain the brightness information of the underwater image, which is convenient for detail extraction. As mentioned above, the image is composed of a base layer and a detail layer, so the detail layer of the channel is:
[0074]
[0075] S300, compensating the red channel according to the detail layer of the green channel or the detail layer of the blue channel in combination with the base layer of the red channel to obtain a compensated red channel;
[0076] It should be noted that in some embodiments, step S300 can include: determining the green channel mean value and the blue channel mean value in turn based on the green channel and the blue channel; when the green channel mean value is greater than the blue channel mean value, performing red channel compensation by combining the detail layer of the green channel with the base layer of the red channel; and when the blue channel mean value is greater than the green channel mean value, performing red channel compensation by combining the detail layer of the blue channel with the base layer of the red channel.
[0077] In some specific embodiments, relative to red light, blue light and green light attenuate relatively slowly in water and propagate the farthest distance. Therefore, we believe that the red channel information of the image loses more, and the blue and green channel information is retained more. We observed that multiple researchers used more underwater image datasets, and found that most underwater images present blue and green tones. Among them, images presenting blue tones are mostly images taken in deep sea, and images presenting green tones are taken in relatively near sea areas. We also found in field research that the seawater near the coastline is generally very turbid due to water flow and silt, and under normal circumstances, it presents yellow. Far from the coast, the seawater gradually presents green, and continues to move away from the coast, the seawater gradually presents blue. For green-tone underwater images, we believe that the green channel detail information is the most complete information preserved in the attenuation; for blue-tone underwater images, we believe that the blue channel detail information is the most complete information preserved in the attenuation.
[0078] For green-tone underwater images, we believe that the green channel detail information of the image is the most complete information preserved by the attenuation, and for blue-tone underwater images, we believe that the blue channel detail information of the image is the most complete information preserved by the attenuation. Because under natural lighting conditions, red light is generally consumed completely by the attenuation at a distance of 4 meters underwater. Therefore, we believe that the red channel detail information of the image is lost more seriously, and the green channel and the blue channel need to compensate for the lost detail information of the red channel.
[0079] After a large number of image tests, it is found that the blue channel mean value of the blue-tone underwater image is the largest, and the green channel mean value of the green-tone underwater image is the largest. We selected 20 representative images from the blue underwater images and the green underwater images respectively for analysis, and the analysis results are shown in Table 1. Figure 5 、 Figure 6 、 Figure 7 、 Figure 8 Therefore, we compare the green channel mean value and the blue channel mean value of the image to determine whether to compensate the red channel detail information by using the green channel or the blue channel.
[0080] Figure 3The images before and after stretching by CLAHE method, their respective channel images and corresponding histograms are shown. In the underwater image of blue tone, the pixel values of red channel are mostly distributed around the pixel value equal to 0. The corresponding red channel image has many black points. In the image processing process, when the pixel value of a pixel is very close to 0, the computer may assume that the pixel value of the pixel is 0. Therefore, in the process of processing, the image information corresponding to this part may be lost, and the corresponding position in the image will become a black point. In addition, when the pixel value is small, the human eye is difficult to distinguish the details in the dark image.
[0081] Through a large number of statistical experiments, it is found that the pixel value of the red channel in the blue or green tone image is relatively small, Figure 6 and Figure 8 Most of the red channel pixels are below 50. Therefore, it is considered that the loss of detail information in the red channel of the image is serious, and the lost detail information in the red channel needs to be compensated by the green channel and the blue channel.
[0082]
[0083] wherein G ave ,B ave are the mean values of the green channel and the blue channel of the image respectively, and R cp is the red channel after compensating the detail information. The above formula shows that when G ave >B ave , the image is green tone as a whole, the detail layer of the green channel of the image is used to compensate the red channel; when B ave >G ave , the image is blue tone as a whole, the detail layer of the blue channel of the image is used to compensate the red channel.
[0084] As shown in Figure 6 and Figure 8 , the mean value of the green channel of the underwater image of green tone is the largest among the mean values of the three channels, and for the underwater image of blue tone, the mean value of the blue channel is the largest among the mean values of the three channels. And the mean values of the red channels of the underwater images of blue tone and green tone are the smallest. Even in most cases, the mean value of the red channel is less than 50. In the method of the present application, the main tone of the image is first judged, and then the lost detail information of the red channel is compensated by the detail information of the main tone.
[0085] S400, merging the compensated red channel, green channel and blue channel to obtain a second image;
[0086] It should be noted that in some specific embodiments, R cp , are finally merged as the underwater image result after red channel attenuation compensation.
[0087] S500, performing color correction on the second image to obtain a target underwater image;
[0088] It should be noted that in some embodiments, step S500 can include performing color correction on the second image using a gray world algorithm to obtain the target underwater image.
[0089] In some embodiments, performing color correction on the second image using a gray world algorithm to obtain the target underwater image can include: determining, based on the compensated red channel, green channel and blue channel, in sequence, a compensated red channel mean value, a green channel mean value and a blue channel mean value; performing average processing on the compensated red channel mean value, the green channel mean value and the blue channel mean value to obtain a gray mean value; obtaining a first compensation coefficient according to a ratio of the gray mean value to the compensated red channel mean value and in combination with a preset weight coefficient; and obtaining a second compensation coefficient according to a ratio of the gray mean value to the green channel mean value and the blue channel mean value; performing first compensation processing on the compensated red channel of the second image through the first compensation coefficient, and performing second compensation processing on the green channel and the blue channel of the second image through the second compensation coefficient to obtain the target underwater image.
[0090] In some specific embodiments, the underwater image after the compensated red channel partially eliminates the influence of the attenuation effect on the underwater image, but there is still a certain deviation between the underwater image and the true color of the target scene, so the gray world is introduced to eliminate the influence of light attenuation of different wavelengths on the image and restore the true color of the target scene. It is found in experiments that most results will appear as a whole red image, so the red channel is limited when using the gray world algorithm:
[0091]
[0092] wherein a is a weight coefficient for controlling the color recovery of the red channel. Its value range is [0, 1]: if a is too small, it will lead to insufficient red compensation of the image, thereby losing some color information, so that the image as a whole presents a blue-green mixed color; on the contrary, if a is too large, it will lead to excessive compensation of the image, so that the whole is reddish, especially the background part of the image will present pink. In the experiments of the present paper, a = 0.8 is selected, which has a good performance. ave ,G ave ,B ave are the mean values of R cp , represents the C channel of the output image.
[0093] In summary, as Figure 9 As shown, the present application is aimed at the problems existing in the prior underwater image processing, and proposes an underwater image enhancement method based on pixel processing. The method mainly adopts a three-step strategy of contrast enhancement, image decomposition and red channel attenuation compensation, and combines denoising preprocessing and color correction to process the underwater image without relying on the underwater imaging system, thereby improving the quality of the underwater image. Specifically, based on the difference in the attenuation of light of different wavelengths in the underwater environment, the present application decomposes the underwater image to be processed in the RGB color space, further decomposes each channel image into a base layer containing image structure information and a detail layer containing image texture information, and proposes a method for compensating the red channel detail information with the blue-green channel detail information. Meanwhile, the present application provides a new underwater image processing method which only processes the image pixels and can eliminate image blur and correct image color difference at the same time. Moreover, the present application includes a large number of detailed experiments, such as verifying the correlation between the mean value of the blue-green channel and the image hue, and the improvement effect of the enhanced underwater image on the underwater target detection result.
[0094] The present application uses the underwater color image quality evaluation metric (UCIQE) and the synthetic underwater image dataset EUVP provided in FUnIE-GAN as the image quality evaluation indicators of the non-reference image. UCIQE refers to the linear combination of color concentration, saturation and contrast, and is an evaluation of the non-uniform color difference, blur and low contrast of the underwater image. Through quantitative and qualitative analysis, it is proved that the algorithm of the present application has significant improvement on the underwater image, and the obtained image has more uniform color and richer details, and has obvious advantages in subjective test, and is more in line with human visual aesthetics, and the color of the processed image is more in line with the actual situation.
[0095] On the other hand, as Figure 10 As shown, the embodiment of the present application provides an underwater image enhancement device 600, which comprises: a first module 610, configured to acquire an original underwater image, perform contrast stretching on the original underwater image, and obtain a first image; the first image comprises a red channel, a green channel and a blue channel; a second module 620, configured to perform image decomposition on the first image to obtain a base layer and a detail layer of each channel; a third module 630, configured to compensate the red channel according to the detail layer of the green channel or the detail layer of the blue channel in combination with the base layer of the red channel, and obtain a compensated red channel; a fourth module 640, configured to merge the compensated red channel, the green channel and the blue channel to obtain a second image; and a fifth module 650, configured to perform color correction on the second image to obtain a target underwater image.
[0096] It should be noted that in some embodiments, before the second module processes, the device further comprises:
[0097] A sixth module is configured to perform de-noising preprocessing on the first image by using bilateral filtering to obtain a de-noised first image.
[0098] The method embodiments of the present application are applicable to the device embodiments, the device embodiments achieve the same functions as the method embodiments, and achieve the same beneficial effects as the method embodiments.
[0099] As shown in Figure 11 Another aspect of the embodiments of the present application further provides an electronic device 700, which comprises a processor 710 and a memory 720.
[0100] The memory 720 is configured to store a program.
[0101] The processor 710 executes the program to realize the method as described above.
[0102] The method embodiments of the present application are applicable to the electronic device embodiments, the electronic device embodiments achieve the same functions as the method embodiments, and achieve the same beneficial effects as the method embodiments.
[0103] Another aspect of the embodiments of the present application further provides a computer readable storage medium, which stores a program, and the program is executed by a processor to realize the method as described above.
[0104] The method embodiments of the present application are applicable to the computer readable storage medium embodiments, the computer readable storage medium embodiments achieve the same functions as the method embodiments, and achieve the same beneficial effects as the method embodiments.
[0105] The embodiments of the present application further disclose a computer program product or a computer program, which comprises computer instructions stored in a computer readable storage medium. A processor of a computer device can read the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to enable the computer device to execute the method as described above.
[0106] In some alternative embodiments, the functions / operations mentioned in the block diagram can not occur in the order mentioned in the operation diagram. For example, depending on the functions / operations involved, two blocks shown in succession can actually be executed substantially simultaneously or the blocks can sometimes be executed in reverse order. In addition, the embodiments presented and described in the flowcharts of the present application are provided by way of example, and the purpose is to provide a more comprehensive understanding of the technology. The disclosed method is not limited to the operations and logical flows presented herein. Alternative embodiments are contemplated in which the order of various operations is changed and in which sub-operations described as part of larger operations are independently executed.
[0107] Furthermore, although the invention has been described in the context of functional modules, it should be understood that, unless otherwise stated, one or more of the functions and / or features may be integrated into a single physical device and / or software module, or one or more functions and / or features may be implemented in a separate physical device or software module. It is also understood that a detailed discussion of the actual implementation of each module is unnecessary for understanding the invention. Rather, given the properties, functions, and internal relationships of the various functional modules in the apparatus disclosed herein, the actual implementation of the module will be understood within the scope of conventional skill of an engineer. Therefore, those skilled in the art can implement the invention as set forth in the claims using ordinary techniques without excessive experimentation. It is also understood that the specific concepts disclosed are merely illustrative and not intended to limit the scope of the invention, which is determined by the full scope of the appended claims and their equivalents.
[0108] If a function is implemented as 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 this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0109] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution means, apparatus, or device (such as a computer-based device, a processor-including device, or other means that can fetch and execute instructions from, or in conjunction with, an instruction execution means, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution means, apparatus, or device.
[0110] More specific examples (a non-exhaustive list) of the computer-readable medium include the following: an electrical connection (electronic) having one or more wires, a portable computer diskette (magnetic), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium can also be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, for example, via optical scanning of the paper or other medium, then compiled, interpreted, or otherwise processed in a suitable manner, if necessary, and then stored in a computer memory.
[0111] It should be understood that aspects of the application can be implemented in hardware, software, firmware or combinations thereof. In the embodiments described above, various steps or methods can be implemented, for example, by software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, and in another embodiment, any of the following techniques can be used to implement the hardware: discrete logic circuits having logic gates for implementing logic functions upon data signals, application specific integrated circuits having logic gates for implementing logic functions upon data signals, programmable gate arrays (PGA), field programmable gate arrays (FPGA), and the like.
[0112] In the description of the specification, the description of the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" and the like means that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present application. In the specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0113] Although embodiments of the present application have been shown and described, it would be recognized by those of ordinary skill in the art that various changes, modifications, alternatives, and variations can be made to the embodiments without departing from the principles and spirit of the application, the scope of which is defined by the claims and their equivalents.
[0114] The above is a specific description of the preferred embodiments of the present application, but the present application is not limited to the embodiments, and those skilled in the art can make various equivalent modifications or replacements without departing from the spirit of the present application, and these equivalent modifications or replacements are all included in the scope defined by the claims of the present application.
Claims
1. An underwater image enhancement method, characterized by, The method comprises the following steps: obtaining an original underwater image, performing contrast stretching on the original underwater image to obtain a first image; the first image comprises a red channel, a green channel and a blue channel; performing image decomposition on the first image to obtain a base layer and a detail layer of each channel; performing red channel compensation on the base layer of the red channel according to the detail layer of the green channel or the detail layer of the blue channel, to obtain a compensated red channel; merging the compensated red channel, the green channel and the blue channel to obtain a second image; performing color correction on the second image to obtain a target underwater image.
2. The method of claim 1, wherein, The method comprises the following steps: performing contrast stretching on each channel of the original underwater image by a contrast-limited adaptive histogram equalization method to obtain the red channel, the green channel and the blue channel, respectively.
3. The method of claim 1, wherein, Before the step of performing image decomposition on the first image, the method further comprises the following steps: performing denoising preprocessing on the first image by a bilateral filter to obtain a denoised first image.
4. The method of claim 1, wherein, The method comprises the following steps: performing mean filtering on the first image to obtain a base layer of each channel; obtaining a detail layer of each channel according to the difference between each channel of the first image and the base layer corresponding to each channel.
5. The method of claim 1, wherein, The method comprises the following steps: determining a green channel mean value and a blue channel mean value in sequence based on the green channel and the blue channel; when the green channel mean value is greater than the blue channel mean value, performing red channel compensation on the base layer of the red channel by the detail layer of the green channel; when the blue channel mean value is greater than the green channel mean value, performing red channel compensation on the base layer of the red channel by the detail layer of the blue channel.
6. The method of claim 1, wherein, The method comprises the following steps: performing color correction on the second image by a gray world algorithm to obtain a target underwater image.
7. The method of claim 6, wherein, The method comprises the following steps: determining a compensated red channel mean value, a green channel mean value and a blue channel mean value in sequence based on the compensated red channel, the green channel and the blue channel; performing average processing on the compensated red channel mean value, the green channel mean value and the blue channel mean value to obtain a gray mean value; obtaining a first compensation coefficient according to the ratio of the gray mean value to the compensated red channel mean value in combination with a preset weight coefficient, and obtaining a second compensation coefficient according to the ratio of the gray mean value to the green channel mean value and the blue channel mean value; performing first compensation processing on the compensated red channel of the second image by the first compensation coefficient, and performing second compensation processing on the green channel and the blue channel of the second image by the second compensation coefficient to obtain a target underwater image.
8. An underwater image enhancement device, characterized by The method comprises the following steps: a first module is configured to obtain an original underwater image, perform contrast stretching on the original underwater image to obtain a first image; The first image comprises a red channel, a green channel and a blue channel; A second module is configured to perform image decomposition on the first image to obtain a base layer and a detail layer of each channel; A third module is configured to perform red channel compensation on the base layer of the red channel according to the detail layer of the green channel or the detail layer of the blue channel to obtain a compensated red channel; A fourth module is configured to combine the compensated red channel, the green channel and the blue channel to obtain a second image; A fifth module is configured to perform color correction on the second image to obtain a target underwater image.
9. An electronic device, comprising: A processor and a memory are included; The memory is configured to store a program; The processor executes the program to implement the method in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The storage medium stores a program, and the program is executed by a processor to implement the method in any one of claims 1 to 7.
Citation Information
Patent Citations
Image preprocessing algorithm suitable for container automatic intelligent upgrading
CN113902628A
Vehicle intelligent detection method, system and equipment in severe weather and medium
CN114549337A