A Single Underwater Image Enhancement Method Based on Dark Channel Low-Rank Prior

By employing a low-rank prior method in the dark channel, combined with color correction and segmentation techniques, transmittance and water light are accurately estimated, solving the problems of block artifacts and inaccurate transmittance in underwater image enhancement and achieving better image enhancement results.

CN116523772BActive Publication Date: 2026-03-06DALIAN MARITIME UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-04
Publication Date
2026-03-06

AI Technical Summary

Technical Problem

Existing underwater image enhancement algorithms suffer from block artifacts and white borders when processing underwater images, and inaccurate transmittance estimation leads to unsatisfactory enhancement results.

Method used

A method based on dark channel low-rank prior is adopted. Through color correction preprocessing, dark channel low-rank completion model and atmospheric scattering model, combined with ADMM algorithm and quadtree segmentation technology, the transmittance and water light are accurately estimated, the foreground and background regions are separated, and the image is enhanced.

Benefits of technology

It improves the enhancement of underwater images, reduces blockiness and white edges, and enhances image clarity and color accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116523772B_ABST
    Figure CN116523772B_ABST
Patent Text Reader

Abstract

This invention provides a single-image underwater image enhancement method based on a low-rank prior for dark channels, comprising: acquiring the underwater image to be processed; renaming the three channels of the image sequentially according to the pixel mean of each channel of the underwater image; obtaining a corrected image based on a color correction preprocessing method; constructing a low-rank completion model for dark channels to obtain a dark channel image; calculating the transmittance of the corrected image based on the dark channel image information; segmenting the dark channel image using the big rule method to separate the foreground and background regions, thereby obtaining a segmented image; iteratively segmenting the image using a quadtree method, recording the position of the candidate sub-region with the highest score when the stopping condition is met, and using the pixel mean of the corresponding position region of each channel in the corrected image as the water light; and obtaining the enhanced underwater image by inversion using an atmospheric scattering model. This invention can obtain more accurate transmittance and water light, improve problems such as color cast and blurring in underwater images, and enhance the underwater image enhancement effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of underwater image processing technology, and more particularly to a method for enhancing a single underwater image based on a low-rank prior in the dark channel. Background Technology

[0002] Human exploration of marine resources continues to unveil the mysteries of the deep sea. Due to the complex and ever-changing marine environment, the absorption and scattering of light by water leads to problems such as blurriness, low contrast, and color distortion in captured underwater images, posing a significant challenge to underwater image enhancement technology. The Dark Channel Prior (DCP) haze removal algorithm and its variants are a powerful and classic branch of image dehazing algorithms, but directly applying them to underwater image enhancement has not yielded significant results. Existing algorithms are constrained by the size of the local sliding window, resulting in block artifacts in the calculated dark channel and white edges in the enhanced image. Currently, researchers mostly use edge-preserving guided filters to overcome these problems, but the transmittance estimated by this method is still relatively coarse. Furthermore, the global atmospheric light estimated in the DCP algorithm is often biased due to the influence of bright objects in the image, leading to unsatisfactory image enhancement results.

[0003] Low-rank matrix recovery aims to reconstruct the entire matrix using limited known information and the correlations between these pieces of information. Low-rank matrix completion is one of the classic models for low-rank matrix recovery. Statistically, 75% of the pixels in the dark channel have a value of 0, typically exhibiting very little detail and texture, with large areas being black; in other words, it is low-rank or approximately low-rank. Summary of the Invention

[0004] To address the aforementioned technical problems, this invention discloses a single-image underwater image enhancement method based on a low-rank prior in the dark channel, specifically comprising the following steps:

[0005] Acquire underwater images to be processed:

[0006] The three channels of the underwater image are renamed sequentially based on the average pixel value of each channel, and the corrected image is obtained based on the color correction preprocessing method.

[0007] A certain proportion of dark pixels are selected in the corrected image to obtain a sample point image. A low-rank completion model for the dark channel is constructed based on the linear relationship within the dark pixels in the sample point image. The ADMM algorithm is used to complete the remaining proportion of pixels to obtain the dark channel image. The transmittance of the corrected image is calculated based on the dark channel image information.

[0008] The dark channel image is segmented using the large law method to separate the foreground and background regions, and the pixel values ​​of the background region are all set to 0 to obtain the segmented image;

[0009] The quadtree method is used to divide the segmented image into four equal-sized sub-regions. Each sub-region is scored according to the number of background points it contains. The region with the highest score is selected as a candidate region and further segmented. The position of the sub-region with the highest score when the iteration stops is recorded. The pixel mean of the corresponding sub-region in each channel of the corrected image is used as the water light.

[0010] Enhanced underwater images are obtained by inversion using an atmospheric scattering model based on transmittance and water light information.

[0011] Furthermore, assuming that the average values ​​of the RGB components in the underwater image tend to the same grayscale value K, the three channels of the underwater image are named, in order, large color channel, medium color channel, and small color channel based on the magnitude of the average pixel values ​​of the three channels. Using the average value of the large color channel, which exhibits the least attenuation, as the benchmark, the grayscale value K is set to... Perform color compensation on the mid-color channel and the small-color channel separately:

[0012]

[0013] Where C is the coefficient matrix. These are the average values ​​of the large color channel, medium color channel, and small color channel, respectively. lms For the images after compensation of the medium and small color channels respectively, I CR This is the color-corrected image. These are the gradients of the image in two directions, respectively.

[0014] Furthermore, a sliding window Ω is set with any single pixel x in the image as the center. The lowest pixel value in the sliding window Ω centered on x is named the dark pixel of x. A certain proportion of dark pixels are randomly selected from the image to obtain the sample point image.

[0015] Furthermore, based on the linear relationships existing within the selected dark pixels, a low-rank completion model for the dark channel is constructed to estimate the dark channel:

[0016]

[0017] Where ψ is the set of selected dark pixels, P ψ (·) is a linear mapping that guarantees that the pixel values ​​of elements within the set ψ remain unchanged, while the values ​​of other pixels are 0. dark f(J) is the nuclear norm, which is the relaxation function of the rank function, i.e., f(J) dark )=||J dark || * =∑ i σ i (J dark );

[0018] The ADMM algorithm is used to solve the objective function (2), and the auxiliary variable Y = P is introduced. ψ (J dark ), initialization parameters Y 0 ε = 10 -6 β = 10 -4 And the number of iterations k = 0;

[0019] Then the augmented Lagrangian function of objective function (2) is:

[0020]

[0021] Where γ is the Lagrange dual variable, and β > 0 is the penalty factor;

[0022] In fixed form (3), Y k and γ k Two variables, then J dark The formula for the (k+1)th iteration is:

[0023]

[0024] Where D λ (X) is the singular value threshold operator of a matrix, if X = U∑V T ,but

[0025] D λ (X)=U sgn(∑)max(|∑|-λ,0)V T (5)

[0026] In fixed type (3) and γ k With two variables, the formula for the (k+1)th iteration of Y is:

[0027]

[0028] To ensure J dark The elements in set ψ remain unchanged, and after each iteration, let...

[0029] In fixed type (3) and Y k+1 With two variables, the formula for the (k+1)th iteration of γ is:

[0030]

[0031] Alternate execution variable J dark The iterative formulas for variables Y and γ are used until the stopping condition is met. At that time, the completed dark channel J is obtained. dark ;

[0032] Based on the concept of DCP, the transmittance is calculated using formula (8);

[0033] T = 1 - ωJ dark (8)

[0034] Furthermore, the dark channel image is segmented using the large-scale law method. Let C0 and C1 be its foreground and background regions, respectively. Let ω0 be the proportion of foreground pixels to the total pixels in the dark channel, with an average gray level of μ0. Let ω1 be the proportion of background pixels to the total pixels in the dark channel, with an average gray level of μ1. Then, the total average gray level of the dark channel is:

[0035] μ=ω0×μ0+ω1×μ1 (9)

[0036] The variances of the foreground and background in the dark channel are calculated using formula (10):

[0037]

[0038] When the variance between the foreground and background is maximized, the segmentation image threshold is obtained as follows:

[0039] T=maxω0×ω1×(μ0-μ)×(μ1-μ) (11)

[0040] Given an image segmentation threshold, if all pixels in the background region are set to 0, the segmented image expression is:

[0041]

[0042] After image segmentation, the background pixel values ​​are all set to 0. A quadtree method is used to divide the segmented image into four equal-sized sub-regions. Each sub-region is scored based on the number of background pixels it contains. The region with the highest score is selected as a candidate region and further segmented. Let x be the score. m y n Let x be the length and width of the segmented image, respectively. a y b Given the length and width of the candidate region, repeat the above operation until the iteration stopping condition x is met. a ×y b ≤0.1%×x m ×y n At that time, record the position of the candidate sub-region with the highest score;

[0043] Take the color-corrected image I respectively CR The average pixel value of the corresponding region in each channel is used as the water light, i.e., A = {A R A G A B}

[0044] This invention discloses a single-image underwater image enhancement method based on a low-rank prior for dark channels. The method renames the three channels of the underwater image based on the pixel mean of each channel and corrects color cast using a color correction preprocessing method. Then, a certain proportion of dark pixels are selected in the corrected image to obtain a sample point image. A low-rank completion model for the dark channels is constructed based on the linear relationship within the dark pixels in the sample point image, and the ADMM algorithm is used to complete the remaining proportion of pixels to obtain the dark channel image. The transmittance of the corrected image is calculated based on the dark channel image information. Next, the dark channel is segmented using the big rule method, and the pixel values ​​of the background region are set to 0 to obtain the segmented image. The segmented image is divided into four equal-sized sub-regions using a quadtree method, and each region is scored based on the number of background points contained within it. The region with the highest score is selected as a candidate region and further segmented. The position of the sub-region with the highest score when the iteration stopping condition is met is recorded, and the pixel mean of the corresponding sub-region in each channel of the corrected image is used as the water light. Finally, the enhanced underwater image is obtained by inverting the atmospheric scattering model based on the transmittance and water light information. This method can obtain more accurate transmittance and water light, thus improving the underwater image enhancement effect. Attached Figure Description

[0045] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the 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 based on these drawings without creative effort.

[0046] Figure 1 This is a flowchart of the method disclosed in this invention;

[0047] Figure 2 This is a diagram showing the color correction results in this invention;

[0048] Figure 3 This refers to the local sliding window Ω style in this invention;

[0049] Figure 4 This refers to the transmittance estimated using the low-rank matrix completion technique in this invention.

[0050] Figure 5 This is a schematic diagram of the water-light estimation iteration in this invention;

[0051] Figure 6 This is a diagram showing the estimated water-light results in this invention;

[0052] Figure 7 This is an enhanced result diagram from the present invention. Detailed Implementation

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

[0054] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0055] like Figure 1 As shown, this invention provides a single underwater image enhancement method based on a low-rank prior in the dark channel, specifically including the following steps:

[0056] S1: Acquire the underwater image to be processed.

[0057] S2: Improves color cast issues in underwater images through a color correction preprocessing module.

[0058] S21: Based on the average pixel value of the three channels, name the three channels of the underwater image as large color channel, medium color channel, and small color channel respectively.

[0059] S22: Based on the gray world hypothesis, assuming that the average values ​​of the three channels of an underwater image tend to the same gray value K, and taking the average value of the largest color channel with the least attenuation as the benchmark, K is set to...

[0060] S23: Perform color compensation on the mid-color channel and the small-color channel respectively to obtain the compensated image I. lms To prevent over-correction of color or overexposure of the image, a coefficient matrix C is introduced for constraint. The specific color correction formula is as follows:

[0061]

[0062] in The coefficient matrix, These are the average values ​​of the large color channel, medium color channel, and small color channel, respectively. lms For the images after compensation of the medium and small color channels respectively, I CR This is the color-corrected image. These represent the gradients of the image in two directions. For example... Figure 2 As shown, Figure 2 (a) is the input image. Figure 2 (b) shows the color-corrected image, which demonstrates that the color correction preprocessing module effectively eliminated the color cast problem.

[0063] S3: Combining the low-rank prior of the dark channel and the atmospheric scattering model, a low-rank completion model for the dark channel is constructed to estimate the dark channel image. The specific method is as follows:

[0064] S31: Set a local sliding window Ω centered on any single pixel x in the image; the sliding window style is as follows. Figure 3 As shown. The lowest pixel value in the sliding window Ω centered at x is named the dark pixel of x; a certain proportion of dark pixels are randomly selected from the color-corrected image to obtain the sample point image.

[0065] S32: Based on the linear relationship existing within the selected dark pixels, construct a low-rank completion model for the dark channel to estimate the dark channel:

[0066]

[0067] Where ψ is the set of selected dark pixels, P ψ (·) is a linear mapping that guarantees that the pixel values ​​of elements within the set ψ remain unchanged, while the values ​​of other pixels are 0. dark f(J) is the nuclear norm, which is the relaxation function of the rank function, i.e., f(J) dark )=||J dark || * =∑ i σ i (J dark );

[0068] S4: The ADMM algorithm is used to solve the objective function (2). The specific steps are as follows:

[0069] S41: Introduce auxiliary variable Y = P ψ (J dark ), initialization parameters Y 0 ε = 10 -6 β = 10 -4 And the number of iterations k = 0;

[0070] S42: The augmented Lagrangian function of the objective function (2) is:

[0071]

[0072] Where γ is the Lagrange dual variable, and β > 0 is the penalty factor;

[0073] S43: Fixed type (3) Y k and γ k Two variables, then J dark The formula for the (k+1)th iteration is:

[0074]

[0075] Where D λ (X) is the singular value threshold operator of a matrix, if X = U∑V T ,but

[0076] D λ (X)=U sgn(∑)max(|∑|-λ,0)V T (5)

[0077] S44: Fixed type (3) and γ k With two variables, the formula for the (k+1)th iteration of Y is:

[0078]

[0079] And in order to ensure J dark The elements in set ψ remain unchanged, and after each iteration, let...

[0080] S45: Fixed type (3) and Y k+1 With two variables, the formula for the (k+1)th iteration of γ is:

[0081]

[0082] S46: Alternately execute steps S43, S44, and S45, iteratively updating variable J. dark Y and γ, until the stopping condition is met. At that time, the completed dark channel J is obtained. dark ;

[0083] S5: Based on the concept of DCP, the transmittance is calculated using formula (8);

[0084] T = 1 - ωJ dark (8)

[0085] Figure 4 The transmissivity map obtained by the low-rank matrix completion method is shown, which provides rich details of the obtained transmissivity.

[0086] S6: Estimate water light by segmenting the background region of the image, specifically using the following method:

[0087] S61: Let C0 and C1 be the foreground and background regions of the dark channel image, respectively. The proportion of foreground pixels to the total pixels of the dark channel is ω0, and the average gray level is μ0. The proportion of background pixels to the total pixels of the dark channel is ω1, and the average gray level is μ1. The total average gray level of the dark channel is calculated using formula (9).

[0088] μ=ω0×μ0+ω1×μ1 (9)

[0089] S62: Calculate the variance of the foreground and background in the dark channel using formula (10):

[0090]

[0091] S63: According to the law of large difference, the segmentation image threshold is obtained when the variance between the foreground and background is maximized. The dark channel segmentation threshold is calculated using formula (11).

[0092] T=maxω0×ω1×(μ0-μ)×(μ1-μ) (11)

[0093] S64: Using the image segmentation threshold information, all pixels in the background region are set to 0 to obtain the segmented image, which is expressed as formula (16).

[0094]

[0095] S65: Using the quadtree method, the segmented image is divided into four equal-sized sub-regions. Each sub-region is scored based on the number of background points it contains. The region with the highest score is selected as a candidate region and segmented further. Figure 5 The iterative segmentation process of water-light A is demonstrated.

[0096] S66: Let x be an example. m y n Let x be the length and width of the segmented image, respectively. a y b Given the length and width of the candidate region, repeat step S65 until the iteration stopping condition x is met. a ×y b ≤0.1%×x m ×y n At that time, record the position of the candidate sub-region with the highest score;

[0097] S67: Take the color-corrected image I respectively CR The average pixel value of the corresponding region in each channel is used as the water light, i.e., A = {A R A G AB}.like Figure 6 The image shows the location of the water light estimated using the background segmentation method, and it can be seen that the location of the water light is relatively accurate.

[0098] S7: Based on the calculated transmittance and water light information, the real scene light is recovered by inversion using an atmospheric scattering model, as shown in the following formula:

[0099]

[0100] Where t0 is a limiting parameter used to suppress noise in the recovered scene caused by excessively low transmittance, and is typically set to 0.1. For example... Figure 7 As shown, Figure 7 (a) is the input image. Figure 7 (b) is the enhanced image. It can be seen that the enhanced image effectively improves the problems of color cast and blur in underwater images, and enhances the underwater image enhancement effect.

[0101] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A single underwater image enhancement method based on dark channel low rank prior, characterized in that, The method comprises the following steps: Obtain an underwater image to be processed: According to the average value of each channel of the underwater image, the three channels of the image are sequentially renamed, and a corrected image is obtained based on a color correction preprocessing method; Select a certain proportion of dark pixels in the corrected image to obtain a sample point image, construct a dark channel low-rank completion model based on the linear relationship within the dark pixels in the sample point image, complete the remaining proportion of pixels by using an ADMM algorithm to obtain a dark channel image, and calculate the transmittance of the corrected image based on the information of the dark channel image; Segment the dark channel image by using the majority law to separate the foreground region and the background region, and set the pixel value of the background region to 0 to obtain a segmented image; Divide the segmented image into four sub-regions of equal size by using a quadtree method, score each region according to the number of background points contained in the region, select the region with the highest score as a candidate region and continue to segment the candidate region, record the position of the sub-region with the highest score when the iteration stopping condition is met, and take the average pixel value of the sub-region at the corresponding position in each channel of the corrected image as the water light; Based on the transmittance and water light information, an enhanced underwater image is obtained by using an atmospheric scattering model.

2. The method of claim 1, wherein the method is based on dark channel low-rank prior for single underwater image enhancement. The average values of the RGB three components of the underwater image tend to the same gray value K. According to the size of the average value of the three channel pixels, the three channels of the underwater image are sequentially named as a large color channel, a medium color channel and a small color channel. The gray value K is set as Color compensation is respectively performed on the medium color channel and the small color channel: where C is a coefficient matrix, are the mean values of the large, medium and small color channels respectively, I lms are the compensated images for the medium and small color channels respectively, I CR is the color corrected image, are the gradients of the image in the two directions respectively.

3. The single underwater image enhancement method based on dark channel low-rank prior according to claim 1 or 2, characterized in that: Set a sliding window Ω with any single pixel point x in the image as the center, and name the lowest pixel value in the sliding window Ω with x as the center as the dark pixel point of x, and obtain a sample point image by randomly selecting a certain proportion of dark pixel points from the image.

4. The method of claim 3, wherein the method is based on dark channel low-rank prior. According to the linear relationship existing in the selected dark pixel points, a dark channel low-rank completion model is constructed to estimate the dark channel: where ψ is the set of selected dark pixels, P ψ (·) is a linear mapping that guarantees the pixel values of the elements in the set ψ are unchanged and the rest of the pixel values are 0, f(J dark ) is the nuclear norm, which is a relaxation of the rank function, i.e., f(J dark ) = ||J dark || * ∑ i σ i (J dark ) ; The ADMM algorithm is used for solving the target function (2), an auxiliary variable Y=P ψ (J dark ) is introduced, the initialization parameters Y 0 , ε=10 -6 , β=10 -4 and the iteration number k=0 are set. The augmented Lagrangian function of the objective function (2) is: Where γ is the Lagrange dual variable, and β>0 is the penalty factor; Fixed (3) in Y k And gamma k Two variables, then J dark The k+1 iteration formula of J where D λ (X) is a matrix singular value thresholding operator, if X = U∑V T then D λ (X) = Usgn(∑) max(|∑| - λ, 0) V T (5) Fixed (3) in and gamma k Two variables, then the k+1 iteration formula of Y is: To guarantee J dark The elements in the set ψ are invariant, and after each iteration we let Fixed (3) in and Y k+1 Two variables, then the k + 1 iteration formula of γ is: Alternating execution of the variables J dark , Y and γ until a stop condition is met , the completed dark channel J dark is obtained According to the concept of DCP, the transmittance is calculated by formula (8); T = 1 - ωJ dark (8).

5. The method of claim 4, wherein the method is based on dark channel low-rank prior. Segment the dark channel image by using the majority law, and set C0 and C1 as the foreground region and the background region of the dark channel image, respectively. The proportion of foreground pixels in the total pixels of the dark channel is ω0, the average gray value is μ0, the proportion of background pixels in the total pixels of the dark channel is ω1, and the average gray value is μ1. The total average gray value of the dark channel is: μ=ω0×μ0+ω1×μ1 (9) The variance of the foreground and the background is calculated by formula (10): When the variance of the foreground and the background is maximum, the threshold of the segmented image is as follows: T=maxω0×ω1×(μ0-μ)×(μ1-μ) (11) Given the image segmentation threshold, set the pixel value of the background region to 0, and the expression of the segmented image is: The pixel values of the background region after image segmentation are all set to 0, the segmented image is divided into four sub-regions of equal size by using a quadtree method, each region is scored according to the number of background points contained in the sub-region, the region with the highest score is taken as a candidate region and continues to be segmented, and x m , y n are respectively the length and width of the segmented image, x a , y b are respectively the length and width of the candidate region, the above operation is repeated, and when the iteration stopping condition x a × y b ≤ 0.1% × x m × y n is met, the position of the candidate sub-region with the highest score is recorded. respectively, the color corrected image I CR The mean value of the pixels in the region of the respective position of each channel is taken as the water light, i.e. A = {A R ,A G ,A B}.

Citation Information

Patent Citations

  • Dark channel prior and variation Retinex-based underwater image enhancement method

    CN107886486A

  • Underwater image enhancement method based on wavelength attenuation identification

    CN113284060A