An underwater planar structure sonar image crack quantification method
Through a method of quantifying image cracks of underwater planar structure sonar, including image denoising, enhancement, segmentation extraction and parameter calculation, the problems of low efficiency and subjective results of underwater structure sonar image crack detection in the prior art are solved, and efficient and automated quantification of fracture parameters is achieved.
Patent Information
- Application Number
- CN202310649270.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-02
- Publication Date
- 2025-05-27
- Estimated Expiration
- 2043-06-02
AI Technical Summary
The prior art is difficult to efficiently and automatically quantify crack parameters from sonar images of underwater planar structures, resulting in low detection efficiency and subjective effects.
A method of quantifying cracks from the input sonar image to the output fractures is adopted, including image denoising, enhancement, crack segmentation and extraction, parameter calculation and pixel size conversion steps, to construct a complete process from the input sonar image to the output fracture parameters.
It improves the efficiency and accuracy of crack detection, reduces the loss of image edge details by denoising processing, and enhances the objectivity of detection data.
Smart Images

Figure CN116596911B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of underwater structure detection of bridges, and particularly to a method for quantifying cracks in sonar images of underwater planar structures. Background Art
[0002] The volume of China's transportation infrastructure construction ranks first in the world. The bridge ages of the infrastructure built in the early years are increasing, and the demand for detection is also growing. Underwater planar structures, such as dams and planar bridge piers, are common structures in infrastructure. However, due to their large surface area, they are prone to crack diseases under the influence of external temperature, humidity changes, etc., seriously affecting the safe and stable operation of the project. Moreover, the cracks in underwater structures are hidden below the water surface, making it difficult to detect and posing a huge potential safety hazard. Therefore, detecting cracks in underwater planar structures is of great significance for ensuring the safe operation of underwater structures and extending their service life.
[0003] The attenuation degree of sound waves in water is much lower than that of light waves, and they have good penetration. Sonar has been widely used in the detection of cracks in underwater planar structures due to the characteristics that its imaging is less affected by weak light and turbid water conditions. In previous detections, after using sonar to scan the structure to obtain the crack sonar image, manual measurement and analysis of crack parameters were carried out, which would consume a lot of time, greatly reducing the detection efficiency. Moreover, the measurement results were also affected by the subjectivity of the detection personnel, and the data lacked objectivity. Most crack quantification methods are for optical road surface crack images, and there is currently no complete method for quantifying cracks in sonar images. To improve the intelligent level and detection efficiency, a complete process method from input crack images to output crack parameters is needed to solve the above problems. Summary of the Invention
[0004] In view of this, the purpose of the present invention is to provide a method for quantifying cracks in sonar images of underwater planar structures, which realizes a complete process from input crack sonar images to output crack parameters and improves the crack detection efficiency.
[0005] To achieve the above purpose, the present invention adopts the following technical scheme: A method for quantifying cracks in sonar images of underwater planar structures, comprising the following steps:
[0006] Step 1: Input the original crack sonar image; collect and read the original crack sonar image;
[0007] Step 2: Image denoising; convert the crack sonar image into a grayscale image, and according to the noise characteristics of the sonar image, use the combination of logarithmic transformation and BM3D algorithm to perform denoising processing on the image;
[0008] Step 3: Image Enhancement; Piecewise gray transformation is used to enhance the image, improving the gray contrast between crack features and the background area, facilitating crack segmentation and extraction;
[0009] Step 4: Crack Segmentation and Extraction; The fuzzy C-means clustering (FCM) is used to extract the crack area in the processed crack image, and morphological processing is performed to remove pseudo-cracks in the extracted crack area and fill holes in the cracks; A KD tree for the endpoints of broken cracks is established to connect the broken crack areas, improving the integrity of the cracks and facilitating crack parameter calculation;
[0010] Step 5: Crack Parameter Calculation; The crack area is thinned, the skeleton curve of the crack area is extracted, and the pixel parameters of the crack are calculated based on the area of the crack area and the length of the skeleton curve;
[0011] Step 6: Conversion of Crack Pixel Size; According to the size of the sonar scanning window, the conversion ratio between the pixel size and the actual size is calculated, and the calculated crack pixel parameters are converted into actual crack parameters;
[0012] Step 7: Output of Crack Parameters; Finally, the actual length and average width of the crack are output.
[0013] In a preferred embodiment: In Step 1, the original crack sonar image read is a cropped sonar image containing crack defect features.
[0014] In a preferred embodiment: In Step 2, the image is denoised. First, the sonar image noise is modeled:
[0015] w(x,y) = g(x,y)·n(x,y)
[0016] where g(x,y) is the ideal sonar image signal, n(x,y) is the reverberation noise signal, which follows a Rayleigh distribution with a mean of 1, and w(x,y) is the received real sonar image signal;
[0017] A method combining logarithmic transformation and the BM3D algorithm is used to remove the multiplicative noise in the sonar image; First, logarithmic transformation is used to convert the multiplicative noise with a Rayleigh distribution in the sonar image into additive noise with a Gaussian normal distribution, expressed as:
[0018] ln(w(x,y)) = ln(g(x,y)·n(x,y)) = ln(g(x,y)) + ln(n(x,y))
[0019] Then, the BM3D algorithm is used to denoise the transformed image to obtain the denoised image p(x,y), and finally, the exponential function exp is used to cancel the logarithmic transformation to obtain the final denoised image f(x,y);
[0020] f(x,y) = ep(x,y) .
[0021] In a preferred embodiment: it includes enhancing the image by using piecewise gray-scale transformation in step 3 to improve the contrast of cracks, and its mathematical expression is:
[0022]
[0023] Specifically: according to the gray-scale values of the three characteristic regions of the shadow area, background area, and target area in the crack sonar image, select a1, a2, a 3 as the limit value of gray-scale transformation; the gray-scale value [0, a 1 ) is the crack shadow area of the sonar image. When the crack width is too large, this area exists in the sonar image. Gamma transformation with γ = 0.5 is used for the pixels with gray-scale values in this area, and the transformed gray-scale range is [0, b 1 ), to improve the contrast between the crack shadow area and the background area; the gray-scale value [a 1 , a 2 is the background area of the sonar image. Linear gray-scale transformation is used for the pixels with gray-scale values in this area to compress the gray-scale range of this part of the pixels to [b1, b 2 ; the gray-scale value (a2, a 3 is the crack target area of the sonar image. This area contains the crack characteristics of the sonar image, and this area is stretched to improve the contrast between the target area and the background area; at the same time, after piecewise gray-scale transformation, the sonar image originally concentrated in the gray-scale range of [0, a 3 is transformed into an image with a gray-scale range of [0, 255], expanding the gray-scale range and improving the contrast of the image.
[0024] In a preferred embodiment: in step 4, for crack segmentation and extraction, first use the histogram FCM clustering algorithm to extract the crack area. The process of image segmentation by the histogram FCM algorithm is described as:
[0025] Step1: Set the number of clusters c = 3, the fuzzy index m, m > 1, the iteration termination threshold, and the maximum number of iterations l m , and the number of iterations l = 0;
[0026] Step2: Construct a gray-scale histogram and calculate the number of pixels at each gray level;
[0027] Step3: Initialize the membership matrix and assign a random membership value to each gray level;
[0028] Step4: Calculate the cluster centers according to the membership matrix U and the distance of the data points;
[0029] Step5: Update the membership matrix U based on the current cluster centers and recalculate the cluster centers;
[0030] Step 6: Repeat Step 5 iteratively until the objective function W(U, V) reaches the termination threshold or the maximum number of iterations lm is reached, and then stop the iteration.
[0031] Step 7: Segment the image into different regions according to the membership matrix.
[0032] There are a large number of pseudo-cracks and voids in the segmented image. Therefore, the opening operation is first performed on the segmented crack image, and then the closing operation is performed for morphological processing to eliminate the pseudo-cracks after segmentation and fill the voids in the cracks.
[0033] The opening operation on the image X using the structuring element K is expressed as:
[0034]
[0035] The closing operation on the image X using the structuring element K is expressed as:
[0036]
[0037] Connect the still-fractured cracks after morphological processing to improve the integrity of the cracks. Specifically, by obtaining the minimum convex polygon between the segmented crack regions, the corner points of the crack and the minimum convex polygon are used as endpoints, and the endpoint set is S = {P1, P2, ···, Pi}. Each crack segment has at least two endpoints. At the same time, define the distance matrix L:
[0038]
[0039] where dis(Pi, P j ) is the distance from the pixel point P i to P j .
[0040] The specific process of the crack connection algorithm based on KD is as follows: Take the first point in the set S as the query point U = {P 1}, and the remaining endpoint set V = S - U = {P 2 , P 3 , ···, P i}; Then, according to the elements in the set V, remove the endpoint P i where L(1, i) = 0. Build a KD tree through the remaining endpoints in V, traverse down the tree, and connect the endpoints P j where the distance L(1, j) is less than the threshold through the set threshold. S = S - {P 1 , P j}; Otherwise, S = S - {P 1}, and update U and V; Continue until the number of elements in the set S is 1 or the set is empty, and then end the algorithm.
[0041] In a preferred embodiment: Step 5 includes extracting the crack skeleton curve, calculating the pixel length of the skeleton curve, and calculating the pixel area of the crack region; where:
[0042] The calculation of the pixel length L of the skeleton curve can be expressed as: m represents the number of line segments connecting horizontally adjacent or vertically adjacent pixel points, and n represents the number of line segments connecting diagonally adjacent pixel points; information in different directions is obtained through the convolution kernel, and the number of line segments m and n in different directions of the skeleton curve is obtained; specifically: the number of line segments of pixel points in a certain direction is equal to the number of pixel points with a value not less than 2 after the image pixel points are calculated by the corresponding direction convolution kernels (a)-(d) minus the number of pixel points with a value equal to 2 after being calculated by the corresponding direction convolution kernels (e)-(h); the crack area A is approximately the number of pixel points with a gray value of 1 in the crack segmentation image, and the average crack width is expressed as d m = A / L.
[0043] In a preferred embodiment: Step 6 includes converting the crack pixel parameters into actual crack parameters, specifically: calculating the conversion ratio of the sonar image pixel points to the actual size, and converting the pixel size into the actual size.
[0044] Compared with the prior art, the present invention has the following beneficial effects: The present invention is a method for quantifying cracks in sonar images of underwater planar structures, which constructs a complete process from the input crack sonar image to the output crack parameters, and can obtain crack parameters in a crack sonar image with noise interference. This method greatly reduces the loss of image edge details in the filtering and denoising process, and can extract complete crack targets in relatively blurred images, improving the calculation accuracy of crack length, area, and average width, and improving the objectivity of detection data and the detection efficiency. Description of the Drawings
[0045] Figure 1 It is a flowchart of the method for quantifying cracks in sonar images of underwater planar structures according to the preferred embodiment of the present invention;
[0046] Figure 2 It is the crack sonar image after denoising according to the preferred embodiment of the present invention;
[0047] Figure 3 It is the crack sonar image after image enhancement according to the preferred embodiment of the present invention;
[0048] Figure 4 It is the crack image after segmentation by the FCM algorithm according to the preferred embodiment of the present invention;
[0049] Figure 5 It is the crack image after the processing of opening operation followed by closing operation according to the preferred embodiment of the present invention;
[0050] Figure 6 The crack image after the KD - tree - based crack connection algorithm for the preferred embodiment of the present invention;
[0051] Figure 7 The crack image after the closing operation after crack connection for the preferred embodiment of the present invention;
[0052] Figure 8 Schematic diagram for extracting the crack skeleton curve of the preferred embodiment of the present invention. Detailed implementation manners
[0053] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0054] It should be noted that the following detailed description is exemplary and is intended to provide further illustration of the present application. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which the present application belongs.
[0055] It should be noted that the terms used herein are only for describing specific implementation manners and are not intended to limit the exemplary embodiments according to the present application; as used herein, unless the context clearly indicates otherwise, the singular forms are also intended to include the plural forms. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.
[0056] Please refer to Figure 1-8 , a method for quantifying cracks in sonar images of underwater planar structures improved in this embodiment, includes the following steps:
[0057] Step 1: Input the original crack sonar image;
[0058] In this embodiment, first, the crack sonar image of the underwater planar structure is collected, the crack targets in the image are cropped out, and the image is converted into a grayscale image to improve the calculation speed.
[0059] Step 2: Image denoising;
[0060] In this embodiment, reverberation noise is the main noise source in the crack sonar image. Reverberation noise is a multiplicative speckle noise that conforms to the Rayleigh distribution. Therefore, first, the noise of the sonar image is modeled:
[0061] w(x,y) = g(x,y)·n(x,y)
[0062] Among them, g(x, y) is the ideal sonar image signal, n(x, y) is the reverberation noise signal, which follows a Rayleigh distribution with a mean of 1, and w(x, y) is the received real sonar image signal.
[0063] In this embodiment, a method combining logarithmic transformation and BM3D algorithm is used to remove the multiplicative noise in the sonar image. First, the logarithmic transformation is used to convert the multiplicative noise with a Rayleigh distribution in the sonar image into additive noise with a Gaussian normal distribution, which can be expressed as:
[0064] ln(w(x, y)) = ln(g(x, y)·n(x, y)) = ln(g(x, y)) + ln(n(x, y))
[0065] Then, the BM3D algorithm is used to denoise the transformed image to obtain the denoised image p(x, y). Finally, the exponential function exp is used to cancel the logarithmic transformation to obtain the final denoised image f(x, y), as Figure 2 shown;
[0066] f(x, y) = e p(x,y)
[0067] Step 3: Image enhancement;
[0068] In this embodiment, piecewise gray-scale transformation is used to enhance the image and improve the contrast of the cracks. Its mathematical expression is:
[0069]
[0070] In the formula, a 1 is the limit value of the black area, and its value is set to 10; a 2 is the gray value of the image background area, and its value is set to 45; a 3 is the maximum gray value of the pixel points existing in the original gray-scale image; b 1 is the mapping value of a 1 , which is consistent with a 1 , and its value is set to 10; b 2 is the mapping value of a 2 , and to compress this part of the gray area, its value is set to 25. The sonar crack image is enhanced by compressing the background gray area and stretching the target area, as Figure 3 shown. The crack features in the enhanced image are more obvious, and the overall brightness of the image increases, which is helpful for subsequent extraction of cracks.
[0071] Step 4: Crack segmentation and extraction;
[0072] In this embodiment, for crack segmentation and extraction, the histogram FCM clustering algorithm is first used to extract the crack area. The process of the histogram FCM algorithm for image segmentation can be described as follows: Step 1: Set the number of clusters c = 3, the fuzzy exponent m (m > 1, and in this paper, m = 2 is taken according to experience), the iteration termination threshold, and the maximum number of iterations l m , and the number of iterations l = 0; Step 2: Calculate the gray histogram of the component and calculate the number of pixels at each gray level; Step 3: Initialize the membership matrix and assign a random membership value to each gray level; Step 4: Calculate the cluster centers according to the membership matrix U and the distance of the data points; Step 5: Update the membership matrix U based on the current cluster centers and recalculate the cluster centers; Step 6: Repeat Step 5 and iterate continuously until the objective function W(U, V) reaches the termination threshold or reaches the maximum number of iterations l m , stop the iteration; Step 7: Segment the image into different regions according to the membership matrix. As Figure 4 shown.
[0073] In this embodiment, the segmented image contains a large number of pseudo-cracks and voids. Therefore, the opening operation is first performed on the segmented crack image, and then the closing operation is performed for morphological processing to eliminate the pseudo-cracks after segmentation and fill the voids in the cracks. As Figure 5 shown.
[0074] The opening operation on the image X using the structuring element K can be expressed as:
[0075]
[0076] The closing operation on the image X using the structuring element K can be expressed as:
[0077]
[0078] In this embodiment, a circular structuring element K with a radius of 2 is used.
[0079] In this embodiment, the cracks that are still broken after morphological processing are connected to improve the integrity of the cracks. Specifically, by obtaining the minimum convex polygon between the segmented crack regions, taking the corner points of the cracks and the minimum convex polygon as endpoints, and the endpoint set is S = {P 1 , P 2 , ···, P i}, each crack has at least two endpoints, and at the same time, the distance matrix L is defined:
[0080]
[0081] In the formula, dis(P i , P j ) is the pixel point Pi Distance to P j .
[0082] The specific process of the KD-based crack connection algorithm is as follows: (1) Take the first point in the set S as the query point U = {P 1}, and the remaining endpoint set V = S - U = {P 2 , P 3 , ···, P i}. Then, according to the elements in the set V, remove the endpoint P i where L(1, i) = 0. Construct a KD tree through the remaining endpoints in V, traverse down the tree, and connect the endpoints P j whose distance L(1, j) is less than the threshold through the set threshold. S = S - {P 1 , P j}; otherwise, S = S - {P 1}, and update U and V. Continue until the number of elements in the set S is 1 or the set is empty, and then end the algorithm. In this embodiment, the threshold is set to 9.
[0083] In this embodiment, as Figure 6 shown, after the crack connection algorithm calculation, the endpoints with the distance between adjacent crack endpoints less than the threshold are connected by line segments. To improve the integrity of the cracks, closing operation is used to form complete cracks from the connected cracks, achieving the extraction of the complete crack target, as Figure 7 shown.
[0084] Step 5: Crack parameter calculation;
[0085] In this embodiment, as Figure 8 shown, first extract the crack skeleton, and then calculate the length of the skeleton curve to represent the crack length. The pixel length L of the skeleton curve can be expressed as m represents the number of line segments connecting horizontally adjacent or vertically adjacent pixel points, and n represents the number of line segments connecting diagonally adjacent pixel points. Information in different directions is obtained through the convolution kernel, and the number of line segments m and n in different directions of the skeleton curve is obtained. Specifically: the number of line segments of pixel points in a certain direction is equal to the number of pixel points with a value not less than 2 after the image pixel points are calculated by the corresponding direction convolution kernels (a)-(d) minus the number of pixel points with a value equal to 2 after being calculated by the corresponding direction convolution kernels (e)-(h).
[0086]
[0087] In this embodiment, after calculation, the pixel length L of the skeleton curve is 101.31.
[0088] In this embodiment, the crack area A is approximately the number of pixel points with a gray value of 1 in the crack segmentation image, A = 335, then the average pixel width d of the crackm = A / L = 335 / 101.31 = 3.31.
[0089] Step 6: Conversion of crack pixel size;
[0090] In this embodiment, the crack image is collected when the radius of the scanning window is 3 m. The number of pixels corresponding to this radius in the image is 547. Therefore, the actual size represented by each pixel is approximately 5.48 mm. After conversion, the actual average width of this crack is 18.12 mm, while the width measured manually is 16 mm, and the quantification result is relatively accurate.
[0091] Step 7: Output of crack parameters;
[0092] In this embodiment, the output crack parameters are: the actual length of the crack is 555.18 mm, and the actual average width of the crack is 18.12 mm.
Claims
1. An underwater planar structure sonar image crack quantification method, characterized in that, it includes the following steps: Step 1: Input the original crack sonar image; collect and read the original crack sonar image; Step 2: Image denoising; convert the crack sonar image into a grayscale image, and according to the characteristics of sonar image noise, use the combination of logarithmic transformation and BM3D algorithm to denoise the image; Step 3: Image enhancement; use piecewise gray-level transformation to enhance the image, improve the gray-scale contrast between crack features and background areas, and facilitate crack segmentation and extraction; Step 4: Crack segmentation and extraction; use fuzzy C-means clustering FCM to extract the crack area in the processed crack image, and remove pseudo-cracks in the extracted crack area and fill holes in the cracks through morphological processing; Build a KD tree for the endpoints of broken cracks, connect the broken crack areas, improve the integrity of the cracks, and facilitate crack parameter calculation; Step 5: Crack parameter calculation; refine the crack area, extract the skeleton curve of the crack area, and calculate the pixel parameters of the crack according to the area of the crack area and the length of the skeleton curve; Step 6: Crack pixel size conversion; according to the size of the sonar scanning window, calculate the conversion ratio between pixel size and actual size, and convert the calculated crack pixel parameters into actual crack parameters; Step 7: Output crack parameters; finally output the actual length and average width of the crack.
2. The underwater planar structure sonar image crack quantification method according to claim 1, characterized in that: In step 1, the read original crack sonar image is a cropped sonar image containing crack defect features.
3. The underwater planar structure sonar image crack quantification method according to claim 1, characterized in that: In step 2, when denoising the image, first model the sonar image noise: w(x,y) = g(x,y)·n(x,y) where g(x,y) is the ideal sonar image signal, n(x,y) is the reverberation noise signal, which follows a Rayleigh distribution with a mean of 1, and w(x,y) is the received real sonar image signal; Use the combination of logarithmic transformation and BM3D algorithm to remove the multiplicative noise in the sonar image; first use logarithmic transformation to convert the multiplicative noise with Rayleigh distribution in the sonar image into additive noise with Gaussian normal distribution, expressed as: ln(w(x,y)) = ln(g(x,y)·n(x,y)) = ln(g(x,y)) + ln(n(x,y)) Then use the BM3D algorithm to denoise the converted image to obtain the denoised image p(x,y), and finally use the exponential function exp to cancel the logarithmic transformation to obtain the final denoised image f(x,y); f(x,y) = e p(x,y) .
4. The underwater planar structure sonar image crack quantification method according to claim 1, characterized in that: Including using piecewise gray-level transformation to enhance the image in step 3 to improve the contrast of the crack, and its mathematical expression is: Specifically: according to the gray values of the three characteristic regions, namely the shadow region, the background region, and the target region, in the crack sonar image, select a 1 , a 2 , a 3 as the limit value for gray-scale transformation; the gray value range [0, a 1 ) is the crack shadow region of the sonar image. When the crack width is too large, this region exists in the sonar image. Gamma transformation with γ = 0.5 is applied to the pixels with gray values in this region, and the transformed gray range is [0, b 1 ), to improve the contrast between the crack shadow region and the background region; the gray value range [a 1 , a 2 is the background region of the sonar image. Linear gray-scale transformation is applied to the pixels with gray values in this region to compress the gray range of these pixels to [b 1 , b 2 ; the gray value range (a 2 , a 3 is the crack target region of the sonar image. This region contains the crack characteristics of the sonar image. Stretch this region to improve the contrast between the target region and the background region; at the same time, after segmented gray-scale transformation, the sonar image originally concentrated in the gray range [0, a 3 is transformed into an image with a gray range of [0, 255], expanding the gray range and improving the contrast of the image.
5. The underwater planar structure sonar image crack quantification method according to claim 1, characterized in that: In Step 4, for crack segmentation and extraction, the histogram FCM clustering algorithm is first used to extract the crack region. The process of the histogram FCM algorithm for image segmentation is described as follows: Step 1: Set the number of clusters \(c = 3\), the fuzzy index \(m\), where \(m>1\), the iteration termination threshold, and the maximum number of iterations \(l\). m , and the number of iterations \(l = 0\). Step2: Component gray histogram, calculate the number of pixels for each gray level; Step3: Initialize the membership matrix, assign a random membership value to each gray level; Step4: Calculate the cluster centers based on the membership matrix U and the distance of data points; Step5: Update the membership matrix U based on the current cluster centers and recalculate the cluster centers; Step 6: Repeat Step 5 iteratively until the objective function W(U, V) reaches the termination threshold or the maximum number of iterations l is reached, m and stop the iteration. Step7: Segment the image into different regions according to the membership matrix; The segmented image contains a large number of pseudo-cracks and voids. Therefore, for the segmented crack image, morphological processing is first performed using opening operation and then closing operation to eliminate the pseudo-cracks after segmentation and fill the voids in the cracks; The opening operation on image X using structuring element K is expressed as: The closing operation on image X using structuring element K is expressed as: Connect the cracks that are still broken after morphological processing to improve the integrity of the cracks; specifically, by obtaining the minimum convex polygon between the segmented crack regions, and taking the corner points of the crack and the minimum convex polygon as endpoints, the endpoint set is S = {P 1 , P 2 , ···, P i}, and each crack has at least two endpoints. At the same time, define the distance matrix L: where dis(P i , P j ) is the distance from pixel point P i to P j ; The specific process of the KD-based crack connection algorithm is as follows: Take the first point in the set S as the query point U = {P 1}, and the remaining endpoint set V = S - U = {P 2 , P 3 , ···, P i}; then remove the endpoint P i where L(1, i) = 0 according to the elements in the set V, construct a KD tree through the remaining endpoints in V, traverse down the tree, and connect the endpoints P j whose distance L(1, j) is less than the threshold through the set threshold, S = S - {P 1 , P j}; otherwise, S = S - {P 1}, update U and V; until the number of elements in the set S is 1 or the set is empty, end the algorithm.
6. A method for quantifying cracks in sonar images of underwater planar structures according to claim 1, characterized in that: Step 5 includes extracting the crack skeleton curve, calculating the pixel length of the skeleton curve, and calculating the pixel area of the crack region; where: The calculation of the pixel length L of the skeleton curve can be expressed as: m represents the number of line segments connecting horizontally adjacent or vertically adjacent pixel points, and n represents the number of line segments connecting diagonally adjacent pixel points; information in different directions is obtained through the convolution kernel to obtain the number of line segments m and n in different directions of the skeleton curve; specifically: the number of line segments of pixel points in a certain direction is equal to the number of pixel points with a value not less than 2 after the image pixel points are calculated by the corresponding direction convolution kernels (a)-(d) minus the number of pixel points with a value equal to 2 after being calculated by the corresponding direction convolution kernels (e)-(h); the area A of the crack region is approximately the number of pixel points with a gray value of 1 in the crack segmentation image, and the average width of the crack is expressed as d m = A / L.
7. A method for quantifying cracks in sonar images of underwater planar structures according to claim 1, characterized in that: Step 6 includes converting the crack pixel parameters into actual crack parameters, specifically: calculating the conversion ratio of the sonar image pixel points to the actual size, and converting the pixel size into the actual size.