An underwater image enhancement method
By using color cast factor values and color cast judgment in the Lab color space, combined with color compensation, contrast enhancement, and detail enhancement algorithms, the problems of color distortion, low contrast, and blurred details in underwater images are solved, achieving high-quality image enhancement effects.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TIANJIN UNIV
- Filing Date
- 2022-12-13
- Publication Date
- 2026-05-26
AI Technical Summary
Existing technologies struggle to simultaneously address color distortion, low contrast, and blurred details in underwater images, and the applicability of single image enhancement methods is limited.
Color cast is determined using color cast factor values and the chromaticity mean of the Lab color space. Color compensation, contrast enhancement, and detail enhancement are performed in stages, including color cast determination, color compensation, image conversion to the Lab color space, and a combination of the CLAHE algorithm and multi-scale detail enhancement algorithm.
It achieves detailed classification and targeted color correction of underwater images, avoids color changes, improves contrast and detail clarity, eliminates excessive background enhancement, and obtains images that are more consistent with human visual observation.
Smart Images

Figure CN115937029B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of underwater image processing technology, and more particularly to an underwater image enhancement method that integrates color compensation, contrast enhancement, and detail enhancement. Background Technology
[0002] Images, as a highly efficient information carrier, play a crucial role in underwater computer vision tasks. However, the complex underwater imaging environment leads to problems such as color distortion, low contrast, and blurred details in acquired underwater images. Methods for improving degraded underwater images mainly fall into two categories: physical model-based image restoration and image enhancement. Physical model-based restoration methods are based on underwater imaging models. By analyzing the degradation mechanism of underwater images and estimating the parameters of the underwater imaging model, they reverse the degradation process and ultimately obtain a clear underwater image. Image enhancement methods, on the other hand, do not consider the formation mechanism of underwater images. From the perspective of digital image processing, they adjust the pixel values of the image to improve image color and contrast, thereby obtaining an image that better matches human visual perception. Physical model-based image restoration methods require external devices or prior knowledge, while image enhancement methods are simpler to implement, involving only the adjustment of image pixel values without considering the degradation inversion process or assuming prior knowledge. Underwater images exhibit different characteristics depending on the aquatic environment in which they are taken, such as different color casts. Therefore, the applicability of a single image enhancement method is limited, and it is difficult to simultaneously address color distortion, low contrast, and blurred details. Summary of the Invention
[0003] The purpose of this invention is to overcome the shortcomings of the prior art and to solve the problems of color distortion, low contrast and blurred details in underwater images in stages, and to provide an underwater image enhancement method that integrates color compensation, contrast enhancement and detail enhancement.
[0004] The objective of this invention is achieved through the following technical solution:
[0005] An underwater image enhancement method, which integrates color compensation, contrast enhancement, and detail enhancement, includes the following steps:
[0006] S1. Color cast is determined from the original underwater image using the color cast factor value and the mean chromaticity value of the Lab color space;
[0007] S2. Perform color compensation on different images with color casts to obtain color-compensated images;
[0008] S3. Convert the color-compensated image and the unbiased image to the Lab color space to obtain the luminance component L and chrominance components a and b. Apply the CLAHE algorithm and multi-scale detail enhancement algorithm to the luminance component L to obtain the contrast-enhanced luminance component L. e And detailed images;
[0009] S4. Enhance the luminance component L for contrast. e Linearly blend with the detail image, and then combine the resulting luminance component L. f The chromaticity components a and b are converted back to the RGB color space to obtain the final underwater enhanced image.
[0010] Furthermore, step S1 is detailed as follows:
[0011] 1) Statistically analyze the color cast factor values of the original underwater images and reference images in the UIEB underwater image dataset. Determine the threshold for the color cast factor based on the statistical results. Define underwater images with a color cast factor value greater than or equal to the threshold as images with color cast, and images with a color cast factor value less than the threshold as images without color cast.
[0012] 2) For underwater images with color cast, based on their chromaticity mean m a m b The sign and ratio determine the type of color cast. When m a <0 and |m a / m b When |≥1, the underwater image exhibits a green color cast; when m b <0 and |m a / m b When | < 1, the underwater image has a blue tint; in other cases besides the two mentioned above, the underwater image has a yellow tint.
[0013] Furthermore, different color compensation formulas are used for different color cast situations, as detailed below:
[0014] 2) Greenish tint
[0015]
[0016] Where c∈{R,B}, I c (x,y), I cM These are the normalized channel values and channel mean of the original underwater image, respectively. c ′(x,y),I c ′ M These are the channel values and channel mean values after preliminary compensation, respectively. G (x,y), I GM These represent the normalized G-channel values and G-channel mean of the original underwater image, respectively. This is the final compensated channel value;
[0017] 2) Yellowish tint
[0018]
[0019] Where c∈{G,B}, I R (x,y), I RM These are the normalized R-channel values and R-channel mean values of the original underwater image, respectively.
[0020] 3) Blue color cast
[0021]
[0022]
[0023] Where I R (x,y), I G (x,y), I B (x, y) represent the normalized R, G, and B channel values of the original underwater image, respectively. RM I GM I BM I′ is the channel mean of the normalized original underwater image. R (x,y), I′ G (x, y) represent the R and G channel values after initial compensation, respectively, and I′ RM , I′ GM These are the mean values of the R and G channels after preliminary compensation. These are the final compensated R and G channel values;
[0024] After color compensation of underwater images with different color casts, tail-cut histogram stretching is applied to the R, G, and B channels to further improve the dynamic range of the three-channel colors.
[0025] Further, in step S3, the color-compensated image and the unbiased image are converted to the Lab color space to obtain the image luminance component L and chrominance components a and b. Then, the luminance component is divided into image blocks of equal size. For each image block, the CLAHE algorithm is used to adjust the clipping value of the image block histogram using the ratio of the mean to the standard deviation of the image block. Then, the clipped pixels are evenly distributed to each pixel level to obtain a contrast-limited histogram. Finally, bilinear interpolation is performed on the luminance component based on the contrast-limited histogram to obtain the contrast-enhanced luminance component L. e The formula for calculating the cutting value is:
[0026]
[0027] In the formula, Q is the total number of pixels in a certain image block, l is the number of gray levels in the output image, σ is the standard deviation of the image block, m is the mean of the image block, μ is an empirical parameter, and λ is a constant value set to prevent division by zero, which is 0.0001.
[0028] Furthermore, in step S3, the detail map is solved using a logarithmic form. The specific formula for the multi-scale detail enhancement algorithm is as follows:
[0029] D1=log(L+ε)-log(L1+ε) (6)
[0030] D2=log(L1+ε)-log(L2+ε) (7)
[0031] D3=log(L2+ε)-log(L3+ε) (8)
[0032] D=0.7×D1+0.5×D2+0.25×D3 (9)
[0033] Where L represents the luminance component after the color-compensated image and the unbiased image are converted to the Lab color space, L1 = L*G1, L2 = L*G2, L3 = L*G3 are three luminance components with different degrees of blur, "*" represents the convolution operation, G1, G2, G3 are three Gaussian functions with different standard deviations, ε is a constant value added to prevent the log function from being zero, D1, D2, D3 are three different detail maps, and D is the final detail map.
[0034] The present invention also provides an underwater image enhancement device, comprising:
[0035] The color cast judgment unit is used to judge the original underwater image and distinguish between images without color cast and images with color cast. The images with color cast are divided into green color cast images, blue color cast images, and yellow color cast images.
[0036] The color compensation unit is used to perform color compensation on different images with color cast to obtain a color-compensated image.
[0037] The color space conversion unit is used to convert images between RGB and Lab color spaces.
[0038] The image enhancement unit is used to enhance the contrast and improve the detail of the luminance component, and then fuses them to obtain the final underwater enhanced image.
[0039] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the underwater image enhancement method.
[0040] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the underwater image enhancement method.
[0041] Compared with the prior art, the beneficial effects of the technical solution of the present invention are:
[0042] 1. This invention discloses a method for judging color cast using color cast factor value and Lab color space chromaticity mean, including the division of whether there is color cast and the division of color cast types, realizing detailed classification of original underwater images. At the same time, different color compensation methods are used for different color cast images to achieve targeted image color distortion correction.
[0043] 2. This invention converts color-compensated images and unbiased images from the RGB color space to the Lab color space, separates the luminance component and chrominance component, and only performs contrast enhancement and detail enhancement on the luminance component. This ensures that the colors of the color-compensated images and unbiased images are not affected by subsequent steps, and avoids the phenomenon that the image colors will also be changed when contrast and detail enhancement are performed on color-corrected images and unbiased images in the RGB color space.
[0044] 3. This invention is based on an improved CLAHE algorithm. It sets the image patch histogram cropping value according to the mean and standard deviation of the image patch, achieving different degrees of enhancement for the background and texture regions of the image, eliminating the over-enhancement of the background region caused by a single cropping value in the traditional CLAHE algorithm. Simultaneously, it employs an improved multi-scale detail enhancement algorithm, obtaining different detail maps of the luminance component through a logarithmic function, and appropriately combining these detail maps at different scales. The resulting final detail map can simultaneously contain information from detail maps at different scales.
[0045] 4. This invention enhances the contrast and obtains detail images of the luminance components of the color-corrected image and the unbiased image respectively, and linearly fuses the contrast-enhanced luminance component and the detail image, thereby achieving simultaneous enhancement of the contrast and detail of the luminance component. Attached Figure Description
[0046] Figure 1 This is a flowchart illustrating the underwater image enhancement method in this embodiment;
[0047] Figure 2 This is a comparison chart showing the enhancement effects of the present invention and other methods on underwater images in different scenarios. Detailed Implementation
[0048] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only for explaining the present invention and are not intended to limit the present invention.
[0049] To verify the effectiveness of this invention in underwater image enhancement, this embodiment selects underwater images from different scenarios as a test set and conducts subjective and objective comparisons with IBLA, GDCP, Two-step, and CBAF methods.
[0050] like Figure 1 As shown, an underwater image enhancement method, which integrates color compensation, contrast enhancement, and detail enhancement, includes the following steps:
[0051] Step 1: Determine the color cast of the original underwater image using the color cast factor value and the mean chromaticity value of the Lab color space.
[0052] Step 101: Calculate the color cast factor values of the original underwater image and the reference image in the UIEB underwater image dataset. The dataset provider obtains enhanced images of the same original underwater image by applying various underwater image enhancement algorithms to the original underwater image, and then selects the enhanced image with the best effect as the reference image.
[0053] The statistical results are as follows: 671 UIEB original images have a color cast factor value greater than 1, accounting for 75.4% of the total; 623 UIEB reference images have a color cast factor value less than 1, accounting for 70% of the total. Based on the statistical results, the threshold for the color cast factor is determined to be 1. Underwater images with a color cast factor value greater than or equal to 1 are considered to have color cast, while those with a color cast factor value less than 1 are considered to have no color cast. The formula for calculating the color cast factor value is as follows:
[0054]
[0055]
[0056]
[0057]
[0058] K = M / D (5)
[0059] Where a(i,j) and b(i,j) are the chromaticity values of the original underwater image at (i,j) in the Lab color space, p and q are the number of rows and columns of the image, and m a m b Let M be the average of a(i,j) and b(i,j). Introducing the concept of an equivalent circle, then M is the center of the equivalent circle (m). a m b The distance from the origin (0, 0) on the AB chromaticity plane, where D is the radius of the equivalent circle and K is the color cast factor value.
[0060] Step 102: For underwater images with color cast, determine the color mean m. a mb The sign and ratio determine the type of color cast, m a <0 and |m a / m b When |≥1, the underwater image exhibits a green color cast; when m b <0 and |m a / m b When | < 1, the underwater image has a blue tint; in other cases besides the two mentioned above, the underwater image has a yellow tint.
[0061] Step 2: Perform color compensation on images with different color casts.
[0062] Step 201: For different color cast situations, different color compensation formulas are used. The specific formulas are as follows:
[0063] 1) Greenish tint
[0064]
[0065] Where c∈{R,B}, I c (x,y), I cM These are the normalized channel values and channel mean of the original underwater image, respectively. c ′(x,y),I c ′ M These are the channel values and channel mean values after preliminary compensation, respectively. G (x,y), I GM These represent the normalized G-channel values and G-channel mean of the original underwater image, respectively. This is the final compensated channel value.
[0066] 2) Yellowish tint
[0067]
[0068] Where c∈{G,B}, I R (x,y), I RM These are the normalized R-channel values and R-channel mean values of the original underwater image, respectively.
[0069] 3) Blue color cast
[0070]
[0071]
[0072] Where I R (x,y), I G (x,y), I B (x, y) represent the normalized R, G, and B channel values of the original underwater image, respectively. RM IGM I BM I′ is the channel mean of the normalized original underwater image. R (x,y), I′ G (x, y) represent the R and G channel values after initial compensation, respectively. R ′ M , I′ GM These are the mean values of the R and G channels after preliminary compensation. These are the final compensated R and G channel values;
[0073] Step 202: After color compensation of underwater images with different color casts, the R, G, and B channels are further improved by tail-trimmed histogram stretching. The specific calculation formula for tail-trimmed histogram stretching is as follows:
[0074]
[0075] in, I represents the channel values obtained after stretching the tail-cut histogram. c I represents the channel value obtained after color compensation. 0.3t I c The channel value at the 0.3 quantile, I 99.7t I c The channel value at the 99.7th quantile, I cmin I cmax These are the minimum and maximum values of the reset channel, respectively. The xth percentile is defined as follows: the xth percentile indicates that x% of the data are less than the measured value, and (1-x%) of the data are greater than the measured value.
[0076] Step 3: Convert the color-compensated image and the unbiased image to the Lab color space, and apply the improved CLAHE algorithm and the improved multi-scale detail enhancement algorithm to the luminance component to obtain the contrast-enhanced luminance component and detail map.
[0077] Step 301: Convert the color-compensated image and the unbiased image to the Lab color space to obtain the image luminance component L and chrominance components a and b. Then, divide the luminance component into image blocks of equal size. For each image block, the improved CLAHE algorithm adjusts the clipping value of the image block histogram using the ratio of the block's mean to its standard deviation. Then, the clipped pixels are evenly distributed to each pixel level to obtain a contrast-limited histogram. Finally, bilinear interpolation is performed on the luminance component based on the contrast-limited histogram to obtain the contrast-enhanced luminance component L. e The improved formula for calculating the cutting value is as follows:
[0078]
[0079] In the formula, Q is the total number of pixels in a certain image block, l is the number of gray levels in the output image, which is set to 256 in the experiment, σ is the standard deviation of the image block, m is the mean of the image block, μ is an empirical parameter, which is set to 0.3 in the experiment, and λ is a constant value set to prevent division by zero, which is 0.0001.
[0080] Step 302: Solve the detail map using logarithmic form. The specific formula for the improved multi-scale detail enhancement algorithm is as follows:
[0081] D1=log(L+ε)-log(L1+ε) (12)
[0082] D2=log(L1+ε)-log(L2+ε) (13)
[0083] D3=log(L2+ε)-log(L3+ε) (14)
[0084] D=0.7×D1+0.5×D2+0.25×D3 (15)
[0085] Where L represents the luminance component after the color-compensated image and the unbiased image are converted to the Lab color space, L1 = L*G1, L2 = L*G2, L3 = L*G3, which are three luminance components with different degrees of blur, "*" represents the convolution operation, G1, G2, G3 are three Gaussian functions with different standard deviations. In the experiment, the standard deviations of the Gaussian functions are 1, 2, and 4, respectively, ε is a constant value added to prevent the log function from being 0. In the experiment, it is taken as 0.1, D1, D2, D3 are three different detail images, and D is the final detail image.
[0086] Step 4: Enhance the luminance component L for contrast. e Adding it to the detail image D achieves linear blending, yielding the final luminance component L. f and L f The improved image, composed of the original chromaticity components a and b, is converted back to the RGB color space to obtain the final underwater enhanced image.
[0087] like Figure 2 The image shown is a comparison of the enhancement effects of this embodiment and four other methods on underwater images in different scenarios. By comparing the effect images of the method of this invention with those of other methods, it can be found that IBLA and GDCP cannot effectively remove the color cast of the image. Two-step removes the color cast of the image but introduces red distortion to some parts of the image. CBAF can effectively remove the color cast of the image, but the local contrast of the resulting image is not high and the details are not clear. The method of this invention can effectively correct the color distortion of the image and remove the color cast. At the same time, the global and local contrast of the image obtained by this invention is high and the details are clearer. Therefore, this invention has a better underwater image enhancement effect.
[0088] This embodiment uses the underwater image quality assessment metrics UIQM and PCQI to objectively compare the experimental results of different methods. As can be seen from the data in Table 1, the PCQI values obtained by this invention are all higher than those of other methods, and the mean values of UIQM and PCQI are also higher than those of other methods. This indicates that this invention is superior to other methods in terms of color restoration, contrast and detail enhancement of the original underwater image.
[0089] Table 1. UIQM and PCQI index values of the present invention and other methods (corresponding images (in the same order) as shown in the figure). Figure 2 (As shown)
[0090]
[0091] Preferably, embodiments of this application also provide an underwater image enhancement device, comprising:
[0092] The color cast judgment unit is used to judge the original underwater image and distinguish between images without color cast and images with color cast. The images with color cast are divided into green color cast images, blue color cast images, and yellow color cast images.
[0093] The color compensation unit is used to perform color compensation on different images with color cast to obtain a color-compensated image.
[0094] The color space conversion unit is used to convert images between RGB and Lab color spaces.
[0095] The image enhancement unit is used to enhance the contrast and improve the detail of the luminance component, and then fuses them to obtain the final underwater enhanced image.
[0096] Preferably, embodiments of this application also provide a specific implementation of an electronic device capable of implementing all steps of the underwater image enhancement method in the above embodiments. The electronic device specifically includes the following:
[0097] Processor, memory, communications interface, and bus;
[0098] The processor, memory, and communication interface communicate with each other via a bus; the communication interface is used to realize information transmission between server-side devices, metering devices, and user-side devices.
[0099] The processor is used to call the computer program in memory, and when the processor executes the computer program, it implements all the steps in the underwater image enhancement method in the above embodiments.
[0100] Preferably, embodiments of this application also provide a computer-readable storage medium capable of implementing all steps of the underwater image enhancement method in the above embodiments. The computer-readable storage medium stores a computer program that, when executed by a processor, implements all steps of the underwater image enhancement method in the above embodiments.
[0101] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on its differences from other embodiments. In particular, hardware + program embodiments are relatively simple in description because they are fundamentally similar to method embodiments; relevant parts can be referred to the descriptions in the method embodiments.
[0102] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0103] While this application provides method operation steps as shown in the embodiments or flowcharts, more or fewer operation steps may be included based on conventional or non-inventive labor. The order of steps listed in the embodiments is merely one possible execution order among many and does not represent the only execution order. In actual device or client product execution, the method can be executed sequentially as shown in the embodiments or drawings, or in parallel (e.g., in a parallel processor or multi-threaded processing environment).
[0104] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0105] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0106] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0107] This invention is not limited to the embodiments described above. The above description of specific embodiments is intended to illustrate and explain the technical solutions of this invention. The specific embodiments described above are merely illustrative and not restrictive. Without departing from the spirit and scope of the claims, those skilled in the art can make many specific modifications based on the teachings of this invention, and these modifications all fall within the scope of protection of this invention.
Claims
1. An underwater image enhancement method that integrates color compensation, contrast enhancement, and detail enhancement, characterized in that, Includes the following steps: S1. Color cast is determined from the original underwater image using the color cast factor value and the mean chromaticity value of the Lab color space; S2. Perform color compensation on different images with color casts to obtain color-compensated images; S3. Convert the color-compensated image and the unbiased image to the Lab color space to obtain the luminance component of the image. L and chromaticity components a , b For the luminance component L The CLAHE algorithm and multi-scale detail enhancement algorithm are applied separately to obtain the contrast-enhanced luminance component. L e And detailed images; Convert the color-compensated image and the unbiased image to the Lab color space to obtain the image luminance component. L and chromaticity components a , b Then, the luminance component is divided into image blocks of equal size. For each image block, the CLAHE algorithm is used to adjust the cropping value of the image block histogram using the ratio of the block's mean to its standard deviation. The cropped pixels are then evenly distributed to each pixel level to obtain a contrast-limited histogram. Finally, bilinear interpolation is performed on the luminance component based on the contrast-limited histogram to obtain a contrast-enhanced luminance component. L e The formula for calculating the cutting value is: (5); In the formula, Q This represents the total number of pixels in a given image patch. The number of gray levels in the output image. The standard deviation of the image patch. m λ is the mean of the image patch, μ is an empirical parameter, and λ is a constant value set to prevent division by zero, which is 0.0001. The specific formula for the multi-scale detail enhancement algorithm, which uses logarithmic form to solve for the detail map, is as follows: (6); (7); (8); (9); in, L The luminance component of the color-compensated image and the unbiased image after conversion to the Lab color space. , These are three brightness components with different degrees of blur. "Represents convolution operation, G 1, G 2, G 3 represents Gaussian functions with three different standard deviations. To prevent the constant value inside the log function from being 0, D 1, D 2, D 3 represents three different detail images. D For the final detailed images; S4. Brightness component that enhances contrast L e Linearly blend with the detail image, and then combine the resulting luminance components. L f and chromaticity components a , b Convert back to the RGB color space to obtain the final underwater enhanced image.
2. The underwater image enhancement method according to claim 1, characterized in that, Step S1 is as follows: 1) Statistically analyze the color cast factor values of the original underwater images and reference images in the UIEB underwater image dataset. Determine the threshold for the color cast factor based on the statistical results. Define underwater images with color cast factor values greater than or equal to the threshold as images with color cast, and images with color cast factor values less than the threshold as images without color cast. 2) For underwater images with color cast, based on their chromaticity mean... m a , m b The sign and ratio determine the type of color cast. At this time, the underwater image shows a greenish tint; when In the above two cases, the underwater image will have a blue tint; in other cases, the underwater image will have a yellow tint.
3. The underwater image enhancement method according to claim 1, characterized in that, In step S2, different color compensation formulas are used for different color cast situations. The specific formulas are as follows: 1) Greenish tint (1); in , , These represent the normalized channel values and channel mean of the original underwater image, respectively. , These are the channel values and channel mean values after preliminary compensation, respectively. , These represent the normalized G-channel values and G-channel mean of the original underwater image, respectively. This is the final compensated channel value; 2) Yellowish tint (2); in , , These are the normalized R-channel values and R-channel mean values of the original underwater image, respectively. 3) Blue color cast (3); (4); in These are the normalized R, G, and B channel values of the original underwater image, respectively. The channel mean is the normalized value of the original underwater image. These are the R and G channel values after preliminary compensation. These are the mean values of the R and G channels after preliminary compensation. These are the final compensated R and G channel values; After color compensation of underwater images with different color casts, tail-cut histogram stretching is applied to the R, G, and B channels to further improve the dynamic range of the three-channel colors.
4. An underwater image enhancement device, characterized in that, include: The color cast judgment unit is used to judge the original underwater image and distinguish between images without color cast and images with color cast. The images with color cast are divided into green color cast images, blue color cast images, and yellow color cast images. The color compensation unit is used to perform color compensation on different images with color cast to obtain a color-compensated image. The color space conversion unit is used to convert images between RGB and Lab color spaces. Convert the color-compensated image and the unbiased image to the Lab color space to obtain the image luminance component. L and chromaticity components a , b Then, the luminance component is divided into image blocks of equal size. For each image block, the CLAHE algorithm is used to adjust the cropping value of the image block histogram using the ratio of the block's mean to its standard deviation. The cropped pixels are then evenly distributed to each pixel level to obtain a contrast-limited histogram. Finally, bilinear interpolation is performed on the luminance component based on the contrast-limited histogram to obtain a contrast-enhanced luminance component. L e The formula for calculating the cutting value is: (5); In the formula, Q This represents the total number of pixels in a given image patch. The number of gray levels in the output image. The standard deviation of the image patch. m λ is the mean of the image patch, μ is an empirical parameter, and λ is a constant value set to prevent division by zero, which is 0.0001. The specific formula for the multi-scale detail enhancement algorithm, which uses logarithmic form to solve for the detail map, is as follows: (6); (7); (8); (9); in, L The luminance component of the color-compensated image and the unbiased image after conversion to the Lab color space. , These are three brightness components with different degrees of blur. "Represents convolution operation, G 1, G 2, G 3 represents Gaussian functions with three different standard deviations. To prevent the constant value inside the log function from being 0, D 1, D 2, D 3 represents three different detail images. D For the final detailed images; The image enhancement unit is used to enhance the contrast and improve the detail of the luminance component, and then fuses them to obtain the final underwater enhanced image.
5. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the underwater image enhancement method according to any one of claims 1 to 3.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the steps of the underwater image enhancement method according to any one of claims 1 to 3.