Underwater image restoration method based on polarization degree image clustering

By using polarization image clustering and adaptive optimization methods, the background and target regions of underwater images are automatically separated, solving the problems of unstable restoration effect and color distortion in complex underwater image environments, and achieving efficient image restoration results.

CN121481900APending Publication Date: 2026-02-06LANZHOU UNIVERSITY OF TECHNOLOGY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511800190.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-02
Publication Date
2026-02-06

AI Technical Summary

Technical Problem

Existing underwater image restoration methods suffer from unstable restoration results, color distortion, and reduced contrast in complex underwater environments. They are particularly ineffective in restoring target areas and rely on manual intervention to select background areas, which increases operational complexity.

Method used

A polarization-based image clustering method is adopted. By constructing an underwater imaging physical model, the polarization degree and polarization angle are calculated using Stokes vectors. Combined with K-means clustering and adaptive optimization methods, the background and target regions are automatically separated, and the image is restored by locally adaptively optimizing the gain term.

Benefits of technology

It achieves automatic separation of background and target areas without human intervention, improves image visibility and contrast, corrects color distortion, adapts to the complexity of different material scenes, and enhances image restoration results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121481900A_ABST
    Figure CN121481900A_ABST
Patent Text Reader

Abstract

An underwater image restoration method based on polarization degree image clustering belongs to the field of image processing, and comprises the following steps: constructing a physical model of underwater imaging; a polarization image is collected, a Stokes vector is calculated, and meanwhile the polarization degree and the polarization angle of the scene are calculated according to the Stokes vector; calculating a brightest polarization image and a darkest polarization image; performing coarse clustering and fine clustering on the polarization degree image, and separating a background region from a target region; and local adaptive optimization is carried out based on an adaptive optimization method of an evaluation index, and image restoration is carried out by using a gain item. The background area can be automatically selected without manual intervention; the back scattering value of each small block can be estimated and optimized in a robust mode through iteration based on evaluation given by the evaluation indexes, the target polarization degree and the background polarization degree of the image are adjusted according to block characteristics, and the recovery effect of the whole image is improved. According to the method, a clear underwater image can be recovered, the visibility and the contrast ratio of the image are improved, and color distortion is corrected at the same time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of image processing technology, specifically relating to an underwater image restoration method based on polarization degree image clustering. Background Technology

[0002] Clear underwater images play a crucial role in ship inspection, deep-sea archaeology, and marine rescue. However, during underwater operations, turbid water causes varying degrees of degradation in captured underwater images, making it impossible to obtain clear images. Water absorbs different wavelengths of light differently, resulting in color distortion in underwater images. Furthermore, suspended particles in the water exacerbate backscattering, reducing image contrast and visibility. These degradations increase dramatically with depth and water quality. Existing underwater image enhancement and restoration methods can be broadly categorized into three types: 1. Pixel-level enhancement methods; 2. Physical model-based restoration methods; and 3. Deep learning-based enhancement methods. Each type has its advantages and disadvantages. Among them, pixel-level enhancement methods are fast, but they are difficult to enhance severely degraded underwater images and are also difficult to accurately process images with severe color casts. Physical model-based restoration methods can simulate and build a physical model of image degradation based on the principles of underwater imaging, and then restore the underwater image before degradation based on the simulation of key parameters. This method can accurately restore the features of underwater scenes and adapt to images with different degradation characteristics. Deep learning-based enhancement methods have become a research hotspot in recent years. They require training on images before and after restoration of different underwater scenes. The trained model can perform image enhancement according to different degradation characteristics. However, this method requires a large dataset for training, and high-quality underwater images are difficult to obtain. In addition, this method has high requirements for computing power.

[0003] Physically based underwater image restoration methods are widely used in practice due to their good restoration results and fast execution speed. Polarization-based methods are also a type of physically based approach. Suspended particles in water scatter light propagating in the water, turning some natural light into polarized light. Polarization cameras can effectively filter or retain polarized light in a scene, capturing multiple polarized images simultaneously. Algorithms can then use these polarized images to effectively restore faded images. However, existing polarization-based methods require manual selection of the background region and only consider the polarization effect of the background while ignoring the polarization effect of the target. Some methods also rely on only a single weighting factor for parameter estimation, all of which have limitations to some extent.

[0004] Underwater imaging environments are far more complex than those on land, often resulting in color fading, reduced contrast, and image degradation. Polarization imaging can selectively preserve or filter polarized light in a scene, and numerous studies have shown that multiple polarization images can effectively restore degraded underwater images. However, many existing algorithms have the following limitations: First, many algorithms rely on manual intervention to select background areas, which not only increases operational complexity but also easily leads to unstable restoration results in dynamic or complex underwater scenes. Second, existing technologies often use a single global weighting factor, which may not yield optimal results in some complex images, especially in the restoration of target areas, leading to poor performance. Finally, existing technologies have not effectively addressed the color distortion problem in underwater images, particularly due to the absorption and scattering of different wavelengths of light by water, which causes color distortion and affects the realism of the image. Summary of the Invention

[0005] To address the problems of existing technologies, this invention provides an underwater image restoration method based on polarization degree image clustering. It aims to solve problems such as color fading, reduced contrast, and image degradation in underwater images, particularly optimizing the restoration effect for target and background regions. This invention incorporates some limitations of existing technologies, automatically clustering the background and target separately and adaptively optimizing the background light weight factor. Furthermore, this invention considers both background and target polarization effects, enabling more effective restoration of clear underwater images and possessing significant practical value.

[0006] The technical solution adopted by this invention to solve the technical problem is as follows:

[0007] This invention provides an underwater image restoration method based on polarization degree image clustering, comprising the following steps:

[0008] Step S1: Construct a physical model for underwater imaging;

[0009] Step S2: Acquire polarization images and calculate Stokes vectors, and simultaneously calculate the degree of polarization and polarization angle of the scene based on the Stokes vectors;

[0010] Step S3: Calculate the brightest polarization image and the darkest polarization image;

[0011] Step S4: Perform coarse and fine clustering on the polarization image to separate the background region from the target region;

[0012] Step S5: Perform local adaptive optimization based on the evaluation index and use the gain term for image restoration.

[0013] Furthermore, in step S1, the physical model of the underwater imaging is represented as follows:

[0014] (1)

[0015] (2)

[0016] (3)

[0017] in, For pixel position, This indicates the scene intensity captured by a regular camera, i.e., the degraded image; This indicates the direct illumination intensity of the target in the scene. Indicates the backscattering intensity in the scene. Indicates the intensity of a target that has not degraded; A transport graph representing a scene; It represents the light intensity at infinity.

[0018] Furthermore, in step S2, the formula for calculating the Stokes vector is:

[0019] (4)

[0020] (5)

[0021] (6)

[0022] in, , , Represents the Stokes vector. , , This represents images of the same scene taken by a polarizing camera at different polarization angles.

[0023] The formulas for calculating the degree of polarization and the polarization angle are as follows:

[0024] (7)

[0025] (8)

[0026] in, This represents the polarization degree image of the image. This represents the polarization angle image of the image. This represents the three color channels of the image.

[0027] Furthermore, in step S3, the calculation formulas for the brightest polarization image and the darkest polarization image are as follows:

[0028] (9)

[0029] (10)

[0030] Will and It can be represented in the following form:

[0031] (11)

[0032] (12)

[0033] in, for and linear superposition, Indicates the degree of polarization of the image. Indicates the maximum target reflection intensity. Indicates the minimum target reflection intensity. Indicates the maximum backscattering intensity. This represents the minimum backscattering intensity.

[0034] Further, in step S4, the K-means clustering algorithm is used to perform coarse clustering on the polarization image. Taking the polarization image as input, the total number of clusters is set to 2, which will generate a coarse clustering image, in which one cluster is the background and the other is the target. The coarse clustering image is then binarized into a binary image, retaining the largest connected component in the image, that is, only keeping the largest white connected component, while discarding the second largest and smaller white connected components and converting them to black. The binary image is then inverted, swapping the target region and the background region, retaining the largest connected component in the image, that is, only keeping the largest white connected component, while discarding the second largest and smaller white connected components and converting them to black. The resulting image is called a mask. Finally, the mask is inverted again to cancel out the previous inversion operation.

[0035] Furthermore, in step S4, the method based on region variance uses variance prior to further process the clustering results to automatically select the background region; the mask is multiplied with the darkest polarization image to obtain region 1, and the mask is inverted and multiplied with the darkest polarization image to obtain region 2; the variance of the non-black parts in region 1 and region 2 is calculated respectively; the region with smaller variance is determined as the background region, and the region with larger variance is the target region; after confirming the background region in the scene, the mask is used to extract it; the mask is applied to the brightest polarization image and the darkest polarization image and the average value is taken to obtain the initial average intensity of the background region, that is, the average backscattering intensity of the background region.

[0036] Furthermore, in step S5, the specific implementation process of the adaptive optimization method based on evaluation indicators is as follows:

[0037] S5.1: Image block division and gain term initialization;

[0038] The image is divided into multiple small blocks, and the optimal parameters are calculated iteratively for each block. The gain term K is initialized and traversed, and the average backscattering intensity of each block is calculated using the gain term K.

[0039] S5.2: Calculate the direct irradiation intensity of each small block using the average backscattering intensity of each small block;

[0040] S5.3: Introduce EME and IE as evaluation criteria to evaluate the direct irradiation intensity of each small block; during the traversal of gain term K, record the gain term K that gives the highest score to these two evaluation indicators;

[0041] S5.4: After traversing the gain term K, each small block obtains an optimal gain term K, and these optimal gain terms K are combined into a K-value matrix; the K-value matrix is ​​smoothed by a median filter;

[0042] S5.5: Recombining the optimal backscattering intensities of all small blocks to form and The backscattering intensity is calculated for the brightest and darkest conditions of the entire polarized image. The sum of these two values ​​is then filtered using a guided filter to obtain the global backscattering intensity. ;

[0043] S5.6: Utilizing the optimized backscattering intensity and Calculate the direct illumination intensity of the entire polarized image under the brightest and darkest conditions. and Based on these calculation results, the global target polarization degree is calculated. and background polarization ;

[0044] S5.7: Image restoration;

[0045] The global direct illumination intensity is calculated by combining the backscattering intensity and direct illumination intensity of the brightest and darkest polarized images, as well as the global target polarization and background polarization. and backscattering intensity Then, the target signal light is obtained based on the underwater polarization imaging model.

[0046] Furthermore, in step S5.6, the direct illumination intensity of the entire polarized image under the brightest and darkest conditions is calculated using formulas (11) and (12). and :

[0047] (11)

[0048] (12)

[0049] in, for and linear superposition, Indicates the degree of polarization of the image. Indicates the maximum target reflection intensity. Indicates the minimum target reflection intensity. Indicates the maximum backscattering intensity. This represents the minimum backscattering intensity.

[0050] Furthermore, in step S5.6, the global target polarization degree is calculated using formulas (13) and (14). and background polarization :

[0051] (13)

[0052] (14).

[0053] Furthermore, the global direct irradiation intensity The formulas for calculating the backscattering intensity B(x,y) are as follows:

[0054] (17)

[0055] (18)

[0056] in, An identity matrix of the same dimension The brightest polarized image, This is the darkest polarized image.

[0057] The beneficial effects of this invention are:

[0058] This invention provides an underwater image restoration method based on polarization degree image clustering, which can restore clear underwater images, recover from light decay caused during propagation, improve image visibility and contrast, and simultaneously correct color distortion. Compared with existing technologies, this invention has the following advantages:

[0059] 1. This invention proposes a method for detecting background without prior knowledge, which can automatically select the background region by clustering polarization images, making it possible without human intervention.

[0060] 2. This invention proposes a method for block-based optimization of the gain parameter K. Based on the evaluation index, the backscattering value of each block can be robustly estimated and optimized through iteration. This allows the target polarization degree, background polarization degree, and a series of subsequent parameters of the image to be adjusted according to the characteristics of the blocks, thereby further improving the overall image restoration effect.

[0061] 3. This invention can fully utilize the valuable polarization information captured by polarization images and recover details in fading underwater images based on this information. At the same time, because this invention adopts a local block parameter optimization method, it can more robustly adapt to scene images with different materials, effectively improving the visibility and usability of underwater fading images in near-shallow waters. Attached Figure Description

[0062] Figure 1 The present invention provides an overall flowchart of an underwater image restoration method based on polarization degree image clustering.

[0063] Figure 2 The input is the polarization degree image, and the output is the coarse clustering image.

[0064] Figure 3 coarse clustering Figure 2 Value-modified graph and the largest connected component that retains only the value 1 (white part).

[0065] Figure 4 The image obtained by inverting the binarized image (there is still small white noise in the black area) and the image obtained by inverting it again to cancel the previous inversion operation (after filtering out the small white noise, it is inverted again, and at this time the whole image has only two connected components, namely black and white).

[0066] Figure 5 Mask and darkest polarized image The multiplied region 1 and the inverted mask are then compared with the darkest polarized image. Multiplying them together yields region 2.

[0067] Figure 6 To successfully identify the background area in this scene. Detailed Implementation

[0068] The present invention will be further described in detail below with reference to the accompanying drawings.

[0069] like Figure 1 As shown, the present invention provides an underwater image restoration method based on polarization degree image clustering. First, multiple polarization images are directly captured using a polarization camera. These polarization images are formed relative to the horizontal direction (…). The images were taken from different angles using a rotating polarizing filter. , and This invention comprises three polarization images. Images captured directly underwater by polarization cameras often exhibit problems such as decreased contrast, color distortion, and image quality degradation. Using these polarization images, the degree of polarization and polarization angle are calculated using Stokes vectors. Clustering is then performed on the polarization degree matrix, roughly dividing the polarization degree image matrix into multiple regions. Based on this, the target and background regions are refined using the maximum connected component method. The average intensity value of the background region is then calculated. Then, the target polarization degree is included in the calculation while considering the background polarization degree, enabling more targeted removal of backscattering from the target region and improving its contrast. This invention proposes a local block constraint based on evaluation metrics. The image is divided into m×m blocks, and the weight factor k for each block is found using EME and IE evaluation metrics to refine the backscattering intensity of each block. Then, the K-value matrix composed of the weight factors k for each block is smoothed by median filtering. Finally, the optimal target and background polarization degrees for each small block are obtained according to this constraint. These parameters can be used to effectively and robustly recover decaying underwater images.

[0070] The present invention provides an underwater image restoration method based on polarization degree image clustering, the specific implementation process of which is as follows:

[0071] Step S1: Construct a physical model for underwater imaging;

[0072] The physical model of underwater imaging is based on the principle of light propagation and scattering. The imaging process of underwater images can be divided into two parts: one part is the image produced by the direct illumination intensity of the target, and the other part is the backscattering intensity caused by suspended particles in the water.

[0073] (1) Direct Illumination Intensity: Direct illumination intensity refers to the light emitted or reflected by the target itself. The quality of underwater images largely depends on the degree of light reflection by the target. The reflective properties of the target surface, the distance between the target and the camera, the intensity of the light source, and the transmittance of the water all affect this intensity. As the distance between the target and the imaging device increases, the intensity of direct illumination light decreases as transmittance decreases. The reflectivity of the target is one of the key factors affecting image quality.

[0074] (2) Backscattering intensity: Suspended particles in water refract and scatter light, especially as water depth or target distance increases, the scattering effect becomes more significant. The changes in light caused by these suspended particles are called backscattering intensity. Backscattering introduces background light into the image, reducing the contrast and sharpness of underwater images. Due to the scattering effect of water, objects in the water become blurred, and the influence of background light intensity on the image cannot be ignored.

[0075] The intensity of background light typically originates from distant light sources, the influence of which gradually diminishes with increasing distance. The scattered light portion of underwater images is formed through the interaction of this background light with particles in the water.

[0076] (3) Total image intensity: The total intensity of an underwater image is composed of the superposition of the direct illumination intensity of the target and the backscattering intensity. Specifically, an underwater image includes the intensity of light reflected by the target and the intensity of scattered light propagating through the water. These two parts together determine the imaging effect of the underwater image, including the image's color, contrast, and sharpness.

[0077] In summary, the physical model for underwater imaging can be expressed as:

[0078] (1)

[0079] in, For pixel position, This indicates the scene intensity captured by a regular camera, which is the image directly taken by a regular camera; it is a degraded image. This indicates the direct illumination intensity of the target in the scene. Represents the backscattering intensity in the scene, where and It can be represented in the following form:

[0080] (2)

[0081] (3)

[0082] in, This indicates the intensity of the target, which is also the image that this invention ultimately aims to recover; The perspective of a scene is determined by the increase in water depth and the distance between the subject and the imaging plane. Decrease; It represents the intensity at infinity.

[0083] Step S2: Polarization image acquisition and Stokes vector calculation;

[0084] In this invention, a polarization camera is used to capture a set of polarization images, which are polarized relative to the horizontal direction ( Images were taken by rotating a polarizing filter to different angles. Common shooting angles include... , and And options to choose from These polarization images will serve as input data. From this set of polarization images, the Stokes vector can be calculated, which describes the polarization state of light, including the degree of polarization and the angle of polarization.

[0085] Specifically, Stokes vectors are composed of images taken at different angles. By calculating the image intensity at different polarization angles, the degree of polarization and polarization angle are extracted, thus obtaining the polarization degree image of the underwater image. These polarization degree images will serve as the basis for subsequent processing, used for the separation and restoration of the target area and background area.

[0086] Specifically, a set of three or four polarized images can be directly captured by a polarization camera. This set of polarized images is polarized relative to the horizontal direction ( The images were taken from different angles using a rotating polarizing filter. , and Three (or more) The image consists of four polarization images. This set of polarization images will serve as the input to this invention. Using these polarization images, the corresponding Stokes vector can be calculated. The specific calculation formula is as follows:

[0087] (4)

[0088] (5)

[0089] (6)

[0090] in, , , Represents the Stokes vector. , , Indicates different polarization angles captured by a polarizing camera ( , and Images in the same scene.

[0091] Then, the degree of polarization and polarization angle of the scene are calculated based on the Stokes vector. The specific calculation formula is as follows:

[0092] (7)

[0093] (8)

[0094] in, This represents the polarization degree image of the image. This represents the polarization angle image of the image. This represents the three color channels of the image.

[0095] Step S3: Calculation of the brightest and darkest polarization images;

[0096] In polarization imaging, the effectiveness of image restoration depends on extracting the brightest and darkest polarization images from the polarization imagery. The brightest and darkest images represent the maximum and minimum values ​​of light polarization, and each polarization image captured from multiple angles contains light intensity information at different angles. By comparing the light intensity of each pixel at different polarization angles, the maximum and minimum light intensities can be extracted.

[0097] S3.1: Calculate the brightest polarization image;

[0098] The maximum light intensity of each pixel across all polarization angles is selected to form the brightest polarized image. This brightest polarized image reflects the region of strongest polarized light in the scene and is typically used to enhance the light intensity of a target area, making the target more prominent.

[0099] S3.2: Calculate the darkest polarization image;

[0100] The darkest polarized image is formed by selecting the minimum light intensity of each pixel across all polarization angles. This darkest polarized image reflects the weakest polarized light in the scene and is typically used to optimize the restoration of background areas and reduce the effects of over-enhancement.

[0101] Specifically, based on the polarization degree image The brightest polarized image in this scene can be calculated. and the darkest polarized image This step replaces manually rotating the polarizing filter to select the brightest and darkest angles. The specific calculation formula is as follows:

[0102] (9)

[0103] (10)

[0104] In polarization imaging, and The linear superposition of the light intensity can be expressed as the total light intensity. ;also, and It can also be represented in the following form:

[0105] (11)

[0106] (12)

[0107] Among them, subscript and These represent the brightest and darkest images of the target or background captured by the rotating polarizing filter in that scene. Indicates the degree of polarization of the image. Indicates the maximum target reflection intensity. Indicates the minimum target reflection intensity. Indicates the maximum backscattering intensity. This represents the minimum backscattering intensity.

[0108] Step S4: Polarization degree image clustering and background / target region separation;

[0109] Building upon polarization imaging, this invention employs a clustering algorithm to process polarization degree images, automatically separating target and background regions. Polarization degree images reflect the degree of light polarization, effectively revealing the optical characteristics of different areas within a scene. By performing clustering analysis on the polarization degree images, target and background regions can be automatically identified, providing precise region segmentation for subsequent image restoration processing.

[0110] Step S4.1: Clustering characteristic analysis of polarization degree images;

[0111] This invention, through extensive experimentation, reveals that polarization images within a scene exhibit strong clustering properties across different regions, enabling the grouping of similar areas into a single class. Specifically, target and background regions within a scene often display significant differences in polarization. The background region typically possesses a relatively uniform polarization, while the polarization of the target region varies depending on the surface material and lighting conditions. Therefore, a clustering algorithm can be used to divide the polarization image into two main regions: the background and the target.

[0112] Step S4.2: K-means clustering algorithm;

[0113] This invention employs the K-means clustering algorithm for automatic segmentation of polarization images. K-means clustering is a classic unsupervised learning method that can classify data into multiple categories based on its features. In this invention, the K-means clustering algorithm is used to divide the polarization image into two categories: background and target. The polarization image is then segmented... As input to the K-means clustering algorithm, K-means clustering is performed on it. By setting the total number of clusters to 2, a coarse clustering graph is generated, where one cluster represents the background and the other represents the target cluster. Figure 2 Taking the left image as an example, the output image after coarse clustering is: Figure 2 The image on the right shows how K-means clustering roughly divides the polarization image into two distinct regions, representing the target and background regions, respectively. However, multiple connected components exist, requiring further processing of the coarse clustering image.

[0114] During the clustering process, each pixel in the polarization image is assigned to the nearest category based on its polarization value. In this way, the entire image is divided into two main categories: one representing the background region and the other representing the target region.

[0115] Step S4.3: Coarse clustering and fine clustering;

[0116] While the initial clustering results of the K-means clustering algorithm can roughly divide the image into target and background regions, some connected component issues remain. To further optimize the clustering effect, this invention performs post-processing on the coarse clustering results. The specific operations are as follows:

[0117] S4.3.1: Binarization processing;

[0118] First, the coarse clustering image is binarized using a binarization function, converting it into a binary image, i.e., a black and white image. Binarization clearly distinguishes the target region from the background region.

[0119] S4.3.2: Connected component analysis;

[0120] Next, connected component analysis is performed, retaining only the largest white connected component in the image, while discarding the second largest and smaller white connected components and converting them to black. The purpose of this step is to remove smaller and irrelevant connected regions from the image, ensuring more accurate clustering results.

[0121] Since the image after coarse clustering is relatively coarse, it needs further binarization to completely segment the coarse clustering image into regions with only two connected components. For example, the coarse clustering... Figure 2 Value-based Figure 3 After (left image), only the largest connected component with a value of 1 (white part) is retained, and the parts with a value of 1 but not the largest connected component are assigned a value of 0. Figure 3 (Right image).

[0122] S4.3.3: Invert operation;

[0123] Within the regions with a value of 1 (white area), there are also many smaller black spot areas, which can be considered noise. To further optimize the results, the binarized image ( Figure 3 (Right image) The inversion operation is equivalent to taking the complement; the black and white conversion is equivalent to swapping the target area and the background area. Figure 4 (Left image), perform connected component analysis again. Finally, retain the largest connected component in the image, that is, only keep the largest white connected component; discard the second largest and smaller white connected components and convert them to black. Perform a negation operation again to cancel out the previous negation operation (…). Figure 4 (Right image).

[0124] Through the above steps, the coarse clustering graph is finally transformed into a refined clustering graph. In this refined clustering graph, there are only two connected components (one black and one white), and this image is called a mask. Figure 4 (Left image). However, at this point, it is impossible to determine which area is the target area and which is the background area.

[0125] Step S4.4: Identification of background and target regions;

[0126] After fine clustering, the next goal is to identify the target region and the background region. In this invention, the main difference between the target region and the background region lies in their polarization degree. The background region usually exhibits a relatively uniform and low-contrast area due to a strong backscattering effect, while the target region typically has high detail richness and a larger difference in polarization degree.

[0127] To accurately identify target and background regions, this invention proposes a region variance-based method. This method utilizes variance priors to further process clustering results and automatically select background regions. Background regions typically have lower variance, while target regions, due to their greater detail and lower backscattering intensity, exhibit higher variance. Therefore, by calculating the variance of different regions, it is possible to effectively determine which regions belong to the background and which belong to the target. Specifically:

[0128] S4.4.1: Set the mask ( Figure 4 (Left image) and the darkest polarization image Multiplying them together gives region 1 ( Figure 5 (Left image), after inverting the mask ( Figure 4 (Right image) and the darkest polarization image Multiplying them together gives region 2 ( Figure 5 (Right image)

[0129] S4.4.2: Calculate the variance of the non-black portions in region 1 and region 2 respectively;

[0130] S4.4.3: Areas with lower variance are identified as background areas, while areas with higher variance are identified as target areas. This is because in murky water, background areas lose most of their details due to strong backscattering, resulting in lower variance. Target areas, while also affected by backscattering, retain more detail compared to the background areas, hence their higher variance. Therefore, the background areas in this scene can be identified and extracted using a mask, such as... Figure 6 As shown.

[0131] Step S4.5: Calculate the average intensity of the background and target;

[0132] Once the target region and background region are successfully distinguished, the next step in this invention is to calculate the average intensity of these two regions. The goal of this step is to determine the typical light intensity of each region, which will serve as the basis for subsequent image restoration. The average intensity of the target region and background region is calculated separately and used as the basis for estimating illumination intensity during the subsequent restoration process.

[0133] Specifically, the mask can be applied to the brightest polarized image. and the darkest polarized image The average value is taken to obtain the average intensity of the initial background region, which is the average backscattering intensity of the background region.

[0134] Step S5: Local adaptive optimization and image restoration;

[0135] This invention proposes an adaptive optimization method based on an evaluation index to calculate the optimal value of the gain term K, and then uses this gain term for image restoration. The specific steps are as follows:

[0136] Step S5.1: Image block division and gain term initialization;

[0137] First, the image is divided into m×m blocks, and the optimal parameters are calculated iteratively for each block. Specifically, in each block, the initial value of the gain term K is set to 0.1. Then, the value of the gain term K is iterated through, ranging from 0.1 to 1, adjusted in steps of 0.01. During this iteration, the gain term K is multiplied by the previously calculated average backscattering intensity of the background region to obtain the background light intensity of the current block. and This allows us to obtain the average backscattering intensity of the current block.

[0138] Step S5.2: Calculation of direct irradiation intensity;

[0139] The direct illumination intensity of a small patch can be obtained by calculating the average backscattering intensity of each patch and subtracting the corresponding average backscattering intensity from the total intensity of that patch. Then, based on these calculated direct illumination intensities, the target polarization degree and background polarization degree of that patch can be further calculated.

[0140] Step S5.3: The process of using and optimizing evaluation indicators;

[0141] To select the optimal gain term K, this invention introduces EME (Enhanced Image Contrast and Detail) and IE (Information Evaluation Metric) as evaluation criteria to assess the direct illumination intensity of each small block. During the iteration of gain term K, the gain term K that yields the highest scores on both evaluation metrics is recorded and saved. This method ensures that the gain term K for each small block is optimized, thereby improving the overall image quality.

[0142] Step S5.4: Generation and smoothing of the optimal gain term matrix;

[0143] After traversing the gain term K, each small block will obtain an optimal gain term K value, and these optimal gain terms form a K-value matrix. Since the gain term of each small block is calculated independently, the K-value matrix needs to be smoothed by a median filter to eliminate local fluctuations and ensure the continuity and smoothness of the image restoration process.

[0144] Step S5.5: Calculate the backscattering intensity of the brightest and darkest polarized images;

[0145] After optimizing the gain term, it is considered that the optimal backscattering intensity for the m×m block has been found. and This invention recombines the optimal backscattering intensities of all small blocks to form and The backscattering intensity is calculated for the brightest and darkest conditions of the entire polarized image. The sum of these two values ​​is then filtered using a guided filter to obtain the global backscattering intensity. .

[0146] Step S5.6: Calculation of target polarization degree and background polarization degree;

[0147] Using the optimized backscattering intensity, the direct illumination intensity of the entire polarization image under the brightest and darkest conditions can be calculated using formulas (11) and (12). and Next, based on these calculation results, the global target polarization degree can be further calculated using formulas (13) and (14). and background polarization .

[0148] Specifically, target polarization degree and background polarization They can be represented as follows:

[0149] (13)

[0150] (14)

[0151] Combining formulas (9) and (10), the following formula can be derived:

[0152] (15)

[0153] (16)

[0154] Step S5.7: Image restoration;

[0155] Finally, through the above optimization steps, combining the backscattering intensity and direct illumination intensity of the brightest and darkest polarized images, as well as the global target polarization and background polarization, and combining formulas (15) and (16), the global direct illumination intensity is calculated using formula (17). and backscattering intensity The target signal light can be obtained based on the underwater polarization imaging model (formula (1)).

[0156] (17)

[0157] (18)

[0158] in, It is an identity matrix of the same dimension.

[0159] In this invention, since the backscattering intensity has been optimized, the transmission map can be approximately calculated using the following formula:

[0160] (19)

[0161] Next, the restored image can be obtained by reverse calculation using formula (2), thus realizing the restoration of the underwater image. In the post-processing stage, the restored image can be white-balanced to eliminate the additional color distortion caused during the restoration process.

[0162] This invention provides an underwater image restoration method based on polarization degree image clustering, which automatically distinguishes between background and target regions without manual intervention, solving the problem of background region selection in existing methods. Simultaneously, this invention proposes a block image weight factor optimization method based on evaluation index constraints, avoiding the use of global single-value weight factors. This method can better adapt to the characteristics of local regions when processing complex images, significantly improving the restoration effect of the target region. Finally, this invention introduces a color correction method based on color constancy, which can effectively eliminate color distortion caused by the absorption and scattering of light of different wavelengths by water, significantly improving the color naturalness of the restored image. Experiments show that this invention can effectively restore underwater faded images and outperforms existing methods in terms of generalization ability and restoration effect.

[0163] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. An underwater image restoration method based on polarization degree image clustering, characterized in that, Includes the following steps: Step S1: Construct a physical model for underwater imaging; Step S2: Acquire polarization images and calculate Stokes vectors, and simultaneously calculate the degree of polarization and polarization angle of the scene based on the Stokes vectors; Step S3: Calculate the brightest polarization image and the darkest polarization image; Step S4: Perform coarse and fine clustering on the polarization image to separate the background region from the target region; Step S5: Perform local adaptive optimization based on the evaluation index and use the gain term for image restoration.

2. The underwater image restoration method based on polarization degree image clustering according to claim 1, characterized in that, In step S1, the physical model of the underwater imaging is represented as follows: (1) (2) (3) in, For pixel position, This indicates the scene intensity captured by a regular camera, i.e., the degraded image; This indicates the direct illumination intensity of the target in the scene. Indicates the backscattering intensity in the scene. Indicates the intensity of a target that has not degraded; A transport graph representing a scene; It represents the light intensity at infinity.

3. The underwater image restoration method based on polarization degree image clustering according to claim 1, characterized in that, In step S2, the formula for calculating the Stokes vector is: (4) (5) (6) in, , , Represents the Stokes vector. , , This represents images of the same scene taken by a polarizing camera at different polarization angles. The formulas for calculating the degree of polarization and the polarization angle are as follows: (7) (8) in, This represents the polarization degree image of the image. This represents the polarization angle image of the image. This represents the three color channels of the image.

4. The underwater image restoration method based on polarization degree image clustering according to claim 1, characterized in that, In step S3, the calculation formulas for the brightest polarization image and the darkest polarization image are as follows: (9) (10) Will and It can be represented in the following form: (11) (12) in, for and linear superposition, Indicates the degree of polarization of the image. Indicates the maximum target reflection intensity. Indicates the minimum target reflection intensity. Indicates the maximum backscattering intensity. This represents the minimum backscattering intensity.

5. The underwater image restoration method based on polarization degree image clustering according to claim 1, characterized in that, In step S4, the K-means clustering algorithm is used to coarsely cluster the polarization image. Using the polarization image as input, and setting the total number of clusters to 2, a coarse clustering image is generated, where one cluster represents the background and the other the target. The coarse clustering image is then binarized into a binary image, retaining only the largest white connected component and discarding the second largest and smaller white connected components, converting them to black. The binary image is then inverted, swapping the target and background regions, retaining only the largest white connected component and discarding the second largest and smaller white connected components, converting them to black. The resulting image is called a mask. Finally, the mask is inverted again to cancel out the previous inversion operation.

6. The underwater image restoration method based on polarization degree image clustering according to claim 5, characterized in that, In step S4, the method based on region variance uses variance prior to further process the clustering results to automatically select the background region; the mask is multiplied with the darkest polarization image to obtain region 1, and the mask is inverted and multiplied with the darkest polarization image to obtain region 2; the variance of the non-black parts in region 1 and region 2 is calculated respectively. Regions with smaller variance are identified as background regions, while regions with larger variance are identified as target regions. After identifying the background regions in the scene, a mask is used to extract them. The mask is applied to the brightest and darkest polarized images, and the average value is taken to obtain the initial average intensity of the background region, which is the average backscattering intensity of the background region.

7. The underwater image restoration method based on polarization degree image clustering according to claim 1, characterized in that, In step S5, the specific implementation process of the adaptive optimization method based on evaluation indicators is as follows: S5.1: Image block division and gain term initialization; The image is divided into multiple small blocks, and the optimal parameters are calculated iteratively for each block. The gain term K is initialized and traversed, and the average backscattering intensity of each block is calculated using the gain term K. S5.2: Calculate the direct irradiation intensity of each small block using the average backscattering intensity of each small block; S5.3: Introduce EME and IE as evaluation criteria to evaluate the direct irradiation intensity of each small block; during the traversal of gain term K, record the gain term K that gives the highest score to these two evaluation indicators; S5.4: After traversing the gain term K, each small block obtains an optimal gain term K, and these optimal gain terms K are combined into a K-value matrix; the K-value matrix is ​​smoothed by a median filter; S5.5: Recombining the optimal backscattering intensities of all small blocks to form and The backscattering intensity is calculated for the brightest and darkest conditions of the entire polarized image. The sum of these two values ​​is then filtered using a guided filter to obtain the global backscattering intensity. ; S5.6: Utilizing the optimized backscattering intensity and Calculate the direct illumination intensity of the entire polarized image under the brightest and darkest conditions. and ; Based on these calculation results, the global target polarization degree is calculated. and background polarization ; S5.7: Image restoration; The global direct illumination intensity is calculated by combining the backscattering intensity and direct illumination intensity of the brightest and darkest polarized images, as well as the global target polarization and background polarization. and backscattering intensity Then, the target signal light is obtained based on the underwater polarization imaging model.

8. The underwater image restoration method based on polarization degree image clustering according to claim 7, characterized in that, In step S5.6, the direct illumination intensity of the entire polarization image under the brightest and darkest conditions is calculated using formulas (11) and (12). and : (11) (12) in, for and linear superposition, Indicates the degree of polarization of the image. Indicates the maximum target reflection intensity. Indicates the minimum target reflection intensity. Indicates the maximum backscattering intensity. This represents the minimum backscattering intensity.

9. The underwater image restoration method based on polarization degree image clustering according to claim 7, characterized in that, In step S5.6, the global target polarization degree is calculated using formulas (13) and (14). and background polarization : (13) (14)。 10. The underwater image restoration method based on polarization degree image clustering according to claim 7, characterized in that, The global direct irradiation intensity and backscattering intensity The calculation formulas are as follows: (17) (18) in, An identity matrix of the same dimension The brightest polarized image, This is the darkest polarized image.