A method for constructing a three-dimensional model of apparent cracks in images

By collecting and processing two-dimensional crack images, combining Delaunay triangulation and STL technology, a fine three-dimensional model of apparent cracks is generated in the building, which solves the problem of high equipment and time costs in the existing technology, and achieves efficient and economical three-dimensional model generation.

CN114549742BActive Publication Date: 2025-05-27CHINA UNIV OF MINING & TECH +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210070863.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-21
Publication Date
2025-05-27
Estimated Expiration
2042-01-21

Smart Images

  • Figure CN114549742B_ABST
    Figure CN114549742B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for constructing a three-dimensional model of apparent cracks in images, which relates to the field of inspection and maintenance of buildings and structures. After obtaining the apparent crack images of buildings and structures, an image processing method is used to obtain a crack-matrix binary image. The width and mean value of each crack are measured, and a curved function is selected to make a depression mapping hypothesis for the crack. Corresponding spatial scatter points are established for each crack pixel, and a triangulation is established among the scatter points. The scatter points and the connected triangular patches are refined, and then a new triangulation is established. Finally, a three-dimensional model is established using stereolithography technology and exported. The present invention works based on two-dimensional images of conventional optical cameras, without the need to purchase three-dimensional imaging equipment, and has the advantages of being simple and easy to implement, small volume of the generated result file, short calculation time, being conducive to popularization, and the obtained fine three-dimensional model being close to the reality. The generated fine three-dimensional model can be used for comparison and judgment of apparent cracks in buildings and structures and size measurement, or imported into numerical simulation software for simulation analysis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of inspection, repair and maintenance of buildings and structures, and particularly to a method for constructing a three-dimensional model of apparent cracks in images. Background Art

[0002] With the development of society and the increasing requirements of people's life and production for infrastructure, the stock of various buildings (structures) and roads is also continuously growing. And daily inspection and maintenance are important guarantees to ensure the safe and timely service of these infrastructure facilities. The investigation and statistics of cracks with narrow, slender, randomly and disorderly distributed shapes are an important part of the daily operation and maintenance work of buildings and structures. Due to the advantages of high efficiency and simplicity, in existing work, two-dimensional optical images of the surfaces of buildings and structures are mostly collected, and image processing and geometric shape processing methods are selected to statistically analyze the cracks.

[0003] In recent years, the demand for fine three-dimensional models of cracks has been increasing continuously. Compared with two-dimensional images, they have the following advantages: First, it is more conducive to analyzing and comparing the changes in the development status of cracks over time using three-dimensional models; Second, staff need to analyze the crack development values under different working conditions and their impacts on the safe service of buildings and structures in numerical simulation software, and a more fine three-dimensional model makes the simulation results closer to the real working conditions; Third, when displayed externally, three-dimensional models have the advantages of vivid display and easy to understand compared with individual two-dimensional images. However, restricted by the following conditions, most existing equipment and operation processes are difficult to provide fine three-dimensional models containing apparent cracks: (1) When three-dimensional devices such as binocular three-dimensional cameras collect images, they need to use a long time to take images of the same position multiple times. The building and structure objects are large in volume, and the crack shapes are narrow, slender, widely distributed, and randomly and disorderly located. If binocular three-dimensional cameras and other three-dimensional imaging devices are used for operation, the working hours are long, increasing the labor intensity of staff; (2) Most three-dimensional lidars or binocular three-dimensional cameras are relatively expensive, which is not conducive to popularization and use; (3) In current existing computer image and graphics research, there are few three-dimensional reconstructions of apparent cracks in large-scale target objects such as buildings and structures based on three-dimensional lidars or binocular three-dimensional cameras. If such devices are used, front-line staff need to develop algorithms themselves, with high technical difficulty and high time cost; (4) Existing work on three-dimensional reconstruction based on two-dimensional crack images mostly makes "one-size-fits-all" assumptions about the shape, position and geometric shape of cracks, and the three-dimensional models built are quite different from the real situation. Summary of the Invention

[0004] Object of the Invention: The present invention proposes a method for constructing a three-dimensional model of apparent cracks in images, which solves the problem that it is difficult to obtain fine three-dimensional models of apparent cracks in large-scale target objects such as buildings and structures using existing methods and conventional equipment. The aim is to establish a fine three-dimensional model of apparent cracks in large-scale target objects of buildings and structures according to existing common equipment, spending less time and cost, and providing technical support for the operation and maintenance work and scientific research of buildings and structures.

[0005] Technical solution: To achieve the object of the present invention, the technical solution adopted by the present invention is as follows:

[0006] A method for constructing a three-dimensional model of apparent cracks in an image, comprising the following steps:

[0007] Step 1: Collect two-dimensional images of cracks, and use image processing methods to perform image noise reduction and binary segmentation to obtain crack-matrix binary images;

[0008] Step 2: Calculate the average width of the cracks, and determine the width of the cross-section where each pixel is located; perform depression mapping on different widths of the cracks to obtain the depression mapping coordinates of the crack pixels;

[0009] Step 3: Combine the depression mapping coordinates of the crack pixels with the coordinates of each pixel in the two-dimensional image to obtain corresponding three-dimensional scatter points, and create a Delaunay triangulation with these three-dimensional scatter points as vertices to establish triangular patches;

[0010] Step 4: Optimize the number of vertices and triangular patches. The vertices include crack edge vertices, crack skeleton vertices, ordinary crack vertices, and matrix pixel corresponding vertices. Delete the triangular patches and their vertices used to represent planes and surfaces with curvatures less than a certain value to characterize the necessary geometric features with the simplified vertices and triangular patches;

[0011] Step 5: Re-establish the Delauny triangulation based on the optimized vertices to obtain triangular patches, and use the STL stereolithography technology to obtain the three-dimensional model of the cracks.

[0012] Further, in the second step, calculating the average width of the cracks and determining the width of the cross-section where each pixel is located specifically includes:

[0013] Obtain the crack skeleton pixels and their coordinates. There are K crack skeleton pixels, and the coordinates of the kth crack skeleton pixel are (x k , y k ); obtain the crack edge pixels and their coordinates. There are P crack edge pixels, and the coordinates of the pth crack edge pixel are (x p , y p ); then the distance d kp between the kth crack skeleton pixel and the pth crack edge pixel is:

[0014]

[0015] The distance d k between the kth crack skeleton pixel and its nearest crack edge pixel is: d k = min{d kp};

[0016] Calculate the average width d of the cracksave , the formula is as follows:

[0017]

[0018] Obtain the coordinates of all crack pixels. There are I crack pixels in total. Calculate the distance between each crack pixel and its nearest crack skeleton pixel, and the distance between each crack pixel and its nearest crack edge pixel;

[0019] Let the coordinates of the i-th crack pixel in the two-dimensional image array be (x i , y i ). The distance between the i-th crack pixel and the k-th crack skeleton pixel is d ik , and the distance between the i-th crack pixel and the p-th crack edge pixel is d ip . The distance between the i-th crack pixel and its nearest crack skeleton pixel is a i , and the distance between the i-th crack pixel and its nearest crack edge pixel is b i ; then

[0020]

[0021]

[0022] a i = min{d ik}

[0023] b i = min{d ip}

[0024] The width of the crack cross-section where the i-th crack pixel is located is 2×(a i + b i ).

[0025] Furthermore, in the second step, the depression mapping method specifically includes:

[0026] Determine the crack standard cross-section depression mapping function according to the average width d ave . Select a function z = z ave (a i ) with a narrow bottom and wide top and axisymmetric curve shape; where the independent variable a i of the function is the distance between a certain crack pixel i and its nearest crack skeleton pixel in a cross-section with an average width, and the dependent variable z is the mapping coordinate of the mapping scatter point corresponding to this crack pixel;

[0027] The mapping function takes the crack skeleton pixel of the current cross-section as the origin; when a i = 0, that is, when it is the crack skeleton pixel at present, z ave has a minimum value z ave_min ; the depression mapping scaling coefficient k of the i-th crack pixeli is:

[0028]

[0029] then

[0030]

[0031] where z i is the depression mapping coordinate of crack pixel i.

[0032] Furthermore, in step 4, the vertices of the crack edge are refined. According to the adjacent positions, by traversing along the crack edge one by one, one crack edge pixel is reserved every n crack edge pixels, where n is an integer greater than 1; let j = 0, and u be the remainder of j divided by n; select any one crack edge pixel as the pixel to be sorted, and execute the following steps:

[0033] S4.1.1: Count the remaining crack edge pixels in the 3×3 neighborhood of the current pixel to be sorted; regard the current crack edge pixel as registered; if u = 0 at this time, divide the current crack edge pixel into the reserved category, otherwise divide it into the non-reserved category; then, let j = j + 1, and change the pixel to be sorted to any unregistered crack edge pixel in the 3×3 neighborhood of the previous pixel to be sorted.

[0034] S4.1.2: Repeat S4.1.1 until there are no unregistered crack edge pixels in the 3×3 neighborhood of the current pixel to be sorted; if there are still unregistered crack edge pixels, change the pixel to be sorted to any unregistered crack edge pixel and continue to execute S4.1.1; if there are no unregistered crack edge pixels, directly jump to S4.1.3;

[0035] S4.1.3: Continue to select any one crack edge pixel as the pixel to be sorted, and repeat S4.1.1 - S4.1.2 until all crack edge pixels in the current pattern are registered; retain the vertices corresponding to the crack edge pixels divided into the reserved category, and delete the vertices corresponding to the crack edge pixels divided into the non-reserved category.

[0036] Furthermore, in step 4, the vertices of the crack skeleton are refined, specifically including:

[0037] Obtain the triangular patches connected to the vertices corresponding to each crack skeleton pixel, and use the vector cross product to calculate the unit normal vector of the triangular patch. The formula is as follows:

[0038]

[0039] where (x 1 , y 1 , z 1 ), (x 2 , y2 , z 2 ), (x 3 , y 3 , z 3 ), (x, y, z are the spatial positions of the three vertices of the triangular patch respectively;

[0040] The normal vector of each vertex corresponding to the crack skeleton pixel is the vector sum of the unit normal vectors of the triangular patches connected to it; then the unit normal vector of each skeleton vertex is obtained according to the normal vector of each vertex corresponding to the crack skeleton pixel; then the average value of the angles between the unit normal vectors of each skeleton vertex and the unit normal vectors of the triangular patches connected to it is calculated, and the skeleton vertices with the average angle size within a certain range are retained.

[0041] Furthermore, in step four, the ordinary crack vertices are refined, specifically:

[0042] The ordinary crack vertices refer to non-edge vertices and non-skeleton vertices. Obtain the unit normal vectors of each ordinary crack vertex in the triangulation and the unit normal vectors of the triangular patches connected to it;

[0043] Calculate the average value of the angles between the unit normal vectors of each ordinary crack vertex and the unit normal vectors of the triangular patches connected to it, and retain the ordinary crack vertices with the average angle size within a certain range.

[0044] Furthermore, in step four, the vertices corresponding to the matrix pixels are refined, specifically:

[0045] There is no concave mapping for the matrix pixels, that is, the z values of the corresponding three-dimensional scatter points are all 0, and only the four vertices corresponding to the matrix pixels closest to the upper left corner, upper right corner, lower left corner, and lower right corner of the image are retained.

[0046] Beneficial effects: Compared with the prior art, the technical solution of the present invention has the following beneficial technical effects:

[0047] The present invention can determine the three-dimensional crack model required for parameterizing and customizing the crack surface function according to actual situations such as the matrix type; the crack position and shape in the model are consistent with the original image; the cross-sectional shapes are similar; (1) File reduction: The required three-dimensional crack surface shape can be well described and characterized with fewer unit numbers and smaller file sizes, and there is no lag or software process crash when importing into other software; (2) Secondary development is possible: After programming and development are completed, no other software is used, which is conducive to function expansion and upgrade according to demand changes; (3) Short time consumption: A conventional optical camera can be used to collect apparent cracks in a sweeping manner, and the corresponding three-dimensional cracks can be generated in a short time, which greatly reduces the time consumption compared with a three-dimensional camera; (4) Low requirements for equipment: Existing ordinary optical cameras and computers can complete the work, and there is no need to purchase three-dimensional imaging equipment. Description of the Drawings

[0048] Figure 1 is the flowchart of the method of the present invention;

[0049] Figure 2 is the binary image of fracture-matrix used in the embodiment;

[0050] Figure 3 is before the mapping of the scatter depression corresponding to a part of the pixels of the sample diagram;

[0051] Figure 4 is after the mapping of the scatter depression corresponding to a part of the pixels of the sample diagram;

[0052] Figure 5 is the triangulation of the scatter points corresponding to a part of the pixels of the sample diagram;

[0053] Figure 6 are the fracture pixels after the reduction of the binary image in the embodiment;

[0054] Figure 7 is the fracture surface STL generated in the embodiment. Detailed implementation manners

[0055] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention.

[0056] This embodiment provides a method for constructing a three-dimensional model of the apparent fracture of an image. It is assumed that the target fracture cross-section is a valley-shaped depression, and the depression curves of the fracture cross-sections with different widths are similar figures. The process is as Figure 1 shown. First, the camera captures the fracture image, and the fracture-matrix binary image is obtained by using the image processing method. Then, a curvilinear function is selected to perform depression mapping on different widths of the fracture, and the corresponding three-dimensional scatter points are obtained by combining the coordinates of the pixels in the image array. And it is ensured that the depression of the fracture cross-sections with different widths is a similar figure. Then, taking these three-dimensional scatter points as vertices, Delaunay triangulation is used to create a triangulation between them to establish triangular patches. Next, the unnecessary vertices and triangular patches are optimized and reduced to represent the necessary geometric features with fewer vertices and triangular patches and a smaller file size. Finally, the fracture three-dimensional model is obtained by using the STL (StereoLithography) technology. The specific implementation steps are as follows:

[0057] This embodiment uses the Matlab software to complete steps S1 - S6, and uses the computer-aided design software Solidworks to complete step S7.

[0058] S1: Obtain the two-dimensional image of the required fracture, and use the image processing method to perform image noise reduction and binary segmentation to obtain the fracture-matrix binary image. As Figure 2 shown, in the binary image used in this embodiment, white represents the fracture and black represents the matrix, with a size of 614 pixels × 614 pixels.

[0059] S2: Calculate the average crack width and determine the width of the cross-section where each pixel is located. Use the bwskel function to obtain the crack skeleton pixels and their coordinates. The pattern in this embodiment contains 1952 crack skeleton pixels. Use the bwboundaries function to obtain the crack edge pixels and their coordinates. The pattern in this embodiment contains 4126 crack edge pixels. Measure the distance values between each crack skeleton pixel and all crack edge pixels. If the coordinates of the k-th crack skeleton pixel are (x k , y k ), k = 1, 2,..., 1952, and the coordinates of the p-th crack edge pixel are (x p , y p ), p = 1, 2,..., 4162, then the distance d kp between the k-th crack skeleton pixel and the p-th crack edge pixel is:

[0060]

[0061] The distance d k between the k-th crack skeleton pixel and its nearest crack edge pixel is:

[0062] d k = min{d kp}, p = 1, 2,..., 4162

[0063] Calculate the average crack width d ave ,

[0064]

[0065] In this embodiment, the pattern d ave is 13.1582 pixels.

[0066] Obtain the coordinates of all crack pixels. The pattern in the embodiment contains 29146 crack pixels, and obtain the distances between each crack pixel and its nearest crack skeleton pixel and the distances between each crack pixel and its nearest crack edge pixel.

[0067] Specifically, the image array coordinates of the i-th crack pixel (i = 1, 2,..., 29146) are (x i , y i ), and the distance d ip between the i-th crack pixel and the p-th crack edge pixel is:

[0068]

[0069] The distance b i between the i-th crack pixel and its nearest crack edge pixel is

[0070] b i = min{dip}, (where p = 1, 2, …, 4162)

[0071] The distance d between the i-th crack pixel and the k-th crack skeleton pixel ik is defined as:

[0072]

[0073] The distance a between the i-th crack pixel and its nearest crack skeleton pixel i is

[0074] a i = min{d ik}, (where k = 1, 2, …, 1952)

[0075] S3: Define the curvilinear depression mapping function according to d ave First, determine the depression mapping function of the standard cross-section of the crack according to d ave Specifically, select a function z = z ave (a i ) with a narrow bottom and wide top and axisymmetric shape under the curve form such as a quadratic function. The independent variable of the function is the distance a between the i-th crack pixel and its nearest crack skeleton pixel i , and z is the depression mapping coordinate of the corresponding mapped scatter point of the crack pixel. And when a i = 0 (i.e., when it is a crack skeleton pixel), z ave has a minimum value. Among them, the minimum value of z ave is z ave_min . In this embodiment, according to d ave = 13.1582, it is defined as:

[0076] z i = z ave (a i ) = -7.2141 + a i 2 / 6

[0077] Then z ave_min = -7.2141. Then, according to the ratio of a i + b i to d ave , obtain the depression mapping scaling coefficient k i of the i-th crack pixel, which is defined as:

[0078]

[0079] Taking the first crack pixel in the embodiment drawing as an example, a 1 = 2, b 1 = 3, then k 1= 2×(2 + 3) / 13.1582 = 0.7600. Then, the height mapping function is scaled and corrected as follows. The depression mapping coordinate z of the i-th crack pixel i is:

[0080]

[0081] Then, the depression mapping value of the first crack pixel is

[0082] z 1 = [-7.2141 + (2 / 0.7600) 2 / 6]×0.7600 = -4.6055

[0083] Refer to the comparison Figure 2 , Figure 3 and Figure 4 , which can reflect the depression mapping of the corresponding scatter points of some pixels in the sample diagram. Among them, the gray scatter points correspond to the matrix pixels, and the black scatter points correspond to the crack pixels. After mapping, the curve shapes of each cross-section of the crack are similar. The crack position is consistent with the actual situation.

[0084] S4: Preliminary establishment of triangulation

[0085] According to the x coordinate, y coordinate and mapped height value z of each pixel in the image array, corresponding points are established in the three-dimensional space. Among them, the mapped height values of the matrix pixels are all 0, such as Figure 4 . Then, taking these points as vertices, the delaunay triangulation is established using the delaunay function, such as Figure 5 . For simplicity of description, the vertices corresponding to the crack skeleton pixels are hereinafter referred to as skeleton vertices, the vertices corresponding to the crack edge pixels are hereinafter referred to as edge vertices, and the vertices corresponding to the crack pixels that are neither skeleton nor edge are hereinafter referred to as ordinary crack vertices. Then, the vertex corresponding to the k-th crack skeleton pixel is called skeleton vertex k, the vertex corresponding to the p-th crack edge pixel is called edge vertex p, and the vertex corresponding to the w-th crack pixel that is neither skeleton nor edge is called ordinary crack vertex w. The sample diagram of this embodiment contains 23068 crack pixels that are neither skeleton nor edge, then w = 1, 2,..., 23068.

[0086] S5: Vertex and triangular facet refinement and optimization

[0087] To reduce the size of the generated 3D model file and avoid using too many triangular facets to represent a plane or a relatively flat surface, and to make the triangular facets represent more complex geometric features. It is necessary to refine the vertices, and then optimize the representation and description of the target crack using triangular facets.

[0088] S5.1: Refine edge vertices:

[0089] According to adjacent positions, by traversing one by one along the crack edge, one crack edge pixel is reserved every n crack edge pixels, and then the corresponding edge vertices are reserved. n is an integer greater than 1 according to requirements. In this embodiment, n is taken as 2.

[0090] Let j = 0, and u be the remainder of j divided by n. In each step of S5.1, j is a continuously changing value, and u changes with the change of j. Select any crack edge pixel as the pixel to be sorted, and execute the following steps:

[0091] S5.1.1: Count the remaining crack edge pixels in the 3×3 neighborhood of the current pixel to be sorted. Consider the current edge pixel as registered. If u = 0, then classify the current crack edge pixel into the reserved category, otherwise classify it into the non-reserved category. Then, let j = j + 1, and change the pixel to be sorted to the remaining unregistered crack edge pixel in the 3×3 neighborhood of the previous pixel to be sorted.

[0092] S5.1.2: Repeat S5.1.1 until there are no unregistered crack edge pixels in the 3×3 neighborhood of the current pixel to be sorted. If there are still unregistered crack edge pixels in the current pattern, change the pixel to be sorted to any unregistered crack edge pixel and repeat the processing flow of S5.1.1; if there are no unregistered crack edge pixels in the current pattern, then directly jump to S5.1.3.

[0093] S5.1.3: Continue to select any crack edge pixel as the pixel to be sorted, and repeat S5.1.1 - S5.1.2 until all crack edge pixels in the current pattern are registered. Reserve the vertices corresponding to the crack edge pixels classified into the reserved category, and delete the vertices corresponding to the crack edge pixels classified into the non-reserved category. Thus, the edge vertex reduction work is completed.

[0094] The crack edge pixels classified into the reserved category in this embodiment are shown in Figure 6 , compared with Figure 2 , it can be found that after reduction, fewer edge pixels can still better describe the morphology and basic positions of each part of the crack.

[0095] S5.2: Simplify the skeleton vertices:

[0096] Obtain the triangular patches connected to the vertices corresponding to each crack skeleton pixel, and calculate the normal vectors of these triangular patches by the following method. If the spatial positions of the three vertices of a certain triangular patch are respectively (x 1 , y 1 , z 1 ), (x 2 , y 2 , z 2 ), (x 3 , y 3 , z 3), use the vector cross product to calculate the unit normal vector of the triangle:

[0097]

[0098] The normal vector of the vertex corresponding to each crack skeleton pixel is the vector sum of the unit normal vectors of the triangles connected to it; then the unit normal vector of each skeleton vertex is obtained according to the normal vector of the vertex corresponding to each crack skeleton pixel; then the average value of the angle between the unit normal vector of each skeleton vertex and the unit normal vector of each triangle connected to it is calculated. The average values ​​of the angles of each skeleton vertex are sorted from large to small, and the first 30%-50% of the skeleton vertices are retained, and the rest of the skeleton vertices are eliminated. This embodiment retains the first 50% of the skeleton vertices.

[0099] S5.3: Simplify common crack vertices

[0100] Common crack vertices are vertices corresponding to crack pixels that are not skeletons and edges. The same method as S5.2 is used to obtain the average value of the angles between the common crack vertices and the unit normal vectors of each triangle face connected to them. The average values ​​of the angles of the common crack vertices are sorted from large to small, and the first 30%-50% of the common crack vertices are retained, and the remaining common crack vertices are eliminated. This embodiment retains the first 50% of the common crack vertices.

[0101] contrast Figure 2 and Figure 6 , it can be found that the changes in the crack pixels after the binary image of the embodiment is simplified.

[0102] S5.4: Reduction of matrix pixel corresponding vertices

[0103] Assume that all matrix pixels are in the same plane, that is, z = 0. Therefore, only the vertices (a total of four) corresponding to the matrix pixels closest to the upper left corner, upper right corner, lower left corner, and lower right corner of the image are retained.

[0104] S6: Reconstruct triangulation and export STL file

[0105] Re-establish the Delauny triangulation based on the retained vertices to obtain the triangular facets, and then use the STL stereolithography technology to obtain the three-dimensional model of the crack from the triangulation, and export the STL file, such as Figure 7 shown.

[0106] S7: Integrate cracks into the object model in computer-aided design software

[0107] Compared with cracks, objects with cracks mostly have simple geometric features and regular shapes (such as beams, columns, floor slabs, masonry, etc.), and are more suitable for creating geometric models using commercial computer-aided design software with good interactivity.

[0108] Specifically, the crack model represented by the STL file is imported into a commercial computer-aided design software, and embedded into the apparent position of the three-dimensional model of the object to be characterized containing the crack. In this embodiment, the crack is located on a flat slate, and the STL is imported into Solidworks in the form of a surface solid. Then, a rectangle of 614×614 is established, and the rectangle is stretched in a plane to the imported surface solid to form a three-dimensional model containing the geometric features of the required crack depression surface.

[0109] The fine three-dimensional model file produced in this embodiment is relatively small, can better describe the morphology of each part of the characterized crack, and is smoothly imported into the numerical simulation analysis software without freezing or software process crashes. The simulation results will be more persuasive than the simple two-dimensional models used in existing work.

Claims

1. A method for constructing a three-dimensional model of apparent cracks in an image, characterized in that: The method comprises the following steps: Step 1, collect two-dimensional images of cracks, and use image processing methods for image noise reduction and binary segmentation to obtain crack-matrix binary images; Step 2, calculate the average width of the cracks, and determine the width of the cross-section where each pixel is located; perform depression mapping on different widths of the cracks to obtain the depression mapping coordinates of the crack pixels; The depression mapping method includes: According to the average width d ave Determine the depression mapping function of the crack standard section, and select a function z = z with a narrow lower part and a wide upper part and axial symmetry in the curve form ave (a i ); where the independent variable a of the function i is the distance between the i-th crack pixel and its nearest crack skeleton pixel in the section with the average width, and the dependent variable z is the mapping coordinate of the mapping scatter point corresponding to the i-th crack pixel; The mapping function takes the current cross-section crack skeleton pixel as the origin, and defines the distance between the i-th crack pixel and its nearest crack edge pixel as b i ; when a i = 0, that is, when the current is a crack skeleton pixel, z ave has the minimum value z ave_min ; the depression mapping scaling coefficient k i of the i-th crack pixel is: Then where z i is the depression mapping coordinate of the i-th crack pixel; Step 3, combine the depression mapping coordinates of the crack pixels with the coordinates of each pixel in the two-dimensional image to obtain corresponding three-dimensional scatter points, create a Delaunay triangulation with these three-dimensional scatter points as vertices, and establish triangular patches; Step 4, optimize the number of vertices and triangular patches. The vertices include crack edge vertices, crack skeleton vertices, ordinary crack vertices, and vertices corresponding to matrix pixels. Delete the triangular patches and their vertices used to represent planes and surfaces with curvatures less than a certain value to characterize the necessary geometric features with the simplified vertices and triangular patches; Step 5, re-establish a Delauny triangulation based on the optimized vertices to obtain triangular patches, and use STL stereolithography technology to obtain a three-dimensional model of the cracks.

2. The three-dimensional model construction method according to claim 1, characterized in that: In the said Step 2, calculating the average width of the cracks and determining the width of the cross-section where each pixel is located specifically includes: Obtain the crack skeleton pixels and their coordinates. There are a total of K crack skeleton pixels, and the coordinates of the k-th crack skeleton pixel are (x k , y k ); Obtain the crack edge pixels and their coordinates. There are a total of P crack edge pixels, and the coordinates of the p-th crack edge pixel are (x p , y p ); Then the distance d kp between the k-th crack skeleton pixel and the p-th crack edge pixel is: The distance d between the k-th crack skeleton pixel and its nearest crack edge pixel k is: d k = min(d kp ); Calculate the average crack width d ave , and the formula is as follows: Obtain the coordinates of all crack pixels. There are I crack pixels in total. Calculate the distance between each crack pixel and its nearest crack skeleton pixel, and the distance between each crack pixel and its nearest crack edge pixel; Let the coordinates of the $i$-th crack pixel in the two-dimensional image array be $(x i , y i ). The distance between the $i$-th crack pixel and the $k$-th crack skeleton pixel is $d ik . The distance between the $i$-th crack pixel and the $p$-th crack edge pixel is $d ip . The distance between the $i$-th crack pixel and its nearest crack skeleton pixel is $a i . The distance between the $i$-th crack pixel and its nearest crack edge pixel is $b i ; then a i = min{d ik} b i = min(d ip ) The width of the cross-section of the crack where the i-th crack pixel is located is 2×(a i +b i ).

3. The three-dimensional model construction method according to claim 1 or 2, characterized in that: In the said Step 4, streamline the crack edge vertices. According to the adjacent positions, by traversing one by one along the crack edge, retain one crack edge pixel every n crack edge pixels, where n is an integer greater than 1; let j = 0, and u be the remainder of j divided by n; select any one crack edge pixel as the pixel to be sorted, and execute the following steps: S4.1.1: Count the remaining crack edge pixels in the 3×3 neighborhood of the current pixel to be sorted; regard the current crack edge pixel as registered; If u = 0 at this time, then classify the current crack edge pixel into the retained category, otherwise classify it into the non-retained category; then, let j = j + 1, and change the pixel to be sorted to any unregistered crack edge pixel in the 3×3 neighborhood of the previous pixel to be sorted; S4.1.2: Repeat S4.1.1 until there are no unregistered crack edge pixels in the 3×3 neighborhood of the current pixel to be sorted; if there are still unregistered crack edge pixels, change the pixel to be sorted to any unregistered crack edge pixel and continue to execute S4.1.1; if there are no unregistered crack edge pixels, then directly jump to S4.1.3; S4.1.3: Continue to select any one crack edge pixel as the pixel to be sorted, and repeat S4.1.1 - S4.1.2 until all crack edge pixels in the current pattern are registered; retain the vertices corresponding to the crack edge pixels classified into the retained category, and delete the vertices corresponding to the crack edge pixels classified into the non-retained category.

4. The three-dimensional model construction method according to claim 1 or 2, characterized in that: in step four, the vertices of the crack skeleton are refined, specifically including: obtaining the triangular patches connected to the vertices corresponding to each crack skeleton pixel, and calculating the unit normal vector of the triangular patch using the vector cross product. The formula is as follows: where (x 1 , y 1 , z 1 ), (x 2 , y 2 , z 2 ), (x 3 , y 3 , z 3 ) are the spatial positions of the three vertices of the triangular patch respectively; The normal vector of the vertex corresponding to each crack skeleton pixel is the vector sum of the unit normal vectors of the triangular patches connected to it; then, the unit normal vector of each skeleton vertex is obtained according to the normal vector of the vertex corresponding to each crack skeleton pixel; then, the average value of the angles between the unit normal vector of each skeleton vertex and the unit normal vectors of the triangular patches connected to it is calculated, and the skeleton vertices with the average value of the included angle within a certain range are retained.

5. The three-dimensional model construction method according to claim 1 or 2, characterized in that: in step four, the vertices of ordinary cracks are refined, specifically: the ordinary crack vertices refer to non-edge vertices and non-skeleton vertices. Obtain the unit normal vectors of each ordinary crack vertex in the triangulation and the unit normal vectors of the triangular patches connected to it; calculate the average value of the angles between the unit normal vector of each ordinary crack vertex and the unit normal vectors of the triangular patches connected to it, and retain the ordinary crack vertices with the average value of the included angle within a certain range.

6. The three-dimensional model construction method according to claim 1 or 2, characterized in that: in step four, the vertices corresponding to the matrix pixels are refined, specifically: There is no concave mapping for the matrix pixels, that is, the z values of the corresponding three-dimensional scatter points are all 0, and only the four vertices corresponding to the matrix pixels closest to the upper left corner, upper right corner, lower left corner, and lower right corner of the image are retained.

Citation Information

Patent Citations

  • Texture rendering method and system for real-time three-dimensional human body reconstruction, chip, equipment and medium

    CN111243071A

  • Method and device for automatically drawing structural cracks and precisely measuring widths thereof

    US20200364849A1