Complex background crack image candidate optimization, continuous repair and quantification method and system

By using a dual thresholding and skeleton endpoint bridging technique, the problems of false target interference and discontinuity in crack images under complex backgrounds are solved, and stable extraction of crack candidate regions and accurate quantification of engineering parameters are achieved.

CN122244057BActive Publication Date: 2026-07-24QINGDAO UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
QINGDAO UNIV OF TECH
Filing Date
2026-05-25
Publication Date
2026-07-24

AI Technical Summary

Technical Problem

Existing technologies struggle to accurately identify crack images in complex contexts, exhibiting false target regions, discontinuous slender crack structures, and lacking a stable conversion mechanism from segmentation results to engineering parameters.

Method used

The initial candidate region is generated by using a linkage dual threshold and hysteresis connectivity retention. False responses are removed by screening based on the skeleton length and area ratio. Broken regions are repaired by bridging the skeleton endpoints. Finally, skeletonization and distance transformation are performed to quantize the parameters.

Benefits of technology

It improves the stability and continuity of crack candidate regions, enhances the continuous representation of the main trunk of slender discontinuous cracks, and strengthens the stability and engineering interpretability of crack quantification results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122244057B_ABST
    Figure CN122244057B_ABST
Patent Text Reader

Abstract

The application discloses a complex background crack image candidate optimization, continuous repair and quantification method and system, and belongs to the technical field of computer vision and digital image processing. In order to solve the problems that crack identification is easily disturbed by false targets, cracks are intermittent, and engineering parameters are difficult to be stably quantified under a complex background, a linkage double threshold is determined after a crack response probability graph is acquired, an initial candidate region is generated by reserving a low threshold region connected with a high threshold, a skeleton length and area ratio is calculated as a fine length index for screening, skeleton end points are extracted, a bridging pixel path is generated to realize local repair when different connected domain end points meet preset multi-condition constraints, and the repaired region is skeletonized to construct a graph structure, the number of original skeleton segments, the total number and total length of cracks are counted, and the width statistics, the strike and other parameters are calculated through distance transformation sampling along the skeleton, so that the complex background false targets can be effectively inhibited, the intermittent cracks can be accurately connected, and stable, accurate and interpretable engineering parameters can be output.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of computer vision and digital image processing technology, and in particular to a method and system for candidate optimization, continuous repair and quantization of cracked images with complex backgrounds. Background Technology

[0002] The statements in this section are merely background information related to the present invention and do not necessarily constitute prior art.

[0003] Crack image recognition technology is widely used in the detection of defects in road surfaces, concrete structures, underground rock surfaces, and other engineering projects. Compared to ordinary surfaces, underground rock crack images often have more complex background textures, stronger local interference, and characteristics such as being thin, having weak response, and being discontinuous. This places higher demands on the accuracy of crack candidate generation, the maintenance of structural continuity, and the stable quantification of engineering parameters.

[0004] Existing technologies suffer from the following main problems. First, they are prone to generating false target regions in complex backgrounds. In scenes with complex backgrounds such as stratification, rough textures, shadows, water stains, or local contamination, the initial crack identification results often contain discrete noise or blocky false crack regions caused by background texture interference. Existing methods based on single-threshold segmentation or simple area screening struggle to simultaneously preserve the crack backbone and remove non-target regions. Second, slender crack structures are prone to local discontinuity. Cracks are typically slender, weakly responsive, and directional, making them susceptible to changes in illumination, local occlusion, and weakly textured regions in images. Existing identification results often show local breaks, resulting in the same crack being segmented into multiple independent segments, thus affecting the continuous representation of the crack structure and the accurate statistical analysis of subsequent parameters such as length, direction, and number of cracks. Third, there is a lack of a stable conversion mechanism from segmentation results to engineering parameters. Most existing technologies focus on the crack region segmentation results themselves, making simple estimations based only on area or bounding rectangle, which is insufficient to stably characterize the basic engineering parameters such as the length, width, direction, number, and density of irregular cracks. Meanwhile, crack burr branches and local pseudo-connections are difficult to remove automatically, further reducing the interpretability and statistical stability of the parameter results. Summary of the Invention

[0005] To address the shortcomings of existing technologies, this invention provides a method and system for candidate optimization, continuous repair, and quantization of crack images in complex backgrounds. The method determines linked dual thresholds based on the crack response probability map, retaining low-threshold regions connected to the high-threshold region to generate initial candidate regions. It then uses the ratio of skeleton length to area as a thinness index for screening, removing blocky pseudo-responses and atypical candidate regions in complex backgrounds. By extracting skeleton endpoints and generating bridging pixel paths when two endpoints of different connected domains satisfy multiple constraints, local repair of the fractured region is achieved. Finally, the repaired region is skeletonized and subjected to distance transformation to quantify parameters such as crack number, length, width, orientation, tortuosity, and density. This method solves the problems of initial crack identification results being susceptible to pseudo-target interference, insufficient continuity, and difficulty in stably extracting engineering parameters in complex backgrounds.

[0006] On the one hand, a method for candidate optimization, continuous repair, and quantization of crack images with complex backgrounds is provided, including: Obtain the crack response probability map of the original image; High and low thresholds are determined based on the crack response probability map, and the low threshold is determined according to the high threshold and the preset maximum allowable interval; the low threshold response region connected to the high threshold response region is retained to obtain the initial crack candidate region; Calculate the skeleton length and area of ​​each connected region in the initial crack candidate region, use the ratio of skeleton length to area as the thinness index, and filter according to the preset area threshold and thinness threshold to obtain the optimized crack candidate region; Extract the optimized crack candidate region skeleton and endpoints. When the two endpoints of different connected regions meet the preset multi-condition constraints, generate a bridging pixel path between the two endpoints and merge the corresponding connected regions to obtain the repaired crack region. The repaired crack area is skeletonized and an undirected graph is constructed. The number of original skeleton segments, the total number of cracks, and the total crack length are counted. Distance transformation is performed on the repaired crack area to obtain a distance field distribution map. Local width sequences are obtained by sampling along the skeleton. The width statistics, direction, tortuosity and density are calculated based on the local width sequences, and the quantification results are output.

[0007] Furthermore, the high threshold is determined based on the high quantile value of the crack response probability map, and the low threshold is the larger of the low quantile value of the crack response probability map and the value obtained by subtracting the preset maximum allowable interval from the high threshold.

[0008] Furthermore, the multi-condition constraints include: the Euclidean distance between the two endpoints is less than a preset distance threshold, the angle between the local extension directions of the two endpoints is less than a preset angle threshold, and the average support probability of pixels on the connection path between the two endpoints is greater than a preset probability threshold.

[0009] Furthermore, the repaired crack area is skeletonized and an undirected graph is constructed. The number of original skeleton segments, the total number of cracks, and the total crack length are counted, specifically: Skeletonization extraction is performed on the repaired crack area to obtain the skeleton centerline. The skeleton is represented as an undirected graph structure, where skeleton pixels are nodes and adjacency relationships are edges. Nodes with a degree not equal to 2 are defined as key nodes, and continuous skeleton paths between two adjacent key nodes are defined as original skeleton segments. The number of original skeleton segments is counted. Based on the distance constraints and orientation consistency constraints of the endpoints of adjacent skeleton segments, adjacent skeleton segments that meet the conditions are merged into one crack, and the total number of cracks is counted. The Euclidean distance between adjacent points of each original skeleton segment is accumulated according to the skeleton point sequence, and the total length of the crack is obtained by summing the lengths of all original skeleton segments.

[0010] Furthermore, a distance transformation is performed on the repaired crack area to obtain a distance field distribution map, and a local width sequence is obtained by sampling along the skeleton, specifically: Perform Euclidean distance transformation on the repaired crack region to obtain the distance field from each pixel inside the crack region to the boundary; Sampling is performed along the centerline of the skeleton on the distance field distribution map to obtain the local distance value of each sampling point in the distance field, and twice the local distance value is taken as the local crack width at the sampling point. The local crack widths at each sampling point are arranged in the order of the skeleton points to form a local width sequence.

[0011] Furthermore, the width statistics include at least one of the following: average width, median width, high quantile width, and maximum width.

[0012] Furthermore, the output quantification results also include diagnostic fields related to candidate screening and bridging repair. These diagnostic fields include at least one of the following: the area of ​​newly added bridging regions, the number of bridging endpoint pairs, or the change in the number of connected components before and after screening.

[0013] On the other hand, a system for candidate optimization, continuous repair, and quantization of complex background crack images is provided, including: The initial candidate generation module is configured to: acquire the crack response probability map of the original image; High and low thresholds are determined based on the crack response probability map, and the low threshold is determined according to the high threshold and the preset maximum allowable interval; the low threshold response region connected to the high threshold response region is retained to obtain the initial crack candidate region; The optimization filtering module is configured to: calculate the skeleton length and area of ​​each connected region in the initial crack candidate region, use the ratio of skeleton length to area as the thin length index, and filter according to the preset area threshold and thin length threshold to obtain the optimized crack candidate region; The connection repair module is configured to: extract the optimized crack candidate region skeleton and endpoints; when two endpoints of different connected domains meet the preset multi-condition constraints, generate a bridging pixel path between the two endpoints and merge the corresponding connected domains to obtain the repaired crack region. The quantization module is configured to: skeletonize the repaired crack region and construct an undirected graph; count the number of original skeleton segments, the total number of cracks, and the total length of cracks; perform distance transformation on the repaired crack region to obtain a distance field distribution map; sample along the skeleton to obtain a local width sequence; calculate the width statistics, orientation, tortuosity, and density based on the local width sequence; and output the quantization results.

[0014] In another aspect, a computer device is also provided, including a computer-readable storage medium, a processor, and a computer program stored on the computer-readable storage medium and executable on the processor, wherein when the processor executes the program, it performs the method of the first aspect.

[0015] Furthermore, a computer-readable storage medium is provided on which a computer program is stored, which, when executed by a processor, performs the method of the first aspect.

[0016] The above technical solution has the following advantages or beneficial effects: (1) Improved the stability and purity of crack candidate region extraction under complex backgrounds. By adopting a candidate generation method that combines linked dual thresholds with hysteresis connectivity retention, the low threshold is adjusted in conjunction with the high threshold constraint, and the candidate region is expanded to a limited extent around the high-confidence crack backbone, retaining only the low-threshold candidate region connected to the high-threshold backbone seed. While retaining the high-confidence crack backbone and its connected weak response regions, it effectively suppresses isolated weak responses and background noise; by using a screening method based on the "slender feature constraint of skeleton length and area ratio" to replace the traditional screening method that relies on the aspect ratio of the circumscribed rectangle, it can effectively remove blocky pseudo-targets, locally enlarged regions and other atypical candidate regions formed under complex backgrounds, thereby improving the purity, continuity and stability of crack candidate regions.

[0017] (2) Improved continuous representation of the main structure of slender, discontinuous cracks. By introducing a local bridging repair mechanism based on skeleton endpoints, endpoint distance constraints, directional consistency constraints, and local probability support constraints are applied sequentially between different connected domains to conditionally restore the continuity of discontinuous cracks caused by weak response, local occlusion, or segmentation. Compared to performing global morphological closing operations on the entire crack region, this invention can more specifically compensate for local gaps in cracks, reduce misconnections in non-target regions, and reduce the situation where the same crack is mistakenly segmented into multiple independent segments, thereby improving the integrity of the main structure representation of cracks and facilitating the stable statistical analysis of subsequent parameters such as length, number of cracks, and orientation.

[0018] (3) Improved stability, accuracy, and engineering interpretability of crack quantification results. This invention does not directly measure parameters of the original segmentation results, but uses the crack structure after candidate extraction optimization and local continuity repair as a unified quantification object. Based on this, skeleton expression, distance transformation width estimation, and topological statistical analysis are performed. This reduces the deviations caused by crack fracture, fragmentation, and spurious responses on length, width, orientation, tortuosity, and number of cracks, thus improving the stability and accuracy of the quantification results.

[0019] Meanwhile, this invention can not only output basic parameters such as total crack length, width statistics, and main direction, but also distinguish between the number of original skeleton segments and the number of engineering trunk segments, and output bridging repair-related diagnostic fields, thereby significantly enhancing the engineering interpretability of crack image analysis results and providing more reliable data support for geomechanical analysis, rock mass structure assessment, material damage characterization, and related engineering monitoring scenarios. Attached Figure Description

[0020] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.

[0021] Figure 1 This is a flowchart of the method in Embodiment 1 of the present invention; Figure 2 This is a comparison chart of the dual-threshold hysteresis and connectivity-preserving candidate generation results in Embodiment 1 of the present invention, wherein... Figure 2 In the diagram, (a) is the probability graph of the model output. Figure 2 Image (b) shows the results of a single threshold high threshold. Figure 2 (c) in the image shows the results for a single threshold low threshold. Figure 2 (d) in the figure represents the results of the double threshold hysteresis. Figure 3 This is a schematic diagram of the candidate region screening results based on the thinness index in Embodiment 1 of the present invention, wherein, Figure 3 (a) in the diagram is a schematic diagram of the candidate region with high slenderness. Figure 3 (b) in the diagram is a schematic diagram of the candidate region with low slenderness. Figure 4 This is a partial schematic diagram of crack continuity bridging repair in Embodiment 1 of the present invention, wherein... Figure 4 (a) in the image is a local area diagram before local repair. Figure 4 (b) in the image represents the newly introduced bridging pixel map. Figure 4 (c) in the diagram is a schematic diagram after bridging repair; Figure 5 This is a schematic diagram of crack skeleton extraction and graphical structure representation in Embodiment 1 of the present invention, wherein, Figure 5 Image (a) shows the result of continuous repair of the crack area. Figure 5 (b) in the diagram is a schematic diagram of the centerline of the crack skeleton extracted from the crack region. Figure 5 (c) in the figure represents the crack diagram structure constructed based on the skeleton endpoints and bifurcation points; Figure 6 This is a schematic diagram of crack width estimation based on distance transformation in Embodiment 1 of the present invention, wherein, Figure 6 (a) in the diagram is a map of the cracked area. Figure 6 Image (b) shows the local width field result obtained by performing a distance transformation on the crack region. Figure 6 (c) in the diagram is a schematic diagram of width estimation; Figure 7 This is a schematic diagram illustrating the key states of an underground rock mass fracture image from initial identification to parameter extraction in Embodiment 1 of the present invention, wherein... Figure 7 (a) in the figure shows the initial crack response results. Figure 7 Image (b) shows the post-processed optimized crack region result. Figure 7 (c) in the figure shows the parameter extraction results based on crack skeleton and width sampling. Detailed Implementation

[0022] To make the objectives, technical solutions, and advantages of the present invention clearer, the embodiments of the present invention will be described in further detail below with reference to the accompanying drawings. Those skilled in the art should understand that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the invention.

[0023] It should be noted that the following detailed description is illustrative and intended to provide further explanation of the invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.

[0024] Example 1 This embodiment provides a method for candidate optimization, continuous repair, and quantization of crack images with complex backgrounds. Figure 1The following is an overall flowchart of Embodiment 1 of the present invention. The method includes the following steps: S1: Acquire the original image and generate a crack response probability map; S2: Set a high threshold and a low threshold based on the crack response probability map, where the low threshold is less than the high threshold and the difference between the two is within a preset range; use the high threshold response region as the seed region and retain the low threshold response region connected to it to obtain the initial crack candidate region; S3: Perform connected component analysis on the initial crack candidate region, calculate the skeleton length and area of ​​each connected component, use the ratio of skeleton length to area as the thinness index, and filter according to the preset area threshold and thinness threshold to obtain the optimized crack candidate region. S4: Extract the optimized crack candidate region skeleton and endpoints. When the two endpoints of different connected regions meet the preset bridging constraints, generate a bridging pixel path between the two endpoints and merge the corresponding connected regions to obtain the repaired crack region. The bridging constraints include at least the distance constraint between endpoints, the direction constraint, and the local continuity constraint. S5: The repaired crack area is skeletonized, and a graph structure is constructed based on the skeleton endpoints and bifurcation points to count the number of crack skeleton segments, the number of cracks, and the total crack length. S6: Perform distance transformation on the repaired crack area to obtain a distance field distribution map, sample along the skeleton to obtain a local width sequence, calculate the width statistics, direction, tortuosity and density based on the local width sequence, and output the quantification results.

[0025] In step S1, the original image is first acquired and a crack response probability map is generated.

[0026] Specifically, the original image of the target to be detected is acquired using image acquisition equipment (such as a microscope, industrial camera, or drone). After preprocessing the original image (such as scale normalization, denoising, or enhancement), it is input into a pre-trained deep learning segmentation model (such as U-Net, DeepLabV3+, or a custom convolutional neural network). This model extracts features through an encoder and restores the spatial dimensions through a decoder, finally outputting a pixel-level crack response probability map with the same size as the original image. The value of each pixel in the map represents the confidence probability value of its belonging to the crack target.

[0027] In step S2, based on the crack response probability map obtained in step S1, this step first determines a set of linked dual thresholds, including a high threshold and a low threshold. Unlike traditional fixed thresholds or independent dual thresholds, this invention uses the high quantile value of the response map to determine the high threshold, which is used to extract high-confidence crack backbone seeds. The low threshold is jointly determined based on the maximum allowable interval between the low quantile value of the probability map and the high threshold, so that the low threshold changes in tandem with the high threshold. The low threshold is used to describe the weak response expansion region of the crack. Through this method, the low threshold is always constrained by the high threshold, avoiding the problem of excessive expansion of the candidate region due to the low threshold being too low independently. Thus, the high threshold is responsible for determining the crack backbone seeds, while the low threshold is responsible for limited expansion around the seeds, balancing the preservation of fine cracks and background suppression.

[0028] After determining the linkage dual thresholds, candidate crack regions are further generated based on a dual-threshold hysteresis strategy: high-threshold response regions are used as backbone seed regions, and low-threshold response regions are used as candidate expansion regions. Only low-threshold connected regions that are connected to the backbone seed regions in terms of connectivity are retained, while isolated weak response regions are removed, resulting in initial crack candidate regions. In other words, only low-threshold connected regions containing high-threshold seeds are retained as valid crack candidate regions. This approach avoids introducing too many weak responses from a single low threshold while preserving the continuous expression of elongated cracks and weak cracks as much as possible, thus obtaining candidate crack regions with better continuity.

[0029] This invention employs a combined approach of linked dual-threshold determination and hysteresis connectivity retention to post-process the crack probability map output by the neural network. The low threshold is always constrained by and changes in conjunction with the high threshold, rather than being set independently. This limits the low-threshold candidate region to a controllable expansion range near the high-confidence crack backbone, mitigating the problems of excessive candidate region expansion and background texture ingestion caused by excessively low thresholds. Simultaneously, the dual-threshold hysteresis strategy retains only low-threshold candidate regions connected to the high-threshold backbone seed, effectively suppressing the introduction of isolated noise and spurious responses in complex backgrounds while enhancing the continuous expression of fine and weak cracks.

[0030] In step S3, connected component analysis is performed on the initial crack candidate regions generated in step S2 to remove non-target regions that clearly do not conform to the slender geometric properties of cracks. First, discrete noise regions with areas below a preset threshold are eliminated based on a minimum area threshold. Then, a skeleton is extracted for each remaining candidate connected region, the skeleton length and region area are calculated, and a slenderness index based on the skeleton length-to-area ratio is constructed. The slenderness index is compared with a preset slenderness threshold, and blocky pseudo-response regions, locally swollen regions, or other atypical candidate regions with insufficient slenderness are eliminated. Candidate regions that simultaneously satisfy the minimum area constraint and the slenderness constraint are retained, resulting in the optimized crack candidate regions.

[0031] Compared to traditional methods that rely solely on area thresholds or bounding box aspect ratios, this embodiment uses a skeleton length-to-area ratio and thinness index that is independent of the region's principal direction. This allows for a more stable characterization of the geometric extension features of curved cracks, non-axis-aligned cracks, and cracks with local width variations. It also more effectively distinguishes between genuine thin cracks and blocky pseudo-responses, locally enlarged regions, and atypical candidate regions formed against complex backgrounds. Candidate regions with small areas or insufficient thinness are identified as blocky pseudo-responses, background texture responses, or atypical candidate regions and are discarded. Candidate regions that simultaneously meet both area and thinness thresholds are retained as valid input regions for subsequent crack continuity recovery and quantitative analysis. Through this geometric constraint screening, the purity and stability of the crack candidate results are significantly improved.

[0032] This embodiment selects an image of underground rock fractures as the input sample to illustrate the processing procedure of the present invention in generating and screening fracture candidate regions. First, an initial fracture response map is obtained, and a set of high and low linkage thresholds are determined based on the response value distribution. Then, based on the high and low thresholds, dual threshold hysteresis and connectivity retention candidate generation are performed to extract fracture candidate regions with good continuity.

[0033] like Figure 2 As shown, Figure 2 This is a comparison chart of the dual-threshold hysteresis and connectivity-preserving candidate generation results in Embodiment 1 of the present invention, wherein... Figure 2 In the diagram, (a) is the probability graph of the model output. Figure 2 Image (b) shows the results of a single threshold high threshold. Figure 2 (c) in the image shows the results for a single threshold low threshold. Figure 2 (d) in the figure represents the results of the dual-threshold hysteresis method. Comparative analysis shows that while high-threshold segmentation alone can preserve the main crack region well, it fails to retain weak response regions, easily leading to localized crack thinning, breakage, or omission. Conversely, while low-threshold segmentation alone can preserve more weak response regions, it introduces more discrete noise and blocky pseudo-response regions, resulting in a decrease in the purity of the candidate regions. In contrast, this invention combines dual-threshold hysteresis with connectivity preservation, using high-threshold response regions as the main seed and retaining low-threshold response regions connected to this seed. This enhances the continuous expression of the main crack structure and suppresses the excessive introduction of irrelevant low-response regions, thus obtaining more suitable initial crack candidate regions for subsequent screening.

[0034] To further remove non-target regions that do not conform to the slender structure characteristics of cracks, this invention also introduces geometric constraint screening based on slenderness index. Figure 3 This is a schematic diagram of the screening idea, where, Figure 3 (a) in the diagram is a schematic diagram of the candidate region with high slenderness, which belongs to the candidate region for slender cracks. Figure 3(b) in the diagram is a schematic representation of the candidate region with low slenderness. Combined with... Figure 3 It is evident that slender crack candidates typically possess a high skeleton length-to-area ratio, effectively reflecting the slender and continuous geometric characteristics of cracks. In contrast, blocky pseudo-response regions or locally enlarged regions exhibit low slenderness, failing to conform to the structural properties of typical crack targets. By introducing a slenderness index for candidate screening, residual blocky non-target regions in the dual-threshold hysteresis results can be further eliminated, improving the geometric rationality of candidate crack regions and the purity of results.

[0035] The dual-threshold hysteresis and connectivity-preserving candidate generation in step S2, and the candidate region selection based on the thinness index in step S3, can be implemented using the following exemplary calculation method: (1) Linked adaptive dual threshold mechanism. Let the crack probability map output by the segmentation network be... ,in Represents the image pixel field. Represents pixels The predicted probability of belonging to a crack. Traditional single-threshold methods typically use: ; For pixels Binary classification results under single threshold segmentation This is the threshold used when performing binary segmentation on the probability map. In this method, when the threshold... When the threshold is too high, fine and weak cracks are prone to breakage; when the threshold is too low, background texture and noise will enter the candidate region in large quantities. Therefore, the single threshold method is difficult to balance crack continuity and background suppression.

[0036] Therefore, this embodiment defines a set of linked dual thresholds: ; in, For high threshold, For low threshold, and These represent the probability quantiles corresponding to the high and low thresholds, respectively. This represents the maximum allowable interval between the high and low thresholds. The high threshold is determined by the high quantile of the probability plot. ; in, Represents a probability graph At the quantile level The pixel value at that location. For low thresholds, the lowest quantile candidate value is first selected: ; Then, the correction is made using a linkage function: ; And further boundary constraints are applied: ; Therefore, the final adaptive double threshold function can be written as: ; The above definition guarantees that: ; In other words, the low threshold is always constrained by the high threshold, thus avoiding the problem of excessive expansion of the candidate region that may occur when the low threshold is set independently. Compared with the traditional independent dual-threshold method, this method designs the low threshold as a subordinate threshold to the high threshold, so that it can expand in a controlled manner around the high-confidence crack region, rather than introducing weak background responses without restriction.

[0037] (2) Dual-threshold lag candidate generation. Based on the above, the final crack mask is constructed by combining the lag threshold retention strategy. The high-confidence seed set and the low-threshold candidate set are defined as follows: ; in, For image pixels, For the pixel domain of the original image, Indicates high threshold Extracted high-confidence seed set, Indicates low threshold The extracted candidate set obviously has .set up Represents the candidate set The final crack mask is defined as follows: (The decomposition of the 8-neighborhood connected components is then performed.) ; Equivalently, it can also be written as: ; This means that only low-threshold connected regions containing high-confidence seeds are retained. In this mechanism, a high threshold is responsible for identifying stable crack cores, a low threshold is responsible for retaining weak crack responses in their vicinity, and connectivity constraints further suppress the retention of isolated noise regions.

[0038] (3) After applying the dual threshold and connectivity preservation, candidate crack masks are obtained. However, in complex contexts, candidate regions may still contain blocky noise, shadow clumps, and local texture pseudo-responses. To further filter out regions that do not conform to crack morphological characteristics, this invention proposes a slender constraint mechanism based on the skeleton length-to-area ratio. Specifically, for the final candidate mask... Perform 8-neighbor connected component decomposition, denoted as: ; in Indicates the first There are candidate connected components, where m represents a candidate crack mask. The total number of connected components obtained after decomposing the components into 8 neighboring connected components.

[0039] Connected Components area Defined as the total number of foreground pixels it contains, that is: ; For connected components Perform skeletalization, and denote its skeleton as: ; in, This is a skeleton extraction operator used to perform skeletonization on the input connected domain and output its centerline skeleton.

[0040] The corresponding skeleton length is defined as: ; Based on this, define connected components. The slenderness index is: ; This indicator reflects the length of the centerline borne per unit area of ​​a region. For actual cracks, the region is typically elongated, narrow, and exhibits significant extension; therefore, the skeleton length is relatively long while the area is relatively small. The area of ​​pseudo-crack regions such as blocky noise and shadow clumps may be considerable, but their skeletal extension is weaker, therefore... Typically smaller.

[0041] Therefore, for each candidate connected component A dual constraint is employed, consisting of an area threshold and a thin-length threshold. ; in, Minimum area threshold, This is the minimum thinness threshold.

[0042] Therefore, the crack mask after slender constraint screening can be represented as: ; Compared to the traditional minimum bounding box aspect ratio constraint, this thin length definition does not depend on the main direction of the connected domain, thus making it more robust to curved cracks, non-axis aligned cracks, and cracks with local width variations. At the same time, since block noise usually has a large area and a short skeleton, this metric is also more conducive to suppressing false detections of planar noise.

[0043] Through the above processing steps, this method can achieve layer-by-layer optimization from the initial crack response map to candidate crack regions. Specifically, the linked dual threshold is used for controlled layering of the response map, hysteresis candidate generation is used to retain weak crack regions supported by high-confidence seeds, and slender constraint screening further removes blocky pseudo-responses and atypical regions generated in complex backgrounds from the geometric structure level, thereby obtaining candidate results that better match the geometric properties of the crack trunk and providing a basis for subsequent endpoint guidance bridging and quantification of parameters such as length, width, number of cracks, and orientation.

[0044] In step S4, skeleton extraction and graph structure segmentation are performed on the optimized crack candidate region obtained in step S3 to obtain several skeleton segments and their endpoint sets. The endpoints of the skeleton segments that satisfy the minimum segment length constraint and their corresponding local extension directions are extracted. Then, potential connectable endpoint pairs are searched only between endpoints belonging to different connected domains, and the following constraints are applied in sequence: endpoint Euclidean distance constraint, endpoint direction consistency constraint, and average probability support constraint of connection path. For endpoint pairs that simultaneously satisfy the above constraints, they are determined to correspond to the local fracture position of the same crack, and a bridging pixel path is generated between the two endpoints. The bridging pixel path is fused with the candidate regions corresponding to the two endpoints to obtain the crack region after continuous repair.

[0045] Preferably, a slight dilation process is further performed on the newly added bridging pixel path to improve the connectivity stability after the bridging region is fused with the original candidate region.

[0046] This embodiment selects an image of underground rock mass containing locally discontinuous cracks as the input sample to illustrate the processing procedure of the present invention in crack continuity restoration. First, the crack region results after candidate screening are obtained, and the endpoint set of discontinuous crack segments is extracted based on the crack skeleton or centerline. Then, distance constraints, direction constraints, and local continuity determination are applied to any two candidate endpoints. For endpoint pairs that meet preset connection conditions, a bridging path is established between the endpoints to restore the continuous representation of the main crack structure.

[0047] It should be noted that although the bridging object in this embodiment is determined by the crack skeleton endpoints, the bridging result is not limited to the skeleton level. Instead, based on the connection relationship between the endpoints, a corresponding bridging path region is generated in the pixel domain and merged into the original crack mask. Therefore, this embodiment essentially belongs to the "pixel-level local bridging based on skeleton endpoint determination" method. Here, the skeleton endpoints provide structural information about the fracture location and extension direction, used to determine "which breakpoints should be connected"; while the pixel bridging path is used to restore the continuous representation of the crack at the image region level, used to implement the specific compensation process of "how to connect". In other words, the skeleton endpoints undertake the bridging determination function, and the bridging pixels undertake the bridging implementation function; they correspond to the decision layer and execution layer in the local crack continuity restoration, respectively.

[0048] A partial schematic diagram of crack continuity bridging repair is shown below. Figure 4 As shown, where, Figure 4 (a) in the image is a local area diagram before local repair. Figure 4 (b) in the image represents the newly introduced bridging pixel map. Figure 4 (c) shows a schematic diagram after bridging repair. It can be seen that at the local fracture location, the main structure of the crack before repair exhibits significant discontinuity, affecting the overall connectivity of the crack. By introducing new bridging pixels while satisfying constraints on endpoint distance, direction, and local continuity, connections are established only within a small gap area, effectively restoring the continuity of the crack's main structure. Compared to simple global morphological closing operations, this bridging method can enhance the continuous representation of the crack while reducing misconnections in non-target areas, thus providing a more stable input for subsequent skeleton extraction and parameter statistics such as length and orientation.

[0049] Unlike traditional methods that directly perform closing operations or dilatation-erosion processing on the entire crack area, this embodiment does not indiscriminately connect all adjacent areas. Instead, it conditionally overlaps only at local fracture locations between the skeleton endpoints. Only when the two endpoints belong to different crack connectivity domains, and their spatial distance, local orientation, and response strength of the intermediate connection path meet the requirements, is a bridging region allowed to be added between them. This avoids the misconnection problem that ordinary morphological closing operations are prone to in complex backgrounds (such as incorrectly connecting adjacent textures, hole edges, or noise areas that do not belong to the same crack as a whole structure).

[0050] After bridging is completed, local redundant connections are removed and structural optimization is performed on the bridged crack region to obtain crack structure results with better continuity. This process reduces the possibility of a single crack being mistakenly segmented into multiple independent segments, improves the integrity of the main crack structure representation, and facilitates the stable statistical analysis of subsequent parameters such as length, number of segments, and orientation. Furthermore, this embodiment can output diagnostic parameters such as the area of ​​the newly added bridging region, the number of bridging endpoint pairs, and the change in connected domains before and after bridging, which characterize the actual contribution of the bridging module to crack continuity restoration.

[0051] In summary, this step adopts a constraint bridging method based on the skeleton endpoint position, orientation consistency, and local probability support information. It only performs local overlapping on endpoint pairs that satisfy the distance constraint, orientation constraint, and probability support constraint, rather than performing a global closing operation on the entire candidate region. This significantly reduces the problem of non-target misconnection while enhancing the continuity of the crack backbone.

[0052] In this embodiment, the bridging of discontinuous cracks can be determined based on the distance between endpoints, the difference in direction, and local continuity. An exemplary calculation method is as follows: Set the endpoints of the crack skeleton and The coordinates are respectively and Then the Euclidean distance between the two endpoints can be expressed as: ; when At that time, it is assumed that the two endpoints satisfy the distance condition for local bridging in space, where This represents the maximum permissible bridging gap.

[0053] Calculate the endpoints separately and The local extension direction of the crack skeleton is denoted as... and Since the two ends of a real fracture crack should have an approximately opposite tendency to extend locally, their direction difference can be expressed as: ; when At that time, it is assumed that the two endpoints satisfy the consistency constraint, where The maximum permissible directional difference threshold.

[0054] After satisfying the distance and direction constraints, the continuity of the local bridging path between the two endpoints is then determined. Let's assume the path starts from the endpoint... and The constructed bridging pixel path is The average support probability of the bridging pixel path on the crack response probability map is defined as follows: ; in, Represents pixels The crack response probability, This indicates the number of pixels in the bridging pixel path. When... At that time, the path is determined to have sufficient local continuity to allow the establishment of a bridging region between the two endpoints, where The minimum probability support threshold.

[0055] In summary, the condition is: only when the two endpoints belong to different crack connected regions and simultaneously satisfy the distance constraint. Directional constraints and local continuity constraints Only when the time is right, a bridging path is established between the two and merged into the original crack region to form the bridged crack structure. Compared with ordinary closing operations, the endpoint-guided local crack bridging method used in this embodiment does not perform uniform edge patching on the entire binary image based on fixed structural elements. Instead, it limits the bridging object to the crack skeleton endpoints, and the bridging basis is limited to the joint constraints of distance, direction, and local response. This allows for a more targeted recovery of the continuous representation of the real crack, reduces overlap in non-target areas, and improves the reliability and interpretability of subsequent crack geometric quantization results.

[0056] In step S5, the number and length of cracks are counted based on the skeleton graph structure. The crack skeleton extraction and graph structure representation are as follows: Figure 5 As shown, where, Figure 5 Image (a) shows the result of continuous repair of the crack area. Figure 5 (b) in the diagram is a schematic diagram of the centerline of the crack skeleton extracted from the crack region. Figure 5 (c) represents the crack graph structure constructed based on skeleton endpoints and bifurcation points. Skeletonization extraction is performed on the continuous repaired crack region output in step S4 to obtain the skeleton centerline. Further, the skeleton centerline is represented as an undirected graph structure, where the skeleton centerline pixels are nodes and the adjacency relationships between adjacent skeleton pixels are edges. Nodes with a degree not equal to 2 in the graph are defined as key nodes; a continuous skeleton path between two key nodes can be defined as an original skeleton segment, thus completing the skeleton graph segmentation. Based on this segmentation result, the number of original skeleton segments and the degree of fragmentation of the crack results are counted. Then, according to the distance constraints and direction consistency constraints between the endpoints of adjacent skeleton segments, adjacent skeleton segments that meet the conditions are merged into a crack, and the total number of cracks in an engineering sense is counted. Simultaneously, the Euclidean distance between adjacent points of all skeleton segments is accumulated according to the skeleton point sequence to obtain the total crack length.

[0057] This embodiment selects an image of underground rock fractures after fracture candidate optimization and continuity repair as the input sample to illustrate the processing procedure of fracture geometric parameter extraction and structured statistics in this invention. Unlike directly measuring parameters of the original segmentation results, this embodiment uses the fracture structure after linked dual-threshold candidate extraction, slender constraint screening, and local continuity repair as a unified quantification object. Based on the optimized fracture structure, skeleton representation, width estimation, and structured parameter statistics are performed. This approach reduces the interference of fracture breakage, fragmentation, and spurious responses in the original segmentation results on parameter statistics, improving the stability, continuity, and engineering interpretability of subsequent parameters such as length, width, orientation, number of fractures, and density.

[0058] First, a crack skeleton is extracted from the optimized crack region, and a centerline or graph structure representation is established based on the skeleton. It should be noted that the skeleton extraction in this embodiment is not for an independent purpose, but rather serves as an intermediate carrier for representing the crack region structure, used to uniformly characterize the main crack path, local orientation, and parameter sampling locations. By converting the optimized crack region into a single-pixel-wide centerline representation, the interference caused by changes in region boundary thickness on length, direction, and width statistics is effectively reduced, thus providing a stable reference framework for subsequent geometric parameter extraction.

[0059] After obtaining the skeleton representation, the local width is further estimated along the crack skeleton by combining the distance transformation results. A schematic diagram of crack width estimation is shown below. Figure 6 As shown, where, Figure 6 (a) in the diagram is a map of the cracked area. Figure 6 Image (b) shows the local width field result obtained by performing a distance transformation on the crack region. Figure 6 (c) in the diagram is a schematic diagram of width estimation, combined with... Figure 6 It is evident that the distance transformation results can reflect the local distance distribution from different locations within the crack region to the boundary, thus providing a basis for width sampling along the skeleton direction. Figure 6 (c) further illustrates the process of selecting representative sampling locations along the crack skeleton for local width estimation, where red markers indicate local sampling locations on the skeleton, and w1, w2, and w3 represent the local width sample values ​​at the corresponding sampling locations. Through this method, a sequence of local widths describing the variation of crack width along its path can be obtained, rather than just a single overall width value. Based on the optimized crack region, crack skeleton, and width estimation results, structured parameters such as crack length, width, orientation, number of cracks, tortuosity, and density can be further output. Compared to directly statistically analyzing geometric parameters based solely on the original segmentation results, this embodiment can more stably characterize the true geometric features of the crack's main structure and reduce the bias caused by local false detections, fracture fragments, and blocky pseudo-responses to the quantization results.

[0060] In addition, this embodiment not only outputs traditional length and width parameters, but also preferably distinguishes between the number of original skeleton segments and the number of engineering trunks, and can output median width, high quantile width, principal direction angle, tortuosity and bridging repair related diagnostic quantities, thereby forming multi-level structured parameter results for engineering analysis.

[0061] By using the optimized crack structure as a unified quantification object, combined with local width sampling and structured parameter extraction via the skeleton centerline and subsequent Euclidean distance transformation, this approach not only characterizes the local variations in crack width but also outputs crack length, width quantiles, orientation, number of cracks, tortuosity, and related diagnostic parameters. The improvement lies not in the basic width estimation formula itself, but in significantly enhancing the stability, accuracy, and engineering interpretability of subsequent quantification results through prior candidate optimization and continuous repair.

[0062] In this embodiment, the crack parameters can be calculated using the following exemplary method: (1) Crack length. Assume the crack skeleton consists of skeleton points arranged in sequence. The structure determines the crack length. It can be represented as: ; in, The number of skeleton points. For the first coordinates of skeleton points They represent the first The x and y coordinates of each skeleton point.

[0063] Crack length is used to characterize the extent of crack extension along the skeleton direction. In discrete image implementations, when the distance between adjacent skeleton points is approximately one pixel, the cumulative number of skeleton pixels can also be used to approximate the crack length.

[0064] (2) Crack width. Let the distance transformation result of the crack region be... ,in Represents pixels The shortest distance to the crack boundary. For any skeleton point The width of its local cracks It can be represented as: ; This allows us to obtain the local width values ​​distributed point-by-point along the crack skeleton. Furthermore, based on the width values ​​of all skeleton sampling points, we can output the average crack width, median width, and high quantile width to characterize the crack width distribution.

[0065] (3) Crack orientation and tortuosity. The crack orientation can be estimated based on the principal direction of the coordinate set of the skeleton segment, which is used to characterize the main extension direction of the crack in space; the crack tortuosity can be represented by the ratio of the actual path length of the crack to the straight distance of the endpoint, which is used to describe the degree of curvature and geometric irregularity of the crack. Since both orientation and tortuosity are calculated based on the optimized main skeleton segment, the disturbance caused by fracture fragments and local noise to the orientation estimation and morphological complexity judgment can be reduced.

[0066] (4) Crack density. Let the image size be... ,in Indicates the image height. This represents the image width; the total length of the cracks in the entire image is... Then the crack length density It can be defined as: ; in, This represents the total pixel area of ​​the image. In some implementations, to improve the intuitiveness of the numerical values, the normalized crack density can be further defined as: ; Its meaning is each The crack length corresponds to the area of ​​each pixel. Crack density is used to characterize the distribution intensity of cracks within the sample area, reflecting the overall development degree of cracks and the density of cracks within the area.

[0067] In this embodiment, the crack quantification result is preferably divided into two layers: the first layer is the original skeleton segment count, which describes the fragmentation degree of the crack at the image level; the second layer is the engineering backbone count after topological merging, which represents the total number of cracks in an engineering sense. By distinguishing between the original skeleton segment count and the engineering backbone count, it is possible to avoid mistaking multiple local fragments of the same fracture crack as multiple independent cracks, thereby improving the engineering rationality of crack count statistics.

[0068] In addition, this embodiment can also output diagnostic parameters such as the change in area before and after candidate screening, the change in the number of connected domains before and after bridging, the area of ​​newly added bridging regions, and the number of bridging endpoint pairs, which can be used to help explain the contribution of the crack continuity repair process to the final quantitative results.

[0069] Therefore, the technical effect of this embodiment does not lie in proposing a separate skeleton extraction or distance transformation width measurement method, but in: based on the optimized crack structure obtained by the aforementioned candidate extraction, slender screening and local bridging repair, a set of structured parameter extraction and statistical processes for engineering analysis is constructed, so that parameters such as crack length, width, direction, number of cracks, tortuosity and density are more stable, more complete and more interpretable.

[0070] In step S6, the crack width estimation and quantization results based on distance transformation are output. An Euclidean distance transformation is performed on the repaired crack region obtained in step S4 or S5 to generate a distance field distribution map of the crack region. Sampling is performed on the distance field distribution map along the skeleton centerline extracted in step S5 to obtain the local distance values ​​corresponding to each skeleton sampling point. The local crack width is defined as twice the local distance value, thus obtaining a local width sequence distributed along the crack skeleton.

[0071] Based on this local width sequence, crack width statistics are calculated, including average width, median width, high quantile width, and maximum width. At the same time, crack direction, tortuosity, and crack density are further calculated by combining the coordinate distribution of the skeleton segment.

[0072] The final output is a structured quantitative result, which includes at least the total number of cracks, the number of original skeleton segments, the total crack length, crack width statistics, and diagnostic fields related to candidate screening and bridging repair.

[0073] To fully illustrate the comprehensive implementation process of this invention, underground rock mass crack images are selected as input samples, and steps S2 to S6 are completed sequentially to finally obtain optimized crack results and basic engineering statistical parameters.

[0074] like Figure 7 As shown, Figure 7 This diagram illustrates the key states of rock mass fracture image processing from initial identification to parameter extraction. Figure 7 (a) in the figure shows the initial crack response results. Figure 7 Image (b) shows the post-processed optimized crack region result. Figure 7 Image (c) shows the parameter extraction results based on crack skeleton and width sampling. Figure 7 As can be seen, the present invention can realize the complete processing of rock mass crack images from initial crack response, post-processing optimization to parameter extraction, and obtain a relatively stable expression of the main crack structure in complex backgrounds.

[0075] Table 1 shows the output results of a specific example, demonstrating that the present invention can not only identify underground rock mass cracks, but also further output basic parameters for engineering statistical analysis.

[0076] Table 1. Example of parameter output.

[0077]

[0078] Example 2 This embodiment provides a system for candidate optimization, continuous repair, and quantization of crack images with complex backgrounds, including: The initial candidate generation module is configured to: acquire the crack response probability map of the original image; High and low thresholds are determined based on the crack response probability map. The low threshold is determined based on the high threshold and the preset maximum allowable interval. Low threshold response regions connected to high threshold response regions are retained to obtain initial crack candidate regions. The optimization filtering module is configured to: calculate the skeleton length and area of ​​each connected region in the initial crack candidate region, use the ratio of skeleton length to area as the thinness index, and filter according to the preset area threshold and thinness threshold to obtain the optimized crack candidate region; The connection repair module is configured to: extract the optimized crack candidate region skeleton and endpoints; when two endpoints of different connected domains meet the preset multi-condition constraints, generate a bridging pixel path between the two endpoints and merge the corresponding connected domains to obtain the repaired crack region. The quantization module is configured to: skeletonize the repaired crack region and construct an undirected graph; count the number of original skeleton segments, the total number of cracks, and the total crack length; perform distance transformation on the repaired crack region to obtain a distance field distribution map; sample along the skeleton to obtain a local width sequence; calculate the width statistics, orientation, tortuosity, and density based on the local width sequence; and output the quantization results.

[0079] It should be noted that each module in this embodiment corresponds one-to-one with each step in Embodiment 1, and their specific implementation process is the same, so it will not be repeated here.

[0080] Example 3 This embodiment also provides a computer device, including a computer-readable storage medium, a processor, and a computer program stored on the computer-readable storage medium and executable on the processor. When the processor executes the program, it completes the method of Embodiment 1.

[0081] It should be understood that in this embodiment, the processor can be a central processing unit (CPU), or it can be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc.

[0082] Memory may include read-only memory and random access memory, and provides instructions and data to the processor. A portion of memory may also include non-volatile random access memory. For example, memory may also store information about the device type.

[0083] In the implementation process, each step of the above method can be completed by the integrated logic circuits in the processor hardware or by software instructions.

[0084] The method in Embodiment 1 can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor. The software modules can reside in readily available storage media in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory; the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method. To avoid repetition, a detailed description is not provided here.

[0085] Those skilled in the art will recognize that the units and algorithm steps described in connection with the various examples of this embodiment can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this invention.

[0086] Example 4 This embodiment also provides a computer-readable storage medium for storing computer instructions, which, when executed by a processor, complete the method of Embodiment 1.

[0087] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for candidate optimization, continuous repair, and quantization of crack images with complex backgrounds, characterized in that, include: Obtain the crack response probability map of the original image; A high threshold and a low threshold are determined based on the crack response probability map, wherein the low threshold is determined according to the high threshold and a preset maximum allowable interval; The low-threshold response regions that are connected to the high-threshold response regions are retained to obtain the initial crack candidate regions; Calculate the skeleton length and area of ​​each connected region in the initial crack candidate region, use the ratio of skeleton length to area as the thinness index, and filter according to the preset area threshold and thinness threshold to obtain the optimized crack candidate region; Extract the optimized crack candidate region skeleton and endpoints. When the two endpoints of different connected regions meet the preset multi-condition constraints, generate a bridging pixel path between the two endpoints and merge the corresponding connected regions to obtain the repaired crack region. The repaired crack area is skeletonized and an undirected graph is constructed. The number of original skeleton segments, the total number of cracks, and the total crack length are counted. Distance transformation is performed on the repaired crack area to obtain a distance field distribution map. Local width sequences are obtained by sampling along the skeleton. The width statistics, orientation, tortuosity and density are calculated based on the local width sequences, and the quantification results are output. The high threshold is determined based on the high quantile value of the crack response probability map, and the low threshold is the larger of the low quantile value of the crack response probability map and the value obtained by subtracting the preset maximum allowable interval from the high threshold. The multi-condition constraints include: the Euclidean distance between the two endpoints is less than a preset distance threshold, the angle between the local extension directions of the two endpoints is less than a preset angle threshold, and the average support probability of pixels on the connection path between the two endpoints is greater than a preset probability threshold. The repaired crack area was skeletonized and an undirected graph was constructed. The number of original skeleton segments, the total number of cracks, and the total crack length were counted. Specifically: Skeletonization extraction is performed on the repaired crack area to obtain the skeleton centerline. The skeleton is represented as an undirected graph structure, where skeleton pixels are nodes and adjacency relationships are edges. Nodes with a degree not equal to 2 are defined as key nodes, and continuous skeleton paths between two adjacent key nodes are defined as original skeleton segments. The number of original skeleton segments is counted. Based on the distance constraints and orientation consistency constraints of the endpoints of adjacent skeleton segments, adjacent skeleton segments that meet the conditions are merged into one crack, and the total number of cracks is counted. The Euclidean distance between adjacent points of each original skeleton segment is accumulated according to the skeleton point sequence, and the total length of the crack is obtained by summing the lengths of all original skeleton segments.

2. The method for candidate optimization, continuous repair, and quantization of complex background crack images according to claim 1, characterized in that, A distance transformation was performed on the repaired crack area to obtain a distance field distribution map. Local width sequences were then obtained by sampling along the skeleton, specifically: Perform Euclidean distance transformation on the repaired crack region to obtain the distance field from each pixel inside the crack region to the boundary; Sampling is performed along the centerline of the skeleton on the distance field distribution map to obtain the local distance value of each sampling point in the distance field, and twice the local distance value is taken as the local crack width at the sampling point. The local crack widths at each sampling point are arranged in the order of the skeleton points to form a local width sequence.

3. The method for candidate optimization, continuous repair, and quantization of complex background crack images according to claim 1, characterized in that, The width statistics include at least one of the following: average width, median width, high quantile width, and maximum width.

4. The method for candidate optimization, continuous repair, and quantization of complex background crack images according to claim 1, characterized in that, The output quantification results also include diagnostic fields related to candidate screening and bridging repair. These diagnostic fields include at least one of the following: the area of ​​newly added bridging regions, the number of bridging endpoint pairs, or the change in the number of connected regions before and after screening.

5. A system for candidate optimization, continuous repair, and quantization of crack images with complex backgrounds, characterized in that, include: The initial candidate generation module is configured to: acquire the crack response probability map of the original image; High and low thresholds are determined based on the crack response probability map, and the low threshold is determined according to the high threshold and the preset maximum allowable interval; the low threshold response region connected to the high threshold response region is retained to obtain the initial crack candidate region; The optimization filtering module is configured to: calculate the skeleton length and area of ​​each connected region in the initial crack candidate region, use the ratio of skeleton length to area as the thin length index, and filter according to the preset area threshold and thin length threshold to obtain the optimized crack candidate region; The connection repair module is configured to: extract the optimized crack candidate region skeleton and endpoints; when two endpoints of different connected domains meet the preset multi-condition constraints, generate a bridging pixel path between the two endpoints and merge the corresponding connected domains to obtain the repaired crack region. The quantization module is configured to: skeletonize the repaired crack region and construct an undirected graph; count the number of original skeleton segments, the total number of cracks, and the total crack length; perform distance transformation on the repaired crack region to obtain a distance field distribution map; sample along the skeleton to obtain a local width sequence; calculate the width statistics, orientation, tortuosity, and density based on the local width sequence; and output the quantization results. The high threshold is determined based on the high quantile value of the crack response probability map, and the low threshold is the larger of the low quantile value of the crack response probability map and the value obtained by subtracting the preset maximum allowable interval from the high threshold. The multi-condition constraints include: the Euclidean distance between the two endpoints is less than a preset distance threshold, the angle between the local extension directions of the two endpoints is less than a preset angle threshold, and the average support probability of pixels on the connection path between the two endpoints is greater than a preset probability threshold. The repaired crack area was skeletonized and an undirected graph was constructed. The number of original skeleton segments, the total number of cracks, and the total crack length were counted. Specifically: Skeletonization extraction is performed on the repaired crack area to obtain the skeleton centerline. The skeleton is represented as an undirected graph structure, where skeleton pixels are nodes and adjacency relationships are edges. Nodes with a degree not equal to 2 are defined as key nodes, and continuous skeleton paths between two adjacent key nodes are defined as original skeleton segments. The number of original skeleton segments is counted. Based on the distance constraints and orientation consistency constraints of the endpoints of adjacent skeleton segments, adjacent skeleton segments that meet the conditions are merged into one crack, and the total number of cracks is counted. The Euclidean distance between adjacent points of each original skeleton segment is accumulated according to the skeleton point sequence, and the total length of the crack is obtained by summing the lengths of all original skeleton segments.

6. A computer device comprising a computer-readable storage medium, a processor, and a computer program stored on the computer-readable storage medium and executable on the processor, characterized in that, When the processor executes the program, it implements the steps in the complex background crack image candidate optimization, continuous repair and quantization method as described in any one of claims 1-4.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the steps in the complex background crack image candidate optimization, continuous repair and quantization method as described in any one of claims 1-4.