Sonar Image Target Processing Method Based on Heterogeneous Filter Detection and Level Set Segmentation
The sonar image is processed through heterogeneous filtering and horizontal set segmentation methods, and the problem of low imaging quality and efficiency in underwater target detection is solved, and the precise extraction and recognition of target profiles is achieved, which improves the detection efficiency and accuracy.
Patent Information
- Application Number
- CN202210836901.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-15
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2042-07-15
AI Technical Summary
Among the existing underwater target detection methods, the underwater optical imaging effect is poor, the quality of active side-sweep sonar image acquisition and target detection efficiency are low, the application of machine vision is limited, and manual interpretation is time-consuming and labor-intensive.
Sonar target processing methods based on heterogeneous filter detection and horizontal set segmentation are adopted, including image acquisition, non-local mean denoising, superpixel image segmentation, heterogeneous filter target detection, adaptive threshold processing and target segmentation, and target outline extraction is performed in combination with superpixel boundary constraints.
Effectively removes the intensity inhomogeneity in sonar images, enhances the target bright and dark areas, improves the false alarm accuracy of target detection, and achieves accurate target profile extraction and recognition.
Smart Images

Figure CN115147710B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of detecting and segmenting underwater targets by using side-scan sonar images, and particularly relates to a sonar target processing method for target detection based on heterogeneous filtering and level-set target segmentation. Background Art
[0002] With the increasing number of underwater exploration activities such as underwater mineral exploration, underwater rescue, and underwater assisted aquaculture, there are more and more underwater target detection means and the detection technology is becoming increasingly mature, which helps to utilize and develop underwater resources and improve the safety of underwater activities at the same time.
[0003] Currently, the mainstream underwater target detection means include two types: acoustic and optical. Underwater optical target detection mainly obtains underwater images through an optical camera and achieves the detection purpose through target recognition means. However, due to the relatively dark underwater light and the short underwater optical visible distance, the optical imaging effect is poor. At the same time, due to the attenuation effect of water on light, underwater optical images often have inherent defects such as low contrast and shape distortion, which limit the application of underwater optical target detection. Among underwater acoustic target detection means, active side-scan sonar is widely used due to its wide detection range and high resolution. However, there are many problems in both image acquisition quality and target detection. For the widely used target detection and recognition method based on machine vision, the application of active side-scan sonar is limited because of its high scanning imaging cost and small data set. And using the method of manual interpretation for sonar target detection and segmentation to obtain the position and contour information of underwater targets is often time-consuming and laborious.
[0004] In practical applications, if the imaging characteristics of underwater sonar can be fully utilized, the sonar image is processed to eliminate underwater imaging noise interference, and the position and contour features of underwater targets are adaptively highlighted, the underwater target acoustic detection efficiency can be greatly improved. Summary of the Invention
[0005] The purpose of the present invention is to provide a sonar image target processing method from sonar image acquisition input to obtaining the position and shape of the target in the sonar image output.
[0006] The sonar target processing method based on heterogeneous filtering detection and level-set segmentation includes the following steps:
[0007] Step 1: Image acquisition.
[0008] Collect side-scan sonar data to obtain a sonar image.
[0009] Step 2: Denoising processing.
[0010] Perform non-local means image denoising processing on the sonar image.
[0011] Step 3: Superpixel image segmentation.
[0012] The sonar image is segmented into superpixel regions of S×S pixels, where S is the preset width of the superpixel region. A superpixel center is set at the center of the superpixel region. For the 2S×2S neighborhood region centered on the superpixel center, local superpixel center iteration and pixel label iteration are performed using the pixel value distance, pixel coordinate distance, and LDZP texture description value distance between all pixels in the neighborhood and the superpixel center pixel to achieve local iterative clustering, and the image is segmented into multiple superpixels with the superpixel edges close to the target edges. The pixel mean of each superpixel region is used as the pixel value of the superpixel to generate a superpixel image.
[0013] Step 4: Heterogeneous filtering target detection.
[0014] For each pixel in the superpixel image, after performing heterogeneous filtering on the target bright area and scaling it proportionally to the grayscale pixel range, a bright area filtered image HCA HO is obtained; for each pixel in the superpixel image, after performing heterogeneous filtering on the target dark area and scaling it proportionally to the grayscale pixel range, a dark area filtered image HCA HS is obtained; the bright area filtered image HCA HO and the dark area filtered image HCA HS are fused to obtain a heterogeneous filtered image HCA H .
[0015] Step 5: Adaptive threshold processing.
[0016] For each pixel of the heterogeneous filtered image, the local variance and mean are calculated respectively, and adaptive threshold segmentation based on local information is performed to obtain the boundary position between the bright and dark regions. Adaptive region expansion is performed according to the pixel value characteristics of the bright and dark regions to obtain an adaptive threshold processed image HCA A containing the rough segmentation contour of the target.
[0017] Step 6: Target fine segmentation.
[0018] Taking the rough segmentation contour of the target in the adaptive threshold processed image HCA A as the initial contour, a level set function model based on distance regularization is constructed, an image energy function is constructed in combination with the superpixel boundary, and level set evolution is performed to obtain the fine segmentation contour of the target.
[0019] Preferably, in Step 1, sonar data is collected by a sonar device and saved as a readable XTF file, the XTF file is parsed to obtain sonar visualization data and a sonar visualization waterfall diagram is generated; for the visualization data, the waterfall diagram is intercepted into a sonar image of a fixed size by using a half-frame cross-interception method.
[0020] Preferably, in step two, each pixel in the sonar image is taken as a target pixel, and the following processing is performed on the target pixel: for all pixels in the entire image except the target pixel, calculate the local similarity between its neighborhood and the neighborhood of the target pixel; and replace the pixel value of the target pixel with the weighted average of all pixels except the target pixel, where the weight is the local similarity.
[0021] Preferably, the process of superpixel segmentation in step three is as follows:
[0022] 3-1. According to the size of the sonar image, divide the processed part of the sonar image into several sub-regions of S×S pixels; calculate the gradient values of the 4×4 neighborhoods of the centers of each sub-region respectively, and place the seed point at the position with the minimum gradient value. Take the seed point of each sub-region as the superpixel center. Assign an initial class label to each sub-region.
[0023] 3-2. Take the 2S×2S neighborhood of the seed point as the search range, and calculate the distance metric D between each pixel point in the search range and the seed point as follows:
[0024]
[0025] where d c is the pixel value distance between the current pixel point and the adjacent seed point; d s is the pixel coordinate distance between the current pixel point and the adjacent seed point; d t is the LDZP texture description value distance between the current pixel point and the adjacent seed point.
[0026] Classify each pixel into the class corresponding to the different seed points based on the minimum distance metric D.
[0027] 3-3. Take the coordinate average value of the pixels with the same class label as the position of the seed point of this class label, and update the position of the seed point of this class label.
[0028] 3-4. Perform iterative updates of the class label and the class seed point position according to steps 3-2 and 3-3 until the position of each class seed point no longer changes.
[0029] 3-5. For the class label matrix, reassign the discontinuous classes and the classes with the number of pixels less than the preset value to the adjacent classes in the order from left to right and from top to bottom until the reassignment is completed, obtaining the final superpixel segmentation image and the superpixel class label matrix.
[0030] 3-6. For each class, calculate the mean value of all its pixel values as the pixel value of the corresponding superpixel of this class, and generate a superpixel image I SP .
[0031] Preferably, the process of step 4 is as follows:
[0032] 4-1. Bright area filtering.
[0033] Construct a bright area heterogeneous filter f o as follows:
[0034]
[0035] where f o [2,2]=3 is the convolution center, and use the bright area heterogeneous filter f o as the convolution kernel to perform convolution operation on the superpixel image I SP to distinguish the target bright area Ω o .
[0036] Scale the convolution results HCA o of all pixels in the target bright area Ω HO_o proportionally to the gray level of 127.5-255 to obtain the bright area filtered image HCA HO .
[0037] 4-2. Dark area filtering.
[0038] Construct a dark area heterogeneous filter f s as:
[0039]
[0040] where f s [2,3]=-3 is the convolution center, and use the dark area heterogeneous filter f s as the convolution kernel to perform convolution operation on the superpixel image I SP to distinguish the target dark area Ω s .
[0041] Scale the convolution results HCA s of all pixels in the target dark area Ω HS_s proportionally to the gray level of 127.5-255 to obtain the dark area filtered image HCA HS .
[0042] 4-3. Fuse the bright area filtered image HCA HO and the dark area filtered image HCA HS to obtain the heterogeneous filtered image HCA H as follows:
[0043] HCA H =(HCA HO +HCA HS )-127.5
[0044] Preferably, the specific process of step five is as follows:
[0045] 5-1. Process the image HCA according to the constructed target bright area Ao As follows:
[0046]
[0047] where HCA Ao (i), HCA H (i) are respectively the pixel values of the superpixel point i in the target bright area processed image HCA Ao and the heterogeneous filtering image HCA H ; σ i 2 is the variance of the pixel values of the 3×3 neighborhood centered on the superpixel point i in the heterogeneous filtering image HCA H ; μ i is the mean value of the pixel values of the 3×3 neighborhood centered on the superpixel point i in the heterogeneous filtering image HCA H ; k o is the adaptive threshold of the bright area.
[0048] Process the image HCA according to the constructed target dark area As As follows:
[0049]
[0050] where HCA As (i), HCA H (i) are respectively the pixel values of the superpixel point i in the target dark area processed image HCA As and the heterogeneous filtering image HCA H ; k s is the adaptive threshold of the dark area.
[0051] 5-2. Fuse the target bright area processed image HCA Ao and the target dark area processed image HCA As to obtain the adaptive threshold processed image HCA A as follows:
[0052] HCA A = (HCA Ao + HCA As ) - 127.5.
[0053] Preferably, the specific process of step six is as follows:
[0054] 6-1. Using the adaptive threshold processed image HCA AThe bright region contour and the dark region contour in it are the initial contours. The level set energy function Γ(φ1, φ2, f1, f2, f3) based on distance regularization is constructed for the target region as follows:
[0055] Γ(φ1, φ2, f1, f2, f3) = ε(φ1, φ2, f1, f2, f3) + R P (φ1, φ2) + E(φ1, φ2)
[0056] where ε(φ1, φ2, f1, f2, f3) is the local fitting energy, and R P (φ1, φ2) is the distance regularization term; E(φ1, φ2) is the superpixel constraint term.
[0057] The expression of the local fitting energy ε(φ1, φ2, f1, f2, f3) is as follows:
[0058]
[0059] where φ1 is the level set function of the target bright region, φ2 is the level set function of the target dark region, f1 is the local fitting energy of the image inside the zero level curve of φ1; f2 is the local fitting energy of the image inside the zero level curve of φ2, and f3 is the local fitting energy outside the image contour. K is the Gaussian kernel function, and λ i is the parameter of the local fitting energy term, and v i is the parameter of the length penalty term. H(·) is the Heaviside function, and its expression is:
[0060]
[0061] where ∈ is the parameter of the Heaviside function.
[0062] The distance regularization term R P (φ1, φ2) has the following expression:
[0063]
[0064] where μ i is the parameter of the distance regularization term; P(·) is the double-well potential function, and its expression is as follows:
[0065]
[0066] The expression of the superpixel constraint term E(φ1, φ2) is as follows:
[0067]
[0068] where α i is the parameter of the superpixel constraint term; is the level set stopping function, and its expression is as follows:
[0069]
[0070] where, Ω E is the set of points on the superpixel boundary, is the gradient at pixel point x. If pixel point x is not in the set of points on the superpixel boundary, then is set to 0.
[0071] 6 - 2. Construct the double - region level set evolution equation as follows:
[0072]
[0073] where, div(·) is the divergence operation, and the expression of δ(·) is as follows:
[0074]
[0075] 6 - 3. According to the above level set evolution equation, evolve the initial contours of the target bright region and dark region until the evolution converges to obtain the exact contour of the target in the sonar image.
[0076] The beneficial effects of the present invention are as follows:
[0077] 1. According to the characteristics of side - scan sonar imaging, the present invention uses a step - by - step heterogeneous filtering method to process the image. On the one hand, it effectively removes the imaging effect of uneven intensity in the sonar image, and on the other hand, it effectively enhances the target bright region and dark region of the image, effectively improving the false - alarm correct rate of target detection.
[0078] 2. The adaptive threshold processing in the present invention determines the threshold according to the local information characteristics of the image after heterogeneous filtering, directly performs region segmentation on the filtered image, and obtains the initial contour and position of the target.
[0079] 3. The fine segmentation based on level set in the present invention uses the result of threshold processing as the initial contour. Combining with the superpixel boundary constraint, it drives the segmentation contour to the superpixel boundary to obtain the exact target contour, so as to retain more accurate target feature information and provide guarantee for the extraction and recognition classification of features. Description of the Drawings
[0080] Figure 1 is the processing flow chart of the present invention;
[0081] Figure 2 is the schematic diagram of the waterfall diagram half - frame cross - intercepting method in the first step of the present invention;
[0082] Figure 3 is the effect diagram of non - local means denoising in the second step of the present invention;
[0083] Figure 4 It is the effect diagram of the superpixel segmentation in the third step of the present invention;
[0084] Figure 5 It is the flow chart of the step-by-step heterogeneous filtering in the fourth step of the present invention;
[0085] Figure 6 It is the flow chart of the adaptive threshold processing in the fifth step of the present invention;
[0086] Figure 7 It is the effect diagram of the level set segmentation in the sixth step of the present invention. Detailed implementation manners
[0087] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0088] As Figure 1 shown, a sonar target processing method based on heterogeneous filtering detection and level set segmentation is as follows:
[0089] Step 1: Collect side-scan sonar data. Collect sonar data through a sonar device and save the sonar data as an interpretable XTF file. Parse the XTF file to obtain sonar visualization data and generate a sonar visualization waterfall diagram; for the visualization data, use the half-frame cross-interception method to intercept the image into a fixed-size sonar image with a width of 1166 pixels and a height of 376 pixels. According to the imaging symmetry of the left and right half-side images of the side-scan sonar image, the following takes the right half-side image as an example for processing.
[0090] In this embodiment, according to the size of the underwater target predicted in the sonar image, the half-frame cross-interception method is used for sonar data visualization processing to prevent the target position from being split into different frames due to being on the frame division line during visualization frame interception, and to ensure the integrity of the sonar target image.
[0091] Step 2: Perform non-local means image denoising processing to remove the speckle noise in the image and improve the sonar image quality.
[0092] Each pixel in the sonar image is respectively used as a target pixel for non-local means image denoising processing. The specific process is as follows: for all pixels in the entire image except the target pixel, calculate the local similarity between its neighborhood and the neighborhood of the target pixel; and use the weighted mean of all pixels except the target pixel with the local similarity as the weight to replace the pixel value of the target pixel to achieve sonar image denoising. The specific process is as follows:
[0093] For the pixel p in the sonar image I, the weighted sum of other pixels q in the image I is used as its pixel value. That is, the image NL[v](p) after non-local mean denoising is as follows:
[0094]
[0095] Among them, the weight w(p,q) of each pixel q is the similarity between the local neighborhood centered on q and the local neighborhood centered on p. That is, the weight w(p,q) of pixel q is:
[0096]
[0097] Among them is the normalization factor of the similarity weight, is the Euclidean distance between the central neighborhoods of p and q. According to the above method, the pixel values of the sonar image are reset to obtain the image NL after non-local mean denoising.
[0098] Step three: Perform image superpixel segmentation to generate superpixels segmented by the target boundary to improve the image processing speed.
[0099] The process of superpixel segmentation is as follows: The image is segmented into multiple superpixel regions of 12×12 pixels, and superpixel centers are set at the centers of the superpixel regions. For the 24×24 neighborhood region centered on the superpixel center, local superpixel center iteration and pixel label iteration are performed with the pixel value distance, pixel coordinate distance, and LDZP texture description value distance between all pixels in the neighborhood and the superpixel center pixel as the clustering distances to achieve local iterative clustering. The image is segmented into multiple superpixels, and the superpixel edges are as close as possible to the target edges. The pixel mean of each superpixel region is used as the pixel value of the superpixel to generate the superpixel image I SP .
[0100] 3-1. According to the size of the sonar image, the right half of the sonar image is pre-segmented into 48×30 sub-regions of 12×12 pixels. 48×30 seed points are evenly distributed as superpixel centers with a step size S of 12 pixels, and the gradient values of the 4×4 neighborhood of the sub-region center are calculated, and the seed points are placed at the positions with the minimum gradient values.
[0101] 3-2. Assign initial class labels to the 48×30 sub-regions, and use the 2S×2S neighborhood of the seed points as the search range. Calculate the distance metric D between each pixel and each seed point respectively, and update the class label of the pixel to the class label of the seed point with the minimum distance to it. Among them, for the gray value of the one-dimensional gray image of the sonar, the pixel (x,y) coordinates, and the LDZP texture description value are used as the basis for the distance metric:
[0102] The pixel value distance metric is expressed as:
[0103]
[0104] Among them, NL[v] i is the pixel value of the current pixel; NL[v] j is the pixel value of the seed point.
[0105] The pixel coordinate distance metric is expressed as:
[0106]
[0107] Among them, (x i , y i ) is the coordinate of the current pixel; (x i , y i ) is the coordinate of the seed point.
[0108] The LDZP texture description value distance metric is expressed as:
[0109]
[0110] Among them, n is the pixel index of the local neighborhood centered on pixel i or j; N is the number of pixels in the neighborhood. For a 3×3 local neighborhood, N = 8. LDZP i,n is the LDZP texture description value of the nth indexed pixel in the local neighborhood centered on pixel i; LDZP j,n is the LDZP texture description value of the nth indexed pixel in the local neighborhood centered on pixel j.
[0111] The obtained distance metric D is:
[0112]
[0113] Each pixel is classified into the class corresponding to the different seed points with the minimum distance metric D as the criterion.
[0114] 3 - 3. Update the class label of each pixel according to Step 3 - 2, and use the average value of the x - coordinate and y - coordinate of the pixels with the same class label as the position of the seed point of this class label to update the position of the seed point of this class label.
[0115] 3 - 4. Perform iterative updates on the global pixel class labels and class seed point positions according to the above Steps 3 - 2 and 3 - 3 until the position of each class seed point no longer changes. According to experience, generally, iterating about 10 times can obtain an ideal classification result.
[0116] 3-5. After the above iterative optimization process, the iterative results may present situations such as multi-connectedness, overly small superpixels, and a single superpixel being divided into multiple discontinuous superpixels. The above problems are solved through connectivity enhancement. For the class label matrix, the discontinuous classes and classes with too small sizes are reassigned to neighboring classes in the order from left to right and top to bottom until the reassignment is completed, obtaining the final superpixel segmentation image and the superpixel class label matrix. If the number of pixels within a class label is less than 60, then this class label is determined to be too small.
[0117] 3-6. For each class, calculate the mean of all its pixel values as the pixel value of the corresponding superpixel, and generate a superpixel image I of 48×30 pixels with the coordinate position of the superpixel center as the mapping position. SP 。
[0118] Step 4: Heterogeneous filtering target detection. According to the sonar imaging characteristics of underwater targets, a heterogeneous filter is adopted for image filtering. For each pixel in the superpixel image, after performing heterogeneous filtering on the bright target area and scaling it proportionally to the grayscale pixel range, the bright area filtered image HCA is obtained. HO , after performing heterogeneous filtering on the dark target area and scaling it proportionally to the grayscale pixel range, the dark area filtered image HCA is obtained. HS ; Add the bright area filtered image HCA HO and the dark area filtered image HCA HS to obtain the heterogeneous filtered image HCA H , and the specific process is as follows:
[0119] The sonar image area with uneven intensity can generally be divided into a background area Ω with locally similar intensity b , a bright target area Ω with a dark area in the local area o , and a dark target area Ω with a bright area in the local area s . According to the above sonar image characteristics, the steps of heterogeneous filtering are divided into bright area filtering and dark area filtering, and the process is as follows:
[0120] 4-1. Bright area filtering.
[0121] Design the bright area heterogeneous filter f o as:
[0122]
[0123] Among them, the position where f o [2,2]=3 is the convolution center, and using the bright area heterogeneous filter f o as the convolution kernel to perform convolution operation on the superpixel image I SP :
[0124] (1) When dealing with the background area Ω with locally similar intensityb When performing a convolution operation on the superpixel b, due to the similar local intensities in the background region, the convolution result HCA of the superpixel b in the background region HO_b ≈0;
[0125] (2) When performing a convolution operation on the superpixel o of the target bright region Ω with a dark region in the local area o Since the right neighborhood of the Ω region in the right sonar image appears as a dark region for the bright region, the convolution result HCA of the superpixel i in the target bright region Ω o >>0; o of the superpixel i HO_o >>0;
[0126] (3) When performing a convolution operation on the superpixel s of the target dark region Ω with a bright region in the local area s Since the left neighborhood of the Ω region in the right sonar image appears as a bright region for the dark region, the convolution result HCA of the superpixel s in the target dark region Ω s ≈0; s of the superpixel s HO_s ≈0;
[0127] According to the above convolution operations, a heterogeneous filtering result for the bright region is obtained from the superpixel image. The convolution results HCA of all pixels HO_o are scaled proportionally to the gray levels of 127.5 - 255 to obtain the bright region filtered image HCA HO as follows:
[0128] HCA HO = H omax (f o × I SP )
[0129] where H omax (·) is the scaling calculation with the maximum value of all convolution results HCA HO_o as the upper limit.
[0130] 4 - 2. Dark region filtering.
[0131] Design the dark region heterogeneous filter f s as:
[0132]
[0133] where the position where f s [2,3] = -3 is the convolution center. Using the dark region heterogeneous filter f s as the convolution kernel to perform a convolution operation on the superpixel image I SP :
[0134] (1) When performing a convolution operation on the background region Ω with similar local intensities bWhen performing a convolution operation on the superpixel b, due to the similar local intensities in the background area, the convolution result HCA of the superpixel b in the background area HS_b ≈0;
[0135] (2) When performing a convolution operation on the superpixel o of the target bright area Ω with a dark area in the local area o , since the right neighborhood of the Ω area in the right sonar image is a dark area, the convolution result HCA of the superpixel i in the target bright area Ω o ≈0; o The superpixel i of the target bright area Ω HS_o ≈0;
[0136] (3) When performing a convolution operation on the superpixel s of the target dark area Ω with a bright area in the local area s , since the left neighborhood of the Ω area in the right sonar image is a bright area, the convolution result HCA of the superpixel s in the target dark area Ω s >>0; s The superpixel s of the target dark area Ω HS_s >>0;
[0137] According to the above convolution operation, the heterogeneous filtering result of the dark area is obtained from the superpixel image, and the convolution result HCA of all pixels HS_s is scaled proportionally to the 0 - 127.5 gray level to obtain the dark area filtered image HCA HS as follows:
[0138] HCA HS = 127.5 - H smax (f s *I SP )
[0139] where H smax (·) is the scaling calculation with the maximum value of all convolution results HCA HS_s as the upper limit.
[0140] 4 - 3. Fuse the bright area filtered image HCA HO and the dark area filtered image HCA HS obtained above to obtain the heterogeneous filtering image HCA H as:
[0141] HCA H =(HCA HO +HCA HS ) - 127.5
[0142] Step 5: Adaptive threshold processing. Calculate the local variance and mean for each pixel of the heterogeneous filtered image respectively, perform adaptive threshold segmentation based on local information to obtain the exact boundary position between the bright and dark regions of the target, and perform adaptive region expansion according to the pixel value characteristics of the bright and dark regions to obtain the contour HCA of the rough segmentation of the target A , and the specific process is as follows:
[0143] For the heterogeneous filtered image HCA H in the bright region Ω of the target to the pixel value is much greater than 127.5, and in the dark region Ω of the target ts the pixel value is much less than 127.5. The pixel values in the background region are around 127.5. According to the pixel value distribution characteristics in the heterogeneous filtered image HCA H , the adaptive threshold processing is divided into two steps: the processing of the bright region Ω of the target to and the processing of the dark region Ω of the target ts .
[0144] Let x i be the pixel value of the superpixel point i in the heterogeneous filtered image HCA H , σ i 2 be the pixel value variance of the 3×3 neighborhood centered on the superpixel point i in the heterogeneous filtered image HCA H , μ i be the pixel value mean of the 3×3 neighborhood centered on the superpixel point i in the heterogeneous filtered image HCA H . Substitute the pixel values of the heterogeneous filtered image HCA H into the following formula to obtain the processed image HCA to of the bright region Ω of the target Ao as follows:
[0145]
[0146] where k o is the adaptive threshold of the bright region, which can be adaptively set according to the target size and imaging quality in the experimental environment.
[0147] Substitute the pixel values of the heterogeneous filtered image HCA H into the following formula to obtain the processed image HCA ts of the dark region Ω of the target As as follows:
[0148]
[0149] where k s is the adaptive threshold of the dark region, which can be adaptively set according to the target size and imaging quality in the experimental environment.
[0150] After that, for the bright region Ω of the target toProcess the image HCA Ao with the target dark region Ω ts Process the image HCA As and fuse them to obtain the adaptively thresholded processed image HCA A as follows:
[0151] HCA A =(HCA Ao +HCA As ) - 127.5
[0152] The target bright region Ω in the heterogeneous filtered image HCA H and the target dark region Ω to have similar local pixel distribution characteristics related to the processing. The following takes the processing of the target bright region Ω ts as an example for illustration: to For example:
[0153] First, analyzing the relationship between the local mean and variance in different regions shows that:
[0154] (1) In the background region Ω b , let n be 3 (the same below), representing the 3×3 local neighborhood centered on the superpixel i. μ b is the mean of the local neighborhood of the superpixel i, and its local variance σ b 2 is:
[0155]
[0156] Since the local pixel values in the background region Ω b are similar, the background region superpixel value x b and its local neighborhood mean μ b and variance σ b 2 have the following relationship:
[0157]
[0158] (2) In the target bright region Ω to , μ to is the local mean of the superpixel i, x to is the target bright region superpixel value, and its local variance σ to 2 can be expressed as:
[0159]
[0160] Since the pixel values in the target bright region Ω to are greater than the background superpixel values, the target bright region superpixel value x to and the local region mean μ to and variance σto 2 The relationship is:
[0161]
[0162] (3) In the target dark region Ω ts where μ ts is the local mean of superpixel i, and x to is the superpixel value of the target dark region, its local variance σ ts 2 can be expressed as:
[0163]
[0164] Since the pixel values in the target dark region Ω ts are less than the superpixel value of the background, the superpixel value x ts of the target dark region and the local region mean μ ts and variance σ ts 2 have the relationship:
[0165]
[0166] Based on the local information characteristics of the above image, the following analysis is made for the target bright region Ω to :
[0167] First, determine that the local information relationship of the target bright region is:
[0168]
[0169] Secondly, assume that the thresholds μ and σ 2 of the local information are:
[0170]
[0171] From the local information characteristics of the image analyzed above, according to the relationship of the local information threshold μ, we can get:
[0172] (2x to - μ to ) μ to ≥ k·μ ≥ (2x b - μ b ) μ b
[0173] From the local information characteristics of the image analyzed above, according to the relationship of the local information threshold σ 2 we can get:
[0174] σ to 2 +(2x to - μ to ) μto ≥ σ to 2 + kμ ≥ σ 2 + kμ
[0175] From the above analysis, the target bright region Ω is obtained. to The relationship between the pixel value, its local mean variance, and the threshold is as follows:
[0176]
[0177] That is, when the pixel value of the pixel being processed in the target bright region Ω to satisfies the above formula, the pixel is a pixel in the target bright region; when it does not satisfy the above formula, the pixel is a pixel in the background region. The formula is expressed as follows:
[0178]
[0179] where k o is the adaptive threshold, which can be adaptively set according to the target size and imaging quality in the experimental environment.
[0180] Due to the similarity of the local distribution characteristics of the pixels related to the processing of the target bright region Ω H and the target dark region Ω to in the HCA image, when processing the target dark region Ω ts , first flip the image within the 0 - 255 gray level range, and then follow the processing steps of the target bright region to obtain the result of the target dark region Ω ts processing. The formula is expressed as follows: ts The processing result.
[0181]
[0182] According to the above analysis, the target bright region Ω is obtained. to Process the image HCA Ao and the target dark region Ω ts Process the image HCA As , and fuse the above two images to obtain the HCA image processed by the adaptive threshold A as:
[0183] HCA A = (HCA Ao + HCA As ) - 127.5
[0184] Step 6: Perform target fine segmentation of the level set function. Use the HCA image processed by the adaptive threshold AThe target rough segmentation area is the initial contour. An image energy function model based on distance regularization is constructed for the image. The image energy function is constructed by combining the superpixel boundary. According to the curve evolution theory and the level set theory, the evolution function is obtained for level set evolution, and the final target fine segmentation contour is obtained. The specific process is as follows:
[0185] Process the image HCA according to the adaptive threshold A The bright area contour and the dark area contour of the target area in the middle are the initial contours. The level set energy function Γ(φ1, φ2, f1, f2, f3) based on distance regularization is constructed for the target area as follows:
[0186] Γ(φ1, φ2, f1, f2, f3) = ε(φ1, φ2, f1, f2, f3) + R P (φ1, φ2) + E(φ1, φ2)
[0187] Among them, ε(φ1, φ2, f1, f2, f3) is the local fitting energy, which is expressed as:
[0188]
[0189] Among them, φ1 is the level set function of the bright area of the target, φ2 is the level set function of the dark area of the target, f1 is the local fitting energy of the image inside the zero-level curve of φ1, f2 is the local fitting energy of the image inside the zero-level curve of φ2, and f3 is the local fitting energy outside the image contour. K is the Gaussian kernel function, λ i is the parameter of the local fitting energy term, v i is the parameter of the length penalty term, and H(·) is the Heaviside function, which can be expressed as:
[0190]
[0191] Among them, ∈ is the parameter of the Heaviside function, and the parameter size can be selected according to the specific implementation.
[0192] R P (φ1, φ2) is the distance regularization term, which maintains the signed distance property of the level set function, avoids time-consuming re-initialization operations, and makes the level set function smooth and the derivative calculation more accurate, and is expressed as:
[0193]
[0194] Among them, μ i is the parameter of the distance regularization term, and the double-well potential function adopted is P(s), which can be expressed as:
[0195]
[0196] $E(\varphi_1,\varphi_2)$ is the superpixel constraint term, which drives the zero-set curve of the level set closer to the superpixel boundary to eliminate image noise interference and obtain a more accurate target contour, expressed as:
[0197]
[0198] Among them, $\alpha$ i is the parameter of the superpixel constraint term; $g(|\nabla I(x)|)$ is the level set stopping function, and its expression is as follows:
[0199]
[0200] Among them, $\Omega$ E is the point set of the superpixel boundary, and $\nabla I(x)$ is the gradient at pixel point $x$.
[0201] According to the level set energy function established above, the dual-region level set evolution equation is:
[0202]
[0203] Among them, $div(\cdot)$ is the divergence operation, and $\delta(\cdot)$ can be expressed as:
[0204]
[0205] According to the above level set evolution equation, the initial contours of the target bright region and dark region are evolved until the evolution converges to obtain the accurate contour of the target in the sonar image.
[0206] The following provides specific cases to verify the sonar target detection effect of the present invention:
[0207] Step 1: Parse the underwater sonar data XTF file collected and saved by the sonar device, visualize the data as a waterfall diagram, and use the semi-frame cross-intercept method to intercept a frame of 1166×376 pixel image every 188 pixels from the 1166-pixel-wide waterfall image, and record the position of the waterfall diagram corresponding to the starting position of each frame of image to accurately locate the actual position of the target in subsequent processing. For each frame of image, it is divided into left and right half-frame images along the midline, and the left half-image is flipped left and right, and the left-right consistency processing of the image is realized according to the characteristics of side-scan sonar imaging and the flipping position is recorded. In this way, the sonar data is visualized as a convenient-to-process right half-frame image and transferred to Step 2.
[0208] Step 2: For the pixel $p$ in the right half-frame sonar image $I$, use the weighted sum of other pixels $q$ in the image $I$ as its pixel value, that is, use the non-local mean method to reset the pixel value of the image, and the denoised image $NL[v](p)$ is:
[0209]
[0210] The weight w(p,q) of each pixel q is the similarity between the local neighborhood centered at q and the local neighborhood centered at p. That is, the weight w(p,q) of pixel q is as follows:
[0211]
[0212] where is the normalization factor of the similarity weight, is the Euclidean distance of the central neighborhoods of p and q. Reset the pixel values of the sonar image according to the above method to obtain the image NL after non-local mean denoising, and then go to Step Three.
[0213] Step Three: According to the size of the target area in the sonar image, with a step size of 12 pixels, preset the image obtained in Step Two into 48×30 superpixel regions and preset the class labels for each region. According to the denoised image, calculate the LDZP local texture description value of the image, and use the image pixel value, local texture description value, and pixel coordinates as the pixel distance metric to reset the class labels of each pixel within the 24×24 pixel neighborhood centered at each superpixel center in turn, and reset the position of each superpixel according to the mean value of the coordinate values of each class of pixels. Perform iterative updates according to the above method until the superpixel positions no longer change or the number of iterations reaches 10 times and then stop to obtain the superpixel segmentation result. Perform connectivity enhancement on the segmentation result. For the class label matrix, reassign the discontinuous superpixels and the superpixels with too small sizes to the adjacent superpixels in the order from left to right and from top to bottom until the reassignment is completed to obtain the final superpixel-segmented image and the superpixel class label matrix. For each class of superpixels, calculate the gray mean value of all pixels in the class as the gray value of the superpixel, and generate a 48×30-pixel superpixel image I SP , and then go to Step Four.
[0214] Step Four: Perform step-by-step heterogeneous filtering on the superpixel image I SP obtained in Step Three. Use two different filtering convolution kernels (the bright-region heterogeneous filter f o and the dark-region heterogeneous filter f s ) to perform convolution operations on the superpixel image I SP and perform normalization operations to obtain two heterogeneous filtering result images HCA HO and HCA HS . Fuse the two heterogeneous filtering result images HCA HO and HCA HS to obtain the step-by-step heterogeneous filtering processing result HCA H , and then go to Step Five.
[0215] Step 5: Perform adaptive thresholding on the stepwise heterogeneous filtering result HCA obtained in Step 4. First, calculate the local mean and variance of the 3×3 neighborhood of each superpixel as the local information of the superpixel. Taking the target bright area as an example (the target dark area has symmetric similarity with the target bright area in pixel values, and the image can be flipped within the 0-255 gray level according to pixel values to process the target dark area according to the processing method of the target bright area), the superpixels that satisfy the formula H are marked as target bright area pixels, where x is the superpixel gray value, μ is the mean of the 3×3 neighborhood of the superpixel, σ is the variance of the 3×3 neighborhood of the superpixel, and k is the adaptive threshold, which can be adaptively set according to the target size and imaging quality in the experimental environment, to obtain the target bright area image HCA 2 . Perform similar operations as the bright area processing on the stepwise heterogeneous filtering result HCA AO after flipping it within the 0-255 gray level to obtain the target dark area image HCA H . Fuse the target bright area image HCA AS and the target dark area image HCA AO to obtain the image HCA AS after adaptive thresholding. This image represents the position and rough segmentation contour of the target in the sonar image, and proceed to Step 6. A
[0216] Step 6: Based on the position and rough segmentation contour of the sonar target obtained in Step 5, perform precise segmentation using the level set method. Taking the rough segmentation contour as the initial region of the target, extend the level set method to the dual-target domain, construct a global energy function based on the level set function, and add a constraint term for the superpixel boundary. According to the curve evolution principle, obtain the evolution function of the level set function to perform level set zero-set contour evolution, and drive the zero-set contour to the target boundary to obtain the precise segmentation contour of the underwater sonar image target.
[0217] Figure 2 is a schematic diagram of the half-frame cross-interception method for waterfall diagrams. Starting from the echo data in the first column of the image, restart a frame every 188 columns of echo data, and take every 376 columns of echo data as an image to visualize the sonar raw data into an image that is convenient for processing. Under this image interception method, it can be ensured that each target can exist completely in one frame of the image, avoiding being truncated into two parts and resulting in detection loss.
[0218] Figure 3 is the effect diagram of non-local mean denoising. It can be seen from the figure that this step can effectively filter out the speckle noise in the image caused by seabed reverberation and device noise, and can effectively avoid the influence of noise on the subsequent processing effect.
[0219] Figure 4 It is an effect diagram of superpixel segmentation. In this embodiment, the diagram is segmented into 48×30 superpixels with a step size of 12 pixels. The green dots in the diagram are the central positions of the superpixels. It can be seen that the superpixel boundaries are close to the target boundaries, which is beneficial to the effect of superpixel boundary constraints in the subsequent level set fine segmentation process.
[0220] Figure 5 It is a flowchart of step-by-step heterogeneous filtering. Step-by-step heterogeneous filtering performs bright area filtering and dark area filtering on the superpixel image respectively. During the filtering, the convolution results are truncated at 0 and normalized to the gray level of 0-255. For this embodiment diagram, the maximum value of the bright area convolution result HCA HO_o is 628.26, and the maximum value of the dark area convolution result HCA HS_s is 542.58. And for the filtered and normalized results HCA HO and HCA HS , the heterogeneous filtered image HCA H is obtained.
[0221] Figure 6 It is a flowchart of adaptive threshold processing. The local mean and variance of each superpixel are calculated with a 3×3 local area as the local neighborhood of the superpixel, and adaptive threshold processing for the bright area and the dark area is performed. For this embodiment diagram, the selected bright area threshold k o is 210, and the dark area threshold k s is 195. The target bright area processed image HCA Ao and the target dark area processed image HCA As are obtained. The above two images are fused to obtain the adaptive threshold processed image HCA A .
[0222] Figure 7 It is an effect diagram of level set segmentation. Among them, the rough segmentation contour is used as the initial region. As the number of evolution iterations of the level set function increases, the segmentation contour continuously approaches the target contour until the global energy function converges to the minimum value or the number of iterations reaches the specified number of iterations with the evolution, then the iteration stops. For this embodiment diagram, each parameter is: λ1 = λ2 = λ3 = 1, v1 = v2 = 0.03×255 2 , σ = 5, μ1 = μ2 = 1, α1 = α2 = 150, ∈ = 1.0. When the number of iterations reaches 280 times, the segmentation contour completely reaches the expected target contour, and the most accurate segmentation result is obtained.
[0223] Specific examples are cited in this specification to elaborate on the principles and implementation methods of the present invention. The descriptions of the above embodiments are only used to help understand the method and its core idea of the present invention; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be construed as a limitation to the present invention.
Claims
1. A sonar image target processing method based on heterogeneous filtering detection and level set segmentation, characterized in that: It includes the following steps: Step 1: Image acquisition; Collect side-scan sonar data to obtain a sonar image; Step 2: Denoising processing; Perform non-local means image denoising processing on the sonar image; Step 3: Superpixel image segmentation; Segment the sonar image into multiple superpixel regions of S×S pixels, where S is the preset width of the superpixel region; Set a superpixel center at the center of the superpixel region. For the 2S×2S neighborhood region centered on the superpixel center, perform local superpixel center iteration and pixel label iteration with the pixel value distance, pixel coordinate distance, and LDZP texture description value distance between all pixels in the neighborhood and the superpixel center pixel as the clustering distance to achieve local iterative clustering, segment the image into multiple superpixels, and the superpixel edges are close to the target edges. Use the pixel mean of each superpixel region as the pixel value of the superpixel to generate a superpixel image; Step 4: Heterogeneous filtering target detection; For each pixel in the superpixel image, perform target bright area heterogeneous filtering separately and then scale it proportionally to the grayscale pixel range to obtain the bright area filtered image HCA HO ; For each pixel in the superpixel image, perform target dark region heterogeneous filtering separately and then scale it proportionally to the grayscale pixel range to obtain the dark region filtered image HCA HS ; Fuse the bright-region filtered image HCA HO and the dark-region filtered image HCA HS to obtain the heterogeneous filtered image HCA H ; Step 5: Adaptive threshold processing; For each pixel of the heterogeneous filtered image, calculate the local variance and mean respectively, perform adaptive threshold segmentation based on local information to obtain the boundary position between the bright and dark regions; perform adaptive region expansion according to the pixel value characteristics of the bright and dark regions to obtain the adaptive threshold processing image HCA containing the rough segmentation contour of the target A ; Step 6: Target fine segmentation; Process the image HCA with an adaptive threshold A Use the rough segmentation contour of the target in A as the initial contour, construct a level set function model based on distance regularization, combine the superpixel boundary to construct an image energy function, and perform level set evolution to obtain the fine segmentation contour of the target.
2. The sonar image target processing method based on heterogeneous filtering detection and level set segmentation according to claim 1, characterized in that: In Step 1, collect sonar data through a sonar device, save the sonar data as a readable XTF file, parse the XTF file to obtain sonar visualization data and generate a sonar visualization waterfall chart; For the visualization data, use the half-frame cross-interception method to intercept the image into a sonar image of a fixed size.
3. The sonar image target processing method based on heterogeneous filtering detection and level set segmentation according to claim 1, characterized in that: In Step 2, take each pixel in the sonar image as the target pixel and perform the following processing on the target pixel: For all pixels except the target pixel in the entire image domain, calculate the local similarity between its neighborhood and the neighborhood of the target pixel; Use the weighted mean of all pixels except the target pixel with the local similarity as the weight to replace the pixel value of the target pixel.
4. The sonar image target processing method based on heterogeneous filtering detection and level set segmentation according to claim 1, characterized in that: The process of superpixel segmentation in Step 3 is as follows: 3-1. According to the size of the sonar image, divide the processed part of the sonar image into several sub-regions of S×S pixels; Calculate the gradient values of the 4×4 neighborhoods of the centers of each sub-region respectively, and place the seed points at the positions with the minimum gradient values; Use the seed points of each sub-region as the superpixel centers; Assign initial class labels to each sub-region; 3-2. Use the 2S×2S neighborhood of the seed point as the search range, and calculate the distance metric D between each pixel point in the search range and the seed point as follows: Among them, d c is the pixel value distance between the current pixel and the adjacent seed point; d s is the pixel coordinate distance between the current pixel and the adjacent seed point; d t is the LDZP texture description value distance between the current pixel and the adjacent seed point; Classify each pixel into the class corresponding to different seed points with the minimum distance metric D as the standard; 3-3. Use the coordinate average value of the pixels with the same class label as the position of the seed point of this class label, and update the position of the seed point of this class label; 3-4. Perform iterative update of the class label and the class seed point position according to Steps 3-2 and 3-3 until the position of each class seed point no longer changes; 3-5. For the class label matrix, reassign the discontinuous classes and the classes with the number of pixels less than the preset value to the neighboring classes in the order from left to right and from top to bottom until the reassignment is completed to obtain the final superpixel segmentation image and the superpixel class label matrix; 3-6. For each class, calculate the mean of all its pixel values as the pixel value of the superpixel corresponding to this class, and generate the superpixel image I with the coordinate position of the superpixel center as the mapping position SP .
5. The sonar image target processing method based on heterogeneous filtering detection and level set segmentation according to claim 1, characterized in that: The process of Step 4 is as follows: 4-1. Bright area filtering; Construct the bright-region heterogenous filter f o as follows: Among them, f o [2,2]=3 is the convolution center, and the bright-region heterogeneous filter f o is used as a convolution kernel to perform a convolution operation on the superpixel image I SP Based on the convolution result, the target bright region Ω o is distinguished; Convolve all pixels in the target bright region Ω o to obtain the convolution result HCA HO_o and scale it proportionally to the gray level of 127.5 - 255 to obtain the bright region filtered image HCA HO ; 4-2. Dark area filtering; Construct the dark zone heterogeneous filter f s as follows: Among them, f s [2, 3]=-3 is the position of the convolution center, and the dark region heterogeneous filter f s is used as the convolution kernel to perform convolution operation on the superpixel image I SP , and the target dark region Ω is distinguished according to the convolution result s ; Convolve all pixels in the target dark region Ω s to obtain the convolution result HCA HS_s and scale it proportionally to the gray level range of 127.5 to 255 to obtain the dark region filtered image HCA HS ; 4-3. Fuse the bright-region filtered image HCA HO and the dark-region filtered image HCA HS to obtain the heterogeneous filtered image HCA H as follows: HCA H =(HCA HO +HCA HS ) - 127.5。 6. The sonar image target processing method based on heterogeneous filtering detection and level set segmentation according to claim 1, characterized in that: The specific process of Step 5 is as follows: 5-1. Process the image HCA according to the constructed target bright area Ao As follows: Among them, HCA Ao (i), HCA H (i) are respectively the pixel values of the superpixel point i in the target bright area processed image HCA Ao , the heterogeneous filtering image HCA H ; σ i 2 is the variance of the pixel values of the 3×3 neighborhood centered on the superpixel point i in the heterogeneous filtering image HCA H , μ i is the mean value of the pixel values of the 3×3 neighborhood centered on the superpixel point i in the heterogeneous filtering image HCA H ; k o is the adaptive threshold of the bright area; Process the image HCA according to the constructed target dark area As As follows: Among them, HCA As (i), HCA H (i) are respectively the pixel values of the superpixel point i in the target dark region processed image HCA As , the heterogeneous filtering image HCA H ; k s is the adaptive threshold of the dark region; 5-2. Process the target bright area processed image HCA Ao with the target dark area processed image HCA As to fuse and obtain the adaptive threshold processed image HCA A as follows: HCA A =(HCA Ao +HCA As ) - 127.5。 7. The method for processing sonar image targets based on heterogeneous filtering detection and level set segmentation according to claim 1, characterized in that: The specific process of Step 6 is as follows: 6-1. Process the image HCA with an adaptive threshold, and use the bright and dark region contours in A as the initial contours. The distance regularization based level set energy function Γ(φ1, φ2, f1, f2, f3) for the target region is as follows: Γ(φ1, φ2, f1, f2, f3) = ε(φ1, φ2, f1, f2, f3) + R P (φ1, φ2) + E(φ1, φ2) Among them, ε(φ1, φ2, f1, f2, f3) is the local fitting energy, and R P (φ1, φ2) is the distance regularization term; E(φ1, φ2) is the superpixel constraint term; The expression of the local fitting energy ε(φ1,φ2,f1,f2,f3) is as follows: Among them, φ1 is the level set function of the target bright area, φ2 is the level set function of the target dark area, f1 is the local fitting energy of the image inside the zero-level curve of φ1; f2 is the local fitting energy of the image inside the zero-level curve of φ2, f3 is the local fitting energy outside the image contour; K is the Gaussian kernel function, λ i is the parameter of the local fitting energy term, v i is the parameter of the length penalty term, H(·) is the Heaviside function, and the expression is: where ∈ is the parameter of the Heaviside function; Distance regularization term R P (φ1, φ2) is expressed as follows: where μ i is the parameter of the distance regularization term; P(·) is the double-well potential function, and its expression is as follows: The expression of the superpixel constraint term E(φ1, φ2) is as follows: Among them, α i is the parameter of the superpixel constraint term; is the level set stopping function, and its expression is as follows: Among them, Ω E is the set of points on the superpixel boundary, is the gradient at pixel point x. If pixel point x is not in the set of points on the superpixel boundary, then is set to 0; 6-2. Construct the dual-region level set evolution equation as follows: where div(·) is the divergence operation, and the expression of δ(·) is as follows: 6-3. According to the above level set evolution equation, evolve the initial contours of the target bright region and dark region until the evolution converges to obtain the exact contours of the target in the sonar image.
Citation Information
Patent Citations
Underwater target rapid extraction method for side-scan sonar imaging
CN107167810A
Eye fundus image quality control method
CN107451998A