An underwater image adaptive enhancement method, system, device and storage medium

By combining sharpening of underwater images, adaptive median filtering, adaptive edge detection and homomorphic filtering, the problems of noise and error information in traditional methods are solved, and the high-quality enhancement effect of underwater images is achieved.

CN116912115BActive Publication Date: 2025-07-25SUN YAT SEN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310823034.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-05
Publication Date
2025-07-25
Estimated Expiration
2043-07-05

AI Technical Summary

Technical Problem

Traditional underwater image processing methods based on edge detection will generate a lot of noise and error information when processing complex images, resulting in poor quality of the acquired underwater image.

Method used

The original underwater image is sharpened by weighting coefficients, combined with adaptive median filtering and adaptive edge detection, the image is enhanced by homomorphic filtering, and the original underwater image is sharpened by weighting coefficients to obtain a sharpened image; the sharpened image is adaptive median filtered to obtain an adaptive median filtered image; the adaptive median filtered image is adaptively detected to obtain an edge enhancement image; the edge image is fused with the original underwater image or sharpened image according to the brightness of the sharpened image to obtain a fusion image; the optimal value of homomorphic filtering parameters is determined, and the fusion image is homomorphic filtered and enhanced according to the optimal value of homomorphic filtering parameters is obtained to obtain an underwater enhancement image.

Benefits of technology

Adaptive enhancement of underwater images is achieved, the contrast and brightness of images are improved, the image details are enhanced, noise interference is reduced, and the overall quality of underwater images is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116912115B_ABST
    Figure CN116912115B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of computer vision technology, and particularly to an underwater image adaptive enhancement method, system, device, and storage medium, including: performing sharpening processing on the original underwater image using a weighting coefficient, and sequentially performing adaptive median filtering and adaptive edge detection on the obtained sharpened image to obtain an edge-enhanced image; obtaining a fused image based on the edge-enhanced image, the original underwater image, and the sharpened image; performing homomorphic filtering enhancement on the fused image according to the obtained optimal value of the homomorphic filtering parameter to obtain an underwater enhanced image. The present invention performs adaptive enhancement processing on underwater images with uneven illumination, solves the problem that traditional underwater image processing methods based on edge detection generate a large amount of noise and error information when processing complex images, resulting in poor quality of the obtained underwater images, and enables the enhanced images to have richer and clearer details, and further improves the contrast and standardized brightness of the overall image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer vision technology, and in particular to an underwater image adaptive enhancement method, system, device and storage medium. Background Art

[0002] Underwater image edge enhancement is an important topic in underwater vision research. Its research significance lies in improving the quality and clarity of underwater images, so as to better achieve tasks such as underwater target detection and recognition. Traditional underwater image edge enhancement methods include traditional image processing methods and deep learning methods. Traditional image processing methods include filtering, sharpening, edge detection, etc., while deep learning methods train neural networks through a large amount of underwater image data to improve the effect of underwater image edge enhancement. Among them, compared with deep learning methods, traditional image processing methods usually have faster processing speed, less consumption of computing resources, lower application costs, and the algorithm theory and application experience of traditional image processing methods are relatively mature, with certain reliability and stability.

[0003] However, traditional image processing methods also have certain problems. For example, it is difficult to adapt to problems such as light changes, scattering, and color deviation in the underwater environment. Filtering is one of the commonly used image processing methods, which can be used to remove noise in the image and smooth the image, but filtering will cause the loss of image detail information. Therefore, it needs to be selected according to specific situations. Sharpening can improve the clarity of the image and the sharpness of the edges, and can highlight the edges and details of the image. However, when processing some images with more noise, it will cause the amplification of noise. Edge detection is a method for detecting edge information in an image, which can extract important information in the image. However, when processing complex images, it will generate a large amount of noise and error information, resulting in poor quality of the obtained underwater images, thus limiting its application. And it is very important to exclude the interference of complex environmental factors on underwater images. Therefore, there is an urgent need for an underwater image enhancement method based on edge detection to meet the current needs of users for improving the quality of underwater images. Summary of the Invention

[0004] The present invention provides an underwater image adaptive enhancement method, system, device and storage medium, and the technical problem to be solved is that traditional edge detection-based underwater image processing methods will generate a large amount of noise and error information when processing complex images, resulting in poor quality of the obtained underwater images.

[0005] To solve the above technical problems, the present invention provides an underwater image adaptive enhancement method, system, device and storage medium.

[0006] In the first aspect, the present invention provides an underwater image adaptive enhancement method, and the method includes the following steps:

[0007] Collect the original underwater image and perform sharpening processing on the original underwater image using the pre-acquired weighting coefficient to obtain a sharpened image;

[0008] Perform adaptive median filtering on the sharpened image to obtain an adaptive median filtered image;

[0009] Perform adaptive edge detection on the adaptive median filtered image to obtain an edge-enhanced image;

[0010] Obtain a binary image of the sharpened image, and perform a bitwise AND operation on the binary image and the edge-enhanced image to obtain an edge image;

[0011] Fuse the edge image with the original underwater image or the sharpened image according to the brightness of the sharpened image to obtain a fused image;

[0012] Determine the optimal value of the homomorphic filtering parameter, and perform homomorphic filtering enhancement on the fused image according to the optimal value of the homomorphic filtering parameter to obtain an underwater enhanced image.

[0013] In a further embodiment, the weighting coefficient is determined according to the pixel value of each pixel point in the original underwater image, and the calculation formula of the sharpened image is:

[0014] I sharpen (x,y) = (1 - M) × f(x,y) + M × g(x,y)

[0015] Wherein,

[0016]

[0017]

[0018] In the formula, I sharpen (x,y) represents the sharpened image; M represents the weighting coefficient; f(x,y) represents the original underwater image; g(x,y) represents the convolution image obtained after the original underwater image is convolved with the Laplacian operator; θ represents the proportion of dark points in the original underwater image; Dark sum represents the number of dark points in the original underwater image, wherein the dark points are determined according to the pixel value of each pixel point in the original underwater image and a preset original image dark point threshold; r represents the number of rows of the grayscale image matrix corresponding to the original underwater image; c represents the number of columns of the grayscale image matrix corresponding to the original underwater image.

[0019] In a further embodiment, the step of performing adaptive median filtering on the sharpened image to obtain an adaptive median filtered image includes:

[0020] Convert the sharpened image to a grayscale image, set the size of the initial window of the filter, and obtain the maximum grayscale value, minimum grayscale value, and grayscale median value of the grayscale image within the initial window of the filter;

[0021] Determine whether the grayscale median value is between the maximum grayscale value and the minimum grayscale value. If the grayscale median value is between the maximum grayscale value and the minimum grayscale value, then determine whether the grayscale value of each pixel point within the initial window of the filter is between the minimum grayscale value and the maximum grayscale value. If not, then determine that the current grayscale median value is noise and output the grayscale median value;

[0022] If the grayscale value of each pixel point within the initial window of the filter is between the minimum grayscale value and the maximum grayscale value, then determine that the current grayscale median value is not noise, retain and output the grayscale value of the current pixel point;

[0023] If the grayscale median value is not between the maximum grayscale value and the minimum grayscale value, then increase the size of the initial window of the filter according to a preset window increase rule, and search for non-noise points within the increased initial window of the filter. If the size is increased to the maximum window size allowed by the filter and no non-noise points are found, then output the grayscale median value.

[0024] In a further embodiment, the step of performing adaptive edge detection on the adaptive median filtered image to obtain an edge enhanced image includes:

[0025] Calculate the gradient magnitude and gradient direction of the adaptive median filtered image according to the Sobel operator;

[0026] Perform non-maximum suppression on the adaptive median filtered image using the gradient magnitude and the gradient direction, and process the non-maximum suppressed adaptive median filtered image using pre-acquired double thresholds to form an edge enhanced image;

[0027] Wherein, the double thresholds include a high edge threshold and a low edge threshold, and the steps for obtaining the high edge threshold and the low edge threshold are:

[0028] Convert the sharpened image to a grayscale image, calculate the pixel average value and pixel standard deviation of all pixel points in the grayscale image, subtract the pixel average value from the pixel standard deviation to obtain the low edge threshold, and obtain the high edge threshold for the sharpened image using the Otsu method.

[0029] In a further embodiment, the fused image includes a bright fused image or a dark fused image, and the step of fusing the edge image with the original underwater image or the sharpened image according to the brightness of the sharpened image to obtain a fused image includes:

[0030] Determine the proportion of dark pixels in the sharpened image according to the pixel values of each pixel point in the sharpened image;

[0031] Classify the sharpened image as a dark image or a bright image according to the proportion of dark pixels and a preset dark pixel threshold of the sharpened image;

[0032] If the sharpened image is classified as a bright image, fuse the edge image with the original underwater image to obtain a bright fused image;

[0033] If the sharpened image is classified as a dark image, fuse the edge image with the sharpened image to obtain a dark fused image.

[0034] In a further embodiment, the step of determining the optimal value of the homomorphic filtering parameters includes:

[0035] Determine the initial optimal values of each homomorphic filter parameter; wherein, the homomorphic filter parameters include a high-frequency weight, a low-frequency weight, a Gaussian function slope value, and a low-high frequency ratio discrimination value;

[0036] Perform homomorphic filtering on the fused image using the initial optimal values of the homomorphic filter parameters to obtain an initial image quality evaluation result;

[0037] Add random perturbations to the initial optimal values of the homomorphic filter parameters to obtain homomorphic filter perturbation parameters;

[0038] Perform homomorphic filtering on the fused image according to the homomorphic filter perturbation parameters to obtain an image quality perturbation evaluation result;

[0039] Obtain a quality evaluation change value according to the initial image quality evaluation result and the image quality perturbation evaluation result;

[0040] Determine the probability value of the homomorphic filter perturbation parameters according to the quality evaluation change value;

[0041] Add random perturbations to the homomorphic filter perturbation parameters, update the homomorphic filter perturbation parameters, and repeat the above steps until a preset number of iterations is reached;

[0042] Determine the optimal homomorphic filter perturbation parameters according to the probability value of the homomorphic filter perturbation parameters, and use them as the optimal values of the homomorphic filtering parameters.

[0043] In a further embodiment, the step of determining the initial optimal values of each homomorphic filter parameter includes:

[0044] Preset the initial values and value ranges of each homomorphic filter parameter;

[0045] Traverse all homomorphic filter parameters. For each traversed homomorphic filter parameter, use the current homomorphic filter parameter as the target homomorphic filter parameter, and obtain the image quality evaluation change curve within the value range of the target homomorphic filter parameter according to the initial values of all homomorphic filter parameters except the target homomorphic filter parameter.

[0046] Determine the initial optimal value of the target homomorphic filter parameter according to the image quality evaluation value of the image quality evaluation change curve.

[0047] In a second aspect, the present invention provides an underwater image adaptive enhancement system, which includes:

[0048] An image sharpening module, configured to collect an original underwater image and perform sharpening processing on the original underwater image using a pre-acquired weighting coefficient to obtain a sharpened image;

[0049] An edge enhancement module, configured to perform adaptive median filtering on the sharpened image to obtain an adaptive median filtered image; perform adaptive edge detection on the adaptive median filtered image to obtain an edge enhanced image;

[0050] An image fusion module, configured to obtain a binary image of the sharpened image, perform a bitwise AND operation on the binary image and the edge enhanced image to obtain an edge image; and fuse the edge image with the original underwater image or the sharpened image according to the brightness of the sharpened image to obtain a fused image;

[0051] A filtering enhancement module, configured to determine the optimal value of the homomorphic filtering parameter, and perform homomorphic filtering enhancement on the fused image according to the optimal value of the homomorphic filtering parameter to obtain an underwater enhanced image.

[0052] In a third aspect, the present invention further provides a computer device, including a processor and a memory, the processor is connected to the memory, the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory so that the computer device executes the steps of implementing the above method.

[0053] In a fourth aspect, the present invention further provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the steps of implementing the above method are realized.

[0054] The present invention provides an underwater image adaptive enhancement method, system, device and storage medium. The method sharpens an original underwater image by using a weighting coefficient to obtain a sharpened image; performs adaptive median filtering on the sharpened image to obtain an adaptive median filtered image, and performs adaptive edge detection on the adaptive median filtered image to obtain an edge enhanced image, so as to use the edge enhanced image and the sharpened image to obtain an edge image; fuses the edge image with the original underwater image or the sharpened image according to the brightness of the sharpened image to obtain a fused image; determines the optimal value of the homomorphic filtering parameter, and performs homomorphic filtering enhancement on the fused image according to the optimal value of the homomorphic filtering parameter to obtain an underwater enhanced image. Compared with the prior art, this method combines algorithms such as filtering, sharpening and edge detection to implement an adaptive enhancement method for underwater images, making the image enhancement effect better, and having the characteristics of simple calculation and strong real-time performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] Figure 1 is a schematic flowchart of the underwater image adaptive enhancement method provided by an embodiment of the present invention;

[0056] Figure 2 is a schematic diagram of the underwater image adaptive enhancement process provided by an embodiment of the present invention;

[0057] Figure 3 is a schematic diagram of the original underwater image provided by an embodiment of the present invention;

[0058] Figure 4 is a result diagram of the underwater enhanced image after enhancing the original underwater image provided by an embodiment of the present invention;

[0059] Figure 5 is a block diagram of the underwater image adaptive enhancement system provided by an embodiment of the present invention;

[0060] Figure 6 is a schematic structural diagram of a computer device provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0061] The following specifically illustrates the embodiments of the present invention in conjunction with the accompanying drawings. The given embodiments are only for illustrative purposes and should not be construed as limiting the present invention. The accompanying drawings are only for reference and illustration, and do not constitute a limitation on the scope of patent protection of the present invention, because many changes can be made to the present invention without departing from the spirit and scope of the present invention.

[0062] Refer to Figure 1 , an embodiment of the present invention provides an underwater image adaptive enhancement method. As Figure 1 shown, the method includes the following steps:

[0063] S1. Collect the original underwater image, and perform sharpening processing on the original underwater image using the pre-acquired weighting coefficient to obtain a sharpened image.

[0064] In this embodiment, the step of performing sharpening processing on the original underwater image using the pre-acquired weighting coefficient to obtain a sharpened image includes:

[0065] Determine the dark points and the number of dark points of the original underwater image according to the pixel value of each pixel point in the original underwater image and the preset original image dark point threshold;

[0066] Calculate the dark point ratio of the original underwater image according to the number of dark points, and determine the weighting coefficient according to the dark point ratio of the original underwater image;

[0067] Perform convolution on the original underwater image using the Laplace operator to obtain a convolution image. Among them, for digital images, the Laplace operator can be simplified as:

[0068] g(x,y) = f(x,y) * H

[0069] In the formula, g(x,y) represents the convolution image obtained after the original underwater image is convolved by the Laplace operator; f(x,y) represents the original underwater image; H represents the Laplace convolution template;

[0070] Perform sharpening processing on the original underwater image using the convolution image and the weighting coefficient to obtain a sharpened image. Among them, the calculation formula of the sharpened image is:

[0071] I sharpen (x,y) = (1 - M) × f(x,y) + M × g(x,y)

[0072] Among them,

[0073]

[0074]

[0075] In the formula, I sharpen (x,y) represents the sharpened image; M represents the weighting coefficient, which is related to the weight of the superposition of the original underwater image and the convolution image. Generally speaking, M is negative. By observing the histograms and sharpening effects of a large number of underwater images, it can be known that the value of M is related to the brightness of the original underwater image; f(x,y) represents the original underwater image; g(x,y) represents the convolution image obtained after the original underwater image is convolved by the Laplace operator; θ represents the dark point ratio of the original underwater image; Dark sumdenotes the number of dark points in the original underwater image, where the dark points are determined according to the pixel value of each pixel in the original underwater image and a preset dark point threshold of the original image; r represents the number of rows of the grayscale image matrix corresponding to the original underwater image; c represents the number of columns of the grayscale image matrix corresponding to the original underwater image.

[0076] The Laplacian operator is the basis for calculating the pixel gray - level difference in the image neighborhood. It is an image neighborhood enhancement algorithm derived from second - order differentiation. Its basic idea is that when the gray level of the central pixel in the neighborhood is lower than the average gray level of other pixels in its neighborhood, the gray level of this central pixel should be further reduced; when it is higher, the gray level of the central pixel is further increased, so as to achieve image sharpening. In the process of algorithm implementation, the gradient is calculated in four - direction or eight - direction for the central pixel in the neighborhood, and the sum of the gradients is used to judge the relationship between the gray level of the central pixel and the gray levels of other pixels in the neighborhood, and the result of the gradient operation is used to adjust the pixel gray level. However, the Laplacian operator emphasizes the sudden change of gray level in the image and does not emphasize the area with slow change of gray level. Therefore, in this embodiment, the original underwater image and the convolution image are superimposed to enhance the gray - level value of the boundary to achieve sharpening.

[0077] In this embodiment, by performing sharpening processing on the original underwater image, the blurred original underwater image can be made clearer, and corresponding sharpening operations can be carried out according to the reasons causing image blurring. It should be noted that the essence of image blurring is that the image is affected by averaging or integration operations. Therefore, the image can be restored by operations such as differential operation to make the image clear. From the perspective of the frequency spectrum, the essence of image blurring is that its high - frequency components are attenuated. Therefore, the original underwater image can be made clearer by high - pass filtering operation.

[0078] S2. Perform adaptive median filtering on the sharpened image to obtain an adaptive median - filtered image.

[0079] In this embodiment, the step of performing adaptive median filtering on the sharpened image to obtain an adaptive median - filtered image includes:

[0080] Convert the sharpened image to a grayscale image, set the size of the initial window of the filter, and obtain the maximum gray level value, minimum gray level value, and gray - level median value of the grayscale image within the initial window of the filter.

[0081] Determine whether the median gray value is between the maximum gray value and the minimum gray value. If the median gray value is between the maximum gray value and the minimum gray value, then determine whether the gray value of each pixel point in the initial filter window is between the minimum gray value and the maximum gray value. If there is no pixel point in the initial filter window whose gray value is between the minimum gray value and the maximum gray value, then determine that the current median gray value is noise, replace the gray value of the current pixel point with the median gray value, and output the median gray value;

[0082] If there is a pixel point in the initial filter window whose gray value is between the minimum gray value and the maximum gray value, then determine that the current median gray value is not noise, retain and output the gray value of the current pixel point;

[0083] If the median gray value is not between the maximum gray value and the minimum gray value, then increase the size of the initial filter window according to the preset window increase rule, and search for non-noise points in the enlarged initial filter window until the maximum window size allowed by the filter is reached. If the maximum window size allowed by the filter is reached and no non-noise points are found, then output the median gray value.

[0084] The basic principle of median filtering is to compare the pixel values within a certain neighborhood, and take the median value as the new value of the central pixel in this neighborhood. Assume that all pixels within a certain neighborhood are sorted from small to large. If there are isolated noise points, then in this array sorted from small to large, those isolated noises will be distributed on both sides, and the median point taken can well retain the pixel information while filtering out the influence of the noise points. Since the median filter is greatly affected by the size of the filter window, if the filter window is small, the filtering effect on noise is poor; on the contrary, it will cause a certain blurring effect on the image, thus losing some detail information. The adaptive median filter can dynamically change the window size of the median filter according to the preset conditions to simultaneously take into account the noise reduction effect and the effect of protecting details. Therefore, in this embodiment, adaptive median filtering is used to filter the image to reduce the interference of underwater noise in the sharpened image.

[0085] S3. Perform adaptive edge detection on the adaptive median filtered image to obtain an edge enhanced image.

[0086] The edge of an image refers to the part where the brightness changes significantly in a local area of the image. The gray profile of this area can generally be regarded as a step, that is, it changes sharply from one gray value to another with a large difference in a very small buffer area. The Canny edge detection operator is currently the optimal edge detection algorithm, and its goal is to find an optimal edge. The definition of the optimal edge is as follows: (1) The algorithm can mark as many actual edges in the image as possible; (2) The marked edges should be as close as possible to the actual edges in the image; (3) Each edge in the image can only be marked once.

[0087] In this embodiment, the step of performing adaptive edge detection on the adaptive median filtered image to obtain an edge-enhanced image includes:

[0088] Calculating the gradient magnitude and gradient direction of the adaptive median filtered image according to the Sobel operator; in this embodiment, the Sobel operator is selected to calculate the gradient magnitude and gradient direction. Compared with other edge operators, the image edges obtained by the Sobel operator are thick and bright. The Sobel operator consists of two 3*3 matrices, namely S x and S y , where S x is used to calculate the pixel gradient matrix G x in the x direction of the image, and S y is used to calculate the pixel gradient matrix G y in the y direction of the image. The calculation formulas are as follows:

[0089]

[0090]

[0091] In the formula, I median represents the adaptive median filtered image, and * represents the cross-correlation operation.

[0092] The calculation formulas for the gradient magnitude and direction are:

[0093]

[0094] θ = arc tan(G y , G x )

[0095] In the formula, G xy represents the gradient magnitude, and θ represents the gradient direction;

[0096] Perform non-maximum suppression on the adaptive median filtered image using the gradient magnitude and the gradient direction, and process the non-maximum suppressed adaptive median filtered image using a pre-acquired double threshold to form an edge-enhanced image; wherein, the double threshold includes a high edge threshold and a low edge threshold, and the steps for obtaining the high edge threshold and the low edge threshold are as follows:

[0097] Convert the sharpened image to a grayscale image, calculate the pixel average value and pixel standard deviation of all pixel points in the grayscale image, subtract the pixel average value from the pixel standard deviation to obtain the low edge threshold, and use the Otsu method on the sharpened image to obtain the high edge threshold.

[0098] The traditional Canny edge detection operator distinguishes edge pixels by setting specified high and low edge thresholds. However, for each image, the high and low edge thresholds that result in better edge detection effects are usually different. Therefore, a manual debugging method is generally used to determine them, resulting in poor algorithm robustness. In this embodiment, an adaptive method is used to determine the high and low edge thresholds. The sharpened image is converted into a grayscale image, the average value and standard deviation of its pixels are calculated, the difference between the average value and standard deviation of the pixels is used to obtain the low edge threshold, and the Otsu method is used on the sharpened image to obtain the high edge threshold, which can improve the algorithm robustness and the edge detection effect.

[0099] In this embodiment, the steps of performing non-maximum suppression on the adaptive median filtered image using the gradient magnitude and the gradient direction, and processing the non-maximum suppressed adaptive median filtered image using a pre-acquired double threshold to form an edge-enhanced image include:

[0100] Perform non-maximum suppression on the gradient magnitude to obtain the non-maximum suppressed adaptive median filtered image. Compare the gradient intensity of the current pixel point with the gradient intensities of adjacent pixel points along the positive and negative gradient directions. If the gradient intensity of the current pixel point is an extreme value, retain the current pixel point and use the current pixel point as an edge pixel point. If the gradient intensity of the current pixel point is not an extreme value, suppress the current pixel point and do not use it as an edge pixel point; it should be noted that for more accurate calculation, linear interpolation is usually used between two adjacent pixels across the gradient direction to obtain the pixel gradients to be compared.

[0101] Perform double threshold processing on the non-maximum suppressed adaptive median filtered image. If the gradient intensity of the edge pixel point is greater than the high edge threshold, the edge pixel point is a strong edge pixel point, and retain the strong edge pixel point;

[0102] If the gradient intensity of the edge pixel point is greater than the low edge threshold and less than the high edge threshold, the edge pixel point is a weak edge pixel point;

[0103] If the gradient intensity of the edge pixel is less than the low edge threshold, it indicates that the edge pixel is a non-edge point, and the edge pixel is suppressed.

[0104] Extract multiple neighboring pixels around the weak edge pixel. If there is a strong edge pixel among the multiple neighboring pixels, the weak edge pixel is retained.

[0105] Connect all the retained strong edge pixels and the retained weak edge pixels to form an edge enhanced image.

[0106] It should be noted that strong edge pixels can be considered as real edges, while weak edge pixels may be real edges or may be caused by noise or color changes. To obtain accurate results, weak edge pixels caused by noise or color changes should be removed. Since it is generally considered that weak edge points caused by real edges are connected to strong edge points, while weak edge points caused by noise are not, therefore, when detecting the eight-connected neighboring pixels of a weak edge point, as long as there is a strong edge point, then this weak edge point is considered as a real edge and retained. Search for all connected weak edges. If any point of a connected weak edge is connected to a strong edge point, then this weak edge is retained, otherwise this weak edge is suppressed. Thus, on the basis of eliminating redundant gradient responses, the influence of noise is further eliminated, and the edge detection accuracy is improved.

[0107] S4. Obtain the binary image of the sharpened image, and perform a bitwise AND operation on the binary image and the edge enhanced image to obtain an edge image.

[0108] Specifically, in this embodiment, the sharpened image is converted to a grayscale image, and the grayscale image is binarized to obtain a binary image. The edge enhanced image is used as a mask image, and a bitwise AND operation is performed on the binary image and the mask image to obtain an edge image.

[0109] S5. According to the brightness of the sharpened image, fuse the edge image with the original underwater image or the sharpened image to obtain a fused image, where the fused image includes a bright fused image or a dark fused image.

[0110] In this embodiment, the step of fusing the edge image with the original underwater image or the sharpened image according to the brightness of the sharpened image to obtain a fused image includes:

[0111] Determine the proportion of dark points in the sharpened image according to the pixel value of each pixel point in the sharpened image.

[0112] Classify the sharpened image as a dark image or a bright image according to the proportion of dark spots and a preset dark spot threshold of the sharpened image;

[0113] If the sharpened image is classified as a bright image, fuse the edge image with the original underwater image to obtain a bright fused image;

[0114] If the sharpened image is classified as a dark image, fuse the edge image with the sharpened image to obtain a dark fused image.

[0115] Specifically, in this embodiment, the proportion of dark spots in the sharpened image is used to determine whether the sharpened image belongs to a bright image or a dark image. If the proportion of dark spots in the sharpened image does not exceed the preset dark spot threshold of the sharpened image, it is considered that the sharpened image belongs to a bright image with overall brightness, and the edge image is fused with the original underwater image. Otherwise, it is considered that this image belongs to a dark image with overall darkness, and the edge image is fused with the sharpened image. It should be noted that since sharpening the original underwater image will cause the image brightness to increase, if the original underwater image is overall dark, then fusing the edge image with the sharpened image can improve the problem of the original image being too dark; if the original underwater image is overall bright, then fusing the edge image with the sharpened image will cause the problem of excessive local brightness enhancement in the image. Therefore, fusing the enhanced edge image with the original image has a better effect. Therefore, the step of determining whether the sharpened image belongs to a bright image or a dark image before image fusion in this embodiment, and then selecting different fusion strategies according to the brightness and darkness conditions can avoid the situation of excessive local brightness enhancement in the image and improve the quality of underwater images.

[0116] S6. Determine the optimal value of the homomorphic filtering parameter, and perform homomorphic filtering enhancement on the fused image according to the optimal value of the homomorphic filtering parameter to obtain an underwater enhanced image.

[0117] The homomorphic filtering algorithm is based on the theoretical basis that a grayscale image is composed of two parts: incident light of the scene and reflected light on the target. Homomorphic filtering uses to remove multiplicative noise, can increase contrast and standardize brightness at the same time, and achieve the purpose of image enhancement. The effect of homomorphic filtering depends to a large extent on the parameter settings of the homomorphic filter. The parameters of traditional homomorphic filters are pre-set parameters, and the same parameters are used for filtering different images, which cannot more adaptively make the image achieve the best effect. The embodiment of the present invention adopts a method of adaptively adjusting the parameter settings of the homomorphic filter, can obtain the parameter combination of the homomorphic filter that makes the image score the highest, and has a better effect when processing different images.

[0118] Before determining the optimal value of the homomorphic filtering parameter in this embodiment, it is necessary to pre-determine the initial optimal values of each homomorphic filter parameter, specifically including:

[0119] Preset the initial values and value ranges of each homomorphic filter parameter; among them, the homomorphic filter parameters include high-frequency weight, low-frequency weight, Gaussian function slope value, and low-high frequency ratio discrimination value;

[0120] Traverse all the homomorphic filter parameters. For each traversed homomorphic filter parameter, take the current homomorphic filter parameter as the target homomorphic filter parameter, and obtain the image quality evaluation change curve within the value range of the target homomorphic filter parameter according to the initial values of all homomorphic filter parameters except the target homomorphic filter parameter;

[0121] Determine the initial optimal value of the target homomorphic filter parameter according to the image quality evaluation value of the image quality evaluation change curve.

[0122] In this embodiment, first, the initial value of the high-frequency weight is set to 2, the initial value of the low-frequency weight is set to 0.5, the initial value of the Gaussian function slope value is set to 4, and the initial value of the low-high frequency ratio discrimination value is set to 10. Secondly, the value ranges of the high-frequency weight, low-frequency weight, Gaussian function slope value, and low-high frequency ratio discrimination value are set to 1-10, 0-1, 1-20, and 0-20 respectively. Fix the initial values of the high-frequency weight, low-frequency weight, and Gaussian function slope value, and calculate the curve graph of the underwater image quality evaluation value UIQM changing with the value range of the low-high frequency ratio discrimination value. According to the curve graph, determine the value of the low-high frequency ratio discrimination value when UIQM reaches the maximum value, which is the initial optimal value of the low-high frequency ratio discrimination value. By analogy, determine the initial optimal values of the high-frequency weight, low-frequency weight, and Gaussian function slope value respectively. Compared with directly specifying each parameter in the prior art, this embodiment can design different homomorphic filter parameter values according to the quality of the image.

[0123] After obtaining the initial optimal values of each homomorphic filter parameter, in this embodiment, based on the simulated annealing method, determine the optimal value of the homomorphic filter parameter according to the initial optimal values of each homomorphic filter parameter. The specific process is as follows:

[0124] Perform homomorphic filtering on the fused image using the initial optimal value of the homomorphic filter parameter to obtain the initial image quality evaluation result;

[0125] Add random perturbations to the initial optimal value of the homomorphic filter parameter to obtain the homomorphic filter perturbation parameter;

[0126] Perform homomorphic filtering on the fused image according to the homomorphic filter perturbation parameter to obtain the image quality perturbation evaluation result;

[0127] Obtain the quality evaluation change value according to the initial image quality evaluation result and the image quality perturbation evaluation result;

[0128] Determine the probability value of the homomorphic filter perturbation parameter according to the quality evaluation change value;

[0129] Add random perturbations to the homomorphic filter perturbation parameter, update the homomorphic filter perturbation parameter, and repeat the above steps until the preset number of iterations is reached;

[0130] Determine the optimal homomorphic filter perturbation parameter according to the probability value of the homomorphic filter perturbation parameter, and use it as the optimal value of the homomorphic filter parameter.

[0131] In this embodiment, homomorphic filter enhancement based on the simulated annealing method is performed on the fused image, and the optimal value of the homomorphic filter parameter is determined by the simulated annealing method. Compared with directly performing homomorphic filtering on the original image, the method adopted in this embodiment can fully enhance the image details, make the image clearer, and thus make the image achieve a better visual effect.

[0132] Finally, in this embodiment, homomorphic filter enhancement is performed on the fused image according to the optimal value of the homomorphic filter parameter to obtain an underwater enhanced image. The specific steps include:

[0133] Perform frequency-domain processing on the fused image using the illumination-reflection model. The calculation formula of the illumination-reflection model is:

[0134] F(x, y) = i(x, y)·r(x, y)

[0135] Wherein, F(x,y) represents the fused image; i(x,y) represents the illumination component, that is, the low-frequency part in the fused image; r(x,y) represents the reflection component, that is, the high-frequency part in the fused image;

[0136] Perform a logarithmic operation on the fused image to obtain a logarithmic image. The calculation formula is:

[0137] ln F(x,y) = ln i(x,y) + ln r(x,y)

[0138] Perform a Fourier transform on the logarithmic image to obtain the frequency-domain expression of the logarithmic image:

[0139] DFT[ln F(x,y)[ = DFT[ln i(x,y)[ + DFT[ln r(x,y)]

[0140] The above formula can be sorted out as:

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

[0142] Perform frequency-domain filtering on the frequency-domain function F(u,v) using the frequency-domain filter H(u, v), so as to weaken the illumination component and enhance the reflection component in the frequency domain. The calculation formula is:

[0143] F(u, v)·H(u, v) = I(u, v)·H(u, v) + R(u, v)·H(u, v)

[0144] Perform the inverse Fourier transform on F(u, v)gH(u, v), and the calculation formula is:

[0145] h F (x, y) = h i (x, y) + h r (x, y)

[0146] Perform the exponential operation on the above formula to obtain the underwater enhanced image g(x, y), and the calculation formula is:

[0147]

[0148] In the formula, g(x, y) represents the underwater enhanced image.

[0149] Since the non-uniform illumination is manifested in the slowly varying incident component, which belongs to the low-frequency component, while the reflection component can reflect the details, contrast and other characteristics of the fused image, which belongs to the high-frequency component. Therefore, in this embodiment, the fused image is processed according to the illumination-reflection model, which can weaken the low-frequency component of the fused image and appropriately enhance the high-frequency component, so as to achieve the purpose of overcoming non-uniform illumination, compressing the dynamic range and enhancing the contrast. Figure 4 This is the result diagram of the underwater enhanced image after enhancing the original underwater image provided by this embodiment.

[0150] The embodiment of the present invention provides an underwater image adaptive enhancement method. The method uses the Laplace operator to sharpen the original underwater image to obtain a sharpened image, then performs adaptive median filtering to remove the noise in the sharpened image to obtain an adaptive median filtered image. At the same time, the edge detection operator is used to perform adaptive edge detection on the adaptive median filtered image to obtain an edge enhanced image. The sharpened image and the original underwater image are used to perform enhancement and fusion processing on the edge enhanced image, and homomorphic filtering enhancement based on the simulated annealing method is performed on the fused image to further increase the contrast and standardized brightness of the image. The underwater image adaptive enhancement method of the present invention combines algorithms such as filtering, sharpening and edge detection, has a good effect on enhancing underwater images with uneven illumination, and can adapt to the changes of image gradients and brightness, making the enhancement effect of the image better.

[0151] It should be noted that the magnitudes of the serial numbers of the above processes do not mean the order of execution. The execution order of each process should be determined according to its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.

[0152] In one embodiment, as Figure 5As shown in the figure, an embodiment of the present invention provides an underwater image adaptive enhancement system, and the system includes:

[0153] An image sharpening module 101, configured to collect an original underwater image, and perform sharpening processing on the original underwater image by using a pre-acquired weighting coefficient to obtain a sharpened image;

[0154] An edge enhancement module 102, configured to perform adaptive median filtering on the sharpened image to obtain an adaptive median filtered image; perform adaptive edge detection on the adaptive median filtered image to obtain an edge enhanced image;

[0155] An image fusion module 103, configured to obtain a binary image of the sharpened image, and perform a bitwise AND operation on the binary image and the edge enhanced image to obtain an edge image; and fuse the edge image with the original underwater image or the sharpened image according to the brightness of the sharpened image to obtain a fused image;

[0156] A filtering enhancement module 104, configured to determine an optimal value of homomorphic filtering parameters, and perform homomorphic filtering enhancement on the fused image according to the optimal value of the homomorphic filtering parameters to obtain an underwater enhanced image.

[0157] For the specific limitations of an underwater image adaptive enhancement system, reference may be made to the above limitations on an underwater image adaptive enhancement method, which will not be elaborated here. Those of ordinary skill in the art can realize that, in combination with the various modules and steps described in the embodiments disclosed in the present application, they can be implemented by hardware, software, or a combination of both. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.

[0158] An embodiment of the present invention provides an underwater image adaptive enhancement system. The system realizes the sharpening processing of the original underwater image through the image sharpening module; realizes the adaptive median filtering and adaptive edge detection of the sharpened image through the edge enhancement image; realizes the enhancement and fusion processing of the edge enhanced image by using the sharpened image and the original underwater image through the image fusion module; realizes the homomorphic filtering enhancement based on the simulated annealing method for the fused image through the filtering enhancement module, further increasing the contrast and standardized brightness of the image. Compared with the prior art, the present application can make full use of the rich gradient information of the underwater image itself to implement image enhancement processing, so that the visual quality of the processed image is improved and the texture information is rich, and it can be applied to underwater images in different environments.

[0159] Figure 6A computer device provided by an embodiment of the present invention includes a memory, a processor, and a transceiver, which are connected through a bus; the memory is used to store a set of computer program instructions and data, and can transmit the stored data to the processor, and the processor can execute the program instructions stored in the memory to perform the steps of the above method.

[0160] Among them, the memory may include a volatile memory or a non-volatile memory, or may include both a volatile and a non-volatile memory; the processor may be a central processing unit, a microprocessor, an application specific integrated circuit, a programmable logic device, or a combination thereof. By way of example but not limitation, the above programmable logic device may be a complex programmable logic device, a field programmable gate array, a generic array logic, or any combination thereof.

[0161] In addition, the memory may be a physically independent unit or integrated with the processor.

[0162] Those of ordinary skill in the art can understand that Figure 6 the structure shown in is only a block diagram of some structures related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have the same component arrangement.

[0163] In one embodiment, the embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above method are implemented.

[0164] An underwater image adaptive enhancement method, system, device and storage medium provided by the embodiment of the present invention. An underwater image adaptive enhancement method combines algorithms such as filtering, sharpening, and edge detection to implement an underwater image adaptive enhancement method for uneven illumination, significantly reducing a large amount of noise and error information generated when processing complex images, and can also reflect more detailed information of the image. The algorithm has a small amount of computation, a fast processing speed, and a low cost.

[0165] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present invention are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another, for example, the computer instructions can be transmitted from a website, computer, server, or data center to another website, computer, server, or data center by wire (such as coaxial cable, optical fiber, digital subscriber line) or wireless (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that the computer can access or a data storage device such as a server or data center that includes one or more integrated available media. The available medium can be a magnetic medium (such as a floppy disk, hard disk, magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as an SSD), etc.

[0166] Those skilled in the art can understand that all or part of the processes in the above embodiments of the method can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed, it can include the processes of the above embodiments of the respective methods.

[0167] The above embodiments only represent several preferred implementation manners of the present application. The description is relatively specific and detailed, but it should not be construed as a limitation on the scope of the invention patent. It should be noted that for those of ordinary skill in the art of the present technology, without departing from the technical principle of the present invention, several improvements and substitutions can be made, and these improvements and substitutions should also be regarded as the protection scope of the present application. Therefore, the protection scope of the patent of the present application should be subject to the protection scope of the claims.

Claims

1. An underwater image adaptive enhancement method, characterized in that, It includes the following steps: Collect the original underwater image, and perform sharpening processing on the original underwater image by using the pre-acquired weighting coefficient to obtain a sharpened image; Perform adaptive median filtering on the sharpened image to obtain an adaptive median filtered image; Perform adaptive edge detection on the adaptive median filtered image to obtain an edge-enhanced image; Obtain the binary image of the sharpened image, and perform a bitwise AND operation on the binary image and the edge-enhanced image to obtain an edge image; Fuse the edge image with the original underwater image or the sharpened image according to the brightness of the sharpened image to obtain a fused image; Determine the optimal value of the homomorphic filtering parameter, and perform homomorphic filtering enhancement on the fused image according to the optimal value of the homomorphic filtering parameter to obtain an underwater enhanced image.

2. The underwater image adaptive enhancement method according to claim 1, characterized in that, The weighting coefficient is determined according to the pixel value of each pixel point in the original underwater image, and the calculation formula of the sharpened image is: Wherein, In the formula, represents the sharpened image; M represents the weighting coefficient; represents the original underwater image; represents the convolution image obtained after the original underwater image is convolved with the Laplacian operator; represents the proportion of dark points in the original underwater image; represents the number of dark points in the original underwater image, where the dark points are determined according to the pixel value of each pixel point in the original underwater image and a preset dark point threshold of the original image; r represents the number of rows of the grayscale image matrix corresponding to the original underwater image; c represents the number of columns of the grayscale image matrix corresponding to the original underwater image.

3. An underwater image adaptive enhancement method according to claim 1, characterized in that, The step of performing adaptive median filtering on the sharpened image to obtain an adaptive median filtered image includes: Convert the sharpened image to a grayscale image, set the size of the initial filter window, and obtain the maximum grayscale value, minimum grayscale value, and grayscale median value of the grayscale image within the initial filter window; Judge whether the grayscale median value is between the maximum grayscale value and the minimum grayscale value. If the grayscale median value is between the maximum grayscale value and the minimum grayscale value, then judge whether the grayscale value of each pixel point within the initial filter window is between the minimum grayscale value and the maximum grayscale value. If not, it is determined that the current grayscale median value is noise, and the grayscale median value is output; If the grayscale value of each pixel point within the initial filter window is between the minimum grayscale value and the maximum grayscale value, it is determined that the current grayscale median value is not noise, and the grayscale value of the current pixel point is retained and output; If the grayscale median value is not between the maximum grayscale value and the minimum grayscale value, increase the size of the initial filter window according to the preset window increase rule, and search for non-noise points within the increased initial filter window. If it is increased to the maximum window size allowed by the filter and no non-noise points are found, the grayscale median value is output.

4. An underwater image adaptive enhancement method according to claim 1, characterized in that, The step of performing adaptive edge detection on the adaptive median filtered image to obtain an edge-enhanced image includes: Calculate the gradient magnitude and gradient direction of the adaptive median filtered image according to the Sobel operator; Perform non-maximum suppression on the adaptive median filtered image by using the gradient magnitude and the gradient direction, and process the non-maximum suppressed adaptive median filtered image by using the pre-acquired double thresholds to form an edge-enhanced image; Wherein, the double thresholds include a high edge threshold and a low edge threshold, and the obtaining steps of the high edge threshold and the low edge threshold are: Convert the sharpened image to a grayscale image, calculate the pixel average value and pixel standard deviation of all pixel points in the grayscale image, subtract the pixel average value from the pixel standard deviation to obtain the low edge threshold, and obtain the high edge threshold for the sharpened image by using the Otsu method.

5. The underwater image adaptive enhancement method according to claim 1, characterized in that The fused image includes a bright fused image or a dark fused image. The step of fusing the edge image with the original underwater image or the sharpened image according to the brightness of the sharpened image to obtain a fused image includes: Determine the proportion of dark points in the sharpened image according to the pixel value of each pixel point in the sharpened image; Classify the sharpened image as a dark image or a bright image according to the proportion of dark points and a preset dark point threshold of the sharpened image; If the sharpened image is classified as a bright image, fuse the edge image with the original underwater image to obtain a bright fused image; If the sharpened image is classified as a dark image, fuse the edge image with the sharpened image to obtain a dark fused image.

6. The underwater image adaptive enhancement method according to claim 1, wherein The step of determining the optimal value of the homomorphic filtering parameters includes: Determine the initial optimal values of each homomorphic filter parameter; wherein, the homomorphic filter parameters include a high-frequency weight, a low-frequency weight, a Gaussian function slope value, and a low-high frequency ratio discrimination value; Perform homomorphic filtering on the fused image by using the initial optimal values of the homomorphic filter parameters to obtain an initial image quality evaluation result; Add random perturbations to the initial optimal values of the homomorphic filter parameters to obtain homomorphic filter perturbation parameters; Perform homomorphic filtering on the fused image according to the homomorphic filter perturbation parameters to obtain an image quality perturbation evaluation result; Obtain a quality evaluation change value according to the initial image quality evaluation result and the image quality perturbation evaluation result; Determine the probability value of the homomorphic filter perturbation parameter according to the quality evaluation change value; Add random perturbations to the homomorphic filter perturbation parameters, update the homomorphic filter perturbation parameters, and repeat the above steps until a preset number of iterations is reached; Determine the optimal homomorphic filter perturbation parameter according to the probability value of the homomorphic filter perturbation parameter, and use it as the optimal value of the homomorphic filtering parameters.

7. An underwater image adaptive enhancement method according to claim 6, characterized in that, The step of determining the initial optimal values of each homomorphic filter parameter includes: Preset the initial values and value ranges of each homomorphic filter parameter; Traverse all the homomorphic filter parameters. For each traversed homomorphic filter parameter, use the current homomorphic filter parameter as the target homomorphic filter parameter, and obtain the image quality evaluation change curve within the value range of the target homomorphic filter parameter according to the initial values of all the homomorphic filter parameters except the target homomorphic filter parameter; Determine the initial optimal value of the target homomorphic filter parameter according to the image quality evaluation value of the image quality evaluation change curve.

8. An underwater image adaptive enhancement system, characterized in that, The system includes: An image sharpening module, configured to collect an original underwater image and perform sharpening processing on the original underwater image by using a pre-acquired weighting coefficient to obtain a sharpened image; An edge enhancement module, configured to perform adaptive median filtering on the sharpened image to obtain an adaptive median filtered image; perform adaptive edge detection on the adaptive median filtered image to obtain an edge enhanced image; An image fusion module, configured to obtain a binary image of the sharpened image, perform a bitwise AND operation on the binary image and the edge enhanced image to obtain an edge image; and fuse the edge image with the original underwater image or the sharpened image according to the brightness of the sharpened image to obtain a fused image; A filtering and enhancement module, configured to determine an optimal value of homomorphic filtering parameters, and perform homomorphic filtering enhancement on the fused image according to the optimal value of the homomorphic filtering parameters to obtain an underwater enhanced image.

9. A computer device, characterized in that: It includes a processor and a memory. The processor is connected to the memory. The memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory so that the computer device executes the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: A computer program is stored in the computer-readable storage medium. When the computer program is run, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Underwater real-time image enhancement method based on multi-algorithm fusion

    CN113269681A

  • High-dynamic infrared image adaptive enhancement and compression method

    CN115496695A