A method for directly generating a hexahedral mesh based on industrial CT sequence images

By directly utilizing industrial CT sequence images for preprocessing and octree partitioning, extracting the core mesh and optimizing the boundary fitting, the inefficiency problem caused by relying on CAD models in existing technologies is solved, and the automated generation of hexahedral meshes is realized.

CN115880421BActive Publication Date: 2026-05-22CHONGQING UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHONGQING UNIV
Filing Date
2022-11-02
Publication Date
2026-05-22

Smart Images

  • Figure CN115880421B_ABST
    Figure CN115880421B_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on industrial CT sequence image direct generation hexahedral grid method, comprising the following steps: 1) reading the CT sequence image of workpiece;2) the CT sequence image is preprocessed, to obtain target area with workpiece information;3) based on octree, target area is divided into several hexahedral grid;4) extracting core grid and its outer surface in hexahedral grid;5) fitting is carried out to core grid, and boundary grid is obtained;6) boundary grid unit is optimized in quality, and then the hexahedral grid corresponding to workpiece is obtained.This method uses the CT sequence image of workpiece as input, first image pre-processing, secondly, using octree divides grid, extracts core grid and outer surface, then boundary fitting is carried out, finally, grid optimization is carried out, realizes that CT image directly generates hexahedral grid, does not need third party commercial software to reconstruct the CAD model of workpiece, can improve automation degree, efficiency is promoted.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of industrial image processing, specifically a method for directly generating hexahedral meshes based on industrial CT sequence images. Background Technology

[0002] Currently, hexahedral mesh generation mainly relies on CAD models, and research on directly generating hexahedral meshes from industrial CT sequence images has not yet been found. The traditional approach to generating hexahedral meshes from industrial CT sequence images involves first importing the CT sequence images into third-party commercial software for 3D reconstruction to obtain the workpiece's CAD model, and then manually meshing the obtained CAD model in pre-processing software. Given the inefficiency of this traditional approach, which relies on intermediate steps to generate CAD models, requires manual mesh generation, and demands a certain level of software proficiency, researching methods for directly generating hexahedral meshes from industrial CT images is particularly important. Summary of the Invention

[0003] The purpose of this invention is to provide a method for directly generating hexahedral meshes based on industrial CT sequence images, comprising the following steps:

[0004] 1) Read the CT sequence images of the workpiece;

[0005] 2) Preprocess the CT sequence images to obtain the target area containing workpiece information;

[0006] 3) Based on the octree, the target region is divided into several hexahedral meshes;

[0007] 4) Extract the core mesh and its outer surface from the hexahedral mesh;

[0008] 5) Fit the core mesh to obtain the boundary mesh;

[0009] 6) Optimize the quality of the boundary mesh elements to obtain the hexahedral mesh corresponding to the workpiece.

[0010] Furthermore, the CT sequence image includes a background region and a target region, and the pixels within the target region contain workpiece information.

[0011] Furthermore, the preprocessing steps for the CT sequence images include:

[0012] 2.1) Denoising the CT sequence images;

[0013] 2.2) Threshold segmentation is performed on the CT sequence images after noise reduction to separate the target area from the background area.

[0014] 2.3) Based on the octree, the target region is divided into several hexahedral meshes;

[0015] Furthermore, based on the octree, the steps of dividing the target region into several hexahedral meshes include:

[0016] 3.1) Divide the octree nodes into white nodes, gray nodes, and black nodes; each node represents a hexahedral unit; where all pixels in a white node have a gray value of 0; some pixels in a gray node have the same gray value as the target area; and all pixels in a black node have the same gray value as the target area.

[0017] 3.2) Find a bounding box that can hold all the information of the workpiece and initialize it as the root node of an octree;

[0018] 3.3) Set the minimum side length L for generating the mesh. min L min It is an integer multiple of the unit pixel;

[0019] 3.4) Determine whether the current octree node is a gray node or a black node. If it is, proceed to step 3.5); otherwise, continue to determine whether the next octree node is a gray node or a black node.

[0020] 3.5) Determine whether the side length of the current octree node has reached the set minimum side length L. min If it is greater than L min If the current node is discrete into 8 child nodes of equal size, then step 3.4) is executed for each child node; if it equals L min Then continue to check whether the side length of the next octree node reaches the set minimum side length L. min .

[0021] Furthermore, the root node size of the octree is 2. n The parameter n is as follows:

[0022]

[0023] In the formula, max represents the maximum value, and log represents the logarithm. This indicates that the result is rounded up; cols, rows, and num represent the length, width, and number of industrial CT sequence images;

[0024] Furthermore, the steps for extracting the core mesh from the hexahedral mesh include: deleting white and gray nodes, retaining all black nodes, and generating the core mesh.

[0025] Furthermore, the steps for extracting the outer surface of the core mesh include:

[0026] a) Number the eight vertices of each grid;

[0027] b) Set the search direction and search coordinates for adjacent cells for each face, with the search directions being left, right, back, front, up, and down respectively;

[0028] c) Traverse the six faces of the core mesh hexahedral cells. If the coordinates of vertex 0 of a cell match the search coordinates, then this face is an internal face; otherwise, it is an external face.

[0029] Furthermore, the steps for fitting the core mesh to obtain the boundary mesh include:

[0030] 5.1) Solve for the normal vector n of the outer surface points of the core mesh. i ,Right now:

[0031]

[0032] In the formula, m is the number of outer surfaces sharing this point, and n j Let be the normal vector of the shared face j;

[0033] 5.2) Solving for the two-dimensional contour intersection point, the steps include: taking the projection point of the outer surface point of the core mesh on the CT sequence image as the starting point, searching for the contour intersection point along the projection vector n. When the gray value of the adjacent pixel on the search path changes abruptly from 255 to 0, the pixel with a gray value equal to 255 is taken as the two-dimensional contour intersection point of the image; 255 is the gray value of the pixel in the target area.

[0034] 5.3) Solve for the fitting points on the boundary surface;

[0035] 5.4) Connect the fitted points to generate the boundary mesh.

[0036] Furthermore, the steps for solving the fitting points on the boundary surface include:

[0037] 5.3.1) Project the outer surface points of the core mesh and their normal vector n onto the two adjacent CT images, with the projection points being a1 and a2, and the corresponding projection normal vectors being n′ and n″;

[0038] 5.3.2) Solve for the intersection points a1′ and a2′ of the two 2D contours on the two CT images respectively;

[0039] 5.3.3) In three-dimensional space, connect two contour intersection points a1′ and a2′ to form a three-dimensional straight line l. Point a and the normal vector n form a ray. Find the intersection point b of the ray and the straight line l.

[0040] 5.3.4) Determine the spatial relationship between the intersection point b and the current two CT images. If the intersection point is higher than the upper image, select two CT images that are moved up one interval unit and return to step 5.3.2); if the intersection point is lower than the lower image, select two CT images that are moved down one interval unit and return to step 5.3.2); if the intersection point is between two CT images, this point is the boundary surface fitting point.

[0041] 5.3.5) Repeat steps 5.3.1) to 5.3.4) to obtain the boundary surface fitting points corresponding to each core mesh outer surface point.

[0042] Furthermore, the steps for quality optimization of boundary mesh cells include:

[0043] 6.1) Boundary point smoothing: Let p i p is the boundary point to be adjusted. i-1 With p i+1 For adjacent boundary points or feature points; connect p i-1 With p i+1 Construct a straight line l passing through point p. i Draw the normal vector n of line l, and then point p. L Move along the n-direction to the boundary to obtain the adjusted boundary point p. i ′;

[0044] 6.2) Perform Laplacian smoothing on surface and internal points.

[0045] The technical effectiveness of this invention is undeniable. Addressing the problem that generating hexahedral meshes from industrial CT images relies on third-party commercial software to generate CAD models, requiring manual intervention and a certain level of software proficiency, resulting in low efficiency, this invention proposes a method for directly generating hexahedral meshes from industrial CT images. This method uses CT sequence images of the workpiece as input. First, the images are preprocessed. Then, an octree is used to divide the mesh, extracting the core mesh and outer surface. Next, boundary fitting is performed, and finally, mesh optimization is conducted. This achieves direct generation of hexahedral meshes from CT images, eliminating the need for third-party commercial software to reconstruct the workpiece's CAD model, and also eliminating the need to import the reconstructed CAD model into preprocessing software for manual hexahedral mesh generation. This improves automation and efficiency. Attached Figure Description

[0046] Figure 1 A flowchart for the method implementation;

[0047] Figure 2 Generate the core mesh: Figure 2 (a) is a CT sequence image of a gear; Figure 2 (b) is the core mesh of the gear;

[0048] Figure 3 Generate boundary mesh;

[0049] Figure 4 Optimize the boundary mesh.

[0050] Figure 5 Generate a hexahedral mesh for the CT sequence images of the support: Figure 5 (a) is the core grid; Figure 5 (b) is the boundary grid; Figure 5 (c) shows the optimized mesh;

[0051] Figure 6 (a)-(b) are schematic diagrams of vertex encoding and search direction;

[0052] Figure 7 Solve for the normal vector;

[0053] Figure 8 (a)-(b) are schematic diagrams for solving the intersection points of two-dimensional contours.

[0054] Figure 9 (a)-(d) are schematic diagrams of solving the surface fitting points;

[0055] Figure 10 This is a schematic diagram of surface fitting.

[0056] Figure 11 Smooth the boundary points;

[0057] Figure 12 (a)-(c) represent surface point smoothing;

[0058] Figure 13 (a)-(d) represent the internal point smoothing operation. Detailed Implementation

[0059] The present invention will be further described below with reference to embodiments, but it should not be construed that the scope of the present invention is limited to the following embodiments. Various substitutions and modifications made based on ordinary technical knowledge and common practices in the art without departing from the above-described technical concept of the present invention should be included within the scope of protection of the present invention.

[0060] Example 1:

[0061] See Figures 1 to 13 A method for directly generating hexahedral meshes based on industrial CT sequence images includes the following steps:

[0062] 1) Read the CT sequence images of the workpiece;

[0063] 2) Preprocess the CT sequence images to obtain the target area containing workpiece information;

[0064] 3) Based on the octree, the target region is divided into several hexahedral meshes;

[0065] 4) Extract the core mesh and its outer surface from the hexahedral mesh;

[0066] 5) Fit the core mesh to obtain the boundary mesh;

[0067] 6) Optimize the quality of the boundary mesh cells to obtain the hexahedral mesh corresponding to the workpiece. This hexahedral mesh helps to determine whether the workpiece meets the processing requirements and whether there are defects or faults. It can also provide assistance for the industrial design and manufacturing of the workpiece.

[0068] The CT sequence image includes a background region and a target region, and the pixels within the target region contain workpiece information.

[0069] The steps for preprocessing the CT sequence images include:

[0070] 2.1) Denoising the CT sequence images;

[0071] 2.2) Threshold segmentation is performed on the CT sequence images after noise reduction to separate the target area from the background area.

[0072] 2.3) Based on the octree, the target region is divided into several hexahedral meshes;

[0073] The steps for dividing the target region into several hexahedral meshes based on an octree include:

[0074] 3.1) Divide the octree nodes into white nodes, gray nodes, and black nodes; each node represents a hexahedral unit; where all pixels in a white node have a gray value of 0; some pixels in a gray node have the same gray value as the target area; and all pixels in a black node have the same gray value as the target area.

[0075] 3.2) Find a bounding box that can hold all the information of the workpiece and initialize it as the root node of an octree;

[0076] 3.3) Set the minimum side length L for generating the mesh. min L min It is an integer multiple of the unit pixel;

[0077] 3.4) Determine whether the current octree node is a gray node or a black node. If it is, execute step 3.5); otherwise, return to the previous level of recursion.

[0078] 3.5) Determine whether the side length of the current octree node has reached the set minimum side length L. min If it is greater than L minIf the current node is discrete into 8 child nodes of equal size, then step 3.4) is executed for each child node; if it equals L min If so, then it will backtrack to the previous level of recursion.

[0079] The root node size of the octree is 2 n The parameter n is as follows:

[0080]

[0081] In the formula, max represents the maximum value, and log represents the logarithm. This indicates that the result is rounded up; cols, rows, and num represent the length, width, and number of industrial CT sequence images;

[0082] The steps to extract the core mesh from a hexahedral mesh include: deleting white and gray nodes, retaining all black nodes, and generating the core mesh.

[0083] The steps for extracting the outer surface of the core mesh include:

[0084] a) Number the eight vertices of each grid;

[0085] b) Set the search direction and search coordinates for adjacent cells for each face, with the search directions being left, right, back, front, up, and down respectively;

[0086] c) Traverse the six faces of the core mesh hexahedral cells. If the coordinates of vertex 0 of a cell match the search coordinates, then this face is an internal face; otherwise, it is an external face.

[0087] The steps for fitting the core mesh to obtain the boundary mesh include:

[0088] 5.1) Solve for the normal vector n of the outer surface points of the core mesh. i ,Right now:

[0089]

[0090] In the formula, m is the number of outer surfaces sharing this point, and n j Let be the normal vector of the shared face j;

[0091] 5.2) Solving for the two-dimensional contour intersection point, the steps include: taking the projection point of the outer surface point of the core mesh on the CT sequence image as the starting point, searching for the contour intersection point along the projection vector n. When the gray value of the adjacent pixel on the search path changes abruptly from 255 to 0, the pixel with a gray value equal to 255 is taken as the two-dimensional contour intersection point of the image; 255 is the gray value of the pixel in the target area.

[0092] 5.3) Solve for the fitting points on the boundary surface;

[0093] 5.4) Connect the fitted points to generate the boundary mesh.

[0094] The steps for finding the fitted points on the boundary surface include:

[0095] 5.3.1) Project the outer surface points of the core mesh and their normal vector n onto the two adjacent CT images, with the projection points being a1 and a2, and the corresponding projection normal vectors being n′ and n″;

[0096] 5.3.2) Solve for the intersection points a1′ and a2′ of the two 2D contours on the two CT images respectively;

[0097] 5.3.3) In three-dimensional space, connect two contour intersection points a1′ and a2′ to form a three-dimensional straight line l. Point a and the normal vector n form a ray. Find the intersection point b of the ray and the straight line l.

[0098] 5.3.4) Determine the spatial relationship between the intersection point b and the current two CT images. If the intersection point is higher than the upper image, select two CT images that are moved up one interval unit and return to step 5.3.2); if the intersection point is lower than the lower image, select two CT images that are moved down one interval unit and return to step 5.3.2); if the intersection point is between two CT images, this point is the boundary surface fitting point.

[0099] 5.3.5) Repeat steps 5.3.1) to 5.3.4) to obtain the boundary surface fitting points corresponding to each core mesh outer surface point.

[0100] The steps for optimizing the quality of boundary mesh cells include:

[0101] 6.1) Boundary point smoothing: Let p i p is the boundary point to be adjusted. i-1 With p i+1 For adjacent boundary points or feature points; connect p i-1 With p i+1 Construct a straight line l passing through point p. i Draw the normal vector n of line l, and then point p. L Move along the n-direction to the boundary to obtain the adjusted boundary point p. i ′;

[0102] 6.2) Perform Laplacian smoothing on surface and internal points.

[0103] Example 2:

[0104] A method for directly generating hexahedral meshes based on industrial CT sequence images includes the following steps:

[0105] 1. Reading CT sequence images of the workpiece: The image area of ​​an industrial CT image is divided into a background area and a target area. The pixels in the target area contain workpiece information.

[0106] 2. Image preprocessing: To facilitate subsequent mesh generation, the CT sequence images need to be preprocessed. After noise reduction, appropriate gray values ​​are selected for threshold segmentation. After threshold segmentation, the gray value of the pixels in the target area of ​​the workpiece is 255, and the gray value of the pixels in the background area is 0, thus separating the target area from the background area.

[0107] 3. Octree-based hexahedral mesh generation: In an octree, one node represents a hexahedral cell. To facilitate subsequent mesh generation, the octree nodes are first classified based on the number of pixels with a grayscale value of 255 within the hexahedral cell corresponding to each node: 1) White nodes, where all pixels have a grayscale value of 0; 2) Gray nodes, where some pixels within the cell have a grayscale value of 255; 3) Black nodes, where all pixels have a grayscale value of 255. Octree-based mesh generation is a recursive process of octree generation, with the following steps:

[0108] Step 1: Find a bounding box that can hold all the information of the workpiece and initialize it as the root node of an octree;

[0109] To ensure that the generated mesh side lengths are integers and the root node size is a power of 2, n is calculated based on the length (cols), width (rows), and number (num) of the industrial CT sequence images:

[0110]

[0111] In the formula, max represents taking the maximum value, and log represents taking the logarithm. This indicates that the result is rounded up.

[0112] Step 2: Set the minimum side length L for generating the mesh. min L min It is an integer multiple of the unit pixel;

[0113] Step 3: Determine whether the current octree node is a gray node or a black node, that is, whether it contains a pixel with a gray value of 255. If it is, proceed to step 4; otherwise, backtrack to the previous level of recursion.

[0114] Step 4: Determine if the side length of the current octree node has reached the set value L. min If it is greater than L min If the current node is discrete into 8 child nodes of equal size, then step 3 is executed for each child node; if it equals L min Otherwise, it will backtrack to the previous level of recursion.

[0115] 4. Core mesh and outer surface extraction:

[0116] Core mesh extraction: Delete white and gray nodes, and keep all black nodes to generate the core mesh.

[0117] Figure 2 (a) is a CT slice sequence image of the gear. The core mesh extracted after dividing the gear into hexahedral meshes using an octree is shown below. Figure 2 As shown in (b).

[0118] (2) Extraction of the outer surface of the core mesh: The outer surface of the core mesh is the surface that is not shared by other hexahedral elements. The extraction steps are as follows:

[0119] 1) Number the eight vertices of each grid cell, in the following order: Figure 6 As shown in (a);

[0120] 2) Set the search direction for adjacent cells for each face, namely left, right, back, front, up, and down. The search coordinates are as follows: Figure 6 As shown in (b), l is the side length L of the core mesh. min ;

[0121] 3) Traverse the six faces of the hexahedral cells represented by the core mesh. If the coordinates of vertex 0 of a cell match the search coordinates, then this face is an internal face; otherwise, it is an external face.

[0122] 5. Fitting the boundary mesh from the inside out: First, solve for the normal vectors of the points on the outer surface of the core mesh; then, solve for the intersection points of the two-dimensional contour; finally, solve for the surface fitting points.

[0123] Step 1: Calculate the normal vector of the core mesh outer surface point: This determines the fitting direction of the fitted point. It is obtained from the normal vectors of all core mesh outer surfaces sharing that point. The calculation formula is as follows:

[0124]

[0125] In equation (2), n j Let n be the normal vector we are looking for, and n be the number of outer surfaces sharing this point. j Let be the normal vector of the shared surface j. For example... Figure 7 As shown, m = 6 here.

[0126] Step 2: Solving for the intersection points of the two-dimensional contours: The solution diagram is shown below. Figure 8As shown, (a) is the projection result of the outer surface point of a core mesh and its normal vector on a CT image. The solution of the two-dimensional contour intersection point is shown in (b). Starting from the projection point a, the contour intersection point is found along the projection vector n. When the gray value of the adjacent pixel on the search path suddenly changes from 255 to 0, it indicates that there is a boundary here. The pixel with a gray value of 255 is the two-dimensional contour intersection point of the image, as shown in point b.

[0127] Step 3: Solving for surface fitting points: The solution diagram is a cross-sectional view, such as... Figure 9 As shown, the gray grid represents the core grid, L represents the image boundary, and the dashed line represents an industrial CT sequence image. The steps for finding the fitting points are as follows:

[0128] 1): Project the outer surface point a of the core mesh and its normal vector n onto the two adjacent CT images (dashed lines with triangles), with projection points a1 and a2, and corresponding projection normal vectors n′ and n″.

[0129] 2): Solve for the intersection points a1′ and a2′ of the two 2D contours on the two CT images respectively;

[0130] 3): In three-dimensional space, a three-dimensional straight line l is formed by connecting the intersection points of two contours. Point a and the normal vector n form a ray. Find the intersection point b of this ray and the straight line l.

[0131] 4): Determine the spatial relationship between the intersection point b and the current two CT images. If the intersection point is higher than the upper image, select two CT images that are moved up one interval unit and return to step 2. If the intersection point is lower than the lower image, select two CT images that are moved down one interval unit and return to step 2. If the intersection point is between two CT images, then this point is the surface fitting point.

[0132] Figure 9 (a) The desired fitting point b deviates from the true boundary L of the image. Based on the above algorithm, three iterations are performed to obtain... Figure 9 (b) As a result, compared with (a), the fitted point b is closer to the true boundary at this time.

[0133] When the normal vector of the outer surface point of the core mesh is perpendicular to the CT image, the projection consists of only one point, making it impossible to solve for the contour intersection point using the method described above. For example... Figure 9 As shown in (c), when two CT images are selected at the area marked by the triangular dashed line, the pixel values ​​of the two projection points change, indicating the existence of a boundary. Therefore, the projection point before the pixel value change is used as the surface fitting point, as shown in point b. The vector being perpendicular to the CT image also exists. Figure 9 In the case shown in (d), the vector is parallel to the boundary, and the operation is the same. Figure 9(c) Similarly, if the pixel values ​​of the projected points remain unchanged, the top or bottom CT images will eventually be retrieved. In this case, the projected points on the top or bottom images will be used as the surface fitting points, such as... Figure 9 (d) Points b1 and b2 are shown.

[0134] 6. Boundary Mesh Generation: Connecting the fitted points generates the boundary mesh. Boundary elements are constructed by connecting the outer surface points of the core mesh with the surface fitted points, such as... Figure 10 As shown. Among them, surface F is a patch on the outer surface of the core mesh, 0, 1, 2, 3 are the outer surface points on surface F, the arrows are the normal vectors corresponding to each point, and 4, 5, 6, 7 are the surface fitting points. A boundary element 0-1-2-3-4-5-6-7 can be constructed through these eight vertices.

[0135] Figure 2 (b) The boundary mesh generated after fitting the gear core mesh is as follows: Figure 3 As shown in the image, however, the generated boundary mesh contains elements of poor quality, so further optimization is needed to improve its quality.

[0136] 7. Mesh Optimization: To improve the quality of boundary elements, the Laplace smoothing algorithm is used to optimize their quality. Smoothing is performed sequentially on boundary points, surface points, and interior points.

[0137] like Figure 11 As shown, boundary point smoothing: p i p is the boundary point to be adjusted. i-1 With p i+1 For adjacent boundary points or feature points, p i Point p is obtained through Laplace smoothing. L When the boundary curvature is large, p L It will deviate from the true boundary (dashed line), so point p also needs to be adjusted. L Adjust to the edge of the model to obtain the optimization point p. i The adjustment method is as follows: Connect p i-1 With p i+1 Construct a straight line l passing through point p. i Draw the normal vector n of line l, and then point p. L Move along the n-direction to the boundary to obtain point p. i This approach improves the quality of the boundary mesh while preserving the model's characteristics.

[0138] Surface point smoothing: Point p is obtained through Laplacian smoothing. iThe mesh quality is significantly improved. Case (a) occurs because the core mesh vertices are located at the boundary when the core mesh is generated. Therefore, during surface fitting, the surface fitting points coincide with the outer surface points of the core mesh, causing adjacent hexahedrons to degenerate and the surface quadrilaterals to degenerate into triangles. However, this does not change the topological connectivity. The mesh quality can also be improved by Laplacian smoothing.

[0139] (3) Internal point smoothing: External point smoothing can only improve the quality of units surrounding feature points and feature edges, such as... Figure 13 As shown, (b) is obtained by smoothing (a) through boundary points and surface points. The quality of boundary elements with multiple external faces is significantly improved (p). i The upper unit), while the boundary unit with only one side facing outwards (p) i The quality of the lower unit cannot be optimized. Therefore, Laplace smoothing is performed on the internal points of these units, and (c) is obtained from (b). By traversing the internal points of all boundary units, (d) is finally obtained.

[0140] Example 3:

[0141] A method for directly generating hexahedral meshes based on industrial CT sequence images includes the following steps:

[0142] 1) Read the CT sequence images of the workpiece.

[0143] 2) Preprocess the CT sequence images to obtain the target area containing workpiece information;

[0144] 3) Based on the octree, the target region is divided into several hexahedral meshes;

[0145] 4) Extract the core mesh and its outer surface from the hexahedral mesh;

[0146] 5) Fit the core mesh to obtain the boundary mesh.

[0147] 6) Optimize the quality of the boundary mesh elements to obtain the hexahedral mesh corresponding to the workpiece.

[0148] Example 4:

[0149] A method for directly generating hexahedral meshes based on industrial CT sequence images is described in Example 3. The CT sequence images include a background region and a target region, and the pixels within the target region contain workpiece information.

[0150] Example 5:

[0151] A method for directly generating hexahedral meshes based on industrial CT sequence images, the main contents of which are described in Example 3, wherein the preprocessing steps for the CT sequence images include:

[0152] 1) Denoise reduction processing is performed on the CT sequence images;

[0153] 2) Threshold segmentation is performed on the CT sequence images after noise reduction to separate the target area from the background area.

[0154] 3) Based on the octree, the target region is divided into several hexahedral meshes;

[0155] Example 6:

[0156] A method for directly generating hexahedral meshes based on industrial CT sequence images, the main content of which is described in Example 3, wherein the step of dividing the target region into several hexahedral meshes based on an octree includes:

[0157] 1) Divide the octree nodes into white nodes, gray nodes, and black nodes; each node represents a hexahedral unit; where all pixels in a white node have a gray value of 0; some pixels in a gray node have the same gray value as the target area; and all pixels in a black node have the same gray value as the target area.

[0158] 2) Find a bounding box that can hold all the information of the workpiece and initialize it as the root node of an octree;

[0159] 3) Set the minimum side length L for generating the mesh. min L min It is an integer multiple of the unit pixel;

[0160] 4) Determine whether the current octree node is a gray node or a black node. If it is, proceed to step 5); otherwise, continue to determine whether the next octree node is a gray node or a black node.

[0161] 5) Determine if the side length of the current octree node has reached the set minimum side length L. min If it is greater than L min If the current node is discrete into 8 child nodes of equal size, then step 4) is executed for each child node; if it equals L min Then continue to check whether the side length of the next octree node reaches the set minimum side length L. min .

[0162] Example 7:

[0163] A method for directly generating hexahedral meshes based on industrial CT sequence images is described in Example 3, where the root node size of the octree is 2. n The parameter n is as follows:

[0164]

[0165] In the formula, max represents the maximum value, and log represents the logarithm. This indicates that the result is rounded up; cols, rows, and num represent the length, width, and number of industrial CT sequence images; Example 8:

[0166] A method for directly generating hexahedral meshes based on industrial CT sequence images is described in Example 3. The step of extracting the core mesh from the hexahedral mesh includes: deleting white and gray nodes, retaining all black nodes, and generating the core mesh.

[0167] Example 9:

[0168] A method for directly generating hexahedral meshes based on industrial CT sequence images, the main contents of which are described in Example 3, wherein the step of extracting the outer surface of the core mesh includes:

[0169] 1) Number the eight vertices of each grid;

[0170] 2) Set the search direction and search coordinates for adjacent cells for each face, with the search directions being left, right, back, front, up, and down respectively;

[0171] 3) Traverse the six faces of the core mesh hexahedral cells. If the coordinates of vertex 0 of a cell match the search coordinates, then this face is an internal face; otherwise, it is an external face.

[0172] Example 10:

[0173] A method for directly generating hexahedral meshes based on industrial CT sequence images, the main contents of which are described in Example 3, wherein the step of fitting the core mesh to obtain the boundary mesh includes:

[0174] 1) Solve for the normal vector n of the outer surface points of the core mesh. i ,Right now:

[0175]

[0176] In the formula, m is the number of outer surfaces sharing this point, and n j Let be the normal vector of the shared face j;

[0177] 2) Solve for the two-dimensional contour intersection point. The steps include: starting from the projection point of the outer surface point of the core mesh on the CT sequence image, find the contour intersection point along the projection vector n. When the gray value of the adjacent pixel on the search path changes abruptly from 255 to 0, the pixel with a gray value of 255 is taken as the two-dimensional contour intersection point of the image; 255 is the gray value of the pixel in the target area.

[0178] 3) Solve for the fitting points on the boundary surface;

[0179] 4) Connect the fitted points to generate the boundary mesh.

[0180] Example 11:

[0181] A method for directly generating hexahedral meshes based on industrial CT sequence images is described in Example 3. The steps for solving the fitting points on the boundary surface include:

[0182] 1) Project the outer surface points of the core mesh and their normal vector n onto the two adjacent CT images, with the projection points being a1 and a2, and the corresponding projection normal vectors being n′ and n″;

[0183] 2) Solve for the intersection points a1′ and a2′ of the two 2D contours on the two CT images respectively;

[0184] 3) In three-dimensional space, connect two contour intersection points a1′ and a2′ to form a three-dimensional straight line l. Point a and the normal vector n form a ray. Find the intersection point b of the ray and the straight line l.

[0185] 4) Determine the spatial relationship between the intersection point b and the current two-layer CT images. If the intersection point is higher than the upper layer image, select two CT images that are moved up one interval unit and return to step 2); if the intersection point is lower than the lower layer image, select two CT images that are moved down one interval unit and return to step 2); if the intersection point is between two layers of CT images, then this point is the boundary surface fitting point.

[0186] 5) Repeat steps 1) to 4) to obtain the boundary surface fitting points corresponding to each core mesh outer surface point.

[0187] Example 12:

[0188] A method for directly generating hexahedral meshes based on industrial CT sequence images, the main contents of which are described in Example 3, wherein the step of optimizing the quality of boundary mesh elements includes:

[0189] 1) Boundary point smoothing: Let p i p is the boundary point to be adjusted. i-1 With p i+1 For adjacent boundary points or feature points; connect p i-1 With p i+1 Construct a straight line l passing through point p. i Draw the normal vector n of line l, and then point p. L Move along the n-direction to the boundary to obtain the adjusted boundary point p. i ′;

[0190] 2) Perform Laplacian smoothing on surface and internal points.

Claims

1. A method for directly generating hexahedral meshes based on industrial CT sequence images, characterized in that, Includes the following steps: Step 1) Read the CT sequence images of the workpiece; Step 2) Preprocess the CT sequence images to obtain the target area with workpiece information; Step 3) Based on the octree, divide the target region into several hexahedral meshes; Step 4) Extract the core mesh and its outer surface from the hexahedral mesh; Step 5) Fit the core mesh to obtain the boundary mesh; Step 6) Optimize the quality of the boundary mesh elements to obtain the hexahedral mesh corresponding to the workpiece; The steps for dividing the target region into several hexahedral meshes based on an octree include: Step 3.1) Divide the octree nodes into white nodes, gray nodes, and black nodes; each node represents a hexahedral unit; where all pixels in a white node have a gray value of 0; some pixels in a gray node have the same gray value as the target area; and all pixels in a black node have the same gray value as the target area. Step 3.2) Find a bounding box that can hold all the information of the workpiece and initialize it as the root node of an octree; Step 3.3) Set the minimum side length for generating the mesh. , It is an integer multiple of the unit pixel; Step 3.4) Determine whether the current octree node is a gray node or a black node. If it is, proceed to step 3.5). Otherwise, continue to determine whether the next octree node is a gray node or a black node. Step 3.5) Determine whether the side length of the current octree node has reached the set minimum side length. If greater than If the current node is discrete into 8 child nodes of equal size, then step 3.4 is executed for each child node. Then continue to check whether the side length of the next octree node reaches the set minimum side length. ; The root node size of the octree is The parameter n is as follows: (1) In the formula, max represents taking the maximum value. Represents taking the logarithm This indicates that the result is rounded up; cols, rows, and num represent the length, width, and number of industrial CT sequence images; The steps for extracting the core mesh from a hexahedral mesh include: deleting white and gray nodes, keeping all black nodes, and generating the core mesh; The steps for extracting the outer surface of the core mesh include: Step 4.1) Number the eight vertices of each grid; Step 4.2) Set the search direction and search coordinates of adjacent cells for each face. The search directions are left, right, back, front, up, and down, respectively. Step 4.3) Traverse the six faces of the core mesh hexahedral cells. If the coordinates of vertex 0 of a cell match the search coordinates, then this face is an internal face; otherwise, it is an external face. The steps for fitting the core mesh to obtain the boundary mesh include: Step 5.1) Solve for the normal vectors of the outer surface points of the core mesh. ,Right now: (2) In the formula, To share the number of outer surfaces at this point, Let be the normal vector of the shared face j; Step 5.2) Solve for the intersection of the two-dimensional contours. The steps include: taking the projection points of the outer surface points of the core mesh onto the CT sequence image as the starting point, along the projection vector... To find the intersection of the contours, when the gray value of an adjacent pixel on the search path suddenly changes from 255 to 0, the pixel with a gray value of 255 is taken as the intersection of the two-dimensional contours of the image; 255 is the gray value of the pixel in the target region. Step 5.3) Solve for the fitting points on the boundary surface; Step 5.4) Connect the fitted points to generate the boundary mesh; The steps for finding the fitted points on the boundary surface include: Step 5.3.1) Assign points to the outer surface of the core mesh and their normal vectors. Projected onto two adjacent CT images, the projection points are respectively and The corresponding projection normal vector is and ; Step 5.3.2) Solve for the intersection points of the two 2D contours on the two CT images respectively. and ; Step 5.3.3) In three-dimensional space, connect the intersection points of the two contours. and This forms a three-dimensional straight line l, with point a and the normal vector... Form a ray and find the intersection point b of the ray and the line l; Step 5.3.4) Determine the spatial relationship between the intersection point b and the current two-layer CT images. If the intersection point is higher than the upper layer image, select two CT images that are moved up one interval unit and return to step 5.3.2); if the intersection point is lower than the lower layer image, select two CT images that are moved down one interval unit and return to step 5.3.2); if the intersection point is between two layers of CT images, then this point is the boundary surface fitting point. Step 5.3.5) Repeat steps 5.3.1) to 5.3.4) to obtain the boundary surface fitting points corresponding to each core mesh outer surface point.

2. The method for directly generating hexahedral meshes based on industrial CT sequence images according to claim 1, characterized in that, The CT sequence image includes a background region and a target region, and the pixels within the target region contain workpiece information.

3. The method for directly generating hexahedral meshes based on industrial CT sequence images according to claim 2, characterized in that, The steps for preprocessing the CT sequence images include: Step 1) Denoise the CT sequence images; Step 2) Threshold segmentation is performed on the denoised CT sequence image to separate the target area from the background area.

4. The method for directly generating hexahedral meshes based on industrial CT sequence images according to claim 1, characterized in that, The steps for optimizing the quality of boundary mesh cells include: Step 1) Boundary point smoothing: (Note: The original text contains several grammatical errors and inconsistencies. A more accurate translation would require the full context.) For the boundary points to be adjusted, and Adjacent boundary points or feature points; connect and Construct a straight line l passing through the point Draw the normal vector n of line l, and then point... Move along the n-direction to the boundary to obtain the adjusted boundary point. ; Step 2) Perform Laplacian smoothing on surface and internal points.