Three-dimensional model reconstruction method, device, equipment and storage medium
By determining the collapsed edge data in three-dimensional reconstruction technology and performing grid simplification, and texture coordinate compression, the problem of texture coordinate jumping out of invalid areas after grid simplification of the grid is solved, and the rendering efficiency and effect of the three-dimensional model is improved.
Patent Information
- Application Number
- CN202210190859.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-25
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2042-02-25
AI Technical Summary
When dealing with large-scale scenes, it is difficult for three-dimensional reconstruction technology to efficiently process massive 3D model data while maintaining the fidelity of the three-dimensional virtual scene, and improve rendering efficiency when rendering the details of the three-dimensional scene. After the grid is simplified, the texture coordinates may jump to the invalid area to cause the black triangle surface.
By obtaining the grid data and texture data of the three-dimensional model, the collapsed edge data is determined as the basis for grid simplification. If the collapsed edge data meets the preset topological conditions, the grid simplification is performed to obtain the second grid data, and the texture coordinate compression of the three-dimensional model is performed to prevent the texture coordinate from jumping out of the invalid area.
While ensuring the rendering effect of the three-dimensional model, it reduces the redundancy of the model file data, improves the rendering efficiency of the three-dimensional model, and avoids the appearance of black triangles in the texture map after the grid is simplified.
Smart Images

Figure CN114677473B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of three-dimensional reconstruction technology, and in particular to a three-dimensional model reconstruction method, device, equipment and storage medium. Background Art
[0002] For large-scale scenes, 3D reconstruction technology finds it difficult to efficiently process massive 3D model data while maintaining the realism of the 3D virtual scene, and to improve rendering efficiency when rendering 3D scene details.
[0003] At present, 3D reconstruction technology is mainly applied to mesh simplification technology. However, after mesh simplification, the texture coordinates of large-scale scene 3D models will jump to the invalid area of the texture image, resulting in black triangles in the texture map of the 3D model, thus affecting the rendering effect. Summary of the invention
[0004] The present application provides a method and device for reconstructing a three-dimensional model to solve the technical problem of black triangles appearing in current three-dimensional models.
[0005] In order to solve the above technical problems, in a first aspect, an embodiment of the present application provides a method for reconstructing a three-dimensional model, comprising:
[0006] Acquire first mesh data and texture data of the three-dimensional model, where the first mesh data includes a plurality of edge data;
[0007] Based on the mesh data, the collapsed edge data of the three-dimensional model is determined, where the collapsed edge data is the edge data with the minimum mesh simplification cost;
[0008] If the collapsed edge data meets the preset topological condition, the first mesh data is mesh-simplified based on the collapsed edge data to obtain second mesh data;
[0009] According to the second mesh data and the texture data, texture coordinates of the three-dimensional model are compressed to obtain a target three-dimensional model.
[0010] This embodiment obtains first mesh data and texture data of a three-dimensional model, and determines collapsed edge data of the three-dimensional model based on the mesh data, wherein the collapsed edge data is edge data with the lowest mesh simplification cost, so as to check the black triangles of the three-dimensional model; and if the collapsed edge data meets the preset topological condition, the first mesh data is mesh simplified based on the collapsed edge data to obtain second mesh data, thereby performing mesh simplification while ensuring that the collapsed edge data meets the preset topological condition, so as to avoid the situation where the texture coordinates jump to the invalid area of the texture image after the mesh simplification; finally, the texture coordinates of the three-dimensional model are compressed according to the second mesh data and texture data to obtain the target three-dimensional model, so as to effectively reduce the data redundancy of the model file and improve the rendering efficiency of the three-dimensional model.
[0011] In one embodiment, the first mesh data further includes a plurality of point data, and based on the mesh data, the collapsed edge data of the three-dimensional model is determined, including:
[0012] Determine a second positive definite matrix of edge data based on the first positive definite matrix of point data;
[0013] Using a preset cost function, according to the second positive definite matrix, determine the minimum cost value of each edge data;
[0014] The target edge data with the smallest minimum cost value is determined as the collapsed edge data.
[0015] In one embodiment, determining a second positive definite matrix of edge data based on a first positive definite matrix of point data includes:
[0016] For each point data, the positive definite matrix corresponding to the polygon connected to the point data is taken as the first positive definite matrix;
[0017] For each edge data, the first positive definite matrices corresponding to the two point data constituting the edge data are added to obtain the second positive definite matrix of the edge data.
[0018] In one embodiment, using a preset cost function and according to the second positive definite matrix, determining the minimum cost value of each edge data includes:
[0019] For each edge data, determine a plurality of collapse point data on the edge data;
[0020] Based on the second positive definite matrix of the edge data and multiple collapse point data, the cost function is iterated until the cost value of the cost function is minimized, and the minimum cost value of the edge data and the target point data are obtained, and the target point data is the collapse point data corresponding to the minimum cost value.
[0021] In one embodiment, if the collapsed edge data meets the preset topological condition, before mesh simplification is performed on the first mesh data based on the collapsed edge data to obtain the second mesh data, the method further includes:
[0022] Check whether the collapsed edge data is boundary data;
[0023] If the collapsed edge data is not boundary data, then check whether the target texture data is the same texture data, the target texture data is the texture data corresponding to all polygons connected to the collapsed edge data;
[0024] If the target texture data is the same texture data, check whether the texture coordinates corresponding to the collapsed edge data are connected;
[0025] If the texture coordinates corresponding to the collapsed edge data are connected, it is determined that the collapsed edge data meets the preset topological condition.
[0026] In one embodiment, if the collapsed edge data meets the preset topological condition, mesh simplification is performed on the first mesh data based on the collapsed edge data to obtain second mesh data, including:
[0027] If the collapsed edge data meets the preset topological condition, removing the collapsed edge data in the first grid data;
[0028] Based on the target point data, the first grid data is updated to obtain the second edge data, where the target point data is the point data on the collapsed edge data.
[0029] In one embodiment, compressing texture coordinates of a three-dimensional model according to the second mesh data and the texture data to obtain a target three-dimensional model includes:
[0030] Mapping the texture data to the second mesh data to obtain an intermediate three-dimensional model;
[0031] Divide the texture coordinates of the intermediate three-dimensional model into intervals to obtain partition data of the texture coordinates;
[0032] According to the partition data, the texture coordinates of the intermediate 3D model are cleaned to obtain the target 3D model.
[0033] In a second aspect, an embodiment of the present application provides a three-dimensional model reconstruction device, comprising:
[0034] An acquisition module, used to acquire first mesh data and texture data of the three-dimensional model, wherein the first mesh data includes edge data;
[0035] A determination module, used to determine the collapsed edge data of the three-dimensional model based on the mesh data, wherein the collapsed edge data is the edge data with the minimum mesh simplification cost;
[0036] A simplification module, configured to perform mesh simplification on the first mesh data based on the collapsed edge data to obtain second mesh data if the collapsed edge data meets a preset topological condition;
[0037] The compression module is used to compress the texture coordinates of the three-dimensional model according to the second grid data and the texture data to obtain a target three-dimensional model.
[0038] In a third aspect, an embodiment of the present application provides a computer device, including a processor and a memory, wherein the memory is used to store a computer program, and when the computer program is executed by the processor, the method for reconstructing a three-dimensional model as in the first aspect is implemented.
[0039] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the three-dimensional model reconstruction method as in the first aspect.
[0040] It should be noted that the beneficial effects of the second to fourth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 A schematic diagram of a process of reconstructing a three-dimensional model according to an embodiment of the present application;
[0042] Figure 2 A schematic diagram of a texture map shown in an embodiment of the present application;
[0043] Figure 3 A schematic diagram of a simplified grid shown in an embodiment of the present application;
[0044] Figure 4 This is a schematic diagram of the structure of the device shown in the embodiment of the present application;
[0045] Figure 5 A schematic diagram of the structure of a computer device shown in an embodiment of the present application. DETAILED DESCRIPTION
[0046] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0047] As described in the related art, after the mesh of a large-scale 3D model is simplified, the texture coordinates will jump to the invalid area of the texture image, resulting in black triangles appearing in the texture map of the 3D model. Figure 2 The black position shown will affect the rendering effect.
[0048] To this end, an embodiment of the present application provides a method for reconstructing a three-dimensional model, by acquiring first mesh data and texture data of the three-dimensional model, and determining, based on the mesh data, collapsed edge data of the three-dimensional model, wherein the collapsed edge data is edge data with the lowest mesh simplification cost, so as to check the black triangles of the three-dimensional model; and if the collapsed edge data meets a preset topological condition, mesh simplification is performed on the first mesh data based on the collapsed edge data to obtain second mesh data, thereby performing mesh simplification while ensuring that the collapsed edge data meets the preset topological condition, so as to avoid the situation where the texture coordinates jump to an invalid area of the texture image after the mesh simplification; finally, texture coordinates of the three-dimensional model are compressed according to the second mesh data and texture data to obtain a target three-dimensional model, so as to effectively reduce data redundancy in the model file and improve the rendering efficiency of the three-dimensional model.
[0049] Please refer to Figure 1 , Figure 1 The flowchart of a three-dimensional model reconstruction method provided in an embodiment of the present application is shown in FIG. The three-dimensional model reconstruction method of the embodiment of the present application can be applied to computer devices, including but not limited to smart phones, laptops, tablet computers, desktop computers, physical servers, cloud servers and other devices. Figure 1 As shown, the three-dimensional model reconstruction method of this embodiment includes steps S101 to S104, which are described in detail as follows:
[0050] Step S101, obtaining first mesh data and texture data of a three-dimensional model, wherein the first mesh data includes a plurality of edge data.
[0051] In this step, the first grid data also includes a plurality of point data, wherein each edge data is composed of two point data, namely, the two end points of an edge, such as Figure 3 The edge data L1 shown is obtained by connecting the point data V3 and the point data V4.
[0052] Step S102: determining the collapsed edge data of the three-dimensional model based on the mesh data, wherein the collapsed edge data is the edge data with the minimum mesh simplification cost.
[0053] In this step, the collapsed edge data can be Figure 3 L1 shown. The minimum mesh simplification cost is the smallest of the minimum cost values of multiple edge data.
[0054] Step S103: If the collapsed edge data meets the preset topological condition, the first mesh data is mesh simplified based on the collapsed edge data to obtain second mesh data.
[0055] In this step, the preset topological conditions include that the collapsed edge data does not belong to the boundary data, the topology is legal, and the texture coordinates are connected. By simplifying the mesh under the preset topological conditions, the problem of black triangles appearing when reconstructing the model of large-scale scenes can be solved, the complexity and data volume of the three-dimensional model can be reduced, and the model rendering efficiency can be improved.
[0056] Step S104: compressing texture coordinates of the three-dimensional model according to the second mesh data and the texture data to obtain a target three-dimensional model.
[0057] In this step, by compressing the texture coordinates, the texture memory is reduced, making the compressed texture more efficient to use.
[0058] In one embodiment, Figure 1 Based on the embodiment shown, the first grid data also includes a plurality of point data, and the above step S102 includes:
[0059] Determine a second positive definite matrix of the edge data based on the first positive definite matrix of the point data;
[0060] Using a preset cost function, according to the second positive definite matrix, determine the minimum cost value of each edge data;
[0061] The target edge data with the smallest minimum cost value is determined as the collapsed edge data.
[0062] In this embodiment, optionally, determining the second positive definite matrix of the edge data based on the first positive definite matrix of the point data includes:
[0063] For each of the point data, taking a positive definite matrix corresponding to a polygon connected to the point data as the first positive definite matrix;
[0064] For each edge data, the first positive definite matrices corresponding to the two point data constituting the edge data are added together to obtain a second positive definite matrix of the edge data.
[0065] In this optional embodiment,
[0066] First, for each point V i Assign an initial positive definite matrix A i =∑C i , where C i Indicates that each V i The positive definite matrix corresponding to the connected polygon, assuming that the equation of this polygon is ax+by+cz+d=0, (a, b, c) is a unit vector, then Then assign a positive definite matrix E to each edge i , E i It is equal to the sum of the positive definite matrices of the two end points on the edge.
[0067] Optionally, the using a preset cost function to determine the minimum cost value of each edge data according to the second positive definite matrix includes:
[0068] For each edge data, determining a plurality of collapse point data on the edge data;
[0069] Based on the second positive definite matrix of the edge data and the multiple collapse point data, the cost function is iterated until the cost value of the cost function is minimized, so as to obtain the minimum cost value of the edge data and the target point data, wherein the target point data is the collapse point data corresponding to the minimum cost value.
[0070] In this optional implementation, assume that the position of the collapse point is x, so that the cost function x T E ix is the smallest. Since this is a quadratic equation, we can find the value of x and the minimum cost value. Calculate the minimum cost value of each edge and collapse the edge with the smallest minimum cost value among multiple minimum cost values. For example, Figure 3 The edge data of is collapsed into point data V5. Furthermore, the positive definite matrix A of the point (i.e., target point data) generated each time the edge is collapsed is i Can be E i replace.
[0071] In one embodiment, if the collapsed edge data meets the preset topological condition, before mesh simplification is performed on the first mesh data based on the collapsed edge data to obtain the second mesh data, the method further includes:
[0072] Checking whether the collapsed edge data is boundary data;
[0073] If the collapsed edge data is not boundary data, checking whether the target texture data is the same texture data, the target texture data being the texture data corresponding to all polygons connected to the collapsed edge data;
[0074] If the target texture data are the same texture data, checking whether the texture coordinates corresponding to the collapsed edge data are connected;
[0075] If the texture coordinates corresponding to the collapsed edge data are connected, it is determined that the collapsed edge data meets the preset topological condition.
[0076] In this embodiment, in order to prevent the collapse of the boundary, the boundary judgment condition should be added. Determine whether the collapsed edge is a boundary, if so, abandon this edge; determine whether the topology is legal, if not, abandon it; determine whether the texture coordinates are connected, if not, abandon it. The topological legality check is to determine whether the texture coordinate value falls within the legal area, that is, the texture images of all connected polygons of the edge to be collapsed point to the same texture image, and the texture coordinate values of the two vertices of the edge to be collapsed in each facet are close enough (less than the threshold).
[0077] In one embodiment, if the collapsed edge data meets a preset topological condition, mesh simplification is performed on the first mesh data based on the collapsed edge data to obtain second mesh data, including:
[0078] If the collapsed edge data meets the preset topological condition, removing the collapsed edge data in the first mesh data;
[0079] Based on the target point data, the first grid data is updated to obtain the second edge data, wherein the target point data is the point data on the collapsed edge data.
[0080] In this embodiment, if Figure 3As shown, calculate the triangular coordinates of the new point V5 in the plane of triangle V1V2V3: project V5 onto the plane where triangle V1V2V3 is located to obtain V5, then the position of V5 can be described by the position of V1V2V3, that is, the following equation:
[0081] After obtaining the triangle coordinates, the texture coordinates of V4 are the weighted sum of the texture coordinates of V1, V2, and V3, and the weighting coefficient is λ i .
[0082] In one embodiment, compressing the texture coordinates of the three-dimensional model according to the second mesh data and the texture data to obtain the target three-dimensional model includes:
[0083] Mapping the texture data to the second mesh data to obtain an intermediate three-dimensional model;
[0084] Dividing the texture coordinates of the intermediate three-dimensional model into intervals to obtain partition data of the texture coordinates;
[0085] The texture coordinates of the intermediate three-dimensional model are cleaned according to the partition data to obtain the target three-dimensional model.
[0086] In this embodiment, texture coordinate data is stored in the mesh model file after texture mapping. Sometimes the texture coordinate values of different facets are the same or similar. Repeated storage of such values will increase the file size and memory usage after reading the mesh data. The texture coordinates in the mesh data are compressed. The texture coordinates are two-dimensional space points, so the three-dimensional model points are resampled. Specifically, the octree is used for interval division. When the interval division is fine enough, the points in each hexahedron can be replaced by the average point, thereby achieving texture coordinate compression.
[0087] In order to execute the three-dimensional model reconstruction method corresponding to the above method embodiment, so as to achieve the corresponding functions and technical effects. Figure 4 , Figure 4 The structural block diagram of a three-dimensional model reconstruction device provided in an embodiment of the present application is shown. For the convenience of explanation, only the parts related to the present embodiment are shown. The three-dimensional model reconstruction device provided in an embodiment of the present application includes:
[0088] An acquisition module 501 is used to acquire first mesh data and texture data of a three-dimensional model, wherein the first mesh data includes edge data;
[0089] A determination module 502 is used to determine the collapsed edge data of the three-dimensional model based on the mesh data, wherein the collapsed edge data is the edge data with the minimum mesh simplification cost;
[0090] A simplification module 503 is configured to perform mesh simplification on the first mesh data based on the collapsed edge data to obtain second mesh data if the collapsed edge data meets a preset topological condition;
[0091] The compression module 504 is used to compress the texture coordinates of the three-dimensional model according to the second mesh data and the texture data to obtain a target three-dimensional model.
[0092] In one embodiment, the first grid data further includes a plurality of point data, and the determining module 502 includes:
[0093] A first determining unit, configured to determine a second positive definite matrix of the edge data based on the first positive definite matrix of the point data;
[0094] A second determining unit, configured to determine a minimum cost value of each edge data according to the second positive definite matrix by using a preset cost function;
[0095] A determination unit is used to determine the target edge data with the smallest minimum cost value as the collapsed edge data.
[0096] In one embodiment, the first determining unit includes:
[0097] as a subunit, for taking, for each of the point data, a positive definite matrix corresponding to a polygon connected to the point data as the first positive definite matrix;
[0098] The adding subunit is used for adding the first positive definite matrices corresponding to the two point data constituting the edge data for each edge data to obtain a second positive definite matrix of the edge data.
[0099] In one embodiment, the second determining unit includes:
[0100] A determination subunit, configured to determine, for each edge data, a plurality of collapse point data on the edge data;
[0101] An iterative subunit is used to iterate the cost function based on the second positive definite matrix of the edge data and the multiple collapse point data until the cost value of the cost function is minimized, and obtain the minimum cost value of the edge data and the target point data, wherein the target point data is the collapse point data corresponding to the minimum cost value.
[0102] In one embodiment, the reconstruction device further includes:
[0103] A first checking module, used for checking whether the collapsed edge data is boundary data;
[0104] A second checking module, for checking whether the target texture data is the same texture data if the collapsed edge data is not boundary data, wherein the target texture data is texture data corresponding to all polygons connected to the collapsed edge data;
[0105] A third checking module, configured to check whether the texture coordinates corresponding to the collapsed edge data are connected if the target texture data are the same texture data;
[0106] A determination module is used to determine whether the collapsed edge data meets the preset topological condition if the texture coordinates corresponding to the collapsed edge data are connected.
[0107] In one embodiment, the simplification module 503 includes:
[0108] a removing unit, configured to remove the collapsed edge data in the first mesh data if the collapsed edge data meets the preset topological condition;
[0109] An updating unit is used to update the first grid data based on target point data to obtain second edge data, wherein the target point data is point data on the collapsed edge data.
[0110] In one embodiment, the compression module 504 includes:
[0111] A mapping unit, used for mapping the texture data to the second mesh data to obtain an intermediate three-dimensional model;
[0112] A division unit, used for dividing the texture coordinates of the intermediate three-dimensional model into intervals to obtain partition data of the texture coordinates;
[0113] A cleaning unit is used to clean the texture coordinates of the intermediate three-dimensional model according to the partition data to obtain the target three-dimensional model.
[0114] The above-mentioned three-dimensional model reconstruction device can implement the three-dimensional model reconstruction method of the above-mentioned method embodiment. The options in the above-mentioned method embodiment are also applicable to this embodiment and will not be described in detail here. The rest of the contents of the embodiment of this application can refer to the contents of the above-mentioned method embodiment, and will not be repeated in this embodiment.
[0115] Figure 5 This is a schematic diagram of the structure of a computer device provided in one embodiment of the present application. Figure 5 As shown, the computer device 6 of this embodiment includes: at least one processor 60 ( Figure 5 Only one is shown in the figure) a processor, a memory 61, and a computer program 62 stored in the memory 61 and executable on the at least one processor 60, and when the processor 60 executes the computer program 62, the steps in any of the above method embodiments are implemented.
[0116] The computer device 6 may be a computing device such as a smart phone, a tablet computer, a desktop computer, a cloud server, etc. The computer device may include but is not limited to a processor 60 and a memory 61. Those skilled in the art will appreciate that Figure 5 It is only an example of the computer device 6 and does not constitute a limitation on the computer device 6. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, it may also include input and output devices, network access devices, etc.
[0117] The processor 60 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0118] In some embodiments, the memory 61 may be an internal storage unit of the computer device 6, such as a hard disk or memory of the computer device 6. In other embodiments, the memory 61 may also be an external storage device of the computer device 6, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the computer device 6. Further, the memory 61 may also include both an internal storage unit and an external storage device of the computer device 6. The memory 61 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program. The memory 61 may also be used to temporarily store data that has been output or is to be output.
[0119] In addition, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.
[0120] An embodiment of the present application provides a computer program product. When the computer program product is run on a computer device, the computer device implements the steps in the above-mentioned method embodiments when executing the computer device.
[0121] In several embodiments provided in the present application, it is understood that each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved.
[0122] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device to execute all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0123] The specific embodiments described above further describe the purpose, technical solutions and beneficial effects of the present application in detail. It should be understood that the above description is only a specific embodiment of the present application and is not intended to limit the scope of protection of the present application. It is particularly pointed out that for those skilled in the art, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of protection of the present application.
Claims
1. A method for reconstructing a three-dimensional model, characterized in that: include: Acquire first mesh data and texture data of a three-dimensional model, wherein the first mesh data includes a plurality of edge data; Based on the mesh data, determining collapsed edge data of the three-dimensional model, the collapsed edge data being the edge data with the minimum mesh simplification cost; If the collapsed edge data meets a preset topological condition, the first mesh data is mesh-simplified based on the collapsed edge data to obtain second mesh data, wherein the preset topological condition includes that the collapsed edge data does not belong to boundary data, the topology is legal, and the texture coordinates can be connected; According to the second mesh data and the texture data, compressing the texture coordinates of the three-dimensional model to obtain a target three-dimensional model; The first grid data further includes a plurality of point data, and the step of determining the collapsed edge data of the three-dimensional model based on the grid data includes: Determine a second positive definite matrix of the edge data based on the first positive definite matrix of the point data; Using a preset cost function, according to the second positive definite matrix, determine the minimum cost value of each edge data; Determine the target edge data with the smallest minimum cost value as the collapsed edge data; The step of compressing texture coordinates of the three-dimensional model according to the second mesh data and the texture data to obtain a target three-dimensional model includes: Mapping the texture data to the second mesh data to obtain an intermediate three-dimensional model; Dividing the texture coordinates of the intermediate three-dimensional model into intervals to obtain partition data of the texture coordinates; The texture coordinates of the intermediate three-dimensional model are cleaned according to the partition data to obtain the target three-dimensional model.
2. The three-dimensional model reconstruction method according to claim 1, characterized in that: The determining the second positive definite matrix of the edge data based on the first positive definite matrix of the point data comprises: For each of the point data, taking a positive definite matrix corresponding to a polygon connected to the point data as the first positive definite matrix; For each edge data, the first positive definite matrices corresponding to the two point data constituting the edge data are added together to obtain a second positive definite matrix of the edge data.
3. The three-dimensional model reconstruction method according to claim 1, characterized in that: The using a preset cost function to determine the minimum cost value of each edge data according to the second positive definite matrix includes: For each edge data, determining a plurality of collapse point data on the edge data; Based on the second positive definite matrix of the edge data and the multiple collapse point data, the cost function is iterated until the cost value of the cost function is minimized, so as to obtain the minimum cost value of the edge data and the target point data, wherein the target point data is the collapse point data corresponding to the minimum cost value.
4. The method for reconstructing a three-dimensional model according to claim 1, wherein: If the collapsed edge data meets the preset topological condition, before the first mesh data is mesh-simplified based on the collapsed edge data to obtain the second mesh data, the method further includes: Checking whether the collapsed edge data is boundary data; If the collapsed edge data is not boundary data, checking whether the target texture data is the same texture data, the target texture data being the texture data corresponding to all polygons connected to the collapsed edge data; If the target texture data are the same texture data, checking whether the texture coordinates corresponding to the collapsed edge data are connected; If the texture coordinates corresponding to the collapsed edge data are connected, it is determined that the collapsed edge data meets the preset topological condition.
5. The method for reconstructing a three-dimensional model according to claim 1, wherein: If the collapsed edge data meets the preset topological condition, the first mesh data is mesh-simplified based on the collapsed edge data to obtain second mesh data, including: If the collapsed edge data meets the preset topological condition, removing the collapsed edge data in the first mesh data; Based on the target point data, the first grid data is updated to obtain the second edge data, wherein the target point data is the point data on the collapsed edge data.
6. A three-dimensional model reconstruction device, characterized in that: include: An acquisition module, used to acquire first mesh data and texture data of a three-dimensional model, wherein the first mesh data includes edge data; A determination module, configured to determine, based on the mesh data, collapsed edge data of the three-dimensional model, wherein the collapsed edge data is the edge data with the minimum mesh simplification cost; A simplification module, configured to perform mesh simplification on the first mesh data based on the collapsed edge data to obtain second mesh data if the collapsed edge data meets a preset topological condition, wherein the preset topological condition includes that the collapsed edge data does not belong to boundary data, the topology is legal, and the texture coordinates are connected; A compression module, configured to compress the texture coordinates of the three-dimensional model according to the second mesh data and the texture data to obtain a target three-dimensional model; The first grid data also includes a plurality of point data, and the determination module includes: A first determining unit, configured to determine a second positive definite matrix of the edge data based on the first positive definite matrix of the point data; A second determining unit, configured to determine a minimum cost value of each edge data according to the second positive definite matrix by using a preset cost function; A determination unit, configured to determine the target edge data with the smallest minimum cost value as the collapsed edge data; The compression module comprises: A mapping unit, used for mapping the texture data to the second mesh data to obtain an intermediate three-dimensional model; A division unit, used for dividing the texture coordinates of the intermediate three-dimensional model into intervals to obtain partition data of the texture coordinates; A cleaning unit is used to clean the texture coordinates of the intermediate three-dimensional model according to the partition data to obtain the target three-dimensional model.
7. A computer device, characterized in that: The method comprises a processor and a memory, wherein the memory is used to store a computer program, and when the computer program is executed by the processor, the method for reconstructing a three-dimensional model as claimed in any one of claims 1 to 5 is implemented.
8. A computer-readable storage medium, characterized in that: It stores a computer program, which, when executed by a processor, implements the three-dimensional model reconstruction method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Three-dimensional grid simplifying method applied to VR virtual bank
CN112258655A
Feature constraint-based triangular mesh optimization method
CN113689566A
Method of mesh simplification via ununiform spatial division
US20030112239A1