Fast Segmentation Method for Sonar Images Blurred by Noise Reduction

: It has remained a hard nut for years to segment sonar images, most of which are noisy images with inevitable blur after noise reduction. For the purpose of solutions to this problem, a fast segmentation algorithm is proposed on the basis of the gray value characteristics of sonar images. This algorithm is endowed with the advantage in no need of segmentation thresholds to be calculated. To realize this goal, it follows the undermentioned steps: first, calculate the gray matrix of the fuzzy image background. After adjusting the gray value, segment the region into the background region, buffer region and target regions. After filtering, reset the pixels with gray value lower than 255 to binarize images and eliminate most artifacts. Finally, remove the remaining noise from images by means of morphological image processing. The simulation results of several sonar images show that the algorithm can segment the fuzzy sonar image quickly and effectively, with no problem of incomplete image target shape. Thus, the stable and feasible method is testified.


Introduction
Sonar equipment is a kind of indispensable equipment for ocean development. As ocean development is getting deepened, there are more rigid requirements for the recognition accuracy of sonar image and the recognition speed of underwater targets. It is because of the complicated marine environment that sonar images often have low contrast and low resolution. The noise generated by the marine environment also brings great difficulties in segmentation and recognition of sonar images. There are few references on how to segment the blurred sonar image after noise reduction. The Markov random field studied by Ahmadvand et al. [1,2] has a good effect on sonar image segmentation. Du et al. [3][4][5] devised the method of maximum entropy segmentation to improve the image segmentation speed. Li et al. [6][7][8] modify the particle swarm optimization method and achieved good results. Today, some of existing methods cost enormously in the time for the threshold calculation [9,10] such as Otsu method [11][12][13] and iterative threshold method [14,15]. Despite these methods are widely used, the segmentation effect of fuzzy sonar image is poor and the execution time is long. Because the ideal result is to get the binary image which only contains the target, this paper proposes a new method to segment the sonar images according to the characteristics of the gray value of those images. Only the pixel with gray value lower than 255 is reset to complete the preliminary segmentation. firstly, calculate the background gray value matrix of fuzzy image. second, the background region, buffer region and target region are divided by the mapping equation. In addition, the fluctuation range of gray value in the same region is very small to prevent too many artifacts in the later operation. After that, the gray value of the whole image is adjusted and filtered. At this time, the gray value of the target is 255. At this time, the gray value of pixels less than 255 can be changed to 0, and the redundant artifacts can be removed to achieve the purpose of preliminary segmentation. Finally, image segmentation is completed by morphological image processing. In this segmentation process, it is not necessary to calculate the image segmentation threshold, so as to achieve the purpose of fast image segmentation. The simulation of multiple sonar images by MATLB shows that this method is feasible and stable.

Model of noise images
As shown in Figure 1, in order to verify the stability and feasibility of the process, the following three sonar images are selected as the research objects. Due to the influence of equipment performance, seabed suspended solids and other factors, sonar image will be greatly disturbed in the imaging process. The problem brings great difficulties in sonar image segmentation. In the process of signal transmission [16], due to the complex underwater environment and easy noise pollution, most of them [17] are noisy images. In order to verify the feasibility of the algorithm, it is necessary to apply noise to the sample image according to the actual underwater noise. After noise reduction, the image is segmented to ensure the accuracy of the results.
First of all, the underwater noise and its impact on the image need to be analyzed. There are three kinds of underwater noise [17]: reverberation of active sonar, sea ambient noise and sonar selfnoise, in which the sea ambient noise appears as Gaussian noise in the sonar image, and is inevitably disturbed during the underwater imaging. The reverberation of active sonar is speckle noise in the sonar image, especially in the sonar image generated in shallow water.
The amplitude of the sea ambient noise in the deep sea obeys Gaussian distribution, and its model [17] is as follows: in which, z stands for the gray value of the image. The mean value is as follows: = ∫ ( ) (2) Its variance is as follows: According to the noise model, Gaussian noise with mean value of 0 and variance of 0.03 is added to sonar image respectively. Next, a model is to be considered for the reverberation of active sonar. The reverberation noise in the image is shown as multiplicative speckle noise [17], and its model is as follows: (i, j) = (i, j) * (i, j) (4) in which, N (i, j) represents the amplitude of the noise image pixel at point (i, j). O (i, j) is the original image, and n (i, j) is the noise that the original image suffers. In consideration of few denoising methods for multiplicative noise, it is required to approximate it to additive noise to facilitate image processing. Its formula is as follows: (i, j) = ( , ) + ( ( , ) − ) (5) in which, ͞ n is the average value of noise and its value is constant 1.
Next, the speckle noise with standard deviation of 1.2 is added to the image samples. These two kinds of noise, to some extent, are so unavoidable that it is usually imperative to denoise the sonar images. Next, we need to denoise the image, and design the corresponding process to segment the denoised image. By means of the segmentation result comparison between of proposed method and other methods, the stability and feasibility of the algorithm are verified.

The processing of sonar images by guided filtering
Guided filtering [18][19][20] has a good effect on sonar image denoising. It is applied to calculate the relationship between near points and target points by virtue of the locally linear model. Suppose I and q respectively stand for the input image and output image, and K represents the center pixel of mask Wk, and then their locally linear relationship is as follows: = + , ∀ ∈ (6) in which, when the mask center is point K, a and b are constant coefficients.
The linear relationship between the input image and the guide image is ▽ q = a ▽ I, which ensures that the output image must have gradient when the guide image has gradient. The relationship between the input noise image p and the output image is qi = pi -ni. In order to minimize the difference between the input image and the output image, and calculate the coefficients a and b, the following results can be obtained: After solving, the values of a and b can be obtained as follows: in which, | w | is the total number of pixels in the mask, σk2 is signifies the variance of the guide image I within the mask wk, and μk symbolizes the mean value of the guide image I in the mask wk. Each pixel is contained by multiple linear masks. The output value of a pixel is equal to the average value of the pixel in multiple linear masks, with its calculation formula as follows: Preprints (www.preprints.org) | NOT PEER-REVIEWED | Posted: 15 October 2020 doi:10.20944/preprints202010.0323.v1 The values of a͞ i and b͞ i are obtained as follows: As shown in Figure 4, guided filtering is used to filter multiple sonar images interfered by Gaussian noise. The guided filter is used for processing of multiple sonar images, and most of Gaussian noise in the images is removed. This shows that the guided filter has a good effect on the Gaussian noise of sonar images caused by sea ambient noise.
Next, the effect of guided filtering on speckle noise caused by reverberation of active sonar is tested. Figure. 5 implies that the guided filter is applied to deal with the speckle noise in those images. After the guided filter is used for speckle noise in multiple images, it is found that most of the noise in images are removed. It is shown that the guided filtering has a good effect on the speckle noise of sonar images caused by reverberation of active sonar in the ocean.
In consideration of the whole image blurred by noise reduction, however, it is necessary to segment the blurred image under the condition that the intact target shape in the image is ensured.

Design of processing
As shown in Figure 6, the gray histogram of sonar images is needed to grasp general distribution features of the gray value for the purpose of segmentation processes to be designed on the basis of traits. Judging from the traversal and statistic data of gray histogram, the target in the sonar image has the gray value far greater than that of the background. The background gray value is largely about 0.1 * 255; likewise, the pixels around the target show their gray value higher than that of the peripheral background. Thus, the sonar image is divided into three obvious regions. The process could be devised as below, with reference to characteristics mentioned above. As elicited from the flow chart, the background gray value matrix of the blurred image is to be calculated necessarily for the image segmentation.

Calculation of background gray value matrix
It is imperative to calculate the background gray value matrix of the denoised image, for the purpose of the sonar image segmentation and repair such incomplete parts of the target in the image as bubbles, and head and legs of a frogman. First, use a 9 * 9 mask to filter the image. The mean filtering can lower down the fluctuation amplitude of the image gray value, and raise the gray value around the main object in the image and thus, laying the foundation for the calculation of the background gray value matrix.
Then, finalize the mask size according to the target size in the image. To do so, use a 7 * 7 mask to traverse all the pixels in the image. Pick out and record n points with the highest gray values among the 49 points centered on g (x, y). Next, sort the recorded gray values in a descending order to form a set M. In consideration of the interference of residual noise in the image, remove both maximum and minimum gray values before calculating the background gray value. Then, calculate the average value of the remaining gray values in the set as the background gray value of the mask center point g (x, y). The calculated background gray value matrix and its histogram are shown in Figure 8. After the background gray value is calculated, the mapping equation is used to adjust the gray value of the whole image to the characteristics of underwater acoustic image gray value. Then, divide the image is divided into three regions in the ascending order of the gray value, namely background region, buffer region and target region.

Calculation of background gray value matrix
Next, apply the mapping equation to map the background matrix onto the original image for adjustment of the gray value. The background gray value at point (x, y) is B, the gray value of the original image at (x, y) is A, and the gray value at point (x, y) after adjustment is E. The gray value is adjusted as steps indicate in Figure 9. According to the gray histogram, when the gray value B in the background matrix is lower than 0.1 * 255, the point is likely to be the background region. If the point appears in the target region, and could be compensated by the median filter in subsequent processes, so the gray value could be 0 directly.
Since the image has undergone the mean filter before the gray value adjustment, the point is likely to be the target in the image when B is less than A, so it is to ascertain whether E is less than 0.6 * 255 after adjustment. If it is lower than this value, it may indicate that the gray value of this part of the image is overshadowed by that of other parts in the target region, so the gray value of this part of the image is increased to 0.6 * 255.
If E is greater than 0.6*255, it is the interior of the target region, so it is necessary to suppress the gray value of this point, so as to lay a foundation for raising the overall gray value of the target to 255.
Finally, if B is greater than A, it means that the probability of this point is probably to be around the target region or to be the target region. Therefore, set its gray value as 0.4 * 255 to ensure that the following compensation with median filtering will not impose excessive impacts upon the target shape.
K acts as the magnification factor. Due to differences in the background gray value, the multiplication of subtraction is also different. And we want to make this image create artifacts in the low gray value area of the target, and suppress the area with high gray value in the target area, so as to lay a foundation for the overall gray value of the target to reach 255 after gray stretching. K is valued as follows: = 5 ≥ 220 = (3 * − 60)/120 100 < < 220 = 2 22.5 ≤ ≤ 100 The mapped images are shown in Figure 10. The preliminary segmentation results are shown in Figure 11. Obviously, the fracture in the target region is repaired, and the interference pixels in the buffer region are also reduced. At this time, the gray value of the target region is 255.
Next, it is necessary to reset the pixels with gray values below 255 and then segment the sonar image through processing of such pixels in a morphological way.

Simulation results
The gray value of the target in the image is 255. The rest parts of background region and buffer region are the background parts of the image after segmentation. Therefore, fulfill binarization by resetting pixels with gray values less than 255. Then, divide the image is divided into three regions in the ascending order of the gray value, namely background region, buffer region and target region.
After binary, some artifacts are eliminated with the remaining artifacts used to repair the target reduction and reduce the lack of pixels in the target. The region with low gray value is enhanced, which is convenient for the following morphological processing of the image.
For the binarized image that is acquired, the steps are taken as follows to carry out morphological processing necessary for segmentation: First, define a 4 * 4 square structure element B. After erosion algorithm, the small target removal algorithm is performed on the result image to remove the area less than 150 pixels. Then, for the sake of spindle-shaped underwater objects, a flat structure element C with radius of 4 is defined to perform the dilation algorithm on the image. Finally, a binarized image is obtained, with only targets contained in the image. In the image of frogman and bubble, if the main target is the frogman, it is feasible to eliminate the bubble by morphological dilation and erosion and small target removal algorithm.  Finally, the method adopted in this study is compared with other segmentation methods, such as Otsu method, one-dimensional maximum entropy segmentation method and iterative threshold method in terms of segmentation time and segmentation effect. Otsu method aims at segmentation based on the binarization threshold of the image.  The entropy in the image represents the average amount of information in the image, and the threshold T is determined with reference to the entropy after one-dimensional maximum entropy segmentation method is adopted.    The evaluation of the algorithm from two aspects of segmentation effect and segmentation time discloses that: after segmentation with adoption of this method, the image has the relatively intact morphology, the target in the image shows a full shape for the high-quality segmentation from the image. This is conspicuous in the segmentation of frogman and bubble image; from the perspective of execution time, the proposed method does not take so long because of no need in calculation of the segmentation threshold, and thus, the execution time for different images doesn't fluctuate bitterly.
From two aspects of segmentation result and segmentation time, it is proved that the method is feasible and stable.

Conclusion
In this paper, a fast segmentation algorithm for blurred sonar images is proposed, and the simulation results prove that the algorithm applies the precise segmentation of the sonar image. Before segmentation, three kinds of noises which may affect the sonar image are taken into consideration: reverberation of active sonar, sea ambient noise and sonar self-noise. After that, the blurred sonar image is obtained by eliminating the above noise by guided filtering.
During the preliminary segmentation of sonar images, such steps as image filtering, background gray value matrix calculation and gray value adjustment were taken to preliminarily segment multiple sonar images. Finally, the blurred sonar image was segmented by virtue of image morphological image processing after the image was binarized directly without calculation of the threshold value.
Finally, compared with other segmentation methods in terms of execution time and effect, this method is proved to be stable and feasible.
Author Contributions: Conceptualization, methodology, software and writing-original manuscript, H.M.; writing-review and editing, Z.X., Y.L. and S.C.; supervision, X.Z. and Y.L. All authors have read and agreed to the published version of the manuscript.