Sonar image difference area boundary line detection method, device, equipment and medium

By searching the possibility area, cropping and line-by-line difference of sonar images, combining OTSU algorithm and probability statistics methods, extracting and drawing the dividing line of sonar images, the problem of difficulty in taking into account the accuracy and real-time nature of sonar image processing in the prior art is solved, and more efficient object detection is achieved.

CN118967727BActive Publication Date: 2025-03-28WUHAN UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410953127.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-16
Publication Date
2025-03-28
Estimated Expiration
2044-07-16

AI Technical Summary

Technical Problem

The prior art is difficult to take into account the accuracy and real-time nature of sonar image processing, especially in complex underwater environments, where noise interference and multipath effect lead to inaccurate image segmentation.

Method used

By performing possibility area search, cropping and line-by-line difference on sonar images, combining OTSU algorithm and probability statistics methods, the dividing lines of sonar images are extracted and drawn.

Benefits of technology

The preprocessing level of sonar image is improved, the binary image results are improved, the target detection accuracy is improved, and the problem of difficulty in taking into account both accuracy and real-time in the prior art.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118967727B_ABST
    Figure CN118967727B_ABST
Patent Text Reader

Abstract

The invention relates to a method, device, equipment and medium for detecting boundary lines of difference regions of sonar images, and belongs to the technical field of image processing. The method comprises: searching for possible regions of sonar images to obtain possible region images; cropping the possible region images to obtain a plurality of first cropping blocks; preprocessing the first cropping blocks based on an OTSU algorithm to obtain second cropping blocks for separating targets from backgrounds; performing line-by-line differentiation on the second cropping blocks to obtain boundary grayscale feature values ​​of the second cropping blocks; performing probability statistics on the boundary grayscale feature values, and obtaining boundary lines based on the screening results of the probability statistics. The invention effectively solves the technical problem that it is difficult to take both accuracy and real-time performance into consideration in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to a method and device for detecting boundary lines of different regions of a sonar image. Background Art

[0002] In underwater missions, ROVs need to sense the environment and avoid collisions, but the underwater environment usually has low light, which reduces the quality of visual images. In contrast, sonar equipment can use ultrasound to sense the environment in the absence of light. It has the advantages of strong anti-interference and wide detection range, and is especially suitable for monitoring complex underwater environments. However, sonar detection also has problems, such as noise interference, multipath and near-field noise caused by complex environments. Although some high-end equipment has good imaging quality, it is expensive and bulky, which is not suitable for small and flexible equipment such as ROV. Therefore, high-quality processing of underwater acoustic images and real-time perception of the environment around the ROV are crucial to its mission completion.

[0003] At present, when processing sonar images to obtain image information, no matter what method is used, it is usually necessary to preprocess the image. Among these preprocessing methods, the OTSU threshold segmentation method is one of the most common binarization methods. The OTSU method can segment the image into two parts, background and target object, by adaptively selecting the threshold, thus providing a basis for subsequent image analysis and processing. However, this method obtains the global threshold based on the global image information. There may be large differences in local grayscale levels in different regions of the image, resulting in improper threshold selection and filtering out key information. If the image is divided into different regions for local OTSU (maximum inter-class variance method) processing, the image binarization result will be effectively improved. If the deep learning method is used, a lot of annotation work will be required, and the real-time performance will be difficult to meet the requirements. Summary of the invention

[0004] In view of this, it is necessary to provide a method for detecting boundary lines of different regions in sonar images to solve the problem that the existing technology is difficult to balance accuracy and real-time performance.

[0005] In order to solve the above problems, the present invention provides a method for detecting boundary lines of different regions in sonar images, comprising:

[0006] Conducting a possible area search on the sonar image to obtain a possible area image;

[0007] Crop the possible area image to obtain a number of first cropped blocks;

[0008] The first cropped block is preprocessed based on the OTSU algorithm to obtain a second cropped block in which the target is separated from the background;

[0009] Performing row-by-row differentiation on the second cropped block to obtain a boundary grayscale feature value of the second cropped block;

[0010] Perform probability statistics on the boundary grayscale eigenvalues ​​to obtain the dividing line.

[0011] In a possible implementation, searching the sonar image for possible areas includes:

[0012] Extracting pixel feature values ​​of each row of the sonar image;

[0013] Performing mean processing on each row of pixel feature values ​​of the sonar image within a preset number of rows from the boundary in the up and down directions to obtain a plurality of row feature values;

[0014] Arrange the row characteristic values ​​according to row numbers to obtain a plurality of interval sets and interval change amplitude sets;

[0015] Based on a recursive method, the interval set and the interval change amplitude set are forward processed to obtain a positive result interval set and a positive interval change amplitude set;

[0016] Recursively processing the interval set and the interval change amplitude set to obtain a reverse result interval set and a reverse interval change amplitude set;

[0017] Merging the positive result interval set with the negative result interval set to obtain a fused interval;

[0018] The fusion interval is vertically expanded and then horizontally cropped to obtain a possible area image.

[0019] In a possible implementation, extracting the characteristic value of each row of pixels of the sonar image includes: extracting the average value of each row of pixels of the sonar image;

[0020] The average value of each row of pixels is subjected to sliding average filtering to achieve preliminary denoising and obtain the characteristic value of each row of pixels.

[0021] In a possible implementation, the forward result interval set and the reverse result interval set are merged, including:

[0022] Selecting a number of positive result intervals with the largest change amplitudes from the positive result interval set based on the positive interval change amplitude set;

[0023] Selecting an equal number of reverse result intervals with the largest change amplitudes from the reverse result interval set based on the reverse interval change amplitude set;

[0024] Calculating a first distance between a left boundary of the forward result interval and a left boundary of the reverse result interval, and a second distance between a right boundary of the forward result interval and a right boundary of the reverse result interval;

[0025] If the first distance or the second distance is less than a preset boundary uniform threshold, the left boundary or the right boundary of the reverse result interval and the positive result interval is corrected, and the corrected positive result interval and the reverse result interval are merged;

[0026] Otherwise, the fusion is performed directly.

[0027] In a possible implementation manner, the cropping of the possible area image includes:

[0028] Down-sampling the possibility area image to obtain a sampled image;

[0029] The sampled image is cropped at equal intervals according to a preset number to obtain a plurality of first cropped blocks.

[0030] In a possible implementation, performing probability statistics on the boundary grayscale feature values ​​to obtain the boundary line includes:

[0031] The boundary grayscale feature value is processed based on the three-line judgment method in probability statistics to obtain the dividing line.

[0032] In a possible implementation, the processing of the boundary grayscale feature value based on the three-line judgment method in probability statistics includes:

[0033] Select any three consecutive rows from the second cropped block as a row set to be identified;

[0034] Determine whether the ratio of the sum of the number of bright spots in the to-be-identified row set to the width of the second cropping block is greater than a preset row determination threshold, wherein the number of bright spots includes: pixels whose boundary grayscale feature value of a single row is 255;

[0035] A row in the to-be-identified row set, for which the ratio of the number of bright spots in a single row to the total number of bright spots is greater than a preset bright spot number judgment threshold, is taken as a possible row;

[0036] A possible row with the largest number of bright spots is selected from the possible rows as the row where the dividing line is located.

[0037] The present invention also provides a sonar image difference area boundary line detection device, comprising:

[0038] A possibility area search module is used to search the sonar image for a possibility area to obtain a possibility area image;

[0039] A cropping module, used for cropping the possible area image to obtain a plurality of first cropping blocks;

[0040] The cropping block processing module is used to pre-process the first cropping block based on the OTSU algorithm to obtain a second cropping block in which the target is separated from the background, and to perform row-by-row differentiation on the second cropping block to obtain the boundary grayscale feature value of the second cropping block, and to perform probability statistics on the boundary grayscale feature value to obtain a dividing line.

[0041] The present invention also provides a device, comprising:

[0042] Memory, used to store programs;

[0043] A processor is coupled to the memory and is used to execute the program stored in the memory to implement the steps in the sonar image difference area boundary line detection method described in any one of the above method items.

[0044] The present invention also provides a medium for storing a computer-readable program or instruction, which, when executed by a processor, can implement the steps of the sonar image difference area boundary line detection method described in any one of the above method items.

[0045] The beneficial effects of the present invention are as follows: the present invention provides a method for detecting boundary lines of different regions of sonar images, firstly based on the mean value of row pixels, a possible region search is performed on the sonar image, and then a series of searched regions are cropped, the region to be processed is refined to obtain a longitudinal cropping block, and finally a processing method based on OpenCV and row-by-row difference is used to draw the boundary line to obtain a sonar image boundary map. The present invention directly divides the image into different regions for local OTSU processing, improves the image binarization processing result, improves the sonar image preprocessing level, and improves the target detection accuracy, thereby effectively solving the technical problem that the prior art is difficult to balance accuracy and real-time performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 A method flow chart of an embodiment of a method for detecting boundary lines of different regions in sonar images provided by the present invention;

[0047] Figure 2 for Figure 1 A method flow chart of step S101 in an embodiment;

[0048] Figure 3 for Figure 2 A method flow chart of an embodiment of step S201;

[0049] Figure 4 for Figure 2 A method flow chart of an embodiment of step S206;

[0050] Figure 5 for Figure 1 A method flow chart of an embodiment of step S102;

[0051] Figure 6 for Figure 1 A method flow chart of an embodiment of step S105;

[0052] Figure 7 A schematic diagram of the structure of an embodiment of a sonar image difference area boundary line detection device provided by the present invention;

[0053] Figure 8 A schematic structural diagram of an embodiment of a device provided by the present invention. DETAILED DESCRIPTION

[0054] The preferred embodiments of the present invention are described in detail below in conjunction with the accompanying drawings, wherein the accompanying drawings constitute a part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not used to limit the scope of the present invention.

[0055] In the description of the embodiments of the present invention, unless otherwise specified, "multiple" means two or more than two. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" may mean: A exists alone, A and B exist at the same time, and B exists alone.

[0056] The descriptions of "first", "second", etc. involved in the embodiments of the present invention are only for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the technical features defined as "first" and "second" may explicitly or implicitly include at least one of the features.

[0057] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0058] In order to solve the above problems, Figure 1 As shown, the present invention provides a method for detecting boundary lines of different regions in sonar images, comprising:

[0059] S101, performing a possible area search on the sonar image to obtain a possible area image;

[0060] S102, cropping the possible area image to obtain a plurality of first cropped blocks;

[0061] S103, preprocessing the first cropped block based on the OTSU algorithm to obtain a second cropped block in which the target is separated from the background;

[0062] It should be noted that the OTSU algorithm is derived from the least squares method and is used for some simple threshold determination. For a grayscale image, in the scenario where a threshold is needed to distinguish its foreground and background, a reasonable assumption can be made: if the pixel distribution diagram of the image is drawn, there should be two peaks on the image, namely the foreground color and the background color. There must be a valley between the two peaks, so the threshold can be set here to achieve a good segmentation effect for the image. Based on the OTSU algorithm, the inter-class variance of the two images segmented with this threshold can be calculated. For each possible threshold, calculate and take out the pixel value with the largest inter-class variance, and this value can better segment the image.

[0063] During implementation, the cropped block is first subjected to OSTU binarization to separate the target from the background. Then, the noise and holes are further eliminated through a closing operation. Continuous line differences are then performed and the absolute values ​​are taken to obtain the grayscale features of the pixel boundaries in the strips. At this time, the grayscale features have only three cases, namely 0, 1, and 255. The grayscale boundaries are mapped and the mapping relationship is shown in the following formula:

[0064] (1)

[0065] In formula (1), p Represents grayscale features.

[0066] S104, performing row-by-row differentiation on the second cropped block to obtain a boundary grayscale feature value of the second cropped block;

[0067] S105 , performing probability statistics on the grayscale feature values ​​of the boundary, and screening out the dividing line based on the result of the probability statistics.

[0068] Compared with the prior art, the method for detecting boundary lines of different regions of sonar images provided by the present invention first searches for possible regions of sonar images based on the mean value of row pixels, then performs cropping processing on a series of searched regions, refines the regions to be processed to obtain longitudinal cropping blocks, and finally draws boundary lines using a processing method based on OpenCV combined with row-by-row difference to obtain a sonar image boundary map. The present invention directly divides the image into different regions for local OTSU processing, improves the image binarization processing results, improves the level of sonar image preprocessing, and improves the target detection accuracy, thereby effectively solving the technical problem that the prior art is difficult to balance accuracy and real-time performance.

[0069] Furthermore, the boundary grayscale feature value can be processed based on the three-line judgment method in probability statistics to obtain the dividing line.

[0070] like Figure 2 In a possible implementation, step S101 includes:

[0071] S201, extracting pixel feature values ​​of each row of the sonar image;

[0072] S202, performing mean processing on each row of pixel feature values ​​of the sonar image within a preset number of rows from the boundary in the up and down directions to obtain a plurality of row feature values;

[0073] Preferably, the preset number of rows is set to 30.

[0074] It should be noted that due to the limitation of the performance of the sonar itself, a dividing line may appear in the very close range of the upper and lower boundary lines, but the area between the dividing line and the boundary line is extremely small, and the number of pixels has little effect on the effect of the OTSU algorithm. If you want to search for this dividing line, you still need to go through a lot of processing, which will affect the real-time performance of the algorithm. Therefore, the present invention performs mean processing on the pixel feature values ​​of the upper and lower rows of the image within 30 rows from the boundary to ensure that the dividing line will not be searched at the upper and lower boundaries of the image later. Then the pixel feature values ​​of the upper and lower 30 rows are for:

[0075] (2)

[0076] In formula (2), n is the number of image rows; is the row number, .

[0077] S203, arranging the row eigenvalues ​​according to the row numbers to obtain a plurality of interval sets and interval variation range sets;

[0078] Specifically, to highlight Change, square it to get the final row eigenvalue , for a series of Processing is performed to obtain a number of continuous rising / falling interval sets arranged by row number And the set of changes corresponding to each interval .

[0079] S204, recursively performing forward processing on the interval set and the interval change amplitude set to obtain a forward result interval set and a forward interval change amplitude set;

[0080] S205, recursively performing reverse processing on the interval set and the interval change amplitude set to obtain a reverse result interval set and a reverse interval change amplitude set;

[0081] S206, merging the positive result interval set and the negative result interval set to obtain a fused interval;

[0082] Specifically, to eliminate The small fluctuation of can be treated by the “region three-in-one method”, which recursively processes the intervals in the set R in a forward and reverse manner to obtain the result interval after forward processing. And the result interval after reverse processing and its corresponding interval amplitude and The pseudo code of the fusion rule is as follows:

[0083] if The absolute value is greater than 10 times The absolute value of

[0084] but , ,delete ;

[0085] Otherwise, no action will be taken.

[0086] in, Representing a collection R The i intervals, express The corresponding change amplitude, when forward processing, starts from the first row of eigenvalues ​​of the image and ends at the last row, that is, ; When processing in reverse, start from the last row of eigenvalues ​​and end at the first row, that is, .

[0087] S207, vertically expand the fusion interval and then horizontally crop it to obtain a possible area image.

[0088] like Figure 3 In a possible implementation, step S201 includes:

[0089] S301, extracting the average value of pixels in each row of the sonar image;

[0090] S302 , performing sliding average filtering on the average value of each row of pixels to achieve preliminary denoising and obtain a characteristic value of each row of pixels.

[0091] like Figure 4 In a possible implementation, step S206 includes:

[0092] S401, selecting a number of positive result intervals with the largest change ranges from the positive result interval set based on the positive interval change range set;

[0093] S402, selecting an equal number of reverse result intervals with the largest change amplitudes from the reverse result interval set based on the reverse interval change amplitude set;

[0094] Preferably, from and Extract the 5 intervals with the largest change in each of them, and get and Two sets of intervals.

[0095] S403, calculating a first distance between a left boundary of a positive result interval and a left boundary of a negative result interval, and a second distance between a right boundary of a positive result interval and a right boundary of a negative result interval;

[0096] S404: if the first distance or the second distance is less than a preset boundary uniform threshold, correct the left boundary or the right boundary of the reverse result interval and the forward result interval, and merge the corrected forward result interval and the reverse result interval;

[0097] Specifically, if the distance between an interval in one set and the left or right boundary of an interval in another set is too close, that is, less than the boundary uniform threshold , it is determined to be the same as the boundary, and it needs to be corrected, and the average value is taken as the corrected boundary, as shown in the following formula:

[0098] (3)

[0099] In formula (3), , Respectively Middle i The left and right boundaries of the interval, , Respectively Middle j The left and right boundaries of the interval, , Respectively represent the left and right boundaries of the corrected interval, , The unified threshold for the boundary.

[0100] In order to ensure that the boundary lines can be obtained in the selected 10 intervals, these intervals are expanded by 5 lines upward and downward respectively, and the image is horizontally cropped according to the interval line number. Finally, the possible area search is completed and 10 possible areas are obtained. The possible area image set is recorded as .

[0101] S405: Otherwise, directly perform fusion.

[0102] like Figure 5 In a possible implementation, step S102 includes:

[0103] S501, down-sampling the possibility area image to obtain a sampled image;

[0104] During implementation, the width of the region image may be reduced by half for downsampling to ensure row continuity of pixels.

[0105] S502: Crop the sampled image at equal intervals according to a preset number to obtain a plurality of first cropped blocks.

[0106] Preferably, each image is cut into 9 strip-shaped cut blocks at equal intervals in the longitudinal direction. The set of cut blocks is recorded as , in order to improve the accuracy of subsequent image processing.

[0107] like Figure 6 In a possible implementation, step S105 includes:

[0108] S601, selecting any three consecutive rows from the second cropping block as a row set to be identified;

[0109] S602, determining whether the ratio of the sum of the number of bright spots in the row set to be identified to the width of the second cropping block is greater than a preset row determination threshold;

[0110] Specifically, in this embodiment, the bright spots are pixels in a single row whose boundary grayscale characteristic value is 255.

[0111] S603, taking a row in the to-be-identified row set, for which the ratio of the number of bright spots in a single row to the total number of bright spots is greater than a preset bright spot number judgment threshold, as a possible row;

[0112] Preferably, the bright spot number judgment threshold is 0.5.

[0113] S604: Select a possible row with the largest number of bright spots from among several possible rows as the row where the boundary line is located.

[0114] It should be noted that the boundary line of the original image is almost impossible to appear as a continuous horizontal line. Therefore, a "three-line judgment method" based on probability statistics is designed. The core idea is to judge the line with the most bright spots (points with a pixel value of 255) as the line where the boundary line is located. The specific meaning is: if the number of bright spots in three consecutive lines is greater than a certain percentage of the width of the block (recorded as the line judgment threshold ), and the number of bright spots in one row is greater than the total number of bright spots in the three rows, then the row where the dividing line is located is identified. The pseudo code is as follows:

[0115] if ,

[0116] and , then it is recorded as a possible line , add the possible row set ;

[0117] if There are any two possible rows and In 5 consecutive rows, keep the one with more bright spots and remove the other one from the Eliminate it and get the final dividing line row ;

[0118] Finally, according to In the result, a horizontal sonar image boundary line is drawn in the corresponding row to obtain a sonar boundary image.

[0119] like Figure 7 The present invention also provides a sonar image difference area boundary line detection device 70, comprising:

[0120] A possibility area search module 710 is used to perform a possibility area search on the sonar image to obtain a possibility area image;

[0121] A cropping module 720, used for cropping the possible area image to obtain a plurality of first cropping blocks;

[0122] The cropping block processing module 730 is used to pre-process the first cropping block based on the OTSU algorithm to obtain a second cropping block in which the target is separated from the background, and to perform row-by-row differentiation on the second cropping block to obtain the boundary grayscale feature value of the second cropping block, and to perform probability statistics on the boundary grayscale feature value to obtain a dividing line.

[0123] like Figure 8 As shown, the present invention also provides a device 80, comprising:

[0124] A memory 810, used for storing programs;

[0125] The processor 820 is coupled to the memory 810 and is used to execute the program stored in the memory 810 to implement the steps in the sonar image difference area boundary line detection method described in any one of the above embodiments.

[0126] Figure 8 Only some of the components of the device 80 are shown, but it should be understood that implementing all of the components shown is not a requirement, and more or fewer components may alternatively be implemented.

[0127] In some embodiments, the processor 820 may be a central processing unit (CPU), a microprocessor or other data processing chip, and is used to run program codes or process data stored in the memory 810, such as the sonar image difference area boundary line detection method of the present invention.

[0128] In some embodiments, the processor 820 may be a single server or a server group. The server group may be centralized or distributed. In some embodiments, the processor 820 may be local or remote. In some embodiments, the processor 820 may be implemented in a cloud platform. In one embodiment, the cloud platform may include a private cloud, a public cloud, a hybrid cloud, a community cloud, a distributed cloud, an internal cloud, a multi-cloud, etc., or any combination thereof.

[0129] In some embodiments, the memory 810 may be an internal storage unit of the device 80, such as a hard disk or memory of the device 80. In other embodiments, the memory 810 may also be an external storage device of the device 80, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc., equipped on the device 80.

[0130] Furthermore, the memory 810 may include both an internal storage unit of the device 80 and an external storage device. The memory 810 is used to store application software installed on the device 80 and various data.

[0131] In one embodiment, when the processor 820 executes the sonar image difference area boundary line detection program in the memory 810, the following steps may be implemented:

[0132] Conducting a possible area search on the sonar image to obtain a possible area image;

[0133] Crop the possible area image to obtain a number of first cropped blocks;

[0134] The first cropped block is preprocessed based on the OTSU algorithm to obtain a second cropped block in which the target is separated from the background;

[0135] Performing row-by-row differentiation on the second cropped block to obtain a boundary grayscale feature value of the second cropped block;

[0136] The grayscale feature values ​​of the boundaries are subjected to probability statistics, and the dividing line is obtained by screening based on the results of the probability statistics.

[0137] Furthermore, the embodiment of the present invention does not specifically limit the type of the device 80 mentioned, and the device 80 may be a portable device such as a mobile phone, a tablet computer, a personal digital assistant (PDA), a wearable device, a laptop computer, etc. Exemplary embodiments of portable devices include but are not limited to portable devices equipped with IOS, Android, Microsoft or other operating systems. The above-mentioned portable device may also be other portable devices, such as a laptop computer with a touch-sensitive surface (e.g., a touch panel). It should also be understood that in some other embodiments of the present invention, the device 80 may not be a portable device, but a desktop computer with a touch-sensitive surface (e.g., a touch panel).

[0138] The present invention also provides a storage medium for storing a computer-readable program or instruction, which, when executed by a processor, can implement the steps of the sonar image difference area boundary line detection method described in any one of the above embodiments.

[0139] Those skilled in the art will appreciate that all or part of the processes of the above-mentioned embodiments can be implemented by instructing related hardware (such as a processor, a controller, etc.) through a computer program, and the computer program can be stored in a computer storage medium, wherein the computer storage medium is a disk, an optical disk, a read-only storage memory, or a random access memory, etc.

[0140] The sonar image difference area boundary line detection method, device, equipment and medium provided by the present invention are introduced in detail above. Specific examples are used in this article to illustrate the principle and implementation mode of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for technical personnel in this field, according to the idea of ​​the present invention, there will be changes in the specific implementation mode and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A method for detecting boundary lines of different regions in sonar images, characterized in that: include: Conducting a possible area search on the sonar image to obtain a possible area image; Crop the possible area image to obtain a number of first cropped blocks; The first cropped block is preprocessed based on the OTSU algorithm to obtain a second cropped block in which the target is separated from the background; Performing row-by-row differentiation on the second cropped block to obtain a boundary grayscale feature value of the second cropped block; Perform probability statistics on the grayscale feature values ​​of the boundary, and obtain the dividing line based on the results of probability statistics; Wherein, the searching of the possible areas of the sonar image comprises: Extracting pixel feature values ​​of each row of the sonar image; Performing mean processing on each row of pixel feature values ​​of the sonar image within a preset number of rows from the boundary in the up and down directions to obtain a plurality of row feature values; Arrange the row characteristic values ​​according to row numbers to obtain a plurality of interval sets and interval change amplitude sets; Based on a recursive method, the interval set and the interval change amplitude set are forward processed to obtain a positive result interval set and a positive interval change amplitude set; Recursively processing the interval set and the interval change amplitude set to obtain a reverse result interval set and a reverse interval change amplitude set; Merging the positive result interval set with the negative result interval set to obtain a fused interval; The fusion interval is vertically expanded and then horizontally cropped to obtain a possible area image; The fusing the positive result interval set with the negative result interval set includes: Selecting a number of positive result intervals with the largest change amplitudes from the positive result interval set based on the positive interval change amplitude set; Selecting an equal number of reverse result intervals with the largest change amplitudes from the reverse result interval set based on the reverse interval change amplitude set; Calculating a first distance between a left boundary of the forward result interval and a left boundary of the reverse result interval, and a second distance between a right boundary of the forward result interval and a right boundary of the reverse result interval; If the first distance or the second distance is less than a preset boundary uniform threshold, the left boundary or the right boundary of the reverse result interval and the positive result interval is corrected, and the corrected positive result interval and the reverse result interval are merged; Otherwise, the fusion is performed directly.

2. The method for detecting boundary lines of different regions in sonar images according to claim 1, characterized in that: The extracting the characteristic value of each row of pixels of the sonar image comprises: extracting the average value of each row of pixels of the sonar image; The average value of each row of pixels is subjected to sliding average filtering to achieve preliminary denoising and obtain the characteristic value of each row of pixels.

3. The method for detecting boundary lines of different regions in sonar images according to claim 1, characterized in that: The clipping of the possibility area image comprises: Down-sampling the possibility area image to obtain a sampled image; The sampled image is cropped at equal intervals according to a preset number to obtain a plurality of first cropped blocks.

4. The method for detecting boundary lines of different regions in sonar images according to claim 1, characterized in that: The method of performing probability statistics on the grayscale feature values ​​of the boundaries and screening the boundary lines based on the results of the probability statistics includes: The boundary grayscale feature value is processed based on the three-line judgment method to obtain the boundary line.

5. The method for detecting boundary lines of different regions in sonar images according to claim 4, characterized in that: The processing of the boundary grayscale feature value based on the three-line judgment method includes: Select any three consecutive rows from the second cropped block as a row set to be identified; Determine whether the ratio of the sum of the number of bright spots in the to-be-identified row set to the width of the second cropping block is greater than a preset row determination threshold, wherein the number of bright spots includes: pixels whose boundary grayscale feature value of a single row is 255; A row in the to-be-identified row set, for which the ratio of the number of bright spots in a single row to the total number of bright spots is greater than a preset bright spot number judgment threshold, is taken as a possible row; A possible row with the largest number of bright spots is selected from the possible rows as the row where the dividing line is located.

6. A sonar image difference area boundary detection device, characterized in that: include: A possibility area search module is used to search the sonar image for a possibility area to obtain a possibility area image; A cropping module, used for cropping the possible area image to obtain a plurality of first cropping blocks; A cropping block processing module is used to pre-process the first cropping block based on the OTSU algorithm to obtain a second cropping block in which the target is separated from the background, and to perform row-by-row differentiation on the second cropping block to obtain a boundary grayscale feature value of the second cropping block, and to perform probability statistics on the boundary grayscale feature value to obtain a dividing line; Wherein, the searching of the possible areas of the sonar image comprises: Extracting pixel feature values ​​of each row of the sonar image; Performing mean processing on each row of pixel feature values ​​of the sonar image within a preset number of rows from the boundary in the up and down directions to obtain a plurality of row feature values; Arrange the row characteristic values ​​according to row numbers to obtain a plurality of interval sets and interval change amplitude sets; Based on a recursive method, the interval set and the interval change amplitude set are forward processed to obtain a positive result interval set and a positive interval change amplitude set; Recursively processing the interval set and the interval change amplitude set to obtain a reverse result interval set and a reverse interval change amplitude set; Merging the positive result interval set with the negative result interval set to obtain a fused interval; The fusion interval is vertically expanded and then horizontally cropped to obtain a possible area image; The fusing the positive result interval set with the negative result interval set includes: Selecting a number of positive result intervals with the largest change amplitudes from the positive result interval set based on the positive interval change amplitude set; Selecting an equal number of reverse result intervals with the largest change amplitudes from the reverse result interval set based on the reverse interval change amplitude set; Calculating a first distance between a left boundary of the forward result interval and a left boundary of the reverse result interval, and a second distance between a right boundary of the forward result interval and a right boundary of the reverse result interval; If the first distance or the second distance is less than a preset boundary uniform threshold, the left boundary or the right boundary of the reverse result interval and the positive result interval is corrected, and the corrected positive result interval and the reverse result interval are merged; Otherwise, the fusion is performed directly.

7. A device, characterized in that: include: Memory, used to store programs; A processor, coupled to the memory, is used to execute the program stored in the memory to implement the steps in the sonar image difference area boundary line detection method as described in any one of claims 1 to 5 above.

8. A medium, characterized in that Used to store computer-readable programs or instructions, which, when executed by a processor, can implement the steps of the sonar image difference area boundary line detection method described in any one of claims 1 to 5 above.

Citation Information

Patent Citations

  • Sonar image statistical enhancement algorithm based on boundary constraint

    CN117372827A

  • Underwater sonar image target detection method and device, electronic equipment and storage medium

    CN118115520A