A target detection method based on sonar images
By performing image addition, denoising, clustering and screening of sonar images of underwater operation vehicles, the serious problem of sonar image noise in underwater environments is solved, and high-accurate underwater target detection and obstacle avoidance navigation are achieved.
Patent Information
- Application Number
- CN202111280253.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-29
- Publication Date
- 2025-06-24
- Estimated Expiration
- 2041-10-29
AI Technical Summary
During underwater navigation, underwater operation vehicles are affected by factors such as water flow disturbances and foreign matter interference, resulting in serious sonar image noise and cannot directly obtain accurate image perception data, which in turn affects the accuracy of target detection.
A target detection method based on sonar image is adopted, through real-time acquisition of sonar images, image addition operation, median filtering algorithm denoising, binary processing, density clustering, area screening and rectangular direction aspect ratio calculation, and the target object area is gradually screened.
It effectively reduces sonar image noise and improves the accuracy of underwater environment perception. It is suitable for situations where there is a lot of underwater noise, avoids missed detection problems when processor performance is insufficient, and realizes the functions of underwater obstacle avoidance navigation and target detection.
Smart Images

Figure CN113989674B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a target detection method based on sonar images, which is mainly applied to obstacle avoidance navigation and target detection of underwater unmanned vehicles. Background Art
[0002] When an underwater operation vehicle performs an underwater operation task, it needs to perceive the surrounding environment. A multi-beam forward-looking sonar can detect the forward fan-shaped area. However, due to factors such as water flow disturbance and foreign object interference, especially in working conditions near the bottom, near the water surface, and near the shore, the reverberation and sidelobe effects are serious, resulting in serious noise in the sonar image and it is impossible to directly obtain relatively accurate image perception data. Therefore, it is easy to misjudge when only processing a single picture, and processing each picture will easily increase the pressure on the processor. Summary of the Invention
[0003] In order to improve the perception effect of an underwater operation vehicle on the surrounding environment and then perform underwater operations, to solve the above problems, a target detection method based on sonar images is provided.
[0004] The purpose of the present invention is achieved in the following way:
[0005] A target detection method based on sonar images, the detection method includes the following steps:
[0006] S1: Obtain sonar images in real time, take at least four consecutive sonar images, and perform image addition operation on them;
[0007] S2: Use the median filtering algorithm to denoise the image after the addition operation, and perform binarization processing with the pixel mean value of the sonar image as the threshold;
[0008] S3: Perform density clustering on the binarized image to obtain several connected regions;
[0009] S4: Calculate the area of the connected region, and screen the connected region through a set threshold, that is, the suspected target region;
[0010] S5: Solve the direction and aspect ratio of the circumscribed rectangle of the suspected target region, and obtain the final target object region through a set threshold.
[0011] Further, in S1, it includes:
[0012] During the navigation of the vehicle, the grayscale images sequentially generated by the forward-looking sonar are sequentially recorded as
[0013] M1, M2, M3, …, M s ,
[0014] Take four consecutive pictures M 4k+1 , M 4k+2,M 4k+3 ,M 4k+4 (k = 0, 1, 2…, and 4k + 4 ≤ s) perform image addition operation, M = (M 4k+1 + M 4k+2 + M 4k+3 + M 4k+4 ) / 4; in the above formula, M s represents the generated grayscale image matrix, and M represents the image matrix after performing the image addition operation.
[0015] Furthermore, in S2, it includes:
[0016] Use the median filtering algorithm to denoise M obtained by adding four consecutive images, and then calculate the pixel mean
[0017]
[0018] where m and n represent that the image matrix has m rows and n columns, and t ij represents the pixel value at the i-th row and j-th column;
[0019] Using T as the threshold, perform binary processing on M obtained by adding four consecutive images, record the pixel positions where the pixel values are greater than T during the binary processing, and denote it as the sample set
[0020] D = {x1, x2, …, x m},
[0021] where x i = (x i1 , x i2 ), and the position it represents is the x i1 -th row and x i2 -th column, and in x i i = 1, 2, …, m.
[0022] Furthermore, in S3, it includes:
[0023] Adopt the DBSCAN density clustering algorithm to divide the sample set D into k non-overlapping clusters, denoted as
[0024] {G l | l = 1, 2, …, k},
[0025]
[0026] Then the cluster
[0027]
[0028] Furthermore, S4 includes:
[0029] Take the cluster G l as the new sample set G l, the number of elements is d l , d l is the area of the connected region and satisfies
[0030]
[0031] Set thresholds d1 and d2, and those satisfying d1 ≤ d l ≤ d2 are regarded as suspected target regions, where m is the number of elements x i in the sample set D
[0032] Furthermore, the S5 includes: calculating the sample set using principal component analysis First, centralize the sample set G l :
[0033]
[0034] Calculate the sample covariance matrix XX T ,
[0035] Find the covariance matrix XX T to obtain eigenvalues λ1 and λ2,
[0036] and find the corresponding eigenvectors α1 and α2 of the eigenvalues;
[0037] If λ1 ≥ λ2, the main direction is α1, and the aspect ratio of the outer rectangle is regarded as λ1 / λ2; otherwise, the main direction is α2, and the aspect ratio of the outer rectangle is λ2 / λ1;
[0038] For spherical targets, the main direction presented by the sonar image should be basically perpendicular to the radius direction, and the aspect ratio is set according to the actual application situation;
[0039] The radius direction vector can be expressed as:
[0040]
[0041] where x0 represents the position of the sonar in the image;
[0042] Use θ to represent the threshold after the dot product of the main direction and the radius, and use γ1 and γ2 to represent the upper and lower limits of the aspect ratio threshold. Then, the main direction and aspect ratio of the target object that meet the requirements can be expressed as:
[0043]
[0044] That is, those meeting the above conditions are target regions, otherwise they are not.
[0045] Advantages of the present invention: The present invention can guide the vehicle to perceive the surrounding environment through sonar images during underwater navigation, is applicable to sonar image processing in the case of more underwater noise, and at the same time solves the defect of easy missed detection when the processor performance is insufficient. Enabling the vehicle to perform effective underwater obstacle avoidance navigation and achieve the target detection function. Brief Description of the Drawings
[0046] Figure 1 is the flowchart of the method of the present invention.
[0047] Figure 2 are four consecutive sonar images of the present invention.
[0048] Figure 3 is a schematic diagram of the area where the target object finally detected by the present invention is located. Detailed Embodiments
[0049] The present invention will be further described in detail below in conjunction with the drawings and specific embodiments.
[0050] It should be noted that the following detailed descriptions are all exemplary and are intended to provide further descriptions of the present application. Unless otherwise specified, all technical and scientific terms used herein have the same technical meanings as those commonly understood by those of ordinary skill in the technical field to which the present application belongs.
[0051] A method for detecting a target in a sonar image, the detection method comprising the following steps:
[0052] S1: Obtain sonar images in real time, take four consecutive sonar images, and perform image addition operation on them;
[0053] S2: Denoise the image after the addition operation by using the median filtering algorithm for the sonar image, and perform binarization processing with the average value of the sonar image pixels as the threshold;
[0054] S3: Perform density clustering on the binarized image to obtain several connected regions;
[0055] S4: Calculate the area of the connected region, and screen the connected region through a set threshold, that is, the suspected target region;
[0056] S5: Solve the direction and aspect ratio of the circumscribed rectangle of the suspected target region, and obtain the final target object region through a set threshold.
[0057] 1. During the navigation of the vehicle, the gray-scale images successively generated by the forward-looking sonar are successively denoted as
[0058] M1, M2, M3,..., M s ,
[0059] Take four consecutive pictures M 4k+1 , M4k+2 , M 4k+3 , M 4k+4 (k = 0, 1, 2…, and 4k + 4 ≤ s) perform image addition operation,
[0060] M = (M 4k+1 + M 4k+2 + M 4k+3 + M 4k+4 ) / 4;
[0061] In the above formula, M s represents the generated grayscale image matrix, and M represents the image matrix after image addition operation.
[0062] Calculate the pixel mean after denoising the M obtained by adding four consecutive images using the median filtering algorithm
[0063]
[0064] where m and n represent that the image matrix has m rows and n columns, and t ij represents the pixel value at the i-th row and j-th column;
[0065] Using T as the threshold, perform binary processing on the M obtained by adding four consecutive images, record the pixel positions where the pixel values are greater than T during the binary processing, and denote it as the sample set
[0066] D = {x1, x2,…, x m}
[0067] where x i = (x i1 , x i2 ), and the position represented is the x i1 -th row and x i2 -th column, and i = 1, 2,…, m in x i .
[0068] 2. Next, use the DBSCAN density clustering algorithm to divide the sample set D into k non-overlapping clusters, denoted as
[0069] {G l | l = 1, 2,…, k},
[0070] where
[0071] then the cluster
[0072] G l = {x l1 , x l2 ,…, x ldl}.
[0073] 3. Take the cluster G l as the new sample set Gl , the number of elements is d l . d l is the area of the connected region and satisfies
[0074]
[0075] Set thresholds d1 and d2, and those satisfying d1 ≤ d l ≤ d2 are regarded as suspected target regions, where m is the number of elements x i in the sample set D. If the condition is met, execute step 5; otherwise, return to step 1 and continue to calculate the next group of four pictures.
[0076] 4. Use principal component analysis to calculate the sample set G l = {x l1 , x l2 , …, x ldl}. First, centralize the sample set G l :
[0077]
[0078] Calculate the sample covariance matrix XX T ,
[0079] Find the covariance matrix XX T to obtain eigenvalues λ1 and λ2,
[0080] and the corresponding eigenvectors α1 and α2 of the eigenvalues;
[0081] If λ1 ≥ λ2, the main direction is α1, and the aspect ratio of the outer rectangle is regarded as λ1 / λ2; otherwise, the main direction is α2, and the aspect ratio of the outer rectangle is λ2 / λ1 (for simplicity of explanation, below it is regarded as λ1 ≥ λ2, that is, the main direction is α1, and the aspect ratio of the outer rectangle is λ1 / λ2).
[0082] For spherical targets, the main direction presented by the sonar image should be basically perpendicular to the radius direction, and the aspect ratio is set according to the actual application situation.
[0083] The radius direction vector can be expressed as:
[0084]
[0085] where x0 represents the position of the sonar in the image.
[0086] Use θ to represent the threshold after the dot product of the main direction and the radius, and use γ1 and γ2 to represent the upper and lower limits of the aspect ratio threshold. Then, the main direction and aspect ratio satisfying the target object can be expressed as:
[0087]
[0088] That is, the area that meets the above conditions is the target area, otherwise it is not.
[0089] The present invention provides a target detection method based on sonar images. The method flow is as Figure 1 shown. During the underwater navigation of the vehicle, a metal spherical target in front is recognized. Four consecutive sonar images are obtained by the forward-looking sonar, as Figure 2 shown. First, perform an image addition operation on the four sonar images; then use the median filtering algorithm to denoise the sonar images, and perform binary processing with the mean value of the sonar image pixels as the threshold; secondly, based on the DBSCAN density clustering algorithm, segment the connected regions of the image, calculate the area of the segmented connected regions, and make a preliminary judgment; then calculate the main direction and the aspect ratio of the outer rectangle of the connected regions that meet the preliminary judgment conditions, and use the threshold for re-judgment; finally, detect the target object and obtain the area where the target object is located, as Figure 3 shown.
[0090] Although the specific implementation manners of the present invention are described above in conjunction with the accompanying drawings, it is not a limitation on the protection scope of the present invention. Those skilled in the art should understand that, based on the technical solutions of the present invention, various modifications or deformations that can be made by those skilled in the art without creative efforts are still within the protection scope of the present invention.
Claims
1. A target detection method based on sonar images, characterized in that: The detection method includes the following steps: S1: Obtain sonar images in real time, take at least four consecutive sonar images, and perform image addition operation on them; S2: Use the median filtering algorithm to denoise the image after the addition operation, and perform binarization processing with the average value of the sonar image pixels as the threshold; S3: Perform density clustering on the binarized image to obtain several connected regions; S4: Calculate the area of the connected regions, and screen the connected regions through a set threshold, that is, the suspected target regions; S5: Solve the direction and aspect ratio of the circumscribed rectangle of the suspected target region, and obtain the final target object region through a set threshold; The S5 includes: calculating the sample set G by using principal component analysis l ={x l1 ,x l2 ,…,x ldl}, first centralizing the sample set G l : Calculate the sample covariance matrix XX T , Find the covariance matrix XX T Calculate the eigenvalues λ1, λ2 Find the eigenvectors α1 and α2 corresponding to the eigenvalues; If λ1≥λ2, the main direction is α1, and the aspect ratio of the outer rectangle is regarded as λ1 / λ2, otherwise the main direction is α2, and the aspect ratio of the outer rectangle is λ2 / λ1; For a spherical target, the main direction presented by the sonar image should be basically perpendicular to the radius direction, and the aspect ratio is set according to the actual application situation; The radius direction vector can be expressed as: where x0 represents the position of the sonar in the image; Use θ to represent the threshold after the dot product of the main direction and the radius, and use γ1 and γ2 to represent the upper and lower limits of the aspect ratio threshold. Then, the main direction and aspect ratio that meet the target object can be expressed as: That is, the one that meets the above conditions is the target region, otherwise it is not.
2. The method for target detection based on sonar images according to claim 1, characterized in that: In S1, it includes: During the navigation of the vehicle, the grayscale images sequentially generated by the forward-looking sonar are sequentially denoted as M1, M2, M3, …, M s , Take four consecutive pictures M 4k+1 , M 4k+2 , M 4k+3 , M 4k+4 (k = 0, 1, 2…, and 4k + 4 ≤ s) perform image addition operations M = (M 4k+1 + M 4k+2 + M 4k+3 + M 4k+4 ) / 4; In the above formula, M s represents the generated grayscale image matrix, and M represents the image matrix after performing image addition operation.
3. The method for target detection based on sonar images according to claim 1, characterized in that: In S2, it includes: Denoise M obtained by adding four consecutive images using the median filtering algorithm and then calculate the pixel average value where m and n represent that the image matrix has m rows and n columns, and t ij represents the pixel value at the i-th row and j-th column; Using T as the threshold, perform binarization processing on M obtained by adding four consecutive images, record the pixel positions where the pixel values are greater than T during the binarization process, and denote it as the sample set D = {x1, x2, …, x m}, where x i =(x i1 , x i2 ), and the position represented is the x i1 -th row and the x i2 -th column. In x i , i = 1, 2,..., m.
4. The method for target detection based on sonar images according to claim 3, wherein: In S3, it includes: Using the DBSCAN density clustering algorithm, the sample set D is divided into k disjoint clusters, denoted as {G l | l = 1, 2, …, k}, Then the cluster 5. The method for target detection based on sonar images according to claim 4, wherein: S4 includes: Take the cluster G l as the new sample set G l , with the number of elements being d l , where d l is the area of the connected region and satisfies Set threshold values d1 and d2 such that those satisfying d1 ≤ d l ≤ d2 are regarded as suspected target regions, where m is the number of elements x i in the sample set D.
Citation Information
Patent Citations
Event detection system based on sound waves and detection method
CN108229402A
Side-scan sonar image target identification method
CN111476809A