Crack fitting method based on direction prior and dark-quantile roi finite element cloud map
By constructing directional priors and dark quantile ROIs, and combining brightness statistics and total least squares fitting, the stability and accuracy problems of crack direction extraction in finite element contour maps are solved. This achieves efficient and accurate crack fitting in complex backgrounds and is applicable to contour maps generated by software such as Abaqus, ANSYS, and COMSOL.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHANDONG UNIV
- Filing Date
- 2026-01-12
- Publication Date
- 2026-04-28
AI Technical Summary
Existing technologies struggle to reliably and accurately extract crack direction information from finite element contour plots. Traditional methods are sensitive to interfering structures such as mesh lines, leading to false edges and fitting direction drift, which fails to meet the reliability and accuracy requirements of engineering analysis.
A method based on orientation prior and dark quantile ROI is adopted. By constructing a narrow strip-shaped ROI, combined with brightness statistics and total least squares fitting, candidate crack points are screened and fitted with high precision to eliminate the influence of interfering structures.
It achieves stable and accurate extraction of crack direction in complex finite element contour maps, improves the robustness and fitting accuracy of the method, meets the reliability and reproducibility requirements of engineering calculations, and is applicable to contour maps generated by various finite element software.
Smart Images

Figure CN121527355B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image detection technology, and in particular to a finite element cloud map crack fitting method based on orientation prior and dark quantile region of interest (ROI). Background Technology
[0002] In structural engineering, materials science, and industrial nondestructive testing, finite element analysis (FEM) is a crucial tool for assessing structural integrity and predicting material failure. Analysis results are often visualized as contour maps, where cracks or damaged areas are represented by abrupt changes in color, brightness, or contour lines. However, automatically and accurately extracting crack orientation information from these contour maps presents a significant challenge.
[0003] Finite element contour maps typically exhibit the following complex characteristics: 1) Color gradients are nonlinear and non-uniformly distributed, and abrupt changes at cracks are easily confused with background gradients; 2) A large number of dense contour lines exist, whose shapes are easily confused with cracks; 3) Explicit computational grid lines (structured or unstructured) are superimposed on the image, and their regularity and high brightness often make them stand out more than real cracks in grayscale images or algorithmic processing, making them easy to misjudge; 4) Cracks themselves occupy a very small proportion in the image, with weak signals, and are easily submerged by strong background textures and rendering artifacts; 5) Contour maps output by different software (such as Abaqus, ANSYS, COMSOL) differ significantly in color gamut and rendering style, making it difficult to set universal processing parameters.
[0004] For extracting linear features from images, traditional methods such as Canny edge detection, Sobel gradient operator, Hough transform line detection, or LSD line segment detector suffer from severe instability when processing complex contour maps. These methods are often highly sensitive to interfering structures such as grid lines and contour lines, leading to a large number of false edges or misidentification of interference as cracks. This results in a significant drift or even complete error in the final fitted crack direction, failing to meet the reliability and accuracy requirements of engineering analysis.
[0005] Therefore, there is an urgent need in this field for a technical solution that can overcome the above-mentioned defects and stably and accurately fit the crack direction under strong interference and weak signal background. Summary of the Invention
[0006] To address the aforementioned issues, this invention proposes a finite element cloud map crack fitting method based on directional prior and dark quantile ROI. By introducing artificial direction guidance, constructing directionally constrained regions of interest, using dark quantile adaptive thresholds to filter crack pixels, and combining total least squares fitting, robust and high-precision extraction of crack directions in complex finite element cloud maps is achieved.
[0007] To achieve the above objectives, the present invention adopts the following technical solution:
[0008] This invention provides a finite element contour map crack fitting method based on directional prior and dark quantile region of interest (ROI), comprising the following steps:
[0009] The system receives the coordinates of two reference points selected by the user along the crack direction on the finite element cloud map, and calculates the preliminary direction angle of the crack based on the coordinates of the two reference points as the direction prior.
[0010] Using the direction prior as the central axis direction and one of the reference points as the benchmark, a strip-shaped ROI is constructed on the cloud map. The brightness values of all pixels within the strip-shaped ROI are extracted. The dark fraction threshold is calculated based on the distribution of the brightness values. Pixels with brightness values lower than or equal to the threshold are selected as the initial set of crack candidate points.
[0011] Calculate the local gradient direction of each pixel in the preliminary crack candidate point set, and select pixels whose local gradient direction deviates from the prior direction by less than the preset direction tolerance to form a direction consistency set.
[0012] The total least squares fit is performed on the pixel coordinates in the direction consistency set to obtain the main direction line of the crack and the fitting parameters. The main direction line is then superimposed on the original finite element cloud map to generate the crack fitting result.
[0013] As an alternative implementation, the construction of a strip-shaped ROI satisfies the following condition: for any pixel in the image, if the vertical distance from the pixel to the straight line passing through the reference point with the initial direction angle as the central axis is less than a preset half width, then the pixel is located within the strip-shaped ROI.
[0014] As an alternative implementation, the dark quantile threshold is obtained by calculating the quantiles of the set of brightness values of all pixels within the ROI, using the following formula:
[0015] ;
[0016] in, q Quantities.
[0017] As an alternative implementation, the gradient magnitude is also used as a constraint during the directional consistency screening process, retaining only pixels with a gradient magnitude greater than a preset lower limit.
[0018] As an alternative implementation method, least squares fitting specifically includes:
[0019] The mean coordinates of pixels in the direction consistency set are calculated to obtain the mean point. The coordinates of all pixels are then centered. The covariance matrix of the centered coordinates is calculated. The covariance matrix is decomposed into eigenvalues. The eigenvector corresponding to the largest eigenvalue is taken as the main direction vector of the crack. Based on the main direction vector and the mean point, the equation of the fitted line is determined.
[0020] As an alternative implementation, after calculating the preliminary orientation angle, a orientation validity check step is also included.
[0021] As an alternative implementation, the orientation validity check includes: determining whether the distance between two reference points is greater than a minimum distance threshold and determining whether the initial orientation angle is a degenerate value.
[0022] As an alternative implementation, if the number of pixels in the preliminary crack candidate point set obtained by screening is less than the preset minimum number threshold, then the ROI width expansion strategy is executed to increase the half width and then the dark subdivision pixel screening is re-executed.
[0023] As an alternative implementation, after obtaining a preliminary set of candidate crack points based on the dark quantile threshold, a local consistency check step is also included: for each pixel in the set, it is determined whether its brightness value is not greater than the average brightness value of the pixels in its neighborhood; if it does not meet the requirement, the pixel is removed.
[0024] As an alternative implementation, before superimposing the main direction line onto the original finite element cloud map, the effective drawing range of the main direction line is determined according to the image boundary to ensure that the main direction line is completely located inside the image.
[0025] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0026] The finite element cloud map crack fitting method based on direction prior and dark quantile ROI of the present invention introduces direction prior and constructs a narrow strip-shaped ROI to strictly limit the crack search space to the vicinity of the preset direction. This effectively eliminates a large number of strongly interfering structures such as grid lines and contour lines that are inconsistent with the crack direction in physical space, resulting in strong anti-interference ability, high recognition stability, and fundamentally improving the robustness of the method.
[0027] The present invention provides a finite element cloud map crack fitting method based on directional prior and dark quantile ROI. It adopts a dark quantile threshold screening strategy based on brightness statistics, which has outstanding weak signal extraction capability. It can adapt to cloud maps with different rendering styles and contrasts, and stably extract low brightness and weak contrast pixels that characterize cracks, thus solving the problem of failure of traditional fixed threshold methods in complex cloud maps.
[0028] The finite element cloud map crack fitting method based on directional prior and dark quantile ROI of the present invention combines manual directional prior and gradient direction-based consistency screening, which doubles the accuracy of crack main direction extraction and effectively prevents fitting direction drift caused by directional interference structures in the image.
[0029] The finite element cloud map crack fitting method based on direction prior and dark quantile ROI of the present invention addresses the characteristic that crack pixels have noise in both the horizontal and vertical directions by using the total least squares method for straight line fitting, which can minimize the error in both directions at the same time. Compared with the ordinary least squares method, it can obtain more accurate and stable direction estimation when the point set is scattered or non-uniform, and the fitting accuracy is high.
[0030] The present invention presents a finite element contour map crack fitting method based on directional prior and dark quantile ROI. The entire method consists of deterministic calculation steps, which do not rely on random initialization or sampling. Under the same input, the same output will be obtained, which meets the strict requirements of reliability and reproducibility in engineering calculations. The manual interaction steps are simple and intuitive, and the output results can be directly used for subsequent engineering analysis, seamlessly connecting with the engineer's decision-making process.
[0031] The present invention presents a finite element contour map crack fitting method based on directional prior and dark quantile ROI. The core algorithm consists of basic image statistics and matrix operations, resulting in low computational complexity and fast processing speed. The method is independent of the rendering details of specific finite element software and exhibits good adaptability to contour maps generated by various software such as Abaqus, ANSYS, and COMSOL, demonstrating broad applicability.
[0032] Advantages of additional aspects of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description
[0033] 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.
[0034] Figure 1 The flowchart shows the finite element cloud map crack fitting method based on directional prior and dark quantile ROI of the present invention.
[0035] Figure 2 This is a schematic diagram illustrating the direction prior acquisition and strip-shaped ROI construction in an embodiment of the present invention;
[0036] Figure 3 This is a schematic diagram illustrating the effect of superimposing the total least squares fitting result onto the original cloud map in an embodiment of the present invention. Detailed Implementation
[0037] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0038] It should be noted that the following detailed descriptions are exemplary and intended to provide further illustration 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.
[0039] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the exemplary embodiments of the invention. As used herein, unless the context clearly indicates otherwise, the singular form is intended to include the plural form as well. Furthermore, it should be understood that the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but includes other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0040] To avoid ambiguity in understanding the technical terms used in the embodiments of this invention, some core terms involved in this invention are explained below before Embodiment 1. Those skilled in the art should understand the technical solutions of this invention in conjunction with the following definitions when reading this specification.
[0041] (1) In this invention, "finite element cloud map" refers to a visualization image generated by finite element analysis software to characterize the distribution of physical fields, including but not limited to displacement cloud maps, stress cloud maps, plastic strain cloud maps, damage variable cloud maps, etc., output by software such as Abaqus, ANSYS, and COMSOL. The finite element cloud map usually represents the numerical calculation results in pseudo-color or grayscale form, and is accompanied by features such as color gradient abrupt changes, dense distribution of contour lines, and visualization mesh rendering.
[0042] (2) In this invention, "direction prior" refers to the approximate direction information of the crack obtained through manual interaction. Specifically, the direction prior is calculated by the user selecting at least two reference points on the crack path in the finite element cloud map, and is used to characterize the overall extension direction of the crack. The direction prior does not require precise correspondence to crack pixels, but is only used to provide directional constraints for subsequent crack candidate region construction and direction screening.
[0043] (3) In this invention, a “strip-type ROI (Region of Interest)” refers to a narrow rectangular analysis region constructed around a priori direction, whose central axis is consistent with the priori direction and whose width is limited by preset parameters. The strip-type ROI is used to spatially limit the crack analysis range, thereby reducing the interference of non-crack structures such as background areas, mesh lines and contour lines in the finite element cloud map on the crack identification process.
[0044] (4) In this invention, the “dark quantile threshold” refers to the quantile threshold calculated based on the pixel brightness distribution within a striped ROI. By selecting pixels in the lower quantile range (e.g., 25%–50%) of the brightness distribution, a set of candidate crack pixels is formed to enhance the weak crack signal in the cloud image and suppress the influence of background brightness changes. This threshold has adaptive characteristics and is suitable for different cloud image rendering methods and brightness distribution conditions.
[0045] (5) In this invention, “Total Least Squares Fitting (TLS Fitting)” refers to a linear fitting method that considers errors in both independent and dependent variables. Unlike traditional least squares methods that only minimize errors in a single direction, TLS Fitting obtains the main extension direction of cracks by analyzing the main direction of the spatial distribution of crack candidate pixels. It is more suitable for handling situations where crack pixels in finite element cloud maps are scattered and have significant bidirectional errors.
[0046] (6) In this invention, “crack candidate pixels” refers to the set of pixels that are determined to be likely to belong to the crack structure after strip-type ROI restriction, dark quantile screening and orientation consistency screening. This set is used for subsequent total least squares fitting and is the basic data for crack main direction extraction.
[0047] Where there is no conflict, the embodiments and features in the embodiments of the present invention can be combined with each other.
[0048] Example 1
[0049] like Figure 1 As shown, this embodiment provides a finite element contour map crack fitting method based on directional prior and dark quantile region of interest (ROI), including the following steps:
[0050] Step 1: Receive the coordinates of two reference points selected by the user along the crack direction on the finite element cloud map, and calculate the preliminary direction angle of the crack based on the coordinates of the two reference points as the direction prior.
[0051] Step 2: Using the direction prior as the central axis direction and one of the reference points as the benchmark, construct a strip-shaped ROI on the cloud map, extract the brightness values of all pixels within the strip-shaped ROI, calculate the dark fraction threshold based on the distribution of brightness values, and filter pixels with brightness values lower than or equal to the threshold as the initial crack candidate point set.
[0052] Step 3: Calculate the local gradient direction of each pixel in the preliminary crack candidate point set, and select pixels whose local gradient direction deviates from the prior direction by less than the preset direction tolerance to form a direction consistency set.
[0053] Step 4: Perform total least squares fitting on the pixel coordinates in the direction consistency set to obtain the main direction line of the crack and the fitting parameters. Superimpose the main direction line on the original finite element cloud map to generate the crack fitting result.
[0054] The specific solution of the present invention is as follows:
[0055] This invention aims to solve the problem of difficulty in fitting crack direction under conditions such as complex background of finite element cloud map, weak crack signal, and strong mesh interference. It achieves stable and high-precision crack direction extraction by using direction prior, strip-type ROI, dark quantile screening and total least squares fitting.
[0056] Step 1: Receive the coordinates of two reference points selected by the user along the crack direction on the finite element cloud map, and calculate the preliminary direction angle of the crack based on the coordinates of the two reference points as the direction prior.
[0057] The method for obtaining the direction prior in step 1 is as follows:
[0058] S1: Load the plastic strain contour map, displacement contour map, or stress contour map exported from Abaqus, ANSYS, or COMSOL into the finite element contour map interface; convert the image to the display interface so that the user can identify the approximate location of the crack in the image and enable the manual point selection function, such as... Figure 2 As shown. The software provided in this embodiment is for reference only. In actual applications, it can be flexibly modified according to requirements.
[0059] S2: The user selects two reference points sequentially along the overall direction of the crack, and the system records the pixel coordinates of the two points as follows:
[0060] ;
[0061] The selected reference point is not required to fall precisely on the crack pixel, but it should provide correct directional guidance.
[0062] S3: Calculate the crack orientation angle determined by the two points. θ 0, specifically the direction angle is obtained using the arctangent function:
[0063] ;
[0064] The direction angle is then uniformly normalized to:
[0065] ;
[0066] To ensure consistency in calculations within the system.
[0067] S4: Calculate the required direction angle The crack direction prior is stored as in this invention and displayed on the image by drawing direction lines or direction arrows for user verification; the direction line is represented by the extension of the line connecting two points:
[0068] ;
[0069] The central axis used for subsequent ROI construction.
[0070] S5: Execution direction validity check, including:
[0071] (1) Reference point distance constraint:
[0072] ;
[0073] in A minimum distance of 20–40 pixels is recommended. This constraint is set because when the distance between two points is too small, the orientation angle calculation becomes highly sensitive to pixel quantization errors, manual click errors, and noise in cloud map rendering, easily leading to instability in the orientation prior and affecting the subsequent construction of strip-shaped ROIs and orientation consistency screening. However, when the distance between two points reaches 20 pixels or more, it effectively reflects the overall direction characteristics of the crack, the orientation angle calculation tends to be stable, and further increasing the point distance has limited effect on improving orientation stability. Therefore, limiting the minimum point distance to the range of 20–40 pixels ensures the reliability of the orientation prior while also considering user convenience and engineering applicability, making it a preferred parameter setting in this invention.
[0074] (2) Non-degenerate directional conditions: avoid Meaningless values may appear (such as in the extreme case where the denominator is close to 0).
[0075] If the orientation angle conflicts with the image coordinate system (e.g., parallel to the boundary causing ROI construction failure), the system prompts the user to reselect the reference point.
[0076] Step 2: Using the direction prior as the central axis direction and one of the reference points as the benchmark, construct a strip-shaped ROI on the cloud map, extract the brightness values of all pixels within the strip-shaped ROI, calculate the dark fraction threshold based on the distribution of brightness values, and filter pixels with brightness values lower than or equal to the threshold as the initial crack candidate point set.
[0077] The method for constructing the striped ROI in step 2 is as follows:
[0078] S1: Prior direction angle obtained in step 1 As the central directional axis of the strip-shaped ROI (Region of Interest), and selecting the first reference point clicked by the user in step 1. Used as the spatial reference point for the ROI; the ROI is determined along the direction. An extended, narrow rectangular region is used to limit the crack candidate region and suppress background noise;
[0079] S2: Calculate the unit vector of the ROI's central axis using the direction vector, specifically:
[0080] ;
[0081] And calculate its normal vector:
[0082] ;
[0083] Used as the direction for determining the horizontal boundary of the ROI.
[0084] S3: Set the half-width of the strip-shaped ROI. Its value range is limited to:
[0085] ;
[0086] When the image resolution is large (width ≥ 800px), it is preferred. =20 to 40 pixels.
[0087] Preferred when the image is small (width < 800 px) =10 to 20 pixels.
[0088] This width ensures that enough pixels are retained near the crack, while avoiding interference from too many grid lines or contour lines.
[0089] Further The range of values for the striped ROI will be explained. The half-width is set within the range of 10px to 40px. On the one hand, it can cover the typical visual width of cracks in the cloud map and avoid the loss of crack pixels due to the area being too narrow. On the other hand, it can effectively suppress the introduction of a large number of background structures such as grid lines and contour lines.
[0090] S4: Use the strip distance formula to determine whether any pixel (x, y) belongs to the ROI. The specific determination criteria are as follows:
[0091] ;
[0092] Pixels that meet the above conditions are assigned to the ROI region.
[0093] This formula actually calculates the vertical distance from a pixel to the central axis of the ROI, and then modifies it with the half-width. Comparisons are made to establish strict directional constraints.
[0094] S5: Determine the vertical extension range of the ROI based on the image size, using one of the following two methods:
[0095] Full map extension mode (default):
[0096] ;
[0097] The ROI extends across the entire image along the central axis.
[0098] Local extension mode (optional):
[0099] Set the extension length L to satisfy:
[0100] ;
[0101] Where H is the cloud map height, used for scenarios where the crack distribution area is limited.
[0102] While both of the aforementioned vertical extension methods are used to define the spatial range of strip-shaped ROIs, their applicable scenarios and focuses differ: the full-image extension mode emphasizes ensuring the integrity and robustness of cracks, while the local extension mode emphasizes enhancing anti-interference capabilities and fitting accuracy. This invention, by setting these two methods, allows the crack direction extraction process to flexibly select based on the sufficiency of prior crack information, ensuring complete crack extraction while also considering the stability and engineering applicability of direction fitting.
[0103] S6: After the ROI is constructed, to avoid non-crack linear structures (such as grid lines and contour lines) in the cloud map being mistakenly included in this step, further restrictions are imposed:
[0104] The ROI center axis must not be offset or rotated beyond:
[0105] ;
[0106] ROIs are not allowed to be repositioned around the image center.
[0107] The ROI must be strictly collinear with the direction line generated by the direction prior.
[0108] The above constraints ensure that the ROI will not "fit" into incorrect linear interference structures.
[0109] S7: Mark and store the final strip-shaped ROI, and render and display the ROI region outline on the interface for user verification; after the ROI is constructed, the proportion of crack pixels in the ROI usually increases from <1% of the whole image to 20-50%, providing a high-quality sample basis for subsequent dark quantile screening and TLS fitting.
[0110] The method for filtering dark sub-pixels in step 2 is as follows:
[0111] S1: After constructing the striped Region of Interest (ROI), extract the luminance values of all pixels within the ROI region. The luminance values can come from a grayscale image or from the luminance channel of an RGB image (such as the L channel in Lab color space). Record the luminance values of all pixels within the ROI as a set:
[0112] ;
[0113] This step ensures that brightness statistics are performed only on pixels within a narrow directional area, avoiding background interference across the entire image that could cause statistical distribution shifts.
[0114] S2: Perform distribution analysis on the brightness set L and calculate its dark quantile threshold T. Specifically, the quantile function is used:
[0115] ;
[0116] in The q-quantile represents the set of luminance values, and the range of possible values for q is limited as follows:
[0117] ;
[0118] and:
[0119] Preferred when the crack is thin and weak (the pixel grayscale is darker): .
[0120] Preferred when cracks are obvious or background noise is strong: .
[0121] Choosing q within the range of 0.25 to 0.50 ensures that weak crack signals are fully extracted while avoiding the misselection of too many dark background textures. This limitation ensures that the quantile threshold is robust and can adapt to different cloud map rendering styles.
[0122] S3: Perform initial screening of pixels within the ROI based on the dark partition threshold T, defining pixels with brightness lower than or equal to T as the crack candidate point set. Specifically:
[0123] ;
[0124] The core idea behind this screening method is:
[0125] Cracks in finite element contour maps typically appear in dark pixels in low-stress color bands or areas of color abrupt changes. Therefore, dark quantile screening is more suitable for nonlinear contour map backgrounds than a fixed threshold.
[0126] S4: Perform a size constraint check on the dark partition selection results. When the number of candidate pixels is less than a preset threshold... If the ROI is 50 pixels (e.g., 50 pixels), it indicates that the ROI may be too narrow or the cloud image contrast may be insufficient. In this case, a width expansion strategy should be implemented.
[0127] Increase in ROI halfwidth:
[0128] in ;
[0129] Then re-execute steps S1 to S3 under this module (method for filtering dark subdivision pixels).
[0130] This step ensures that pixel samples usable for fitting can be obtained even when the crack signal is extremely weak.
[0131] S5: Further refine the candidate set Perform a local consistency check to remove pixels with abrupt grayscale changes that are not part of a crack structure, such as thin dark lines or shadow structures caused by gradient color bands in the contour map. The local consistency check uses the neighborhood brightness mean constraint:
[0132] Let the average brightness of the neighborhood of pixel (x, y) be:
[0133] ;
[0134] The neighborhood Ω is often a 3×3 or 5×5 region.
[0135] Pixels that satisfy the following formula are retained:
[0136] ;
[0137] Other pixels are removed to further improve the purity of the crack pixels.
[0138] S6: The final set of preliminary screening results for dark partitions These pixels serve as candidate crack pixels for subsequent directional consistency screening. This set can typically reduce overall image noise by 60% to 90%, and is one of the core steps in this invention to solve the problem of "weak crack signals being submerged in strong background interference" in finite element contour maps.
[0139] Step 3: Calculate the local gradient direction of each pixel in the preliminary crack candidate point set, and select pixels whose local gradient direction deviates from the prior direction by less than the preset direction tolerance to form a direction consistency set.
[0140] The method for directional consistency screening in step 3 is as follows:
[0141] S1: Initial screening set of dark sub-positions Calculate the local gradient for all pixels. Gradient calculation can use Sobel, Scharr, or other conventional derivative operators, with Sobel being preferred. Its horizontal and vertical gradients are as follows:
[0142] ;
[0143] And based on this, the gradient direction of each pixel is calculated:
[0144] ;
[0145] The gradient direction reflects the main extension trend of the local pixel structure.
[0146] S2: Set the gradient direction for each pixel. Prior information about the crack direction obtained in step 1 The directional difference between the two is defined as follows:
[0147] ;
[0148] To avoid the impact of abrupt changes caused by the periodicity of angles, the directional difference values are normalized as follows:
[0149] ;
[0150] Ensure the angle difference is always within Interval.
[0151] S3: Set the orientation consistency threshold Its scope is limited as follows:
[0152] ;
[0153] in:
[0154] When the crack is relatively straight, a smaller threshold (5° to 10°) is preferred;
[0155] A larger threshold (10°–20°) is preferred when the crack may be slightly curved.
[0156] This threshold is used to determine whether a pixel conforms to the directional characteristics of a crack.
[0157] Orientation Consistency Threshold A range of 5° to 20° can accommodate slight local bending of the crack and prior errors in the artificial orientation, while effectively eliminating interfering structures that are significantly inconsistent with the crack orientation.
[0158] S4: Initial screening set of dark sub-positions For each pixel in the image, an orientation consistency check is performed, and pixels that meet the following conditions are retained:
[0159] ;
[0160] The remaining pixels are discarded. This step can significantly remove the following structures from the contour map: obvious grid lines that are not aligned with the crack direction, contour lines that form large angles with the crack direction, false edges generated by the boundaries of color blocks in the contour map rendering, and isolated outlining pixels caused by numerical noise.
[0161] S5: To avoid local anomalies in background gradient intensity in the cloud image, this invention further incorporates gradient magnitude constraints in the directional consistency filtering. Let the pixel gradient magnitude be:
[0162] ;
[0163] Set the lower limit of gradient magnitude Recommended range: (Grayscale unit) Within this recommended range, it can effectively remove smooth background areas and weak noise pixels, while avoiding the accidental deletion of real crack pixels due to excessively high threshold. It is an optimal value range that achieves a balance between crack retention rate and noise suppression.
[0164] Only pixels that meet the following conditions are retained: .
[0165] This constraint can effectively eliminate pixels that are mistakenly identified as cracks in the brightness smooth area.
[0166] S6: After the above filtering, the set of directions with consistency is obtained:
[0167] ;
[0168] gather It typically has high crack pixel purity, which can significantly reduce the error of total least squares fitting and improve the robustness of crack main direction identification.
[0169] Step 4: Perform total least squares fitting on the pixel coordinates in the direction consistency set to obtain the main direction line of the crack and the fitting parameters. Superimpose the main direction line on the original finite element cloud map to generate the crack fitting result.
[0170] The method for total least squares (TLS) crack line fitting in step 4 is as follows:
[0171] S1: After completing the directional consistency screening, the set of high-purity crack pixels obtained from the screening is denoted as:
[0172] ;
[0173] Where i represents the number of pixels that satisfy the orientation consistency condition. To ensure fitting stability, this invention requires:
[0174] ;
[0175] If the area is less than 30 pixels, the user will be prompted to increase the ROI width or lower the dark partition threshold.
[0176] S2: For the set Perform centering. Calculate the mean coordinates of all pixels:
[0177] ;
[0178] And construct a centralized coordinate system:
[0179] , ;
[0180] This centering step is used to eliminate offset, so that the fitted directional features are unaffected by position.
[0181] S3: Calculate the covariance matrix of the crack pixels to extract their principal directions. The covariance matrix is defined as:
[0182] ;
[0183] This matrix characterizes the distribution characteristics of crack pixels along the principal direction in a two-dimensional plane.
[0184] S4: Perform eigenvalue decomposition on the covariance matrix to find the largest eigenvalue. Corresponding feature vectors:
[0185] ;
[0186] This feature vector indicates the main extension direction of the crack point cloud, i.e., the crack direction; to ensure consistency of direction, this invention limits:
[0187] With step 1 The difference does not exceed .
[0188] If the difference exceeds If the fitting direction is abnormal, it will be suggested to repeat step 2 or step 3.
[0189] S5: Based on eigenvectors Construct an analytical expression for the crack fitting line. The crack line passes through the mean point. , direction is The parametric equations are obtained as follows:
[0190] ;
[0191] Its corresponding general form can be written as:
[0192] ;
[0193] in:
[0194] ;
[0195] All fitting coefficients (A, B, C) are TLS results and maintain the true proportions.
[0196] S6: Extend the fitted line towards the image boundary. To ensure accurate size mapping, this invention limits the extension range to:
[0197] ;
[0198] in and These are the parameter values for the intersection of the line direction and the image boundary, ensuring that the line falls completely within the image.
[0199] S7: Output crack direction parameters, including:
[0200] The fitted linear equation for TLS is (A,B,C):
[0201] Direction angle:
[0202] ;
[0203] Mean point .
[0204] Fitting residuals:
[0205] ;
[0206] The results are recorded in the results file for use in post-engineering processing or crack propagation direction assessment.
[0207] The method for superimposing and outputting the results in step 4 is as follows:
[0208] S1: The parametric equations for the fitted crack line in the TLS are obtained as follows:
[0209] ;
[0210] And its parametric form:
[0211] ;
[0212] The system first determines the valid range of values for the line on the image based on the image dimensions. Let the image width be x and the height be y. Extend the line in both directions until it intersects the image boundary, and then calculate the parameter range: and .
[0213] This determines the actual drawing range of the line on the image:
[0214] , ;
[0215] S2: To ensure that the fitted straight line accurately reflects the actual crack direction, this invention further stipulates that the drawing of the straight line must maintain consistent mathematical proportions and must not be scaled, rotated, or approximated. All drawings are based on the original pixel coordinate system of the image and do not introduce any affine or perspective transformations.
[0216] ;
[0217] This ensures the authenticity and reproducibility of the fitting results in the image coordinate space;
[0218] S3: During the visualization overlay process, to avoid the fitted straight line being obscured by the color of the cloud map, this invention uses a fixed color (such as pure black or pure white) and a fixed line width (e.g., 2-4 pixels), and preferably forms a large contrast with the main color tone of the original cloud map color band, so that the crack straight line is clearly distinguishable. The limitations are as follows:
[0219] Line color: black (0,0,0) or white (255,255,255);
[0220] Line width range: 2 ≤ linewidth ≤ 4;
[0221] The system automatically determines the background brightness and selects contrasting colors for drawing.
[0222] S4: Plot the TLS fitted line onto the original contour map to generate an overlay image, such as... Figure 3 As shown. The overlaid images are in matrix form:
[0223] ;
[0224] in:
[0225] This is the original cloud image pixel matrix;
[0226] This is a linear pixel matrix drawn according to the format set in step S3 of this module (method of result overlay and output).
[0227] S5: Output crack direction parameter file, including:
[0228] The coefficients (A, B, C) of the fitted straight line for TLS.
[0229] TLS main direction angle:
[0230] ;
[0231] Directional deviation:
[0232] ;
[0233] Fitting residuals:
[0234] ;
[0235] This document is used for automated processes in engineering analysis, crack assessment, or simulation post-processing.
[0236] S6: Save the result as:
[0237] Overlay image (overlay.png / overlay.jpg);
[0238] Fitting parameter file (params.csv or txt);
[0239] List of crack pixels (optional);
[0240] Directional consistency screening chart (optional);
[0241] To meet the diverse needs of engineering reports, automated analysis, and repetitive calculations.
[0242] S7: This step further specifies the reproducibility requirements for the output results:
[0243] With the same cloud map, the same parameter settings, and the same user-selected points, it must be able to generate completely identical fitted lines and parameter files.
[0244] This invention does not introduce random numbers or random sampling in the algorithm process, ensuring that the fitting results meet the reliability requirements of engineering calculations.
[0245] While the specific embodiments of the present invention have been described above in conjunction with the accompanying drawings, this is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art without creative effort based on the technical solutions of the present invention are still within the scope of protection of the present invention.
Claims
1. A finite element contour map crack fitting method based on directional prior and dark quantile ROI, characterized in that, Includes the following steps: The system receives the coordinates of two reference points selected by the user along the crack direction on the finite element cloud map, and calculates the preliminary direction angle of the crack based on the coordinates of the two reference points as the direction prior. Using the direction prior as the central axis direction and one of the reference points as the benchmark, a strip-shaped ROI is constructed on the cloud map. The brightness values of all pixels within the strip-shaped ROI are extracted. The dark fraction threshold is calculated based on the distribution of the brightness values. Pixels with brightness values lower than or equal to the threshold are selected as the initial set of crack candidate points. The dark quantile threshold is calculated by dividing the set of brightness values of all pixels within the ROI by quantiles. The calculation formula is as follows: ; in, The threshold for dark quantiles. This represents the q-quantile of the brightness set. q For quantiles, The set of brightness values for all pixels within the ROI; If the number of pixels in the preliminary crack candidate point set obtained by screening is less than the preset minimum number threshold, then the ROI width expansion strategy is executed to increase the half width and then the dark subdivision pixel screening is re-executed. After obtaining a preliminary set of crack candidate points based on the dark quantile threshold, a local consistency check step is also included: for each pixel in the set, it is determined whether its brightness value is not greater than the average brightness value of the pixels in its neighborhood. If the condition is not met, the pixel is removed. Calculate the local gradient direction of each pixel in the preliminary crack candidate point set, and select pixels whose local gradient direction deviates from the prior direction by less than the preset direction tolerance to form a direction consistency set. The total least squares fit is performed on the pixel coordinates in the direction consistency set to obtain the main direction line of the crack and the fitting parameters. The main direction line is then superimposed on the original finite element cloud map to generate the crack fitting result.
2. The finite element contour map crack fitting method based on directional prior and dark quantile ROI as described in claim 1, characterized in that, The construction of a strip-shaped ROI satisfies the following condition: for any pixel in the image, if the perpendicular distance from the pixel to the straight line passing through the reference point with the initial direction angle as the central axis is less than the preset half width, then the pixel is located within the strip-shaped ROI.
3. The finite element contour map crack fitting method based on directional prior and dark quantile ROI as described in claim 1, characterized in that, In the process of directional consistency screening, gradient magnitude is also used as a constraint to retain only pixels with gradient magnitude greater than a preset lower limit.
4. The finite element contour map crack fitting method based on directional prior and dark quantile ROI as described in claim 1, characterized in that, Total least squares fitting specifically includes: The mean coordinates of pixels in the direction consistency set are calculated to obtain the mean point. The coordinates of all pixels are then centered. The covariance matrix of the centered coordinates is calculated. The covariance matrix is decomposed into eigenvalues. The eigenvector corresponding to the largest eigenvalue is taken as the main direction vector of the crack. Based on the main direction vector and the mean point, the equation of the fitted line is determined.
5. The finite element contour map crack fitting method based on directional prior and dark quantile ROI as described in claim 1, characterized in that, After calculating the initial direction angle, a direction validity check step is also included.
6. The finite element contour map crack fitting method based on directional prior and dark quantile ROI as described in claim 5, characterized in that, The orientation validity check includes: determining whether the distance between two reference points is greater than the minimum distance threshold and determining whether the initial orientation angle is a degenerate value.
7. The finite element contour map crack fitting method based on directional prior and dark quantile ROI as described in claim 1, characterized in that, Before overlaying the main direction line onto the original finite element cloud map, determine the effective drawing range of the main direction line based on the image boundary to ensure that the main direction line is completely located inside the image.
Citation Information
Patent Citations
Pavement crack extraction method based on two-dimensional image
CN112085699A
Concrete crack early recognition method based on 3D point cloud
CN120541759A