An underwater image enhancement method based on improved quadtree and main color line direction

By improving the underwater image enhancement method based on quadtrees and the main color line direction, the problems of color distortion and detail blurring in underwater images are solved, thereby improving the visual quality of the images. This method is suitable for advanced vision tasks such as underwater target detection and semantic segmentation.

CN122390974APending Publication Date: 2026-07-14WYBOTICS CO LTD +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
WYBOTICS CO LTD
Filing Date
2026-04-21
Publication Date
2026-07-14

AI Technical Summary

Technical Problem

Existing underwater image enhancement methods suffer from a lack of effective image information when dealing with turbid waters, distant targets, or minor structural defects. They also suffer from severe noise interference during the imaging process, color distortion, and non-uniform lighting that obliterates key texture features, making it difficult to support high-precision autonomous navigation and automated defect detection.

Method used

An improved quadtree image segmentation system was used to segment underwater images. Regions were selected and background light values ​​were solved through a scoring mechanism. A transmittance optimization objective function was established by combining the direction of the main color line. The transmittance map was obtained by using L1/2 regularization optimization problem. After post-processing, a three-channel transmittance map was obtained. Finally, the image was enhanced by methods such as linear blending white balance, Retinex enhancement, and adaptive sharpening.

Benefits of technology

It significantly improves the visual quality of underwater images, alleviates color distortion and detail blurring, provides high-quality image input for advanced vision tasks, enhances image clarity and color fidelity, and is suitable for underwater target detection and semantic segmentation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122390974A_ABST
    Figure CN122390974A_ABST
Patent Text Reader

Abstract

The application provides an underwater image enhancement method based on improved quadtree and main color line direction, which comprises the following steps: obtaining image regions by dividing an original underwater image through an improved quadtree image segmentation system, scoring and screening the image regions, and solving the background light to obtain a background light value; obtaining the main color line direction of the original underwater image, establishing a transmittance optimization objective function based on the main color line direction and the background light value, solving the optimal solution through the transmittance optimization objective function to obtain a global transmittance scalar; obtaining an initial transmittance map of the original underwater image according to the global transmittance scalar and the background light value, and performing post-processing to obtain a three-channel transmittance map; restoring the original underwater image by using the three-channel transmittance map to obtain a restored underwater image, and performing image enhancement on the restored underwater image to obtain an enhanced underwater image. The method provided by the application can solve the problems of color distortion, detail blur and inaccurate transmittance estimation during underwater image enhancement.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of digital image processing technology, and in particular to an underwater image enhancement method based on an improved quadtree and the direction of the main color line. Background Technology

[0002] Clear and realistic underwater images are a crucial perceptual prerequisite for autonomous navigation, target detection, and intelligent identification of facility defects in underwater robots. The underwater environment is a complex medium with severe optical degradation. Light undergoes drastic attenuation and scattering in water, resulting in overall color cast, low contrast, and blurred details in images. This makes direct visual analysis or manual interpretation extremely difficult and inefficient. To improve the automation and reliability of underwater operations, underwater image enhancement algorithms have been continuously researched and improved, particularly with the introduction of physical model-based restoration methods and deep learning. These methods utilize prior knowledge of underwater imaging, optical models, or data-driven feature learning to build robust and efficient underwater visual preprocessing systems, providing high-quality image input for subsequent advanced visual tasks. However, in practical applications, effective image information is severely lacking for turbid waters, distant targets, or structurally subtle defects. During imaging, severe noise interference, color distortion, and non-uniform illumination obscure key texture features, limiting the enhancement effect and making it difficult to effectively support high-precision autonomous navigation and reliable automated defect detection. Summary of the Invention

[0003] In view of this, the purpose of this invention is to provide an underwater image enhancement method based on an improved quadtree and the direction of the main color line, which can solve the problems of color distortion, blurred details and inaccurate transmittance estimation that occur during underwater image enhancement.

[0004] This invention provides an underwater image enhancement method based on an improved quadtree and the direction of the main color line, comprising:

[0005] S1. The original underwater image is segmented by an improved quadtree image segmentation system to obtain image regions. The image regions are scored and filtered using a scoring mechanism. The background light value is obtained by solving the background light solution for the filtered image regions.

[0006] S2. Obtain the direction of the main color line in the original underwater image. Establish a transmittance optimization objective function based on the direction of the main color line and the background light value. Obtain the global transmittance scalar by finding the optimal solution through the transmittance optimization objective function.

[0007] S3. Obtain the initial transmittance map of the original underwater image based on the global transmittance scalar and background light value, and then perform post-processing on the initial transmittance map to obtain a three-channel transmittance map.

[0008] S4. The original underwater image is restored using the three-channel transmittance map to obtain the restored underwater image. Image enhancement is then performed on the restored underwater image to obtain the enhanced underwater image.

[0009] The beneficial effects of the embodiments of the present invention are as follows:

[0010] Compared with existing technologies, the method provided in this embodiment improves the robustness of background light estimation by introducing a multi-dimensional scoring mechanism, and constructs and efficiently solves L 1 / 2 The regularization optimization problem yielded a more accurate transmittance map, effectively alleviating the color distortion and detail blurring issues in underwater images, significantly improving the visual quality and usability of the restored images, and providing high-quality image input for advanced visual tasks such as underwater target detection and semantic segmentation.

[0011] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention are realized and obtained in accordance with the structures particularly pointed out in the description, claims and drawings.

[0012] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0013] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0014] Figure 1 This is a flowchart illustrating an underwater image enhancement method based on an improved quadtree and the direction of the main color line.

[0015] Figure 2 A comparison of the effects of an underwater image enhancement method based on an improved quadtree and the direction of the main color line;

[0016] Figure 3 This is a partial effect diagram of an underwater image enhancement method based on an improved quadtree and the direction of the main color line;

[0017] Figure 4 This is a visualization comparing the underwater image enhancement method based on an improved quadtree and the direction of the main color line with other algorithms. Detailed Implementation

[0018] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0019] Example 1

[0020] To facilitate understanding of this embodiment, in conjunction with Figure 1 This invention provides a detailed description of an underwater image enhancement method based on an improved quadtree and the direction of the primary color line. The underwater image enhancement method based on an improved quadtree and the direction of the primary color line, as disclosed in this embodiment, includes the following steps:

[0021] S1. The original underwater image is segmented by an improved quadtree image segmentation system to obtain image regions. The image regions are scored and filtered using a scoring mechanism. The background light value is obtained by solving the background light problem for the filtered image regions.

[0022] Specifically, the original underwater image is segmented using an improved quadtree image segmentation system to obtain image regions. A scoring mechanism is then used to score and filter these image regions. Finally, background light values ​​are calculated from the filtered image regions, including:

[0023] S11. The original underwater image is segmented into 4 image regions using an improved quadtree image segmentation system.

[0024] The image region includes image regions in color mode and image regions in grayscale mode. The expression for the pixels of the image region in color mode is:

[0025] ;

[0026] In the formula, x and y are the horizontal and vertical coordinates of the pixel, respectively.

[0027] The expression for the pixels of an image region in grayscale mode is:

[0028] ;

[0029] In the formula, w R w represents the weight of the red channel. G w represents the weight of the green channel. B This represents the weight of the blue channel. In this embodiment, according to the ITU-R BT.6 standard, w is taken as... R =0.299、w G =0.587, w B=0.114.

[0030] S12. Establish a scoring mechanism to score the four segmented image regions and select the three image regions with the highest scores. Then, continue to segment these three image regions using the improved quadtree image segmentation system and use the scoring mechanism to select the segmented image regions. Repeat this process until the segmented image regions are smaller than the set threshold.

[0031] The scoring mechanism consists of multiple scoring indicators, including ambiguity. Flatness Red light attenuation degree Texture complexity Color consistency The expression for the scoring mechanism is:

[0032] ;

[0033] In the formula, The score for the image region, Indicates a sub-region. .

[0034] As a preferred implementation, in order to amplify the scoring differences between different image regions, the scoring mechanism needs to be non-linearly enhanced. The expression of the scoring mechanism after non-linear enhancement is:

[0035] .

[0036] The following describes the calculation methods for each evaluation indicator. To simplify the calculation process, flatness is... Red light attenuation degree Color consistency Calculated based on the image region in color mode; for blurriness... Texture complexity The calculation is performed based on the image region in grayscale mode.

[0037] Furthermore, in the scoring mechanism,

[0038] Ambiguity The calculation method is as follows:

[0039] First, calculate the Laplacian response for each scale k in each image region, expressed as:

[0040] ;

[0041] In the formula, Indicates the size is The Laplace nucleus, scale .

[0042] Secondly, treating each pixel value of the Laplacian response as a sample value, the variance of the entire image region is calculated, and its expression is:

[0043] ;

[0044] In the formula, N represents the resolution of the image region. The mean of the entire image region is expressed as:

[0045] ;

[0046] Then, by combining the variance of the entire image region, the blurriness at each scale k can be calculated, and its expression is:

[0047] ;

[0048] Next, the final ambiguity is calculated based on the ambiguity at each scale k. Its expression is:

[0049] ;

[0050] flatness The expression is:

[0051] ;

[0052] In the formula, Let be the average pixel intensity of color channel c in sub-image region I(i). Let I(i) represent the standard deviation of the sub-image region I(i).

[0053] Red light attenuation The expression is:

[0054] ;

[0055] In the formula, Indicates the light intensity of color channel c. This indicates the light intensity of the red channel.

[0056] In this embodiment, since red light has the longest wavelength and the greatest attenuation in an underwater environment, it best reflects the underwater lighting environment. Therefore, the degree of red light attenuation is used in the scoring mechanism. As one of the scoring criteria.

[0057] Texture complexity The calculation method is as follows:

[0058] First, when the grayscale of the pixels in the image region is When considering each grayscale pixel, consider its surrounding P uniformly distributed neighboring grayscale pixels. In the case of calculating the local binary pattern of each grayscale pixel in normal mode, the expression is:

[0059] .

[0060] Secondly, due to the local binary mode in normal mode, there are There are several possibilities. When the value of P is large, it often leads to a huge amount of computation. Therefore, the local binary pattern under the uniform pattern is used instead of the local binary pattern under the normal pattern. When the value of P is 8, there are 58 possible local binary patterns under the uniform pattern, while there are 256 possible local binary patterns under the normal pattern, which greatly reduces the amount of computation.

[0061] The normal mode is obtained by combining the uniform mode and the non-uniform mode. The uniform mode is defined as follows: for a binary string of local binary mode, the number of transitions from 0 to 1 or from 1 to 0 does not exceed 2. For example, in the following matrices, the first two matrices represent the uniform mode, and the last matrix represents the non-uniform mode.

[0062] ,

[0063] ,

[0064] .

[0065] Next, the pixel value distribution of each gray-level pixel in the image region is calculated based on the local binary pattern in the uniform mode, and a histogram is generated using the pixel value distribution. Then, each gray-level pixel is obtained by normalization based on the histogram. The probability distribution of is expressed as:

[0066] ;

[0067] Then, each grayscale pixel is calculated based on the probability distribution. The information entropy, also known as the first information entropy, is expressed as:

[0068] ;

[0069] In this expression, to avoid The calculation error that occurs when the value is exactly 0 leads to instability in numerical calculations. Therefore, a constant is added to the first information entropy. The second information entropy is obtained, and its expression is:

[0070] ;

[0071] In the formula, .

[0072] Finally, the texture complexity is calculated based on the second information entropy. Its expression is:

[0073] ;

[0074] Color consistency The calculation method is as follows:

[0075] First, the image area in color mode is converted to the HSV color space. In the HSV color space, each pixel in the image area in color mode is represented by the following components: hue (H), saturation (S), and value (V). Therefore, the average hue of the image area in color mode is set to:

[0076] ;

[0077] In the formula, the hue channel of the image region in color mode is... , This represents the pixel position, and N is the number of pixels.

[0078] Secondly, the standard deviation of the hue mean is calculated based on the hue channels of the HSV color space, and its expression is as follows:

[0079] ;

[0080] Then, to ensure that the standard deviation of the hue mean matches the dimensions of other evaluation indicators, the standard deviation is normalized, and its expression is as follows:

[0081] ;

[0082] Finally, color consistency is calculated based on the normalized standard deviation, and its expression is as follows:

[0083] .

[0084] S13. Collect the k image regions with the highest scores after segmentation, and obtain the background light value by averaging the k image regions according to their scores.

[0085] Combining the above steps, Figure 2To compare the method of this embodiment with the traditional quadtree background illumination solution method, and to intuitively evaluate the color distortion improvement effect, the method of this embodiment maps all pixels of the underwater image to a three-dimensional color space according to their RGB values, generating a 3D point cloud in the color space—each pixel corresponds to a point in the point cloud, with coordinates representing the values ​​of the red, green, and blue channels, respectively. The point cloud clearly shows the overall color distribution: the point cloud obtained by the traditional method is often densely packed in the blue-green region, reflecting the severe attenuation of red light by water; while the point cloud processed by the method of this embodiment clearly diffuses into the red-yellow region, with an overall distribution closer to the "gray diagonal" shape of a natural scene. The results show that, compared with the traditional quadtree background illumination solution method, the method of this embodiment expands the dynamic visual range of underwater images to a certain extent and effectively improves the color distortion problem of underwater images.

[0086] S2. Obtain the direction of the main color line in the original underwater image. Establish a transmittance optimization objective function based on the direction of the main color line and the background light value. Obtain the global transmittance scalar by finding the optimal solution through the transmittance optimization objective function.

[0087] The primary color direction describes the main color distribution direction of the original underwater image. The degree of degradation of the original underwater image can be described by the geometric relationship between the background light value and the primary color line direction.

[0088] Specifically, the direction of the main color line in the original underwater image is obtained. A transmittance optimization objective function is established based on the main color line direction and the background light value. The optimal solution is obtained through the transmittance optimization objective function to obtain the global transmittance scalar, which includes:

[0089] S21. Establish a covariance matrix by calculating the mean of global pixels in the original underwater image. Extract the maximum eigenvalue based on the covariance matrix and select the eigenvector corresponding to the maximum eigenvalue as the direction of the main color line in the original underwater image.

[0090] In S21, a covariance matrix is ​​established by calculating the mean of global pixels in the original underwater image. The largest eigenvalue is obtained through feature extraction based on the covariance matrix. The eigenvector corresponding to the largest eigenvalue is selected as the direction of the main color line in the original underwater image.

[0091] First, set the original underwater image in color mode as... Arrange the pixels of the original underwater image into The matrix, where, ;

[0092] Secondly, set the x-axis of all pixels in the original underwater image. i If the set is X, then the expression for X is:

[0093] ;

[0094] Based on the previous expression, the mean value of global pixels in the original underwater image is calculated as follows:

[0095] ;

[0096] Then, subtract the mean from each pixel in the global pixel set to obtain decentralized pixel data, which is expressed as:

[0097] ;

[0098] Next, a covariance matrix is ​​constructed using decentralized pixel data, and its expression is as follows:

[0099] ;

[0100] Finally, eigenvalue decomposition is performed on the covariance matrix to obtain several eigenvalues. And its corresponding unit eigenvector e, the unit eigenvector corresponding to the largest eigenvalue is selected as the direction of the main color line of the original underwater image, and its expression is:

[0101] ;

[0102] S22. Based on the atmospheric scattering model, establish a linear equation according to the mathematical relationship between background light value, main color line direction and transmittance.

[0103] The atmospheric scattering model is defined as follows:

[0104] ;

[0105] In the formula, These are the pixel values ​​of the original underwater image (in a foggy scene). The value represents the true value of an underwater image under ideal conditions (in a fog-free scene), where A is the background light value. Transmittance.

[0106] Based on this, in S22, the linear equations established according to the mathematical relationship between background light estimation, principal color direction, and transmittance include:

[0107] First, transmittance Simplifying to an undetermined variable x, a mathematical relationship is established based on the undetermined variable x, the global average color V, and the direction of the main color line D. Its expression is:

[0108] ;

[0109] In the formula, The Euclidean norm of atmospheric light vectors. This represents the dot product of the main color line direction D and the background light value A.

[0110] Secondly, by transforming the above mathematical relationship, we obtain the relational expression for the undetermined variable x, which is:

[0111] ;

[0112] Then, to enhance the numerical stability of the relation of the undetermined variable x, it is transformed into a 1×1 linear system, the expression of which is:

[0113]

[0114] Next, we define the scalar on the right side of the linear equation as b, and its expression is:

[0115] ;

[0116] Then, the information of atmospheric light in the red channel is embedded into the linear system, and a normalization factor is introduced to construct the system matrix A1, the expression of which is:

[0117] ;

[0118] Finally, based on the scalar b on the right side of the defined linear equation and the system matrix A1, a linear equation consisting of the direction of the main color line and the background light value is established, and its expression is:

[0119] .

[0120] S23, Introduce data fidelity items and The sparse regularization term, combined with auxiliary variables, transforms the linear equation into a transmittance optimization objective function.

[0121] Directly solving linear equations can be affected by noise or model simplification errors. Therefore, data fidelity terms and L are introduced into the linear equations. 1 / 2 The sparse regularization term yields the objective function for optimizing transmittance.

[0122] S24. The transmittance optimization objective function is decomposed into a first subproblem and a second subproblem using a variable splitting strategy, and the optimal solution of the transmittance optimization objective function is obtained by using the alternating iteration method (GiPALM) to obtain the global transmittance scalar.

[0123] The expression for the transmittance optimization objective function is as follows:

[0124] ;

[0125] In the formula, Let be the global transmittance scalar value to be determined, y be an auxiliary variable, and M be a matrix consisting of the direction of the primary color line and the background light value. The regularization coefficient is . express Norm.

[0126] Based on this, in S24, the transmittance optimization objective function is decomposed into a first subproblem and a second subproblem using a variable splitting strategy as follows:

[0127] First, a variable splitting strategy is adopted for the transmittance optimization objective function. That is, with the auxiliary variable y fixed, the transmittance optimization objective function is simplified into a problem of solving for the undetermined parameter x, and its expression is:

[0128] ;

[0129] Secondly, let The problem of solving for the undetermined variable x can be further simplified into a standard quadratic form problem, which is expressed as:

[0130] ;

[0131] Differentiating the quadratic problem, we obtain the first-order optimality condition, which is expressed as follows:

[0132] ;

[0133] Again The first derivation is obtained, and its expression is:

[0134] ;

[0135] Based on this, preprocessing parameters are introduced into the first derivation. The second derivation is obtained, and its expression is:

[0136] ;

[0137] The first subproblem is defined based on the second derivation, and its expression is:

[0138] ;

[0139] The expression for the second subproblem is:

[0140] ;

[0141] In the formula, For a certain y and x k+1 Related intermediate variables. In this embodiment, intermediate variables... The expression is:

[0142] ;

[0143] In the formula, A coefficient is set by the user, and its value is 1.

[0144] Furthermore, in S24, the optimal solution of the transmittance optimization objective function is obtained using the alternating iteration method to obtain the global transmittance scalar as follows:

[0145] First, for the second subproblem, due to the non-smooth part of the expression... Direct solution is difficult, therefore this embodiment uses a half-thresholding operator to address the non-smooth part of the second subproblem. Each component The analytical solution is obtained by solving independently, and its expression is:

[0146] ;

[0147] Secondly, for the previous expression, when When the optimal solution is obtained... , the optimal solution As a global transmittance scalar, the optimal solution at this point It is a non-zero closed expression; otherwise, It is 0.

[0148] For example, setting a threshold The expression is:

[0149] ;

[0150] Then when When, the optimal solution The expression is:

[0151] ;

[0152] In this embodiment, .

[0153] As a preferred implementation, after obtaining the optimal solution of the transmittance optimization objective function using the alternating iteration method, the objective function converges, and its expression is:

[0154] ;

[0155] In the process of iterating using the alternating iteration method, when the difference in the values ​​of the objective function is less than the preset tolerance, the objective function is considered to have converged.

[0156] S3. Obtain the initial transmittance map of the original underwater image based on the global transmittance scalar and background light value, and then perform post-processing on the initial transmittance map to obtain a three-channel transmittance map.

[0157] Specifically, post-processing the initial transmittance map to obtain a three-channel transmittance map includes:

[0158] S31. Define the attenuation coefficient and calculate the transmittance of the red channel in the initial transmittance diagram based on the global transmittance scalar and the attenuation coefficient.

[0159] The expression for the attenuation coefficient is as follows:

[0160] ;

[0161] The expression for the transmittance of the red channel is:

[0162] ;

[0163] S32. Perform numerical clipping on the transmittance of the red channel in the initial transmittance map to obtain the clipped initial transmittance map.

[0164] To ensure the transmittance of the red channel is physically reasonable, the transmittance t of the red channel in the initial transmittance map is numerically cropped, and its expression is as follows:

[0165] ;

[0166] In the formula, t min The minimum transmittance is 0.05, t max The maximum transmittance is 0.95.

[0167] In this embodiment, after obtaining the initial transmittance map after cropping, the transmittance of the red channel after numerical cropping is adjusted by a certain proportion to obtain the transmittance of the green and blue channels respectively.

[0168] The expression for the transmittance of the green channel is:

[0169] ;

[0170] The expression for the transmittance of the blue channel is:

[0171] .

[0172] S33. The initial transmittance map after cropping is smoothed and edge-preserving by using the total variation TV denoising method and the joint bilateral filtering method in sequence to obtain a three-channel transmittance map.

[0173] S4. The original underwater image is restored using the three-channel transmittance map to obtain the restored underwater image. Image enhancement is then performed on the restored underwater image to obtain the enhanced underwater image.

[0174] The methods for image enhancement of restored underwater images include:

[0175] The overall color cast of the restored underwater image was corrected using the linear blending white balance method.

[0176] The illumination and contrast of the restored underwater image were adjusted using the multi-scale Retinex enhancement method.

[0177] By using adaptive sharpening to highlight and restore image details in underwater images;

[0178] Noise in the restored underwater image was suppressed using bilateral filtering.

[0179] Combination Figure 3 The image enhancement method presented in this paper results in a significant dehazing effect, excellent color correction, and high retention of image details in the enhanced underwater image.

[0180] Example 2

[0181] Building upon Example 1, to verify the effectiveness of the proposed method, this example will comprehensively evaluate the algorithm from both subjective and objective perspectives. Several widely used methods will be compared, including algorithms based on underwater physical imaging models (e.g., UDCP, IBLA, UCL), algorithms based on traditional image processing (e.g., ACDC, WWPF), and underwater image enhancement algorithms based on improved color-line models (UIEA-ICM). Six representative underwater images from different scenes will be selected, all taken from the Underwater Image Enhancement Benchmark (UIEB) dataset.

[0182] 1. Subjective evaluation

[0183] Depend on Figure 4It can be seen that underwater images processed using the UDCP and ACDC methods are prone to bright spots and irregular color blocks at the edges, with the ACDC method being particularly severe and exhibiting color distortion. The UCL method has weak color correction capabilities and significant image blur. The WWPF method can preserve image details well, but the overall image is dark, and like the two methods mentioned above, it easily introduces irregular color blocks in bright areas, damaging the original image information. Compared to the above methods, the IBLA method has poor dehazing effect. In cases where the overall image is greenish due to severe red light attenuation, all the above methods exhibit color cast. Compared to the above methods, UIEA-ICM effectively improves the color distortion problem caused by underwater color degradation, but it still suffers from color distortion caused by excessive contrast, resulting in poor image visibility. In summary, the method presented in this embodiment considers both underwater image dehazing and color correction, providing a wider visual range while avoiding color distortion caused by excessive contrast, making it more consistent with human visual perception.

[0184] 2. Objective evaluation

[0185] To further verify the enhancement effect of the proposed method, three objective evaluation metrics are introduced to quantitatively measure different image enhancement methods: Average Gradient (AG), Underwater Color Image Quality Evaluation (UCIQE), and Underwater Image Quality Measure (UIQM).

[0186] The Aggregate Gradient (AG) index is a non-referenced evaluation metric that quantifies image sharpness based on pixel grayscale variations. Its core idea is to reflect image quality by statistically analyzing grayscale changes. The more regions with dramatic grayscale changes (larger gradients) in an image, the more pronounced the image edges and the sharper the overall visual effect; conversely, smaller gradients indicate a blurry image or insufficient contrast. A larger average gradient indicates higher image sharpness and better visibility. Experimental results are shown in Table 1.

[0187] Table 1. Comparison of AG index and its mean under different algorithms

[0188]

[0189] The algorithm proposed in this embodiment achieved an average gradient of 126.63 on six test images, significantly higher than the comparison algorithms (UDCP: 25.05, ACDC: 23.87, IBLA: 18.48, UIEA-ICM: 38.25). The average gradient, measuring the rate of grayscale change between image pixels, reflects the sharpness and richness of texture details. The significant lead of the algorithm in this embodiment in this metric demonstrates its dual advantages: firstly, the algorithm effectively removes underwater scattering media through accurate transmittance estimation, achieving excellent dehazing and contrast enhancement effects; secondly, the improved post-processing workflow (such as adaptive sharpening and edge-preserving filtering) maximizes the preservation and enhancement of the image's microstructure and edge information during the dehazing process. For example, when processing complex texture images such as coral reefs or underwater structures, the enhanced results from this algorithm show sharper object outlines, and surface textures are restored to clear details through color mask "perspective," rather than being smoothed or smeared. This powerful ability to preserve details ensures that the enhanced images not only have a better visual experience, but also provide a data foundation with a higher signal-to-noise ratio and richer features for subsequent advanced vision tasks such as underwater target recognition, crack detection, or 3D reconstruction.

[0190] UCIQE is a no-reference quality assessment metric specifically designed to address the degradation mechanisms of underwater images. It quantifies the subjective perception of underwater image visual quality by the human eye through a linearly weighted combination, and its core consists of three key components: saturation, contrast, and chroma. Specifically, it uses the standard deviation of the chroma channel in the CIELab color space to characterize color richness and uniformity; it measures local contrast and detail visibility through the root mean square error of the luminance channel; and it calculates the mean of the saturation channel to reflect the vividness of colors. This metric's design profoundly reflects the physical constraints of underwater imaging: due to the preferential absorption of red light wavelengths by water, images generally exhibit a blue-green tint accompanied by decreased saturation; simultaneously, forward scattering leads to severe contrast degradation. By integrating these features closely related to human visual perception, UCIQE can effectively distinguish between "poor visual quality" caused by physical degradation and "over-enhancement" or "color distortion" that may be introduced through algorithmic processing. Therefore, a higher UCIQE value indicates that the image is closer to the ideal state in terms of color fidelity, richness of detail, and overall visual comfort. The experimental results of the UCIQE index for different algorithms are shown in Table 2.

[0191] Table 2. Comparison of UCIQE Indicators and Means under Different Algorithms

[0192]

[0193] The algorithm proposed in this embodiment achieved the highest mean score (0.6473) among the six test images on the UCIQE metric, significantly outperforming the comparison algorithm. This result strongly demonstrates the superior performance of the algorithm in terms of overall visual quality, especially in color fidelity, contrast, and saturation balance. The outstanding performance of the algorithm in this embodiment on this metric can be attributed to the targeted design of its technical chain: In terms of color correction: improved background light estimation and subsequent linear blending white balance work together to more accurately compensate for underwater color cast, thereby directly improving the score of chromaticity components and making the image colors closer to the performance under natural lighting; In terms of contrast and detail enhancement: based on the color line model and L... 1 / 2 The transmittance map obtained through regularization optimization can more accurately estimate the degree of degradation in different regions, thereby more effectively restoring the scene's inherent brightness and contrast during the physical restoration stage. Subsequent Retinex enhancement and adaptive sharpening further strengthen this effect. Regarding saturation enhancement: the overall color correction and contrast stretching process, while correcting color cast, also naturally enhances color purity, avoiding oversaturation or unnatural color rendering, resulting in a reasonable increase in saturation components.

[0194] In summary, the highest UCIQE index is not an isolated phenomenon, but a direct reflection of the synergistic optimization of the algorithm in this embodiment in terms of both physical model accuracy (background light, transmittance estimation) and post-processing enhancement rationality (color correction, contrast adjustment). This ensures that the enhanced image not only has better visual comfort, but also provides a more reliable data foundation for subsequent advanced visual tasks (such as object recognition and biological classification) that rely on color and texture information.

[0195] The UIQM metric is a quantitative indicator specifically designed to evaluate the quality of underwater images without reference. Based on the degradation mechanisms and imaging characteristics of underwater images, it employs three individual evaluation criteria: Underwater Image Colorfulness Measure (UICM), Underwater Image Sharpness Measure (UISM), and Underwater Image-Age Contrast Measure (UICONM). These are weighted and combined according to the parameters of a multiple linear regression to obtain an overall evaluation. Specifically, UICM assesses color recovery and richness, UISM measures edge and detail sharpness, and UICONM reflects tonal gradation and global contrast. Therefore, a higher UIQM value indicates that the algorithm can simultaneously and synergistically improve multiple core visual dimensions of the underwater image, avoiding sacrificing overall visual quality by over-optimizing a single attribute (such as over-sharpening leading to noise amplification or over-saturation leading to color distortion). A higher UIQM value indicates a better balance between enhancing the color, sharpness, and contrast of the image. Experimental results are shown in Table 3.

[0196] Table 3. Comparison of underwater color image quality assessment values ​​and their mean values ​​under different algorithms

[0197]

[0198] The algorithm proposed in this embodiment achieved the highest mean value (1.0977) on the UIQM metric among the six test images, significantly outperforming all comparison algorithms. This result demonstrates that the algorithm in this embodiment not only improves on individual image attributes but also achieves a better overall balance among colorfulness, sharpness, and contrast, thus exhibiting the best performance in overall visual quality.

[0199] The superior performance of this embodiment's algorithm on the UIQM metric can be attributed to the systematic and synergistic nature of its technical framework: In the color dimension: improved five-dimensional background light estimation and subsequent mixed white balance provide a more accurate benchmark for color correction, making the restored image colors more natural and rich, directly improving the UIQM metric score; In the sharpness dimension: based on the color line model and L... 1 / 2The regularly optimized transmittance map provides a more accurate estimate of scene depth and detail degradation. Combined with a post-processing workflow of TV denoising and bilateral filtering, it effectively dehazes while significantly preserving edge and texture details, thus greatly improving the UISM score. In terms of contrast, accurate transmittance estimation and the restoration model fundamentally reconstruct the scene's inherent contrast levels. Subsequent Retinex enhancement further optimizes local lighting, resulting in more natural transitions between light and dark areas and enhanced detail, collectively boosting the UICONM score.

[0200] In summary, the highest UIQM metric fully validates the effectiveness of the proposed algorithm in this embodiment—from improved background light estimation to a regularized transmittance optimization model and a systematic post-processing workflow—as a complete technical solution. It demonstrates that the algorithm can comprehensively improve the visual quality of underwater images in a highly coordinated manner. Its output not only better aligns with human visual preferences but also provides more ideal foundational data for downstream visual tasks that require simultaneous reliance on color, texture, and shape information (such as semantic segmentation and 3D reconstruction).

[0201] To systematically evaluate the actual contributions of each method used in post-processing in this embodiment, an ablation experiment was designed. This ablation experiment sequentially removed or disabled four key post-processing steps: linear blending white balance, Retinex enhancement, edge sharpening, and bilateral filtering, to observe their independent and combined effects on the final enhancement effect. The experimental results are shown in Table 4.

[0202] Table 4. Comparison of the impact of various post-processing methods on the image.

[0203]

[0204] The following conclusions can be drawn from analyzing the data in Table 4:

[0205] 1. The removal of multi-scale Retinex enhancement resulted in the most significant overall decline in all objective metrics (AG, UCIQE, UIQM), confirming its irreplaceable core role in reconstructing reasonable lighting and improving overall contrast. The absence of multi-scale Retinex enhancement directly leads to an overall "grayish" image and insufficient detail contrast.

[0206] 2. The removal of artifacts by bilateral filtering primarily leads to a significant decrease in the values ​​of the AG and UIQM indices, accompanied by an increase in noise and artifacts. This indicates that bilateral filtering is a key guarantee for achieving a balance between smoothing homogeneous regions and preserving important edges, thus ensuring high-quality output.

[0207] 3. The linear blending white balance method removes the main factors affecting the UCIQE index, resulting in a noticeable overall color cast in the image (such as a residual blue-green tint). This verifies that the linear blending white balance method is a necessary step for basic color correction and to make the image colors more natural.

[0208] 4. The removal of the adaptive sharpening method leads to a sharp drop in the average gradient, indicating a significant loss of image detail and texture sharpness. Adaptive sharpening, acting as a detail "amplifier," can effectively restore the microscopic contrast lost during degradation and restoration, but its direct impact on color and overall contrast is relatively small.

[0209] It should be noted that the above-described embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. An underwater image enhancement method based on an improved quadtree and the direction of the main color line, characterized in that, include: S1. The original underwater image is segmented by an improved quadtree image segmentation system to obtain image regions. The image regions are scored and filtered using a scoring mechanism. The background light value is obtained by solving the background light solution for the filtered image regions. S2. Obtain the direction of the main color line in the original underwater image. Establish a transmittance optimization objective function based on the direction of the main color line and the background light value. Obtain the global transmittance scalar by finding the optimal solution through the transmittance optimization objective function. S3. Obtain the initial transmittance map of the original underwater image based on the global transmittance scalar and background light value, and then perform post-processing on the initial transmittance map to obtain a three-channel transmittance map. S4. The original underwater image is restored using the three-channel transmittance map to obtain the restored underwater image. Image enhancement is then performed on the restored underwater image to obtain the enhanced underwater image.

2. The underwater image enhancement method based on an improved quadtree and the direction of the main color line according to claim 1, characterized in that, The original underwater image was segmented using an improved quadtree image segmentation system to obtain image regions. A scoring mechanism was used to score and filter the image regions, and the background light values ​​were obtained by solving the background light problem on the filtered image regions. S11. The original underwater image is segmented into 4 image regions using an improved quadtree image segmentation system. S12. Establish a scoring mechanism, use the scoring mechanism to score the four segmented image regions, and select the three image regions with the highest scores. Then, continue to use the improved quadtree image segmentation system to segment these three image regions, and use the scoring mechanism to select the segmented image regions. Repeat this process until the segmented image regions are smaller than the set threshold. S13. Collect the k image regions with the highest scores after segmentation, and obtain the background light value by averaging the k image regions according to their scores.

3. The underwater image enhancement method based on an improved quadtree and the direction of the main color line according to claim 1, characterized in that, The scoring mechanism consists of multiple scoring indicators, including ambiguity. Flatness Red light attenuation degree Texture complexity Color consistency , The expression for the scoring mechanism is: ; In the formula, The score for the image region, Indicates a sub-region. .

4. The underwater image enhancement method based on an improved quadtree and the direction of the main color line according to claim 3, characterized in that, To amplify the score differences between different image regions, the scoring mechanism needs to be non-linearly enhanced. The expression of the scoring mechanism after non-linear enhancement is as follows: 。 5. The underwater image enhancement method based on an improved quadtree and the direction of the main color line according to claim 1, characterized in that, The direction of the main color line in the original underwater image is obtained. A transmittance optimization objective function is established based on the main color line direction and the background light value. The optimal solution is obtained through the transmittance optimization objective function to obtain the global transmittance scalar, which includes: S21. Establish a covariance matrix by calculating the mean of global pixels in the original underwater image. Extract the maximum eigenvalue based on the covariance matrix and select the eigenvector corresponding to the maximum eigenvalue as the direction of the main color line in the original underwater image. S22. Based on the atmospheric scattering model, establish a linear equation according to the mathematical relationship between background light value, main color line direction and transmittance. S23, Introduce data fidelity items and The sparse regularization term, combined with auxiliary variables, transforms the linear equation into a transmittance optimization objective function. S24. Use the variable splitting strategy to decompose the transmittance optimization objective function into a first subproblem and a second subproblem, and use the alternating iteration method to find the optimal solution of the transmittance optimization objective function to obtain the global transmittance scalar.

6. The underwater image enhancement method based on an improved quadtree and the direction of the main color line according to claim 5, characterized in that, The expression for the transmittance optimization objective function is: ; In the formula, Let be the global transmittance scalar value to be determined, y be an auxiliary variable, and M be a matrix consisting of the direction of the primary color line and the background light value. The regularization coefficient is . express Norm.

7. The underwater image enhancement method based on an improved quadtree and the direction of the main color line according to claim 6, characterized in that, After obtaining the optimal solution of the transmittance optimization objective function using the alternating iteration method, the objective function converges, and its expression is: 。 8. The underwater image enhancement method based on an improved quadtree and the direction of the main color line according to claim 1, characterized in that, Post-processing the initial transmittance map yields a three-channel transmittance map, including: S31. Define the attenuation coefficient and calculate the transmittance of the red channel in the initial transmittance diagram based on the global transmittance scalar and the attenuation coefficient. S32. Perform numerical clipping on the transmittance of the red channel in the initial transmittance map to obtain the clipped initial transmittance map. S33. The initial transmittance map after cropping is smoothed and edge-preserving by using the total variation TV denoising method and the joint bilateral filtering method in sequence to obtain a three-channel transmittance map.

9. The underwater image enhancement method based on an improved quadtree and the direction of the main color line according to claim 8, characterized in that, The transmittance of the red channel in the initial transmittance map is numerically clipped, and the expression for this clipping is as follows: ; In the formula, t min The minimum transmittance is 0.05; t max The maximum transmittance is 0.

95.

10. The underwater image enhancement method based on an improved quadtree and the direction of the main color line according to claim 1, characterized in that, Methods for image enhancement of restored underwater images include: The overall color cast of the restored underwater image was corrected using the linear blending white balance method. The illumination and contrast of the restored underwater image were adjusted using the multi-scale Retinex enhancement method. By using adaptive sharpening to highlight and restore image details in underwater images; Noise in the restored underwater image was suppressed using bilateral filtering.