A method and system for detecting and segmenting the length and width of cracks in tunnel lining.

By using the YOLOv8 network model and data augmentation technology, efficient and accurate detection and segmentation of tunnel lining cracks were achieved, solving the problems of low detection efficiency and low accuracy in existing technologies, and adapting to the identification of tunnel defects in complex environments.

CN116863134BActive Publication Date: 2025-10-31河南省城乡规划设计研究总院股份有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310707660.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-15
Publication Date
2025-10-31
Estimated Expiration
2043-06-15

AI Technical Summary

Technical Problem

Existing methods for detecting cracks in tunnel linings are inefficient and lack precision, making it difficult to meet engineering requirements in complex environments. Furthermore, traditional algorithms are slow, making it difficult to balance accuracy and speed.

Method used

The YOLOv8 network model is used for tunnel lining crack detection and segmentation. Combining data augmentation technology and image processing, a lightweight YOLOv8s-seg network structure is used. Through image acquisition, training set and validation set partitioning, and optimization of model hyperparameters, high-precision and fast detection is achieved.

Benefits of technology

While improving detection speed, it ensures high accuracy and adapts to the measurement of crack number, length and maximum width in various complex scenarios, providing automated technical support for tunnel defect identification and detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116863134B_ABST
    Figure CN116863134B_ABST
Patent Text Reader

Abstract

This invention discloses a method and system for detecting and segmenting the length and width of tunnel lining cracks. This invention uses a YOLOv8 network model to replace existing two-stage detection models such as R-CNN, SPP Net, and Faster R-CNN N. This improves the speed of crack detection and segmentation while maintaining high accuracy. The YOLOv8 network model is trained using data-augmented images, ensuring that the obtained model meets the required detection and segmentation accuracy. This allows the detection and segmentation model to be used for measuring the number, length, and maximum width of cracks in various complex scenarios, demonstrating wide applicability and strong adaptability. It provides technical support for the future automation of tunnel defect identification and detection using computer vision technology.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of tunnel defect detection technology, specifically, it relates to a method and system for detecting and segmenting the length and width of tunnel lining cracks. Background Technology

[0002] With China's rapid economic development, the contradiction between the rapidly expanding demand for urban space and the limited surface space has become increasingly prominent, making the effective development and utilization of urban underground space more and more urgent. As a vital lifeline engineering project for human use of underground space, tunnel construction has seen unprecedented development. However, because tunnels are semi-concealed projects built in underground rock and soil media, and because tunnels in my country were constructed at different times, under different geological conditions, and with varying levels of technology, many tunnels have developed various defects after years of operation. Lining cracks are among the most common and serious defects. Achieving automatic and rapid identification and detection of tunnel lining cracks is of fundamental importance for the safety assessment of tunnel lining structures and the safe operation and management of tunnels. It is an urgent need in practical engineering applications and is currently a hot topic and cutting-edge issue in tunnel engineering research both domestically and internationally.

[0003] For a long time, the detection of tunnel lining cracks has mainly relied on manual measurement. This method suffers from drawbacks such as low efficiency, high risk, strong subjectivity, inability to guarantee accuracy, and high time and labor costs. In recent years, thanks to larger datasets, more powerful computers, and technologies capable of training deeper networks, deep learning algorithms have made significant breakthroughs in crack recognition and achieved better recognition results than traditional methods. Commonly used target detection algorithms in current technology include R-CNN, SPP Net, and Faster R-CNN. While these algorithms have high detection accuracy, their detection speed is slow, making it difficult to balance accuracy and speed. Furthermore, their detection accuracy cannot meet engineering requirements under complex environmental conditions. Summary of the Invention

[0004] The purpose of this section is to outline some aspects of embodiments of the present invention and to briefly describe some preferred embodiments. Simplifications or omissions may be made in this section, as well as in the abstract and title of this application, to avoid obscuring the purpose of these documents; however, such simplifications or omissions should not be construed as limiting the scope of the invention.

[0005] The present invention adopts the following technical solution.

[0006] A method for detecting and segmenting the length and width of cracks in tunnel lining, comprising the following steps:

[0007] S1: Collect images of tunnel lining cracks, perform data augmentation, and obtain training images;

[0008] S2: Divide the training images, reserve the test set, label the remaining images, and randomly divide them into training and validation sets according to the proportion;

[0009] S3: Input the training set into the YOLOv8 network model for pre-training, use the validation set to test the model's detection and segmentation performance, use the test set to optimize the model's hyperparameters, and obtain the detection and segmentation model;

[0010] S4: Acquire images of tunnel lining cracks and input them into the detection and segmentation model;

[0011] S5: Use a detection and segmentation model to detect and segment cracks in tunnel lining crack images, and calculate the length and maximum width of the cracks.

[0012] Furthermore, the data augmentation methods used in step S1 are Mosaic, random HSV, and affine transformation.

[0013] Furthermore, in step S2, the tool for labeling the images is the Roboflow online annotation tool, and the dataset is divided in such a way that a portion of the data is reserved as a test set, and the ratio of the training set to the validation set is 8:2.

[0014] Furthermore, the specific steps of step S3 include:

[0015] The training set is input into the YOLOv8 network model for pre-training to initially obtain the detection and segmentation model;

[0016] Images are extracted from the test set and used as input to the pre-trained model to optimize the model's training hyperparameters.

[0017] Input the validation set, obtain the detection and segmentation results, and evaluate whether they meet the detection and segmentation accuracy requirements;

[0018] Adjust the training hyperparameters and repeat the above steps until the optimal combination of training hyperparameters is obtained.

[0019] Furthermore, the training hyperparameters include the number of training epochs, optimizer type, initial learning rate, parameter optimization algorithm, batch size of input images, and segmentation mask downsampling rate.

[0020] Furthermore, in step S4, the image acquisition method is at least one of the following: acquisition by a drone system, acquisition by a smartphone camera, and acquisition by a DSLR camera.

[0021] Furthermore, the specific steps for length calculation in step S5 are as follows:

[0022] The result mask of the crack detection and segmentation module is converted to uint8 type using the astype function and then converted into a binary image;

[0023] The skeleton is extracted from the binary image using the skeletonization function in the skimage.morphology module, and the finest skeleton structure is obtained using the lee method. Then, the length of the skeletonized boundary is retrieved using the regionprops function to obtain the skeleton path length of the crack.

[0024] The argwhere function extracts the positions of non-zero elements from the skeletonized image, resulting in two columns of coordinates representing the path pixels: the first column represents the x-coordinate, and the second column represents the y-coordinate.

[0025] A linear regression model object is created using the LinearRegression function, and then the fit(x,y) function is used to fit the coordinates of the path pixels, where x is the array of horizontal coordinates of the path pixels and y is the array of vertical coordinates of the path pixels. The minimum and maximum values ​​of the x coordinates of the path pixels are calculated using the min and max functions, respectively, and the minimum and maximum values ​​of y are predicted using the trained linear regression model.

[0026] Based on the predicted y-coordinate and the range of the path's x-coordinate, the length of the path, i.e., the crack length L, is calculated using Euclidean distance. The specific expression for Euclidean distance is as follows:

[0027]

[0028] In the formula x max x min Let x and y be the minimum and maximum values ​​of the path pixel coordinates, respectively. max y min These are the minimum and maximum values ​​of y predicted by the trained linear regression model, respectively.

[0029] Furthermore, the specific steps for calculating the width in step S5 are as follows:

[0030] The result mask of the crack detection and segmentation module is converted to uint8 type using the astype function and then converted into a binary image;

[0031] The `findContours` function in OpenCV is used to find all crack contours in the image. The contour retrieval mode is specified as tree retrieval mode to detect all crack contours, establish a complete hierarchical relationship between contours, and specify the contour approximation method as a simple approximation method to reduce the storage space of contour points and retain only the endpoint information.

[0032] For each contour, by extracting the leftmost, rightmost, topmost, and bottommost points on the contour, a minimum rectangular region that can contain the contour is determined. Half the minimum side length of the minimum rectangle is calculated as the upper limit of the radius of the inscribed circle, and a precision parameter P is defined. r ;

[0033] Construct a grid point coordinate matrix containing all pixels within the outline rectangular area, iterate through each pixel in the grid, use the pointPolygonTest function to determine whether the point is inside the outline, filter out all pixels inside the outline, and add their coordinates to a list.

[0034] Randomly select a subset of pixels from the list, calculate the radius of their corresponding inscribed circles, and update the current maximum radius and center point.

[0035] The remaining pixels are searched cyclically, their corresponding inscribed circle radii are calculated, the maximum radius and center point are updated, and finally the crack position with the maximum radius is found from the crack inscribed circle radius list. Its corresponding center point and diameter value, i.e., the maximum crack width, are then obtained. The specific expression for the precision parameter Pr is as follows:

[0036]

[0037] In the formula, R x L x D represents the x-coordinates of the leftmost and rightmost points on the contour, respectively. y U y These are the ordinates of the lowest and highest points on the contour, respectively.

[0038] Furthermore, the YOLOv8 network model adopts a lightweight YOLOv8s-seg network structure.

[0039] The present invention also provides a detection and segmentation system for the length and width of tunnel lining cracks, the system being used to implement the above-mentioned detection and segmentation method, comprising:

[0040] The image processing module is used to collect images of tunnel lining cracks and perform data augmentation to obtain training images.

[0041] The image segmentation module is used to segment the training images, reserve the test set, label the remaining images, and randomly divide them into the training set and the validation set according to the proportion.

[0042] The model training module is used to input the training set into the YOLOv8 network model for pre-training, use the validation set to test the model's detection and segmentation performance, use the test set to optimize the model's training hyperparameters, and obtain the detection and segmentation model.

[0043] The image acquisition module is used to acquire images of tunnel lining cracks and input them into the detection and segmentation model;

[0044] The crack measurement module is used to detect and segment cracks in tunnel lining crack images using a detection and segmentation model, and to calculate the length and maximum width of the cracks.

[0045] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0046] This invention replaces existing two-stage detection models such as R-CNN, SPP Net, and Faster R-CNN with the YOLOv8 network model. While improving the speed of detection and segmentation of tunnel lining cracks, it also ensures high accuracy. The YOLOv8 network model is trained using data-augmented images to ensure that the obtained model meets the detection and segmentation accuracy requirements. This allows the detection and segmentation model to be used to measure the number, length, and maximum width of cracks in various complex scenarios. It has a wide range of applications and strong adaptability, providing technical support for the future full automation of tunnel defect identification and detection using computer vision technology. Attached Figure Description

[0047] Figure 1 This is a schematic diagram of the overall method flow of the present invention;

[0048] Figure 2 This is a flowchart illustrating the operation of the present invention.

[0049] Figure 3 This is a schematic diagram of the process of optimizing and training hyperparameters of the YOLOv8 model in this invention;

[0050] Figure 4 This is a schematic diagram of tunnel lining crack images collected under the influence of external conditions in this invention.

[0051] Figure 5 This is a schematic diagram of the model detection and segmentation results in this invention;

[0052] Figure 6 This is a schematic diagram showing the calculation results of crack length and maximum width in this invention;

[0053] Figure 7 This is a schematic diagram of the detection and segmentation system in this invention. Detailed Implementation

[0054] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0055] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.

[0056] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places throughout this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that mutually excludes other embodiments. The present invention provides the following embodiments.

[0057] like Figures 1-6 As shown, this embodiment provides a technical solution:

[0058] A method for detecting and segmenting the length and width of cracks in tunnel lining, comprising the following steps:

[0059] S1: Collect images of tunnel lining cracks, perform data augmentation, and obtain training images.

[0060] The data augmentation methods used in this embodiment are Mosaic, Random HSV, and Affine Transform. The Random HSV method mainly adjusts the color, saturation, and brightness of the image, while the Affine Transform method mainly adjusts the inversion, translation, and scaling of the image. One or more methods can be combined to perform data augmentation processing on the image according to actual needs.

[0061] S2: Divide the training images, reserve the test set, label the remaining images, and randomly divide them into training and validation sets according to the proportion.

[0062] In this embodiment, the tool used to label the images is the Roboflow online annotation tool. The dataset is divided by reserving a small portion of the data as a test set, and the ratio of the training set to the validation set is 8:2. The 8:2 completely random division ratio is a commonly used ratio in neural network training.

[0063] S3: Input the training set into the YOLOv8 network model for pre-training, use the validation set to test the model's detection and segmentation performance, use the test set to optimize the model's hyperparameters, and obtain the detection and segmentation model.

[0064] The latest version of YOLOv8, which performs better in disease detection and segmentation, was selected to replace the existing two-stage detection models such as R-CNN, SPP Net, and Faster R-CNN, as well as the more primitive version of YOLO model. This simplifies the process of building a tunnel lining crack detection and segmentation model while ensuring high accuracy.

[0065] The YOLOv8 network model described in this embodiment adopts a lightweight YOLOv8s-seg network structure. Compared with Faster-R-CNN, which has a detection speed of 0.259s / image, its trained model has a detection speed of up to 0.013s / image and a segmentation speed of up to 0.154s / image, resulting in faster recognition speed.

[0066] The specific steps of step S3 in this embodiment include:

[0067] The training set is input into the YOLOv8 network model for pre-training to initially obtain the detection and segmentation model;

[0068] Images are extracted from the test set and used as input to the pre-trained model to optimize the model's training hyperparameters.

[0069] Input the validation set, obtain the detection and segmentation results, and evaluate whether they meet the detection and segmentation accuracy requirements;

[0070] Adjust the training hyperparameters and repeat the above steps until the optimal combination of training hyperparameters is obtained. The detection parameters are the confidence threshold and the intersection-union ratio threshold.

[0071] The training hyperparameters described in this embodiment include the number of training epochs, optimizer type, initial learning rate, parameter optimization algorithm, batch size of input images, and segmentation mask downsampling rate.

[0072] S4: Collect images of tunnel lining cracks and input them into the detection and segmentation model.

[0073] In step S4 of this embodiment, the image acquisition method is at least one of the following: acquisition by a drone system, acquisition by a smartphone camera, and acquisition by a DSLR camera.

[0074] S5: Use a detection and segmentation model to detect and segment cracks in tunnel lining crack images, and calculate the length and maximum width of the cracks.

[0075] The specific steps for length calculation in step S5 of this embodiment are as follows:

[0076] The result mask of the crack detection and segmentation module is converted to uint8 type using the astype function and then converted into a binary image;

[0077] The skeleton is extracted from the binary image using the skeletonization function in the skimage.morphology module, and the finest skeleton structure is obtained using the lee method. Then, the length of the skeletonized boundary is retrieved using the regionprops function to obtain the skeleton path length of the crack.

[0078] The argwhere function extracts the positions of non-zero elements from the skeletonized image, resulting in two columns of coordinates representing the path pixels: the first column represents the x-coordinate, and the second column represents the y-coordinate.

[0079] A linear regression model object is created using the LinearRegression function, and then the fit(x,y) function is used to fit the coordinates of the path pixels, where x is the array of horizontal coordinates of the path pixels and y is the array of vertical coordinates of the path pixels. The minimum and maximum values ​​of the x coordinates of the path pixels are calculated using the min and max functions, respectively, and the minimum and maximum values ​​of y are predicted using the trained linear regression model.

[0080] Based on the predicted y-coordinate and the range of the path's x-coordinate, the length of the path, i.e., the crack length L, is calculated using Euclidean distance. The specific expression for Euclidean distance is as follows:

[0081]

[0082] In the formula x max x min Let x and y be the minimum and maximum values ​​of the path pixel coordinates, respectively. max y min These are the minimum and maximum values ​​of y predicted by the trained linear regression model, respectively.

[0083] The specific steps for width calculation in step S5 of this embodiment are as follows:

[0084] The result mask of the crack detection and segmentation module is converted to uint8 type using the astype function and then converted into a binary image;

[0085] The `findContours` function in OpenCV is used to find all crack contours in the image. The contour retrieval mode is specified as tree retrieval mode to detect all crack contours, establish a complete hierarchical relationship between contours, and specify the contour approximation method as a simple approximation method to reduce the storage space of contour points and retain only the endpoint information.

[0086] For each contour, by extracting the leftmost, rightmost, topmost, and bottommost points on the contour, a minimum rectangular region that can contain the contour is determined. Half the minimum side length of the minimum rectangle is calculated as the upper limit of the radius of the inscribed circle, and a precision parameter P is defined. r Precision parameter P r Used to control the accuracy of iterative solutions for the inscribed circle.

[0087] Construct a grid point coordinate matrix containing all pixels within the outline rectangular area, iterate through each pixel in the grid, use the pointPolygonTest function to determine whether the point is inside the outline, filter out all pixels inside the outline, and add their coordinates to a list.

[0088] Randomly select a subset of pixels from the list, calculate the radius of their corresponding inscribed circles, and update the current maximum radius and center point.

[0089] The remaining pixels are searched cyclically, their corresponding inscribed circle radii are calculated, the maximum radius and center point are updated, and finally the crack position with the maximum radius is found from the crack inscribed circle radius list. Its corresponding center point and diameter value, i.e., the maximum crack width, are then obtained. The specific expression for the precision parameter Pr is as follows:

[0090]

[0091] In the formula, R x L x D represents the x-coordinates of the leftmost and rightmost points on the contour, respectively. y U y These are the ordinates of the lowest and highest points on the contour, respectively.

[0092] This embodiment embeds image contour and skeleton analysis technology into the YOLOv8 model, which can accurately and quickly detect and segment tunnel lining cracks under complex external conditions, while also accurately detecting parameters such as the number, length, and maximum width of tunnel lining cracks. This provides technical support for the future full automation of tunnel defect identification and detection using computer vision technology.

[0093] The following is a detailed explanation of this embodiment based on a specific example. A dataset of 9722 crack images was collected. Based on the collected dataset, a detection and segmentation model for the length and maximum width of tunnel lining cracks based on YOLOv8 was constructed using the YOLOv8s-seg network structure.

[0094] After augmenting and labeling the dataset, 200 images were reserved as the test set. The remaining dataset was divided according to the described method and fed into the YOLOv8 network model for pre-training. After parameter tuning, the optimal training hyperparameter combination was obtained. The number of training epochs was set to 800, the optimizer type to SGD, the initial learning rate to 0.01, the parameter optimization algorithm to genetic algorithm, the batch size of input images to 8, and the segmentation mask downsampling rate to 4. Finally, the confidence threshold for the detection parameters was set to 0.2, constructing a YOLOv8-based model for detecting and segmenting the length and maximum width of cracks in tunnel lining.

[0095] The experimental data of the YOLOv8-based model for detecting and segmenting the length and maximum width of tunnel lining cracks are shown in Table 1. The specific detection and segmentation visualization results are shown below. Figure 4 and Figure 5 As shown in the image, the visualization results of the number, length, and maximum width of cracks are as follows: Figure 6 As shown, the method and system for detecting and segmenting the length and maximum width of tunnel lining cracks based on YOLOv8 in this embodiment can be used to measure the number, length, and maximum width of cracks in various complex scenarios. It has a wide range of applications and strong adaptability.

[0096] Table 1: Test Data of the Detection Model

[0097]

[0098] like Figure 7 As shown, the present invention also provides a detection and segmentation system for the length and width of tunnel lining cracks, characterized in that the system is used to implement the above-mentioned detection and segmentation method, including:

[0099] The image processing module is used to collect images of tunnel lining cracks and perform data augmentation to obtain training images.

[0100] The image segmentation module is used to segment the training images, reserve the test set, label the remaining images, and randomly divide them into the training set and the validation set according to the proportion.

[0101] The model training module is used to input the training set into the YOLOv8 network model for pre-training, use the validation set to test the model's detection and segmentation performance, use the test set to optimize the model's training hyperparameters, and obtain the detection and segmentation model.

[0102] The image acquisition module is used to acquire images of tunnel lining cracks and input them into the detection and segmentation model;

[0103] The crack measurement module is used to detect and segment cracks in tunnel lining crack images using a detection and segmentation model, and to calculate the length and maximum width of the cracks.

[0104] The above description, in conjunction with specific embodiments, provides a further detailed explanation of the present invention. It should not be construed that the specific implementation of the present invention is limited to these descriptions. For those skilled in the art, several simple deductions or substitutions can be made without departing from the concept of the present invention, and all such deductions or substitutions should be considered to fall within the scope of protection defined by the claims submitted herein.

Claims

1. A method for detecting and segmenting the length and width of cracks in tunnel lining, characterized in that, The specific steps include: S1: Collect images of tunnel lining cracks, perform data augmentation, and obtain training images; S2: Divide the training images, reserve the test set, label the remaining images, and randomly divide them into training and validation sets according to the proportion; S3: Input the training set into the YOLOv8 network model for pre-training, use the validation set to test the model's detection and segmentation performance, use the test set to optimize the model's hyperparameters, and obtain the detection and segmentation model; S4: Acquire images of tunnel lining cracks and input them into the detection and segmentation model; S5: Use a detection and segmentation model to detect and segment cracks in tunnel lining crack images, and calculate the length and maximum width of the cracks. The specific steps for calculating the length of the crack are as follows: The result mask of the crack detection and segmentation module is converted to uint8 type using the astype function and then converted into a binary image; The skeleton is extracted from the binary image using the skeletonization function in the skimage.morphology module, and the finest skeleton structure is obtained using the lee method. Then, the length of the skeletonized boundary is retrieved using the regionprops function to obtain the skeleton path length of the crack. The `argwhere` function extracts the positions of non-zero elements from the skeletonized image, resulting in two columns of coordinates representing the path pixels. The first column represents... x Coordinates, the second column represents y coordinate; Create a linear regression model object using the LinearRegression function, and then use the fit function fit( x , y The function fits the coordinates of the path pixels, where x It is an array of x-coordinates of the path pixels. y It is an array of y-coordinates of path pixels, and the min and max functions are used to calculate the path pixels respectively. x Find the minimum and maximum values ​​of the coordinates, and use a trained linear regression model to... y Predict the minimum and maximum values; Based on the predicted y-coordinate and the range of the path's x-coordinate, the Euclidean distance is used to calculate the path length, which is the crack length value. L The specific expression for Euclidean distance is: In the formula x max , x min These are the minimum and maximum x-coordinates of the path pixels, respectively. y max , y min These are the minimum and maximum values ​​of y predicted by the trained linear regression model, respectively.

2. The method for detecting and segmenting the length and width of tunnel lining cracks according to claim 1, characterized in that, The data augmentation methods used in step S1 are Mosaic, random HSV, and affine transformation.

3. The method for detecting and segmenting the length and width of tunnel lining cracks according to claim 1, characterized in that, In step S2, the tool used to label the images is the Roboflow online annotation tool. The dataset is divided by reserving a portion of the data as a test set, and the ratio of the training set to the validation set is 8:

2.

4. The method for detecting and segmenting the length and width of tunnel lining cracks according to claim 1, characterized in that, The specific steps of step S3 include: The training set is input into the YOLOv8 network model for pre-training to initially obtain the detection and segmentation model; Images are extracted from the test set and used as input to the pre-trained model to optimize the model's training hyperparameters; Input the validation set, obtain the detection and segmentation results, and evaluate whether they meet the detection and segmentation accuracy requirements; Adjust the training hyperparameters and repeat the above steps until the optimal combination of training hyperparameters is obtained.

5. The method for detecting and segmenting the length and width of tunnel lining cracks according to claim 4, characterized in that, The training hyperparameters include the number of training epochs, optimizer type, initial learning rate, parameter optimization algorithm, batch size of input images, and segmentation mask downsampling rate.

6. The method for detecting and segmenting the length and width of tunnel lining cracks according to claim 1, characterized in that, In step S4, the image acquisition method is at least one of the following: acquisition by a drone system, acquisition by a smartphone camera, and acquisition by a DSLR camera.

7. The method for detecting and segmenting the length and width of tunnel lining cracks according to claim 1, characterized in that, The specific steps for calculating the width in step S5 are as follows: The result mask of the crack detection and segmentation module is converted to uint8 type using the astype function and then converted into a binary image; The `findContours` function in OpenCV is used to find all crack contours in the image. The contour retrieval mode is specified as tree retrieval mode to detect all crack contours, establish a complete hierarchical relationship between contours, and specify the contour approximation method as a simple approximation method to reduce the storage space of contour points and retain only the endpoint information. For each contour, by extracting the leftmost, rightmost, topmost, and bottommost points on the contour, a minimum rectangular region that can contain the contour is determined. Half the minimum side length of the minimum rectangle is calculated as the upper limit of the radius of the inscribed circle, and a precision parameter is defined. P r ; Construct a grid point coordinate matrix containing all pixels within the outline rectangular area, iterate through each pixel in the grid, use the pointPolygonTest function to determine whether the point is inside the outline, filter out all pixels inside the outline, and add their coordinates to a list. Randomly select a subset of pixels from the list, calculate the radius of their corresponding inscribed circles, and update the current maximum radius and center point. The remaining pixels are searched cyclically, their corresponding inscribed circle radii are calculated, the maximum radius and center point are updated, and finally the crack position with the maximum radius is found from the crack inscribed circle radius list. Its corresponding center point and diameter value, i.e., the maximum crack width, are then obtained. The precision parameter... P The specific expression for r is: In the formula, R x , L x These are the x-coordinates of the leftmost and rightmost points on the contour, respectively. D y , U y These are the ordinates of the lowest and highest points on the contour, respectively.

8. A method for detecting and segmenting the length and width of tunnel lining cracks according to any one of claims 1-7, characterized in that, The YOLOv8 network model adopts a lightweight YOLOv8s-seg network structure.

9. A system for detecting and segmenting the length and width of cracks in tunnel lining, characterized in that, The system is used to implement the detection and segmentation method according to any one of claims 1-7, comprising: The image processing module is used to collect images of tunnel lining cracks and perform data augmentation to obtain training images. The image segmentation module is used to segment the training images, reserve the test set, label the remaining images, and randomly divide them into the training set and the validation set according to the proportion. The model training module is used to input the training set into the YOLOv8 network model for pre-training, use the validation set to test the model's detection and segmentation performance, use the test set to optimize the model's training hyperparameters, and obtain the detection and segmentation model. The image acquisition module is used to acquire images of tunnel lining cracks and input them into the detection and segmentation model; The crack measurement module is used to detect and segment cracks in tunnel lining crack images using a detection and segmentation model, and to calculate the length and maximum width of the cracks.

Citation Information

Patent Citations

  • Crack detection method

    CN115240070A

  • Tunnel lining crack detection method and equipment based on YOLOv5

    CN115830432A