A three-dimensional reconstruction method, device, medium and program product

By converting the three-dimensional grid data into a matrix set and using these matrix sets for three-dimensional reconstruction, the problem of reducing hardware processing speed in the existing three-dimensional data form is solved, and more efficient three-dimensional data processing is achieved.

CN119206137BActive Publication Date: 2025-03-07INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411735568.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2025-03-07
Estimated Expiration
2044-11-29

AI Technical Summary

Technical Problem

Existing three-dimensional data forms, such as point clouds and three-dimensional grids, are not friendly to underlying hardware processing, resulting in reduced hardware processing speed.

Method used

By converting the target 3D grid data into a matrix set of vertex coordinate matrices, edge-point relationship matrices, and face-edge relationship matrices, these matrix sets are used for 3D reconstruction, and hardware processing speed is improved.

Benefits of technology

The hardware processing speed during the three-dimensional reconstruction process is improved, and the adaptation and efficiency optimization of three-dimensional data processing is achieved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119206137B_ABST
    Figure CN119206137B_ABST
Patent Text Reader

Abstract

The present application discloses a three-dimensional reconstruction method, device, medium and program product, and relates to the field of data processing technology. The method includes: converting the format of target three-dimensional mesh data to obtain a matrix set corresponding to the target three-dimensional mesh data; the matrix set includes a vertex coordinate matrix, an edge-point relationship matrix, and a face-edge relationship matrix; the vertex coordinate matrix contains the three-dimensional coordinates of all vertices in the target three-dimensional mesh data, and the closer the distance between vertices in the three-dimensional mesh data, the closer the location of its data stored in the vertex coordinate matrix; each row of the edge-point relationship matrix represents the vertices corresponding to each edge, and different numbers are used to represent the starting point and end point of the edge; each row of the face-edge relationship matrix represents the edge corresponding to each triangular face, and positive and negative symbols are used to indicate whether the direction of the edge is the same as the clockwise direction of the face; three-dimensional reconstruction is performed based on the matrix set. The underlying hardware data processing speed and three-dimensional reconstruction speed are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a three-dimensional reconstruction method, device, medium and program product. Background Art

[0002] At present, common representation forms of 3D data include point cloud, 3D mesh, neural implicit representation, etc. Among them, 3D mesh data is the most commonly used 3D data form. However, 3D data in the form of point cloud and 3D mesh are not friendly to the underlying hardware processing and will reduce the hardware processing speed. Summary of the invention

[0003] In view of this, the purpose of the present invention is to provide a 3D reconstruction method, device, medium and program product, which can improve the processing speed of the underlying hardware and improve the speed of 3D reconstruction. The specific scheme is as follows:

[0004] In a first aspect, the present application discloses a three-dimensional reconstruction method, comprising:

[0005] Obtain target three-dimensional grid data;

[0006] The target three-dimensional mesh data is formatted to obtain a matrix set corresponding to the target three-dimensional mesh data; the matrix set includes a vertex coordinate matrix, an edge-point relationship matrix, and a face-edge relationship matrix; the vertex coordinate matrix contains the three-dimensional coordinates of all vertices in the target three-dimensional mesh data, and the closer the vertices are in the three-dimensional mesh data, the closer the location where their data is stored in the vertex coordinate matrix; each row of the edge-point relationship matrix represents the vertices corresponding to each edge, each column of the edge-point relationship matrix represents the edges corresponding to each vertex, and different numbers are used to represent the starting point and end point of the edge; each row of the face-edge relationship matrix represents the edges corresponding to each triangular face, and positive and negative signs are used to indicate whether the direction of the edge is the same as the clockwise direction of the face, and each column of the face-edge relationship matrix represents the triangular face corresponding to each edge;

[0007] A three-dimensional reconstruction is performed based on the matrix set.

[0008] Optionally, the construction of the matrix set includes:

[0009] Taking the initial vertex as the starting point and following the rule of traversing adjacent triangular faces first, traverse the vertices contained in all triangular faces in turn, and obtain the vertex coordinate matrix according to the three-dimensional coordinates of the traversed vertices, so that the closer the vertices are in the three-dimensional mesh data, the closer the data is stored in the vertex coordinate matrix; the initial vertex is the vertex with the smallest vertex index number in the target three-dimensional mesh data;

[0010] Traversing each edge in the target three-dimensional mesh data in turn, and assigning values ​​to the edge-point relationship matrix according to vertex index numbers of two vertices included in the current edge and the direction of the current edge, until all edges of the target three-dimensional mesh data are traversed;

[0011] Traverse each triangular face in the target three-dimensional mesh data in turn, and assign values ​​to the face-edge relationship matrix according to the edge index numbers of the three edges contained in the current triangular face, as well as the clockwise direction of the previous edge and the direction of the edge, until all triangular faces of the target three-dimensional mesh data are traversed.

[0012] Optionally, performing three-dimensional reconstruction based on the matrix set includes:

[0013] Obtaining a first query instruction for adjacent vertices of a target vertex in three-dimensional reconstruction;

[0014] Querying the transposed matrix of the edge-point relationship matrix according to the first query instruction to determine the target edge corresponding to the target vertex;

[0015] The edge-point relationship matrix is ​​queried to determine the remaining vertices corresponding to the target edge except the target vertex, so as to obtain the adjacent vertices of the target vertex.

[0016] Optionally, performing three-dimensional reconstruction based on the matrix set includes:

[0017] Obtaining a second query instruction for the face where the target vertex is located in the three-dimensional reconstruction;

[0018] Query the transposed matrix of the edge-point relationship matrix according to the second query instruction to determine the target edge corresponding to the target vertex;

[0019] The transposed matrix of the face-edge relationship matrix is ​​queried to determine the triangular face corresponding to the target edge, so as to obtain the triangular face where the target vertex is located.

[0020] Optionally, performing three-dimensional reconstruction based on the matrix set includes:

[0021] Obtaining a third query instruction for vertices included in the target surface in the three-dimensional reconstruction;

[0022] Querying the face-edge relationship matrix according to the third query instruction to determine the target edge corresponding to the target face;

[0023] The edge-point relationship matrix is ​​queried to determine all vertices corresponding to the target edge, so as to obtain all vertices included in the target surface.

[0024] Optionally, performing three-dimensional reconstruction based on the matrix set includes:

[0025] Obtaining a fourth query instruction for adjacent triangular faces of the target face in three-dimensional reconstruction;

[0026] Query the face-edge relationship matrix according to the fourth query instruction to determine the target edge corresponding to the target face;

[0027] The transposed matrix of the face-edge relationship matrix is ​​queried to determine the remaining triangular faces corresponding to the target edge except the target face, so as to obtain the triangular faces adjacent to the target face.

[0028] Optionally, performing three-dimensional reconstruction based on the matrix set includes:

[0029] Obtaining a data processing instruction issued during the three-dimensional reconstruction process, and determining whether the data processing instruction is a multiple query instruction;

[0030] If it is a multiple query instruction, the data processing instruction is decomposed into multiple single query instructions and then executed.

[0031] Optionally, performing three-dimensional reconstruction based on the matrix set includes:

[0032] Acquire multiple query instructions for adjacent vertices of vertices included in a target surface during a three-dimensional reconstruction process;

[0033] dividing the multiple query instructions into a first single query instruction for vertices included in the target face, and a second single query instruction for vertices corresponding to the vertices;

[0034] A target point included in the target surface is determined according to the first single query instruction, and a vertex corresponding to the target point is determined according to the second single query instruction.

[0035] Optionally, the acquiring target three-dimensional grid data includes:

[0036] Get three-dimensional mesh data;

[0037] The three-dimensional grid data is divided according to regions to obtain a plurality of three-dimensional sub-grid data, and the three-dimensional sub-grid data is used as the target three-dimensional grid data.

[0038] Optionally, segmenting the three-dimensional grid data according to regions to obtain a plurality of three-dimensional sub-grid data includes:

[0039] According to the preset maximum number of triangular faces and the maximum segmentation length, the three-dimensional mesh data is segmented according to the region to obtain a plurality of three-dimensional sub-mesh data.

[0040] Optionally, segmenting the three-dimensional grid data according to regions to obtain a plurality of three-dimensional sub-grid data includes:

[0041] According to the three-dimensional coordinate system corresponding to the three-dimensional grid data, three-dimensional sub-grid data corresponding to the three-dimensional grid data are obtained by segmenting on the horizontal coordinate, the vertical coordinate and the vertical coordinate respectively.

[0042] Optionally, segmenting the three-dimensional grid data according to regions to obtain a plurality of three-dimensional sub-grid data includes:

[0043] According to the corresponding segmentation order of different three-dimensional sub-grid data on the horizontal coordinate, the vertical coordinate and the ordinate, a unique corresponding grid block identifier is generated for the three-dimensional sub-grid data, so as to locate the three-dimensional sub-grid data through the grid block identifier.

[0044] In a second aspect, the present application discloses an electronic device, comprising:

[0045] Memory, used to store computer programs;

[0046] The processor is used to execute the computer program to implement the aforementioned three-dimensional reconstruction method.

[0047] In a third aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein the computer program implements the aforementioned three-dimensional reconstruction method when executed by a processor.

[0048] In a fourth aspect, the present application discloses a computer program product, including a computer program, which implements the aforementioned three-dimensional reconstruction method when executed by a processor.

[0049] In the present application, target three-dimensional mesh data is obtained; the format of the target three-dimensional mesh data is converted to obtain a matrix set corresponding to the target three-dimensional mesh data; the matrix set includes a vertex coordinate matrix, an edge-point relationship matrix, and a face-edge relationship matrix; the vertex coordinate matrix contains the three-dimensional coordinates of all vertices in the target three-dimensional mesh data, and the closer the vertices are in the three-dimensional mesh data, the closer the location where their data is stored in the vertex coordinate matrix; each row of the edge-point relationship matrix represents the vertices corresponding to each edge, each column of the edge-point relationship matrix represents the edges corresponding to each vertex, and the starting point and end point of the edge are represented by different numbers; each row of the face-edge relationship matrix represents the edges corresponding to each triangular face, and the positive and negative signs are used to indicate whether the direction of the edge is the same as the clockwise direction of the face, and each column of the face-edge relationship matrix represents the triangular face corresponding to each edge; three-dimensional reconstruction is performed based on the matrix set. It can be seen that in order to improve the processing speed of the underlying hardware in the 3D reconstruction process, the 3D mesh data is converted into a matrix form that is friendly to the top-level hardware, so that the hardware is based on matrix operations during 3D reconstruction; further, through the vertex coordinate matrix, the edge and point relationship matrix, and the face and edge relationship matrix, as well as different expressions such as numbers and symbols in the matrix, the various elements in the 3D mesh data can be fully expressed through the matrix; based on the constructed matrix set, the underlying hardware of the server is used for 3D reconstruction, which can improve the processing speed of the underlying hardware, improve the speed of 3D reconstruction, and achieve adaptation and efficiency optimization of the 3D data processing process. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0051] Figure 1 A flow chart of a three-dimensional reconstruction method provided in this application;

[0052] Figure 2 is a specific schematic diagram of three-dimensional grid data;

[0053] Figure 3 A specific vertex coordinate matrix storage vertex order diagram provided for this application;

[0054] Figure 4 Provided for this application Figure 2 A schematic diagram of the relationship matrix between edges and points corresponding to the three-dimensional grid data in tabular form;

[0055] Figure 5A specific edge-point relationship matrix storage diagram provided for this application;

[0056] Figure 6 Provided for this application Figure 2 A schematic diagram of the face and edge relationship matrix corresponding to the three-dimensional grid data in tabular form;

[0057] Figure 7 A specific schematic diagram of face and edge relationship matrix storage provided for this application;

[0058] Figure 8 A specific three-dimensional reconstruction method flow chart provided in this application;

[0059] Fig. 9 A schematic diagram of the structure of a three-dimensional reconstruction device provided in this application;

[0060] Fig.10 A structural diagram of an electronic device provided for this application. DETAILED DESCRIPTION

[0061] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0062] In the related art, common representation forms of 3D data include point cloud, 3D mesh, neural implicit representation, etc. Among them, 3D mesh data is the most commonly used 3D data form; however, 3D data in the form of point cloud, 3D mesh, etc. are not friendly to the underlying hardware processing and will reduce the hardware processing speed. In order to overcome the above technical problems, this application proposes a 3D reconstruction method that can improve the underlying hardware processing speed and improve the speed of 3D reconstruction.

[0063] The present application discloses a three-dimensional reconstruction method. Figure 1 As shown, the method may include the following steps:

[0064] Step S11: Acquire target three-dimensional grid data.

[0065] First, obtain the 3D mesh data required for 3D reconstruction. 3D mesh data is a data format that uses a set of triangular faces in space to represent the shape of a 3D object, such as Figure 2 The figure shows a specific schematic diagram of three-dimensional grid data; the three-dimensional grid model M is defined as a set: ; where V: {v0,v1,v2,…,vm} is the set of all vertices in the mesh model, each vertex corresponds to a coordinate in three-dimensional space, such as v0(x0,y0,z0); E: {e0,e1,e2,…,e n} is the set of all edges in the mesh model. Each edge corresponds to two vertices, and adjacent edges can share vertices; F: {f0,f1,f2,…,f k} is the set of all triangular faces in the mesh model. Each triangular face contains three vertices and three edges. Adjacent faces can share edges. It should be noted that the labels of vertices, edges and triangular faces have been defined in the three-dimensional mesh data, that is, which vertex is v0 and which is v1.

[0066] Step S12: converting the target three-dimensional mesh data into a format to obtain a matrix set corresponding to the target three-dimensional mesh data; the matrix set includes a vertex coordinate matrix, an edge-point relationship matrix, and a face-edge relationship matrix.

[0067] In this embodiment, the target three-dimensional mesh data is converted into a matrix format that is more conducive to the underlying hardware operation processing. It can be understood that the matrix is ​​a common and universal underlying representation of various forms of data processed by computing hardware, so converting the three-dimensional mesh data into a matrix representation is conducive to the rapid and efficient acceleration of the underlying hardware. In addition, the conversion of the three-dimensional model in the form of a neural network representation into a matrix form is also the simplest compared to the conversion into other forms, so the use of three-dimensional data in a matrix format is conducive to further unification of the representation form with new three-dimensional data such as neural network representation.

[0068] Among them, the vertex coordinate matrix contains the three-dimensional coordinates of all vertices in the target three-dimensional mesh data, and the closer the vertices are in the three-dimensional mesh data, the closer their data are stored in the vertex coordinate matrix; each row of the edge-point relationship matrix represents the vertices corresponding to each edge, and each column of the edge-point relationship matrix represents the edges corresponding to each vertex, and the starting point and end point of the edge are represented by different numbers; each row of the face-edge relationship matrix represents the edge corresponding to each triangular face, and the positive and negative signs are used to indicate whether the direction of the edge is the same as the clockwise direction of the face, and each column of the face-edge relationship matrix represents the triangular face corresponding to each edge.

[0069] That is, through the vertex coordinate matrix, the edge and point relationship matrix, and the face and edge relationship matrix, the vertex coordinates are stored in the vertex coordinate matrix, and vertices with close distances are stored closely; in the edge and point relationship matrix, the correspondence between each vertex and its edge is stored, and the direction of the edge is identified by data; in the face and edge relationship matrix, the correspondence between the three edges corresponding to each triangular face is stored, and positive and negative signs are used to indicate whether the direction of the edge and the triangular face is consistent. Therefore, all the information in the three-dimensional mesh data can be expressed through the above three matrices, and three-dimensional reconstruction can be performed based on the matrix.

[0070] Specifically, the construction process of the vertex coordinate matrix, edge-point relationship matrix, and face-edge relationship matrix in the above matrix set can be as follows: for the vertex coordinate matrix, starting from the initial vertex, traverse the vertices contained in all triangular faces in turn according to the rule of traversing adjacent triangular faces first, and obtain the vertex coordinate matrix according to the three-dimensional coordinates of the traversed vertices, so that the closer the vertices are in the three-dimensional mesh data, the closer their data are stored in the vertex coordinate matrix; the initial vertex is the vertex with the smallest vertex index number in the target three-dimensional mesh data. For example Figure 2 The three-dimensional grid shown, that is, the vertex coordinate matrix is ​​M loc , the matrix is ​​stored as a two-dimensional vector, specifically in the order of the face index numbers (f0, f1, f2, ...), and the order of the vertices contained in each face. For example, f0 contains vertices v0, v1, v2, f1 contains vertices v1, v2, v3, f2 contains vertices v0, v1, v5, and f3 contains vertices v1, v3, v4. For example Figure 3 As shown, the order of vertices stored in the vertex coordinate matrix is ​​v0, v1, v2, v3, v5, v4. This storage method can improve the locality of memory access during calculation, because adjacent triangles are more likely to perform the same calculation at the same time. Storing vertices in the above order can ensure to the greatest extent that the vertices accessed by these adjacent triangles during synchronous calculations are also similar in memory.

[0071] For the edge-point relationship matrix, traverse each edge in the target three-dimensional mesh data in turn, and assign values ​​to the edge-point relationship matrix according to the vertex index numbers of the two vertices contained in the current edge and the direction of the current edge until all edges of the target three-dimensional mesh data are traversed. The edge-point relationship matrix is ​​denoted as T EV , Figure 4 for Figure 2The table form diagram of the edge and point relationship matrix corresponding to the three-dimensional grid data. In this matrix, 1 corresponds to the vertex representing the starting point of the edge, and 2 corresponds to the vertex representing the end point of the edge. Of course, other numbers can be used to represent it. When the matrix is ​​actually stored, it will be simplified by using a two-dimensional vector, that is, only the two vertices corresponding to each edge are stored, and the starting point of the edge is in front and the end point is in the back, such as Figure 5 As shown, e0 corresponds to 0 and 1, that is, the two vertices representing edge e0 are v0 and v2, and since 0 is in front, e0 is an edge from v0 to v2.

[0072] For the face and edge relationship matrix, traverse each triangular face in the target three-dimensional mesh data in turn, and assign values ​​to the face and edge relationship matrix according to the edge index numbers of the three edges contained in the current triangular face, as well as the clockwise direction of the previous edge and the direction of the edge, until all triangular faces of the target three-dimensional mesh data are traversed. The face and edge relationship matrix is ​​recorded as T FE , Figure 6 for Figure 2 The table form diagram of the face and edge relationship matrix corresponding to the three-dimensional grid data. The matrix is ​​represented by symbols. The three edges corresponding to each face are represented by 1, 2, and 3 respectively. The negative sign in front of the edge indicates that the direction of the edge in the triangle face is opposite to the original direction of the edge, that is, the direction of the edge is opposite to the original direction of the edge. Figure 2 The clockwise direction in the middle triangle is opposite. When storing at the bottom layer, a signed two-dimensional vector can be used as a simplified storage of the matrix, such as Figure 7 As shown, only the three edges corresponding to each face are saved in sequence. Similarly, the symbol in front of the edge represents the relationship between the direction of the edge in the triangular face and the original direction of the edge.

[0073] Step S13: Perform three-dimensional reconstruction based on the matrix set.

[0074] After obtaining the matrix set corresponding to the three-dimensional mesh data, the server's underlying hardware is used to perform three-dimensional reconstruction based on the matrix set. The reconstruction process includes queries on the matrix set, such as querying the adjacent nodes of a node and querying the vertices contained in the triangle surface, etc.

[0075] In some embodiments, the three-dimensional reconstruction based on the matrix set may include: obtaining a first query instruction f(V,V) for the adjacent vertices of the target vertex in the three-dimensional reconstruction; querying the transposed matrix of the edge-point relationship matrix according to the first query instruction to determine the target edge corresponding to the target vertex; querying the edge-point relationship matrix to determine the remaining vertices corresponding to the target edge except the target vertex, so as to obtain the adjacent vertices of the target vertex. It can be understood that since the edge-point relationship matrix can only be used to find points based on the edge after being stored in the underlying one-dimensional vector, when querying adjacent vertices based on points, the transposed matrix of the edge-point relationship matrix is ​​queried to determine the target edge where the target vertex is located, and then the edge-point relationship matrix is ​​queried to determine all vertices included in the target edge, from which the target point is screened out, and the remaining vertices obtained are the adjacent vertices of the target vertex.

[0076] Before specifically querying the adjacent vertices of a vertex, the target operation rule can be used to query whether the target vertex has an adjacent relationship. That is, in this embodiment, the method of three-dimensional reconstruction also includes: constructing a target operation rule by combining an AND operation and an OR operation; the target operation rule is used to analyze whether there are adjacent vertices, whether different edges are connected, whether different triangles have common edges, and whether different edges correspond to the same triangle; accordingly, the three-dimensional reconstruction based on the matrix set includes: obtaining a query instruction of the target type in the three-dimensional reconstruction; the query instruction of the target type is used to query the adjacent or corresponding relationship of vertices, edges and triangles; using the target operation rule to analyze whether there is a corresponding relationship, and if so, executing the query instruction of the target type. That is, before executing various query instructions in three-dimensional reconstruction, first analyze whether the instruction has a result according to the target operation rule, if there is a result, execute the instruction, if the analysis finds that the instruction does not have a result, then the instruction can be directly terminated, that is, there is no need to execute the instruction, thereby further speeding up the three-dimensional reconstruction speed.

[0077] This embodiment provides a specific target operation rule:

[0078] ;

[0079] Among them, and represents the logical AND operation. When both elements of the AND operation are non-zero elements, the result is 1 after the AND operation, otherwise it is 0; or represents the logical OR operation. When any element in the OR operation is 1, the result is 1, otherwise it is 0; the ⊙ operation finally obtains a binary result of 0 or 1.

[0080] For example, Figure 4 The edge-point relationship matrix is ​​shown in the table form. The query instruction f(V0,V 相邻 ), that is, query the adjacent vertices of vertex V0, first obtain the matrix corresponding to V0, that is Figure 4The data in the column where V0 is located is used to perform the target operation rule operation on the column data and other column data. If the operation result of the operation with columns V1, V2, and V5 is 1, it can be determined that V0 has adjacent vertices. The above target rule operation is also used to query whether there is an adjacent or contained relationship between vertices, edges, and face elements.

[0081] In some embodiments, the three-dimensional reconstruction based on the matrix set may include: obtaining a second query instruction f(V, E) for the face where the target vertex is located in the three-dimensional reconstruction; querying the transposed matrix of the edge-point relationship matrix according to the second query instruction to determine the target edge corresponding to the target vertex; querying the transposed matrix of the face-edge relationship matrix to determine the triangular face corresponding to the target edge, so as to obtain the triangular face where the target vertex is located. When it is necessary to query the face where the target vertex is located, since there is no corresponding relationship between vertices and faces, the transposed matrix of the edge-point relationship matrix is ​​first queried to determine the target edge where the target vertex is located, and then the transposed matrix of the face-edge relationship matrix is ​​queried to determine the triangular face where the target edge is located, so as to obtain the triangular face where the target vertex is located.

[0082] In some embodiments, the three-dimensional reconstruction based on the matrix set may include: obtaining a third query instruction f(F, V) for the vertices included in the target face in the three-dimensional reconstruction; querying the face-edge relationship matrix according to the third query instruction to determine the target edge corresponding to the target face; querying the edge-point relationship matrix to determine all vertices corresponding to the target edge to obtain all vertices included in the target face. When it is necessary to query which vertices are included in the target triangular face, first query the face-edge relationship matrix to determine the target edge included in the target face, and then query the edge-point relationship matrix to determine the vertices included in the target edge to obtain all vertices included in the target face.

[0083] In some embodiments, the three-dimensional reconstruction based on the matrix set may include: obtaining a fourth query instruction f(F,F) for the adjacent triangular faces of the target face in the three-dimensional reconstruction; querying the face-edge relationship matrix according to the fourth query instruction to determine the target edge corresponding to the target face; querying the transposed matrix of the face-edge relationship matrix to determine the remaining triangular faces except the target face corresponding to the target edge, so as to obtain the triangular faces adjacent to the target face. When querying the triangular faces adjacent to the target triangular face, first query the face-edge relationship matrix to determine all target edges contained in the target face, then query the transposed matrix of the face-edge relationship matrix to determine all triangular faces to which these target edges belong, and filter out the target face, and the remaining faces are the adjacent faces of the target face.

[0084] In some embodiments, the three-dimensional reconstruction based on the matrix set may include: obtaining a data processing instruction issued during the three-dimensional reconstruction process, determining whether the data processing instruction is a multiple query instruction; if it is a multiple query instruction, decomposing the data processing instruction into multiple single query instructions for execution. That is, sometimes an instruction cannot be implemented at one time, and the instruction needs to be divided into multiple single instructions. For example, the multiple query instruction f(F, V, V) is to query the adjacent vertices of the vertices contained in the target surface, and the instruction f(F, V, V) needs to be divided into f(F, V) and f(V, V).

[0085] Specifically, the above decomposition of the data processing instruction into multiple single query instructions and then execution includes: obtaining multiple query instructions for adjacent vertices of vertices contained in the target surface during the three-dimensional reconstruction process; dividing the multiple query instructions into a first single query instruction for the vertices contained in the target surface, and a second single query instruction for the vertices corresponding to the vertices; determining the target point contained in the target surface according to the first single query instruction, and determining the vertex corresponding to the target point according to the second single query instruction. Thus, by defining a query calculation operator based on matrix representation, single and multiple query calculations between three-dimensional mesh elements can be realized.

[0086] As can be seen from the above, in this embodiment, target three-dimensional mesh data is obtained; the format of the target three-dimensional mesh data is converted to obtain a matrix set corresponding to the target three-dimensional mesh data; the matrix set includes a vertex coordinate matrix, an edge-point relationship matrix, and a face-edge relationship matrix; the vertex coordinate matrix contains the three-dimensional coordinates of all vertices in the target three-dimensional mesh data, and the closer the vertices are in the three-dimensional mesh data, the closer the location where their data is stored in the vertex coordinate matrix; each row of the edge-point relationship matrix represents the vertices corresponding to each edge, and each column of the edge-point relationship matrix represents the edges corresponding to each vertex, and different numbers are used to represent the starting point and end point of the edge; each row of the face-edge relationship matrix represents the edges corresponding to each triangular face, and positive and negative signs are used to indicate whether the direction of the edge is the same as the clockwise direction of the face, and each column of the face-edge relationship matrix represents the triangular face corresponding to each edge; three-dimensional reconstruction is performed based on the matrix set. It can be seen that in order to improve the processing speed of the underlying hardware in the 3D reconstruction process, the 3D mesh data is converted into a matrix form that is friendly to the top-level hardware; further, through the vertex coordinate matrix, the edge and point relationship matrix, the face and edge relationship matrix, and the use of different expressions such as numbers and symbols in the matrix, the various elements in the 3D mesh data can be fully expressed through the matrix; based on the constructed matrix set, the underlying hardware of the server is used for 3D reconstruction, which can improve the processing speed of the underlying hardware, improve the speed of 3D reconstruction, and achieve adaptation and efficiency optimization of the 3D data processing process.

[0087] The present application embodiment discloses a specific three-dimensional reconstruction method, see Figure 8 As shown, the method may include the following steps:

[0088] Step S21: Acquire three-dimensional grid data.

[0089] Step S22: Segment the three-dimensional grid data according to regions to obtain a plurality of three-dimensional sub-grid data, and use the three-dimensional sub-grid data as target three-dimensional grid data.

[0090] In this embodiment, the three-dimensional grid data is divided into a plurality of three-dimensional sub-grid data, thereby accelerating the format conversion speed by converting them simultaneously. In addition, this embodiment divides the data according to the area of ​​the three-dimensional grid. Under this division method, it can be ensured that adjacent grids can be stored in the same three-dimensional sub-grid, avoiding data dispersion and confusion.

[0091] In some embodiments, the segmentation of the three-dimensional mesh data by region to obtain a plurality of three-dimensional sub-mesh data may include: segmenting the three-dimensional mesh data by region to obtain a plurality of three-dimensional sub-mesh data according to a preset maximum number of triangular faces and a maximum segmentation length. That is, by configuring the maximum number of triangular faces and the maximum segmentation length, the size of the three-dimensional sub-mesh data is limited. For example, the segmentation is performed according to the maximum number of triangular faces N and the maximum segmentation length L, and all triangular face data contained in the obtained three-dimensional sub-mesh data is less than or equal to N, and the perimeter of the three-dimensional sub-mesh is less than or equal to L. The specific maximum number of triangular faces and the maximum segmentation length can be directly specified based on experience or determined through experimental test analysis in combination with actual hardware resource performance, processing efficiency requirements, etc.

[0092] In some embodiments, the segmentation of the three-dimensional grid data according to regions to obtain a plurality of three-dimensional sub-grid data may include: according to the three-dimensional coordinate system corresponding to the three-dimensional grid data, segmentation is performed on the horizontal coordinate, the vertical coordinate and the vertical coordinate respectively to obtain the three-dimensional sub-grid data corresponding to the three-dimensional grid data. For example, in the first quadrant of the three-dimensional coordinate system where the three-dimensional grid data is located, the first quadrant has x>0, y>0 and z>0, and each coordinate axis is segmented starting from 0 according to the direction of the coordinate axis. In this way, the locality of data in the memory during calculation can be ensured, and an overall three-dimensional grid model can be processed in blocks to ensure that the positions of the triangles in the same block are close in space. At the same time, the amount of data in each block is small enough to fully utilize the high-speed storage resources of the hardware to realize the overall loading of a block of data.

[0093] On this basis, the three-dimensional grid data is segmented according to the region to obtain a plurality of three-dimensional sub-grid data, which may include: generating a unique corresponding grid block identifier for the three-dimensional sub-grid data according to the segmentation order corresponding to the different three-dimensional sub-grid data on the horizontal coordinate, the vertical coordinate and the vertical coordinate, so as to locate the three-dimensional sub-grid data through the grid block identifier. That is, in order to distinguish each three-dimensional sub-grid data, the segmentation order can be identified by the segmentation order, and the segmentation order is the number of segmentations, and the segmentation order in the horizontal coordinate is recorded as u, the segmentation order in the vertical coordinate is recorded as h, and the segmentation order in the vertical coordinate is recorded as w, then the three-dimensional sub-grid data is identified as (u, h, w); since the three-dimensional grid data is in the first quadrant of the three-dimensional coordinate system and is segmented from the origin, after the first segmentation on the horizontal coordinate, the first segmentation on the vertical coordinate and the first segmentation on the vertical coordinate, the three-dimensional sub-grid data is identified as (1, 1, 1), and the adjacent three-dimensional sub-grids of the three-dimensional sub-grid data along the X-axis are (2, 1, 1).

[0094] The specific three-dimensional mesh data segmentation process is as follows, taking the maximum number of triangles N and the maximum segmentation length L as an example: 1. Calculate the axis-aligned segmentation box S of the three-dimensional mesh data M, that is, calculate the minimum and maximum point positions of all vertices of M in the X, Y, and Z axis directions, and construct a segmentation box with this position along the coordinate axis direction; 2. If the number of triangles in the current segmentation box is greater than N or the maximum side length of the segmentation box is greater than L, then divide the segmentation box into two equal parts in the direction of the maximum side length; continue to segment the two obtained sub-segmentation boxes until all the segmented sub-segmentation boxes meet the conditions; 4. Count the segmentation orders u, h, and w in the X, Y, and Z coordinate axis directions, and the order at the same position along the same coordinate axis direction is only calculated once; 5. All the final sub-segmentation boxes obtained by the above process are numbered in three dimensions, and the number of each dimension is an integer starting from 0. The X-direction numbers of all segmentation boxes are in the range of [0,u], the Y-direction numbers of all segmentation boxes are in the range of [0,h], and the Z-direction numbers of all segmentation boxes are in the range of [0,w]. Any segmentation box can be identified by a unique three-dimensional number (u,h,w). Through the above blocks, it can be achieved that the triangles in each block are spatially adjacent, and the calculation processing can be loaded and calculated in units of blocks. The search across adjacent blocks can be directly implemented through the three-dimensional numbers of each block. For example, for a block (u,h,w), its adjacent blocks along the X direction are (u-1,h,w) and (u+1,h,w).

[0095] Furthermore, for all vertices, a four-dimensional array (v,u,h,w) is used to record the corresponding block number, v is the index number of the vertex, (u,h,w) is the three-dimensional number of the block where the vertex is located. For all edges, a four-dimensional array (e,u,h,w) is used to record the corresponding block number, e is the index number of the edge, (u,h,w) is the three-dimensional number of the block where the edge is located. For all faces, a four-dimensional array (f,u,h,w) is used to record the corresponding block number, f is the index number of the face, (u,h,w) is the three-dimensional number of the block where the face is located. Through the above three four-dimensional arrays, the mapping and direct indexing of each element of vertex, edge, and face from global to local blocks can be realized.

[0096] Step S23: converting the format of the target three-dimensional grid data to obtain a matrix set corresponding to the target three-dimensional grid data.

[0097] Taking a target 3D mesh data block as an example, a specific format conversion process includes:

[0098] S301: Count the number of all vertices, edges, and faces in the block, and initialize the three matrices M of the block loc 、T EV 、T FE , set all matrix elements to 0;

[0099] S302: Select a vertex v with the smallest X coordinate from among all vertices in the block. If there are multiple vertices with the smallest X coordinate, select the one with the smallest Y coordinate, and so on.

[0100] S303: for the vertex v found in S302, find the face f where it belongs, and if the vertex belongs to multiple faces, select the face with the smallest index number;

[0101] S304: For the face f in S303, find the three edges it contains and fill T according to the information of the three edges. FE The entry corresponding to the face f in the matrix;

[0102] S305: For the three edges contained in face f in S304, find the vertices contained in each of the three edges in turn according to the direction information of f, and fill in T according to the relevant information EV Related entries in the matrix;

[0103] S306: For the vertices included in the three edges in S305, first determine their positions in the matrix M in turn. loc Does it already exist? If not, add its corresponding coordinate information in order to the matrix M loc middle;

[0104] S307: Execute the operations of S301 to S306 for all the triangular faces in the block;

[0105] By performing the above operations on all blocks, the matrix representation transformation of all sub-blocks of the three-dimensional grid is completed.

[0106] It can be seen that by designing a block method for the 3D mesh model and using the maximum number of triangles and the maximum space length occupied by the block as the block standard, the data in each block can be highly localized. And by converting the 3D mesh sub-blocks to matrix representations by triangles, the local storage of the final vertex elements can be achieved by organizing the block conversion in units of triangles, which is conducive to improving the data access efficiency during processing and calculation.

[0107] Step S24: performing three-dimensional reconstruction based on the matrix set.

[0108] Among them, the specific processes of the above-mentioned steps S23 and S24 can refer to the corresponding contents disclosed in the above-mentioned embodiments, and will not be repeated here.

[0109] As can be seen from the above, in this embodiment, three-dimensional mesh data is obtained; the three-dimensional mesh data is segmented according to regions to obtain multiple three-dimensional sub-mesh data, and the three-dimensional sub-mesh data is used as target three-dimensional mesh data; the target three-dimensional mesh data is formatted to obtain a matrix corresponding to the target three-dimensional mesh data; and three-dimensional reconstruction is performed based on the matrix set. By segmenting the three-dimensional mesh data according to regions, it can be ensured that the positions of the triangles in the same block are close in the storage space, and the high-speed storage resources of the hardware can be fully utilized to realize the overall loading of a block of data.

[0110] Correspondingly, the present application also discloses a three-dimensional reconstruction device, such as Fig. 9 As shown, the device comprises:

[0111] A three-dimensional grid data acquisition module 11 is used to acquire target three-dimensional grid data;

[0112] The format conversion module 12 is used to perform format conversion on the target three-dimensional mesh data to obtain a matrix set corresponding to the target three-dimensional mesh data; the matrix set includes a vertex coordinate matrix, an edge-point relationship matrix, and a face-edge relationship matrix; the vertex coordinate matrix contains the three-dimensional coordinates of all vertices in the target three-dimensional mesh data, and the closer the vertices are in the three-dimensional mesh data, the closer the location where their data is stored in the vertex coordinate matrix; each row of the edge-point relationship matrix represents the vertices corresponding to each edge, each column of the edge-point relationship matrix represents the edges corresponding to each vertex, and different numbers are used to represent the starting point and end point of the edge; each row of the face-edge relationship matrix represents the edges corresponding to each triangular face, and positive and negative signs are used to indicate whether the direction of the edge is the same as the clockwise direction of the face, and each column of the face-edge relationship matrix represents the triangular face corresponding to each edge;

[0113] The three-dimensional reconstruction module 13 is used to perform three-dimensional reconstruction based on the matrix set.

[0114] As can be seen from the above, in this embodiment, target three-dimensional mesh data is obtained; the format of the target three-dimensional mesh data is converted to obtain a matrix set corresponding to the target three-dimensional mesh data; the matrix set includes a vertex coordinate matrix, an edge-point relationship matrix, and a face-edge relationship matrix; the vertex coordinate matrix contains the three-dimensional coordinates of all vertices in the target three-dimensional mesh data, and the closer the vertices are in the three-dimensional mesh data, the closer the location where their data is stored in the vertex coordinate matrix; each row of the edge-point relationship matrix represents the vertices corresponding to each edge, and each column of the edge-point relationship matrix represents the edges corresponding to each vertex, and different numbers are used to represent the starting point and end point of the edge; each row of the face-edge relationship matrix represents the edges corresponding to each triangular face, and positive and negative signs are used to indicate whether the direction of the edge is the same as the clockwise direction of the face, and each column of the face-edge relationship matrix represents the triangular face corresponding to each edge; three-dimensional reconstruction is performed based on the matrix set. It can be seen that in order to improve the processing speed of the underlying hardware in the 3D reconstruction process, the 3D mesh data is converted into a matrix form that is friendly to the top-level hardware; further, through the vertex coordinate matrix, the edge and point relationship matrix, the face and edge relationship matrix, and the use of different expressions such as numbers and symbols in the matrix, the various elements in the 3D mesh data can be fully expressed through the matrix; based on the constructed matrix set, the underlying hardware of the server is used for 3D reconstruction, which can improve the processing speed of the underlying hardware, improve the speed of 3D reconstruction, and achieve adaptation and efficiency optimization of the 3D data processing process.

[0115] In some specific embodiments, the three-dimensional reconstruction device may specifically include:

[0116] A vertex coordinate matrix construction unit is used to traverse the vertices contained in all triangular faces in sequence according to the rule of traversing adjacent triangular faces first, starting from the initial vertex, and obtaining the vertex coordinate matrix according to the three-dimensional coordinates of the traversed vertices, so that the closer the vertices are in the three-dimensional mesh data, the closer the data is stored in the vertex coordinate matrix; the initial vertex is the vertex with the smallest vertex index number in the target three-dimensional mesh data;

[0117] An edge-point relationship matrix construction unit is used to traverse each edge in the target three-dimensional mesh data in turn, and assign values ​​to the edge-point relationship matrix according to vertex index numbers of two vertices included in a current edge and a direction of the current edge, until all edges of the target three-dimensional mesh data are traversed;

[0118] The face and edge relationship matrix construction unit is used to traverse each triangular face in the target three-dimensional mesh data in turn, and assign values ​​to the face and edge relationship matrix according to the edge index numbers of the three edges contained in the current triangular face, and the clockwise direction of the previous edge and the direction of the edge, until all triangular faces of the target three-dimensional mesh data are traversed.

[0119] In some specific embodiments, the three-dimensional reconstruction module 13 may specifically include:

[0120] A first query instruction acquisition unit, used to acquire a first query instruction for adjacent vertices of a target vertex in three-dimensional reconstruction;

[0121] a target edge determination unit, configured to query the transposed matrix of the edge-point relationship matrix according to the first query instruction, and determine the target edge corresponding to the target vertex;

[0122] The adjacent vertex determination unit is used to query the edge-point relationship matrix to determine the remaining vertices corresponding to the target edge except the target vertex, so as to obtain the adjacent vertices of the target vertex.

[0123] In some specific embodiments, the three-dimensional reconstruction module 13 may specifically include:

[0124] A second query instruction acquisition unit, used to acquire a second query instruction for the surface where the target vertex is located in the three-dimensional reconstruction;

[0125] a target edge determination unit, configured to query the transposed matrix of the edge-point relationship matrix according to the second query instruction, and determine the target edge corresponding to the target vertex;

[0126] The triangular face determination unit is used to query the transposed matrix of the face-edge relationship matrix to determine the triangular face corresponding to the target edge, so as to obtain the triangular face where the target vertex is located.

[0127] In some specific embodiments, the three-dimensional reconstruction module 13 may specifically include:

[0128] A third query instruction acquisition unit, used to acquire a third query instruction for vertices included in the target surface in three-dimensional reconstruction;

[0129] a target edge determining unit, configured to query a face-edge relationship matrix according to the third query instruction to determine a target edge corresponding to the target face;

[0130] The vertex determination unit is used to query the edge-point relationship matrix to determine all vertices corresponding to the target edge, so as to obtain all vertices included in the target surface.

[0131] In some specific embodiments, the three-dimensional reconstruction module 13 may specifically include:

[0132] A fourth query instruction acquisition unit, used to acquire a fourth query instruction for adjacent triangular faces of a target face in three-dimensional reconstruction;

[0133] a target edge determining unit, configured to query the face-edge relationship matrix according to the fourth query instruction, and determine a target edge corresponding to the target face;

[0134] The triangular face determination unit is used to query the transposed matrix of the face-edge relationship matrix, determine the remaining triangular faces corresponding to the target edge except the target face, so as to obtain the triangular faces adjacent to the target face.

[0135] In some specific embodiments, the three-dimensional reconstruction module 13 may specifically include:

[0136] A multiple query instruction acquisition unit, used to acquire the data processing instruction issued during the three-dimensional reconstruction process, and determine whether the data processing instruction is a multiple query instruction;

[0137] The instruction splitting unit is used for splitting the data processing instruction into multiple single query instructions for execution if the instruction is a multiple query instruction.

[0138] In some specific embodiments, the three-dimensional reconstruction module 13 may specifically include:

[0139] A multiple query instruction acquisition unit, used to acquire multiple query instructions for adjacent vertices of vertices included in a target surface during a three-dimensional reconstruction process;

[0140] an instruction splitting unit, configured to split the multiple query instructions into a first single query instruction for the vertices included in the target face, and a second single query instruction for the vertices corresponding to the vertices;

[0141] An instruction execution unit is used to determine the target point contained in the target surface according to the first single query instruction, and determine the vertex corresponding to the target point according to the second single query instruction.

[0142] In some specific embodiments, the three-dimensional grid data acquisition module 11 may specifically include:

[0143] A three-dimensional grid data acquisition unit, used for acquiring three-dimensional grid data;

[0144] The target three-dimensional mesh data determining unit is used to divide the three-dimensional mesh data according to regions to obtain a plurality of three-dimensional sub-mesh data, and use the three-dimensional sub-mesh data as the target three-dimensional mesh data.

[0145] In some specific embodiments, the target three-dimensional mesh data determination may specifically include:

[0146] The segmentation unit is used to segment the three-dimensional mesh data according to the preset maximum number of triangles and the maximum segmentation length to obtain a plurality of three-dimensional sub-mesh data according to the area.

[0147] In some specific embodiments, the segmentation unit is used to obtain three-dimensional sub-grid data corresponding to the three-dimensional grid data by segmenting on the horizontal coordinate, the vertical coordinate and the vertical coordinate respectively according to the three-dimensional coordinate system corresponding to the three-dimensional grid data.

[0148] In some specific embodiments, the coordinate system-based segmentation unit is used to generate a unique corresponding grid block identifier for the three-dimensional sub-grid data according to the corresponding segmentation order of different three-dimensional sub-grid data on the horizontal coordinate, the vertical coordinate and the vertical coordinate, so as to locate the three-dimensional sub-grid data through the grid block identifier.

[0149] Furthermore, the present application also discloses an electronic device, see Fig.10 As shown, the contents in the drawings should not be considered as any limitation on the scope of use of the present application.

[0150] Fig.10 The present invention provides a schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the three-dimensional reconstruction method disclosed in any of the aforementioned embodiments.

[0151] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.

[0152] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon include an operating system 221, a computer program 222, and data 223 including a matrix set, etc. The storage method can be temporary storage or permanent storage.

[0153] The operating system 221 is used to manage and control the hardware devices and computer programs 222 on the electronic device 20, so as to realize the operation and processing of the massive data 223 in the memory 22 by the processor 21, and it can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the three-dimensional reconstruction method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks.

[0154] Furthermore, an embodiment of the present application also discloses a computer storage medium, in which computer executable instructions are stored. When the computer executable instructions are loaded and executed by a processor, the three-dimensional reconstruction method steps disclosed in any of the aforementioned embodiments are implemented.

[0155] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0156] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0157] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0158] The above is a detailed introduction to a three-dimensional reconstruction method, device, medium and program product provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for general technical personnel in this field, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A three-dimensional reconstruction method, characterized in that: include: Obtain target three-dimensional grid data; Performing format conversion on the target three-dimensional mesh data to obtain a matrix set corresponding to the target three-dimensional mesh data; the matrix set includes a vertex coordinate matrix, an edge-point relationship matrix, and a face-edge relationship matrix; The vertex coordinate matrix contains the three-dimensional coordinates of all vertices in the target three-dimensional mesh data. The vertex coordinate matrix is ​​obtained by taking the initial vertex as the starting point and traversing the vertices contained in all triangular faces in turn according to the rule of preferentially traversing adjacent triangular faces, and storing the three-dimensional coordinates of the vertices in turn according to the order of traversal; each row of the edge-point relationship matrix represents the vertices corresponding to each edge, and each column of the edge-point relationship matrix represents the edge corresponding to each vertex, and the starting point and end point of the edge are represented by different numbers; each row of the face-edge relationship matrix represents the edge corresponding to each triangular face, and the positive and negative signs are used to indicate whether the direction of the edge is the same as the clockwise direction of the face, and each column of the face-edge relationship matrix represents the triangular face corresponding to each edge; A three-dimensional reconstruction is performed based on the matrix set.

2. The three-dimensional reconstruction method according to claim 1, characterized in that: The construction of the matrix set includes: Taking the initial vertex as the starting point and following the rule of traversing adjacent triangular faces first, traverse the vertices contained in all triangular faces in turn, and obtain the vertex coordinate matrix according to the three-dimensional coordinates of the traversed vertices; the initial vertex is the vertex with the smallest vertex index number in the target three-dimensional mesh data; Traversing each edge in the target three-dimensional mesh data in turn, and assigning values ​​to the edge-point relationship matrix according to vertex index numbers of two vertices included in the current edge and the direction of the current edge, until all edges of the target three-dimensional mesh data are traversed; Traverse each triangular face in the target three-dimensional mesh data in turn, and assign values ​​to the face-edge relationship matrix according to the edge index numbers of the three edges contained in the current triangular face, as well as the clockwise direction of the previous edge and the direction of the edge, until all triangular faces of the target three-dimensional mesh data are traversed.

3. The three-dimensional reconstruction method according to claim 1, characterized in that: The three-dimensional reconstruction based on the matrix set includes: Obtaining a first query instruction for adjacent vertices of a target vertex in three-dimensional reconstruction; Querying the transposed matrix of the edge-point relationship matrix according to the first query instruction to determine the target edge corresponding to the target vertex; The edge-point relationship matrix is ​​queried to determine the remaining vertices corresponding to the target edge except the target vertex, so as to obtain the adjacent vertices of the target vertex.

4. The three-dimensional reconstruction method according to claim 1, characterized in that: The three-dimensional reconstruction based on the matrix set includes: Obtaining a second query instruction for the face where the target vertex is located in the three-dimensional reconstruction; Query the transposed matrix of the edge-point relationship matrix according to the second query instruction to determine the target edge corresponding to the target vertex; The transposed matrix of the face-edge relationship matrix is ​​queried to determine the triangular face corresponding to the target edge, so as to obtain the triangular face where the target vertex is located.

5. The three-dimensional reconstruction method according to claim 1, characterized in that: The three-dimensional reconstruction based on the matrix set includes: Obtaining a third query instruction for vertices included in the target surface in the three-dimensional reconstruction; Querying the face-edge relationship matrix according to the third query instruction to determine the target edge corresponding to the target face; The edge-point relationship matrix is ​​queried to determine all vertices corresponding to the target edge, so as to obtain all vertices included in the target surface.

6. The three-dimensional reconstruction method according to claim 1, characterized in that: The three-dimensional reconstruction based on the matrix set includes: Obtaining a fourth query instruction for adjacent triangular faces of the target face in three-dimensional reconstruction; Query the face-edge relationship matrix according to the fourth query instruction to determine the target edge corresponding to the target face; The transposed matrix of the face-edge relationship matrix is ​​queried to determine the remaining triangular faces corresponding to the target edge except the target face, so as to obtain the triangular faces adjacent to the target face.

7. The three-dimensional reconstruction method according to claim 1, characterized in that: The three-dimensional reconstruction based on the matrix set includes: Obtaining a data processing instruction issued during the three-dimensional reconstruction process, and determining whether the data processing instruction is a multiple query instruction; If it is a multiple query instruction, the data processing instruction is decomposed into multiple single query instructions and then executed.

8. The three-dimensional reconstruction method according to claim 7, characterized in that: The three-dimensional reconstruction based on the matrix set includes: Acquire multiple query instructions for adjacent vertices of vertices included in a target surface during a three-dimensional reconstruction process; dividing the multiple query instructions into a first single query instruction for vertices included in the target face, and a second single query instruction for vertices corresponding to the vertices; A target point included in the target surface is determined according to the first single query instruction, and a vertex corresponding to the target point is determined according to the second single query instruction.

9. The three-dimensional reconstruction method according to any one of claims 1 to 8, characterized in that: The step of acquiring target three-dimensional grid data comprises: Get three-dimensional mesh data; The three-dimensional grid data is divided according to regions to obtain a plurality of three-dimensional sub-grid data, and the three-dimensional sub-grid data is used as the target three-dimensional grid data.

10. The three-dimensional reconstruction method according to claim 9, characterized in that: The step of segmenting the three-dimensional grid data according to regions to obtain a plurality of three-dimensional sub-grid data includes: According to the preset maximum number of triangular faces and the maximum segmentation length, the three-dimensional mesh data is segmented according to the region to obtain a plurality of three-dimensional sub-mesh data.

11. The three-dimensional reconstruction method according to claim 10, characterized in that: The step of segmenting the three-dimensional grid data according to regions to obtain a plurality of three-dimensional sub-grid data includes: According to the three-dimensional coordinate system corresponding to the three-dimensional grid data, three-dimensional sub-grid data corresponding to the three-dimensional grid data are obtained by segmenting on the horizontal coordinate, the vertical coordinate and the vertical coordinate respectively.

12. The three-dimensional reconstruction method according to claim 11, characterized in that: The step of segmenting the three-dimensional grid data according to regions to obtain a plurality of three-dimensional sub-grid data includes: According to the corresponding segmentation order of different three-dimensional sub-grid data on the horizontal coordinate, the vertical coordinate and the ordinate, a unique corresponding grid block identifier is generated for the three-dimensional sub-grid data, so as to locate the three-dimensional sub-grid data through the grid block identifier.

13. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the three-dimensional reconstruction method according to any one of claims 1 to 12.

14. A computer-readable storage medium, characterized in that: Used to store a computer program; wherein when the computer program is executed by a processor, the three-dimensional reconstruction method as described in any one of claims 1 to 12 is implemented.

15. A computer program product, characterized in that The invention comprises a computer program, which, when executed by a processor, implements the three-dimensional reconstruction method according to any one of claims 1 to 12.

Citation Information

Patent Citations

  • 3D object reconstruction method based on dynamic graph network

    CN112927357A

  • Method, device and equipment for generating quadrilateral grid data through ordered point cloud and storage medium

    CN114119870A