An underwater image enhancement method

By decomposing underwater images into foreground and background, contrast enhancement and transmission estimation are performed separately, and adaptive color correction is combined to solve the problems of sharpness and color distortion in underwater images under complex environments, achieving high-quality image enhancement results.

CN120655554BActive Publication Date: 2026-05-22NANTONG MARINE ADVANCED RESEARCH INSTITUTE SOUTHEAST UNIVERSITY +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NANTONG MARINE ADVANCED RESEARCH INSTITUTE SOUTHEAST UNIVERSITY
Filing Date
2025-06-13
Publication Date
2026-05-22

AI Technical Summary

Technical Problem

Existing underwater image enhancement algorithms perform poorly in complex environments, failing to effectively improve image clarity and color distortion.

Method used

The underwater image is decomposed into foreground and background sub-images. A contrast enhancement method based on percentile maximum and a multi-layer transmission map estimation method are used to process the foreground and background images respectively. The two are then fused by principal component analysis, and finally adaptive color correction is performed.

Benefits of technology

It improves the clarity and color accuracy of underwater images, resulting in high-quality enhanced images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120655554B_ABST
    Figure CN120655554B_ABST
Patent Text Reader

Abstract

The application discloses an underwater image enhancement algorithm based on foreground and background principal component fusion and adaptive color correction. Specifically, first, a contrast enhancement strategy based on the maximum value of the percentile is implemented on the foreground image of the degraded image to generate a contrast-enhanced foreground sub-image. Then, a novel scoring formula is used to estimate the ambient light candidate region and a multi-layer transmission map is used to estimate the defogging strategy to generate a defogged background sub-image. Next, a principal component analysis fusion method is used to combine the advantages of foreground contrast enhancement and background restoration reconstruction to fuse a high-visibility underwater image. Finally, a color correction strategy guided by color balance is proposed to further correct the color of the fused image to improve the visual effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to an underwater image enhancement method, specifically an underwater image enhancement method that combines foreground and background principal component fusion with adaptive color correction, belonging to the field of image processing technology. Background Technology

[0002] With the continuous growth of the global population and the increasing scarcity of land resources, the exploration and development of marine resources has become a key focus for researchers and scholars. Underwater imaging technology, as an important tool for exploring marine resources, helps researchers obtain information about the underwater world and promotes the exploration of underwater resources. However, the quality of underwater images is often affected by various factors, such as the absorption and scattering of underwater light, light refraction, and the complexity of the environment, resulting in insufficient clarity and usable information in underwater images, as well as problems such as color distortion and blurring. Therefore, how to improve the quality of underwater images, especially image enhancement in low-light and complex environments, has become an urgent technical challenge to be solved.

[0003] Traditional underwater image enhancement algorithms are mainly divided into two categories: algorithms based on visual priors and algorithms based on physical models. Visual prior-based enhancement algorithms improve the visual quality of images to a certain extent by adjusting visual information such as brightness and contrast, making the images appear clearer. Examples include MLLE based on the gray-world assumption and ICSP based on Retinex theory. However, due to the common problems of color cast and uneven illumination in underwater images, visual prior-based methods often fail to achieve significant results in severely degraded underwater environments.

[0004] Another type of approach is physical model-based enhancement algorithms. These algorithms focus more on the physical characteristics of the underwater environment, attempting to recover the original image by simulating the underwater light propagation process. Underwater image degradation can often be modeled through the absorption and scattering effects of water. Common approaches include image restoration methods based on underwater imaging physical models. These methods utilize various prior assumptions to calculate physical model parameters and infer a clear image. Examples include the UDCP algorithm based on dark channel priors and algorithms based on diffusion priors. While these physical model methods can improve underwater image quality to some extent, they typically assume that image degradation is predictable. In complex underwater environments, these assumptions are often difficult to fully hold. Therefore, although traditional methods provide effective means for underwater image enhancement, their limitations remain significant, necessitating further optimization and improvement. Summary of the Invention

[0005] Objective: To address the problems and shortcomings of existing technologies, this invention provides an underwater image enhancement method using foreground and background principal component fusion and adaptive color correction. First, the underwater image is divided into foreground and background sub-images. A contrast enhancement algorithm based on the percentile maximization method is used to improve the clarity of the foreground sub-image. Next, a novel model ambient light estimation theory and a multi-layer transmission map estimation algorithm are introduced to estimate the physical model parameters of the background sub-image to reconstruct it. Then, principal component analysis is used to fuse the foreground and background sub-images to obtain a clear underwater image. Finally, an adaptive color correction algorithm is applied to further correct local color casts in the underwater image, resulting in the final clear image.

[0006] Technical solution: An underwater image enhancement method using foreground and background principal component fusion and adaptive color correction, specifically including the following steps:

[0007] Step 1: Input an underwater degraded image and decompose it into foreground and background components. After this decomposition, apply a contrast enhancement method based on percentile maximum to the foreground image to obtain a sub-image with enhanced foreground contrast.

[0008] Step 2: A four-layer classification estimation method based on texture mean and standard deviation is used to estimate the ambient light candidate region of the background image and select the pixel with the largest color difference as the ambient light point.

[0009] Step 3: Use the multi-layer transmission map estimation method to estimate the transmission map of the background image and combine it with the ambient light points from the previous step to restore the background sub-image.

[0010] Step 4: Using principal component analysis fusion method, combining the advantages of foreground contrast enhancement and background restoration and reconstruction, a high-visibility underwater image is fused.

[0011] Step 5: Further correct local color casts on the fused underwater image using the principle of minimum color loss.

[0012] Step 1: Input an underwater image and enhance the foreground sub-image of the input image using a contrast enhancement method based on percentile maximum values. This includes the following steps:

[0013] Step 1-1: Define the image height as [value] and width as [value]. Its separation critical value is expressed by the following formula:

[0014]

[0015] in As a reference value for the separated image; Indicates the location The pixel at that location. r, g, and b represent the red, green, and blue color channels, respectively.

[0016] Steps 1-2: Then the foreground image and background image It can be expressed by the following formula:

[0017]

[0018]

[0019] Then, a contrast enhancement method based on the percentile maximum is used to enhance the contrast of the foreground image, thereby enhancing the image's contrast and texture details. First, iterate through... The three color channels are used to update the pixel values ​​in each channel. Pixels with image values ​​less than a first threshold are replaced with the first threshold value, and pixels with image values ​​greater than a second threshold are replaced with the second threshold value, resulting in the image. The purpose of this process is to enhance the contrast of the foreground image, which is represented as:

[0020]

[0021]

[0022] in This represents the total number of pixel values. This is the percentile, set to 0.1%. Both M[x] and M[x+1] represent the foreground image. Array. and It represents the position of the image pixel corresponding to the percentile. yes Representative foreground image The array corresponds to the threshold. Images below the threshold are selected based on this threshold. The pixel values ​​are updated to the threshold. The operation on the second threshold can be represented similarly:

[0023]

[0024]

[0025] in Percentiles The corresponding threshold, after analysis, was set to 99.5%. This threshold is used to identify images containing values ​​greater than the threshold. The pixel values ​​are updated to the threshold. Then, a contrast enhancement method based on the percentile maximum was used to obtain the enhanced image:

[0026]

[0027] in and These are the contrast-enhanced image and the foreground image with updated pixel values, respectively. Meanwhile... and These are the maximum and minimum values ​​of the foreground image after the pixel values ​​are updated.

[0028] Step 2: Estimate the ambient light spots in the background image using a four-layer classification estimation method based on texture mean and standard deviation, including the following steps:

[0029] Step 2-1: The mathematical formula for the underwater imaging physical model can be expressed as:

[0030]

[0031] in It is the input image. It is the image of the model reconstruction. It is ambient light. This is a transmission map. Since ambient light areas are typically uniformly illuminated, lacking significant detail and complex texture, selecting the minimum sum of the texture mean and standard deviation as the candidate region allows for more accurate localization of potential background light areas, expressed by the following formula:

[0032]

[0033] in , Indicates grayscale level. These are the elements of the image with respect to the gray-level co-occurrence matrix. , It is grayscale. , The mean, , grayscale , The standard deviation.

[0034] Step 2-2: Then process the background image. A scoring formula based on texture mean and standard deviation is used. A four-level classification estimation method is used to select candidate regions for ambient light. Definition This indicates the region with the lowest score among the four regions. Then... Repeat the above steps until... The width and height are both less than 20. Since red light attenuates faster than green or blue light in water, the pixel with the largest color difference among the remaining pixels in the candidate region is selected as the final ambient light. The formula is expressed as:

[0035]

[0036]

[0037] in Indicates the candidate region for ambient light. It is an ambient light spot. This represents the difference between the red and green channels. This represents the difference between the red and blue channels. The sum of these two values ​​is used to represent the pixel with the largest color difference using the argmax function; d represents the position of this pixel with the largest color difference. Representing an image The pixel at position d.

[0038] Step 3: Use a multi-layer transmission map estimation method to estimate the transmission map of the background image and combine it with the ambient light points from the previous step to reconstruct the background sub-image. The specific steps are as follows:

[0039] Step 3-1: Estimating ambient light spots Then, the restoration of the background image depends on Furthermore, the contrast of the restored image increases with... The decrease and increase lead to finding the optimal... This ensures the restored image has maximum contrast. The optimal estimate is calculated as follows:

[0040]

[0041] in This is the initial transmission image. 128 is a normalization factor that adjusts the pixel values ​​of the image to a suitable range. For RGB images, pixel values ​​are typically in the range [0, 255], and 128 is a mid-range value. Scaling with 128 normalizes the pixel values ​​of the image.

[0042] Step 3-2: Optimize the image's transmission map using guided filtering to prevent artifacts that may appear in the image due to variations in depth in the real-world scene. The formula is as follows:

[0043]

[0044]

[0045]

[0046] in Background image The maximum average pixel value in the range. It is the ratio of the average pixel value of the largest channel to the average pixel value of the channels in the background image.

[0047] Step 3-3: Calculate the results and The restored image can be obtained by substituting it into the underwater imaging physical model for calculation, as expressed by the formula:

[0048] .

[0049] Step 4: Using principal component analysis fusion, combining the advantages of foreground contrast enhancement and background restoration and reconstruction, a high-visibility underwater image is generated. The specific steps are as follows:

[0050] Step 4-1: A principal component analysis (PCA) fusion strategy is employed to obtain a clear underwater image by integrating the advantageous features of the foreground contrast enhancement sub-image and the background restoration and reconstruction sub-image. The fusion weights are determined by analyzing the eigenvalues ​​and eigenvectors of the covariance matrices of the foreground and background images. Then, the eigenvalues ​​of the matrix are solved based on the calculated covariance matrix. and eigenvectors Select the eigenvector corresponding to the larger eigenvalue, divide it by the sum of the eigenvalues, and obtain the normalized weights, expressed by the formula:

[0051]

[0052]

[0053] in , The eigenvectors with larger eigenvalues , It is a standardized weight. It represents the number of eigenvalues.

[0054] Step 4-2: The final image fusion can be defined as:

[0055]

[0056] in This represents the final fused image.

[0057] Step 5: Further correct local color casts on the fused underwater image using the principle of minimum color loss. The specific steps are as follows:

[0058] Step 5-1: First, define the image Z. c The average value of the three color channels for:

[0059]

[0060] Where H and W are Z c The height and width; by calculating the average of the three color channels, the channel with the largest average value is selected as Z. m Z c(x), Z c, Z c (x, y) are all fused images, Z c (x, y) is used to indicate that x and y represent the horizontal and vertical coordinates of the image, respectively.

[0061] Step 5-2: Since the decay rates of different color channels are inconsistent, in order to recover the color decay of each channel, a linear transfer equation is used to define the dynamic boundary of the largest color channel, expressed as:

[0062]

[0063]

[0064] in , and Representing different color channels , and Color correction value.

[0065] Step 5-3: Then for each color channel Define the upper and lower boundaries of saturation. and :

[0066]

[0067]

[0068] The value 0.002 is an empirical constant, primarily used to define the cropping ratio at saturation boundaries (upper and lower boundaries). Its function is to remove extreme low-saturation and high-saturation pixel values ​​from the image histogram, resulting in a new image. .

[0069] Step 5-4: Finally, remap the image pixel values ​​to the range 0 to 255.

[0070]

[0071] Step 5-5: Since image channels in natural colors typically have similar mean and histogram distributions, we iterate through each color channel using the following formula until convergence is achieved:

[0072]

[0073] The threshold for the minimum color loss constraint is set to... .

[0074] A computer device, characterized in that: the computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, it implements the underwater image enhancement algorithm based on foreground and background principal component fusion and adaptive color correction as described above.

[0075] A computer-readable storage medium, characterized in that: the computer-readable storage medium stores a computer program that executes the underwater image enhancement algorithm based on foreground and background principal component fusion and adaptive color correction as described above.

[0076] Beneficial effects: This invention obtains clear underwater images by processing the foreground and background images in stages, fully utilizing the advantages of contrast-enhanced images and physically model-reconstructed images. Finally, an adaptive color correction algorithm is used to further correct local color casts in the image, resulting in a high-quality enhanced image. Attached Figure Description

[0077] Figure 1 This is a detailed flowchart of the underwater image enhancement method based on foreground and background principal component fusion and adaptive color correction in an embodiment of the present invention;

[0078] Figure 2 yes Figure 1 A detailed view of the ambient light estimation part in the physical reconstruction stage of the background image;

[0079] Figure 3 It is a comparison image of enhanced visual effects on a blurred water scene;

[0080] Figure 4 It is a comparison image of enhanced visual effects on a scene where the water appears greenish;

[0081] Figure 5 This is a comparison image showing enhanced visual effects on a scene where the water appears bluish. Detailed Implementation

[0082] The present invention will be further illustrated below with reference to specific embodiments. It should be understood that these embodiments are for illustrative purposes only and are not intended to limit the scope of the invention. After reading the present invention, any modifications of the present invention in various equivalent forms by those skilled in the art will fall within the scope defined by the appended claims.

[0083] The detailed process of this embodiment is as follows: Figure 1As shown, a clear underwater image is obtained by processing the foreground and background images in stages, fully utilizing the advantages of contrast-enhanced images and physically reconstructed images. A contrast enhancement method based on percentile maximum values ​​and a multi-layer transmission map estimation method for the background image are introduced to obtain contrast-enhanced foreground and reconstructed background images. Principal component analysis is used to combine the advantageous features of the contrast-enhanced and reconstructed images to obtain a clear, natural, and visually appealing underwater image. Finally, an adaptive color correction algorithm is used to further correct local color casts in the image, resulting in a high-quality enhanced image. The specific implementation of the scheme consists of four main stages: foreground image enhancement, background image restoration and reconstruction, foreground and background image fusion, and adaptive color correction.

[0084] Phase 1: Foreground Image Enhancement Phase

[0085] Input an underwater degradation image and define the image. The height is Width is Its separation critical value is It can be expressed by the following formula:

[0086]

[0087] in Used as a reference value for separating the images. , , These represent the red, green, and blue color channels, respectively. Divided into foreground images and background image It can be expressed by the following formula:

[0088]

[0089]

[0090] Then, a contrast enhancement method based on the percentile maximum is used to enhance the contrast of the foreground image, thereby enhancing the image's contrast and texture details. First, iterate through... The three color channels are used to update the pixel values ​​in each channel. Pixels with image pixel values ​​less than a first threshold are replaced with the first threshold value, and pixels with pixel values ​​more significantly than a second threshold are replaced with the second threshold value. The purpose of this process is to enhance the contrast of the foreground image, which is represented as:

[0091]

[0092]

[0093] in This represents the total number of pixel values. It is the percentile, set to 0.1%. and It represents the position of the image pixel corresponding to the percentile. It is percentiles and This represents the threshold corresponding to the foreground image array. Images in the image below the threshold are selected based on this threshold. The pixel values ​​are updated to the threshold. The operation on the second threshold can be represented similarly:

[0094]

[0095]

[0096] in Percentiles The corresponding threshold, after analysis, was set to 99.5%. This threshold is used to identify images containing values ​​greater than the threshold. The pixel values ​​are updated to the threshold. Then, a contrast enhancement method based on the percentile maximum was used to obtain the enhanced image:

[0097]

[0098] in and These are contrast-enhanced images and pixel-value-updated foreground images, respectively. Meanwhile... and These are the maximum and minimum values ​​of the foreground image after the pixel values ​​are updated.

[0099] Background image restoration and reconstruction stage:

[0100] This stage requires the introduction of an underwater imaging physical model, which can be expressed mathematically as follows:

[0101]

[0102] in It is the input image. It is the image of the model reconstruction. It is ambient light. It is a transmission image.

[0103] Since ambient light regions are typically uniformly illuminated and lack significant details and complex textures, selecting the minimum sum of the texture mean and standard deviation as candidate regions can more accurately locate potential ambient light regions. Therefore, a four-layer classification estimation method based on texture mean and standard deviation is used to estimate ambient light points in the background image, including the following steps:

[0104]

[0105] Where i and j represent gray levels, and P(i, j) is the element of the gray-level co-occurrence matrix of the image. , It is the mean of gray levels i and j. , The standard deviations of gray levels i and j. For example... Figure 2 As shown, background image A scoring formula based on texture mean and standard deviation is used. A four-level classification estimation method is used to select candidate regions for ambient light. Definition This indicates the region with the lowest score among the four regions. Then... Repeat the above steps until... The width and height are both less than 20. Since red light attenuates faster than green or blue light in water, the pixel with the largest color difference among the remaining pixels in the candidate region is selected as the final ambient light. The formula is expressed as:

[0106]

[0107]

[0108] Estimating ambient light The restoration of the background image depends on Furthermore, the contrast of the restored image increases with... The decrease and increase lead to finding the optimal... This ensures the restored image has maximum contrast. The optimal estimate is calculated as follows:

[0109]

[0110]

[0111]

[0112] in E represents the loss for the initial translucency and the physical restoration process, while FC is the cost function that evaluates the quality of the restored image associated with the iteratively updated current translucency. A parameter representing the balance between control information loss and mean deviation. It is the total number of pixels in the background image block. and Used to evaluate image contrast and brightness. 128 is a normalization factor that adjusts the image's pixel values ​​to a suitable range. For RGB images, pixel values ​​are typically in the range [0, 255], and 128 is a midpoint. Scaling by 128 normalizes the image's pixel values. Then, guided filtering is used to optimize the transmission map of the image patches to prevent artifacts that might occur due to variations in real-world scene depth between different image patches. The formula is expressed as:

[0113]

[0114]

[0115]

[0116] in Background image The maximum average pixel value in the range. It is the ratio of the average pixel value of the largest channel to the average pixel value of the channels in the background image. T and It is a transmission diagram that has been optimized and adjusted for gain.

[0117] Finally, the calculated results and The restored image can be obtained by substituting it into the underwater imaging physical model for calculation, as expressed by the formula:

[0118]

[0119] Phase 3: Foreground and Background Image Fusion Phase

[0120] A principal component analysis (PCA) fusion strategy is employed to obtain a clear underwater image by integrating the advantageous features of foreground contrast enhancement sub-images and background restoration and reconstruction sub-images. The fusion weights are determined by analyzing the eigenvalues ​​and eigenvectors of the covariance matrices of the foreground and background images. The process of solving the covariance matrix is ​​defined as follows:

[0121]

[0122] in It is the covariance matrix. , It is the average pixel value of the image. Then, the eigenvalues ​​of the matrix are solved based on the calculated covariance matrix. and eigenvectors Select the eigenvector corresponding to the larger eigenvalue, divide it by the sum of the eigenvalues, and obtain the normalized weights, expressed by the formula:

[0123]

[0124]

[0125] in , The eigenvectors with larger eigenvalues , It is a standardized weight. It refers to the number of feature values. The final fused image. It can be defined as:

[0126]

[0127] Adaptive color correction stage:

[0128] The fused underwater image is further corrected for local color casts using a principle based on minimum color loss. First, define... Average value of the three color channels for:

[0129]

[0130] Where H and W are respectively The height and width. By calculating the average of the three color channels, the channel with the largest average is selected as the color channel. .

[0131] Because different color channels decay at different rates, a linear transfer equation is used to define the dynamic boundary of the largest color channel in order to recover the color decay of each channel. The formula is expressed as:

[0132]

[0133]

[0134] in , and Representing different color channels , and The color correction value. Then for each color channel... Define the upper and lower boundaries of saturation. and :

[0135]

[0136]

[0137] The value 0.002 is an empirical constant, primarily used to define the cropping ratio at saturation boundaries (upper and lower boundaries). Its function is to remove extreme low-saturation and high-saturation pixel values ​​from the image histogram, resulting in a new image. Finally, the image pixel values ​​are remapped to the range 0 to 255.

[0138]

[0139] Since image channels in natural colors typically have similar mean and histogram distributions, we iteratively update each color channel using the following formula until convergence is achieved:

[0140]

[0141] The threshold for the minimum color loss constraint is set to... .

[0142] This invention can better solve the problem of image degradation in underwater scenes, correct the color of the image in the water to make it appear as the color under natural light, and through the fusion of foreground and background images and local adaptive color correction, it can better restore color information and object details, thus providing assistance for downstream tasks.

[0143] It is evident that those skilled in the art will understand that the various steps of the underwater image enhancement algorithm based on foreground and background principal component fusion and adaptive color correction described in the above embodiments can be implemented using general-purpose computing devices. The algorithm can be executed centrally on a single computing device or distributed across a network of multiple computing devices. Optionally, the algorithm can be implemented using device-executable program code, stored in a storage medium, and executed by the computing device. Furthermore, in some cases, the execution order of the steps may differ from that described herein, or each step may be implemented as an independent integrated circuit module, or multiple steps may be integrated into a single integrated circuit module. Therefore, the embodiments of the present invention are not limited to specific hardware or software combinations.

Claims

1. An underwater image enhancement method using foreground and background principal component fusion and adaptive color correction, characterized in that, Includes the following steps: Step 1: Input an underwater degraded image and decompose the input image into a foreground image and a background image; The contrast enhancement method based on percentile maximum value is applied to foreground images to obtain sub-images with enhanced foreground contrast. Step 2: A four-layer classification estimation method based on texture mean and standard deviation is used to estimate the ambient light candidate region of the background image and select the pixel with the largest color difference as the ambient light point. Step 2-1: The mathematical formula for the underwater imaging physical model is expressed as follows: I c (x)=t c (x) J c (x)+(1-t c (x)) A c ,c∈{r,g,b} Among them I c (x) is the input image, J c (x) is the model-reconstructed image, A c It is ambient light, t c (x) is the transmittance; selecting the minimum sum of the texture mean and standard deviation as the candidate region can more accurately locate potential background light regions, expressed by the following formula: Where i and j represent gray levels, P(i,j) is an element of the gray-level co-occurrence matrix of the image, and μ i μ j σ is the mean of gray levels i and j. i σ j The standard deviations of gray levels i and j; Step 2-2: Then process the background image I B A four-level classification estimation method based on a scoring formula S using texture mean and standard deviation was used to select candidate ambient light regions I. A The pixel with the largest color difference among the remaining pixels in the candidate region is selected as the final ambient light; the formula is expressed as: in Indicates the candidate region for ambient light; This represents the difference between the red and green channels. This represents the difference between the red and blue channels. The sum of these two values ​​is used, and the `argmax` function represents the pixel with the largest color difference. c It represents the ambient light point; d indicates the location of the point with the greatest color difference. Representing an image The pixel at position d; Step 3: Use the multi-layer transmission map estimation method to estimate the transmission map of the background image and combine it with the ambient light points from the previous step to restore the background sub-image. Step 3-1: Estimate ambient light point A c Afterwards, the restoration of the background image depends on t c The optimal estimate of (x) is calculated as follows: Where t c (x) is the initial transmittance; Step 3-2: Optimize the transmission map of the image using guided filtering, expressed by the formula: Among them I Max Background image The maximum average pixel value in; It is the ratio of the maximum channel pixel average to the channel pixel average in the background image; background image The height is H and the width is W; Step 3-3: Calculate A c and t c (x) Substituting into the underwater imaging physical model, the restored image can be obtained through calculation, expressed by the formula: ; Step 4: For the sub-image with enhanced foreground contrast and the sub-image with restored background, principal component analysis is used to fuse them to obtain the fused underwater image. Step 5: Further correct local color casts on the fused underwater image using the principle of minimum color loss.

2. The underwater image enhancement method with foreground and background principal component fusion and adaptive color correction according to claim 1, characterized in that, Step 1 includes the following steps: Step 1-1: Define image I c Given a height of H and a width of W, its separation threshold value is k, expressed by the following formula: Where α is the reference value for the separated image; I c (x,y) represents the pixel at position (x,y); r, g, and b represent the red, green, and blue color channels, respectively. Step 1-2: Foreground Image I F and background image I B It can be expressed by the following formula: Then, a contrast enhancement method based on the percentile maximum is used to enhance the contrast of the foreground image; first, iterate through I... F The three color channels are used to update the pixel values ​​in each channel; the pixel values ​​of pixels with image values ​​less than a first threshold are replaced with the first threshold, and the pixel values ​​of pixels with pixel values ​​greater than a second threshold are replaced with the second threshold, resulting in the image. ; An enhanced image is obtained by using a percentile-maximum contrast enhancement method: in and These are the contrast-enhanced image and the foreground image with updated pixel values, respectively; simultaneously and These are the minimum and maximum values ​​of the foreground image after pixel value updates, respectively.

3. The underwater image enhancement method with foreground and background principal component fusion and adaptive color correction according to claim 1, characterized in that, Step 4 includes the following steps: Step 4-1: Principal component analysis (PCA) fusion is employed to obtain a clear underwater image by integrating the advantageous features of sub-images that enhance foreground contrast and those that restore background. The fusion weights are determined by analyzing the eigenvalues ​​and eigenvectors of the covariance matrices of the foreground and background images. Then, the eigenvalues ​​λ and eigenvectors α of the calculated covariance matrix are solved. The eigenvector corresponding to the largest eigenvalue is selected and divided by the sum of the eigenvalues ​​to obtain the normalized weights, expressed by the formula: Where α1 and α2 are the eigenvectors of the larger eigenvalues, ω1 and ω2 are the standardized weights, and N is the number of eigenvalues; Step 4-2: The final image fusion is defined as: Z c (x) represents the final fused image. , These are sub-images with enhanced foreground contrast and sub-images with restored background image, respectively.

4. The underwater image enhancement method with foreground and background principal component fusion and adaptive color correction according to claim 1, characterized in that, Step 5 includes the following steps: Step 5-1: First, define the image Z. c The average value of the three color channels for: Where H and W are Z c The height and width; by calculating the average of the three color channels, the channel with the largest average value is selected as Z. m ; Step 5-2: Define the dynamic boundary of the maximum color channel using the linear transfer equation, expressed as: in , and These represent the red, green, and blue channels Z, respectively. r Z g and Z b Color correction value; Step 5-3: Then for each color channel Z c Define the upper and lower boundaries L of saturation. c and U c : Where 0.002 is an empirical constant used to define the cropping ratio at the saturation boundary. Its function is to remove extreme low-saturation and high-saturation pixel values ​​from the image histogram to obtain a new image. ; Step 5-4: Finally, remap the image pixel values ​​to the range 0 to 255. Step 5-5: Iterate using the following formula to update each color channel until convergence is achieved: The threshold for the minimum color loss constraint is set to 10. -2 .

5. A computer device, characterized in that: The computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the underwater image enhancement method of foreground and background principal component fusion and adaptive color correction as described in any one of claims 1-4.

6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program that performs an underwater image enhancement method for foreground and background principal component fusion and adaptive color correction as described in any one of claims 1-4.