A rock mass fracture network medium reconstruction method and system based on graph tracking
Patent Information
- Application Number
- CN202610088569.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-22
- Publication Date
- 2026-09-18
- Estimated Expiration
- 2046-01-22
AI Technical Summary
[0004]现有多模拟软件耦合方法普遍存在兼容性与裂隙网络拓扑性不一致的问题:首先,依赖单一软件的专用接口或中间格式,迁移到异构平台(如由PFC转入COMSOL)时,易丢失节点—边关系或需大量手工描图,效率低且主观误差大;其次,传统图像矢量化多停留在轮廓提取,难以稳定获得“端点/交汇点—连通边”的图结构,断点、闭环、毛刺与噪声常导致裂隙被误分割或粘连;最后,缺少从像素坐标到工程坐标的统一映射机制(比例、偏移、坐标轴方向),矢量化后的DFN网络尺寸与位置难以与实际工程模型域精准对齐
本发明提供了一种用于裂隙网络图像的拓扑一致性重构与多点坐标标定的方法:在骨架化与图构建基础上,引入最小代价函数的有约束图跟踪与拓扑不变量一致性的闭环校正;采用距离变换加权RDP在保证Hausdorff误差不超过设定上界的条件下减少CAD顶点;并基于控制点完成仿射/单应标定,输出平均/最大重投影误差以量化坐标精度。该方案在保持裂隙连通与环结构的同时,显著降低矢量顶点数量并提高导入效率,适用于将PFC等离散元软件的位图结果稳定导入CAD/COMSOL等平台。
Smart Images

Figure CN121962523B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of fracture network reconstruction technology, and particularly relates to a method and system for reconstructing rock fracture network media based on graph tracing. 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] The geometry and topology of fracture networks directly affect the stability of rock mass engineering. In practical rock mass engineering numerical simulations, multi-software coupling methods are often used. To achieve model import between different simulation software, discrete fracture networks (DFNs) often need to be vectorized and modeled. In engineering practice, discrete element software such as PFC can simulate the geometric distribution of fracture networks in rock masses under various conditions and can export them as bitmaps. However, subsequent mesh modeling, parametric geometry, boundary condition settings, and seepage-stress multi-field simulations often rely on the vector modeling and multiphysics coupling capabilities of CAE platforms (such as COMSOL). This creates a data transfer requirement between different numerical simulation software: it must maintain topological features such as fracture orientation, length, and connectivity, while also enabling scalable, aligned, and batch import coordinates to facilitate reuse and iteration between different software.
[0004] Existing multi-simulation software coupling methods generally suffer from incompatibility and inconsistency in the topology of fracture networks: First, relying on the dedicated interface or intermediate format of a single software, when migrating to heterogeneous platforms (such as from PFC to COMSOL), node-edge relationships are easily lost or a large amount of manual drawing is required, resulting in low efficiency and large subjective errors; Second, traditional image vectorization often stops at contour extraction, making it difficult to stably obtain the graph structure of "endpoints / intersections - connected edges", and breakpoints, loops, burrs and noise often lead to the missegmentation or adhesion of fractures; Finally, there is a lack of a unified mapping mechanism (scale, offset, coordinate axis direction) from pixel coordinates to engineering coordinates, making it difficult to accurately align the size and position of the vectorized DFN network with the actual engineering model domain. Summary of the Invention
[0005] To overcome the shortcomings of the prior art, this invention proposes a method and system for reconstructing rock fracture network media based on graph tracking. This method solves the compatibility problem of converting discrete fracture networks between heterogeneous numerical simulation software. It is used for topological consistency reconstruction and multi-point coordinate calibration of fracture network images, maintaining fracture connectivity and loop structure while significantly reducing the number of vector vertices and improving import efficiency.
[0006] To achieve the above objectives, one or more embodiments of the present invention provide the following technical solutions: In a first aspect, the present invention discloses a method for reconstructing rock mass fracture network media based on graph tracing, comprising: Obtain the fracture network to be reconstructed and perform preprocessing to obtain a binary image; The binary image is skeletonized to obtain a single-pixel-wide rift ridge; Based on the neighborhood connectivity, the endpoints and intersections of the fracture skeleton are identified. The endpoints and intersections are used as graph nodes, the connected skeleton sequence between the endpoints and intersections is used as graph edges, and constrained graph tracing is performed starting from the endpoints to obtain the ordered vertex coordinate sequence of each fracture polyline. The ordered vertex coordinate sequence is mapped to the target two-dimensional coordinate system using multi-point coordinate calibration. A polyline command text file is generated based on the mapped coordinates, and the fracture network medium is reconstructed using the polyline command text file.
[0007] Secondly, this invention discloses a rock mass fracture network media reconstruction system based on graph tracing, comprising: The data reading and binarization module is used to acquire the fracture network to be reconstructed and preprocess it to obtain a binary image. The skeletonization module is used to perform skeletonization processing on the binary image to obtain a single-pixel-wide rift ridge. The constrained graph tracing module is used to identify the endpoints and intersections of the fracture skeleton based on the neighborhood connectivity relationship, and to use the endpoints and intersections as graph nodes, the connected skeleton sequence between the endpoints and intersections as graph edges, and to perform constrained graph tracing starting from the endpoints to obtain the ordered vertex coordinate sequence of each fracture polyline. The mapping and export module is used to perform multi-point coordinate calibration mapping on the ordered vertex coordinate sequence to the target two-dimensional coordinate system, generate a polyline command text file based on the mapped coordinates, and reconstruct the fracture network medium using the polyline command text file.
[0008] Thirdly, the present invention discloses an electronic device, including a memory and a processor, and computer instructions stored in the memory and running on the processor, wherein the computer instructions, when run by the processor, complete the steps of the above-mentioned graph-tracing-based rock fracture network medium reconstruction method.
[0009] Fourthly, the present invention discloses a computer-readable storage medium for storing computer instructions, which, when executed by a processor, complete the steps of the above-described graph-tracing-based rock fracture network medium reconstruction method.
[0010] Compared with the prior art, the beneficial effects of the present invention are as follows: This invention provides a method for topological consistency reconstruction and multi-point coordinate calibration of splinter network images: based on skeletonization and graph construction, it introduces constrained graph tracking with a minimum cost function and closed-loop correction for topological invariant consistency; it uses distance transform weighted RDP to reduce CAD vertices while ensuring that the Hausdorff error does not exceed a set upper bound; and it completes affine / homography calibration based on control points, outputting the average / maximum reprojection error to quantify coordinate accuracy. This scheme significantly reduces the number of vector vertices and improves import efficiency while maintaining splinter connectivity and loop structure, and is suitable for stably importing bitmap results from discrete element software such as PFC into platforms such as CAD / COMSOL.
[0011] 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
[0012] 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.
[0013] Figure 1 This is a flowchart of the rock mass fracture network media reconstruction method based on graph tracing as described in Embodiment 1 of the present invention.
[0014] Figure 2 This is the fracture network diagram obtained by PFC and other discrete element software simulations as described in Embodiment 1 of the present invention.
[0015] Figure 3 This is the quality inspection diagram of the fracture network skeletonization tracking described in Embodiment 1 of the present invention.
[0016] Figure 4 This is a coordinate diagram of the endpoints of the fracture network skeleton described in Embodiment 1 of the present invention.
[0017] Figure 5 This is the final effect diagram of the CAD reconstruction of the fracture network described in Embodiment 1 of the present invention.
[0018] Figure 6 The final result of importing the fracture network medium geometry model described in Embodiment 1 of the present invention into COMSOL is shown in the diagram. Detailed Implementation
[0019] 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.
[0020] It should be noted that the terminology used herein is for the purpose of describing particular implementations only and is not intended to limit the exemplary implementations of the present invention.
[0021] Where there is no conflict, the embodiments and features in the embodiments of the present invention can be combined with each other.
[0022] Example 1 In one or more embodiments, a method for reconstructing rock mass fracture network media based on graph tracing is disclosed, such as... Figure 1 As shown, it includes the following steps: Step S1: Obtain the fracture network to be reconstructed and perform preprocessing to obtain a binary image.
[0023] The crack network distribution image exported from discrete element numerical simulation software such as PFC is obtained and preprocessed for normalization: according to the gray-scale distribution, phase inversion is performed to map the crack lines and background to black and white binary values; the image is cropped and its size is unified to remove non-target elements and edge interference; the processed image is placed in a specified directory as the input set and a correspondence with the original file name is established for subsequent batch processing and result backfilling.
[0024] As one implementation, the input set of images is in "bmp" format, and the black-and-white binarization threshold can be implemented either through Otsu adaptive or fixed threshold.
[0025] As one implementation method, the input image format supports PNG, JPG / JPEG, BMP, and TIF / TIFF; when the crack is dark and the background is light, grayscale inversion is enabled to unify it into a binary input of "crack = black, background = white".
[0026] Step S2: Perform skeletonization processing on the binary image to obtain a single-pixel-wide main ridge of the rift.
[0027] Specifically, skeletonization prioritizes calling scikit-image's skeletonize method; if that is not available, it falls back to the OpenCV morphological skeleton implementation.
[0028] Step S3: Identify the endpoints and intersections of the fracture skeleton based on the neighborhood connectivity relationship, and use the endpoints and intersections as graph nodes, the connected skeleton sequence between the endpoints and intersections as graph edges, and perform constrained graph tracing starting from the endpoints to obtain the ordered vertex coordinate sequence of each fracture polyline.
[0029] Step S3-1: Identify endpoints and intersections based on the 8-neighborhood connectivity of skeleton pixels: endpoints are defined as skeleton pixels with a neighborhood degree of 1, and intersections are defined as skeleton pixels with a neighborhood degree greater than or equal to 3; and filter out free branches or line segments with a length less than a preset threshold.
[0030] Step S3-2: Extend the main ridge of the fracture along the graph edges starting from the endpoint, and select the path using the minimum cost function of the constrained graph tracing; for closed loops without endpoints, perform closure and backtracking correction based on loop evidence scoring and topological invariant consistency as constraints to obtain an ordered vertex coordinate sequence of each fracture polygon; selectively remove short branches and perform geometric simplification on the polygons to reduce noise impact and the number of redundant points.
[0031] Constrained graph tracing selects routes based on the minimum cost function, which is:
[0032] in, For adjacent segment corners, For pixel gap, I t For skeletal strength or spine response, , , Let be the linear combination coefficients in the minimum cost function, and When graph tracing forms a candidate path of "endpoint-less closed loop" on the skeleton, in order to avoid misjudging noisy pseudo-loops or non-cracked structures as real loops, a loop evidence score is introduced for the closed loop candidate path, and it is calibrated by the average curvature and perimeter threshold.
[0033] Let the candidate closed-loop broken line be ,in Let represent the coordinates of the i-th vertex of the closed-loop polyline, satisfying the closure condition. The closed-loop perimeter is defined as:
[0034] In the formula, For closed-loop candidate broken lines circumference; n This is the number of segments in the polyline (i.e., the number of vertices minus 1). p i , p i-1 The coordinates of adjacent vertices; It is a two-dimensional Euclidean norm. To characterize the curvature of the closed loop, the mean of discrete rotation angles is used to approximate the average curvature: for internal vertices... Define adjacent segment vectors , The discrete rotation angle is:
[0035] The mean curvature is defined as:
[0036] In the first two equations, Let be the discrete rotation angle (in radians) at the i-th internal vertex; These are the Euclidean lengths of the adjacent segment vectors, respectively; To prevent tiny constants with a denominator of zero; Let be the average curvature of the candidate closed-loop polygonal line. Based on the above two types of geometric evidence, the loop evidence score (which can also be understood as the evidence discriminant function) is defined as:
[0037] In the formula, Scoring of loop evidence for closed-loop candidates; This is an indicator function that takes the value 1 when the condition inside the parentheses is true, and 0 otherwise. L min It serves as a perimeter threshold, used to exclude noise loops with excessively short perimeters; The average curvature threshold is used to exclude pseudo-loops or jagged loops with excessive curvature. Only when this threshold is met is the loop candidate considered to have sufficient loop evidence and proceed to subsequent topology consistency checks and output.
[0038] Furthermore, to ensure that the overall topology of the gap network is not destroyed during closed-loop correction and path backtracking, the consistency of topological invariants is used as a constraint, and the invariance of the number of connected components and the Eulerian characteristic number is used as the criterion. The undirected graph formed by the skeleton pixels in the 8-neighborhood sense is represented as follows: G =( V , E ), where the vertex set V Composed of skeleton pixels (or an equivalent set of skeleton nodes), and edge set. E It consists of 8 adjacency relationships; let the number of 8-neighbor connected components be denoted as . C ( G The Euler characteristic number of a graph is defined as:
[0039] In the formula, G This is the undirected graph corresponding to the skeleton; V For the set of vertices; E Let it be the set of edges; The number of vertices; The number of sides; C ( G () represents the number of connected components obtained by partitioning based on 8-neighborhood connectivity; Let be the Euler characteristic. Let the local skeleton diagram before loop closure correction or path replacement be . G 0. The corrected or replaced local skeleton diagram is as follows: G 1. Then the topological invariant consistency constraint is written as:
[0040] In the formula, G 0 represents the local skeleton diagram before correction; G 1 is the corrected local skeleton diagram; C ( G 0), C ( G 1) The number of connected components before and after the correction are respectively; These are the Euler characteristic numbers before and after the correction. If a candidate loop closure or candidate path replacement causes the above constraints to be invalid, it is determined that it violates the topological consistency of the gap network. This invention will backtrack to the nearest bifurcation point and select the second-best candidate branch to continue tracking and closure testing until the loop evidence score constraint and the topological invariant consistency constraint are satisfied simultaneously, or the candidate branches are exhausted.
[0041] Furthermore, short branches are removed and the polyline is geometrically simplified. Specifically, short branch removal and polyline geometric simplification are achieved using a distance transform weighted RDP algorithm. The distance from the endpoint of the fracture skeleton to the fracture boundary is calculated and normalized to obtain the weight. A point correlation threshold is used to control vertex retention, and the Hausdorff distance is limited to a maximum of 1 / 3. As an upper bound constraint for geometric error.
[0042] To reduce redundant points and maintain geometric accuracy, a distance-transform-weighted RDP simplification is performed on the tracked polyline. Specifically, the distance from each skeleton point to the crack boundary is calculated. D(i) and normalized to w i ;according to Set a point correlation threshold so that the output curve satisfies the Hausdorff distance not exceeding [a certain threshold]. The upper bound constraint of the error allows for greater simplification in wide crack regions and shape preservation in narrow crack regions.
[0043] In particular, In the formula, For the first i The point-related simplification threshold / tolerance corresponding to the nth point (or the nth polyline vertex) is used to determine whether the point should be retained during weighted RDP simplification; This serves as the global baseline threshold (maximum allowable simplification tolerance or upper bound of error), used to control the overall simplification intensity. This is the weight adjustment coefficient (influence coefficient), used to adjust the strength of the effect of the point weight on the threshold. It is usually taken as... ; w i For the first i The normalized weight of each point is the distance from that point to the crack boundary. D ( i The value is obtained by normalization and is usually taken in the range [0,1]. It is used to reflect the importance of the geometric details at that point. This is the minimum threshold (lower tolerance) used to ensure that the threshold is not too large in detailed / narrow crack areas, thus preventing oversimplification.
[0044] In this embodiment, branch pruning iteratively deletes short branches originating from the endpoint and with a length less than a preset value; RDP simplification_rdp(...) uses the deviation threshold rdp_epsilon to control vertex retention, improving CAD import efficiency. Specifically, rdp_epsilon is a global basic deviation threshold (corresponding) used to characterize the maximum error scale allowed by polyline simplification; when distance transform weighted simplification is enabled, rdp_epsilon is not uniformly applied to all vertices, but rather the point correlation threshold of each vertex is calculated based on rdp_epsilon and the point weight wi, and then the vertex is determined to be retained accordingly, thereby achieving stronger simplification of wide crack regions and stronger shape preservation of narrow crack / boundary neighborhoods.
[0045] Preferably, a quality control overlay of the original image's grayscale, red skeleton, and green endpoints is output; this visualization is drawn using OpenCV and saved as a PNG file with the same name as the input image, facilitating the examination of the parameters' impact on the results.
[0046] Step S4: Perform multi-point coordinate calibration and mapping on the ordered vertex coordinate sequence to the target two-dimensional coordinate system, generate a polyline command text file based on the mapped coordinates, and reconstruct the fracture network medium using the polyline command text file.
[0047] In this step, multi-point coordinate calibration mapping is performed, mapping the obtained pixel-level vertex coordinate sequence to the target two-dimensional coordinate system according to a set scaling factor and coordinate offset. If necessary, the vertical axis direction is adjusted to conform to the coordinate conventions of CAD. Based on the mapped coordinates, a polyline command text file that can be directly recognized by CAD is generated, and corresponding result files and quality inspection overlay images are output one by one according to the input images to reproduce the geometry and connectivity of the fracture network in CAD and to verify the recognition effect. Specifically: Step S4-1, Coordinate Mapping: Based on affine / homography calibration of control points, perform pixel-to-CAD mapping and output the average / maximum reprojection error; when control points are insufficient, a degradation scheme of independent X / Y scaling and origin offset is adopted, with optional Y-axis flipping. The degradation scheme is specifically implemented as follows: for any pixel coordinate (… u , v First, determine the corrected ordinate based on whether Y-axis flipping is enabled. v ', when not flipped v '= v When flipped, take ,in H img The image height (in pixels) is then mapped using independent scaling and origin offset.
[0048] In the formula, X , Y These are the mapped CAD plane coordinates; u , v The pixel coordinates of the point to be mapped in the image; v 'This is the ordinate after Y-axis alignment processing; o x , o y This is the offset of the origin in the CAD coordinate system; s x , s y These are the scaling factors in the X and Y directions, respectively (unit: CAD length / pixel). H img This represents the image height in pixels. For determining the specific parameters, a scaling factor input by the user is preferred. s x , s y and offset o x , o y Directly given; if not directly given, it can also be determined from the known CAD coordinate range. X min , X max ]、[ Y min , Y max Image width W img ,high H img Calculated , and take o x =X min , o y =Y min This enables a linear scaling mapping from pixel coordinates to CAD coordinates.
[0049] Due to the initial image pixel coordinates ( u , v The coordinates do not perfectly correspond to the actual coordinates. When there are ≥3 control points, an affine matrix is used. (In the formula, x The vector column coordinates of any pixel; x 'It is the target coordinate column vector after mapping, which is the target coordinate ( X , Y)composition; It is an analogous linear transformation matrix; (This is a translation vector) to complete the mapping from pixel to target coordinate system. In implementation, it is preferable to map the control points... The above is estimated using the least squares method. A , t , that is, pixel augmentation Solve Obtain the coefficient matrix and take , .
[0050] When there are ≥4 control points, a homography matrix is used. (In the formula, p ' is the homogeneous matrix of target pixel coordinates ; p The homogeneous matrix of pixel coordinates of the mapping point ; This is a homography matrix; the symbol "~" indicates equality in the homogeneous coordinate sense, i.e., the existence of a non-zero scale factor. Make (Establishment) Complete perspective calibration, preferably using RANSAC homography matrix. H Robust estimation is performed to reduce the impact of mismatched control points on the calibration results. The average and maximum reprojection errors are output. As a coordinate accuracy indicator and quality inspection item; The calculation process for the average and maximum reprojection errors is as follows: for each pair of control points First, the predicted coordinates are calculated using the estimated mapping model. When using a homography matrix, first calculate... Then perform homogeneous normalization to obtain , When using affine matrices, calculate directly. Definition of the first i The reprojection error of each control point is:
[0051] Based on this, the average reprojection error and the maximum reprojection error are obtained:
[0052] In the formula, For the first i The true CAD coordinates of the target given at each control point; e represents the predicted target coordinates calculated using an affine / homography model. i For the first i Euclidean reprojection error of each control point; NThe number of control point pairs participating in error statistics; This represents the average projection error; This represents the maximum projection error.
[0053] Step S4-2: After converting the coordinates, format the command-line text with the node coordinate sequence of each polyline, and append a blank line after each command to ensure correct termination in CAD. All text files are saved in the output directory with the same name as the input images (one-to-one correspondence), and statistical and total entries for each drawing are printed in the Windows console for quick verification and quality control of the exported results. The "Windows console" refers to the command-line window that automatically pops up when the program is started via a batch script (.bat) in the Windows operating system, used to display log information and statistical results during program execution.
[0054] In this embodiment, batch processing of multiple images in the input directory is supported. The output files correspond one-to-one with the input images in the main file name and are saved with the ".txt" extension. The node coordinate sequence text file is saved in ".txt" format, where the coordinate format is the CAD polyline command line format, such as "_PLINE 100,200 105,205". Each image in the input set corresponds to a ".txt" file with the same name. The fracture network medium geometric model is saved in ".dxf" format.
[0055] Preferably, the export mode includes two types: line segment mode and polyline mode. The polyline mode is used to reduce the number of CAD vertices and improve import efficiency.
[0056] Step S4-3, Rock Mass Fracture Network CAD Reconstruction and COMSOL Import: By reconstructing a fractured network medium in CAD using a polyline command text file, the fractured network medium file can be imported as a geometric model into other numerical simulation software such as COMSOL. Importing the reconstructed fractured network medium geometric model into numerical simulation software like COMSOL facilitates editing and subsequent simulations.
[0057] This invention can make equivalent replacements or combinations of skeletonization algorithms, path simplification and export formats. For example, changing polyline text to DXF / LWPOLYLINE exchange format, replacing Otsu threshold with other adaptive thresholds, etc., should all fall within the protection scope of this invention.
[0058] Taking the batch import of fracture network diagrams obtained from PFC simulation into COMSOL as an example, the method steps of the present invention are described as follows. This example runs a batch script in a Windows environment, reads the black and white fracture diagrams in the input directory, and outputs CAD command text corresponding one-to-one with the input files, along with (optional) quality inspection overlay images.
[0059] Step 1, Input and Preprocessing.
[0060] like Figure 2 As shown, in the PFC discrete element numerical simulation software, the crack network is set to black and the background to white, and the black and white binary crack network distribution map is exported as a ".bmp" format. The resulting binary image is then used in subsequent processes with "crack = 1, background = 0".
[0061] Run the batch processing script. The script's command-line functions include, but are not limited to: setting the input image directory, setting whether to perform binarization, whether to automatically convert CAD coordinates to actual model coordinates, setting the output directory for fracture network node coordinates, and setting the directory for quality inspection overlay images. The program iterates through the input directories, processing files with extensions .bmp / .png / .jpg / .jpeg / .tif / .tiff one by one.
[0062] In step 1, the input image directory, the output directory of the fracture network node coordinates, etc., are located in the same folder as the script program.
[0063] Step 2, skeletonization.
[0064] Import scikit-image and OpenCV libraries into PyCharm to perform skeletonization on the binary image.
[0065] Step 3, node identification and graph tracing.
[0066] Endpoints and intersections are identified based on the 8-neighbor connectivity of skeleton pixels, and graph nodes and edges are constructed. Constrained graph tracing is then performed starting from the endpoints: the cost increment is calculated for each candidate next pixel (pt+1). ,in For adjacent segment corners, Given pixel gap and It as skeleton strength or ridge response, select the branch that minimizes the total cost J and mark the visited edges until the endpoint is reached or the boundary is closed.
[0067] For "closed loops without endpoints," a loop evidence score and topological invariant consistency are used for determination: a true closed loop is confirmed when the average curvature does not exceed a threshold, the perimeter is greater than a threshold, and the number of connected components before and after the loop is consistent with the Euler characteristic; otherwise, backtracking and replacing the suboptimal path maintains topological consistency. To reduce redundant points and maintain geometric accuracy, distance-transformed weighted RDP simplification is performed on the tracked polylines: the distance D(i) from each skeleton point to the crack boundary is calculated and normalized to wi; according to... Set a point correlation threshold so that the output curve satisfies Hausdorff distance ≤ The upper bound constraint of the error allows for greater simplification in wide crack regions and shape preservation in narrow crack regions.
[0068] To facilitate checking the impact of parameters on the results, a quality control overlay image of "original image grayscale + red skeleton + green endpoints" can be output; this visualization is drawn using OpenCV and saved as a PNG file with the same name as the input image, such as... Figure 3 As shown.
[0069] In step 3, the branch pruning iteratively deletes short branches that originate from the endpoint and have a length less than the preset value; RDP simplification_rdp(...) uses the deviation threshold rdp_epsilon to control vertex retention, thereby improving CAD import efficiency.
[0070] Step 4, coordinate mapping and CAD export.
[0071] When there are ≥3 control points, use an affine matrix. Complete the mapping from pixels to the target coordinate system. When there are ≥4 control points, use a homography matrix. After completing perspective calibration, robust estimation is performed using RANSAC, and the average and maximum reprojection errors are output. As a coordinate accuracy indicator and quality inspection item; After coordinate conversion, the program formats the node coordinate sequence of each polyline into a command-line text string named _PLINE x1,y1 x2,y2..., and appends a blank line after each command to ensure proper termination in CAD. All text files are saved in the output directory with the same name as the input image (one-to-one correspondence), such as... Figure 4 As shown, the statistics and totals entries for each graph are printed in the Windows console.
[0072] Open the text file containing the fracture network node coordinate sequence in the output directory, paste it all into the CAD's built-in command line input field, and you can quickly reconstruct the fracture network medium geometry model in CAD. Figure 5 As shown.
[0073] In step 4, when there are insufficient control points, the mapping can degenerate into a scheme of independent X / Y scaling and origin offset (with optional Y-axis flipping); when control points are available, affine / homography calibration is preferred and reported. .
[0074] In step 4, the node coordinate sequence text file is saved in ".txt" format.
[0075] In step 4, the fracture network medium geometric model is saved as a ".dxf" file. Furthermore, the CAD reconstruction and COMSOL import of the rock mass fracture network: Create a new blank model in COMSOL, and in the "Geometry" node of the COMSOL model tree, select to import the aforementioned ".dxf" file. This will load the reconstructed fracture network as a geometric object. Figure 6 As shown.
[0076] Example 2 In one or more embodiments, a rock mass fracture network media reconstruction system based on graph tracing is disclosed, specifically including: The data reading and binarization module is used to acquire the fracture network to be reconstructed and preprocess it to obtain a binary image. The skeletonization module is used to perform skeletonization processing on the binary image to obtain a single-pixel-wide rift ridge. The constrained graph tracing module is used to identify the endpoints and intersections of the fracture skeleton based on the neighborhood connectivity relationship, and to use the endpoints and intersections as graph nodes, the connected skeleton sequence between the endpoints and intersections as graph edges, and to perform constrained graph tracing starting from the endpoints to obtain the ordered vertex coordinate sequence of each fracture polyline. The mapping and export module is used to perform multi-point coordinate calibration mapping on the ordered vertex coordinate sequence to the target two-dimensional coordinate system, generate a polyline command text file based on the mapped coordinates, and reconstruct the fracture network medium using the polyline command text file.
[0077] Example 3 This embodiment provides an electronic device, including a memory and a processor, as well as computer instructions stored in the memory and running on the processor. When the computer instructions are executed by the processor, they complete the steps of the above-described graph-tracing-based rock fracture network medium reconstruction method.
[0078] Example 4 This embodiment provides a computer-readable storage medium for storing computer instructions, which, when executed by a processor, complete the steps of the above-described graph-tracing-based rock fracture network medium reconstruction method.
[0079] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1A device that provides the functions specified in one or more boxes.
[0080] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0081] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment, whereby a series of operational steps are performed to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0082] The descriptions of each embodiment in the above embodiments have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0083] The above description is merely a preferred embodiment of the present invention and is not intended to limit the 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 reconstructing rock mass fracture network medium based on graph tracking, characterized in that, include: Obtain the fracture network to be reconstructed and perform preprocessing to obtain a binary image; The binary image is skeletonized to obtain a single-pixel-wide rift ridge; The endpoints and intersections of the fracture skeleton are identified based on neighborhood connectivity. The endpoints and intersections are used as graph nodes, and the connected skeleton sequence between the endpoints and intersections is used as graph edges. Constrained graph tracing is performed starting from the endpoints to obtain the ordered vertex coordinate sequence of each fracture polyline. Specifically, the main ridge of the fracture is extended along the graph edges starting from the endpoints, and the path is selected through the minimum cost function of constrained graph tracing. For closed loops without endpoints, closure and backtracking correction are performed based on loop evidence scoring and with topological invariant consistency as a constraint to obtain the ordered vertex coordinate sequence of each fracture polyline. Among them, the loop evidence score is calibrated by the average curvature and the perimeter threshold, and the consistency of topological invariants is constrained by the invariance of the number of connected components and the Euler characteristic number. The ordered vertex coordinate sequence is mapped to the target two-dimensional coordinate system using multi-point coordinate calibration. A polyline command text file is generated based on the mapped coordinates, and the fracture network medium is reconstructed using the polyline command text file.
2. The rock mass fracture network medium reconstruction method based on graph tracking according to claim 1, wherein, The endpoint and intersection points are identified based on the 8-neighborhood connectivity of skeleton pixels: endpoints are defined as skeleton pixels with a neighborhood degree of 1, and intersection points are defined as skeleton pixels with a neighborhood degree greater than or equal to 3; and free branches or line segments with a length less than a preset threshold are filtered out.
3. The method for reconstructing rock mass fracture network media based on graph tracing as described in claim 1, characterized in that, The minimum cost function is: in, For adjacent segment corners, For pixel gap, I t For skeletal strength or spine response, , , represents the linear combination coefficients in the minimum cost function.
4. The method for reconstructing rock mass fracture network media based on graph tracing as described in claim 1, characterized in that, The perimeter is: In the formula, For closed-loop candidate broken lines circumference; n The number of segments in the polyline; p i , p i-1 The coordinates of adjacent vertices; It is a two-dimensional Euclidean norm; The average curvature is: In the formula, Let i be the discrete rotation angle at the i-th internal vertex; The average curvature of the candidate closed-loop polygonal line; The loop evidence score is defined as follows: In the formula, Scoring of loop evidence for closed-loop candidates; For indicator functions; L min Perimeter threshold; This is the average curvature threshold.
5. The method for reconstructing rock mass fracture network media based on graph tracing as described in claim 1, characterized in that, The multi-point coordinate calibration mapping is specifically as follows: When there are ≥3 control points, use an affine matrix. Complete the mapping from pixels to the target coordinate system. When there are ≥4 control points, use a homography matrix. Complete perspective calibration; among which, x The vector column coordinates of any pixel; x 'It is the target coordinate column vector after mapping, which is the target coordinate ( X , Y )composition; It is an analogous linear transformation matrix; It is a translation vector; p ' is the homogeneous matrix of target pixel coordinates ; p The homogeneous matrix representing the pixel coordinates of the mapping points ; It is a homography matrix; When there are insufficient control points, a degradation scheme of independent X / Y scaling and origin offset is adopted, and the points are flipped along the Y-axis.
6. The method for reconstructing rock mass fracture network media based on graph tracing as described in claim 5, characterized in that, The degradation scheme is as follows: for any pixel coordinate, first obtain the corrected ordinate based on whether Y-axis flipping is enabled. v ', take when not flipped v '= v When flipped, take ,in H img The image height is used; then mapping is completed by independent scaling and origin offset: In the formula, X , Y These are the mapped CAD plane coordinates; u , v The pixel coordinates of the point to be mapped in the image; v 'This is the ordinate after Y-axis alignment processing; o x , o y This is the offset of the origin in the CAD coordinate system; s x , s y These are the scaling factors in the X and Y directions, respectively; H img This represents the image height.
7. A rock mass fracture network media reconstruction system based on graph tracing, characterized in that, include: The data reading and binarization module is used to acquire the fracture network to be reconstructed and preprocess it to obtain a binary image. The skeletonization module is used to perform skeletonization processing on the binary image to obtain a single-pixel-wide rift ridge. The constrained graph tracing module is used to identify endpoints and intersections of the fracture skeleton based on neighborhood connectivity. Using the endpoints and intersections as graph nodes and the connected skeleton sequence between them as graph edges, constrained graph tracing is performed starting from the endpoints to obtain an ordered vertex coordinate sequence for each fracture polyline. Specifically, for the main ridge of the fracture, the path is selected along the graph edges starting from the endpoints using the minimum cost function of constrained graph tracing. For closed loops without endpoints, closure and backtracking correction are performed based on loop evidence scoring and constrained by topological invariant consistency to obtain an ordered vertex coordinate sequence for each fracture polyline. Among them, the loop evidence score is calibrated by the average curvature and the perimeter threshold, and the consistency of topological invariants is constrained by the invariance of the number of connected components and the Euler characteristic number. The mapping and export module is used to perform multi-point coordinate calibration mapping on the ordered vertex coordinate sequence to the target two-dimensional coordinate system, generate a polyline command text file based on the mapped coordinates, and reconstruct the fracture network medium using the polyline command text file.
8. An electronic device, characterized in that, It includes a memory and a processor, as well as computer instructions stored in the memory and running on the processor, which, when executed by the processor, perform the graph-tracking-based rock fracture network media reconstruction method according to any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, Used to store computer instructions, which, when executed by a processor, complete the rock mass fracture network medium reconstruction method based on graph tracing as described in any one of claims 1-6.
Citation Information
Patent Citations
Three-dimensional fracture-pore coupling network simulation generation method and system
CN117745979A
Drilling fracture zone fracture network reconstruction method based on two-stage clustering algorithm
CN118351306A