A method for calculating the length of a tunnel lining crack disease

By refining tunnel lining cracks through semantic segmentation and the A* algorithm, and combining the crack length with clustering algorithm, the problem of low efficiency and poor accuracy in manually identifying tunnel lining crack defects is solved, and efficient and accurate automated detection is achieved.

CN116664497BActive Publication Date: 2026-03-31CHONGQING INST OF SURVEYING & MAPPING SCI & TECH (CHONGQING MAP COMPILATION CENT) +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-10
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

In existing technologies, the detection of tunnel lining cracks relies on manual judgment, which is highly subjective, inefficient, and inaccurate, making it difficult to guarantee the reliability and completeness of the detection results.

Method used

A semantic segmentation model is used to process tunnel crack images. Morphological operations and endpoint search algorithms are used to distinguish crack connected components. The crack skeleton is refined by combining the A* algorithm, and the crack length is calculated by clustering algorithm to achieve automated detection.

Benefits of technology

It improves the efficiency and accuracy of tunnel lining crack detection, reduces the subjectivity of manual judgment, and ensures the integrity and reliability of the detection results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116664497B_ABST
    Figure CN116664497B_ABST
Patent Text Reader

Abstract

The application discloses a tunnel lining crack disease length calculation method, which comprises the following steps: carrying out binaryzation processing on a crack semantic segmentation mask and carrying out a morphological closing operation; searching crack endpoints based on each segmentation connected domain, distinguishing cross cracks from regular cracks, and refining and extracting crack skeletons based on an astar algorithm; carrying out clustering calculation based on each refined crack skeleton endpoint, integrating skeleton information belonging to the same crack; and calculating the length of the crack skeleton after distinguishing instances. The data source of the application is a semantic segmentation mask image of a tunnel apparent crack disease detected by a semantic segmentation model, the crack is refined and extracted based on a post-processing operation, the instance of the crack is distinguished based on an endpoint clustering algorithm, the length of the crack is accurately calculated, and the working efficiency is greatly improved compared with the existing disease identification and measurement relying on manual operation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of tunnel defect detection technology, and in particular to a method for detecting tunnel lining defects. Background Technology

[0002] During the service life of a tunnel, due to factors such as construction quality, geological conditions, and operational years, tunnels often develop defects such as lining cracks and water leakage. Lining defects reduce the effective thickness of the lining structure, seriously affecting the safety, stability, and durability of the project. Therefore, the detection of tunnel defects is unavoidable in the daily maintenance of tunnels, and establishing an effective mechanism for the detection and identification of tunnel lining defects is of great significance.

[0003] Currently, the detection of tunnel cracks relies on manual judgment, which is highly subjective, has poor traceability, makes it difficult to guarantee the accuracy and completeness of the detection results, and has the disadvantages of low efficiency and low safety. Summary of the Invention

[0004] In view of this, the purpose of this invention is to provide a method for calculating the length of tunnel lining cracks, so as to solve the technical problems of high subjectivity, low efficiency and low accuracy in manually judging tunnel cracks.

[0005] The method for calculating the length of tunnel lining cracks in this invention includes the following steps:

[0006] 1) After processing the original crack image with a semantic segmentation model, a crack segmentation mask is obtained. The crack segmentation mask is then binarized, and then dilation and erosion are performed sequentially based on morphological closure operations to repair the minor fractures in the crack segmentation results.

[0007] 2) Distinguish the connected components of each crack segmentation mask using a morphological connected component algorithm, and search for the endpoints of each connected component using an endpoint search algorithm; the endpoint search algorithm includes the following steps:

[0008] The first step is to extract the bounding box based on the connected component mask information. Starting from the four vertices of the bounding box, search along the x and y directions at distances of w / 2 and h / 2 respectively, where w is the width of the bounding box and h is the height of the bounding box. Search for the mask pixels that touch the bounding box, i.e., the touch points, and use the searched touch points as endpoints. If there are multiple adjacent touch points, select the middle point as the endpoint.

[0009] The second step involves searching for two endpoints (x1, y1) and (x2, y2) starting from the same vertex. The straight-line distance between the two points is calculated, and the shortest path distance between them is calculated using the Astar pathfinding algorithm. The rules for retaining the final boundary point are as follows:

[0010]

[0011] L Astar Given the shortest distance between the two endpoints (x1, y1) and (x2, y2);

[0012] 3) Differentiate between intersecting cracks and regular cracks, and refine the crack skeleton based on the ASTAR algorithm:

[0013] The endpoints of each connected component obtained from the search are classified and processed. The masked connected components with only two endpoints are identified as regular cracks, and the skeleton of the regular cracks is directly extracted based on the ASTAR pathfinding algorithm.

[0014] For a masked connected component with three endpoints, further determine the crack type. The specific determination rules are as follows: Use the ASTAR pathfinding algorithm to search for the shortest paths between each pair of the three endpoints, and sort them according to their lengths, denoted as L. max L mid L min Using the lengths L of the three paths max L mid L min The relationship between the cracks determines the crack morphology, such as the formula. As shown, if L max Approximately equal to L mid With L min The sum of these values ​​indicates a regular crack, and the longest path L is selected. max A crack skeleton is defined as a crack; otherwise, it is determined to be an intersecting crack.

[0015] The process for handling intersecting cracks is as follows: Determine the intersection point of the intersecting cracks; if path L... max L mid L min If three paths share a common intersection point, that intersection point is called the intersection point. If the three paths do not share a common intersection point, then an intersection point search is performed by traversing the shortest path L. min The search range is determined by using the traversed point as the center and the width of the crack connected region as the radius. If points on the other two paths exist simultaneously within the search range, then the traversed point is taken as the intersection point. The formula for calculating the width of the crack connected region is as follows:

[0016]

[0017] Among them, P i This indicates whether pixel i belongs to the current connectivity threshold; it is 1 if it does, and 0 otherwise.

[0018] After obtaining the intersection point based on the above algorithm, the ASTAR pathfinding algorithm is used to search for the shortest path between the three endpoints and the intersection point to obtain the skeleton of the intersection crack.

[0019] The refined crack skeleton extracted above is a polyline with a width of 1 pixel;

[0020] 4) Clustering calculations are performed based on the endpoints of each refined crack skeleton to integrate crack skeletons belonging to the same crack; the clustering calculation steps are as follows:

[0021] ① Traverse all endpoints and find the endpoint with the shortest distance that is less than the first judgment distance to form a paired endpoint; the first judgment distance is a set value.

[0022] ② Identify whether each pair of paired endpoints is a normal endpoint or an interleaved endpoint;

[0023] ③ If the two paired endpoints are ordinary endpoints, then connect these two ordinary endpoints with a straight line, thereby integrating the two crack skeletons to which these two ordinary endpoints belong into one crack skeleton.

[0024] If the two paired endpoints are staggered endpoints, further judgment is made based on the second judgment distance, which is a set value. If the distance between the two staggered endpoints is less than the second judgment distance, the two crack skeletons to which these two staggered endpoints belong are judged to be skeletons belonging to the same crack region, but no connection operation is performed on these two staggered endpoints.

[0025] If the distance between two intersecting endpoints is greater than the second determination distance, then the two crack skeletons to which these two intersecting endpoints belong are determined to be two different crack regions, and crack skeleton integration is not performed.

[0026] 5) Calculate the length of the crack skeleton. Calculate the distance between adjacent pixels on the skeleton. The distance between adjacent pixels horizontally on the skeleton is 1, the distance between adjacent pixels vertically on the skeleton is 1, and the distance between adjacent pixels diagonally on the skeleton is 1.4. Add up the distances between all pixels on the skeleton to get the length of the crack skeleton.

[0027] Furthermore, in step ②, the method for identifying whether each pair of paired endpoints is a normal endpoint or an interleaved endpoint is as follows:

[0028] Assume the endpoints of the paired group are po1 and po2, and their respective crack skeletons are L1 and L2, where the length of the L1 skeleton is greater than that of the L2 skeleton. A bounding box is extracted based on the crack skeleton L1, and the judgment direction is determined according to the bounding box coordinates. If the width of the bounding box is greater than its height, the x-direction is used for judgment; otherwise, the y-direction is used. If the judgment direction is x, the x-coordinates of n points along skeleton L1 starting from po1 are taken to form list 1. Simultaneously, the x-coordinates of n points along skeleton L2 starting from po2 are taken to form list 2. If the two lists contain the same element, the two cracks have an overlapping area, and the endpoints of the paired group are overlapping endpoints; otherwise, they are ordinary endpoints. When the judgment direction is y, the y-coordinates on the crack skeleton are taken for judgment according to the above judgment rules.

[0029] The beneficial effects of this invention are:

[0030] The present invention provides a method for calculating the length of tunnel lining cracks. The data source is a semantic segmentation mask image of the apparent cracks in the tunnel detected by a semantic segmentation model. The cracks are refined and the skeleton is extracted based on post-processing operations. The instance of the cracks is distinguished based on the endpoint clustering algorithm, and the crack length is accurately calculated. Compared with the existing method that relies on manual identification and measurement of cracks, its work efficiency is greatly improved. Attached Figure Description

[0031] Figure 1 A flowchart for calculating the length of cracks in tunnel lining;

[0032] Figure 2 A crack skeleton containing only two endpoints;

[0033] Figure 3 It is a crack skeleton with three endpoints;

[0034] Figure 4 This is a diagram illustrating the intersection search.

[0035] Figure 5 It is a cross-crack skeleton;

[0036] Figure 6 This is a flowchart of the endpoint clustering calculation process. Detailed Implementation

[0037] The present invention will be further described below with reference to the accompanying drawings and embodiments.

[0038] As shown in the figure, the method for calculating the length of tunnel lining cracks in this embodiment includes the following steps:

[0039] 1) After processing the original crack image with a semantic segmentation model, a crack segmentation mask is obtained. The crack segmentation mask is then binarized, and then dilation and erosion are performed sequentially based on morphological closure operations to repair the minor fractures in the crack segmentation results.

[0040] 2) Distinguish the connected components of each crack segmentation mask using a morphological connected component algorithm, and search for the endpoints of each connected component using an endpoint search algorithm; the endpoint search algorithm includes the following steps:

[0041] The first step is to extract the bounding box based on the connected component mask information. Starting from the four vertices of the bounding box, search along the x and y directions at distances of w / 2 and h / 2, respectively, where w is the width of the bounding box and h is the height of the bounding box. Search for the mask pixels that touch the bounding box, i.e., the touch points, and use the searched touch points as endpoints. If there are multiple adjacent touch points, select the middle point as the endpoint.

[0042] The second step involves searching for two endpoints (x1, y1) and (x2, y2) starting from the same vertex. The straight-line distance between the two points is calculated, and the shortest path distance between them is calculated using the Astar pathfinding algorithm. The rules for retaining the final boundary point are as follows:

[0043]

[0044] L Astar It is the shortest distance between the two endpoints (x1, y1) and (x2, y2).

[0045] 3) Differentiate between intersecting cracks and regular cracks, and refine the crack skeleton based on the ASTAR algorithm:

[0046] The endpoints of each connected component obtained from the search are classified. Masked connected components with only two endpoints are identified as regular cracks, and the skeleton of the regular cracks is directly extracted based on the ASTAR pathfinding algorithm.

[0047] For a masked connected component with three endpoints, further determine the crack type. The specific determination rules are as follows: Use the ASTAR pathfinding algorithm to search for the shortest paths between each pair of the three endpoints, and sort them according to their lengths, denoted as L. max L mid L min Using the lengths L of the three paths max L mid L min The relationship between the cracks determines the crack morphology, such as the formula. As shown, if L max Approximately equal to L mid With L min The sum of these values ​​indicates a regular crack, and the longest path L is selected. max If it is a crack skeleton, then it is determined to be an intersecting crack.

[0048] The process for handling intersecting cracks is as follows: Determine the intersection point of the intersecting cracks; if path L... max L mid L min If three paths share a common intersection point, that intersection point is called the intersection point. If the three paths do not share a common intersection point, then an intersection point search is performed by traversing the shortest path L. min The search range is determined by using the traversed point as the center and the width of the crack connected region as the radius. If points on the other two paths exist simultaneously within the search range, then the traversed point is taken as the intersection point. The formula for calculating the width of the crack connected region is as follows:

[0049]

[0050] Among them, P iThis indicates whether pixel i belongs to the current connectivity threshold; it is 1 if it does, and 0 otherwise.

[0051] After obtaining the intersection point based on the above algorithm, the ASTAR pathfinding algorithm is used to search for the shortest path between the three endpoints and the intersection point to obtain the skeleton of the cross crack.

[0052] The crack skeleton extracted above is a polyline with a width of 1 pixel.

[0053] 4) Clustering calculations are performed based on the endpoints of each refined crack skeleton to integrate crack skeletons belonging to the same crack; the clustering calculation steps are as follows:

[0054] ① Traverse all endpoints and find the endpoint with the shortest distance that is less than the first judgment distance to form a paired endpoint. The first judgment distance is a set value.

[0055] ② Identify whether each pair of paired endpoints is a normal endpoint or an interleaved endpoint. The identification method is as follows:

[0056] Assuming the endpoints of the paired group are po1 and po2, and their respective crack skeletons are L1 and L2, where the length of skeleton L1 is greater than that of L2, a bounding box (Bbox) is extracted based on crack skeleton L1, and the judgment direction is determined according to the coordinates of the bounding box. If the width of the bounding box is greater than its height, the x-direction is used as the judgment direction; otherwise, the y-direction is used. If the judgment direction is x, the x-coordinates of n points on skeleton L1 starting from po1 are taken to form list 1. Simultaneously, the x-coordinates of n points on skeleton L2 starting from po2 are taken to form list 2. If the two lists contain the same element, the two cracks have an overlapping area, as shown in the white area in the figure. The crack endpoint group is an overlapping endpoint; otherwise, it is a normal endpoint. When the judgment direction is y, the y-coordinates on the crack skeleton are taken for judgment according to the above judgment rules. Through experiments, the optimal number of points n is 20.

[0057] ③ If the two endpoints of the pair are ordinary endpoints, then connect the two ordinary endpoints with a straight line, thereby integrating the two crack skeletons to which the two ordinary endpoints belong into one crack skeleton.

[0058] If the two paired endpoints are staggered endpoints, further judgment is made based on the second judgment distance, which is a set value. If the distance between the two staggered endpoints is less than the second judgment distance, the two crack skeletons to which these two staggered endpoints belong are judged to be skeletons belonging to the same crack region, but no connection operation is performed on these two staggered endpoints.

[0059] If the distance between two intersecting endpoints is greater than the second determination distance, then the two crack skeletons to which these two intersecting endpoints belong are determined to be two different crack regions, and crack skeleton integration is not performed.

[0060] In this embodiment, the first determination distance is set to 60, the second determination distance is set to 25, the actual size of the original image is 1000*1000 pixels, and the corresponding actual size is 1m*1m.

[0061] 5) Calculate the length of the crack skeleton. Calculate the distance between adjacent pixels on the skeleton. The distance between adjacent pixels horizontally on the skeleton is 1, the distance between adjacent pixels vertically on the skeleton is 1, and the distance between adjacent pixels diagonally on the skeleton is 1.4. Add up the distances between all pixels on the skeleton to get the length of the crack skeleton.

[0062] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A method of calculating the length of a crack defect in a tunnel lining, characterized by: The method comprises the following steps: 1) The crack original drawing is processed by a semantic segmentation model to obtain a crack segmentation mask, the crack segmentation mask is binarized, and then inflation and corrosion are sequentially performed based on a morphological closing operation to repair micro-fractures in the crack segmentation result; 2) The connected domains of each crack segmentation mask are distinguished by a morphological connected domain algorithm, and the end points of each connected domain are searched based on an end point searching algorithm; the end point searching algorithm comprises the following steps: First step, based on the connected domain mask information, a positioning frame is extracted, starting from the four corners of the positioning frame, searching w / 2, h / 2 distances in the x direction and the y direction respectively, w is the width of the positioning frame, h is the height of the positioning frame, the mask pixel points that contact the positioning frame are searched, that is, the touch boundary points, and the searched touch boundary points are taken as the end points, if there are multiple adjacent touch boundary points, the central point is selected as the end point; Second step, if two end points (x1, y1) and (x2, y2) are searched from the same corner, the straight line distance between the two points is calculated, and the shortest path distance between the two points is calculated by using the Astar pathfinding algorithm, and the final touch boundary point retention rule is as follows: L Astar is the shortest distance between two endpoints (x1, y1), (x2, y2); 3) Distinguish the cross crack and the regular crack, and refine and extract the crack skeleton based on the astar algorithm: For each connected domain end point searched by the connected domain, the connected domain mask is classified as a regular crack if it contains only two end points, and the skeleton of the regular crack is directly extracted based on the astar pathfinding algorithm; For the mask connected domain containing three end points, further distinguish the crack type, the specific determination rules are as follows: the shortest path between the three end points is searched by using a star search algorithm respectively, and is sorted according to the path length and is recorded as L max 、 mid 、 min L max 、 mid 、 min L max , The relationship between the three path lengths is used to formulate the crack shape determination rule, as shown in formula , if L mid is approximately equal to the sum of L min , it is determined as a regular crack, and the longest path L max is taken as the crack skeleton; otherwise, it is determined as a cross crack; The process for handling intersecting cracks is as follows: Determine the intersection point of the intersecting cracks; if path L... max L mid L min If three paths share a common intersection point, that intersection point is called the intersection point. If the three paths do not share a common intersection point, then an intersection point search is performed by traversing the shortest path L. min The search range is determined by using the traversed point as the center and the width of the crack connected region as the radius. If points on the other two paths exist simultaneously within the search range, then the traversed point is taken as the intersection point. The formula for calculating the width of the crack connected region is as follows: where P i represents whether the pixel point i belongs to the current connected threshold, and is 1 if yes, otherwise 0; After obtaining the intersection point based on the above algorithm, the shortest path between the three end points and the intersection point is searched by using the astar pathfinding algorithm, and the skeleton of the cross crack is obtained; The crack skeleton extracted by the above refinement is a 1-pixel-point-wide polyline; 4) Cluster calculation is performed based on the end points of each refined crack skeleton to integrate the crack skeletons belonging to the same crack; the cluster calculation step is as follows: ① Traverse each end point, find the end point with the shortest distance from all end points and less than the first judgment distance, and form paired end points; the first judgment distance is a set value; ② Identify each group of paired end points as ordinary end points or staggered end points; ③ If the two paired end points are ordinary end points, connect the two ordinary end points with a straight line, thereby integrating the two crack skeletons to which the two ordinary end points belong into one crack skeleton; If the two paired end points are staggered end points, further judgment is performed according to the second judgment distance, the second judgment distance is a set value, if the distance between the two staggered end points is less than the second judgment distance, the two crack skeletons to which the two staggered end points belong are judged as the skeletons of the same crack region, but the two staggered end points are not connected; If the distance between the two staggered end points is greater than the second judgment distance, it is judged that the two crack skeletons to which the two staggered end points belong are the skeletons of two different crack regions, and no crack skeleton integration is performed; 5) The length of the crack skeleton is calculated, the distance between adjacent pixel points on the skeleton is calculated, the distance between horizontally adjacent pixel points on the skeleton is 1, the distance between vertically adjacent pixel points on the skeleton is 1, and the distance between diagonally adjacent pixel points on the skeleton is 1.4, and the length of the crack skeleton is obtained by accumulating the distances between all pixel points on the skeleton.

2. The method of claim 1, wherein: The step ② identifies whether each group of paired endpoints is a normal endpoint or a staggered endpoint, and the identification method is as follows: Suppose the paired group endpoints are po1 and po2, and the respective fracture frameworks are L1 and L2, wherein the length of the L1 framework is greater than that of the L2 framework. A boundary box is extracted based on the fracture framework L1, and a judgment direction is determined according to the boundary box coordinates. If the width of the boundary box is greater than the height, the x direction is the judgment direction, and vice versa. If the judgment direction is x, the x coordinates of n points on the L1 framework are taken from po1 as the starting point to form a list 1, and the x coordinates of n points on the L1 framework are taken from po2 as the starting point to form a list 2. If the two lists have the same elements, the two fractures have a staggered region, and the paired group endpoints are staggered endpoints, and vice versa. If the judgment direction is y, the above determination rule is followed to take the y coordinates on the fracture framework to determine.