Sonar image segmentation method and system
By combining spatial fill curves and grayscale distribution estimation, the calculation complexity of sonar image segmentation is reduced, segmentation efficiency and accuracy are improved, and the problem of inaccurate segmentation in the existing technology in high noise environment is solved.
Patent Information
- Application Number
- CN202510061432.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-15
- Publication Date
- 2025-06-20
AI Technical Summary
The existing sonar image segmentation method has shortcomings in terms of computational complexity and real-time performance, especially in high noise environments, making it difficult to accurately segment the target and background.
The dimensionality reduction of the two-dimensional sonar image into a one-dimensional vector is performed through the spatial fill curve, and the distribution parameters are calculated using the grayscale distribution estimation, and the strategy function is generated to calculate the target and shadow threshold. Finally, the segmentation function is used to segment and the two-dimensional image is reconstructed by inverse transformation.
It improves segmentation efficiency, enhances segmentation accuracy in complex backgrounds, and can more effectively gather target areas and effectively reduce the computing volume.
Smart Images

Figure CN120182298A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image segmentation, and particularly relates to a sonar image segmentation method and system. Background Art
[0002] Sonar image segmentation is one of the important technologies in the field of underwater acoustics and is of great significance for the recognition, positioning, and tracking of underwater targets. However, current sonar image segmentation methods are mostly based on two-dimensional image processing technologies. Although target segmentation can be achieved to a certain extent, there are significant deficiencies in terms of computational complexity and real-time performance. Especially in a high-noise environment, the ability of existing methods to accurately segment targets from the background is limited, which severely restricts the wide application of sonar image segmentation technology.
[0003] The existing technology mainly uses a method combining two-dimensional filtering and threshold segmentation to achieve sonar image segmentation. Although this method can distinguish targets from the background to a certain extent, the operation time is relatively long and cannot meet the requirements of efficient processing. Especially in a complex underwater environment with severe noise interference, the effects of two-dimensional filtering and threshold segmentation are greatly reduced, and the accuracy and stability of the segmentation results are difficult to guarantee.
[0004] In summary, the existing technology has problems such as low efficiency, poor real-time performance, and low segmentation accuracy in high-noise environments in two-dimensional sonar image segmentation. Summary of the Invention
[0005] To solve the above technical problems, the present invention provides a sonar image segmentation method and system to solve the technical problems in the existing technology.
[0006] On the one hand, the invention provides the following technical solution. A sonar image segmentation method, the method comprising:
[0007] Obtain a sonar image, and use a space-filling curve to reduce the two-dimensional sonar image to a one-dimensional vector;
[0008] Use a filtering technique to perform denoising filtering on the one-dimensional vector to obtain a filtered vector;
[0009] Use gray-scale distribution estimation to calculate the distribution parameters of the filtered vector, generate a policy function based on the distribution parameters, and use the policy function to calculate a target threshold and a shadow threshold;
[0010] Use a segmentation function to segment the filtered vector according to the target threshold and the shadow threshold to obtain a target, a shadow, and a background;
[0011] Use the inverse transformation of the space-filling curve to reconstruct based on the target, the shadow, and the background to obtain a two-dimensional segmented image.
[0012] Compared with the prior art, the beneficial effects of the present application are as follows:
[0013] Through space-filling curve scanning, the high-amplitude part of the one-dimensional vector (i.e., the target region of the image) is more concentrated. Compared with the line-by-line scanning method, space-filling curve scanning can more effectively aggregate the target region.
[0014] Through gray-scale distribution estimation, the segmentation threshold between the target and the shadow is calculated, effectively distinguishing the target, the shadow, and the background.
[0015] Through the cooperation of space-filling curve and gray-scale distribution estimation, the computational amount can be effectively reduced, the segmentation efficiency can be improved, and a high segmentation accuracy can be achieved under complex backgrounds.
[0016] Further, the space-filling curve includes any one of Peano curve, Hilbert curve, Moore curve, or Morton curve.
[0017] Further, the filtering technique includes any one of Gaussian filtering, mean filtering, or median filtering.
[0018] Further, the gray-scale distribution estimation is based on the Weibull distribution model, where the distribution function of the Weibull distribution model is:
[0019]
[0020] where P(A) is the distribution function, A is the amplitude, a is the scale parameter of the distribution parameter, and b is the shape parameter of the distribution parameter.
[0021] Further, the policy function includes:
[0022]
[0023] where T T is the target threshold, T S is the shadow threshold, a is the scale parameter of the distribution parameter, and b is the shape parameter of the distribution parameter.
[0024] Further, the segmentation function includes:
[0025]
[0026] where s2(i) represents the i-th element in the ternary vector, and its values are 1, -1, or 0, corresponding to the target, the shadow, and the background respectively, and s1(i) represents the i-th element in the filtering vector, T T is the target threshold, and T S is the shadow threshold.
[0027] Further, the expression for obtaining the two-dimensional segmentation image is as follows:
[0028]
[0029] Among them, represents the inverse transformation process, s2(i) represents the i-th element in the ternary vector, and its values are 1, -1, or 0, corresponding to the target, shadow, and background respectively, and I o (x, y) represents the two-dimensional segmentation image.
[0030] In a second aspect, the present invention provides the following technical solution. A sonar image segmentation system, the system includes:
[0031] A dimensionality reduction module, configured to obtain a sonar image and reduce the two-dimensional sonar image to a one-dimensional vector by using a space-filling curve;
[0032] A filtering module, configured to perform denoising filtering on the one-dimensional vector by using a filtering technique to obtain a filtered vector;
[0033] A calculation module, configured to estimate and calculate distribution parameters of the filtered vector by using a gray-scale distribution, generate a policy function based on the distribution parameters, and calculate a target threshold and a shadow threshold by using the policy function;
[0034] A segmentation module, configured to segment the filtered vector according to the target threshold and the shadow threshold by using a segmentation function to obtain a target, a shadow, and a background;
[0035] A reconstruction module, configured to perform reconstruction based on the target, the shadow, and the background by using the inverse transformation of the space-filling curve to obtain a two-dimensional segmentation image.
[0036] In a third aspect, the present invention provides the following technical solution. A computer includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the sonar image segmentation method as described above is implemented.
[0037] In a fourth aspect, the present invention provides the following technical solution. A storage medium stores a computer program, and when the computer program is executed by a processor, the sonar image segmentation method as described above is implemented. Description of the Drawings
[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for use in the embodiments or the description of the prior art. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0039] Figure 1 Flow chart of the sonar image segmentation method provided by the first embodiment of the present invention;
[0040] Figure 2 Block diagram of the structure of the sonar image segmentation system provided by the second embodiment of the present invention;
[0041] Figure 3 Schematic diagram of the hardware structure of a computer provided by the third embodiment of the present invention.
[0042] The embodiments of the present invention will be further described below with reference to the accompanying drawings. Detailed implementation manners
[0043] The embodiments of the present invention will be described in detail below. The examples of the embodiments are shown in the accompanying drawings, where the same or similar reference numerals are the same or similar elements or elements with the same or similar functions from beginning to end. The embodiments described below by referring to the accompanying drawings are exemplary and are intended to explain the embodiments of the present invention, and should not be construed as a limitation to the present invention.
[0044] In the description of the embodiments of the present invention, it should be understood that the orientation or positional relationship indicated by the terms "length", "width", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc. is based on the orientation or positional relationship shown in the accompanying drawings, and is only for the convenience of describing the embodiments of the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and thus should not be construed as a limitation to the present invention.
[0045] In addition, the terms "first" and "second" are only used for descriptive purposes and should not be construed as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include one or more of such features. In the description of the embodiments of the present invention, "a plurality" means two or more unless otherwise specifically defined.
[0046] Embodiment 1
[0047] In the first embodiment of the present invention, please refer to Figure 1 , a sonar image segmentation method, including the following steps S01 to S05:
[0048] S01, obtaining a sonar image, and reducing the two-dimensional sonar image to a one-dimensional vector by using a space-filling curve;
[0049] Among them, the space-filling curve includes any one of Peano curve, Hilbert curve, Moore curve or Morton curve.
[0050] By reducing the two-dimensional sonar image to a one-dimensional vector, this process can preserve the local structural features of the image and reduce the computational amount.
[0051] In this embodiment, the Hilbert curve is selected as the space-filling curve. The Hilbert curve is a kind of space-filling curve, which has good aggregation characteristics and can maintain the spatial relationship of adjacent pixels in a two-dimensional image. In this embodiment, the Hilbert curve is used to transform the sonar image from a two-dimensional matrix into a one-dimensional vector to improve the efficiency of subsequent processing.
[0052] When the processed sonar image is an arbitrary rectangle, the space-filling curve needs to divide the rectangle, and multiple Hilbert scan curves based on squares are used to fill the rectangular area. The specific approach is to extract the largest square area from the rectangle for scanning, and then recursively perform similar processing on the remaining areas until all areas are processed.
[0053] S02. Use a filtering technique to perform denoising filtering on the one-dimensional vector to obtain a filtered vector;
[0054] Among them, the filtering technique includes any one of Gaussian filtering, mean filtering or median filtering.
[0055] In this embodiment, the median filtering is selected as the filtering technique. By adopting the median filtering method, noise can be effectively removed while the edge information of the image is retained. Since the sonar image is not directly imaged and needs to be obtained after signal processing of the original acquisition data, and due to the low sonar resolution and complex underwater acoustic environment, the background noise of the sonar image is relatively strong. Therefore, necessary filtering processing on the sonar image before target segmentation can improve the efficiency and accuracy of sonar target segmentation.
[0056] S03. Use gray distribution estimation to calculate the distribution parameters of the filtered vector, generate a policy function based on the distribution parameters, and use the policy function to calculate the target threshold and the shadow threshold;
[0057] Among them, the gray distribution estimation is based on the Weibull distribution model, and the distribution function of the Weibull distribution model is:
[0058]
[0059] Among them, P(A) is the distribution function, A is the amplitude, a is the scale parameter of the distribution parameter, and b is the shape parameter of the distribution parameter. a is used to control the position of the gray value with the maximum probability, and b is used to control the concentration degree of the gray value.
[0060] The Weibull distribution is a distribution model commonly used to describe random variables and can better fit the gray-scale distribution in sonar images. By estimating the Weibull distribution of the gray-scale values of the image, two main distribution parameters can be obtained: the scale parameter and the shape parameter. These two parameters can help determine the segmentation thresholds for the target and shadow regions.
[0061] In this embodiment, the gray-scale distribution of the filtered filter vector is estimated, and the Weibull distribution model is used to calculate the gray-scale distribution parameters of the image. Based on these parameters, a threshold selection strategy (policy function) for target segmentation is designed to calculate the target segmentation threshold and the shadow segmentation threshold.
[0062] Among them, the policy function includes:
[0063]
[0064] Among them, T T is the target threshold, T S is the shadow threshold, a is the scale parameter of the distribution parameter, and b is the shape parameter of the distribution parameter.
[0065] S04. Using the segmentation function, segment the filtered vector according to the target threshold and the shadow threshold to obtain the target, shadow, and background;
[0066] Among them, the segmentation function includes:
[0067]
[0068] Among them, s2(i) represents the i-th element in the ternary vector, and its value is 1, -1, or 0, corresponding to the target, shadow, and background respectively. s1(i) represents the i-th element in the filter vector, T T is the target threshold, and T S is the shadow threshold.
[0069] It can be understood that in the one-dimensional filter vector generated from the sonar image, those greater than or equal to the target threshold are marked as the target, those less than or equal to the shadow threshold are marked as the shadow, and the rest are marked as the background, thus generating a ternary vector.
[0070] In this embodiment, according to the calculated target threshold and shadow threshold, the one-dimensional filter vector is classified, and the pixels in the image are divided into the target, shadow, and background.
[0071] S05. Using the inverse transformation of the space-filling curve, reconstruct based on the target, the shadow, and the background to obtain a two-dimensional segmented image.
[0072] Among them, the expression for obtaining the two-dimensional segmented image is:
[0073]
[0074] Among them, represents the inverse transformation process, s2(i) represents the i-th element in the ternary vector, and its values are 1, -1, or 0, corresponding to the target, shadow, and background respectively, and I o (x, y) represents the two-dimensional segmented image.
[0075] In summary, a sonar image segmentation method has the following effects:
[0076] Through the space-filling curve scanning, the high-amplitude part of the one-dimensional vector (i.e., the target area of the image) is relatively concentrated. Compared with the line-by-line scanning method, the space-filling curve scanning can more effectively aggregate the target area.
[0077] After median filtering the one-dimensional vector, the larger-amplitude part is smoothed, and the noise is effectively removed. Median filtering can better retain the target information while removing the background noise.
[0078] Through Weibull distribution estimation, the segmentation thresholds of the target and the shadow are calculated. Experimental data show that the threshold selection strategy based on Weibull distribution can effectively distinguish the target, shadow, and background.
[0079] Through the cooperation of the space-filling curve and the gray-scale distribution estimation, the computational amount can be effectively reduced, the segmentation efficiency can be improved, and a high segmentation accuracy can be achieved under complex backgrounds.
[0080] Embodiment 2
[0081] As Figure 2 shown, in the second embodiment of the present invention, a sonar image segmentation system is provided, and the system includes:
[0082] A dimensionality reduction module 10, configured to obtain a sonar image and reduce the two-dimensional sonar image to a one-dimensional vector by using a space-filling curve;
[0083] A filtering module 20, configured to perform denoising filtering on the one-dimensional vector by using a filtering technique to obtain a filtered vector;
[0084] A calculation module 30, configured to calculate the distribution parameters of the filtered vector by using gray-scale distribution estimation, generate a policy function based on the distribution parameters, and calculate the target threshold and the shadow threshold by using the policy function;
[0085] A segmentation module 40, configured to segment the filtered vector according to the target threshold and the shadow threshold by using a segmentation function to obtain the target, shadow, and background;
[0086] A reconstruction module 50, configured to perform reconstruction based on the target, the shadow, and the background by using the inverse transformation of a space-filling curve, so as to obtain a two-dimensional segmentation image.
[0087] For the sonar image segmentation system provided in an embodiment of the present invention, the implementation principle and the achieved technical effects are the same as those in the foregoing method embodiment. For a brief description, for parts not mentioned in the system embodiment, reference may be made to the corresponding content in the foregoing method embodiment.
[0088] Embodiment III
[0089] As Figure 3 shown, in the third embodiment of the present invention, the following technical solution is provided: A computer includes a memory 202, a processor 201, and a computer program stored on the memory 202 and executable on the processor 201. When the processor 201 executes the computer program, the sonar image segmentation method as described above is implemented.
[0090] Specifically, the foregoing processor 201 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.
[0091] Among them, the memory 202 may include a mass storage for data or instructions. By way of example and not limitation, the memory 202 may include a hard disk drive (HDD), a floppy disk drive, a solid state drive (SSD), a flash memory, an optical disc, a magneto-optical disc, a magnetic tape, or a universal serial bus (USB) drive, or a combination of two or more of these. In a suitable case, the memory 202 may include removable or non-removable (or fixed) media. In a suitable case, the memory 202 may be inside or outside the data processing device. In a specific embodiment, the memory 202 is a non-volatile memory. In a specific embodiment, the memory 202 includes a read-only memory (ROM) and a random access memory (RAM). In a suitable case, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically alterable ROM (EAROM), or a flash memory, or a combination of two or more of these. In a suitable case, the RAM may be a static random access memory (SRAM) or a dynamic random access memory (DRAM), where the DRAM may be a fast page mode dynamic random access memory (FPMDRAM), an extended data output dynamic random access memory (EDODRAM), a synchronous dynamic random access memory (SDRAM), etc.
[0092] The memory 202 can be used to store or cache various data files required for processing and / or communication, as well as possible computer program instructions executed by the processor 201.
[0093] The processor 201 reads and executes the computer program instructions stored in the memory 202 to implement the above sonar image segmentation method.
[0094] In some embodiments, the computer may further include a communication interface 203 and a bus 200. Among them, as Figure 3 shown, the processor 201, the memory 202, and the communication interface 203 are connected through the bus 200 to complete communication with each other.
[0095] The communication interface 203 is used to implement communication between the various modules, devices, units, and / or devices in the embodiments of the present application. The communication interface 203 can also implement data communication with other components such as external devices, image / data acquisition devices, databases, external storage, and image / data processing workstations.
[0096] The bus 200 includes hardware, software, or both, and couples the components of a computer to each other. The bus 200 includes, but is not limited to, at least one of the following: Data Bus, Address Bus, Control Bus, Expansion Bus, Local Bus. By way of example and not limitation, the bus 200 may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an InfiniBand interconnect, a Low Pin Count (LPC) bus, a memory bus, a Micro Channel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local Bus (VLB) bus, or other suitable bus or a combination of two or more of these. Where appropriate, the bus 200 may include one or more buses. Although the embodiments of the present application describe and illustrate specific buses, the present application contemplates any suitable bus or interconnect.
[0097] Embodiment 4
[0098] In the fourth embodiment of the present invention, in combination with the above sonar image segmentation method, the embodiments of the present invention provide the following technical solution: a storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the above sonar image segmentation method is implemented.
[0099] Those skilled in the art will understand that the data in the flowchart and / or the logic and / or steps described in other ways herein, for example, can be regarded as a sequenced data table of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other systems that can fetch and execute instructions from the instruction execution system, apparatus, or device), or used in combination with these instruction execution systems, apparatuses, or devices. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by or in combination with an instruction execution system, apparatus, or device.
[0100] More specific examples (nonexhaustive list) of the readable medium include the following: an electrical connection portion (electronic device) having one or more wirings, a portable computer disk cartridge (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other media, followed by editing, interpretation, or other appropriate processing as necessary, and then stored in a computer memory.
[0101] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, any one or a combination of the following techniques well known in the art can be used: discrete logic circuits having logic gate circuits for implementing logical functions on data signals, application-specific integrated circuits having appropriate combinational logic gate circuits, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0102] The technical features of the above-described embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the various technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered to be within the scope described in this specification.
[0103] The above-described embodiments merely represent several implementation manners of the present application. The description thereof is relatively specific and detailed, but it should not be construed as a limitation on the scope of the invention patent. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all fall within the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the appended claims.
Claims
1. A sonar image segmentation method, characterized in that: The method comprises: Acquire a sonar image, and reduce the two-dimensional sonar image into a one-dimensional vector using a space filling curve; Performing denoising filtering on the one-dimensional vector using filtering technology to obtain a filtered vector; Calculating distribution parameters of the filter vector using grayscale distribution estimation, generating a strategy function based on the distribution parameters, and calculating a target threshold and a shadow threshold using the strategy function; Using a segmentation function to segment the filter vector according to the target threshold and the shadow threshold to obtain a target, a shadow and a background; Reconstruction is performed based on the target, the shadow and the background using an inverse transformation of a space filling curve to obtain a two-dimensional segmented image.
2. The sonar image segmentation method according to claim 1, characterized in that: The space filling curve includes any one of a Peano curve, a Hilbert curve, a Moore curve or a Morton curve.
3. The sonar image segmentation method according to claim 1, characterized in that: The filtering technique includes any one of Gaussian filtering, mean filtering or median filtering.
4. The sonar image segmentation method according to claim 1, characterized in that: The grayscale distribution estimation is based on the Weibull distribution model, wherein the distribution function of the Weibull distribution modulus is: Among them, P(A) is the distribution function, A is the amplitude, a is the scale parameter of the distribution parameter, and b is the shape parameter of the distribution parameter.
5. The sonar image segmentation method according to claim 1, characterized in that: The strategy function includes: Among them, T T is the target threshold, T S is the shadow threshold, a is the scale parameter of the distribution parameter, and b is the shape parameter of the distribution parameter.
6. The sonar image segmentation method according to claim 1, characterized in that: The segmentation function comprises: Among them, s2(i) represents the i-th element in the three-value vector, and its value is 1, -1 or 0, corresponding to the target, shadow and background respectively, s1(i) represents the i-th element in the filter vector, T T is the target threshold, T S is the shadow threshold.
7. The sonar image segmentation method according to claim 1, characterized in that: The expression of the two-dimensional segmented image is: in, represents the inverse transform process, s2(i) represents the i-th element in the three-value vector, and its value is 1, -1 or 0, corresponding to the target, shadow and background respectively, I o (x,y) represents the two-dimensional segmented image.
8. A sonar image segmentation system, characterized in that: The system comprises: A dimension reduction module, used for acquiring a sonar image, and reducing the two-dimensional sonar image into a one-dimensional vector using a space filling curve; A filtering module, used for performing denoising filtering on the one-dimensional vector using a filtering technique to obtain a filtered vector; A calculation module, used to calculate the distribution parameters of the filter vector by using the grayscale distribution estimation, generate a strategy function based on the distribution parameters, and calculate the target threshold and the shadow threshold by using the strategy function; A segmentation module, used for segmenting the filter vector according to the target threshold and the shadow threshold using a segmentation function to obtain a target, a shadow and a background; The reconstruction module is used to reconstruct based on the target, the shadow and the background by using the inverse transformation of the space filling curve to obtain a two-dimensional segmented image.
9. A computer comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the sonar image segmentation method according to any one of claims 1 to 6 is implemented.
10. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by the processor, the sonar image segmentation method according to any one of claims 1 to 6 is implemented.