An underwater image enhancement method based on joint processing of frequency domain and space domain

By employing a joint frequency and spatial domain processing method, and utilizing quadtree search and homomorphic filtering techniques, the problems of color distortion and low contrast in underwater images were solved, achieving adaptive correction and comprehensive enhancement effects.

CN119090790BActive Publication Date: 2026-05-19TIANJIN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
TIANJIN UNIV
Filing Date
2024-09-12
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

Existing underwater image enhancement methods have limited applicability in dealing with color distortion, low contrast, and blurred details, and it is difficult to achieve adaptive correction and comprehensive improvement.

Method used

A joint frequency and spatial processing method is adopted. The optimal background region is searched by quadtree, the channel difference and color cast factor threshold are calculated, color correction and homomorphic filtering are performed, and Lab color space fusion is combined to achieve contrast and detail enhancement.

Benefits of technology

It achieves adaptive color correction and contrast enhancement for underwater images, improving image detail clarity and color reproduction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119090790B_ABST
    Figure CN119090790B_ABST
Patent Text Reader

Abstract

The application is an underwater image enhancement method based on frequency domain and space domain joint processing, comprising: collecting public underwater image data set, searching the optimal background area of the collected underwater image by using the quadtree method, and then obtaining the maximum attenuation channel and the minimum attenuation channel difference of the optimal background area; comparing the attenuation channel difference distribution interval statistics with the color corrected image channel difference to obtain the underwater image color deviation factor threshold; using the improved channel compensation method to compensate different color deviation images to realize image color correction; using the improved homomorphic filtering method to perform contrast enhancement processing on the image; finally, fusing the color corrected image and the contrast enhanced image in the Lab color space to obtain the final color corrected and clear underwater enhanced image. The application realizes adaptive correction of underwater image color, contrast enhancement, detail enhancement and color restoration of underwater image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the technical field of underwater image processing, and in particular to an underwater image enhancement method based on joint frequency and spatial domain processing. Background Technology

[0002] Underwater optical imaging technology boasts advantages such as high imaging speed and high spatial resolution, and is widely used in fields such as marine resource exploration, marine biological research, and underwater warfare. However, particles present in low-visibility underwater environments can scatter and absorb target signals, leading to decreased image contrast. Furthermore, the attenuation of light underwater depends on its wavelength, causing color distortion in underwater color images.

[0003] Currently, there are various methods for enhancing underwater image quality, broadly categorized into computer vision-based methods and physical model-based methods. Vision-based enhancement methods do not consider physical models of image degradation; they directly process the image pixel-by-pixel to improve image quality without relying on a physical model. Physical model-based methods consider the underwater propagation and polarization characteristics of light, using these characteristics to build an imaging degradation model, and then restoring the image by inversely solving the model. Physical model-based methods require external devices or certain prior knowledge, while vision-based enhancement methods are simpler to implement than image restoration methods, involving only the adjustment of image pixel values ​​without considering degradation inversion processes or assuming prior knowledge. However, underwater images exhibit different characteristics depending on the aquatic environment in which they are captured, 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

[0004] This invention aims to address the shortcomings of existing technologies by providing an underwater image enhancement method based on joint frequency and spatial domain processing, enabling water color determination, adaptive correction of underwater image colors, and enhancement of underwater image contrast.

[0005] To achieve the above objectives, the present invention adopts the following technical solution:

[0006] An underwater image enhancement method based on joint frequency and spatial domain processing includes the following steps:

[0007] S1. Obtain publicly available underwater image datasets;

[0008] S2. Find the optimal background region for the public dataset;

[0009] S3. Based on the optimal background area obtained in step S2, calculate the channel difference M between the maximum and minimum channels respectively;

[0010] S4. Statistically calculate the channel difference M obtained in step S3 and compare it with the channel difference M of the color-corrected image to obtain the color cast factor threshold of the color cast image.

[0011] S5. Based on the color cast factor threshold obtained in step S4, the color cast image is divided into greenish, blueish and yellowish.

[0012] S6. Perform channel compensation on the different color-shifted images obtained in step S5 to correct the color shift of the images;

[0013] S7. Improve the contrast of the original image using an improved homomorphic filtering method;

[0014] S8. The color correction map obtained in step S6 and the contrast enhancement map obtained in step S7 are fused in the Lab color space to obtain the color correction and contrast enhancement map.

[0015] In step S2, the method for finding the optimal background region is the quadtree search method, and the formula is as follows:

[0016]

[0017] in,

[0018] Let c represent the variance of the i-th sub-region c channel;

[0019] i∈{1,2,3,4} represents the i-th block of the image segmented in each iteration;

[0020] m*n represents the number of pixels in the i-th region;

[0021] c∈{r,g,b} represents the red, green, and blue color channels of the image;

[0022] This represents the pixel value of channel c at point x;

[0023] This represents the average pixel value of the i-th region.

[0024] In step S3, the difference M between the mean values ​​of the maximum and minimum channels is obtained using the following method, with the formula as follows:

[0025]

[0026] in,

[0027] This represents the maximum channel mean of the image;

[0028] This represents the minimum channel mean of the image.

[0029] In step S4, the method for obtaining the color cast factor threshold is as follows:

[0030] The statistical distribution interval of the channel difference M obtained in step S3 is calculated, and the channel difference M of the color-corrected image is calculated. The range of the channel difference M of the color-corrected image in the statistical distribution interval is compared to obtain the color cast factor threshold. When the image channel difference M > the color cast factor threshold, the image color is distorted. When the image channel difference M ≤ the color cast factor threshold, the image does not need to be corrected.

[0031] In step S5, the color-biased image is divided into greenish, blueish, and yellowish tones, based on the formula for the color channels of the processed image:

[0032]

[0033] in,

[0034] m c This represents the average value across all channels.

[0035] p i (x,y) represents the pixel value at the optimal background region (x,y);

[0036] n represents the optimal number of pixels in the background region;

[0037] c represents different color channels;

[0038] Represents the mean of the image;

[0039] D c This indicates the difference between the mean of each channel and the mean of the image.

[0040] In step S6, the color correction method includes:

[0041] For images with a green tint, the green channel is used as the reference channel, and compensation is applied to the red and blue channels using the following formula:

[0042]

[0043] For a yellowish image, the red channel is used as the reference channel, and the green and blue channels are compensated using the following formula:

[0044]

[0045] For a bluish image, the blue channel is used as the reference channel to compensate the green channel, and the compensated green channel is used as the reference channel to compensate the red channel. The compensation formula is as follows:

[0046]

[0047] in,

[0048] I rc (x), I gc (x), I bc (x) represent the red, green, and blue channels after color correction, respectively;

[0049] I r (x), I g (x), I b (x) represent the red, green, and blue channels of the original underwater image, respectively;

[0050] These represent the average pixel values ​​of the red, green, and blue channels in the optimal background area, respectively.

[0051] α and β represent constants.

[0052] In step S7, homomorphic filtering is applied to the image to enhance contrast, including:

[0053] S71. Homomorphic filtering is used to enhance high-frequency information while suppressing low-frequency background information. The original image is represented by an illumination-reflection model.

[0054] f(x,y)=i(x,y)·r(x,y);

[0055] in,

[0056] f(x,y) represents the grayscale image of the original underwater image;

[0057] i(x,y) represents the incident component;

[0058] r(x,y) represents the reflection component;

[0059] (x,y) represents the image coordinates;

[0060] Take the logarithm of both sides of the above equation:

[0061] lnf(x,y)=lni(x,y)+lnr(r,y);

[0062] Perform a Fourier transform, and you will get:

[0063] F(u,v)=I(u,v)+R(u,v);

[0064] in,

[0065] F(u,v), I(u,v), and R(u,v) represent the Fourier transforms of lnf(x,y), lni(x,y), and lnr(r,y), respectively.

[0066] (μ,υ) represents the image coordinates in the frequency domain;

[0067] Filtering is performed on both sides:

[0068] S(μ,υ)=H(u,v)F(u,v)=H(u,v)I(u,v)+H(u,v)R(u,v);

[0069] in,

[0070] S(μ,υ) represents the Fourier transform of the result;

[0071] H(u,v) represents the transfer function of the homomorphic filter;

[0072] Step S72: Based on homomorphic filtering, a new sigmoid transfer function curve is introduced. The expression for the sigmoid curve is:

[0073]

[0074] in,

[0075] p(t) represents the ordinate value of the introduced S-curve;

[0076] x represents the x-coordinate value;

[0077] t represents the control curve parameter;

[0078] Based on the fact that the S-curve has a structure similar to the profile of a homomorphic filter, a new transfer function is constructed as follows:

[0079]

[0080] in,

[0081] D0 represents the cutoff frequency;

[0082] k represents the parameter of the control function;

[0083] D(μ,υ) represents the distance from the frequency (μ,υ) to the filter center (μ0,υ0);

[0084] S73. Perform inverse Fourier transform on the frequency domain filtered image:

[0085] s(x,y)=IDFT[S(u,v)];

[0086] in,

[0087] s(x,y) represents the inverse Fourier transform result of the image after filtering;

[0088] IDFT stands for Inverse Fourier Transform;

[0089] Taking the antinomial to restore the spatial domain, we get:

[0090] g(x,y)=exp s(x,y) = i0(x,y)·r0(x,y);

[0091] in,

[0092] g(x,y) represents the image recovered to the spatial domain.

[0093] i0(x,y) represents the incident component of the image after filtering;

[0094] r0(x,y) represents the illumination component of the image after filtering.

[0095] In step S8, the color correction image from step S6 and the contrast enhancement image from step S7 are fused in the Lab color space to obtain the color correction and contrast enhancement images. The specific process is as follows:

[0096] I fused =ω·I dz +a cc +b cc ;

[0097] in,

[0098] I fused This represents the image after blending within the Lab color space;

[0099] I fused Indicates the fusion coefficient;

[0100] I dz The luminance channel represents the contrast-enhanced image;

[0101] a cc This represents the a channel of the color-corrected image in the Lab color space;

[0102] b cc This represents the b channel of the color-corrected image in the Lab color space.

[0103] The beneficial effects of the present invention are as follows: The algorithm described in the present invention identifies and corrects color cast in underwater images, enhances details using homomorphic filtering, and finally performs fusion processing in the Lab color space to determine the color of the water body, achieve adaptive correction of underwater image colors, and realize contrast enhancement, detail enhancement, and color restoration of underwater images. Attached Figure Description

[0104] Figure 1 This is a schematic diagram of the process of the present invention;

[0105] Figure 2 This is a distribution chart of the difference between the maximum and minimum attenuation channels in underwater images, compiled according to the present invention.

[0106] Figure 3 This is a comparison image showing the color correction and contrast enhancement of underwater green-colored images using the present invention and other algorithms.

[0107] Figure 4 This is a comparison image showing the color correction and contrast enhancement of underwater yellow-toned images using the present invention and other algorithms;

[0108] Figure 5 This is a comparison image showing the color correction and contrast enhancement of underwater blue-color-distorted images using the present invention and other algorithms.

[0109] The following will describe in detail, with reference to the accompanying drawings, embodiments of the present invention. Detailed Implementation

[0110] The principles and features of the present invention are described below with reference to the accompanying drawings. The embodiments given are for illustrative purposes only and are not intended to limit the scope of the invention. The invention is described more specifically in the following paragraphs by way of example with reference to the accompanying drawings. The advantages and features of the invention will become clearer from the following description. It should be noted that the drawings are in a very simplified form and use non-precise proportions, and are only used to facilitate and clarify the illustration of the embodiments of the invention.

[0111] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.

[0112] The present invention will be further described below with reference to the accompanying drawings and embodiments:

[0113] An underwater image enhancement method based on joint frequency and spatial domain processing, such as Figure 1 As shown, it includes the following steps:

[0114] S1. Obtain the publicly available underwater image dataset, which is the UIEB dataset.

[0115] S2. Find the optimal background region for the public dataset;

[0116] The optimal background region, i.e. the region with the minimum image variance, is searched using the quadtree method in the publicly available underwater image dataset, as follows:

[0117]

[0118] in,

[0119] Let represent the variance of channel c in the i-th sub-region; i∈{1,2,3,4} represents the i-th block of the image segmented in each iteration; m*n represents the number of pixels in the i-th region; c∈{r,g,b} represents the red, green, and blue color channels of the image; This represents the pixel value of channel c at point x; This represents the average pixel value of the i-th region.

[0120] S3. Based on the optimal background area obtained in step S2, calculate the channel difference M between the maximum and minimum channels respectively;

[0121] The difference M between the mean values ​​of the maximum and minimum channels is obtained using the following method, and the formula is as follows:

[0122]

[0123] in,

[0124] This represents the maximum channel mean of the image; This represents the minimum channel mean of the image.

[0125] S4. Statistically distribute the channel difference M obtained in step S3, and calculate the channel difference M of the color-corrected image. Compare the channel difference M of the color-corrected image within the range of the statistical distribution interval to obtain the color cast factor threshold. When the image channel difference M > the color cast factor threshold, the image color is distorted. When the image channel difference M ≤ the color cast factor threshold, the image does not need to be corrected.

[0126] The specific steps are as follows:

[0127] Here, the channel difference M is a concept. First, we calculate the channel difference M of the underwater image dataset obtained in step S1 (the publicly available underwater image dataset obtained in step S1 includes both color-accurate and distorted images), and then perform a statistical analysis on the distribution of the M values. For example, suppose the channel difference M obtained from this underwater image dataset (100 images) is (0.5, 0.6, 0.9, 0.2, 0.1, ..., ..., ...), representing 100 values. We then perform a statistical distribution analysis on these values, such as... Figure 2 As shown.

[0128] Select images with true colors from this dataset, and then extract the channel difference M of these images. For example, in this dataset of 100 underwater images, find images with true colors. Suppose we find 10 images, and the channel difference M of these 10 images are (0.01, 0.1, 0.2, 0.05, ..., ...).

[0129] By comparing the channel difference M of the true color image within the region of the statistical distribution, the image color cast factor threshold is obtained. In this example, the channel difference M of the true color image is less than 0.2, so the image color cast threshold is determined to be 0.2. When M>0.2, the image color is distorted, and when M≤0.2, the image does not need to be corrected.

[0130] S5. Based on the color cast factor threshold obtained in step S4, the color-cast image is divided into greenish, blueish, and yellowish casts. The criterion is that the formula for the color channels of the processed image is:

[0131]

[0132]

[0133] in,

[0134] m c p represents the mean of each channel; i (x,y) represents the pixel value at (x,y) in the optimal background region; n represents the number of pixels in the optimal background region; c represents different color channels; D represents the mean of the image. c This indicates the difference between the mean of each channel and the mean of the image.

[0135] S6. Perform channel compensation on the different color-shifted images obtained in step S5 to correct the color shift of the images;

[0136] Color correction methods include:

[0137] For images with a green tint, the green channel experiences the least attenuation. Therefore, the green channel is used as the reference channel, and the red and blue channels are compensated using the following formula:

[0138]

[0139] For images with a yellow tint, the red channel experiences the least attenuation. Therefore, the red channel is used as the reference channel, and the green and blue channels are compensated using the following formula:

[0140]

[0141] For images with a bluish tint, the blue channel experiences the least attenuation. However, unlike the other two tint compensation methods, directly using the blue channel to compensate the red channel will result in a reddish tint. This is due to overcompensation of the red channel. Therefore, the blue channel is used as the reference channel for compensating the green channel, and the compensated green channel is used as the reference channel for compensating the red channel. The compensation formula is as follows:

[0142]

[0143] in,

[0144] I rc (x), I gc (x), I bc (x) represent the color-corrected red, green, and blue channels, respectively; I r (x), I g (x), I b (x) represent the red, green, and blue channels of the original underwater image, respectively; α and β represent the pixel mean values ​​of the red, green, and blue channels in the optimal background area, respectively; α and β represent constants.

[0145] To further improve image quality, after attenuation channel compensation, the dynamic range of each channel is adjusted using a local histogram stretching method, and color deviation is removed by linear stretching. The specific formula is as follows:

[0146]

[0147] Where c∈{R,G,B}; L c U c These represent the lower and upper limits of the tail portion removed from the histogram of each image channel, respectively. These limits are determined by selecting the tail portion's cutoff position by removing 0.1% of the pixels. c (x) is the image after channel compensation; I c (x) is the image after the final linear stretching to remove color cast.

[0148] S7. Based on the color-compensated image, the image contrast is still low. Further improve the contrast, including:

[0149] S71. Homomorphic filtering is used to enhance high-frequency information while suppressing low-frequency background information. The original image is represented by an illumination-reflection model.

[0150] f(x,y)=i(x,y)·r(x,y);

[0151] in,

[0152] f(x,y) represents the grayscale image of the original underwater image; i(x,y) represents the incident component; r(x,y) represents the reflected component; and (x,y) represents the image coordinates.

[0153] Take the logarithm of both sides of the above equation:

[0154] lnf(x,y)=lni(x,y)+lnr(r,y);

[0155] Perform a Fourier transform, and you will get:

[0156] F(u,v)=I(u,v)+R(u,v);

[0157] in,

[0158] F(u,v), I(u,v), and R(u,v) represent the Fourier transforms of lnf(x,y), lni(x,y), and lnr(r,y), respectively; (μ,υ) represents the image coordinates in the frequency domain.

[0159] Filtering is performed on both sides:

[0160] S(μ,υ)=H(u,v)F(u,v)=H(u,v)I(u,v)+H(u,v)R(u,v);

[0161] in,

[0162] S(μ,υ) represents the Fourier transform of the result; H(u,v) represents the transfer function of the homomorphic filter;

[0163] H(u,v) can be expressed by the following formula:

[0164]

[0165] Where, r H Represents high-frequency gain, r L D represents the low-frequency gain, D0 represents the cutoff frequency, c is a constant that controls the filter configuration, and D(μ,υ) represents the distance from the frequency (μ,υ) to the filter center (μ0,υ0).

[0166] The transfer function can be changed by setting different parameters, but it is not conducive to parameter setting because it has many control parameters.

[0167] Step S72: To simplify the parameter setting of the homomorphic filter transfer function, a new S-shaped transfer function curve is introduced. This curve has a rapid initial growth rate and a slow growth rate in the middle stage, closely resembling the transfer function curve of the homomorphic filter. The expression for the S-shaped curve is:

[0168]

[0169] in,

[0170] p(t) represents the ordinate value of the introduced S-curve; x represents the abscissa value; t represents the control curve parameter;

[0171] Based on the fact that the S-curve has a structure similar to the profile of a homomorphic filter, a new transfer function is constructed as follows:

[0172]

[0173] in,

[0174] D0 represents the cutoff frequency; k represents the parameters of the control function; D(μ,υ) represents the distance from the frequency (μ,υ) to the filter center (μ0,υ0);

[0175] S73. Perform inverse Fourier transform on the frequency domain filtered image:

[0176] s(x,y)=IDFT[S(u,v)];

[0177] in,

[0178] s(x,y) represents the inverse Fourier transform result of the image after filtering; IDFT represents the inverse Fourier transform.

[0179] Taking the antinomial to restore the spatial domain, we get:

[0180] g(x,y)=exp s(x,y) = i0(x,y)·r0(x,y);

[0181] in,

[0182] g(x,y) represents the image restored to the spatial domain; i0(x,y) represents the incident component of the image after filtering; r0(x,y) represents the illumination component of the image after filtering.

[0183] S8. The color correction map obtained in step S6 and the contrast enhancement map obtained in step S7 are fused in the Lab color space to obtain the color correction and contrast enhancement maps. The specific process is as follows:

[0184] I fused =ω·I dz +a cc +b cc ;

[0185] in,

[0186] I fused This represents the image after blending within the Lab color space; I fused I represents the fusion coefficient; dz This represents the luminance channel of a contrast-enhanced image; a cc This represents the a channel of the color-corrected image in the Lab color space; b cc This represents the b channel of the color-corrected image in the Lab color space. Specific implementation examples:

[0188] Figure 3 , Figure 4 , Figure 5The images show the experimental results of this invention and other algorithms after processing underwater images with different color casts. Here, UICONM represents underwater image contrast measurement; UICM represents underwater image chromaticity measurement; UISM represents underwater image sharpness measurement; UIQM (Universal Image Quality Metric) loss function is a commonly used image quality measurement method that can accurately evaluate the effect of image processing algorithms and the quality of image restoration; UCIQE (Uncertainty in Color, Intensity, and Saturation of an Image) is an index used to evaluate the quality of underwater images, and is a linear combination of color intensity, saturation, and contrast; AG (Autogynephilia) represents the average gradient, the larger the average gradient, the better, as a larger gradient indicates more image details and higher sharpness; PCQI (patch-based contrast quality index) represents the patch-based contrast quality index.

[0189] Analysis of the experimental results (a) shows the original image, (b) the CBAF algorithm, (c) the DAC algorithm, (d) the GDCP algorithm, (e) the ACDC algorithm, (f) the TWO algorithm, (g) the PCDE algorithm, and (h) the algorithm of this invention. It can be seen that other algorithms cannot simultaneously solve the problems of color cast and contrast enhancement, while the algorithm of this invention improves the color cast, enhances the contrast moderately, and makes the details and textures of the image clear. The subjective visual quality is better than the other image processing algorithms.

[0190] Table 1. Average objective evaluation index of different algorithms for different images.

[0191]

[0192]

[0193] Table 1 shows the objective evaluation values. A higher value indicates a clearer image and the best image enhancement effect. The table shows that the method of this invention generally exhibits a high evaluation value, indicating that it has a more significant effect on enhancing image quality compared to other methods.

[0194] The present invention has been described above by way of example with reference to the accompanying drawings. Obviously, the specific implementation of the present invention is not limited to the above-described manner. Any improvements made using the inventive concept and technical solution of the present invention, or direct application to other occasions without modification, are all within the protection scope of the present invention.

Claims

1. An underwater image enhancement method based on joint frequency and spatial domain processing, characterized in that, Includes the following steps: S1. Obtain publicly available underwater image datasets; S2. Find the optimal background region for the public dataset; S3. Based on the optimal background area obtained in step S2, calculate the channel difference M between the maximum and minimum channels respectively; S4. Statistically calculate the channel difference M obtained in step S3 and compare it with the channel difference M of the color-corrected image to obtain the color cast factor threshold of the color cast image. S5. Based on the color cast factor threshold obtained in step S4, the color cast image is divided into greenish, blueish and yellowish. S6. Perform channel compensation on the different color-shifted images obtained in step S5 to correct the color shift of the images; S7. Enhance the contrast of the original image using an improved homomorphic filtering method, including: S71. Homomorphic filtering is used to enhance high-frequency information while suppressing low-frequency background information. The original image is represented by an illumination-reflection model. ; in, A grayscale representation of the original underwater image; Indicates the incident component; Indicates the reflected component; Represents image coordinates; Take the logarithm of both sides of the above equation: ; Perform a Fourier transform, and you will get: ; in, , , They represent , , Fourier transform; Represents the image's coordinates in the frequency domain; Filtering is performed on both sides: ; in, The Fourier transform of the result; The transfer function of a homomorphic filter; Step S72: Based on homomorphic filtering, an S-shaped transfer function curve is introduced. The expression for the S-shaped curve is: ; in, This represents the ordinate value of the introduced S-shaped curve; x represents the x-coordinate value; t represents the control curve parameter; Based on the fact that the S-curve has a structure similar to the profile of a homomorphic filter, a new transfer function is constructed as follows: ; in, Indicates the cutoff frequency; k represents the parameter of the control function; Represents frequency To the filter center The distance; S73. Perform inverse Fourier transform on the frequency domain filtered image: ; in, This represents the inverse Fourier transform result of the image after filtering; IDFT stands for Inverse Fourier Transform; Taking the antinomial to restore the spatial domain, we get: ; in, To restore the spatial domain image; This represents the incident component of the image after filtering. This represents the illumination component of the image after filtering. S8. The color correction map obtained in step S6 and the contrast enhancement map obtained in step S7 are fused in the Lab color space to obtain the color correction and contrast enhancement map.

2. The underwater image enhancement method based on joint frequency and spatial processing according to claim 1, characterized in that, In step S2, the method for finding the optimal background region is the quadtree search method, and the formula is as follows: ; in, Indicates the first Variance of channel c in each subregion; Represents the image segmentation in each iteration. One block; Indicates the first The number of pixels in each region; Represents the red, green, and blue color channels of an image; This represents the pixel value of channel c at point x; Indicates the first The average number of pixels in each region of the image.

3. The underwater image enhancement method based on joint frequency and spatial processing according to claim 1, characterized in that, In step S3, the difference M between the mean values ​​of the maximum and minimum channels is obtained using the following method, with the formula as follows: ; in, This represents the maximum channel mean of the image; This represents the minimum channel mean of the image.

4. The underwater image enhancement method based on joint frequency and spatial processing according to claim 1, characterized in that, In step S4, the method for obtaining the color cast factor threshold is as follows: The statistical distribution interval of the channel difference M obtained in step S3 is calculated, and the channel difference M of the color-corrected image is calculated. The range of the channel difference M of the color-corrected image in the statistical distribution interval is compared to obtain the color cast factor threshold. When the image channel difference M > the color cast factor threshold, the image color is distorted. When the image channel difference M ≤ the color cast factor threshold, the image does not need to be corrected.

5. The underwater image enhancement method based on joint frequency and spatial processing according to claim 4, characterized in that, In step S5, the color-biased image is divided into greenish, blueish, and yellowish tones, based on the formula for the color channels of the processed image: ; ; in, This represents the average value across all channels. Represents the optimal background region Pixel value at; n represents the optimal number of pixels in the background region; c represents different color channels; Represents the mean of the image; D c This indicates the difference between the mean of each channel and the mean of the image.

6. The underwater image enhancement method based on joint frequency and spatial processing according to claim 1, characterized in that, In step S6, the color correction method includes: For images with a green tint, the green channel is used as the reference channel, and the red and blue channels are compensated using the following formula: ; For a yellowish image, the red channel is used as the reference channel, and the green and blue channels are compensated using the following formula: ; For a bluish image, the blue channel is used as the reference channel to compensate the green channel. The compensated green channel is then used as the reference channel to compensate the red channel. The compensation formula is as follows: ; in, , , These represent the red, green, and blue channels after color correction, respectively. , , These represent the red, green, and blue channels of the original underwater image, respectively. , , These represent the average pixel values ​​of the red, green, and blue channels in the optimal background area, respectively. , Represents a constant.

7. The underwater image enhancement method based on joint frequency and spatial processing according to claim 1, characterized in that, In step S8, the color correction image from step S6 and the contrast enhancement image from step S7 are fused in the Lab color space to obtain the color correction and contrast enhancement images. The specific process is as follows: ; in, This represents the image after blending within the Lab color space; Indicates the fusion coefficient; The luminance channel represents the contrast-enhanced image; This indicates the color-corrected image in the Lab color space. aisle; This indicates the color-corrected image in the Lab color space. aisle.