A method for underwater image processing and enhancement
By eliminating the uneven illumination of underwater images through a two-dimensional Gaussian function and adaptive background estimation, and combining this with a nonlinear piecewise function to enhance contrast, the problem of poor underwater image quality is solved, and the image quality is improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-02
- Publication Date
- 2026-03-31
AI Technical Summary
Underwater images suffer from poor quality due to uneven lighting and complex environments, making it difficult for existing technologies to effectively process and enhance them.
A two-dimensional Gaussian function and an adaptive background estimation method are used to eliminate non-uniform regions by convolving the image with the background matrix, and image enhancement is performed by combining a nonlinear piecewise function to improve contrast.
It effectively eliminates uneven lighting, enhances the contrast between the foreground and background, improves the quality of underwater images, and makes target objects easier to identify.
Smart Images

Figure CN117218014B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of underwater exploration technology. Background Technology
[0002] With the rapid increase in global population and the continuous depletion of land resources, people have had to begin to pay attention to the development and utilization of underwater resources. Due to the dim lighting conditions underwater, auxiliary light sources are often required, resulting in uneven illumination in the acquired images. Underwater images are mainly affected by the absorption and scattering effects of water, water turbidity, and lighting conditions, making it difficult to guarantee image quality. Accurate underwater information cannot be easily obtained from images with the naked eye.
[0003] Common image processing methods are generally applicable to images captured in the air. Underwater environments are complex, and common image processing methods, such as histogram equalization, Retinex, gamma transform, and filtering, often fail to achieve satisfactory results. Our researchers have proposed a new underwater image processing and enhancement method to address the problems of uneven lighting and unclear images in underwater environments, taking into account the complex lighting and noise conditions. Summary of the Invention
[0004] The technical problem solved by this invention is to provide an underwater image processing and enhancement method that can effectively overcome uneven lighting and unclear images in underwater images.
[0005] The technical solution adopted in this invention is to provide a method for underwater image processing and enhancement, characterized by including the following steps;
[0006] Step 1, initial value setting;
[0007] Image f(x, y) is a grayscale image with dimensions H and W, where x and y are the pixel coordinates of the image, and x∈[0, H], y∈[0, W].
[0008] Two-dimensional Gaussian function Where σ is the standard deviation, and the initial value is σ0. The width and height of the two-dimensional Gaussian function template;
[0009] Error threshold δ;
[0010] The background matrix g(x, y, σ) is given, where A is the constant that σ increases in each cycle, i.e., σ i+1 =σ i +A. Where i = 0, 1, 2, 3..., represents the number of iterations, with an initial value of 0;
[0011] Step 2, Adaptive background estimation;
[0012] Step 2.1, the image f(x, y) and the two-dimensional Gaussian function Perform convolution to obtain the background matrix g(x, y, σ). i ):
[0013]
[0014] Step 2.2, calculate g(x, y, σ) i The background matrix g(x, y, σ) calculated in the previous iteration is compared with that of the background matrix g(x, y, σ) i-1 The average error at the corresponding pixel position:
[0015]
[0016] If i = 0, then σ i =σ0, g(x, y, σ i-1 ) = 0;
[0017] Step 2.3: If Δ≤δ, then g(x, y, σ) i ) represents the optimal background matrix, and the dimensions of the matrix obtained are consistent with the dimensions of the image f(x, y). Otherwise, σ i+1 =σ i +A, then repeat step 2;
[0018] Step 3: Use the background matrix to remove shadows in non-uniform areas;
[0019] Step 3.1, using the image f(x, y) and the optimal background matrix g(x, y, σ) i Perform a division operation on the corresponding pixel positions:
[0020]
[0021] Step 3.2: Normalize the values in f′(x, y) to a range:
[0022]
[0023] Where min(f′(x,y)) is the minimum value of f′(x,y), max(f′(x,y)) is the maximum value of f′(x,y), and the range of values in the resulting f″(x,y) is [0,1].
[0024] Step 4: Image enhancement;
[0025] Image enhancement is performed using a nonlinear piecewise function to improve image contrast;
[0026] The enhanced image is as follows:
[0027]
[0028] Finally, the image value F(x, y) is restored to the range [0, 255].
[0029] F(x, y) = F(x, y) × 255
[0030] The beneficial effects of this invention are that, based on the complex underwater lighting and noise environment, a method for underwater image processing and enhancement is proposed, which solves the problems of uneven lighting and unclear images in underwater images, effectively eliminates uneven lighting, enhances the contrast wave between the foreground and background, and improves the quality of underwater images. Attached Figure Description
[0031] Figure 1 This is a flowchart of the method of the present invention. Detailed Implementation
[0032] The invention will now be further described with reference to the accompanying drawings.
[0033] To address the issues of poor image quality and blurred objects in underwater cameras due to the complex underwater environment, this invention proposes a method for underwater image processing and enhancement. The main components include: first, setting the initial values required for the calculations; then, using a two-dimensional Gaussian function to iteratively calculate the image background; next, performing pixel-wise mathematical operations on the original image and background matrix to eliminate non-uniform regions; and finally, using a non-linear piecewise function to enhance the image. This method not only eliminates non-uniform lighting areas underwater, smoothing the image background, but also improves the contrast between underwater objects and the background, enhancing image quality and making targets easier to identify.
[0034] The specific algorithm is as follows:
[0035] Step 1, initial value setting;
[0036] Image f(x, y) is a grayscale image with dimensions H and W, where x and y are the pixel coordinates of the image, and x∈[0, H], y∈[0, W].
[0037] Two-dimensional Gaussian function Where σ is the standard deviation, and the initial value is σ0. The width and height of the two-dimensional Gaussian function template;
[0038] Error threshold δ;
[0039] The background matrix g(x, y, σ) is given, where A is the constant that σ increases in each cycle, i.e., σ i+1 =σ i +A. Where i = 0, 1, 2, 3..., represents the number of iterations, with an initial value of 0;
[0040] Step 2, Adaptive background estimation;
[0041] Step 2.1, the image f(x, y) and the two-dimensional Gaussian function Perform convolution to obtain the background matrix g(x, y, σ). i ):
[0042]
[0043] Step 2.2, calculate g(x, y, σ) i The background matrix g(x, y, σ) calculated in the previous iteration is compared with that of the background matrix g(x, y, σ) i-1 The average error at the corresponding pixel position:
[0044]
[0045] If i = 0, then σ i =σ0, g(x, y, σ i-1 ) = 0;
[0046] Step 2.3: If Δ≤δ, then g(x, y, σ) i ) represents the optimal background matrix, and the dimensions of the matrix obtained are consistent with the dimensions of the image f(x, y). Otherwise, σ i+1 =σ i +A, then repeat step 2;
[0047] Step 3: Use the background matrix to remove shadows in non-uniform areas;
[0048] Step 3.1, using the image f(x, y) and the optimal background matrix g(x, y, σ) i Perform a division operation on the corresponding pixel positions:
[0049]
[0050] The 0.001 is to prevent division by zero;
[0051] Step 3.2: Normalize the values in f′(x, y) to a range:
[0052]
[0053] Where min(f′(x,y)) is the minimum value of f′(x,y), max(f′(x,y)) is the maximum value of f′(x,y), and the range of values in the resulting f″(x,y) is [0,1].
[0054] Step 4: Image enhancement;
[0055] Image enhancement is performed using a nonlinear piecewise function to improve image contrast;
[0056] The enhanced image is as follows:
[0057]
[0058] Finally, the image value F(x, y) is restored to the range [0, 255].
[0059] F(x, y) = F(x, y) × 255
[0060] The technical solution of this invention can effectively eliminate uneven illumination, enhance the contrast between the foreground and background, and improve the quality of underwater images.
Claims
1. A method for underwater image processing and enhancement, characterized in that Comprising the following steps; Step 1, initial value setting; Step 2, adaptive background estimation; image is a gray-scale image with length and width of and , and is an image pixel coordinate, where ; A two-dimensional Gaussian function , wherein is a standard deviation, with an initial value of , is a length and a width of the two-dimensional Gaussian function template; Error threshold ; background matrix , is the standard deviation, is the constant is incremented each cycle, i.e. wherein n denotes the number of cycles, with an initial value of 0; Step 3, using background matrix to eliminate shadows in non-uniform regions; Step 2.1, image with a two-dimensional Gaussian function convolution operation to obtain the background matrix : ; Step 2.2, calculation the background matrix calculated in the previous loop error average for the corresponding pixel position: ; If then , ; Step 2.3: If then is the optimal background matrix, the length and width of the matrix sought are consistent with the length and width of the image , otherwise repeat Step 2; Step 4: image enhancement; Step 3.1, divide by the image and the best background matrix Division operation on the corresponding pixel positions: ; Step 3.2: The values in the table below are normalized to a range: 0.0 0.0 0.0 0.0 0.0 0.0 ; wherein is the minimum value in the range is the maximum value in the range the range of values is ; Using a nonlinear piecewise function to enhance the image and improve the contrast of the image; The enhanced image is: ; Finally the image is restored to values in the range: values in the range: 。
Citation Information
Patent Citations
Underwater laser stripe center extraction method
CN113223074A
Super-resolution image reconstruction method and system based on position correlation point spread function
CN114913062A