Side scan sonar image enhancement method and system for turbid waters
Patent Information
- Application Number
- CN202611232408.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-14
- Publication Date
- 2026-09-25
AI Technical Summary
[0004]为了解决无法区分孤立泥沙暗斑与真实实体遮挡暗区的空间分布差异的技术问题,本发明的目的在于提供一种面向浑浊水域的侧扫声呐图像增强方法及系统,所采用的技术方案具体如下:
该方法获取声呐原始矩阵,并进行有效区截取,通过有效区计算全局灰度均值,提取声呐原始矩阵中沿列方向随距离递减的灰度值变化规律,生成衰减背景矩阵,去除声呐原始矩阵中的环境干扰得到对数补偿矩阵,避免了采用除法增益补偿导致运算极易出现数值溢出的问题;分别计算各节点与预置的源点和汇点之间的连接权重;再计算相邻节点间的连接权重,并对构建好的网络结构图进行切割,得到目标遮挡二值化矩阵;通过目标遮挡二值化矩阵对对数补偿矩阵进行融合处理,解决了各向同性处理方式无差别地平滑所有像素的问题;再通过自然指数变换,得到灰度均衡图像,解决了无法区分孤立泥沙暗斑与真实实体遮挡暗区的空间分布差异的问题。
Smart Images

Figure CN122820520A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image enhancement technology, specifically to a method and system for enhancing side-scan sonar images in turbid waters. Background Technology
[0002] Side-scan sonar is a standard detection device for underwater exploration operations. It generates two-dimensional acoustic images by receiving underwater echoes. The strong reflective bright spots and the extremely dark acoustic shadows behind them in the images are key features for determining the geometry of underwater objects. When performing detection missions in highly turbid waters such as inland rivers or nearshore areas, a large number of suspended sediment particles in the water will cause strong volume scattering and absorption of high-frequency sound waves. This phenomenon leads to the use of division gain compensation in the sonar image processing flow to enhance the shadow contours of the downstream automatic target recognition system. However, since the effective energy of the far-end sound waves is extremely weak, the denominator of the division operation approaches zero, which makes the compensation operation prone to numerical overflow, thereby abnormally amplifying the weak sediment scattering noise.
[0003] Existing conventional image segmentation techniques, such as single-pixel grayscale thresholding or conventional morphological filtering, cannot distinguish the spatial distribution differences between isolated mud and sand dark spots and dark areas occluded by real entities. Because suspended mud and sand clumps in murky water environments exhibit random free distribution, the isolated dark spots they form lack continuity between adjacent scan lines. Conventional isotropic processing methods smooth all pixels indiscriminately, resulting in the inability to distinguish the spatial distribution differences between isolated mud and sand dark spots and dark areas occluded by real entities. Summary of the Invention
[0004] To address the technical problem of being unable to distinguish the spatial distribution differences between isolated mud and sand spots and dark areas obscured by real objects, the present invention aims to provide a side-scan sonar image enhancement method and system for turbid waters. The specific technical solution adopted is as follows: This invention proposes a side-scan sonar image enhancement method for turbid waters, the method comprising: Obtain the original sonar matrix with the grayscale value of each pixel as an element. The row direction of the original sonar matrix is along the course and the column direction is across the course. The effective area is truncated from the original sonar matrix to the area from the initial aftershock of the sonar echo to the first contact with the seabed. Extract the grayscale value change pattern along the column direction of the original sonar matrix as the distance decreases to generate the attenuation background matrix. Environmental interference in the original sonar matrix is removed by the mean of element values in the effective region and the attenuation background matrix to obtain the logarithmic compensation matrix; source and sink points are preset, and the connection weights between each node and the source and sink points, as well as the connection weights between each adjacent node, are determined based on the numerical distribution of element values in the logarithmic compensation matrix. The network structure graph is constructed by each connection weight and the coordinate position of each node, and then cut to obtain the target occlusion binarization matrix. The logarithmic compensation matrix is fused with the target occlusion binarization matrix, and a grayscale balanced image is obtained by natural exponential transformation.
[0005] Furthermore, methods for obtaining the raw sonar matrix include: The pixel column is obtained by sonar and filled into a preset buffer queue. When the pixel column is full, the acquisition of the pixel column is stopped. If a task end command is received, stop acquiring the pixel column; The pixel columns in the buffer queue are horizontally concatenated to obtain the original sonar matrix.
[0006] Furthermore, the methods for extracting the effective region include: The initial aftershock is eliminated by sonar echo with a preset aftershock limit, and the first reflection of the sonar echo upon contact with the bottom of the water is used to determine the preset reflection threshold. The effective area is obtained by extracting the region from the original sonar matrix where the column index is greater than or equal to the aftershock limit, until the first element value greater than the reflection determination threshold appears after the initial aftershock is eliminated.
[0007] Furthermore, the methods for obtaining the attenuation background matrix include: Iterate through the original sonar matrix and reset the values of elements less than 1 to 1; Perform a natural logarithmic transformation on the reset sonar original matrix to obtain the natural logarithmic matrix; The natural logarithm matrix is smoothed by two-dimensional convolution using a two-dimensional Gaussian low-pass filter of a preset size to obtain the attenuated background matrix.
[0008] Furthermore, the methods for obtaining the logarithmic compensation matrix include: Take the logarithm of each element value of the reset sonar original matrix to obtain the original terms; Calculate the arithmetic mean of all element values in the effective region to obtain the global grayscale mean; take the logarithm of the global grayscale mean and add it to the corresponding element value of the attenuation background matrix to obtain the interference term; Calculate the difference between the original terms and the interference terms for all nodes to obtain the logarithmic compensation matrix.
[0009] Furthermore, the methods for obtaining the connection weights of each node to the source and sink nodes include: Calculate the arithmetic mean and standard deviation of all elements in the log-compensated matrix; The reciprocal of the absolute difference between each element value of the logarithmic compensation matrix and the lower limit of the dark area gray level is used to obtain the connection weight between each node and the source point. The lower limit of the dark area gray level is the difference between the arithmetic mean and the standard deviation. The reciprocal of the absolute difference between each element value and the arithmetic mean of the logarithmic compensation matrix is used to obtain the connection weight between each node and the sink.
[0010] Furthermore, the methods for obtaining the connection weights between adjacent nodes include: The first connection weight is obtained by taking the reciprocal of the absolute difference between the element values of each adjacent node in the column direction of the logarithmic compensation matrix. The reciprocal of the absolute difference between the element values of each adjacent node in the row direction of the logarithmic compensation matrix is multiplied by the preset anisotropic amplification coefficient to obtain the second connection weight. The first connection weight is the connection weight between adjacent nodes in the column direction, and the second connection weight is the connection weight between adjacent nodes in the row direction.
[0011] Furthermore, methods for obtaining the target occlusion binarization matrix include: The maximum flow minimum cut algorithm is used to find the cutting section in the network structure graph that minimizes the sum of connection weights corresponding to the cutting edge. The network structure graph is then cut using the cutting section to obtain the set of source nodes that remain connected to the source nodes and the set of sink nodes that remain connected to the sink nodes. Different preset values are assigned to the elements of the source and sink sets, and they are arranged according to their original coordinate positions to obtain the target occlusion binarization matrix.
[0012] Furthermore, methods for obtaining grayscale equalized images include: A smooth transition matrix is obtained by performing a convolution smoothing operation on the logarithmic compensation matrix using a two-dimensional Gaussian low-pass filter. If the element value of the target occlusion binarization matrix is equal to the element value of the sink set, the corresponding element value in the smooth transition matrix is used to replace the element value. If the element value of the target occlusion binarization matrix is equal to the element value of the source point set, the corresponding element value in the logarithmic compensation matrix is used to replace the element value to obtain the fused echo matrix. The maximum and minimum values of each element in the fused echo matrix are normalized, and the normalized fused echo matrix is then subjected to a natural exponential transformation using the natural exponential function to obtain a grayscale equalized image.
[0013] The present invention also proposes a side-scan sonar image enhancement system for turbid waters, the system comprising a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor executes the computer program to implement the steps of the method as described in any of the foregoing.
[0014] The present invention has the following beneficial effects: This method acquires the original sonar matrix and extracts the effective area. It calculates the global grayscale mean through the effective area, extracts the grayscale value variation pattern along the column direction with distance in the original sonar matrix, generates an attenuation background matrix, and removes environmental interference from the original sonar matrix to obtain a logarithmic compensation matrix. This avoids the problem of numerical overflow caused by division gain compensation. The method calculates the connection weights between each node and preset source and sink points. Then, it calculates the connection weights between adjacent nodes and cuts the constructed network structure graph to obtain a target occlusion binarization matrix. The logarithmic compensation matrix is fused with the target occlusion binarization matrix, solving the problem of indiscriminate smoothing of all pixels by isotropic processing. Finally, a grayscale equalization image is obtained through natural exponential transformation, solving the problem of being unable to distinguish the spatial distribution differences between isolated mud and sand dark spots and real entity occlusion dark areas. Attached Figure Description
[0015] Figure 1 This is a flowchart of a side-scan sonar image enhancement method for turbid waters, provided as an embodiment of the present invention. Detailed Implementation
[0016] Please see Figure 1 The diagram illustrates a flowchart of a side-scan sonar image enhancement method for turbid waters according to an embodiment of the present invention, the method comprising: Step S1: Obtain the original sonar matrix with each pixel's grayscale value as an element. The row direction of the original sonar matrix is along the course, and the column direction is across the course. Extract the effective area from the original sonar matrix, which is the area from the initial aftershock of the sonar echo to the first contact with the seabed. Extract the grayscale value change pattern along the column direction of the original sonar matrix as the distance decreases, and generate the attenuation background matrix.
[0017] Side-scan sonar receives echo signals from underwater targets and the seabed, forming image data reflecting underwater acoustic characteristics. This image data is stored and represented internally in a two-dimensional matrix, known as the sonar raw matrix. Each element corresponds to a pixel in the image, and the element value is the grayscale value of that pixel. The grayscale value quantifies the relative strength of the echo signal at the corresponding spatial location. The strength of the echo signal depends on the acoustic reflection characteristics of the underwater medium or target at that location. The stronger the reflection, the stronger the echo signal, the larger the grayscale value, and the brighter the image. The weaker the reflection, the smaller the grayscale value, and the darker the image. The row direction of the sonar raw matrix is consistent with the direction of the carrier's movement, representing the time-based detection history along the course, reflecting the continuous spatial locations traversed by the detection equipment along the course at different times. Its column direction is consistent with the direction of sound wave propagation, representing the spatial propagation distance across the course, reflecting the distance the sound wave travels horizontally from the transducer to both sides. The sonar raw matrix carries the raw echo intensity information for all spatial locations within the detection area.
[0018] Because sound waves undergo geometric diffusion and medium absorption as they propagate, the grayscale values along the column direction in the original sonar matrix exhibit a spatial distribution trend of decreasing from the near end to the far end. That is, the farther the sound wave propagates, the weaker the echo signal and the smaller the grayscale value. The initial hardware aftershocks present when the sonar transducer emits sound waves will form high-amplitude interference at the near end of the original sonar matrix. Its grayscale value does not reflect the true underwater echo information and belongs to the invalid data range that needs to be excluded. When the sound wave propagates to the bottom of the water, a strong reflected echo is generated due to the sudden change in the bottom impedance. Its grayscale value changes significantly. This jump position marks the physical boundary between the sound wave propagating from the water body and the reflection at the bottom. Based on the above physical laws, the effective area of the original sonar matrix is extracted. The matrix area from the elimination of the initial aftershock interference to the first contact with the bottom of the water is taken as the effective area. The pixels in this effective area only correspond to the echo signal during the propagation of the sound wave in the water body. Therefore, the grayscale value in this area mainly reflects the volume scattering intensity of the sound wave by suspended particles in the water body.
[0019] During the trans-directional propagation of sound waves, due to the continuous expansion of the sound wavefront and the absorption of sound energy by the medium, the amplitude of the echo signal continuously decreases with the increase of propagation distance. This is manifested in the original sonar matrix as a stable decrease in gray value along the column direction with increasing distance. This law is an inherent characteristic of the physical process of sound wave propagation and is unrelated to the random distribution of local underwater topography or suspended sediment. By extracting this gray value change law with decreasing distance point by point along the column direction of the original sonar matrix and fitting it as a smooth attenuation trend, an attenuation background matrix is generated, which represents the spatial attenuation component of gray value caused by the sound wave propagation distance, without including reflection details of underwater targets or scattering noise from sediment.
[0020] Step S2: Remove environmental interference from the original sonar matrix by using the mean value of the element values in the effective region and the attenuation background matrix to obtain the logarithmic compensation matrix; preset the source and sink points, and determine the connection weights between each node and the source and sink points, as well as the connection weights between each adjacent node, based on the numerical distribution of the element values in the logarithmic compensation matrix. Construct a network structure graph using each connection weight and the coordinate position of each node, and then cut it to obtain the target occlusion binarization matrix.
[0021] The grayscale values in the original sonar matrix are the result of the superposition of the inherent acoustic reflection characteristics of the underwater target, the volume scattering intensity of suspended sediment in the water, and the energy attenuation caused by the sound wave propagation distance. In order to eliminate the two environmental interference factors of water turbidity and distance attenuation, the original sonar matrix needs to be compensated using the mean value of the effective area and the attenuation background matrix to obtain a logarithmic compensation matrix. The mean value of the effective area represents the overall concentration level of suspended sediment particles in the current detected water area and can measure the degree of water turbidity. Each element value of the logarithmic compensation matrix has basically eliminated the environmental interference introduced by the propagation distance and water turbidity, and mainly retains the inherent acoustic reflection characteristics of the underwater target or substrate.
[0022] In side-scan sonar images, target occlusion areas appear as dark areas with extremely low grayscale values, while flat substrate areas appear as medium-brightness areas with relatively uniform grayscale values. However, the grayscale value of a single pixel alone cannot accurately distinguish between the true target occlusion shadow and the randomly distributed suspended mud and sand dark spots in the murky water. To transform the pixel classification problem in the logarithmic compensation matrix into a node attribution problem, source and sink points representing target occlusion attributes and flat substrate attributes are pre-defined, and each pixel in the logarithmic compensation matrix is mapped to a node. Based on the element values of each node, the connection weights between each node and the source and sink points are calculated. The connection weight with the source point reflects the initial tendency of the pixel to belong to the target occlusion area; the larger the connection weight, the closer the pixel is to the target occlusion shadow in terms of grayscale features. The connection weight with the sink point reflects the initial tendency of the pixel to belong to the flat substrate background; the larger the connection weight, the more likely the pixel is to belong to the flat substrate background.
[0023] The obstructed areas formed by real underwater targets have spatially continuous physical characteristics, while free suspended sediment patches in turbid water environments are mostly isolated. To utilize this spatial distribution difference, it is necessary to calculate the connection weights between adjacent nodes. The connection weights between adjacent nodes are determined based on the degree of difference in the element values of adjacent nodes. The larger the connection weight, the more similar the two pixels are in grayscale, and they tend to belong to the same category. The smaller the connection weight, the more obvious the grayscale jump between the two pixels, and they tend to be cut off as the boundary between different categories. Spatially continuous regions of the same type tend to be preserved during the cutting process due to their larger connection weights, while isolated noise points tend to be cut off due to their smaller connection weights.
[0024] A network structure graph is constructed based on the connection weights of each node, including the edges between each node and the source node, the edges between each node and the sink node, and the edges between adjacent nodes. The network structure graph is then cut using the connection weights of each edge. The cutting surfaces tend to avoid regions with continuous adjoining along the flight direction, prioritizing the cutting of isolated nodes lacking support along the flight direction. After cutting, the network structure graph is divided into two sets of nodes: one connected to the source node and the other connected to the sink node. The set of nodes connected to the source node corresponds to the target occlusion region. The cutting results are arranged according to the original coordinates of each node to generate a target occlusion binarization matrix, which visually distinguishes the target occlusion region from the flat background region.
[0025] Step S3: The logarithmic compensation matrix is fused using the target occlusion binarization matrix, and a grayscale equalization image is obtained through natural exponential transformation.
[0026] In the target occlusion binarization matrix, there may be jagged edges at the boundary between the target region and the background region due to the discreteness of the cutting algorithm, and there may be a small number of isolated noise points or misjudged regions in the background region. To eliminate these defects, a convolution smoothing operation is performed on the logarithmic compensation matrix. Each element value in the logarithmic compensation matrix has basically eliminated the environmental interference introduced by the propagation distance and water turbidity, and mainly retains the inherent acoustic reflection characteristics of the underwater target or bottom sediment. Through the convolution smoothing operation, isolated noise points in the background region are effectively suppressed, and the gray values at the boundary between the target region and the background region form a gradual transition, so that the jagged edges are smoothly corrected.
[0027] To obtain a displayable physical grayscale image, a natural exponential transformation is performed by combining the target occlusion binarization matrix and the logarithmic compensation matrix to restore the logarithmic domain values in the logarithmic compensation matrix to linear domain grayscale values. After the natural exponential transformation, the grayscale values are mapped to the standard grayscale range, resulting in a grayscale equalization image. In this image, the boundary contour between the target occlusion area and the flat background area is complete and clear, the scattering noise in the background area has been suppressed, and the original acoustic gradient of the target area has been preserved, making it usable as a feature input for a target recognition system.
[0028] In summary, this method obtains the original sonar matrix and extracts the effective region. The global grayscale mean is calculated using this effective region, and the grayscale value variation along the column direction with decreasing distance is extracted from the original sonar matrix to generate an attenuation background matrix. Environmental interference in the original sonar matrix is removed to obtain a logarithmic compensation matrix. The connection weights between each node and preset source and sink points are calculated. The connection weights between adjacent nodes are then calculated, and the constructed network structure is segmented to obtain a target occlusion binarization matrix. The logarithmic compensation matrix is then fused and subjected to natural exponential transformation using the target occlusion binarization matrix to obtain a grayscale equalization image. This method solves the problem of being unable to distinguish the spatial distribution differences between isolated mud and sand spots and dark areas occluded by real entities.
[0029] Preferably, in some specific implementations of the embodiments of the present invention, the method for obtaining the original sonar matrix includes: When the sonar hardware is working, it generates a one-dimensional echo data sequence arranged along the cross-heading each time it completes the transmission and reception of sound waves. In order to stitch them into a two-dimensional matrix, a buffer queue of preset capacity is initialized in memory to temporarily store the pixel columns of each received frame. Each one-dimensional pixel column output by the sonar is received in sequence and the pixel columns are stored in the end of the buffer queue.
[0030] While continuously receiving pixel columns, the system monitors the internal storage status of the buffer queue in real time. When the pixel columns stored in the buffer queue are filled to the preset capacity, it indicates that the data accumulation of the current batch has met the batch processing requirements, and the system stops receiving normally. When the system receives a scan task end command, even if the pixel columns in the current buffer queue have not yet reached the capacity, the system immediately stops receiving to prevent the remaining data from being stuck in the buffer queue for a long time and causing data loss. The two trigger conditions are set in parallel to ensure that the system can output the received data to subsequent operations in a timely manner in both the case of normal batch completion and early task termination.
[0031] Upon triggering any stop condition, all currently accumulated pixel columns are extracted from the buffer queue. These pixel columns are arranged in the buffer queue according to their received time. All one-dimensional pixel columns are then horizontally stitched together in this order, with the first received pixel column located at the leftmost edge of the matrix, generating a complete two-dimensional image, i.e., the original sonar matrix. The row directions of the original sonar matrix correspond to the path of the probe along its course, reflecting the probe position at different times. The column directions correspond to the propagation distance of the sound wave across the course, reflecting the distance of horizontal propagation from the transducer to both sides. Each element represents the grayscale value of the echo signal at that location, preserving all information of the original echo signal in both time and space dimensions.
[0032] In one specific implementation of this invention, the capacity of the buffer queue is set to 1024 frames. 1024 frames corresponds to a moderate memory usage, which will not cause excessive consumption of system resources and the processing delay is controllable, meeting the real-time requirements of underwater detection. At the same time, in the operation scenario of side-scan sonar, it can accumulate a sufficient number of continuous detection frames to support the data width along the course required for subsequent operations.
[0033] Preferably, in some specific implementations of the embodiments of the present invention, the method for extracting the effective region includes: The sonar echo is used to eliminate the initial aftershocks by setting an aftershock limit, and the first contact of the sonar echo with the bottom of the water is used to set a reflection judgment threshold. The aftershock limit is used to define the effective elimination position of the transducer's initial aftershocks, that is, all data before the limit is regarded as invalid aftershock interference and is eliminated. The reflection judgment threshold is used to define whether the sound wave has reached the bottom of the water. When the gray value of the echo signal exceeds the reflection judgment threshold, it is determined that it has reached the hard interface of the bottom of the water.
[0034] The effective area is defined as the region in the original sonar matrix where the column index is greater than or equal to the aftershock limit and the element value is greater than the reflection threshold for the first time after the initial aftershock is eliminated. If no element value greater than the reflection threshold appears at the end of the column, the effective area is defined as the region where the column index is greater than or equal to the aftershock limit up to the end of the column. The column index being greater than or equal to the aftershock limit ensures that the data in the effective area does not contain interference from the initial aftershock of the transducer, and the element value being greater than the reflection threshold ensures that the data in the effective area is located within the water propagation range before the sound wave contacts the bottom of the water body, and does not contain strong reflected echoes from the hard interface of the bottom of the water body. Therefore, the pixels in the effective area correspond to the echo signal during the propagation of the sound wave in the water body, and their gray values mainly reflect the volume scattering intensity of the sound wave by suspended particles in the water body.
[0035] In one specific implementation of this invention, the aftershock limit is set to 50 pixels. Within a very short time after the transducer emits a sound wave, the hardware itself has a vibration aftershock. This interference forms a false bright area in the near end of the sonar image, which is generally 30 pixels wide. 50 pixels is enough to eliminate it without cutting off the subsequent real water echo data.
[0036] In one specific implementation of this invention, the reflection determination threshold is set to a gray value of 30. In typical turbid waters, the gray value of water body scattering echoes is usually below 30. However, when the sound wave propagates to the bottom of the water, the strong reflection from the hard interface at the bottom of the water will cause the gray value to suddenly rise to above 30. Therefore, a gray value of 30 can effectively distinguish between water body echoes and bottom echoes.
[0037] Preferably, in some specific implementations of the embodiments of the present invention, the method for obtaining the attenuation background matrix includes: The original sonar matrix may contain pixels with gray values of zero or close to zero. These values would lead to undefined operations during the natural logarithmic transformation. Therefore, the original sonar matrix is traversed, and when an element value less than 1 is detected, it is reset to 1 to ensure that all elements in the original sonar matrix are positive. The original sonar matrix is then subjected to a natural logarithmic transformation, and the gray value of each element is taken as its natural logarithm to obtain a natural logarithmic matrix. Since the energy of sound waves decays exponentially with distance during propagation, taking the natural logarithm transforms this exponential decay relationship into a linear relationship, making the energy loss trend of sound waves with distance appear linear, which facilitates the extraction of the attenuation law.
[0038] A two-dimensional Gaussian low-pass filter is used to perform a two-dimensional convolution smoothing operation on the natural logarithm matrix. The filter window size is preset in both the cross-course and along-course directions. The cross-course filtering window size is larger, which can smooth the gray-level fluctuations caused by underwater topographic undulations or local target reflections in the cross-course direction, and retain the macroscopic trend of gray-level values decreasing from near to far. The along-course filtering window size is set to 1 to ensure that the basis features between different frames are not mixed, and to avoid introducing the differences in underwater reflections at different detection times into the attenuation background matrix. The matrix output by the two-dimensional convolution smoothing operation is the attenuation background matrix. The gray-level values in it reflect the spatial attenuation components caused by geometric diffusion and medium absorption during the cross-course propagation of sound waves, and do not include the reflection details of local underwater targets or the scattering noise of silt.
[0039] In some specific implementations of this invention, the size of the two-dimensional Gaussian low-pass filter kernel is set according to the geometric scale characteristics of the target in the water area to be detected; the height of the two-dimensional Gaussian low-pass filter along the flight path is set to 1 to ensure that the background data between different detection frames at different times is independent; the width of its cross-flight window is set to be greater than the corresponding pixel width of the physical occlusion shadow of the estimated typical entity target in the water area to be detected on the image, so that the filter window can span the entity occlusion area, thereby smoothing and extracting the macroscopic spatial attenuation trend formed by the geometric diffusion of sound waves and medium absorption, and avoiding the entity occlusion dark area being absorbed as a local background feature; in one specific implementation of this invention, the rectangular filter kernel adopts a size of 15×1, which is suitable for attenuation background extraction in small-sized target scenes.
[0040] Preferably, in some specific implementations of the embodiments of the present invention, the method for obtaining the logarithmic compensation matrix includes: The gray value of each pixel in the original sonar matrix is the result of the combined effects of underwater target reflection echo, water turbidity scattering, and distance attenuation. To eliminate these two environmental interferences, water turbidity and distance attenuation, the original sonar matrix needs to be compensated by difference. Because after logarithmic operation, the exponential decay relationship of sound wave energy with distance is transformed into a linear relationship, the gain compensation that originally needed to be completed by division in the original domain can be achieved in the logarithmic domain by subtraction. Therefore, taking the natural logarithm of each element value of the reset original sonar matrix yields the original term, which represents the actual echo intensity at the pixel location, including all environmental components.
[0041] The arithmetic mean of the gray values of all pixels within the effective area is calculated as the global gray mean output. The global gray mean represents the overall concentration level of suspended sediment particles in the current detected water area, quantifying the turbidity of the water. When the turbidity of the water is high, the global gray mean is larger, and when the water is clear, the global gray mean is smaller. After taking the natural logarithm of the global gray mean, it is added to the corresponding element value of the attenuation background matrix to obtain the interference term. The sum is the theoretical benchmark value of environmental interference at the pixel location.
[0042] The difference between the original term and the interference term of all nodes is calculated to obtain the logarithmic compensation matrix. The difference operation is equivalent to stripping the environmental interference reference from the actual echo. When the original term is greater than the interference term, the difference is greater than zero, indicating that there is a hard target that enhances the echo at that location. When the original term is less than the interference term, the difference is less than zero, indicating that there is a target shadow that weakens the echo at that location. After the difference operation, the environmental interference components superimposed by water turbidity and distance attenuation in the original sonar matrix are effectively stripped away, and each element value in the logarithmic compensation matrix retains the inherent acoustic reflection characteristics of the underwater target or bottom sediment.
[0043] Preferably, in some specific implementations of the embodiments of the present invention, the method for obtaining the connection weights of each node to the source and sink nodes includes: The target occlusion shadow region is characterized by a dark area with low grayscale value, while the flat background region is characterized by a medium grayscale region with a relatively concentrated grayscale value distribution. The connection weights between each node and the source point representing the target occlusion attribute and the sink point representing the flat background attribute are calculated respectively. The connection weight between the node and the source point reflects the initial tendency of the corresponding pixel to belong to the target occlusion region. The larger the connection weight, the closer the pixel is to the target occlusion shadow in terms of grayscale feature. The connection weight between the node and the sink point reflects the initial tendency of the corresponding pixel to belong to the flat background region. The larger the connection weight, the closer the pixel is to the flat background in terms of grayscale feature.
[0044] When calculating the connection weights between each node and the source point, the lower limit of the dark area grayscale is first determined based on the global statistics of the logarithmic compensation matrix. The difference between the arithmetic mean of all element values and the standard deviation of all element values in the logarithmic compensation matrix is the lower limit of the dark area grayscale. Pixels below the lower limit of the dark area grayscale significantly deviate from the normal background and are suspected of being occluded by the target. For each node in the logarithmic compensation matrix, the absolute difference between its element value and the lower limit of the dark area grayscale is calculated, and the reciprocal of the absolute difference is used as the connection weight between the node and the source point. The closer the element value of the logarithmic compensation matrix is to the lower limit of the dark area grayscale, the smaller the absolute difference and the larger the reciprocal, the higher the tendency of the pixel to belong to the target occlusion area. The farther the element value of the logarithmic compensation matrix is from the lower limit of the dark area grayscale, the larger the absolute difference and the smaller the reciprocal, the lower the tendency of the pixel to belong to the target occlusion area.
[0045] When calculating the connection weights between each node and the sink, the arithmetic mean of all elements in the logarithmic compensation matrix is calculated, representing the gray-level center position of the flat background region in the current image. For each node in the logarithmic compensation matrix, the absolute difference between its element value and the arithmetic mean is calculated, and the reciprocal of this absolute difference is used as the connection weight between the node and the sink. The closer the element value of the logarithmic compensation matrix is to the arithmetic mean, the smaller the absolute difference and the larger the reciprocal, the higher the tendency of the pixel to belong to the flat background region. The farther the element value of the logarithmic compensation matrix is from the arithmetic mean, the larger the absolute difference and the smaller the reciprocal, the lower the tendency of the pixel to belong to the flat background region.
[0046] It should be noted that when the absolute difference between the element value of the logarithmic compensation matrix and the lower limit of the dark area grayscale is zero, it means that the pixel fully meets the judgment criteria for target occlusion shadow in terms of grayscale features. In this case, the connection weight between the node and the source point is directly set to the preset maximum value to avoid division by zero error. When the absolute difference between the element value of the logarithmic compensation matrix and the arithmetic mean is zero, it means that the pixel fully meets the judgment criteria for a flat background in terms of grayscale features. In this case, the connection weight between the node and the sink point is also directly set to the maximum value.
[0047] In one specific implementation of this invention, the maximum value is set to 10. 6 It will not cause computational overflow due to excessively large values, and it will also ensure that the connection weights are greater than all normally calculated connection weights.
[0048] Preferably, in some specific implementations of the embodiments of the present invention, the method for obtaining the connection weights between adjacent nodes includes: In side-scan sonar images, real underwater targets have physical dimensions, and the shadow areas formed by their blocking of sound waves exhibit highly contiguous and coherent physical characteristics along the navigation direction due to spanning multiple scan frames. In contrast, suspended mud and sand patches are randomly distributed and lack positional coherence between adjacent scan lines. To distinguish between target shadows and mud and sand noise, it is necessary to calculate the connection weights between adjacent nodes in the column and row directions, respectively.
[0049] The first connection weight is obtained by taking the reciprocal of the absolute difference between the element values of each adjacent node in the column direction of the logarithmic compensation matrix. The larger the difference, the greater the gray level difference between adjacent pixels. The smaller the reciprocal, the lower the cost of cutting off the edge, and the more likely it is to be cut off at this point to form the target boundary. The smaller the difference, the closer the gray levels between adjacent pixels. The larger the reciprocal, the stronger the connection, and the more likely it is to keep the two pixels in the same category. The first connection weight reflects the degree of gray level similarity between adjacent pixels in the cross-course direction.
[0050] The reciprocal of the absolute difference between the element values of each adjacent node in the row direction of the logarithmic compensation matrix is multiplied by a preset anisotropic amplification factor to obtain the second connection weight. The anisotropic amplification factor in the second connection weight makes the second connection weight greater than the first connection weight overall. Because the real target spans multiple frames along the flight direction, its shadow area has a high degree of positional coherence in the row direction. The second connection weight significantly increases the cost of cutting off the coherent dark area in the row direction, thus tending to preserve the coherent real target shadow along the flight direction.
[0051] It should be noted that when the element value difference between adjacent nodes in the column direction is zero, it means that the two adjacent pixels are exactly the same in grayscale. In this case, they should belong to the same category and should not be cut off. The first connection weight between the adjacent nodes is set to the maximum value to ensure that adjacent pixels with the same grayscale are retained in the same category. When the element value difference between adjacent nodes in the row direction is zero, it also means that the two adjacent pixels are exactly the same in grayscale and are adjacent in position along the flight direction. They have the coherent characteristics of the real target shadow in the time history and should not be cut off. The second connection weight between the adjacent nodes is set to the maximum value.
[0052] In one specific implementation of this invention, the anisotropic amplification factor is set to 3, which can effectively enhance the connectivity protection along the course while maintaining the cutoffability of the cross-course edge, and can be adjusted according to different water conditions.
[0053] Preferably, in some specific implementations of the embodiments of the present invention, the method for obtaining the target occlusion binarization matrix includes: All nodes and connecting edges together form a network structure graph. This network structure graph contains the edges between each node and the source node, the edges between each node and the sink node, and the edges between adjacent nodes. It is necessary to cut the network structure graph and divide all pixel nodes into two categories: target occlusion area and flat background area.
[0054] The maximum flow minimum cut algorithm is used to find the cutting section in the network structure graph that minimizes the sum of the connection weights of the cut edges. That is, by iteratively transmitting traffic from the source to the sink along each edge until there is no longer any transmission path from the source to the sink in the network structure graph where all edges are not saturated, the sum of the weights of the cut edges from the source to the sink reaches the minimum. This cutting section is the combination of cutting edges with the minimum sum of connection weights. The maximum flow minimum cut algorithm is a well-known technique in the art, and its specific details will not be elaborated.
[0055] After obtaining the cutting section, the network structure diagram is cut according to the cutting section. The network structure diagram is divided into two sets of nodes that are not connected to each other: the set of source nodes that are connected to the source nodes and the set of sink nodes that are connected to the sink nodes. The set of source nodes corresponds to the target occlusion area; the set of sink nodes corresponds to the flat background area.
[0056] To accurately distinguish the elements in the two sets, the elements in the source set are assigned a value of 1, marking them as the target occlusion region; the elements in the sink set are assigned a value of 0, marking them as the flat background region. After the assignment, all element values are rearranged into a two-dimensional matrix according to the coordinate position of each node in the original sonar matrix to obtain the target occlusion binarization matrix. The target occlusion region and the flat background region can be distinguished by different element values in the target occlusion binarization matrix.
[0057] Preferably, in some specific implementations of the embodiments of the present invention, the method for obtaining a grayscale equalized image includes: The boundary between the target region and the background region in the logarithmic compensation matrix may have jagged edges due to cutting, and there may be a small number of isolated noise points or misjudged regions in the background region. Therefore, a two-dimensional Gaussian low-pass filter is used to perform a convolution smoothing operation on the logarithmic compensation matrix to make the label values of the boundary region gradually transition in space, while smoothing the isolated noise points in the background region, thus obtaining a smooth transition matrix.
[0058] Since regions with different identifier values in the target occlusion binarization matrix need to be treated differently in subsequent processing, the fusion method needs to be determined based on the element values. Each element in the target occlusion binarization matrix is traversed. If the element value is 0, indicating that the location belongs to a flat substrate background region, the element value of the corresponding position in the smooth transition matrix is used to replace the original element value at that position. If the element value is 1, indicating that the location belongs to the target occlusion region, the element value of the corresponding position in the logarithmic compensation matrix is used to replace the original element value at that position. After the element replacement process, the fused echo matrix is obtained. The element values of the flat substrate background region have been smoothed, and the scattering noise caused by suspended sediment is effectively suppressed. The values of the target occlusion region remain unchanged, preserving its original acoustic gradient.
[0059] The smoothing and fusion processes described above are all performed in the natural logarithm domain, and the element values in the fusion echo matrix are logarithmic domain values. To obtain a physical grayscale image that can be displayed or used by downstream recognition systems, the logarithmic domain values need to be restored to linear domain grayscale values. First, the maximum and minimum values of each element value in the fusion echo matrix are normalized, and the normalized element values are multiplied by a preset exponential control upper limit to linearly compress all element values to a fixed range, avoiding uncontrollable subsequent exponential calculation results due to differences in different data distribution ranges.
[0060] The normalized fused echo matrix is then subjected to a natural exponential transformation using the natural exponential function, restoring the logarithmic domain values to linear domain grayscale values. The natural exponential function is monotonically increasing; bright areas with larger values show significant stretching after the inverse transformation, while dark areas with smaller values show relatively gentler changes, effectively widening the grayscale difference between the target reflection area and the occluded dark area. After the natural exponential transformation, the restored linear domain grayscale values are mapped to a standard grayscale range, resulting in a grayscale-equalized image. The boundary contour between the target occlusion area and the flat background area is complete and clear, background scattering noise is suppressed, and the original acoustic gradient of the target area is preserved. This image can be directly output or input into a target recognition system as a feature.
[0061] In one specific implementation of this invention, the formula for normalizing the maximum and minimum values is expressed as follows: ; in, It is the element value of the fused echo matrix in the x row and y column; It is the minimum element value of the fused echo matrix. It is the maximum element value of the fused echo matrix; It is the preset upper limit of the exponential control. Because the natural exponential function grows rapidly when the input value is greater than 5, it is set to 5. This ensures the safe operation of the inverse transform and effectively preserves the relative differences between gray values, ensuring that the restored image has sufficient contrast. It is the element value in row x and column y after normalization to the maximum and minimum values.
[0062] In one specific implementation of this invention, when performing convolution smoothing operation on the logarithmic compensation matrix through the two-dimensional Gaussian low-pass filter, considering that the object to be eliminated is the small edge jaggedness and isolated noise caused by graph cutting, the filter kernel of the two-dimensional Gaussian low-pass filter adopts a window size of 3×3 and the standard deviation is set to 1.0, which can eliminate local small high-frequency noise while maintaining a clear transition of the overall outline of the target area.
[0063] It should be noted that because there is an inherent acoustic difference between the target occlusion area and the flat background area, the gray values of all pixels in the fused echo matrix are completely equal, resulting in the difference between the maximum and minimum element values being zero. In other words, the case where the denominator is zero will not occur in actual side-scan sonar images, and there will be no division by zero error.
[0064] On the other hand, the present invention also provides a side-scan sonar image enhancement system for turbid waters, the system including a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor executes the computer program to implement the steps of any of the methods described above.
[0065] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
Claims
1. A method for enhancing side-scan sonar images in turbid waters, characterized in that, The method includes: Obtain the original sonar matrix with the grayscale value of each pixel as an element. The row direction of the original sonar matrix is along the course and the column direction is across the course. The effective area is truncated from the original sonar matrix to the area from the initial aftershock of the sonar echo to the first contact with the seabed. Extract the grayscale value change pattern along the column direction of the original sonar matrix as the distance decreases to generate the attenuation background matrix. Environmental interference in the original sonar matrix is removed by the mean of element values in the effective region and the attenuation background matrix to obtain the logarithmic compensation matrix; source and sink points are preset, and the connection weights between each node and the source and sink points, as well as the connection weights between each adjacent node, are determined based on the numerical distribution of element values in the logarithmic compensation matrix. The network structure graph is constructed by each connection weight and the coordinate position of each node, and then cut to obtain the target occlusion binarization matrix. The logarithmic compensation matrix is fused with the target occlusion binarization matrix, and a grayscale balanced image is obtained by natural exponential transformation.
2. The side-scan sonar image enhancement method for turbid waters according to claim 1, characterized in that, The method for obtaining the original sonar matrix includes: The pixel column is obtained by sonar and filled into a preset buffer queue. When the pixel column is full, the acquisition of the pixel column is stopped. If a task end command is received, stop acquiring the pixel column; The pixel columns in the buffer queue are horizontally concatenated to obtain the original sonar matrix.
3. The side-scan sonar image enhancement method for turbid waters according to claim 1, characterized in that, The method for extracting the effective region includes: The initial aftershock is eliminated by sonar echo with a preset aftershock limit, and the first reflection of the sonar echo upon contact with the bottom of the water is judged by a preset reflection threshold. The effective area is obtained by extracting the region in the original sonar matrix where the column index is greater than or equal to the aftershock limit, and where the element value is greater than the reflection determination threshold for the first time after the initial aftershock is eliminated.
4. The side-scan sonar image enhancement method for turbid waters according to claim 1, characterized in that, The method for obtaining the attenuation background matrix includes: Traverse the original sonar matrix and reset the values of elements less than 1 to 1; Perform a natural logarithmic transformation on the reset sonar original matrix to obtain the natural logarithmic matrix; The natural logarithm matrix is smoothed by two-dimensional convolution using a two-dimensional Gaussian low-pass filter of a preset size to obtain the attenuated background matrix.
5. The side-scan sonar image enhancement method for turbid waters according to claim 4, characterized in that, The method for obtaining the logarithmic compensation matrix includes: Take the logarithm of each element value of the reset sonar original matrix to obtain the original terms; Calculate the arithmetic mean of all element values in the effective region to obtain the global grayscale mean; take the logarithm of the global grayscale mean and add it to the corresponding element value of the attenuation background matrix to obtain the interference term; Calculate the difference between the original terms and the interference terms for all nodes to obtain the logarithmic compensation matrix.
6. The side-scan sonar image enhancement method for turbid waters according to claim 1, characterized in that, The methods for obtaining the connection weights of each node to the source and sink nodes include: Calculate the arithmetic mean and standard deviation of all elements in the log-compensated matrix; The reciprocal of the absolute difference between each element value of the logarithmic compensation matrix and the lower limit of the dark area gray level is used to obtain the connection weight between each node and the source point. The lower limit of the dark area gray level is the difference between the arithmetic mean and the standard deviation. The reciprocal of the absolute difference between each element value and the arithmetic mean of the logarithmic compensation matrix is used to obtain the connection weight between each node and the sink.
7. The side-scan sonar image enhancement method for turbid waters according to claim 1, characterized in that, The method for obtaining the connection weights between adjacent nodes includes: The first connection weight is obtained by taking the reciprocal of the absolute difference between the element values of each adjacent node in the column direction of the logarithmic compensation matrix. The reciprocal of the absolute difference between the element values of each adjacent node in the row direction of the logarithmic compensation matrix is multiplied by the preset anisotropic amplification coefficient to obtain the second connection weight. The first connection weight is the connection weight between adjacent nodes in the column direction, and the second connection weight is the connection weight between adjacent nodes in the row direction.
8. The side-scan sonar image enhancement method for turbid waters according to claim 1, characterized in that, The method for obtaining the target occlusion binarization matrix includes: The maximum flow minimum cut algorithm is used to find the cutting section in the network structure graph that minimizes the sum of connection weights corresponding to the cutting edge. The network structure graph is then cut using the cutting section to obtain the set of source nodes that remain connected to the source nodes and the set of sink nodes that remain connected to the sink nodes. Different preset values are assigned to the elements of the source and sink sets, and they are arranged according to their original coordinate positions to obtain the target occlusion binarization matrix.
9. A side-scan sonar image enhancement method for turbid waters according to claim 8, characterized in that, The method for obtaining the grayscale equalized image includes: A smooth transition matrix is obtained by performing a convolution smoothing operation on the logarithmic compensation matrix using a two-dimensional Gaussian low-pass filter. If the element value of the target occlusion binarization matrix is equal to the element value of the sink set, the corresponding element value in the smooth transition matrix is used to replace the element value. If the element value of the target occlusion binarization matrix is equal to the element value of the source point set, the corresponding element value in the logarithmic compensation matrix is used to replace the element value to obtain the fused echo matrix. The maximum and minimum values of each element in the fused echo matrix are normalized, and the normalized fused echo matrix is then subjected to a natural exponential transformation using the natural exponential function to obtain a grayscale equalized image.
10. A side-scan sonar image enhancement system for turbid waters, the system comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method as described in any one of claims 1 to 9.