Self-adaptive threshold sparse gradient spectral line graph optimization method and system
Through the spectrum line graph optimization method of adaptive threshold sparse gradient, the gradient information of sonar signals is processed, the adhesion artifact problem caused by noise is solved, the sparsity and interpretability of the Doppler shift spectrum line graph are improved, and the operation efficiency of the optimization algorithm is improved.
Patent Information
- Application Number
- CN202510688794.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-27
- Publication Date
- 2025-06-24
- Estimated Expiration
- 2045-05-27
AI Technical Summary
The gradient information of sonar signals often contains noise, which leads to the problem of adhesion artifacts, which makes the Doppler shift spectrum line graph insufficient sparsity.
The spectrum line graph optimization method of adaptive threshold sparse gradient is adopted. The calculation module uses the boundary fill of the two-dimensional matrix of the full-angle Doppler shift spectrum line, calculates the horizontal and vertical gradients, quantizes the gradient direction, performs non-maximum suppression, calculates the local mean and standard deviation, generates a dynamic threshold matrix, and performs thresholding to obtain a sparse spectrum gradient map.
Effectively suppress glitch noise and random interference, improve the sparsity and interpretability of Doppler frequency shift spectrum line graphs, reduce redundant data processing, and improve the operation efficiency of optimization algorithms.
Smart Images

Figure CN120195668A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of sonar array signal processing, and particularly relates to a method and system for optimizing a spectrogram with an adaptive threshold sparse gradient. Background Art
[0002] With the rapid development of marine resource exploration and underwater monitoring technologies, the importance of sonar signal processing and analysis in fields such as marine environment perception and target detection has become increasingly prominent. The complexity of the marine environment, such as turbulent diffusion, strong noise, high reverberation, and water absorption effects, significantly interferes with the quality of sonar signals, making it a huge challenge to extract target features from echo signals.
[0003] Traditional sonar signal processing methods mainly rely on time-frequency analysis techniques to represent the echo structure by decomposing the time-frequency domain features of signals. However, after propagation in a long-distance marine channel, the fine features of sonar signals are easily masked by noise, resulting in a significant decrease in the separability of the features extracted by time-frequency analysis and making it difficult to meet the actual application requirements. As an important carrier for representing the motion characteristics of targets, the gradient information in the all-angle Doppler frequency shift spectrogram of sonar signals often contains noise, leading to the problem of adhesion artifacts and insufficient sparsity of the Doppler frequency shift spectrogram. Summary of the Invention
[0004] The main objective of the present invention is to provide a method and system for optimizing a spectrogram with an adaptive threshold sparse gradient, aiming to solve the problem that the gradient information in sonar signals often contains noise, resulting in the problem of adhesion artifacts and insufficient sparsity of the Doppler frequency shift spectrogram.
[0005] The technical solution proposed by the present invention is as follows: A method for optimizing a spectrogram with an adaptive threshold sparse gradient, which is applied to a system for optimizing a spectrogram with an adaptive threshold sparse gradient; the system includes a calculation module and a display module; the method includes: The calculation module imports a two-dimensional matrix of the all-angle Doppler frequency shift spectrogram, where the size of the two-dimensional matrix is M×N, M is the size of the two-dimensional matrix in the angle dimension, N is the size of the two-dimensional matrix in the frequency dimension, and the matrix element value of the two-dimensional matrix represents the spectrogram intensity value at the corresponding angle and frequency coordinates; The calculation module performs boundary filling on the input two-dimensional matrix of the all-angle Doppler frequency shift spectrogram, calculates the horizontal gradient Gx and the vertical gradient Gy through convolution operations, and calculates the gradient magnitude matrix G_mag and the gradient direction matrix G_dir using Gx and Gy; The calculation module quantifies the gradient direction matrix G_dir into four main directions, and performs non-maximum suppression on each data point (i,j) in G_mag to obtain a non-maximum suppression gradient matrix G_nms; The computing module uses G_nms to calculate the local mean matrix Local_mean and the local standard deviation matrix Local_std, uses Local_mean and Local_std to calculate the dynamic threshold matrix Threshold_map, performs thresholding on the dynamic threshold matrix Threshold_map to obtain the sparse spectral gradient map G_sparse, and displays the sparse spectral gradient map G_sparse through the display module.
[0006] Preferably, the computing module performs boundary padding on the input two-dimensional matrix of full-angle Doppler frequency shift spectral lines, calculates the horizontal gradient Gx and the vertical gradient Gy through convolution operations, and calculates the gradient magnitude matrix G_mag and the gradient direction matrix G_dir using Gx and Gy, including: The computing module defines the Sobel operator. Among them, the Sobel operator is used to calculate the discrete gradient approximation values of the two-dimensional matrix of full-angle Doppler frequency shift spectral lines in the angle and frequency directions to represent the spectral intensity change rate. The Sobel operator includes the horizontal Sobel operator Sobel_x and the vertical Sobel operator Sobel_y, and the expressions are respectively: , , The computing module performs boundary padding on the input two-dimensional matrix of full-angle Doppler frequency shift spectral lines to ensure the effectiveness of the neighborhood operation of the data points at the spectral map edge, thereby obtaining the two-dimensional matrix of full-angle Doppler frequency shift spectral lines Matrix_padded after boundary padding. The calculation formula is: , In the formula, the matrix size of the two-dimensional matrix of full-angle Doppler frequency shift spectral lines after boundary padding is (M + 2) × (N + 2) to ensure that the operation of the Sobel operator at the edge data points will not exceed the boundary; Matrix(i, j) represents the spectral line intensity value of the two-dimensional matrix Matrix of full-angle Doppler frequency shift spectral lines at the angle coordinate i and the frequency coordinate j; Matrix_padded(i, j) represents the spectral line intensity value of the two-dimensional matrix Matrix_padded of full-angle Doppler frequency shift spectral lines after boundary padding at the angle coordinate i and the frequency coordinate j.
[0007] Preferably, the computing module performs boundary padding on the input two-dimensional matrix of full-angle Doppler frequency shift spectral lines to ensure the effectiveness of the neighborhood operation of the data points at the spectral map edge, thereby obtaining Matrix_padded. After that, it further includes: The calculation module initializes the horizontal gradient matrix Gx and the vertical gradient matrix Gy. The sizes of the horizontal gradient matrix Gx and the vertical gradient matrix Gy are the same as those of the input two-dimensional matrix of full-angle Doppler frequency shift spectral lines, and the elements of the horizontal gradient matrix Gx and the vertical gradient matrix Gy are initialized to zero; The calculation module calculates Gx and Gy through convolution operations, extracts the 3×3 neighborhood window of each data point (i,j) of Matrix_padded, and performs convolution calculations with Sobel_x and Sobel_y respectively. The calculation formula is: , In the formula, Sobel_x(m,n) represents the coefficient value of the horizontal Sobel operator Sobel_x at the coordinate (m,n), and the summation operation is performed for m and n in the range of 1-3; the horizontal gradient matrix Gx represents the change rate of the spectral line intensity in the angular dimension; Gx(i,j) represents the horizontal gradient Gx matrix at the angular coordinate i and the frequency coordinate j value at, that is, at the angular coordinate i and the frequency coordinate j The horizontal gradient value obtained by performing convolution calculation on the two-dimensional matrix Matrix_padded of the full-angle Doppler frequency shift spectral line after boundary padding through the horizontal Sobel operator Sobel_x; , In the formula, Sobel_y(m,n) represents the coefficient value of the vertical Sobel operator Sobel_y at the coordinate (m,n), and the summation operation is performed for m and n in the range of 1-3; the vertical gradient Gy represents the change rate of the spectral line intensity in the frequency dimension; Gy(i,j) represents the vertical gradient Gy matrix at the angular coordinate i and the frequency coordinate j value at, that is, at the angular coordinate i and the frequency coordinate j The vertical gradient value obtained by performing convolution calculation on the two-dimensional matrix Matrix_padded of the full-angle Doppler frequency shift spectral line after boundary padding through the vertical Sobel operator Sobel_y.
[0008] Preferably, the calculation module calculates Gx and Gy through convolution operations, extracts the 3×3 neighborhood window of each data point (i,j) of Matrix_padded, and performs convolution calculations with Sobel_x and Sobel_y respectively. After that, it further includes: The calculation module calculates the gradient magnitude matrix G_mag and the gradient direction matrix G_dir using Gx and Gy. The calculation formula is: , , In the formula, the gradient magnitude matrix G_mag represents the severity of the spectral line intensity change; the gradient direction matrix G_dir is in radians, with a value range of [-π, π], representing the direction of the spectral line intensity change; G_mag(i,j) represents the value of the gradient magnitude matrix G_mag at the angular coordinate i and the frequency coordinate j That is, the gradient magnitude is calculated by performing a square root operation on the sum of the squares of the horizontal gradient value Gx(i,j) and the vertical gradient value Gy(i,j); G_dir(i,j) represents the value of the gradient direction matrix G_dir at the angular coordinate i and the frequency coordinate j That is, the gradient direction radian value is calculated by performing an arctangent operation on the horizontal gradient value Gx(i,j) and the vertical gradient value Gy(i,j).
[0009] Preferably, the calculation module quantizes the gradient direction matrix G_dir into four main directions and performs non-maximum suppression on each data point (i,j) in G_mag to obtain the non-maximum suppression gradient matrix G_nms, including: The calculation module initializes the non-maximum suppression gradient matrix G_nms, where the size of the non-maximum suppression gradient matrix G_nms is the same as that of the gradient magnitude matrix G_mag, and the elements of the non-maximum suppression gradient matrix G_nms are initialized to zero; The calculation module quantizes the gradient direction matrix G_dir into four main directions, where the four main directions of the gradient direction matrix G_dir are 0°, 45°, 90°, and 135° respectively. The calculation formula for the quantized gradient direction Angle_deg(i,j) of each data point (i,j) in G_dir is: , In the formula, the angular range of the quantized gradient direction Angle_deg(i,j) is [0°, 180°).
[0010] Preferably, after the calculation module quantizes the gradient direction matrix G_dir into four main directions, it further includes: The calculation module performs non-maximum suppression on each data point (i,j) in G_mag, where the value ranges of i and j in the data point (i,j) need to exclude the data matrix boundary to avoid out-of-bounds neighborhood access; The calculation module selects two neighboring data points in the gradient direction for gradient magnitude comparison according to the quantized gradient direction Angle_deg(i,j) of each data point (i,j) in G_mag, and obtains the non-maximum suppression gradient matrix G_nms according to the comparison result. The calculation formula is as follows: , , In the formula, max(Nei(i,j)) represents at the angular coordinate i and the frequency coordinate j , the maximum value of the gradient magnitudes of the two neighboring data points selected according to the quantized gradient direction Angle_deg(i,j).
[0011] Preferably, the calculation module calculates the local mean matrix Local_mean and the local standard deviation matrix Local_std using G_nms, calculates the dynamic threshold matrix Threshold_map using Local_mean and Local_std, performs thresholding on the dynamic threshold matrix Threshold_map to obtain the sparse spectrum gradient map G_sparse, and displays the sparse spectrum gradient map G_sparse through the display module, including: The calculation module calculates the local mean matrix Local_mean using G_nms, filters the non-maximum suppression gradient matrix G_nms using a 3×3 mean filter to obtain the average gradient magnitude of the 3×3 neighborhood of each data point. Among them, the calculation formula of Local_mean(i,j) is; , In the formula, Local_mean(i,j) represents the value of the local mean matrix Local_mean at the angular coordinate i and the frequency coordinate j , that is, the local average gradient magnitude obtained by performing neighborhood averaging on the gradient matrix G_nms after non-maximum suppression using a 3×3 mean filter; u represents the offset at the angular coordinate; v represents the offset at the frequency coordinate; K_mean represents the mean filter kernel, and the expression of K_mean is: .
[0012] Preferably, the calculation module calculates the local mean matrix Local_mean using G_nms, filters the non-maximum suppression gradient matrix G_nms using a 3×3 mean filter to obtain the average gradient magnitude of the 3×3 neighborhood of each data point, and then further includes: The calculation module calculates the local standard deviation matrix Local_std, and filters the non-maximum suppression gradient matrix G_nms using a standard deviation filter to obtain the standard deviation of the gradient amplitude in the 3×3 neighborhood of each data point. The window size of the standard deviation filter is 3×3, and the calculation formula for Local_std(i,j) is: , In the formula, Local_std(i,j) represents the value of the local standard deviation matrix Local_std at the angular coordinate i and the frequency coordinate j . The calculation module calculates the dynamic threshold matrix Threshold_map. The calculation formula for the dynamic threshold Threshold_map(i,j) of each data point (i,j) in Threshold_map is: , In the formula, Local_mean(i,j) is the value of the data point (i,j) in the local mean matrix Local_mean, and Local_std(i,j) is the value of the data point (i,j) in the local standard deviation matrix Local_std, k is the adaptive threshold coefficient, which is an adjustable parameter, k The value range of is 0.5 - 2, which is used to control the threshold sensitivity and the sparsity of the spectrogram.
[0013] Preferably, after the calculation module calculates the dynamic threshold matrix Threshold_map, it further includes: The calculation module performs thresholding to generate a sparse spectral gradient map G_sparse. For the data point (i,j), if the value of the non-maximum suppression gradient matrix G_nms(i,j) is greater than the dynamic threshold threshold_map(i,j), the gradient value is retained in the sparse spectral gradient map G_sparse. If the value of the non-maximum suppression gradient matrix G_nms(i,j) is less than or equal to the dynamic threshold threshold_map(i,j), the gradient value is set to zero in the sparse spectral gradient map G_sparse. The calculation formula is: , In the formula, G_sparse(i,j) is the data point (i,j) in the sparse spectral gradient map; The calculation module outputs the sparse spectral gradient map G_sparse to the display module, and displays the sparse spectral gradient map G_sparse through the display module.
[0014] The present invention also provides a spectral line graph optimization system with adaptive threshold sparse gradient, which applies the spectral line graph optimization method with adaptive threshold sparse gradient; the system includes a calculation module and a display module.
[0015] Through the above technical solution, the following beneficial effects can be achieved: Compared with the prior art, the spectral line graph optimization method with adaptive threshold sparse gradient proposed by the present invention has the following beneficial effects: a dynamic threshold matrix Threshold_map is generated by combining the local mean and standard deviation with an adaptive coefficient, replacing the traditional fixed threshold or manually preset threshold, which can adjust the threshold in real time according to the local noise level, effectively suppressing spike noise and random interference, especially performing excellently in a low signal-to-noise ratio environment and without manual intervention or data training, and being applicable to the actual scenario where marine sonar data is scarce; by performing maximum suppression combined with gradient direction quantization, the gradient direction is quantized into four main directions, greatly reducing the computational complexity. At the same time, key gradient points are screened through non-maximum suppression, and only the significant gradient features in the main direction are retained, thus avoiding the problem of gradient adhesion artifacts caused by noise, improving the sparsity and interpretability of the full-angle Doppler frequency shift spectral line graph, and also being able to reduce redundant data processing and improve the operation efficiency of the optimization algorithm. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on the structures shown in these drawings without creative efforts.
[0017] Figure 1 It is a flowchart of the steps of the first embodiment of the spectral line graph optimization method with adaptive threshold sparse gradient proposed by the present invention; Figure 2 It is a schematic diagram of the input data of the Doppler frequency shift spectral line matrix of the ninth embodiment of the spectral line graph optimization method with adaptive threshold sparse gradient proposed by the present invention; Figure 3 It is a schematic diagram of the spectral line graph optimization result of the ninth embodiment of the spectral line graph optimization method with adaptive threshold sparse gradient proposed by the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0018] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0019] The present invention provides a spectral line graph optimization method and system with adaptive threshold sparse gradient.
[0020] As shown in the attaFigure 1 As shown in Figure 1 , in the first embodiment of a method for optimizing a spectrogram of an adaptive threshold sparse gradient proposed by the present invention, this method is applied to a spectrogram optimization system of an adaptive threshold sparse gradient; the system includes a calculation module and a display module; this embodiment includes the following steps: Step S110: The calculation module imports a two-dimensional matrix of full-angle Doppler shift spectrograms (i.e., Matrix), where the size of the two-dimensional matrix is M×N, M is the size of the two-dimensional matrix in the angle dimension, N is the size of the two-dimensional matrix in the frequency dimension, and the matrix element value of the two-dimensional matrix represents the spectrogram intensity value at the corresponding angle and frequency coordinates.
[0021] Step S120: The calculation module performs boundary filling on the imported two-dimensional matrix of full-angle Doppler shift spectrograms, calculates the horizontal gradient Gx and the vertical gradient Gy through convolution operations, and calculates the gradient magnitude matrix G_mag and the gradient direction matrix G_dir using Gx and Gy.
[0022] Step S130: The calculation module quantizes the gradient direction matrix G_dir into four main directions, and performs non-maximum suppression on each data point (i,j) in G_mag to obtain a non-maximum suppression gradient matrix G_nms.
[0023] Step S140: The calculation module calculates the local mean matrix Local_mean and the local standard deviation matrix Local_std using G_nms, calculates the dynamic threshold matrix Threshold_map using Local_mean and Local_std, performs thresholding on the dynamic threshold matrix Threshold_map to obtain a sparse spectrum gradient map G_sparse, and displays the sparse spectrum gradient map G_sparse through the display module.
[0024] Compared with the prior art, the method for optimizing a spectrogram of an adaptive threshold sparse gradient proposed by the present invention has the following beneficial effects: By combining the local mean and standard deviation with an adaptive coefficient to generate a dynamic threshold matrix Threshold_map, replacing the traditional fixed threshold or manually preset threshold, it can adjust the threshold in real time according to the local noise level, effectively suppressing spike noise and random interference, especially performing excellently in a low signal-to-noise ratio environment and without manual intervention or data training, being applicable to the actual scenario of scarce marine sonar data; By performing maximum suppression in combination with gradient direction quantization, quantizing the gradient direction into four main directions, it greatly reduces the computational complexity. At the same time, by screening key gradient points through non-maximum suppression and only retaining the significant gradient features in the main directions, it avoids the problem of gradient adhesion artifacts caused by the inclusion of noise, improves the sparsity and interpretability of the full-angle Doppler shift spectrogram, and can also reduce redundant data processing and improve the operating efficiency of the optimization algorithm.
[0025] In the second embodiment of an optimized method for a spectrogram of an adaptive threshold sparse gradient proposed by the present invention, based on the first embodiment, step S120 includes the following steps: Step S210: The calculation module defines a Sobel operator, where the Sobel operator is used to calculate the discrete gradient approximation values of the two-dimensional matrix of the full-angle Doppler frequency shift spectrogram in the angular and frequency directions to represent the spectral intensity change rate. The Sobel operator includes a horizontal Sobel operator Sobel_x and a vertical Sobel operator Sobel_y, and the expressions are respectively: , .
[0026] Step S220: The calculation module performs boundary padding on the input two-dimensional matrix of the full-angle Doppler frequency shift spectrogram to ensure the effectiveness of the neighborhood operation of the data points at the spectrogram edge, thereby obtaining the two-dimensional matrix Matrix_padded of the full-angle Doppler frequency shift spectrogram after boundary padding. The calculation formula is: , In the formula, the matrix size of the two-dimensional matrix of the full-angle Doppler frequency shift spectrogram after boundary padding is (M + 2) × (N + 2) to ensure that the operation of the Sobel operator at the edge data points will not exceed the boundary; Matrix(i,j) represents the spectral line intensity value of the two-dimensional matrix Matrix of the full-angle Doppler frequency shift spectrogram at the angular coordinate i and the frequency coordinate j ; Matrix_padded(i,j) represents the spectral line intensity value of the two-dimensional matrix Matrix_padded of the full-angle Doppler frequency shift spectrogram after boundary padding at the angular coordinate i and the frequency coordinate j .
[0027] In the third embodiment of an optimized method for a spectrogram of an adaptive threshold sparse gradient proposed by the present invention, based on the second embodiment, after step S220, the following steps are further included: Step S310: The calculation module initializes a horizontal gradient matrix Gx and a vertical gradient matrix Gy. The sizes of the horizontal gradient matrix Gx and the vertical gradient matrix Gy are the same as those of the input two-dimensional matrix of the full-angle Doppler frequency shift spectrogram, and the elements of the horizontal gradient matrix Gx and the vertical gradient matrix Gy are initialized to zero.
[0028] Step S320: The calculation module calculates Gx and Gy through convolution operations, extracts the 3×3 neighborhood window of each data point (i,j) in Matrix_padded, and performs convolution calculations with Sobel_x and Sobel_y respectively. The calculation formula is as follows: , In the formula, Sobel_x(m,n) represents the coefficient value of the horizontal Sobel operator Sobel_x at the coordinate (m,n), and the summation operation is performed for m and n within the range of 1-3; the horizontal gradient matrix Gx represents the change rate of the spectral line intensity in the angular dimension; Gx(i,j) represents the value of the horizontal gradient Gx matrix at the angular coordinate i and the frequency coordinate j , that is, at the angular coordinate i and the frequency coordinate j , the horizontal gradient value obtained by performing convolution calculation on the two-dimensional matrix Matrix_padded of the full-angle Doppler frequency shift spectral line after boundary padding through the horizontal Sobel operator Sobel_x.
[0029] .
[0030] In the formula, Sobel_y(m,n) represents the coefficient value of the vertical Sobel operator Sobel_y at the coordinate (m,n), and the summation operation is performed for m and n within the range of 1-3; the vertical gradient Gy represents the change rate of the spectral line intensity in the frequency dimension; Gy(i,j) represents the value of the vertical gradient Gy matrix at the angular coordinate i and the frequency coordinate j , that is, at the angular coordinate i and the frequency coordinate j , the vertical gradient value obtained by performing convolution calculation on the two-dimensional matrix Matrix_padded of the full-angle Doppler frequency shift spectral line after boundary padding through the vertical Sobel operator Sobel_y.
[0031] In the fourth embodiment of an optimized method for spectral line diagrams with adaptive threshold sparse gradients proposed in the present invention, based on the third embodiment, after step S320, the following steps are further included: Step S410: The calculation module calculates the gradient magnitude matrix G_mag and the gradient direction matrix G_dir using Gx and Gy. The calculation formulas are as follows: , , In the formula, the gradient magnitude matrix G_mag represents the severity of the spectral line intensity change; the gradient direction matrix G_dir is in radians, and its value range is [-π, π], representing the direction of the spectral line intensity change; G_mag(i,j) represents the value of the gradient magnitude matrix G_mag at the angular coordinate i and the frequency coordinate j , that is, the gradient magnitude calculated by performing the square root operation on the sum of the squares of the horizontal gradient value Gx(i,j) and the vertical gradient value Gy(i,j); G_dir(i,j) represents the value of the gradient direction matrix G_dir at the angular coordinate i and the frequency coordinate j , that is, the gradient direction radian value calculated by performing the arctangent operation on the horizontal gradient value Gx(i,j) and the vertical gradient value Gy(i,j).
[0032] In the fifth embodiment of an optimized method for spectral line diagrams with an adaptive threshold sparse gradient proposed by the present invention, based on the fourth embodiment, step S130 includes the following steps: Step S510: The calculation module initializes the non-maximum suppression gradient matrix G_nms. Among them, the size of the non-maximum suppression gradient matrix G_nms is the same as that of the gradient magnitude matrix G_mag, and the elements of the non-maximum suppression gradient matrix G_nms are initialized to zero.
[0033] Step S520: The calculation module quantizes the gradient direction matrix G_dir into four main directions. Among them, the four main directions of the gradient direction matrix G_dir are 0°, 45°, 90°, and 135° respectively. The calculation formula for the quantized gradient direction Angle_deg(i,j) of each data point (i,j) in G_dir is: , In the formula, the angular range of the quantized gradient direction Angle_deg(i,j) is [0°, 180°).
[0034] In the sixth embodiment of an optimized method for spectral line diagrams with an adaptive threshold sparse gradient proposed by the present invention, based on the fifth embodiment, after step S520, the following steps are further included: Step S610: The calculation module performs non-maximum suppression on each data point (i,j) in G_mag. Among them, the value ranges of i and j in the data point (i,j) need to exclude the data matrix boundary to avoid out-of-bounds neighborhood access.
[0035] Step S620: The calculation module selects two neighboring data points in the gradient direction according to the quantized gradient direction Angle_deg(i,j) of each data point (i,j) in G_mag for gradient magnitude comparison, and obtains the non-maximum suppression gradient matrix G_nms according to the comparison result. The calculation formula is as follows: , , In the formula, max(Nei(i,j)) represents the maximum value of the gradient magnitudes of the two neighboring data points selected according to the quantized gradient direction Angle_deg(i,j) at the angular coordinate i and the frequency coordinate j .
[0036] In the seventh embodiment of an optimized method for spectrogram of adaptive threshold sparse gradient proposed by the present invention, based on the sixth embodiment, step S140 includes the following steps: Step S710: The calculation module calculates the local mean matrix Local_mean by using G_nms, and filters the non-maximum suppression gradient matrix G_nms with a 3×3 mean filter to obtain the average gradient magnitude of the 3×3 neighborhood of each data point. Among them, the calculation formula of Local_mean(i,j) is; , In the formula, Local_mean(i,j) represents the value of the local mean matrix Local_mean at the angular coordinate i and the frequency coordinate j , that is, the local average gradient magnitude obtained by performing neighborhood averaging on the gradient matrix G_nms after non-maximum suppression through a 3×3 mean filter; u represents the offset at the angular coordinate; v represents the offset at the frequency coordinate; K_mean represents the mean filter kernel, and the expression of K_mean is: .
[0037] In the eighth embodiment of an optimized method for spectrogram of adaptive threshold sparse gradient proposed by the present invention, based on the seventh embodiment, after step S710, the following steps are further included: Step S810: The calculation module calculates the local standard deviation matrix Local_std, and filters the non-maximum suppression gradient matrix G_nms with a standard deviation filter to obtain the standard deviation of the gradient magnitudes of the 3×3 neighborhood of each data point. Among them, the window size of the standard deviation filter is 3×3, and the calculation formula of Local_std(i,j) is: , where Local_std(i,j) represents the value of the local standard deviation matrix Local_std at the angular coordinate i and the frequency coordinate j .
[0038] Step S820: The calculation module calculates the dynamic threshold matrix Threshold_map. Among them, the calculation formula for the dynamic threshold Threshold_map(i,j) of each data point (i,j) in Threshold_map is: , where Local_mean(i,j) is the value of the data point (i,j) in the local mean matrix Local_mean, and Local_std(i,j) is the value of the data point (i,j) in the local standard deviation matrix Local_std, k is the adaptive threshold coefficient, which is an adjustable parameter, k and the value range of is 0.5 - 2, which is used to control the threshold sensitivity and the sparsity of the spectrogram.
[0039] In the ninth embodiment of an adaptive threshold sparse gradient spectrogram optimization method proposed by the present invention, based on the eighth embodiment, after step S820, the following steps are further included: Step S910: The calculation module performs thresholding to generate a sparse frequency spectrum gradient map G_sparse. Among them, for the data point (i,j), if the value of the non-maximum suppression gradient matrix G_nms(i,j) is greater than the dynamic threshold threshold_map(i,j), then the gradient value is retained in the sparse frequency spectrum gradient map G_sparse. If the value of the non-maximum suppression gradient matrix G_nms(i,j) is less than or equal to the dynamic threshold threshold_map(i,j), then the gradient value is set to zero in the sparse frequency spectrum gradient map G_sparse. The calculation formula is: , where G_sparse(i,j) is the data point (i,j) in the sparse frequency spectrum gradient map.
[0040] Step S920: The calculation module outputs the sparse frequency spectrum gradient map G_sparse to the display module, and the display module displays the sparse frequency spectrum gradient map G_sparse.
[0041] As shown in and attached Figure 2 and attached Figure 3 shown, attached Figure 3This is a schematic diagram of the optimized result of the spectral line graph of the adaptive threshold sparse gradient in the embodiment of the present invention, that is, the output result graph. In the case of complex background noise, strong offshore reverberation, and strong terrain reverberation, the solution of the present application has the following advantages: 1. The anti-noise interference ability is significantly improved, and the threshold can be adjusted in real time according to the local noise level, effectively suppressing spike noise and random interference.
[0042] 2. The gradient sparsification is enhanced. Non-maximum suppression is combined with gradient direction quantization to retain only the significant gradient features in the main direction, avoiding the gradient adhesion problem caused by noise, and improving the sparsity and interpretability of the spectral line graph.
[0043] 3. Adaptive gradient optimization. The dynamic threshold is calculated through local statistical characteristics, taking into account local context information, avoiding over-segmentation or under-segmentation problems caused by global thresholds, and ensuring the complete retention of the edges of the Doppler frequency shift spectral lines.
[0044] 4. Direction quantization simplifies the calculation. The gradient direction is quantized into four main directions, greatly reducing the computational complexity. At the same time, key gradient points are screened through non-maximum suppression, reducing redundant data processing and improving the running efficiency of the algorithm.
[0045] 5. Strong robustness. The adaptive coefficient dynamically adjusts the threshold sensitivity according to specific requirements, enhancing the generality and scene adaptability of the method. In different sea areas, different target shapes, different reverberation intensities, and background noise conditions, it shows good stability and applicability.
[0046] The present invention also proposes a spectral line graph optimization system of adaptive threshold sparse gradient, which applies the spectral line graph optimization method of adaptive threshold sparse gradient; the system includes a calculation module and a display module.
[0047] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0048] The embodiments of the present invention have been described above with reference to the drawings. However, the present invention is not limited to the above specific embodiments. The above specific embodiments are only illustrative and not restrictive. Under the inspiration of the present invention, those of ordinary skill in the art can also make many forms without departing from the spirit and scope protected by the claims of the present invention. These all belong to the protection scope of the present invention.
Claims
1. An optimization method for spectral line graphs of adaptive threshold sparse gradients, characterized in that Spectral Line Graph Optimization System Applied to Adaptive Threshold Sparse Gradient The system includes a calculation module and a display module; The method includes: The calculation module imports a two-dimensional matrix of full-angle Doppler frequency shift spectral lines. Among them, the size of the two-dimensional matrix is M×N, M is the size of the two-dimensional matrix in the angle dimension, N is the size of the two-dimensional matrix in the frequency dimension, and the matrix element value of the two-dimensional matrix represents the spectral line intensity value at the corresponding angle and frequency coordinates; The calculation module performs boundary padding on the imported two-dimensional matrix of full-angle Doppler frequency shift spectral lines, calculates the horizontal gradient Gx and the vertical gradient Gy through convolution operations, and calculates the gradient magnitude matrix G_mag and the gradient direction matrix G_dir using Gx and Gy; The calculation module quantizes the gradient direction matrix G_dir into four main directions, and performs non-maximum suppression on each data point (i,j) in G_mag to obtain the non-maximum suppression gradient matrix G_nms; The calculation module calculates the local mean matrix Local_mean and the local standard deviation matrix Local_std using G_nms, calculates the dynamic threshold matrix Threshold_map using Local_mean and Local_std, performs thresholding on the dynamic threshold matrix Threshold_map to obtain the sparse spectral gradient map G_sparse, and displays the sparse spectral gradient map G_sparse through the display module.
2. An optimized method for spectral line diagrams of adaptive threshold sparse gradients according to claim 1, characterized in that The calculation module performs boundary padding on the imported two-dimensional matrix of full-angle Doppler frequency shift spectral lines, calculates the horizontal gradient Gx and the vertical gradient Gy through convolution operations, and calculates the gradient magnitude matrix G_mag and the gradient direction matrix G_dir, including: The calculation module defines the Sobel operator. Among them, the Sobel operator is used to calculate the discrete gradient approximation values of the two-dimensional matrix of full-angle Doppler frequency shift spectral lines in the angle and frequency directions to represent the spectral intensity change rate. The Sobel operator includes the horizontal direction Sobel operator Sobel_x and the vertical direction Sobel operator Sobel_y, and the expressions are respectively: , , The calculation module performs boundary padding on the imported two-dimensional matrix of full-angle Doppler frequency shift spectral lines to ensure the effectiveness of neighborhood operations on data points at the edge of the spectral graph, thereby obtaining the boundary-padded two-dimensional matrix of full-angle Doppler frequency shift spectral lines Matrix_padded. The calculation formula is: , In the formula, the matrix size of the boundary-padded two-dimensional matrix of full-angle Doppler frequency shift spectral lines is (M + 2)×(N + 2) to ensure that the operation of the Sobel operator at the edge data points will not exceed the boundary; Matrix(i,j) represents the spectral line intensity value of the two-dimensional matrix Matrix of full-angle Doppler frequency shift spectral lines at the angle coordinate i and the frequency coordinate j; Matrix_padded(i,j) represents the spectral line intensity value of the boundary-padded two-dimensional matrix Matrix_padded of full-angle Doppler frequency shift spectral lines at the angle coordinate i and the frequency coordinate j.
3. An optimized method for spectral line graphs of adaptive threshold sparse gradients according to claim 2, characterized in that The calculation module performs boundary padding on the input two-dimensional matrix of full-angle Doppler frequency shift spectral lines to ensure the effectiveness of neighborhood operations on data points at the spectral map edges, thereby obtaining Matrix_padded. Subsequently, it also includes: The calculation module initializes the horizontal gradient matrix Gx and the vertical gradient matrix Gy. Here, the sizes of the horizontal gradient matrix Gx and the vertical gradient matrix Gy are the same as those of the input two-dimensional matrix of full-angle Doppler frequency shift spectral lines, and the elements of the horizontal gradient matrix Gx and the vertical gradient matrix Gy are initialized to zero; The calculation module calculates Gx and Gy through convolution operations, extracts the 3×3 neighborhood window of each data point (i, j) in Matrix_padded, and performs convolution calculations with Sobel_x and Sobel_y respectively. The calculation formula is: , Wherein, Sobel_x(m,n) represents the coefficient value of the Sobel_x operator in the horizontal direction at the coordinate (m,n), and the summation operation is performed for m and n within the range of 1-3; the horizontal gradient matrix Gx represents the change rate of the spectral line intensity in the angular dimension; Gx(i,j) represents the value of the horizontal gradient Gx matrix at the angular coordinate i and the frequency coordinate j at, that is, at the angular coordinate i and the frequency coordinate j the horizontal gradient value obtained by convolving the two-dimensional matrix Matrix_padded of the full-angle Doppler frequency shift spectral line after boundary filling with the Sobel_x operator in the horizontal direction; , Wherein, Sobel_y(m,n) represents the coefficient value of the Sobel_y operator in the vertical direction at the coordinate (m,n), and the summation operation is performed for m and n within the range of 1-3; the vertical gradient Gy represents the change rate of the spectral line intensity in the frequency dimension; Gy(i,j) represents the value of the vertical gradient Gy matrix at the angular coordinate i and the frequency coordinate j i.e., the vertical gradient value obtained by convolving the two-dimensional matrix Matrix_padded of the full-angle Doppler frequency shift spectral line after boundary filling with the Sobel_y operator in the vertical direction at the angular coordinate i and the frequency coordinate j .
4. An optimized method for spectral line graph of adaptive threshold sparse gradient according to claim 3, characterized in that The calculation module calculates Gx and Gy through convolution operations, extracts the 3×3 neighborhood window of each data point (i, j) in Matrix_padded, and performs convolution calculations with Sobel_x and Sobel_y respectively. Subsequently, it also includes: The calculation module calculates the gradient magnitude matrix G_mag and the gradient direction matrix G_dir using Gx and Gy. The calculation formula is: , , In the formula, the gradient magnitude matrix G_mag represents the severity of the spectral line intensity change; the gradient direction matrix G_dir is in radian value, and its value range is [-π, π], representing the direction of the spectral line intensity change; G_mag(i,j) represents the value of the gradient magnitude matrix G_mag at the angular coordinate i and the frequency coordinate j , that is, the gradient magnitude calculated by taking the square root of the sum of the squares of the horizontal gradient value Gx(i,j) and the vertical gradient value Gy(i,j); G_dir(i,j) represents the value of the gradient direction matrix G_dir at the angular coordinate i and the frequency coordinate j , that is, the gradient direction radian value calculated by the arctangent operation of the horizontal gradient value Gx(i,j) and the vertical gradient value Gy(i,j).
5. An optimized method for spectral line graph of adaptive threshold sparse gradient according to claim 4, characterized in that The calculation module quantizes the gradient direction matrix G_dir into four main directions and performs non-maximum suppression on each data point (i, j) in G_mag to obtain the non-maximum suppression gradient matrix G_nms, including: The calculation module initializes the non-maximum suppression gradient matrix G_nms. Here, the size of the non-maximum suppression gradient matrix G_nms is the same as that of the gradient magnitude matrix G_mag, and the elements of the non-maximum suppression gradient matrix G_nms are initialized to zero; The calculation module quantizes the gradient direction matrix G_dir into four main directions. Here, the four main directions of the gradient direction matrix G_dir are 0°, 45°, 90°, and 135° respectively. The calculation formula for the quantized gradient direction Angle_deg(i, j) of each data point (i, j) in G_dir is: , In the formula, the angle range of the quantized gradient direction Angle_deg(i, j) is [0°, 180°).
6. An optimized method for spectrogram of adaptive threshold sparse gradient according to claim 5, characterized in that The calculation module quantizes the gradient direction matrix G_dir into four main directions. Subsequently, it also includes: The calculation module performs non-maximum suppression on each data point (i, j) in G_mag. Here, the value ranges of i and j in the data point (i, j) need to exclude the data matrix boundaries to avoid out-of-bounds neighborhood access; The calculation module selects two neighborhood data points in the gradient direction for gradient magnitude comparison according to the quantized gradient direction Angle_deg(i, j) of each data point (i, j) in G_mag, and obtains the non-maximum suppression gradient matrix G_nms according to the comparison result. The calculation formula is as follows: , , where max(Nei(i,j)) represents the maximum value of the gradient magnitudes of two neighboring data points selected according to the quantization gradient direction Angle_deg(i,j) at the angular coordinate i and the frequency coordinate j .
7. An optimized method for spectrogram of adaptive threshold sparse gradient according to claim 6, characterized in that The calculation module uses G_nms to calculate the local mean matrix Local_mean and the local standard deviation matrix Local_std, uses Local_mean and Local_std to calculate the dynamic threshold matrix Threshold_map, performs thresholding on the dynamic threshold matrix Threshold_map to obtain the sparse spectral gradient map G_sparse, and displays the sparse spectral gradient map G_sparse through the display module, including: The calculation module uses G_nms to calculate the local mean matrix Local_mean, filters the non-maximum suppression gradient matrix G_nms using a 3×3 mean filter to obtain the average gradient magnitude of the 3×3 neighborhood of each data point. Among them, the calculation formula of Local_mean(i,j) is; , Where, Local_mean(i,j) represents the value of the local mean matrix Local_mean at the angular coordinate i and the frequency coordinate j , that is, the local average gradient amplitude obtained by performing neighborhood averaging on the gradient matrix G_nms after non-maximum suppression through a 3×3 mean filter; u represents the offset at the angular coordinate; v represents the offset at the frequency coordinate; K_mean represents the mean filter kernel, and the expression of K_mean is: 。 8. An optimized method for spectrogram of adaptive threshold sparse gradient according to claim 7, characterized in that The calculation module uses G_nms to calculate the local mean matrix Local_mean, filters the non-maximum suppression gradient matrix G_nms using a 3×3 mean filter to obtain the average gradient magnitude of the 3×3 neighborhood of each data point. After that, it further includes: The calculation module calculates the local standard deviation matrix Local_std, filters the non-maximum suppression gradient matrix G_nms using a standard deviation filter to obtain the standard deviation of the gradient magnitude of the 3×3 neighborhood of each data point. Among them, the window size of the standard deviation filter is 3×3, and the calculation formula of Local_std(i,j) is: , where Local_std(i,j) represents the value of the local standard deviation matrix Local_std at the angular coordinate i and the frequency coordinate j ; The calculation module calculates the dynamic threshold matrix Threshold_map. Among them, the calculation formula of the dynamic threshold Threshold_map(i,j) of each data point (i,j) in Threshold_map is: , Wherein, Local_mean(i,j) is the value of the data point (i,j) in the local mean matrix Local_mean, and Local_std(i,j) is the value of the data point (i,j) in the local standard deviation matrix Local_std. k is the adaptive threshold coefficient and is an adjustable parameter. k The value range of is 0.5 - 2, which is used to control the threshold sensitivity and the sparsity of the spectrogram.
9. An optimized method for spectrogram of adaptive threshold sparse gradient according to claim 8, characterized in that The calculation module calculates the dynamic threshold matrix Threshold_map. After that, it further includes: The calculation module performs thresholding to generate the sparse spectral gradient map G_sparse. Among them, for the data point (i,j), if the value of the non-maximum suppression gradient matrix G_nms(i,j) is greater than the dynamic threshold threshold_map(i,j), then retain this gradient value in the sparse spectral gradient map G_sparse. If the value of the non-maximum suppression gradient matrix G_nms(i,j) is less than or equal to the dynamic threshold threshold_map(i,j), then set this gradient value to zero in the sparse spectral gradient map G_sparse. The calculation formula is: , In the formula, G_sparse(i,j) is the data point (i,j) in the sparse spectral gradient map; The calculation module outputs the sparse spectral gradient map G_sparse to the display module, and displays the sparse spectral gradient map G_sparse through the display module.
10. An optimized system for spectral line diagrams with an adaptive threshold sparse gradient, characterized in that, Apply the spectral line graph optimization method of adaptive threshold sparse gradient according to any one of claims 1-9; the system includes a calculation module and a display module.
Citation Information
Patent Citations
Marine phytoplankton image edge detection method based on non-local mean denoising mode
CN119722720A
Method and apparatus for automatic control of spectral doppler imaging
US20030158484A1