A tunnel hole wall crack disease detection method, system and device
By acquiring dual-view images of the tunnel wall using industrial cameras, and utilizing edge detection and grayscale analysis to quantify deformation influencing factors, the core deformation degree of the tunnel wall defect area is identified, solving the problem of inaccurate extraction of tunnel wall defect contours and achieving efficient tunnel wall quality rating.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHANGAN UNIV
- Filing Date
- 2026-02-11
- Publication Date
- 2026-05-15
AI Technical Summary
The existing contour extraction of tunnel wall defects is affected by the deformation of the area near the defect, resulting in inaccurate defect size analysis and contour extraction, and making it difficult to accurately determine whether the deformed part is strongly correlated with the core part.
By acquiring dual-view images of the tunnel wall using an industrial camera, the gradient of each pixel is obtained, edge detection and connected component analysis are performed, the initial defect area is extracted, the deformation influence factor is quantified, and the core deformation degree is identified by combining grayscale changes and curvature differences, thus obtaining the final crack area and defect size.
It enables accurate contour extraction and quality rating of defective areas in tunnel walls, can identify three-dimensional volume changes, distinguish the relationship between deformed areas and core areas, and improves the accuracy and efficiency of tunnel wall inspection.
Smart Images

Figure CN121685548B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, specifically to a method, system, and apparatus for detecting cracks in tunnel walls. Background Technology
[0002] In the process of tunnel wall defect detection, surface defects are a key factor affecting their quality and grade. Automated optical inspection systems are commonly used, employing cameras and image processing technology to scan the tunnel wall surface in real time, detecting most defects and classifying, locating, and grading them. Tunnel wall surface defects are numerous and complex in origin, often involving the entire tunnel wall during inspection. Effective defect control requires a deep understanding of the formation mechanism of each defect, as well as the implementation of systematic maintenance optimization and strict quality management. The application of online automated inspection technology has significantly improved the efficiency and accuracy of defect identification and control.
[0003] Surface defects in tunnel walls require accurate contour extraction to classify the tunnel wall quality based on defect size. During the classification process, defects have a core and deformable portion. It's crucial to accurately analyze whether the deformable portion is affected by the defect. While the core can be identified as the defect area, the deformable portion, influenced by other defects and the 3D appearance of the tunnel wall, cannot be directly correlated with the core. Under the dual-view perspective of an industrial camera, strongly correlated deformable portions do not exhibit significant 3D volume changes and are therefore less affected by the dual-view perspective. This allows for the determination of the relationship between the deformable and core regions, the identification of crack contours, and the extraction of defect sizes, ultimately leading to accurate quality classification of the tunnel wall. Summary of the Invention
[0004] This invention provides a method, system, and apparatus for detecting cracks in tunnel walls, addressing the problem that existing methods for extracting the contour of defective areas in tunnel walls are affected by deformation of the area near the defect, hindering defect size analysis and contour extraction. The specific technical solution adopted is as follows:
[0005] This invention proposes a method for detecting cracks in tunnel walls, which includes the following steps:
[0006] The tunnel wall surface images are acquired from two perspectives using an industrial camera, and the gradient of each pixel in the two perspective images is obtained.
[0007] Edge detection is performed on the surface image of the cave wall, and several initial defect regions are obtained through connected component analysis. The gradient changes of the edges of each initial defect region to the inside and outside of the region are analyzed to obtain the inner and outer edges of each initial defect region, and then the defect regions to be tested, as well as their core regions and deformation regions, are obtained. The defect regions to be tested in the dual-view cave wall surface images are matched according to their distribution and size, as well as their internal grayscale representation, to obtain several defect region pairs.
[0008] The similarity between the inner and outer edges of the defect region to be tested is analyzed. Combined with the gray-scale change between the core region and the deformed region, the deformation influence factor of each defect region to be tested is quantified. The difference between the deformed regions of the two defect regions to be tested in the defect region pair is analyzed. Based on the overall curvature change and the difference between the internal gradients of the deformed regions, combined with the difference in the deformation influence factor of the defect regions to be tested, the core deformation degree of each defect region pair is obtained.
[0009] Based on the core deformation degree of each defect region pair, and the core area and deformation area of the defect region to be tested, the final crack area and defect size of each defect region pair are obtained; based on the final crack area, the crack contour of the tunnel wall surface image is extracted, and the tunnel wall quality is rated in combination with the defect size.
[0010] Optionally, the specific method for obtaining the inner and outer edges of each initial defect region, and then acquiring each defect region to be tested, its core region, and its deformed region, includes:
[0011] Any initial defect region is designated as the current initial defect region. For the current initial defect region and its closed edge, other initial defect regions completely contained by the current initial defect region or other initial defect regions completely contained by the current initial defect region are obtained. If the current initial defect region is completely contained, it is designated as a defect region to be tested and designated as the core region of the defect region to be tested. The portion of other initial defect regions that completely contain the current initial defect region, excluding the current initial defect region, is designated as the deformed region of the defect region to be tested. If the current initial defect region completely contains another initial defect region, the other initial defect region that is completely contained is designated as a defect region to be tested and designated as the core region of the defect region to be tested. The portion of the current initial defect region that excludes the other initial defect region is designated as the deformed region of the defect region to be tested.
[0012] The closed edge of the core region is recorded as the inner edge of the defect region to be tested, and the closed edge of the deformed region is recorded as the outer edge of the defect region to be tested.
[0013] Take any initial defect region that does not have an inclusion relationship as the target initial defect region, obtain the center of the target initial defect region, and for any edge pixel on its closed edge, connect the edge pixel to the center of the target initial defect region to obtain the center line of the edge pixel. Arrange the gradient magnitudes of each pixel on the center line according to the order in which the edge pixels point to the center to obtain the center gradient sequence and its center gradient curve of the edge pixel. Extract several maxima from the center gradient curve and divide the center gradient curve into several gradient curve segments by the maxima.
[0014] By analyzing the differences between the maximum value and other gradient amplitudes in each gradient curve segment, as well as the fluctuation of other gradient amplitudes, and combining the distribution of gradient curve segments in the central gradient curve, the inner and outer edges of the target initial defect region are obtained.
[0015] The region enclosed by the inner edge of the initial defect region of the target is taken as a defect region to be tested and recorded as the core region of the defect region to be tested. The initial defect region of the target is taken as the deformation region of the defect region to be tested. For any outer edge pixel and its corresponding inner edge pixel, the gray values of all pixels on the line connecting the inner edge pixel and the outer edge pixel are arranged in the order from the inner edge pixel to the outer edge pixel, and this is taken as the gray-scale gradient sequence of the outer edge pixel.
[0016] Optionally, the specific method for obtaining the inner and outer edges of the target initial defect region includes:
[0017] For any gradient curve segment, obtain the mean and standard deviation of the gradient magnitudes (excluding the maxima) within that segment, the order of the first gradient magnitude in the central gradient sequence, and the edge probabilities of the maxima within that segment. The calculation method is as follows:
[0018]
[0019] in, This indicates the order value of the gradient curve segment among all gradient curve segments in the central gradient sequence. This represents the maximum value of the order among all gradient curve segments in the central gradient sequence. This represents the standard deviation of the gradient magnitudes, excluding the maxima, within the gradient curve segment. This represents the mean of the gradient magnitudes, excluding the maxima, within the gradient curve segment. This represents the maximum value in the gradient curve segment, that is, the last gradient magnitude in the gradient curve segment; Represents an exponential function with the natural constant as its base;
[0020] The maximum value corresponding to the maximum edge possible factor of each gradient curve segment in the central gradient curve is taken as the edge maximum value of the central gradient curve, and the corresponding pixel is taken as the inner edge pixel. All edge pixels on the closed edge of the target initial defect region are taken as outer edge pixels, and the outer edge is obtained. The corresponding inner edge pixels are obtained for all outer edge pixels, and all inner edge pixels are smoothly connected to obtain the inner edge.
[0021] Optionally, the specific method for obtaining several defect region pairs includes:
[0022] For any defect region to be tested in a hole wall surface image from any viewpoint, obtain the coordinates and area of the center of the defect region; obtain the average gray value of all pixels in the defect region as the gray value of the defect region.
[0023] A bipartite graph is constructed based on the defect regions to be tested in the surface images of the cave wall from two perspectives. All defect regions to be tested in the surface images of the cave wall from one perspective are taken as left nodes, and all defect regions to be tested in the surface images of the cave wall from the other perspective are taken as right nodes. For any two defect regions to be tested between the two nodes, the Euclidean norm is calculated based on the difference between the center coordinates, area and grayscale values of the two defect regions to be tested, which is used as the degree of matching difference between the two defect regions to be tested. The degree of matching difference is used as the boundary value between the corresponding two nodes, thereby obtaining the boundary value between the two nodes in the bipartite graph.
[0024] KM matching is performed on the bipartite graph, and the rule of smaller boundary value is more matching is adopted to obtain several pairs of matching nodes. The two defect regions to be tested corresponding to the matching node pairs are taken as a pair of defect regions, and several pairs of defect regions in the dual-view hole wall surface image are obtained.
[0025] Optionally, the deformation influence factor of each defect region to be tested is obtained by the following method:
[0026] For any edge pixel on the outer edge of any defect region to be tested, which is the outer edge pixel, obtain the grayscale gradient sequence of the outer edge pixel and the corresponding inner edge pixel; obtain the tangent direction of each outer edge pixel and each inner edge pixel; and obtain the deformation influence factor of the defect region to be tested. The calculation method is as follows:
[0027]
[0028]
[0029] in, This represents the standard deviation of the grayscale value difference between all corresponding inner edge pixels and outer edge pixels in the defect area to be tested. This indicates the number of pixels at the outer edge of the defect region being tested. Indicates the first The angle between the tangent direction of an outer edge pixel and the tangent direction of its corresponding inner edge pixel. Indicates the first The gradient factor of the grayscale gradient sequence of the outer edge pixels; Indicates the first The mean of the absolute values of the differences between adjacent gray values in the gray-level gradient sequence of each outer edge pixel. Indicates the first The number of gray values in the gray-level gradient sequence of each outer edge pixel. Indicates the first In the grayscale gradient sequence of the outer edge pixels, the first... Each grayscale value Indicates the first In the grayscale gradient sequence of the outer edge pixels, the first... One grayscale value; Represents the absolute value function. Represents the cosine trigonometric function. This represents an exponential function with the natural constant as the base, and 255 is the upper limit of the range of grayscale values; Hyperparameters are used to avoid the fraction becoming meaningless when the denominator is 0.
[0030] Optionally, the specific method for obtaining the core deformation degree of each defect region pair includes:
[0031] Based on the overall curvature change of the deformed region and the differences between internal gradients, the curvature performance value and gradient gradation factor of the deformed region of each test defect region in the defect region are obtained.
[0032] Using the deformation influence factor of the corresponding defect region to the deformed region as the weight, the gradient gradient factor of the deformed region is weighted to obtain the weighted gradient gradient factor of the deformed region; based on the difference in curvature performance value of the deformed regions of the two defect regions to be tested in the defect region pair, and the difference in the weighted gradient gradient factor, the core deformation degree of the defect region pair is obtained. The core deformation degree is negatively correlated with the difference in curvature performance value and the difference in the weighted gradient gradient factor.
[0033] Optionally, the curvature performance value and gradient gradation factor of the deformed region of each defect region to be tested in the defect region pair are obtained by the following method:
[0034] For any defect region centered on two test defect regions, for any one of the deformed regions, the curvature of several curve segments on the outer edge of the deformed region is obtained and the average value is calculated as the curvature performance value of the deformed region.
[0035] For any outer edge pixel and its inner edge pixel in the deformed region, the difference between the gradient magnitude of the outer edge pixel and the gradient magnitude of its inner edge pixel is obtained. The sum of the difference and the gray value of the inner edge pixel is used as the gradient change factor of the outer edge pixel. The gradient factors of all outer edge pixels in the deformed region are weighted and normalized to obtain the gradient weight of each outer edge pixel. The gradient change factors of each outer edge pixel are weighted and summed based on the gradient weight, and the result is used as the gradient gradient factor of the deformed region.
[0036] Optionally, the specific method for obtaining the final crack region and defect size of each defect region pair includes:
[0037] The union of the deformed regions of the two test defect regions in a defect region pair where the core deformation degree is greater than the core deformation influence threshold is taken as the final crack region of the defect region pair; if the core deformation degree is less than or equal to the core deformation influence threshold, the intersection of the core regions of the two test defect regions in the defect region pair is taken as the final crack region.
[0038] For any final crack region, obtain the minimum bounding rectangle of the final crack region, and take the diagonal length of the minimum bounding rectangle as the defect size of the final crack region.
[0039] This invention also proposes a tunnel wall crack detection system, which includes:
[0040] The tunnel wall image acquisition module is used to acquire dual-view images of the tunnel wall surface using an industrial camera, and to obtain the gradient of each pixel in the dual-view images of the tunnel wall surface.
[0041] The cavity wall defect analysis module is used to perform edge detection on the cavity wall surface image. Several initial defect regions are obtained through connected component analysis. The gradient changes of the edges of each initial defect region to the inside and outside of the region are analyzed to obtain the inner and outer edges of each initial defect region. Then, each defect region to be tested, its core region and deformation region are obtained. The defect regions to be tested in the cavity wall surface image from two perspectives are matched according to their distribution and size, as well as their internal grayscale performance, to obtain several defect region pairs.
[0042] The similarity between the inner and outer edges of the defect region to be tested is analyzed. Combined with the gray-scale change between the core region and the deformed region, the deformation influence factor of each defect region to be tested is quantified. The difference between the deformed regions of the two defect regions to be tested in the defect region pair is analyzed. Based on the overall curvature change and the difference between the internal gradients of the deformed regions, combined with the difference in the deformation influence factor of the defect regions to be tested, the core deformation degree of each defect region pair is obtained.
[0043] The tunnel wall crack detection module is used to obtain the final crack area and defect size of each defect area pair based on the core deformation degree of each defect area pair, as well as the core area and deformation area of the defect area to be tested; based on the final crack area, the crack contour of the tunnel wall surface image is extracted, and the tunnel wall quality is rated in combination with the defect size.
[0044] The present invention also proposes a tunnel wall crack detection device, which includes a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, it implements the steps of the above method.
[0045] The beneficial effects of this invention are: This invention uses an industrial camera to acquire images of the tunnel wall in a long tunnel in real time. Based on the changes in the outer deformation of the defect area in the dual-view tunnel wall surface images, it determines whether the deformation is strongly correlated with the core of the defect. That is, it can identify the changes in three-dimensional volume under dual-view, thereby performing difference analysis and judgment on the deformation areas with large three-dimensional changes affected by other factors and the deformation areas strongly correlated with the core. Attached Figure Description
[0046] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0047] Figure 1 This is a schematic flowchart of a method for detecting cracks in tunnel walls according to an embodiment of the present invention;
[0048] Figure 2 The diagram below shows a structural block diagram of a tunnel wall crack detection system provided in another embodiment of the present invention. Detailed Implementation
[0049] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0050] Please see Figure 1 The diagram illustrates a flowchart of a method for detecting cracks in tunnel walls according to an embodiment of the present invention. The method includes the following steps:
[0051] Step S001: Acquire dual-view images of the tunnel wall surface using an industrial camera, and obtain the gradient of each pixel in the dual-view images of the tunnel wall surface.
[0052] The purpose of this embodiment is to acquire images of the tunnel wall in a long tunnel in real time using an industrial camera. Based on the changes in the outer deformation of the defect area in the dual-view tunnel wall surface images, it is determined whether the deformation is strongly correlated with the core defect. That is, the changes in three-dimensional volume can be identified under dual-view. In this way, the differences between the deformation areas with large three-dimensional changes affected by other factors and the deformation areas strongly correlated with the core are analyzed and judged. Therefore, it is necessary to first acquire dual-view tunnel wall surface images.
[0053] Specifically, industrial cameras are deployed in the long tunnel walls to capture images of the tunnel walls below the cameras in real time, obtaining dual-view tunnel wall images. Through preprocessing, including grayscale conversion and filtering for noise reduction, dual-view tunnel wall surface images are obtained. The gradient of each pixel in the tunnel wall surface image from either viewpoint is obtained by using the Sobel operator, resulting in the gradient of each pixel, including the gradient magnitude and gradient direction.
[0054] It should be noted that the extraction of crack contours in tunnel walls is mainly used to determine the size of defects based on crack contours, and to rate the quality of tunnel walls in combination with the number of defects. However, due to the interference between different defects, and the fact that the three-dimensional volume of each defect changes in the tunnel wall, there are obvious core areas and deformed areas affected by interference in the defect area. It is necessary to determine whether the deformed areas are entirely affected by the core area of the corresponding defect, and then clarify the defect size of the defect area for subsequent crack contour extraction and tunnel wall quality rating.
[0055] Step S002: Perform edge detection on the surface image of the cave wall and obtain several initial defect regions through connected component analysis; analyze the gradient changes of the edges of each initial defect region to the inside and outside of the region to obtain the inner and outer edges of each initial defect region, and then obtain each defect region to be tested, its core region and deformation region; match the defect regions to be tested in the dual-view cave wall surface image according to their distribution and size, as well as their internal grayscale performance, to obtain several defect region pairs.
[0056] Preferably, in one embodiment of the present invention, edge detection is performed on the surface image of the cavity wall, and several initial defect regions are obtained through connected component analysis. The specific method includes:
[0057] For any viewpoint of the cave wall surface image, based on the gradient of each pixel, several edges of the cave wall surface image are obtained by the Canny edge detection algorithm; based on the obtained edges, connected component analysis is performed to obtain several edge-closed regions, which are used as several initial defect regions in the cave wall surface image.
[0058] It should be noted that all gradient changes detected in the tunnel wall are used for subsequent quality assessment. That is, the connected regions formed by the closed edges created by the gradient changes are all regarded as defects. The initial defect region is obtained through edge detection and connected region analysis. Since the three-dimensional volume changes caused by defects in the tunnel wall will cause deformation near the defects, it will affect the distribution of edges and connected regions. That is, there may be a situation where one closed edge is completely inside the connected region formed by another closed edge. At the same time, for closed edges that do not contain other closed edges or are contained by other closed edges, it is also necessary to extend them inward or outward, obtain their inner or outer edges based on the gradient changes, and then construct the core region with the inner edge and the deformation region with the outer edge for subsequent analysis.
[0059] Preferably, in one embodiment of the present invention, the gradient changes from the edge of each initial defect region to the inside and outside of the region are analyzed to obtain the inner edge and outer edge of each initial defect region, thereby obtaining each defect region to be tested, its core region, and its deformed region. The specific method includes:
[0060] Any initial defect region is designated as the current initial defect region. For the current initial defect region and its closed edge, other initial defect regions completely contained by the current initial defect region or other initial defect regions completely contained by the current initial defect region are obtained. If the current initial defect region is completely contained, it is designated as a defect region to be tested, and is designated as the core region of the defect region to be tested. The portion of other initial defect regions that completely contain the current initial defect region, excluding the current initial defect region, is designated as the deformed region of the defect region to be tested. If the current initial defect region completely contains another initial defect region, the other initial defect region that is completely contained is designated as a defect region to be tested, and is designated as the core region of the defect region to be tested. The portion of the current initial defect region that excludes the other initial defect region is designated as the deformed region of the defect region to be tested. The closed edge of the core region is designated as the inner edge of the defect region to be tested, and the closed edge of the deformed region is designated as the outer edge of the defect region to be tested.
[0061] It should be noted that two initial defect regions that are in a complete containment relationship are most likely the core region and deformed region of a single defect region, and the closed edge gradients of both regions are relatively obvious and can be directly obtained through the containment relationship. On the other hand, if the initial defect region does not have a containment relationship, since its edge gradient is obvious, there is no need to perform gradient change analysis outward, that is, the closed edge has already been formed, and the external gradient change is not significantly related to the initial defect region. However, when performing gradient traversal inward, the gradient may not be obvious because the deformed region of the defect region is greatly affected by the core region, resulting in a gradual change in grayscale. Consequently, the inner edge of the core region cannot be directly obtained through edge detection, and it is necessary to extract the inner edge through gradient traversal.
[0062] Specifically, for any initial defect region that does not have an inclusive relationship, the center of the initial defect region is obtained. For any edge pixel on its closed edge, the edge pixel is connected to the center of the initial defect region to obtain the center line of the edge pixel. The gradient magnitudes of each pixel on the center line are arranged according to the order in which the edge pixels point to the center to obtain the center gradient sequence of the edge pixels. A coordinate system is constructed with the order value as the horizontal axis and the gradient magnitude value as the vertical axis. The elements in the center gradient sequence are mapped to obtain the center gradient curve of the center gradient sequence. Several maxima in the center gradient curve are extracted, and the center gradient curve is divided into several gradient curve segments by the maxima. The maxima are the peak values in the center gradient curve. The peak value extraction adopts the existing algorithm. In this embodiment, the AMPD algorithm is used for extraction, and each maxima is taken as the last data point in each gradient curve segment.
[0063] Furthermore, for any gradient curve segment, obtain the mean and standard deviation of the gradient magnitudes (excluding the maxima) within that segment, as well as the order of the first gradient magnitude in the central gradient sequence. Then, the marginal probability factors of the maxima within that gradient curve segment are... The calculation method is as follows:
[0064]
[0065] in, This indicates the order of the gradient curve segment among all gradient curve segments in the central gradient sequence (the gradient curve segments are arranged in order from left to right on the horizontal axis). This represents the maximum value of the order among all gradient curve segments in the central gradient sequence. This represents the standard deviation of the gradient magnitudes, excluding the maxima, within the gradient curve segment. This represents the mean of the gradient magnitudes, excluding the maxima, within the gradient curve segment. This represents the maximum value in the gradient curve segment, that is, the last gradient magnitude in the gradient curve segment; This represents an exponential function with the natural constant as its base.
[0066] It should be noted that, due to the gradual change in grayscale from the inner edge of the core region to the outer edge of the deformed region, the gradient magnitudes are relatively similar, and the corresponding standard deviation should be small. For the maximum value, the greater the difference between it and other gradient magnitudes in the gradient curve segment, the more likely it is to be a larger gradient corresponding to an undetected inner edge. At the same time, the more other gradient curve segments exist before the gradient curve segment, the less reference value its maximum value has. That is, due to the gradual change in grayscale, the maximum value will appear less frequently, and the earlier the maximum value appears, the more likely it is to be a larger gradient of the inner edge. This is used to obtain the edge probability factors of the maximum value in each gradient curve segment.
[0067] Furthermore, the maximum value corresponding to the maximum value of the edge possible factor of each gradient curve segment in the central gradient curve is taken as the edge maximum value of the central gradient curve, and the corresponding pixel is taken as the inner edge pixel. All edge pixels on the closed edge of the initial defect region are taken as outer edge pixels, and the outer edge is obtained. The corresponding inner edge pixels are obtained for all outer edge pixels, and all inner edge pixels are smoothly connected to obtain the inner edge. The area surrounded by the inner edge is taken as a defect region to be tested, and is recorded as the core region of the defect region to be tested. The initial defect region is taken as the deformation region of the defect region to be tested. At the same time, for any outer edge pixel and its corresponding inner edge pixel, the gray values of all pixels on the line connecting the inner edge pixel and the outer edge pixel are arranged in the order from the inner edge pixel to the outer edge pixel, and taken as the gray-level gradient sequence of the outer edge pixel.
[0068] Furthermore, the core region and deformation region are determined and obtained for all initial defect regions, resulting in several defect regions to be tested, as well as their core regions and deformation regions.
[0069] It should be further explained that the industrial camera acquires surface images of the same object from different perspectives twice in order to present its three-dimensional appearance. At the same time, the regional distribution positions in the two hole wall surface images do not change significantly. Since the core area is the defect, it does not cause significant three-dimensional deformation. The gradient changes in the hole wall surface images from both perspectives are similar. By matching the size of the defect area, defect area pairs corresponding to the same defect are obtained. This is used for subsequent analysis of the three-dimensional appearance changes based on the two perspectives to determine whether the deformed area is affected by the core area.
[0070] Preferably, in one embodiment of the present invention, the defect regions to be tested in the dual-view cavity wall surface images are matched according to their distribution and size, as well as their internal grayscale representation, to obtain several defect region pairs. The specific method includes:
[0071] For any defect region to be tested in the surface image of the cave wall from any viewpoint, obtain the coordinates and area of the center (spatial center, the method of obtaining it is existing technology and will not be described in detail) of the defect region to be tested. The coordinate system is constructed with the lower left corner of the cave wall surface image as the origin, the horizontal direction to the right as the positive direction of the horizontal axis, and the vertical direction upward as the positive direction of the vertical axis. The average gray value of all pixels in the defect region to be tested is obtained as the gray value of the defect region to be tested.
[0072] Furthermore, a bipartite graph is constructed based on the defect regions to be tested in the dual-view images of the cave wall surface. All defect regions to be tested in the cave wall surface image from one view are taken as left nodes, and all defect regions to be tested in the cave wall surface image from the other view are taken as right nodes. For any two defect regions to be tested between the two nodes, the Euclidean norm is calculated based on the difference between the center coordinates, area, and grayscale values of the two defect regions to be tested, which is used as the degree of matching difference between the two defect regions to be tested. The degree of matching difference is used as the boundary value between the corresponding two nodes to obtain the boundary value between the two nodes in the bipartite graph. KM matching is performed on the bipartite graph, and the rule of smaller boundary value means better matching is adopted to obtain several pairs of matching nodes. The two defect regions to be tested corresponding to the matching node pair are taken as a pair of defect regions, thus obtaining several pairs of defect regions in the dual-view images of the cave wall surface.
[0073] Thus, the defect region to be tested is extracted through edge detection and connected component analysis. Based on the distribution between closed edges and the gradient changes as they extend inward or outward, the inner and outer edges are extracted to obtain the core region and the deformation region. This reflects the manifestation of the three-dimensional deformation of the tunnel wall caused by the defect in the tunnel wall in the dual-view perspective. Based on this, the defect region to be tested is matched between the tunnel wall surface images in the dual perspective to obtain the defect region pairs corresponding to the same defect, which are then used for subsequent three-dimensional representation analysis to determine the actual defect region.
[0074] Step S003: Analyze the similarity between the inner and outer edges of the defect area to be tested, and combine the gray-scale changes between the core area and the deformed area to quantify the deformation influence factor of each defect area to be tested; perform difference analysis on the deformed areas of the two defect areas to be tested in the defect area pair, and based on the overall curvature change and the difference between the internal gradients of the deformed areas, combined with the difference in the deformation influence factor of the defect areas to be tested, obtain the core deformation degree of each defect area pair.
[0075] It should be noted that in analyzing whether the deformed area is strongly correlated with the core area, it is necessary to analyze the relationship between the deformed area and the core area themselves, as well as the changes in the deformed area from both perspectives. Regarding the relationship between the deformed area and the core area, if the inner and outer edges are similar in overall direction and change from the inner edge to the outer edge, the grayscale will show a gradual change due to the influence of the defect itself. This can be used to quantify the strong correlation between the inner and outer edges, and the deformation influence factor can be used to reflect the gradient influence of the core area on the deformed area. On the other hand, if the correlation is weak, there will be a large difference in direction, that is, the overall direction of the inner and outer edges is not closely related, and the grayscale changes in the deformed area are not significantly related to the grayscale of the core area.
[0076] Preferably, in one embodiment of the present invention, the similarity between the inner and outer edges of the defect region to be tested is analyzed, and the deformation influence factor of each defect region to be tested is quantified by combining the gray-scale change performance between the core region and the deformed region. The specific method includes:
[0077] For any edge pixel on the outer edge of any defect region to be tested, which is the outer edge pixel, obtain the grayscale gradient sequence of the outer edge pixel and the corresponding inner edge pixel (if it has already been obtained, it is obtained directly; if the defect region to be tested is composed of two initial defect regions, then connect the outer edge pixel with the center of the defect region (core region) to obtain a line, and the pixel that passes through the inner edge is the corresponding inner edge pixel, and obtain the corresponding grayscale gradient sequence based on the inner and outer edge pixels); obtain the tangent direction of each outer edge pixel and each inner edge pixel, that is, the vertical direction of the gradient direction. In this embodiment, the tangent direction is obtained counterclockwise (there are two vertical directions of the gradient direction, and the counterclockwise one is extracted as the tangent direction), then the deformation influence factor of the defect region to be tested is obtained. The calculation method is as follows:
[0078]
[0079]
[0080] in, This represents the standard deviation of the gray value difference between all corresponding inner edge pixels and outer edge pixels in the defect area to be tested. That is, the difference is obtained by subtracting the gray value of the inner edge pixel from the gray value of any corresponding outer edge pixel, and then calculating the standard deviation based on the gray value difference obtained from all outer edge pixels. This indicates the number of pixels at the outer edge of the defect region being tested. Indicates the first The angle between the tangent direction of an outer edge pixel and the tangent direction of its corresponding inner edge pixel. Indicates the first The gradient factor of the grayscale gradient sequence of the outer edge pixels; Indicates the first The mean of the absolute values of the differences between adjacent gray values in the gray-level gradient sequence of each outer edge pixel. Indicates the first The number of gray values in the gray-level gradient sequence of each outer edge pixel. Indicates the first In the grayscale gradient sequence of the outer edge pixels, the first... Each grayscale value Indicates the first In the grayscale gradient sequence of the outer edge pixels, the first... One grayscale value; Represents the absolute value function. Represents the cosine trigonometric function. This represents an exponential function with the natural constant as its base, and 255 is the upper limit of the grayscale value range. In this embodiment, it is used to... Perform normalization processing; To avoid hyperparameters that render fractions meaningless due to denominators of 0, this embodiment employs... To narrate.
[0081] It should be noted that, during the diffusion process from the inner edge to the outer edge in the grayscale gradient sequence, as the grayscale value increases from a smaller value in the core area to a larger value in the deformed area, a gradient analysis is performed on the increase and decrease of adjacent grayscale values. The larger the proportion of adjacent grayscale values that are all increasing, the closer the gradient factor will be to 1, and the more the grayscale gradient sequence conforms to the overall growth trend. At the same time, the smaller the absolute value of the difference between adjacent grayscale values, the more it conforms to the grayscale value gradient characteristics, and the larger the gradient factor will be. The smaller the angle between the tangent directions of the corresponding inner and outer edge pixels, the larger the cosine value, and the greater the reference value for the gradient factor. Combining the difference between the first and last grayscale values of the grayscale gradient sequence, i.e., the difference between the inner and outer edge pixels, and calculating the standard deviation of the difference of all grayscale sequences, the smaller the standard deviation, the more similar the gradient trend and amplitude of the entire deformed area, and the larger the corresponding deformation influence factor.
[0082] It is further necessary to explain that, in the defect area pair, the deformation areas of the two defect areas to be tested need to be analyzed to determine whether they are areas affected by the core area. Areas that are significantly affected by the core area should be considered as defect areas, and their gradient changes will not show significant differences in the dual-view tunnel wall surface images, with no significant curvature changes. On the other hand, the deformation influence factor of the deformation area that is not affected by the core area will be smaller. At the same time, due to the three-dimensional changes in the tunnel wall under dual-view changes, there will be significant gradient and curvature changes between the deformation areas of the two defect areas to be tested. The influence of the core area on the deformation area is judged by combining the deformation influence factor, and the degree of core deformation is quantified.
[0083] Preferably, in one embodiment of the present invention, a difference analysis is performed on the deformed regions of the two test defect regions in a defect region pair. Based on the overall curvature change and the difference between the internal gradients of the deformed regions, combined with the difference in deformation influence factors of the test defect regions, the core deformation degree of each defect region pair is obtained. The specific method includes:
[0084] For any defect region aligning with two other defect regions to be tested, for any one of the deformed regions, the curvature of several curve segments on the outer edge of the deformed region is obtained and the average value is calculated as the curvature representation value of the deformed region (curvature calculation is existing technology and will not be elaborated in this embodiment); for any outer edge pixel and its inner edge pixel of the deformed region, the difference between the gradient magnitude of the outer edge pixel and the gradient magnitude of its inner edge pixel is obtained, and the sum of the difference and the gray value of the inner edge pixel is used as the gradient change factor of the outer edge pixel; the gradient factors of all outer edge pixels in the deformed region are weighted and normalized to obtain the gradient weight of each outer edge pixel, and the gradient change factors of each outer edge pixel are weighted and summed based on the gradient weight, and the result is used as the gradient gradient factor of the deformed region.
[0085] Furthermore, using the deformation influence factor of the deformed region corresponding to the test defect region as the weight, the gradient gradient factor of the deformed region is weighted to obtain the weighted gradient gradient factor of the deformed region; based on the difference in curvature performance value of the deformed regions of the two test defect regions in the defect region pair, and the difference in the weighted gradient gradient factor, the core deformation degree of the defect region pair is obtained, and the core deformation degree is negatively correlated with the difference in curvature performance value and the difference in the weighted gradient gradient factor.
[0086] As an example, the product of the absolute difference in curvature values of the deformed regions of the two test defect regions in the defect region pair and the absolute difference in the weighted gradient gradient factor, and the result of inverse normalization, is taken as the core deformation degree of the defect region pair.
[0087] It should be noted that the smaller the curvature difference between deformed regions, the smaller the 3D volume change in both perspectives, and the greater the likelihood of a strong correlation with the core region. Simultaneously, based on the grayscale and gradient between inner and outer edge pixels, the gradient changes of each outer edge pixel are weighted and summed with a gradient factor. This gradient gradient factor is obtained by combining the gradient difference with the grayscale gradient change. Furthermore, the gradient gradient factor is weighted and compared considering the influence of deformation factors, meaning that the gradient change characteristics are affected by the grayscale gradient. A smaller difference also indicates a smaller gradient difference in the deformed region, suggesting a greater influence from the core region, thus determining the degree of core deformation.
[0088] Thus, by performing a similarity analysis on the inner and outer edges and combining the gray-scale gradient characteristics between the inner and outer edges, we preliminarily analyze the influence factors of the core region on the deformation area of the defect region to be tested, reflecting the correlation between the deformation area and the core region. Based on this, we conduct a difference analysis on the deformation areas in the defect region pair, comprehensively judge whether the defect region to be tested in the defect region pair has spread to the deformation area, and reflect whether the deformation area needs to be considered in the defect region by the core deformation degree.
[0089] Step S004: Based on the core deformation degree of each defect region pair, and the core region and deformation region of the defect region to be tested, obtain the final crack region and defect size of each defect region pair; extract the crack contour of the tunnel wall surface image based on the final crack region, and combine the defect size to perform quality rating of the tunnel wall.
[0090] Preferably, in one embodiment of the present invention, the final crack area and defect size of each defect area pair are obtained based on the core deformation degree of each defect area pair and the core area and deformation area of the defect area to be tested. The specific method includes:
[0091] A core deformation influence threshold is preset. In this embodiment, the core deformation influence threshold is described as 0.6. The union (union of pixels) of the deformed regions of the two test defect regions in the defect region pair where the core deformation degree is greater than the core deformation influence threshold is taken as the final crack region of the defect region pair (the deformed region as a whole includes the core region). If the core deformation degree is less than or equal to the core deformation influence threshold, the intersection of the core regions of the two test defect regions in the defect region pair is taken as the final crack region.
[0092] It should be noted that during the matching process of the defect area to be tested in the dual-view images of the hole wall surface, the industrial camera does not significantly change the position of the area in the image. The deformed areas are strongly correlated with the core area, so the final crack area is constructed by obtaining the union. If the deformed areas are not considered, the final crack area needs to be constructed by the intersection of the core areas to avoid the influence of the deformed areas.
[0093] Furthermore, for any final crack region, the minimum bounding rectangle of the final crack region is obtained, and the diagonal length of the minimum bounding rectangle is taken as the defect size of the final crack region.
[0094] It should be further noted that since the final crack area is obtained by taking the union of the deformed areas of the defect area and the core area of the defect area to be tested, the corresponding area is the same in the dual-view tunnel wall surface image. Therefore, it is no longer necessary to specify which view of the tunnel wall surface image it belongs to. Crack contour is extracted based on the final crack area to determine the type of defect, and the quality rating of the tunnel wall is determined by combining the defect size.
[0095] Preferably, in one embodiment of the present invention, the method for extracting the crack contour from the tunnel wall surface image based on the final crack region and combining it with the defect size to perform a quality rating of the tunnel wall includes:
[0096] For each final crack region, the contour of the defect corresponding to the final crack region is extracted based on the determined region using a contour extraction algorithm. The contour extraction algorithm can be performed using edge detection or other algorithms, which are well-known technologies and will not be described in detail in this embodiment.
[0097] Furthermore, based on the extracted crack contours and defect dimensions, the tunnel wall defect detection system can automatically classify defects and intelligently rate the quality of the tunnel wall based on the defect size and the number of defects in each category.
[0098] Thus, dual-view images of the tunnel wall surface are acquired using an industrial camera, and initial defect areas are initially extracted. Through edge and gradient expansion analysis, the defect areas to be tested, as well as their core and deformation areas, are determined. The defect areas to be tested in the dual-view tunnel wall surface images are matched to obtain defect area pairs. The correlation between the core and deformation areas is analyzed, and deformation area difference analysis is performed based on the defect area pairs to obtain the core deformation degree, reflecting whether the deformation area needs to be considered in the defect area. This eliminates the misjudgment of defect size caused by the three-dimensional volume change due to the close distribution of defects, and thus obtains the final crack area and defect size, realizing the contour extraction of the defect area, and performing subsequent quality rating of the tunnel wall.
[0099] It should be noted that this embodiment adopts... The model is used to represent the inverse proportional relationship and for normalization processing. As input to the model, This represents an exponential function with the natural constant as the base. Implementers can set inverse proportional functions and normalization functions according to the actual situation.
[0100] Please see Figure 2 The diagram illustrates a structural block diagram of a tunnel wall crack detection system according to another embodiment of the present invention. The system includes:
[0101] The tunnel wall image acquisition module 101 acquires tunnel wall surface images from two perspectives using an industrial camera, and obtains the gradient of each pixel in the tunnel wall surface images from the two perspectives.
[0102] Tunnel wall defect analysis module 102:
[0103] Edge detection is performed on the surface image of the cave wall, and several initial defect regions are obtained through connected component analysis. The gradient changes of the edges of each initial defect region to the inside and outside of the region are analyzed to obtain the inner and outer edges of each initial defect region, and then the defect regions to be tested, as well as their core regions and deformation regions, are obtained. The defect regions to be tested in the dual-view cave wall surface images are matched according to their distribution and size, as well as their internal grayscale representation, to obtain several defect region pairs.
[0104] The similarity between the inner and outer edges of the defect region to be tested is analyzed. Combined with the gray-scale changes between the core region and the deformed region, the deformation influence factor of each defect region to be tested is quantified. The difference between the deformed regions of the two defect regions in the defect region pair is analyzed. Based on the overall curvature change and the difference between the internal gradients of the deformed regions, combined with the difference in the deformation influence factor of the defect regions to be tested, the core deformation degree of each defect region pair is obtained.
[0105] The tunnel wall crack detection module 103 obtains the final crack area and defect size of each defect area pair based on the core deformation degree of each defect area pair and the core area and deformation area of the defect area to be tested; it extracts the crack contour of the tunnel wall surface image based on the final crack area and performs a quality rating of the tunnel wall in combination with the defect size.
[0106] Another embodiment of the present invention provides a tunnel wall crack detection device, which includes a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, it implements the above-described method steps S001 to S004.
[0107] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for detecting cracks in tunnel walls, characterized in that, The method includes the following steps: The tunnel wall surface images are acquired from two perspectives using an industrial camera, and the gradient of each pixel in the two perspective images is obtained. Edge detection is performed on the surface image of the cave wall, and several initial defect regions are obtained through connected component analysis. The gradient changes of the edges of each initial defect region to the inside and outside of the region are analyzed to obtain the inner and outer edges of each initial defect region, and then the defect regions to be tested, as well as their core regions and deformation regions, are obtained. The defect regions to be tested in the dual-view cave wall surface images are matched according to their distribution and size, as well as their internal grayscale representation, to obtain several defect region pairs. The similarity between the inner and outer edges of the defect region to be tested is analyzed. Combined with the gray-scale change between the core region and the deformed region, the deformation influence factor of each defect region to be tested is quantified. The difference between the deformed regions of the two defect regions to be tested in the defect region pair is analyzed. Based on the overall curvature change and the difference between the internal gradients of the deformed regions, combined with the difference in the deformation influence factor of the defect regions to be tested, the core deformation degree of each defect region pair is obtained. Based on the core deformation degree of each defect region pair, and the core region and deformation region of the defect region to be tested, the final crack region and defect size of each defect region pair are obtained; based on the final crack region, the crack contour of the tunnel wall surface image is extracted, and the tunnel wall quality is rated in combination with the defect size. The specific method for obtaining the inner and outer edges of each initial defect region, and then acquiring each test defect region, its core region, and deformed region, includes the following steps: Any initial defect region is designated as the current initial defect region. For the current initial defect region and its closed edge, other initial defect regions completely contained by the current initial defect region or other initial defect regions completely contained by the current initial defect region are acquired. If the current initial defect region is completely contained, it is designated as a test defect region and simultaneously designated as the core region of the test defect region. The portion of other initial defect regions completely containing the current initial defect region, excluding the current initial defect region, is designated as the deformed region of the test defect region. If the current initial defect region completely contains another initial defect region, the completely contained other initial defect region is designated as a test defect region and designated as the core region of the test defect region. The portion of the current initial defect region excluding the other initial defect region is designated as the deformed region of the test defect region. The closed edge of the core region is designated as the inner edge of the test defect region, and the closed edge of the deformed region is designated as the outer edge of the test defect region. Any initial defect region without a containment relationship is designated as the core region. The initial defect region is used as the target initial defect region. The center of the target initial defect region is obtained. For any edge pixel on its closed edge, the edge pixel is connected to the center of the target initial defect region to obtain a center line connecting the edge pixels. The gradient magnitudes of the pixels along this center line are arranged according to the order in which the edge pixels point towards the center, resulting in the center gradient sequence and its center gradient curve. Several maxima are extracted from the center gradient curve, and the center gradient curve is divided into several gradient curve segments based on these maxima. The differences between the maxima and other gradient magnitudes in each gradient curve segment are analyzed. The fluctuations of other gradient amplitudes, combined with the distribution of gradient curve segments in the central gradient curve, yield the inner and outer edges of the target initial defect region. The region enclosed by the inner edge of the target initial defect region is taken as a test defect region and recorded as the core region of the test defect region. The target initial defect region is taken as the deformation region of the test defect region. For any outer edge pixel and its corresponding inner edge pixel, the gray values of all pixels on the line connecting the inner edge pixel and the outer edge pixel are arranged in the order from the inner edge pixel to the outer edge pixel, as the gray-scale gradient sequence of the outer edge pixel. The specific methods for obtaining several defect region pairs are as follows: For any defect region to be tested in a cave wall surface image from any viewpoint, obtain the coordinates and area of the center of the defect region; obtain the average gray value of all pixels in the defect region as the gray value of the defect region; construct a bipartite graph based on the defect regions to be tested in the cave wall surface images from both views, taking all defect regions to be tested in the cave wall surface images from one viewpoint as left nodes and all defect regions to be tested in the cave wall surface images from the other viewpoint as right nodes. For any two defect regions to be tested between the two nodes, calculate the Euclidean norm based on the difference between the center coordinates, area, and gray value of the two defect regions to be tested, as the degree of matching difference between the two defect regions to be tested, and take the degree of matching difference as the boundary value between the corresponding two nodes to obtain the boundary value between the two nodes in the bipartite graph; perform KM matching on the bipartite graph, adopting the rule that the smaller the boundary value, the better the match, to obtain several pairs of matching nodes. Take the two defect regions to be tested corresponding to the matching node pair as a pair of defect regions to obtain several pairs of defect regions in the cave wall surface images from both views. The deformation influence factor of each defect region to be tested is obtained as follows: For any edge pixel on the outer edge of any defect region to be tested, which is the outer edge pixel, obtain the grayscale gradient sequence of the outer edge pixel and the corresponding inner edge pixel; obtain the tangent direction of each outer edge pixel and each inner edge pixel; and obtain the deformation influence factor of the defect region to be tested. The calculation method is as follows: in, This represents the standard deviation of the grayscale value difference between all corresponding inner edge pixels and outer edge pixels in the defect area to be tested. This indicates the number of pixels at the outer edge of the defect region being tested. Indicates the first The angle between the tangent direction of an outer edge pixel and the tangent direction of its corresponding inner edge pixel. Indicates the first The gradient factor of the grayscale gradient sequence of the outer edge pixels; Indicates the first The mean of the absolute values of the differences between adjacent gray values in the gray-level gradient sequence of each outer edge pixel. Indicates the first The number of gray values in the gray-level gradient sequence of each outer edge pixel. Indicates the first In the grayscale gradient sequence of the outer edge pixels, the first... Each grayscale value Indicates the first In the grayscale gradient sequence of the outer edge pixels, the first... One grayscale value; Represents the absolute value function. Represents the cosine trigonometric function. This represents an exponential function with the natural constant as the base, and 255 is the upper limit of the range of grayscale values; To avoid hyperparameters where the denominator is 0, rendering the fraction meaningless, the curvature performance value and gradient gradient factor of the deformed region of each test defect region in the defect region pair are obtained based on the overall curvature change of the deformed region and the difference between internal gradients. The gradient gradient factor of the deformed region is weighted using the deformation influence factor of the corresponding test defect region as the weight, resulting in a weighted gradient gradient factor. Based on the difference in curvature performance values of the deformed regions of the two test defect regions in the defect region pair, and the difference in the weighted gradient gradient factor, the core deformation degree of the defect region pair is obtained. The core deformation degree is negatively correlated with both the difference in curvature performance values and the difference in the weighted gradient gradient factor.
2. The method for detecting tunnel wall cracks according to claim 1, characterized in that, The specific method for obtaining the inner and outer edges of the initial defect region of the target is as follows: For any gradient curve segment, obtain the mean and standard deviation of the gradient magnitudes (excluding the maxima) within that segment, the order of the first gradient magnitude in the central gradient sequence, and the edge probabilities of the maxima within that segment. The calculation method is as follows: in, This indicates the order value of the gradient curve segment among all gradient curve segments in the central gradient sequence. This represents the maximum value of the order among all gradient curve segments in the central gradient sequence. This represents the standard deviation of the gradient magnitudes, excluding the maxima, within the gradient curve segment. This represents the mean of the gradient magnitudes, excluding the maxima, within the gradient curve segment. This represents the maximum value in the gradient curve segment, that is, the last gradient magnitude in the gradient curve segment; Represents an exponential function with the natural constant as its base; The maximum value corresponding to the maximum edge possible factor of each gradient curve segment in the central gradient curve is taken as the edge maximum value of the central gradient curve, and the corresponding pixel is taken as the inner edge pixel. All edge pixels on the closed edge of the target initial defect region are taken as outer edge pixels, and the outer edge is obtained. The corresponding inner edge pixels are obtained for all outer edge pixels, and all inner edge pixels are smoothly connected to obtain the inner edge.
3. The method for detecting tunnel wall cracks according to claim 1, characterized in that, The curvature performance value and gradient gradation factor of the deformed region of each test defect region in the defect region pair are obtained by the following method: For any defect region centered on two test defect regions, for any one of the deformed regions, the curvature of several curve segments on the outer edge of the deformed region is obtained and the average value is calculated as the curvature performance value of the deformed region. For any outer edge pixel and its inner edge pixel in the deformed region, the difference between the gradient magnitude of the outer edge pixel and the gradient magnitude of its inner edge pixel is obtained. The sum of the difference and the gray value of the inner edge pixel is used as the gradient change factor of the outer edge pixel. The gradient factors of all outer edge pixels in the deformed region are weighted and normalized to obtain the gradient weight of each outer edge pixel. The gradient change factors of each outer edge pixel are weighted and summed based on the gradient weight, and the result is used as the gradient gradient factor of the deformed region.
4. The method for detecting tunnel wall cracks according to claim 1, characterized in that, The specific method for obtaining the final crack region and defect size of each defect region pair includes: The union of the deformed regions of the two test defect regions in a defect region pair where the core deformation degree is greater than the core deformation influence threshold is taken as the final crack region of the defect region pair. If the core deformation degree is less than or equal to the core deformation influence threshold, the intersection of the core regions of the two test defect regions in the defect region is taken as the final crack region. For any final crack region, obtain the minimum bounding rectangle of the final crack region, and take the diagonal length of the minimum bounding rectangle as the defect size of the final crack region.
5. A tunnel wall crack detection system, characterized in that, This system is used to implement the method for detecting tunnel wall cracks as described in any one of claims 1-4, and the system comprises: The tunnel wall image acquisition module is used to acquire dual-view images of the tunnel wall surface using an industrial camera, and to obtain the gradient of each pixel in the dual-view images of the tunnel wall surface. The cavity wall defect analysis module is used to perform edge detection on the cavity wall surface image. Several initial defect regions are obtained through connected component analysis. The gradient changes of the edges of each initial defect region to the inside and outside of the region are analyzed to obtain the inner and outer edges of each initial defect region. Then, each defect region to be tested, its core region and deformation region are obtained. The defect regions to be tested in the cavity wall surface image from two perspectives are matched according to their distribution and size, as well as their internal grayscale performance, to obtain several defect region pairs. The similarity between the inner and outer edges of the defect region to be tested is analyzed. Combined with the gray-scale change between the core region and the deformed region, the deformation influence factor of each defect region to be tested is quantified. The difference between the deformed regions of the two defect regions to be tested in the defect region pair is analyzed. Based on the overall curvature change and the difference between the internal gradients of the deformed regions, combined with the difference in the deformation influence factor of the defect regions to be tested, the core deformation degree of each defect region pair is obtained. The tunnel wall crack detection module is used to obtain the final crack area and defect size of each defect area pair based on the core deformation degree of each defect area pair, as well as the core area and deformation area of the defect area to be tested; based on the final crack area, the crack contour of the tunnel wall surface image is extracted, and the tunnel wall quality is rated in combination with the defect size.
6. A device for detecting cracks in tunnel walls, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method for detecting cracks in tunnel walls as described in any one of claims 1-4.