An image enhancement method based on sparse contrast mean shift
Patent Information
- Application Number
- CN202610787567.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-03
- Publication Date
- 2026-08-28
AI Technical Summary
但该算法主要存在以下缺点:(1)全局固定带宽导致去噪与保边难以平衡
[0100] 1. This method is simple in design and significantly improves noise suppression capability and target recognition accuracy;
Smart Images

Figure CN122656950A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of sonar technology and image enhancement, specifically an image enhancement method based on sparse contrast Mean-shift. Background Technology
[0002] Imaging sonar, with its superior penetration capabilities and adaptability to complex marine environments, is indispensable for underwater detection. With the continuous growth of human demand for marine resource development and space utilization, underwater detection has become one of the core challenges facing the field of marine engineering. As the primary technology for long-range underwater detection, sonar images the sound waves reflected from targets, and the image quality is a key basis for underwater detection engineering. However, in complex sea conditions, the high-power pulse signals of imaging sonar are easily affected by factors such as water flow disturbances, suspended particles, and temperature and salinity changes, causing scattering, attenuation, and deflection of sound waves during propagation, reducing the quality and intensity of the echo signal. The time-varying nature and spatial complexity of underwater acoustic channels cause reverberation noise to highly overlap with the target signal in the time and frequency domains, often resulting in blurred target contours and edge distortion. Random speckle noise not only masks the target echo characteristics and reduces image clarity but also exacerbates background noise, further increasing the difficulty of subsequent processing. These problems not only restrict the visual recognition capability of sonar images but also affect the accuracy of underwater target identification and localization algorithms. Therefore, the urgent need for a technology that can effectively suppress noise while simultaneously enhancing image details and textures has become a key scientific problem that needs to be solved in the field of underwater image processing.
[0003] Mean-shift image denoising is a nonlinear filtering method based on kernel density gradient estimation. When processing noisy images, the algorithm iteratively calculates the Mean-shift vector for each pixel in the pixel feature space (usually a high-dimensional feature space composed of spatial coordinates and gray values), which is the offset of the current point towards the direction of the maximum density gradient of the samples in the neighborhood. By continuously moving the feature position of the pixel along the density gradient direction, all pixels eventually converge to their respective local density maxima (modal points). During the convergence process, high-frequency noise components, because they are distributed in low-density areas, are attracted to the nearby high-density cluster centers, thus achieving noise filtering. At the same time, due to the significant difference in density distribution on both sides of the target edge region in the image, the pixels converge to different modalities, and the edge is preserved.
[0004] The Mean-shift filtering algorithm does not require a pre-defined noise model and has good edge preservation performance, making it very important in image denoising. However, the algorithm has the following main drawbacks: (1) The fixed global bandwidth makes it difficult to balance denoising and edge preservation. The kernel bandwidth of the Mean-shift algorithm needs to be pre-set and globally fixed. When the bandwidth is too large, the pixels of adjacent target regions will be pulled into the same mode, resulting in excessive smoothing of the target edges and blurring of the contours; when the bandwidth is too small, the algorithm's convergence pull on noise pixels is insufficient, and a large number of noise points cannot be effectively gathered to the center of the mode, resulting in incomplete denoising. (2) Limited robustness to high-intensity speckle noise. When the sonar image is subjected to severe speckle noise or reverberation interference, the real target sample points in the feature space are surrounded by a large number of noise sample points, and the region of maximum density may deviate from the true feature distribution of the target, causing the pixel points to converge to the wrong mode, resulting in distortion or structural deformation of the target region. Summary of the Invention
[0005] The purpose of this invention is to provide an image enhancement method based on sparse contrast Mean-shift to solve the problems mentioned in the background art.
[0006] To achieve the above objectives, the present invention provides the following technical solution:
[0007] An image enhancement method based on sparse contrast mean-shift includes the following steps:
[0008] (1) Finite orthogonal contrast calculation: By introducing the guard radius and orthogonal convolution kernel, a finite orthogonal contrast calculation strategy is designed to perform local contrast estimation on the input sonar image, thereby improving the robustness of feature estimation.
[0009] (2) Sparse contrast weighted Mean-shift denoising: Based on the sparse contrast calculated in step (1), the Mean-shift algorithm is improved by weighting, smooth denoising is performed in the low contrast region, the contrast kernel response weight is enhanced in the high contrast region, and the target edge and structural contour are preserved.
[0010] (3) Adaptive unsharpened mask image enhancement: Construct an adaptive unsharpened mask enhancement model, use the orthogonal contrast obtained in step (1) to dynamically adjust the gain coefficient, perform high gain sharpening on the target area, and suppress the background area at the same time, and output the enhanced image.
[0011] Finite orthogonal contrast calculation: Consider a two-dimensional discrete grayscale sonar image. pixel values , For pixel coordinates, Define the image domain, given the pixel protection radius. Define size as Finite orthogonal discrete convolution kernels The core is at the center point The four orthogonal directions of a two-dimensional discrete grayscale sonar image, with a distance of , are given by . The unit impulse response is taken at position , and zero is taken at other positions. The mathematical expression is as follows:
[0012]
[0013]
[0014] in, It is a two-dimensional Kronecker delta function if and only if and The value is 1 if it is true, and 0 otherwise.
[0015] Two-dimensional discrete grayscale sonar images Apply convolution kernel Perform two-dimensional discrete convolution to obtain the orthogonal neighborhood aggregation response. :
[0016]
[0017]
[0018] The response is essentially the center pixel. Four orthogonal directions, with a distance of The sum of the gray values of the far-end pixels, and the sum of the differences between the center pixel and the four orthogonal far-end pixels, are defined as the finite orthogonal local contrast. :
[0019]
[0020] Sparse contrast-weighted Mean-shift noise reduction: ①LAB color space conversion: Sonar images are essentially single-channel data based on echo intensity. They are usually converted to RGB format through pseudo-color mapping for display and storage. However, the RGB color space depends on the specific mapping scheme and display device. It is a device-dependent color space, which lacks objective consistency and is not conducive to quantitative analysis. Therefore, sonar images are converted to a device-independent and perceptually uniform color space to improve their applicability and robustness in visual processing tasks and provide a more stable data foundation for subsequent color feature-based analysis.
[0021] By leveraging the XYZ colorimetric fundamental space to achieve device independence and establish perceptual uniformity of objective color, the conversion rule from linear RGB sonar images to XYZ space is as follows:
[0022]
[0023] in yes standard Transformation matrix, Representing sonar images RGB components;
[0024] The LAB color space compresses the XYZ dynamic range through non-linear transformation to achieve perceptual uniformity. Before conversion, a white point referenced from a D65 standard light source is required. Normalize the XYZ values;
[0025] To reconcile the differences between nonlinear sensing and linear storage, an auxiliary function is introduced. :
[0026]
[0027] The formula for calculating LAB components is as follows:
[0028]
[0029]
[0030]
[0031] Finally, the sonar image after color space conversion is obtained. It can be seen that the Euclidean distance in the LAB space is smaller, indicating that its color similarity is higher and its robustness to underwater noise is stronger.
[0032] ②Sparse contrast kernel function: To address the problem that relying on color similarity is difficult to effectively preserve image edges, a contrast similarity constraint is introduced in high-contrast regions to construct a sparse contrast-weighted mean-shift filtering model. This model uses traditional mean-shift noise reduction in flat regions to ensure smoothness and reduce redundant computation. In sensitive regions, a contrast-weighted kernel function is introduced to enhance the weight of the contrast parameter and improve edge perception, thereby achieving a good balance between effectively smoothing noise and preserving edge details.
[0033] To prove the convergence of sparse contrast-weighted mean-shift, based on kernel density estimation, we assume that the spatial, color, and contrast kernel functions are all Gaussian kernels, denoted as follows: , and And weighted and fused into a composite kernel function:
[0034]
[0035]
[0036] in , To achieve a uniform bandwidth, the corresponding kernel density estimate is:
[0037]
[0038] in Let be the normalization constant of the composite kernel. Differentiating the above equation, we get:
[0039]
[0040] Based on the derivative property of the Gaussian kernel function, for any kernel function... have Substituting into the above equation and simplifying, we get:
[0041]
[0042]
[0043] Simplifying the above equation, we get:
[0044]
[0045] It can be written as an offset:
[0046]
[0047] The gradient formula then simplifies to:
[0048]
[0049] The transformed form is:
[0050]
[0051] As can be seen from the above formula, in the sparse contrast-weighted Mean-shift algorithm, and The offset is directly proportional to the single-core case; compared to the single-core case, the offset obtained by this algorithm is... and It integrates the weight characteristics of different kernel functions, but the core mechanism of density gradient guided offset remains unchanged: the algorithm drives the current point to move towards the local density peak along the direction of the kernel density gradient.
[0052] The details of the sparse contrast-weighted mean-shift algorithm for noise reduction in image edge regions are as follows: Let the current pixel point... Its pixel value Orthogonal contrast amplitude Space broadband Color broadband and orthogonal contrast broadband The convergence threshold is ;
[0053] For point Its eigenvector is by Build a neighborhood around the center:
[0054]
[0055] Take neighboring points within the neighborhood. Its pixel value Orthogonal contrast amplitude Spatial weight The calculation is as follows:
[0056]
[0057] Color weight The calculation is as follows:
[0058]
[0059] Orthogonal contrast weight The calculation is as follows:
[0060]
[0061] Total weight The calculation is as follows:
[0062]
[0063] Update color value The calculation formula is as follows:
[0064]
[0065] Color shift amount The calculation is as follows:
[0066]
[0067] Convergence is determined as follows:
[0068]
[0069] If the updated color value If the convergence condition is satisfied, then let Output the point; otherwise, output the value. Return point as the current color value Continue iterating until convergence;
[0070] Adaptive unsharpened mask image enhancement: Based on the above image denoising, an adaptive unsharpened enhancement algorithm is further introduced;
[0071] ① Adaptive Unsharpened Coefficient Model Construction
[0072] Based on this point orthogonal contrast Design adaptive coefficients It also satisfies the following mathematical properties:
[0073] Monotonicity: Normalized orthogonal contrast The greater the contrast, the stronger the enhancement.
[0074] Boundedness: Does a minimum value exist? and maximum value Avoid overshooting or undershooting;
[0075] Threshold property: There exists a threshold. , making when hour ;
[0076] Smoothness: Infinitely differentiable, ensuring the continuity of the results;
[0077] Based on the above requirements, an adaptive model is constructed using the hyperbolic tangent function, as shown in the following expression:
[0078]
[0079] in:
[0080] This is a threshold parameter that controls the boundary between enhancement and suppression;
[0081] The amplitude parameter controls the maximum intensity of enhancement / suppression;
[0082] This is a steepness parameter that controls the steepness of the transition region;
[0083] ② Model parameter determination and analysis
[0084] parameter Determination of: Let The probability density function is The cumulative distribution function is Considering that the target area occupies a small proportion in the sonar image, take Distribution quantiles as ,Right now ,in The range of 0.75-0.85 corresponds to the 15%-25% of pixels with the highest contrast, which are considered as the target area, based on the fact that the area of the target area does not exceed 25% of the total area of the image
[001] .
[0085] parameter Determination of amplitude parameters The local signal-to-noise ratio (DNR) is negatively correlated with the image signal-to-noise ratio (SNR). Let be the ratio of the local mean to the standard deviation, then:
[0086]
[0087] in For the maximum allowable range, As an attenuation factor, this design allows high signal-to-noise ratio images to require only a small enhancement, while low signal-to-noise ratio images receive a stronger enhancement;
[0088] parameter Determination of steepness parameters The coefficient of variation is defined as being positively correlated with the concentration of the orthogonal contrast distribution. Let be the ratio of the standard deviation to the local mean, then:
[0089]
[0090] in Base steepness, As a regulating factor, Using the baseline coefficient of variation, this design allows for a steep transition when the contrast distribution is concentrated and a smooth transition when it is dispersed;
[0091] ③ Adaptive unsharpened mask model
[0092] To mitigate the overshoot and undershoot issues in unsharpened mask image enhancement, adaptive unsharpening coefficients are substituted into the unsharpened mask model, resulting in:
[0093]
[0094] in, For the sharpened image pixels, The Gaussian blur value of the image pixel;
[0095] As can be seen from the above formula, when the orthogonal contrast is large, the enhancement is greater, making the high grayscale area brighter, while the low grayscale area is brighter.
[0096] As a further aspect of the present invention: in step (1), the finite orthogonal contrast calculation avoids feature degradation in the target edge region due to excessively large convolution kernels by setting a protection radius.
[0097] As a further aspect of the present invention: the sparse contrast weighting strategy in step (2) is to use local contrast as a weighting factor and adjust the influence of the kernel function of the space and grayscale domain during the Mean-shift iteration process to achieve differentiated filtering intensity.
[0098] As a further aspect of the present invention: the adaptive unsharpened mask image enhancement model in step (3) uses orthogonal contrast to dynamically adjust the gain coefficient of the unsharpened mask. The region with higher contrast is given a higher sharpening gain, while the region with lower contrast is suppressed.
[0099] Compared with the prior art, the beneficial effects of the present invention are:
[0100] 1. This method is simple in design and significantly improves noise suppression capability and target recognition accuracy;
[0101] 2. This method has portability and adaptability, and is widely used in various sonar systems;
[0102] 3. This method effectively overcomes the limitations of traditional methods in balancing feature enhancement and noise suppression, and alleviates the problems of blurred target contours and excessive smoothing. Attached Figure Description
[0103] Figure 1 This is a flowchart illustrating the image enhancement method based on sparse contrast Mean-shift.
[0104] Figure 2 This is a comparison chart of sampling points and spatial similarity in sonar images.
[0105] Figure 3 This is a diagram illustrating the iterative process of the sparse contrast Mean-shift algorithm.
[0106] Figure 4 This is an image showing the effect of adaptive unsharpened mask image enhancement. Detailed Implementation
[0107] Various exemplary embodiments, features, and aspects of this application will now be described in detail with reference to the accompanying drawings. The same reference numerals in the drawings denote elements that have the same or similar functions. Although various aspects of the embodiments are shown in the drawings, they are not necessarily drawn to scale unless specifically indicated otherwise.
[0108] The term “exemplary” as used herein means “serving as an example, embodiment, or illustration.” Any embodiment illustrated herein as “exemplary” is not necessarily to be construed as superior to or better than other embodiments.
[0109] Furthermore, to better illustrate this application, numerous specific details are provided in the following detailed embodiments. Those skilled in the art should understand that this application can be implemented even without certain specific details. In some instances, methods, means, and elements well-known to those skilled in the art have not been described in detail in order to highlight the main points of this application.
[0110] Example 1
[0111] Please see Figure 1-4 An image enhancement method based on sparse contrast Mean-shift includes the following steps:
[0112] (1) Finite orthogonal contrast calculation: By introducing the guard radius and orthogonal convolution kernel, a finite orthogonal contrast calculation strategy is designed to perform local contrast estimation on the input sonar image, thereby improving the robustness of feature estimation.
[0113] (2) Sparse contrast weighted Mean-shift denoising: Based on the sparse contrast calculated in step (1), the Mean-shift algorithm is improved by weighting, smooth denoising is performed in the low contrast region, the contrast kernel response weight is enhanced in the high contrast region, and the target edge and structural contour are preserved.
[0114] (3) Adaptive unsharpened mask image enhancement: Construct an adaptive unsharpened mask enhancement model, use the orthogonal contrast obtained in step (1) to dynamically adjust the gain coefficient, perform high gain sharpening on the target area, and suppress the background area at the same time, and output the enhanced image.
[0115] Finite orthogonal contrast calculation: Consider a two-dimensional discrete grayscale sonar image. pixel values , For pixel coordinates, Define the image domain, given the pixel protection radius. Define size as Finite orthogonal discrete convolution kernels The core is at the center point The four orthogonal directions of a two-dimensional discrete grayscale sonar image, with a distance of , are given by . The unit impulse response is taken at position , and zero is taken at other positions. The mathematical expression is as follows:
[0116]
[0117]
[0118] in, It is a two-dimensional Kronecker delta function if and only if and The value is 1 if it is true, and 0 otherwise.
[0119] Two-dimensional discrete grayscale sonar images Apply convolution kernel Perform two-dimensional discrete convolution to obtain the orthogonal neighborhood aggregation response. :
[0120]
[0121]
[0122] The response is essentially the center pixel. Four orthogonal directions, with a distance of The sum of the gray values of the far-end pixels, and the sum of the differences between the center pixel and the four orthogonal far-end pixels, are defined as the finite orthogonal local contrast. :
[0123]
[0124] Sparse contrast-weighted mean-shift noise reduction:
[0125] Traditional mean-shift noise reduction algorithms rely solely on color and spatial similarity metrics, neglecting local geometric information and potentially leading to overly smoothed edges in sonar images. To address this, an improved sparse contrast-weighted mean-shift algorithm is proposed. Based on color space transformation, a sparse contrast-weighted similarity kernel function is introduced, employing different mean-shift modes to smooth noise in different regions, thus avoiding loss of edge details and achieving a balance between detail and global structure.
[0126] ①LAB Color Space Conversion: Sonar images are essentially single-channel data based on echo intensity. They are usually converted to RGB format via pseudo-color mapping for display and storage. However, the RGB color space depends on the specific mapping scheme and display device, and is a device-dependent color space. It lacks objective consistency and is not conducive to quantitative analysis. Therefore, sonar images are converted to a device-independent and perceptually uniform color space to improve their applicability and robustness in visual processing tasks and provide a more stable data foundation for subsequent color feature-based analysis.
[0127] By leveraging the XYZ colorimetric fundamental space to achieve device independence and establish perceptual uniformity of objective color, the conversion rule from linear RGB sonar images to XYZ space is as follows:
[0128]
[0129] in yes standard Transformation matrix, Representing sonar images RGB components;
[0130] The LAB color space compresses the XYZ dynamic range through non-linear transformation to achieve perceptual uniformity. Before conversion, a white point referenced from a D65 standard light source is required. Normalize the XYZ values;
[0131] To reconcile the differences between nonlinear sensing and linear storage, an auxiliary function is introduced. :
[0132]
[0133] The formula for calculating LAB components is as follows:
[0134]
[0135]
[0136]
[0137] Finally, the sonar image after color space conversion is obtained. It can be seen that the Euclidean distance in the LAB space is smaller, indicating that its color similarity is higher and its robustness to underwater noise is stronger.
[0138] ②Sparse contrast kernel function: To address the problem that relying on color similarity is difficult to effectively preserve image edges, a contrast similarity constraint is introduced in high-contrast regions to construct a sparse contrast-weighted mean-shift filtering model. This model uses traditional mean-shift noise reduction in flat regions to ensure smoothness and reduce redundant computation. In sensitive regions, a contrast-weighted kernel function is introduced to enhance the weight of the contrast parameter and improve edge perception, thereby achieving a good balance between effectively smoothing noise and preserving edge details.
[0139] To prove the convergence of sparse contrast-weighted mean-shift, based on kernel density estimation, we assume that the spatial, color, and contrast kernel functions are all Gaussian kernels, denoted as follows: , and And weighted and fused into a composite kernel function:
[0140]
[0141]
[0142] in , To achieve a uniform bandwidth, the corresponding kernel density estimate is:
[0143]
[0144] in Let be the normalization constant of the composite kernel. Differentiating the above equation, we get:
[0145]
[0146] Based on the derivative property of the Gaussian kernel function, for any kernel function... have Substituting into the above equation and simplifying, we get:
[0147]
[0148]
[0149] Simplifying the above equation, we get:
[0150]
[0151] It can be written as an offset:
[0152]
[0153] The gradient formula then simplifies to:
[0154]
[0155] The transformed form is:
[0156]
[0157] As can be seen from the above formula, in the sparse contrast-weighted Mean-shift algorithm, and The offset is directly proportional to the single-core case; compared to the single-core case, the offset obtained by this algorithm is... and It integrates the weight characteristics of different kernel functions, but the core mechanism of density gradient guided offset remains unchanged: the algorithm drives the current point to move towards the local density peak along the direction of the kernel density gradient.
[0158] The details of the sparse contrast-weighted mean-shift algorithm for noise reduction in image edge regions are as follows: Let the current pixel point... Its pixel value Orthogonal contrast amplitude Space broadband Color broadband and orthogonal contrast broadband The convergence threshold is ;
[0159] For point Its eigenvector is by Build a neighborhood around the center:
[0160]
[0161] Take neighboring points within the neighborhood. Its pixel value Orthogonal contrast amplitude Spatial weight The calculation is as follows:
[0162]
[0163] Color weight The calculation is as follows:
[0164]
[0165] Orthogonal contrast weight The calculation is as follows:
[0166]
[0167] Total weight The calculation is as follows:
[0168]
[0169] Update color value The calculation formula is as follows:
[0170]
[0171] Color shift amount The calculation is as follows:
[0172]
[0173] Convergence is determined as follows:
[0174]
[0175] If the updated color value If the convergence condition is satisfied, then let Output the point; otherwise, output the value. Return point as the current color value Continue iterating until convergence;
[0176] Adaptive unsharpened mask image enhancement: Based on the above image denoising, an adaptive unsharpened enhancement algorithm is further introduced;
[0177] ① Adaptive Unsharpened Coefficient Model Construction
[0178] Based on this point orthogonal contrast Design adaptive coefficients It also satisfies the following mathematical properties:
[0179] Monotonicity: Normalized orthogonal contrast The greater the contrast, the stronger the enhancement.
[0180] Boundedness: Does a minimum value exist? and maximum value Avoid overshooting or undershooting;
[0181] Threshold property: There exists a threshold. , making when hour ;
[0182] Smoothness: Infinitely differentiable, ensuring the continuity of the results;
[0183] Based on the above requirements, an adaptive model is constructed using the hyperbolic tangent function, as shown in the following expression:
[0184]
[0185] in:
[0186] This is a threshold parameter that controls the boundary between enhancement and suppression;
[0187] The amplitude parameter controls the maximum intensity of enhancement / suppression;
[0188] This is a steepness parameter that controls the steepness of the transition region;
[0189] ② Model parameter determination and analysis
[0190] parameter Determination of: Let The probability density function is The cumulative distribution function is Considering that the target area occupies a small proportion in the sonar image, take Distribution quantiles as ,Right now ,in The range of 0.75-0.85 corresponds to the 15%-25% of pixels with the highest contrast, which are considered as the target area, based on the fact that the area of the target area does not exceed 25% of the total area of the image
[001] .
[0191] parameter Determination of amplitude parameters The local signal-to-noise ratio (DNR) is negatively correlated with the image signal-to-noise ratio (SNR). Let be the ratio of the local mean to the standard deviation, then:
[0192]
[0193] in For the maximum allowable range, As an attenuation factor, this design allows high signal-to-noise ratio images to require only a small enhancement, while low signal-to-noise ratio images receive a stronger enhancement;
[0194] parameter Determination of steepness parameters The coefficient of variation is defined as being positively correlated with the concentration of the orthogonal contrast distribution. Let be the ratio of the standard deviation to the local mean, then:
[0195]
[0196] in Base steepness, As a regulating factor, Using the baseline coefficient of variation, this design allows for a steep transition when the contrast distribution is concentrated and a smooth transition when it is dispersed;
[0197] ③ Adaptive unsharpened mask model
[0198] To mitigate the overshoot and undershoot issues in unsharpened mask image enhancement, adaptive unsharpening coefficients are substituted into the unsharpened mask model, resulting in:
[0199]
[0200] in, For the sharpened image pixels, The Gaussian blur value of the image pixel;
[0201] As shown in the above formula, when the orthogonal contrast is large, the enhancement is greater, making high grayscale areas brighter, while the brightening effect on low grayscale areas is smaller. When applied to areas with drastic pixel changes, it can effectively enhance the target and suppress the background, thereby achieving image sharpening.
[0202] Preferably, in step (1), the finite orthogonal contrast calculation avoids feature degradation in the target edge region due to excessively large convolution kernels by setting a protection radius.
[0203] Preferably, the sparse contrast weighting strategy in step (2) is: using local contrast as a weighting factor, adjusting the influence of the kernel function in the spatial and grayscale domains during the Mean-shift iteration process to achieve differentiated filtering intensity.
[0204] Preferably, the adaptive unsharpened mask image enhancement model in step (3) dynamically adjusts the gain coefficient of the unsharpened mask using orthogonal contrast. Regions with higher contrast are given higher sharpening gain, while regions with lower contrast are suppressed.
[0205] It should be specifically noted that this invention lies in the concept of fusing sparse contrast with Mean-shift. This concept breaks through the limitations of traditional image enhancement, going beyond simple global filtering or single contrast enhancement to jointly model local contrast features and spatial clustering characteristics. By mining the structural differences in contrast distribution between the target and the background in the image, it can more accurately enhance the target contour and suppress high-intensity underwater noise, effectively overcoming interference from complex acoustic environments and improving the accuracy and robustness of the enhancement results.
[0206] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the invention. Therefore, the embodiments should be considered in all respects as exemplary and non-limiting, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, it is intended that all variations falling within the meaning and scope of equivalents of the claims be included within the present invention.
[0207] Furthermore, it should be understood that although this specification describes embodiments, not every embodiment contains only one independent technical solution. This narrative style is merely for clarity. Those skilled in the art should consider the specification as a whole, and the technical solutions in each embodiment can also be appropriately combined to form other embodiments that can be understood by those skilled in the art.
Claims
1. An image enhancement method based on sparse contrast mean-shift, characterized in that, Includes the following steps: (1) Finite orthogonal contrast calculation: By introducing the guard radius and orthogonal convolution kernel, a finite orthogonal contrast calculation strategy is designed to perform local contrast estimation on the input sonar image, thereby improving the robustness of feature estimation. (2) Sparse contrast weighted Mean-shift denoising: Based on the sparse contrast calculated in step (1), the Mean-shift algorithm is improved by weighting, smooth denoising is performed in the low contrast region, the contrast kernel response weight is enhanced in the high contrast region, and the target edge and structural contour are preserved. (3) Adaptive unsharpened mask image enhancement: Construct an adaptive unsharpened mask enhancement model, use the orthogonal contrast obtained in step (1) to dynamically adjust the gain coefficient, perform high gain sharpening on the target area, and suppress the background area at the same time, and output the enhanced image. Finite orthogonal contrast calculation: Consider a two-dimensional discrete grayscale sonar image. pixel values , For pixel coordinates, Define the image domain, given the pixel protection radius. Define size as Finite orthogonal discrete convolution kernels The core is at the center point The four orthogonal directions of a two-dimensional discrete grayscale sonar image, with a distance of . The unit impulse response is taken at position , and zero is taken at other positions. The mathematical expression is as follows: ; ; in, It is a two-dimensional Kronecker delta function if and only if and The value is 1 if the condition is met, and 0 otherwise. Two-dimensional discrete grayscale sonar images Apply convolution kernel Perform two-dimensional discrete convolution to obtain the orthogonal neighborhood aggregation response. : ; ; The response is essentially the center pixel. Four orthogonal directions, with a distance of The sum of the gray values of the far-end pixels, and the sum of the differences between the center pixel and the four orthogonal far-end pixels, are defined as the finite orthogonal local contrast. : ; Sparse contrast-weighted Mean-shift noise reduction: ①LAB color space conversion: Sonar images are essentially single-channel data based on echo intensity. They are usually converted to RGB format through pseudo-color mapping for display and storage. However, the RGB color space depends on the specific mapping scheme and display device. It is a device-dependent color space, which lacks objective consistency and is not conducive to quantitative analysis. Therefore, sonar images are converted to a device-independent and perceptually uniform color space to improve their applicability and robustness in visual processing tasks and provide a more stable data foundation for subsequent color feature-based analysis. By leveraging the XYZ colorimetric fundamental space to achieve device independence and establish perceptual uniformity of objective color, the conversion rule from linear RGB sonar images to XYZ space is as follows: ; in yes standard Transformation matrix, Representing sonar images RGB components; The LAB color space compresses the XYZ dynamic range through non-linear transformation to achieve perceptual uniformity. Before conversion, a white point referenced from a D65 standard light source is required. Normalize the XYZ values; To reconcile the differences between nonlinear sensing and linear storage, an auxiliary function is introduced. : ; The formula for calculating LAB components is as follows: ; ; ; Finally, the sonar image after color space conversion is obtained. It can be seen that the Euclidean distance in the LAB space is smaller, indicating that its color similarity is higher and its robustness to underwater noise is stronger. ②Sparse contrast kernel function: To address the problem that relying on color similarity is difficult to effectively preserve image edges, a contrast similarity constraint is introduced in high-contrast regions to construct a sparse contrast-weighted mean-shift filtering model. This model uses traditional mean-shift noise reduction in flat regions to ensure smoothness and reduce redundant computation. In sensitive regions, a contrast-weighted kernel function is introduced to enhance the weight of the contrast parameter and improve edge perception, thereby achieving a good balance between effectively smoothing noise and preserving edge details. To prove the convergence of sparse contrast-weighted mean-shift, based on kernel density estimation, we assume that the spatial, color, and contrast kernel functions are all Gaussian kernels, denoted as follows: , and And weighted and fused into a composite kernel function: ; ; in , To achieve a uniform bandwidth, the corresponding kernel density estimate is: ; in Let be the normalization constant of the composite kernel. Differentiating the above equation, we get: ; Based on the derivative property of the Gaussian kernel function, for any kernel function... have Substituting into the above equation and simplifying, we get: ; ; Simplifying the above equation, we get: ; It can be written as an offset: ; The gradient formula then simplifies to: ; The transformed form is: ; As can be seen from the above formula, in the sparse contrast-weighted Mean-shift algorithm, and The offset is directly proportional to the single-core case; compared to the single-core case, the offset obtained by this algorithm is... and It integrates the weight characteristics of different kernel functions, but the core mechanism of density gradient guided offset remains unchanged: the algorithm drives the current point to move towards the local density peak along the direction of the kernel density gradient. The details of the sparse contrast-weighted mean-shift algorithm for noise reduction in image edge regions are as follows: Let the current pixel point... Its pixel value Orthogonal contrast amplitude Space broadband Color broadband and orthogonal contrast broadband The convergence threshold is ; For point Its eigenvector is by Build a neighborhood around the center: ; Take neighboring points within the neighborhood. Its pixel value Orthogonal contrast amplitude Spatial weight The calculation is as follows: ; Color weight The calculation is as follows: ; Orthogonal contrast weight The calculation is as follows: ; Total weight The calculation is as follows: ; Update color value The calculation formula is as follows: ; Color shift amount The calculation is as follows: ; Convergence is determined as follows: ; If the updated color value If the convergence condition is satisfied, then let Output the point; otherwise, output the value. Return point as the current color value Continue iterating until convergence; Adaptive unsharpened mask image enhancement: Based on the above image denoising, an adaptive unsharpened enhancement algorithm is further introduced; ① Construction of Adaptive Unsharpened Coefficient Model Based on this point orthogonal contrast Design adaptive coefficients It also satisfies the following mathematical properties: Monotonicity: Normalized orthogonal contrast The greater the contrast, the stronger the enhancement. Boundedness: Does a minimum value exist? and maximum value Avoid overshooting or undershooting; Threshold property: There exists a threshold. , making when hour ; Smoothness: Infinitely differentiable, ensuring the continuity of the results; Based on the above requirements, an adaptive model is constructed using the hyperbolic tangent function, as shown in the following expression: ; in: This is a threshold parameter that controls the boundary between enhancement and suppression; The amplitude parameter controls the maximum intensity of enhancement / suppression; This is a steepness parameter that controls the steepness of the transition region; ② Model parameter determination and analysis parameter Determination of: Let The probability density function is The cumulative distribution function is Considering that the target area occupies a small proportion in the sonar image, take Distribution quantiles as ,Right now ,in The range of 0.75-0.85 corresponds to the 15%-25% of pixels with the highest contrast, which are considered as the target area, based on the fact that the area of the target area does not exceed 25% of the total area of the image [001]. parameter Determination of amplitude parameters The local signal-to-noise ratio (DNR) is negatively correlated with the image signal-to-noise ratio (SNR). Let be the ratio of the local mean to the standard deviation, then: ; in For the maximum allowable range, As an attenuation factor, this design allows high signal-to-noise ratio images to require only a small enhancement, while low signal-to-noise ratio images receive a stronger enhancement; parameter Determination of steepness parameters The coefficient of variation is defined as being positively correlated with the concentration of the orthogonal contrast distribution. Let be the ratio of the standard deviation to the local mean, then: ; in Base steepness, As a regulating factor, Using the baseline coefficient of variation, this design allows for a steep transition when the contrast distribution is concentrated and a smooth transition when it is dispersed; ③ Adaptive unsharpened mask model To mitigate the overshoot and undershoot issues in unsharpened mask image enhancement, adaptive unsharpening coefficients are substituted into the unsharpened mask model, resulting in: ; in, The image pixels after sharpening. The Gaussian blur value of the image pixel; As can be seen from the above formula, when the orthogonal contrast is large, the enhancement is greater, making the high grayscale area brighter, while the low grayscale area is brighter.
2. The image enhancement method based on sparse contrast Mean-shift according to claim 1, characterized in that, In step (1), the finite orthogonal contrast calculation avoids feature degradation in the target edge region due to excessively large convolution kernels by setting a protection radius.
3. The image enhancement method based on sparse contrast Mean-shift according to claim 1, characterized in that, The sparse contrast weighting strategy in step (2) is as follows: using local contrast as a weighting factor, the influence of the kernel function in the spatial and grayscale domains is adjusted during the Mean-shift iteration process to achieve differentiated filtering intensity.
4. The image enhancement method based on sparse contrast Mean-shift according to claim 1, characterized in that, The adaptive unsharpened mask image enhancement model in step (3) uses orthogonal contrast to dynamically adjust the gain coefficient of the unsharpened mask. Areas with higher contrast are given higher sharpening gain, while areas with lower contrast are suppressed.