Three-dimensional model scanning optimal conduction preserved area texture mapping method
Through the area-preserving texture mapping method based on optimal conduction, using the equilibrium map with minimum elastic potential energy and optimal conduction mapping, the problem of deformation and stretching in the texture map of the three-dimensional model is solved, and natural, average visual effects and efficient Texture mapping process.
Patent Information
- Application Number
- CN202410727359.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-06
- Publication Date
- 2024-09-20
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing 3D model scanning texture mapping method lacks a suitable mapping algorithm, resulting in serious deformation and stretching of the texture pattern. It cannot reduce the angle deformation while keeping the area unchanged, and cannot effectively handle the triangular gridding of single boundary zero genus. model, resulting in poor texture mapping effects.
The area-preserving texture mapping method based on optimal conduction is used to parameterize the three-dimensional model into the plane parameter domain through the equilibrium map with minimum elastic potential energy, and the optimal conduction area-preserving mapping is used to reduce the deformation and stretching of the texture pattern and prevent holes and The occurrence of repeated mapping phenomenon.
It achieves natural, average, and visually realistic effects of texture mapping for 3D models, keeping local angles and areas unchanged, improving the quality and efficiency of texture mapping, and reducing time complexity.
Smart Images

Figure CN118674848A
Abstract
Description
Technical Field
[0001] The present application relates to a texture mapping method for three-dimensional model scanning, and in particular to an optimal conduction and area-preserving texture mapping method for three-dimensional model scanning, belonging to the technical field of three-dimensional model mapping. Background Art
[0002] Texture mapping is an important technology in computer graphics. With the increasingly sophisticated 3D model scanning technology, it is of great significance to draw the surface of complex 3D models to display effects similar to the real world in special effects movies, 3D animation, industrial design, virtual reality and other application fields. Parameterization is a very critical step in texture mapping. It is related to whether the effect of texture mapping is seriously deformed or stretched, thus affecting the realistic effect of computer simulation of the real world. The standard of parameterization is to reduce the degree of deformation and stretching after parameterization, and to measure the size of deformation by angle and area changes.
[0003] Early synthesized raster images were criticized for failing to achieve realistic effects when pursuing images that were closer to the real world, that is, they could not show textures, bumps, scratches, dirt or fingerprints on smooth surfaces. Texture mapping, as one of the key technologies for synthesizing high-quality images that are close to the real world, only requires a small amount of calculation to map a colorful texture pattern to a three-dimensional object, thereby achieving an increased visual effect of simulating reality. Previous modeling methods to depict the objective world require processing of each face of the model, which not only requires a large storage space, but also takes a long time to calculate, so the modeling method is very inefficient compared to texture mapping.
[0004] Texture mapping is simply the process of mapping a selected two-dimensional pattern to a curved surface by some method, and combining lighting calculation, image blending and other technologies to make the surface look more visually effective and more gorgeous. The two-dimensional pattern is generally loaded into the texture space for mapping. The texture space can also be represented by a mathematical function. Textures can be divided into one-dimensional, two-dimensional and three-dimensional, which can simulate rock formations, vegetation and marble respectively.
[0005] In recent years, as the public's expectations for the production quality of animation, games, and film and television have become higher and higher, large-scale 3D animated films have become common. The processing of the skin, hair, etc. of the character models in animated films requires the use of texture mapping. Texture mapping is roughly divided into two steps. The first step is how to map the texture image to the surface of a three-dimensional object, and the second step is how to display the texture pattern on the surface of the three-dimensional object to the screen space. Since the texture pattern is generally two-dimensional, and the screen display is also two-dimensional, when it is intuitively viewed, when the three-dimensional object in the middle is ignored, it is the conversion between the two-dimensional texture and the two-dimensional screen, but it will cause some deformation. By selecting the appropriate texture pattern and mapping method, not only can the beautiful patterns on the smooth surface be simulated, but also the unevenness of the surface of the three-dimensional object and even the light and dark changes can be expressed. As a highly realistic graphics technology, the texture mapping method has great research value in image processing and has broad development and application prospects in the engineering field.
[0006] The problems that need to be solved by the existing 3D model scanning texture mapping method and the key technical difficulties of this application include:
[0007] (1) The existing texture mapping technology lacks a suitable mapping algorithm. When a two-dimensional pattern is mapped to a three-dimensional model, the texture pattern is severely deformed and stretched. After texture mapping, holes and repeated mapping appear in some parts of the three-dimensional model. There is a lack of parameterization algorithms based on the standard that can minimize deformation. It is impossible to realistically depict the real world and minimize the angle deformation while keeping the area unchanged. The texture mapping effect is poor. There is a lack of area-preserving texture mapping methods based on optimal conduction. The results of area-preserving parameterization cannot ensure that the angle deformation is small while keeping the area unchanged. The algorithm lacks mathematical theoretical support and is unstable and has high time complexity.
[0008] (2) The prior art lacks research on the parameterization of triangulated mesh models with single boundaries and zero defects, and is unable to construct an area-preserving texture mapping parameterization method based on optimal conduction. In the plane parameterization stage, there is a lack of a balanced mapping method with the minimum elastic potential energy to map the target triangulated surface parameterization to a plane unit disk, and then complete the entire texture mapping process. Not only is it unable to maintain the characteristic of unchanged local angles, but it is also unable to maintain area measurement, and is unable to maintain the area of the triangulated mesh model unchanged, and is unable to meet the requirement of small deformation during texture mapping. The methods of the prior art have poor display and feasibility in texture mapping, and have the disadvantages of large area deformation, rough mapping, and uneven and unnatural mapping.
[0009] (3) For texture mapping of closed zero-genus surfaces, if a plane area is used as the parameter domain, the boundary stitching problem must be considered. However, the existing technology cannot be well applied to the plane parameter domain, and the angle cannot be kept unchanged during the first step of parameterization. As a result, it is impossible to ensure that the deformation of the local angle of the surface is small after area-preserving mapping, and it is impossible to achieve the goal of natural, average, and small-deformation visually realistic effects of the three-dimensional model surface texture mapping, and it is impossible to implement the area-preserving texture mapping method based on optimal conduction. Summary of the invention
[0010] This application summarizes the shortcomings of current texture mapping methods, and aims at the characteristics of single-boundary zero-deficient surfaces, with the goal of achieving natural, average, and small-deformation visual realistic effects on the texture mapping of three-dimensional model surfaces, and realizes an area-preserving texture mapping method based on optimal conduction. The balanced mapping with the minimum elastic potential energy is used to ensure that the local angle is less deformed after the whole process, and then the area-preserving mapping is used to determine the area without deformation. A suitable mapping algorithm is proposed so that when a two-dimensional pattern is mapped to a three-dimensional model, the deformation and stretching of the texture pattern can be minimized, and the phenomenon of holes and repeated mapping in some parts of the three-dimensional model after texture mapping is prevented. The parameterization process is determined based on the standard that can minimize deformation. The balanced mapping based on the minimum elastic potential energy and the optimal conduction area-preserving texture mapping can minimize the deformation of the angle while keeping the area unchanged, thereby achieving a better texture mapping effect.
[0011] In order to achieve the above technical effects, the technical solutions adopted in this application are as follows:
[0012] The optimal conduction area-preserving texture mapping method for 3D model scanning realizes the texture mapping of 3D surfaces based on the optimal conduction area-preserving parameterization. First, the information of the target surface is simplified by using the triangular meshing of the target surface, and the surface is parameterized to the plane parameter domain through the balanced mapping with the minimum elastic potential energy. The texture coordinates obtained by further optimal conduction area-preserving mapping and the texture image are aligned to realize texture mapping. It is divided into the following three parts:
[0013] P1-parameterize the target 3D model to the unit disk through the balanced mapping with the minimum elastic potential energy: first obtain the 3D model, and triangulate the 3D model through CAD or 3D scanner. For some closed zero-deficient 3D grid models without boundaries, segment the model into a single boundary model through segmentation. Then, for the pre-processed 3D grid model, the 3D grid data is parameterized to the plane unit disk through the balanced mapping with the minimum elastic potential energy, in preparation for further optimal conduction area-preserving mapping; the balanced mapping with the minimum elastic potential energy includes boundary extraction and the balanced mapping with the minimum elastic potential energy from the curved surface to the plane.
[0014] P2-Optimal conduction, i.e. area-preserving mapping, is performed on the data parameterized to the plane parameter domain: Discrete optimal conduction includes discrete conduction initialization, optimal conduction mapping, initialization height energy, calculation of power graph, calculation of hyperplane matrix, and further optimal conduction area-preserving mapping is performed through Newton iteration method to obtain the texture coordinates corresponding to each point on the three-dimensional model after the correct area-preserving mapping;
[0015] P3-Texture coordinate registration: Realize the texture coordinate registration between texture images and 3D models, realize the binding of texture images to 3D models, display textures through OpenGL, and make one-to-one correspondence between the parameterized texture coordinates and the coordinates of the texture images that need to be mapped to realize texture mapping.
[0016] Preferably, the balanced mapping with the minimum elastic potential energy: the texture mapping is parameterized, and the balanced mapping with the minimum elastic potential energy makes the topological structure of the three-dimensional model unchanged after parameterization, and makes the topological deformation minimum, and makes the elastic potential energy of the grid minimum based on elastic mechanics;
[0017] Assume that M is a facial epidermis made of rubber, and N is a hard, non-deformable, smooth sphere. The facial epidermis is put on N. The processing method is defined as mapping: p: M→N. When it is determined that M is in contact with the sphere everywhere, M adjusts itself so that it is attached to the surface of the sphere and is in an equilibrium position. At this time, the shape of the epidermis on the sphere no longer changes, and the elastic potential energy at this time reaches the minimum. At this time, the mapping p is called the equilibrium mapping with the minimum elastic potential energy.
[0018] The balanced mapping parameterization with the minimum elastic potential energy of the triangular mesh is to first fix the boundary of the triangular mesh to the boundary of the plane polygon, and determine the position of the boundary point of the triangular mesh on the polygon boundary according to the ratio of the boundary length of the triangular mesh to the total boundary length. At this time, each edge of the triangular mesh is regarded as made of rubber, and each edge naturally adjusts itself to minimize the elastic potential energy. The corresponding vertex of the triangular mesh inside the plane polygon is determined by minimizing the elastic potential energy of the entire triangular mesh.
[0019] The n boundary points x1,…,x on the triangular mesh model S(G,X) are n As the boundary points mapped to the selected plane area, these boundary points are mapped to a planar n-gon The boundary points of the plane polygon P are selected by including the n-gon in a circle, that is, placing the n vertices on a circle, and making the length of the line segment connecting the two corresponding adjacent boundary points on the grid surface boundary proportional to the central angle of the circle corresponding to the two adjacent vertices of the plane n-gon, or directly setting the plane n-gon P to a square, a circle, an equilateral triangle or other convex polygon;
[0020] The grid surface S is regarded as a surface made of rubber. Each edge in the edge set E is also a stretchable rubber. The deformation energy of the vertices on the target surface S mapped to the plane parameter domain P is:
[0021]
[0022] where u i ,u j are the projection points of the two nodes connecting the edge (i, j) on the two-dimensional plane P, and the positions of the points on the surface boundary have been calculated and fixed, k ij is the elastic coefficient of edge (i, j), ensuring that the length of each edge in the initial grid S and the shape of the adjacent faces do not change too much. ij Take it as:
[0023]
[0024] Define a discrete energy function from the perspective of continuous Dirichlet energy and minimize the energy to get the result:
[0025]
[0026] In the formula, k1 and k2 are the other two vertices of the two adjacent faces of edge (i, j), and α and β represent the other two angles that are independent of edge (ij). ij represents the length of edge (ij), A ijk represents the area of the triangle f(i, j, k), and k ij Taken as the average elastic modulus;
[0027] So that the energy equation 1E harm (u) is the smallest, then it is transformed into:
[0028] Δ PL f(u i )=∑ (i,j)∈E k ij (f(u j )-f(u i )) Formula 4
[0029] When Δ PLf ≡0, the deformation energy is minimized;
[0030] Get the corresponding coordinates of all vertices in the grid surface S mapped to the plane P. The specific solution is as follows:
[0031] Assume that after a triangular mesh surface S is mapped to a plane P, the five vertices of P are set to u1(u1v1), u2(u2v2), u5(u5v5), u6(u6v6), u7(u7v7) in sequence, and u1, v1, u2, v2, u5, v5, u6, v6, u7, v7 are known values, u1(u1v1), u2(u2v2), u5(u5v5), u6(u6v6), u7(u7v7) are fixed on the plane P as boundary points in equal proportions during initialization, and the coordinate values of these points are determined. Let f(u) be the position of a point u on the triangular mesh surface on the plane P, f(u1), f(u2), f(u5), f(u6).f(u7) be the positions of known points, and f(u3) and f(u4) be unknown points inside the mesh;
[0032] According to formula 1, the formula at u3 is expressed as:
[0033]
[0034] This formula is transformed into:
[0035]
[0036] In equation 6, all the information on the right side of the equal sign is known. The linear equations about f(u3) and f(u4) are listed. The coefficient matrix of the linear equations is a large sparse matrix. The sparse matrix is processed by the Eigen library.
[0037] f(u i ) is represented by u i The coordinate position of this point on plane P, the sparse matrix is simplified to two sparse matrices on the plane about (u, v) on plane P, where the left side of equation 7 uses k ij The matrix represented is set to A, then the right side of equation 6 is set to U matrix and V matrix, u, v represent the coordinate matrices of all unknown points, and we get:
[0038]
[0039] Solve this system of equations to obtain the coordinates of the unknown points.
[0040] Preferably, the extraction of the boundary: if the given three-dimensional model is a closed triangular mesh with a genus of 0, the triangular mesh needs to be cut, the cutting line is set as the boundary, and then the cutting boundary of the mesh is proportionally mapped to the position associated with the parameter domain boundary of the plane according to the order of the edge length after cutting. For the closed three-dimensional model, Openflipper is used for manual cutting.
[0041] Preferably, the balanced mapping with the minimum elastic potential energy of the curved surface to the plane is: the discrete surface is approximated by a triangular grid. Assume that the triangular grid of the surface is represented by M, and the vertex on the grid defines the function f: M→R point p is a triangle on the triangular grid [v i , v j , v k ] is a point inside the triangle, where point p is represented by three vertices v i , v j , v k A linear combination of:
[0042] p=λ i v i +λ j v j +λ k v k Formula 8
[0043] And (λ i ,λ j ,λ k ) is the centroid coordinate of point p and satisfies λ i +λ j +λ k =1, the centroid coordinates are calculated as follows:
[0044]
[0045] Where A([p,v j , v k ]) indicates p, v j , v k The area of the enclosed triangle, function f is expressed as a linear combination function:
[0046] f(p)=λ i f(v i )+λ j f(v j )+λ k f(v k ) Formula 10
[0047] By direct calculation, the harmonic energy of the mapping is expressed as:
[0048]
[0049] Among them, j Represents the edge [v i , v j ], assuming that the weight of the edge [v i ,v j ]The two adjacent triangles are [v i ,v j ,v k ] and [vi ,v j ,v l ],θ k and θ l The two triangles are respectively k and v l The vertex angle of , the edge weight is expressed as:
[0050]
[0051] The boundary side has only one adjacent triangle, and only one cotangent of the opposite angle is used. The corresponding equation is:
[0052]
[0053] The calculation of the equilibrium map with the minimum elastic potential energy is a linear equation system, and the calculation algorithm is as follows:
[0054] Algorithm 1: Balanced mapping with minimum elastic potential energy
[0055] Input: a surface triangular mesh M with zero-genus single boundary, in the form of a .m mesh file;
[0056] 1) Traverse the boundary of the surface triangular grid and obtain the boundary point sequence (v1, v2, ..., v n-1 );
[0057] 2) Set the image points of the boundary vertices on the plane:
[0058]
[0059] 3) Traverse all edges and calculate the corresponding weight w ij ;
[0060] 4) For all internal points, construct the discretized Laplace equation for all its adjacent points
[0061] 5) Solve the linear system to obtain the image point of the internal point;
[0062] Output: Equilibrium map of the surface grid with the minimum elastic potential energy on the plane
[0063] Preferably, discrete optimal conduction: Assume that μ has compact support Ω on space X, where Ω is a convex region on X, defined as Ω = Suppμ = {x∈X|μ(x)>0}, and space Y is split into Y = (v1, v2, …, v n-1 );
[0064] Define a height vector Contains n real numbers. For each yi∈Y, let a hyperplane be defined on X as: π i(h): <x,y i >+h i =0, where <, > is defined as The inner product on , the potential energy function is defined as:
[0065] u h (x): max i {〈x, y i >+h i Formula 15
[0066] Let G(h) represent a supported plane π i (h) is an open convex polyhedron, and the projection of G(h) on the partial area of Ω is several polygons. Each cell corresponds to the polygon W i (h) is the projection of a face of the convex polyhedron G(h) on Ω;
[0067] Convex function u h In each cell W i (h) is a linear function π i (h), the gradient map is:
[0068] grad u h :W i (h)→y i ,i=1,2,...,n, Equation 16
[0069] The mapping makes each W i (h) corresponds to an independent point y i , it is agreed that for any given metric μ,v j >0, j=1,…,n, satisfies Then there must be a height vector h that is uniquely determined by adding a constant vector (c, c, …, c), and the convex function u h Induce the decomposition of the cells on Ω, and all the cells satisfy the following area-preserving constraints:
[0070]
[0071] Furthermore, the gradient u of the gradient map h Optimize the following conduction cost:
[0072] E(T): =∫ Ω |xT(x)| 2 μ(x)dx. Equation 18
[0073] The global optimal conduction problem is solved by Newton's method, the steps are as follows:
[0074] First, define a space where height vectors exist:
[0075]
[0076] Then, define the energy E(h) as the volume of the polyhedron enclosed by the cylinder generated by G(h) and Ω and subtract a linear term:
[0077]
[0078] Then the gradient energy is:
[0079]
[0080] Assume that the cell cavity W i (h) and W j (h) The intersection is e on one edge ij =W i (h)∩W j (h)∩Ω, the hyperplane matrix of E(h) is:
[0081]
[0082] H0 is convex, the hyperplane matrix is positive definite on H0, the global unique minimum h is an iteration point on H0, and the gradient map gradu h The measure-preserving constraint is satisfied, and further, the gradient mapping is the optimal conduction mapping.
[0083] Preferably, discrete conduction initialization: first parameterize the three-dimensional grid surface to a plane, and normalize the result to a unit disk. This step of parameterization uses a balanced map with the minimum elastic potential energy, and then assigns a target area to each point on the disk. Define u(v i ) for each point v i The Dirac metric of ∈V is one third of the area of all triangles corresponding to the edges connected to the point:
[0084]
[0085] Where [v i ,v j ,v k ] indicates that the triangle is composed of v i ,v j ,v k Consists of three points.
[0086] Preferably, the optimal conduction mapping: it is necessary to find a final height vector h = (h1, h2, ..., h n ), first fix a height vector, the hyperplane is composed of π i (h) gives πi (h): <x,y i >+h i , the convex function is:
[0087] u h (x)=max i { <x,y i >+h i Formula 24
[0088] Denote G(h) as the support plane π i The upper envelope of (h), the region where the projection of G(h) generates Ω is a number of polygonal regions
[0089] Keep the area of each cell W i The virtual variables of each vertex are updated iteratively, that is, the height vector h = (h1, h2, ..., h n ), in each iteration, first calculate the power diagram, by taking each vertex as a point, and taking the weight radius of each vertex as the power of the diagram, and then calculate the dual triangulation of the calculated power diagram, record the length of each edge in the power diagram and the corresponding dual triangulation to generate the hyperplane matrix, solve the gradient energy equation by Newton's method, and update the height energy h = (h1,h2,…,h n ) until each cell cavity is satisfied Less than the set δw, and finally update the position of each vertex as the center of the power Voronoi diagram to obtain the parameterized area-preserving result.
[0090] Preferably, the height energy is initialized: In the initialization stage, each point in the point set Y is ensured to be in Ω by changing the scale by zooming in or out or by displacement transformation, and then the Voronoi diagram with power weights of 0 is calculated, and the height energy is initialized by h i =-1 / 2||y i || 2 , where ||y i || 2 is the position of a point in the plane region, ensuring that every cell is non-empty.
[0091] Preferably, the calculation of the power graph: The area-preserving calculation of the Ω region based on optimal conduction is equivalent to the computation of the geometric power graph. Given a point set Y = {y1, y2, ..., y n}, each point y i will be associated with a value w i As the power of that point, from any point x to y iThe power distance is defined as:
[0092]
[0093] The cell cavity area is:
[0094] w i =2h i + <y i ,y i > Formula 26
[0095] The cell cavity area was calculated from the power map.
[0096] Preferably, the calculation of the hyperplane matrix: using the gradient energy Indicates changes in the cell cavity here As weights, the gradient is then found by calculating the dual triangulation and cell area:
[0097]
[0098] Calculate each edge e in the power graph ij and the corresponding dual edge Then generate the hyperplane matrix H(h) = (h ij (h)), where:
[0099]
[0100] where h ij is the value at the matrix position (i, j);
[0101] Then use Newton's method to update the height vector:
[0102]
[0103] Where ε represents the step size. During the calculation process, ensure that all cells W i (h)∩Ω are all non-empty. Assume that all cells are non-empty at step k, but are updated at step k+1:
[0104]
[0105] If some cells in the power diagram have h k+1 If it is empty, it will return to h k , and reduce the step size from ε to 1 / 2ε, then recalculate. If there are still some empty cells, reduce ε again until all power cells are not 0;
[0106] Let F be the domain (for elementary purposes, let F be ), n-dimensional space Fn The hyperplane in is given by the equation:
[0107] a1x1+…+a n x n =b Formula 31
[0108] The defined subset must satisfy a1,…,a n ∈F is a constant that is not entirely zero.
[0109] Compared with the prior art, the innovations and advantages of this application are:
[0110] (1) This application summarizes the shortcomings of current texture mapping methods, and targets the characteristics of single-boundary zero-deficient surfaces, with the goal of achieving natural, average, and small-deformation visually realistic texture mapping effects on three-dimensional model surfaces, and implements an area-preserving texture mapping method based on optimal conduction. Balanced mapping with the minimum elastic potential energy is used to ensure that the local angle is less deformed after the entire process, and then area-preserving mapping is used to determine that the area does not deform. A suitable mapping algorithm is proposed so that when a two-dimensional pattern is mapped to a three-dimensional model, the deformation and stretching of the texture pattern can be minimized, and the phenomenon of holes and repeated mapping in certain parts of the three-dimensional model after texture mapping can be prevented. The parameterization process is determined based on the standard that can minimize deformation. The balanced mapping based on the minimum elastic potential energy and the optimal conduction area-preserving texture mapping can minimize the deformation of the angle while keeping the area unchanged, thereby achieving a better texture mapping effect.
[0111] (2) The present application is aimed at developing and improving the parameterization of a triangular mesh model with a single boundary and zero defect. First, an area-preserving texture mapping parameterization method based on optimal conduction is constructed. In the plane parameterization stage, a balanced mapping method with the minimum elastic potential energy is used to map the target triangulated surface parameters to a plane unit disk. The obtained plane parameter domain information is further mapped using the optimal conduction algorithm to obtain the texture coordinates of the target surface, and then the entire texture mapping process is completed. Because the data after the balanced mapping parameterization with the minimum elastic potential energy not only has the characteristic of keeping the local angle unchanged, but also maintains the area measurement, the result is mapped to preserve the area, which can well maintain the area of the triangular mesh model unchanged. This process also makes the angle deformation smaller at the end, thereby meeting the requirement of smaller deformation during texture mapping. The area-preserving parameterization method implemented in the present application has good display and feasibility in texture mapping, and has the advantages of small area deformation, smooth mapping, uniform and natural.
[0112] (3) The parameterization method and emphasis in the texture mapping of this application are to minimize the distortion after mapping. For the texture mapping of closed zero-genus surfaces, if a plane area is used as the parameter domain, the boundary stitching problem must be considered. The use of a single-boundary zero-genus surface is well suited for the plane parameter domain, and the use of a balanced map with the minimum elastic potential energy in the first step of parameterization can keep the angle unchanged, so that after area-preserving mapping, the deformation of the local angle of the surface can be kept as small as possible. An area-preserving texture mapping method based on optimal conduction is implemented. Before performing area-preserving parameterization, a balanced map with the minimum elastic potential energy is used for parameterization, so that the result after area-preserving parameterization not only ensures that the area remains unchanged, but also ensures that the angle deformation is small. An area-preserving mapping algorithm based on optimal conduction is used, and the area-preserving algorithm has a strong mathematical theoretical support and is stable, effective, and has low time complexity. BRIEF DESCRIPTION OF THE DRAWINGS
[0113] Figure 1 It is a schematic diagram of the process of parametric mapping of triangular mesh surface to plane.
[0114] Figure 2 This is a specific implementation flow chart of texture mapping based on area-preserving transformation based on optimal conduction.
[0115] Figure 3 It is a schematic diagram of loading and displaying imaging information of a target three-dimensional model data file.
[0116] Figure 4 It is a schematic diagram of the triangular mesh surface corresponding to the target surface.
[0117] Figure 5 This is a schematic diagram of the equilibrium map with the smallest elastic potential energy parameterized to a unit disk.
[0118] Figure 6 It is a schematic diagram of the unit disk of area-preserving mapping based on optimal conduction.
[0119] Figure 7 This is a comparison chart of the effects of applying checkerboard texture to a lion head image by experimenting with different methods.
[0120] Figure 8 This is a comparison chart of the effects of experimenting with different methods of applying checkerboard textures to a 3D rabbit model. DETAILED DESCRIPTION
[0121] The following, in conjunction with the accompanying drawings, further describes the technical solution of the optimal conduction area-preserving texture mapping method for three-dimensional model scanning provided by the present application, so that technicians in this field can better understand the present application and implement it.
[0122] Texture mapping is to map a two-dimensional texture pattern to a three-dimensional model. Therefore, it is necessary to find a suitable mapping algorithm so that when the two-dimensional pattern is mapped to the three-dimensional model, the deformation and stretching of the texture pattern can be minimized as much as possible, and to prevent the phenomenon of holes and repeated mapping in some parts of the three-dimensional model after texture mapping. The selection of the algorithm in the parameterization process is based on the standard of minimizing deformation. The smaller the deformation, the more realistically the computer can depict the real world. Texture mapping based on balanced mapping with minimum elastic potential energy and optimal conduction and area preservation can minimize the deformation of angles while keeping the area unchanged, thereby achieving better texture mapping effects.
[0123] This application studies the parameterization of a triangulated mesh model with a single boundary and zero defect. First, an area-preserving texture mapping parameterization method based on optimal conduction is constructed. In the plane parameterization stage, a balanced mapping method with the minimum elastic potential energy is used to map the target triangulated surface parameters to a plane unit disk. The obtained plane parameter domain information is further mapped using an optimal conduction algorithm to obtain the texture coordinates of the target surface, and then the entire texture mapping process is completed. Because the data after the balanced mapping parameterization with the minimum elastic potential energy not only has the characteristic of keeping the local angle unchanged, but also maintains the area measurement, the result is then mapped to preserve the area, which can well maintain the area of the triangulated mesh model unchanged. This process also makes the angle deformation smaller in the end, thereby meeting the requirement of smaller deformation during texture mapping.
[0124] By using the parameterization method framework proposed in this application and conducting comparative experiments with the simple balanced mapping parameterization method with the minimum elastic potential energy, a comparative analysis is given, and it is shown that the area-preserving parameterization method implemented in this application has good display and feasibility in texture mapping. Compared with other methods, this application has the advantages of small area deformation, smooth mapping, uniform and natural mapping, etc.
[0125] 1. Gridding of 3D Model
[0126] The three-dimensional model for texture mapping obtains its sampling points through a three-dimensional scanner or CAD and reconstructs the grid to obtain its triangular grid information. The triangular grid is obtained through triangulation and uses an m-format file. The file contains the information of the associated points and faces corresponding to the triangular grid, that is, the surface triangulation.
[0127] 2. Balanced mapping with minimum elastic potential energy
[0128] The texture map is parameterized using a balanced map with the minimum elastic potential energy. The balanced map with the minimum elastic potential energy keeps the topological structure of the three-dimensional model unchanged after parameterization and minimizes the topological deformation. Based on elastic mechanics, the elastic potential energy of the grid is minimized.
[0129] Assume that M is a facial epidermis made of rubber, and N is a hard, non-deformable, smooth sphere. The facial epidermis is put on N. The processing method is defined as mapping: p: M→N. When it is determined that M is in contact with the sphere everywhere, M adjusts itself so that it is attached to the surface of the sphere and is in an equilibrium position. At this time, the shape of the epidermis on the sphere no longer changes, and the elastic potential energy is minimized. At this time, the mapping p is called the equilibrium map with the minimum elastic potential energy.
[0130] The balanced mapping parameterization with the minimum elastic potential energy of the triangular grid is to first fix the boundary of the triangular grid to the boundary of the plane polygon, and determine the position of the boundary points of the triangular grid on the polygon boundary according to the ratio of the boundary length of the triangular grid to the total boundary length. At this time, each edge of the triangular grid is regarded as made of rubber, and each edge naturally adjusts itself to minimize the elastic potential energy. The corresponding vertices of the triangular grid inside the plane polygon are determined by minimizing the elastic potential energy of the entire triangular grid.
[0131] The n boundary points x1,…,x on the triangular mesh model S(G,X) are n As the boundary points mapped to the selected plane area, these boundary points are mapped to a planar n-gon The boundary points of the plane polygon P are selected by including the n-gon in a circle, that is, placing the n vertices on a circle, and making the length of the line segment connecting the corresponding two adjacent boundary points on the grid surface boundary proportional to the central angle of the circle corresponding to the two adjacent vertices of the plane n-gon, or directly setting the plane n-gon P to a square, circle, equilateral triangle or other convex polygon.
[0132] The grid surface S is regarded as a surface made of rubber. Each edge in the edge set E is also a stretchable rubber. The deformation energy of the vertices on the target surface S mapped to the plane parameter domain P is:
[0133]
[0134] where u i ,u j are the projection points of the two nodes connecting the edge (i, j) on the two-dimensional plane P, and the positions of the points on the surface boundary have been calculated and fixed, k ij is the elastic coefficient of edge (i, j), ensuring that the length of each edge in the initial grid S and the shape of the adjacent faces do not change too much. ij Take it as:
[0135]
[0136] Define a discrete energy function from the perspective of continuous Dirichlet energy and minimize the energy to get the result:
[0137]
[0138] In the formula, k1 and k2 are the other two vertices of the two adjacent faces of edge (i, j), and α and β represent the other two angles that are independent of edge (ij). ij represents the length of edge (ij), A ijk represents the area of the triangle f(i, j, k), preventing k ij If it is not a positive number, the parameterization will be invalid. ij Taken as the average elastic modulus.
[0139] So that the energy equation 1E harm (u) is the smallest, then it is transformed into:
[0140] Δ PL f(u i )=∑ (i,j) ∈Ek ij (f(u j )-f(u i )) Formula 4
[0141] When Δ PL When f≡0, the deformation energy is minimized;
[0142] Get the corresponding coordinates of all vertices in the grid surface S mapped to the plane P. The specific solution is as follows:
[0143] Suppose a triangular mesh surface S is mapped to a plane P as follows Figure 1 As shown, the five vertices of P are set to u1(u1v1), u2(u2v2), u5(u5v5), u6(u6v6), and u7(u7v7) respectively, and u1, v1, u2, v2, u5, v5, u6, v6, u7, and v7 are known values. u1(u1v1), u2(u2v2), u5(u5v5), u6(u6v6), and u7(u7v7) are fixed on plane P in equal proportion as boundary points during initialization. The coordinate values of these points are determined. Let f(u) be the position of a point u on the triangular grid surface on plane P, f(u1), f(u2), f(u5), f(u6).f(u7) be the positions of known points, and f(u3) and f(u4) are unknown points inside the grid.
[0144] According to formula 1, the formula at u3 is expressed as:
[0145]
[0146] This formula is transformed into:
[0147]
[0148] In equation 6, all the information on the right side of the equal sign is known. The linear equations about f(u3) and f(u4) are listed. The coefficient matrix of the linear equations is a large sparse matrix. The sparse matrix is processed by the Eigen library.
[0149] f(u i ) is represented by u i The coordinate position of this point on plane P, the sparse matrix is simplified to two sparse matrices on the plane about (u, v) on plane P, where the left side of equation 7 uses k ij The matrix represented is set to A, then the right side of equation 6 is set to U matrix and V matrix, u, v represent the coordinate matrices of all unknown points, and we get:
[0150]
[0151] Solve this system of equations to obtain the coordinates of the unknown points.
[0152] (I) Boundary extraction
[0153] If the given 3D model is a closed triangular mesh with a genus of 0, the triangular mesh needs to be cut, the cutting line is set as the boundary, and then the cutting boundary of the mesh is proportionally mapped to the position associated with the parameter domain boundary of the plane according to the order of the edge length after cutting. For closed 3D models, Openflipper is used for manual cutting.
[0154] (II) Balanced mapping with minimum elastic potential energy from curved surface to flat surface
[0155] Discrete surfaces are approximated by triangular meshes. Assume that the triangular mesh of the surface is represented by M, and the vertex on the mesh defines the function f: M→R. Point p is a triangle on the triangular mesh [v i , v j , v k ] is a point inside the triangle, where point p is represented by three vertices v i , v j , v k A linear combination of:
[0156] p=λ i v i +λ j v j +λ k v k Formula 8
[0157] And (λ i ,λ j ,λ k ) is the centroid coordinate of point p and satisfies λ i +λ j +λ k=1, the centroid coordinates are calculated as follows:
[0158]
[0159] Where A([p,v j , v k ]) indicates p, v j , v k The area of the enclosed triangle, function f is expressed as a linear combination function:
[0160] f(p)=λ i f(v i )+λ j f(v j )+λ k f(v k ) Formula 10
[0161] By direct calculation, the harmonic energy of the mapping is expressed as:
[0162]
[0163] where w ij Represents the edge [v i , v j ], assuming that the weight of the edge [v i ,v j ]The two adjacent triangles are [v i ,v j ,v k ] and [v i ,v j ,v l ],θ k and θ l The two triangles are respectively k and v l The vertex angle of , the edge weight is expressed as:
[0164]
[0165] The boundary side has only one adjacent triangle, and only one cotangent of the opposite angle is used. The corresponding equation is:
[0166]
[0167] The calculation of the equilibrium map with the minimum elastic potential energy is a linear equation system, and the calculation algorithm is as follows:
[0168] Algorithm 1: Balanced mapping with minimum elastic potential energy
[0169] Input: a surface triangular mesh M with zero-genus single boundary, in the form of a .m mesh file;
[0170] 1) Traverse the boundary of the surface triangular grid and obtain the boundary point sequence (v1, v2, ..., v n-1 );
[0171] 2) Set the image points of the boundary vertices on the plane:
[0172]
[0173] 3) Traverse all edges and calculate the corresponding weight wi j ;
[0174] 4) For all internal points, construct the discretized Laplace equation for all its adjacent points
[0175] 5) Solve the linear system to obtain the image point of the internal point;
[0176] Output: Equilibrium map of the surface grid with the minimum elastic potential energy on the plane
[0177] 3. Discrete Optimal Conduction
[0178] Assume that μ has compact support Ω on space X, where Ω is a convex region on X, defined as Ω = Suppμ = {x∈X|μ(x) > 0}, and space Y is split into Y = (v1, v2, …, v n-1 );
[0179] Define a height vector Contains n real numbers. For each yi∈Y, let a hyperplane be defined on X as: π i (h): <x,y i >+h i =0, where <, > is defined as The inner product on , the potential energy function is defined as:
[0180] u h (x): max i {〈x, y i >+h i Formula 15
[0181] Let G(h) represent a supported plane π i (h) is an open convex polyhedron, and the projection of G(h) on the partial area of Ω is several polygons. Each cell corresponds to the polygon W i (h) is the projection of a face of the convex polyhedron G(h) onto Ω.
[0182] Convex function u h In each cell W i (h) is a linear function πi(h), and the gradient mapping is:
[0183] grad u h :W i (h)→y i ,i=1,2,..,n, Equation 16
[0184] The mapping makes each W i (h) corresponds to an independent point yi, and it is agreed that for any given metric μ, v j >0, j=1,…,n, satisfies Then there must be a height vector h that is uniquely determined by adding a constant vector (c, c, …, c), and the convex function u h Induce the decomposition of the cells on Ω, and all the cells satisfy the following area-preserving constraints:
[0185]
[0186] Furthermore, the gradient u of the gradient map h Optimize the following conduction cost:
[0187] E(T): =∫ Ω |xT(x)| 2 μ(x)dx. Equation 18
[0188] The global optimal conduction problem is solved by Newton's method, the steps are as follows:
[0189] First, define a space where height vectors exist:
[0190]
[0191] Then, define the energy E(h) as the volume of the polyhedron enclosed by the cylinder generated by G(h) and Ω and subtract a linear term:
[0192]
[0193] Then the gradient energy is:
[0194]
[0195] Assume that the cell cavity W i (h) and W j (h) The intersection is e on one edge ij =W i (h)∩W j (h)∩Ω, the hyperplane matrix of E(h) is:
[0196]
[0197] H0 is convex, the hyperplane matrix is positive definite on H0, the global unique minimum h is an iteration point on H0, and the gradient map gradu h The measure-preserving constraint is satisfied, and further, the gradient mapping is the optimal conduction mapping.
[0198] (I) Discrete conduction initialization
[0199] First, the three-dimensional grid surface is parameterized to a plane, and the result is normalized to a unit disk. This step of parameterization uses a balanced map with the minimum elastic potential energy, and then a target area is assigned to each point on the disk. Define u(v i ) for each point v i The Dirac metric of ∈V is one third of the area of all triangles corresponding to the edges connected to the point:
[0200]
[0201] Where [v i ,v j ,v k ] indicates that the triangle is composed of v i ,v j ,v k Consists of three points.
[0202] Optimal Conduction Mapping
[0203] We need to find a final height vector h = (h1, h2, ..., h n ), first fix a height vector, the hyperplane is composed of π i (h) gives π i (h):<x,yi> +h i , the convex function is:
[0204] u h (x)=max i { <x,y i 〉+h i Formula 24
[0205] Denote G(h) as the support plane π i The upper envelope of (h), the region where the projection of G(h) generates Ω is a number of polygonal regions
[0206] Keep the area of each cell W i The virtual variables of each vertex are updated iteratively, that is, the height vector h = (h1, h2, ..., h n), in each iteration, first calculate the power diagram, by taking each vertex as a point, and taking the weight radius of each vertex as the power of the diagram, and then calculate the dual triangulation of the calculated power diagram, record the length of each edge in the power diagram and the corresponding dual triangulation to generate the hyperplane matrix, solve the gradient energy equation by Newton's method, and update the height energy h = (h1, h2, ..., hn) until each cell cavity is satisfied Less than the set δw, and finally update the position of each vertex as the center of the power Voronoi diagram to obtain the parameterized area-preserving result.
[0207] (III) Initialization height energy
[0208] In the initialization stage, we ensure that every point in the point set Y is in Ω by changing the scale or by displacement transformation, and then calculate the Voronoi diagram with power weights of 0. i =-1 / 2||y i || 2 , where ||y i || 2 is the position of a point in the plane region, ensuring that every cell is non-empty.
[0209] (IV) Calculation of power graph
[0210] The area-preserving calculation of the Ω region based on optimal conduction is equivalent to computing the geometric power graph. Given a point set Y = {y1, y2, …, y n}, each point y i will be associated with a value w i As the power of that point, from any point x to y i The power distance is defined as:
[0211]
[0212] The cell cavity area is:
[0213] w i =2h i + <y i ,y i > Formula 26
[0214] The cell cavity area was calculated from the power map.
[0215] (V) Calculation of Hyperplane Matrix
[0216] With gradient energy Indicates changes in the cell cavity here As weights, the gradient is then found by calculating the dual triangulation and cell area:
[0217]
[0218] Calculate each edge e in the power graph ij and the corresponding dual edge Then generate the hyperplane matrix H(h) = (h ij (h)), where:
[0219]
[0220] where h ij is the value at the matrix position (i, j);
[0221] Then use Newton's method to update the height vector:
[0222]
[0223] Where ε represents the step size. During the calculation process, ensure that all cells W i (h)∩Ω are all non-empty. Assume that all cells are non-empty at step k, but are updated at step k+1:
[0224]
[0225] If some cells in the power diagram have h k+1 If it is empty, it will return to h k , and reduce the step size from ε to 1 / 2ε, then recalculate. If there are still some empty cells, reduce ε again until all power cells are not zero.
[0226] Let F be the domain (for elementary purposes, let F be ), n-dimensional space F n The hyperplane in is given by the equation:
[0227] a1x1+…+a n x n =b Formula 31
[0228] The defined subset must satisfy a1,…,a n ∈F is a constant that is not entirely zero.
[0229] The discrete OMT calculation algorithm is as follows:
[0230] Input: A triangular mesh of a planar unit disk with texture coordinates generated by Algorithm 1
[0231] 1) Set the target area first Target area By target area to conclude;
[0232] 2) Calculate the power diagram and W for each cell i The corresponding area w i ;
[0233] 3) Calculate the dual Delange triangulation, and calculate the length of each edge in the diagram and the corresponding edge length in the dual triangulation to form a hyperplane matrix H(h) = (h ij (h));
[0234] 4) Update
[0235] 5) Repeat steps 2 to 4 until each cell cavity are all less than δw;
[0236] 6) Calculate W for each cell i The center of mass is denoted by c i , the area-preserving mapping is where τ is the Brenier map τ: W i →φ(v i );
[0237] Output: A unique area-preserving map in is also a unit disk, each cell The area of wi should be close to the target area
[0238] 4. Texture Mapping
[0239] The texture mapping part is implemented using the texture mapping function in OpenGL, which makes a one-to-one correspondence between the parameterized balanced mapping with the minimum elastic potential energy and the plane data after OMT area-preserving mapping, including the coordinates of the parameterized texture coordinates and the texture image to be mapped, to realize the texture mapping process.
[0240] V. Experiment and Results Analysis
[0241] 1. System Framework
[0242] The specific implementation process of texture mapping based on optimal conduction area-preserving transformation is as follows Figure 2As shown. This includes establishing the connection between the target three-dimensional surface and the two-dimensional texture image. The connection between the target three-dimensional surface and the two-dimensional texture image is divided into three parts. The first part is to parameterize the target three-dimensional surface through the balanced mapping with the minimum elastic potential energy, that is, mapping it to the two-dimensional unit disk. The second part is to map the information of the points mapped to the two-dimensional plane through the optimal conduction area preservation mapping to generate the final parameterization result. The third part is to align the final parameterization result with the texture image.
[0243] 1. Parameterization of balanced mapping with minimum elastic potential energy. The 3D model that needs texture mapping is preprocessed. The 3D model is scanned by a 3D model scanner. When the model is just some point cloud data, the huge point cloud data needs to be surfaced. Since the texture mapping of a surface with a single boundary and zero genus is considered, when the target 3D model has no boundary, the model needs to be cut. Here, the software OpenFlipper is used for cutting. Then the initialized target 3D grid is parameterized, and the mapping plane is adjusted to a unit disk during the parameterization process. Some of the 3D models used in this experiment have zero boundaries and are cut using OpenFlipper.
[0244] 2. Area-preserving mapping based on optimal conduction. The result of the calculation that has been parameterized to the unit disk through the equilibrium mapping with the minimum elastic potential energy is iteratively approximated to the target value given in the optimal conduction by using Newton's method until the required accuracy error is reached. The optimal conduction mapping process ends and the position corresponding to each point is obtained. The calculation result is still on the unit disk.
[0245] 3. Texture coordinate registration. This step is implemented through OpenGL. First, you need to specify the texture, that is, you need to convert the loaded texture image into a texture and store it in memory, then specify the application method of the texture image, that is, the rendering type, then activate texture drawing, and finally specify the match between the texture coordinates and the target 3D model texture coordinates to generate the final result.
[0246] (II) Specific implementation process of the experiment
[0247] Combined with the specific process of experimental operation, the experimental results of each step are given according to the system framework. ⑴ First, the target three-dimensional model is parameterized with the balanced mapping with the minimum elastic potential energy, and the three-dimensional model is mapped to the unit disk through the balanced mapping with the minimum elastic potential energy. First, the data file of the target three-dimensional model needs to be loaded and calculated, and MeshViwer is used to display the specific imaging information. Figure 3 shown.
[0248] The triangular mesh surface corresponding to the target surface is as follows Figure 4As shown, geometric figures, faces and animal surfaces were selected as experimental data for demonstration.
[0249] After the target surface model is subjected to the balanced mapping with the minimum elastic potential energy, the triangular grid area is quantized to the unit disk. Figure 5 The result of parameterization is related to the refinement of the model. When the target surface model stores more model information (corresponding to more points, lines, and surfaces), the denser the triangulation grid, the more uniform the distribution of points will be during the parameterization process.
[0250] ⑵ Area-preserving mapping based on optimal conduction. Figure 6 As shown, first, the calculation result of the balanced mapping parameterized to the unit disk with the minimum elastic potential energy is iteratively approximated to the target value given in the optimal conduction by using Newton's method until the required accuracy error is reached. The optimal conduction mapping process is terminated and the corresponding position of each point is obtained.
[0251] (III) Experimental results and analysis
[0252] 1. Experimental results
[0253] The triangular mesh model is parameterized by minimizing the harmonic energy by using the balanced mapping with the minimum elastic potential energy to map it to the plane disk area, and the coordinates of the points on the unit disk obtained by the optimal conduction area-preserving mapping of the parameterized data are used as the parameterization process of the entire three-dimensional surface model. Then, the plane parameter domain based on the area-preserving parameterization is aligned with the texture space that has been loaded with the texture image. Finally, the two-dimensional texture pattern is mapped to the surface of the surface, so that the realistic effect of the two-dimensional texture is displayed on the surface of the three-dimensional model. Several sets of data are selected for display, including pasting marble texture on the three-dimensional face model to make it show the feeling of facial sculpture, and pasting animal hair on the three-dimensional rabbit model to make its three-dimensional model display more realistic. Of course, in order to show the effect of the algorithm, we also try to paste the checkerboard texture on the model to show its parameter change effect on the three-dimensional surface model, such as area change and angle change. Because the checkerboard is composed of many small squares of the same size, it is easy to observe its angle and area changes.
[0254] 2. Experimental Analysis
[0255] The coordinates of the points on the unit disk obtained by performing the optimal conduction area-preserving mapping on the parameterized data are the texture map of the three-dimensional surface model. Then, the texture map of the three-dimensional surface model is aligned with the texture space loaded with the texture image. This method is compared with the texture coordinates generated by performing the parameterization of the balanced map with the minimum elastic potential energy and then performing the texture mapping effect. The texture of the map includes checkerboard texture and marble texture images, such as Figure 7 and Figure 8 As shown, Figure 7 and Figure 8 In the figure, the one on the left is the balanced map that only uses the minimum elastic potential energy, and the one on the right is the texture map after using the balanced map with the minimum elastic potential energy and then mapping it through optimal conduction and area preservation.
[0256] from Figure 7 and Figure 8 It can be seen from the effect that the texture image using only the balanced map with the minimum elastic potential energy has exaggerated deformation on both sides of the lion head model's lower jaw, and the area changes of the two black checkerboards are particularly large. The same algorithm is used in the rabbit model's ears, face area and the part of the foot below the model, which also deforms to a large extent. Because the surface at this location is very uneven, the small square blocks in this part have become larger to a greater extent than the nearby small squares, and have become smaller to a greater extent on the model's neck. Although the texture mapping effect using the optimal conduction conformal mapping has deformation in terms of angle, the size and distribution of the small squares are very average in the overall effect. In contrast, there are no exaggerated changes in shape and area in the lion's lower jaw, rabbit's ears, face, feet and neck areas.
Claims
1. An optimal conductive area-preserving texture mapping method for scanning a three-dimensional model, characterized in that: The texture mapping of three-dimensional surfaces is realized based on the optimal conduction area-preserving parameterization. The information of the surface itself is simplified by using the triangular meshing of the target surface, and the surface is parameterized to the plane parameter domain through the balanced mapping with the minimum elastic potential energy. The texture coordinates obtained by further optimal conduction area-preserving mapping and the texture image are aligned to realize texture mapping. It is divided into the following three parts: P1-parameterize the target 3D model to the unit disk through the balanced mapping with the minimum elastic potential energy: first obtain the 3D model, and triangulate the 3D model through CAD or 3D scanner. For some closed zero-deficient 3D grid models without boundaries, segment the model into a single boundary model through segmentation. Then, for the pre-processed 3D grid model, the 3D grid data is parameterized to the plane unit disk through the balanced mapping with the minimum elastic potential energy, in preparation for further optimal conduction area-preserving mapping; the balanced mapping with the minimum elastic potential energy includes boundary extraction and the balanced mapping with the minimum elastic potential energy from the curved surface to the plane. P2-Optimal conduction, i.e. area-preserving mapping, is performed on the data parameterized to the plane parameter domain: Discrete optimal conduction includes discrete conduction initialization, optimal conduction mapping, initialization height energy, calculation of power graph, calculation of hyperplane matrix, and further optimal conduction area-preserving mapping is performed through Newton iteration method to obtain the texture coordinates corresponding to each point on the three-dimensional model after the correct area-preserving mapping; P3-Texture coordinate registration: Realize the texture coordinate registration between texture images and 3D models, realize the binding of texture images to 3D models, display textures through OpenGL, and make one-to-one correspondence between the parameterized texture coordinates and the coordinates of the texture images that need to be mapped to realize texture mapping.
2. The optimal conduction area-preserving texture mapping method for three-dimensional model scanning according to claim 1, characterized in that: Balanced mapping with minimum elastic potential energy: The texture map is parameterized. The balanced mapping with minimum elastic potential energy keeps the topological structure of the three-dimensional model unchanged after parameterization and minimizes the topological deformation. Based on elastic mechanics, the elastic potential energy of the grid is minimized. Assume that M is a facial epidermis made of rubber, and N is a hard, non-deformable, smooth sphere. The facial epidermis is put on N. The processing method is defined as mapping: p: M→N. When it is determined that M is in contact with the sphere everywhere, M adjusts itself so that it is attached to the surface of the sphere and is in an equilibrium position. At this time, the shape of the epidermis on the sphere no longer changes, and the elastic potential energy at this time reaches the minimum. At this time, the mapping p is called the equilibrium mapping with the minimum elastic potential energy. The balanced mapping parameterization with the minimum elastic potential energy of the triangular mesh is to first fix the boundary of the triangular mesh to the boundary of the plane polygon, and determine the position of the boundary point of the triangular mesh on the polygon boundary according to the ratio of the boundary length of the triangular mesh to the total boundary length. At this time, each edge of the triangular mesh is regarded as made of rubber, and each edge naturally adjusts itself to minimize the elastic potential energy. The corresponding vertex of the triangular mesh inside the plane polygon is determined by minimizing the elastic potential energy of the entire triangular mesh. The n boundary points x1,…,x on the triangular mesh model S(G,X) are n As the boundary points mapped to the selected plane area, these boundary points are mapped to a planar n-gon The boundary points of the plane polygon P are selected by including the n-gon in a circle, that is, placing the n vertices on a circle, and making the length of the line segment connecting the two corresponding adjacent boundary points on the grid surface boundary proportional to the central angle of the circle corresponding to the two adjacent vertices of the plane n-gon, or directly setting the plane n-gon P to a square, a circle, an equilateral triangle or other convex polygon; The grid surface S is regarded as a surface made of rubber. Each edge in the edge set E is also a stretchable rubber. The deformation energy of the vertices on the target surface S mapped to the plane parameter domain P is: where u i ,u j are the projection points of the two nodes connecting the edge (i, j) on the two-dimensional plane P, and the positions of the points on the surface boundary have been calculated and fixed, k ij is the elastic coefficient of edge (i, j), ensuring that the length of each edge in the initial grid S and the shape of the adjacent faces do not change too much. ij Take it as: Define a discrete energy function from the perspective of continuous Dirichlet energy and minimize the energy to get the result: In the formula, k1 and k2 are the other two vertices of the two adjacent faces of edge (i, j), and α and β represent the other two angles that are independent of edge (ij). ij represents the length of edge (ij), A ijk represents the area of the triangle f(i, j, k), and k ij Taken as the average elastic modulus; So that the energy equation 1E harm (u) is the smallest, then it is transformed into: Δ PL f(u i )=∑ (i,j)∈E k ij (f(u j )-f(u i )) Equation 4 When Δ PL When f≡0, the deformation energy is minimized; Get the corresponding coordinates of all vertices in the grid surface S mapped to the plane P. The specific solution is as follows: Assume that after a triangular mesh surface S is mapped to a plane P, the five vertices of P are set to u1(u1v1), u2(u2v2), u5(u5v5), u6(u6v6), u7(u7v7) in sequence, and u1, v1, u2, v2, u5, v5, u6, v6, u7, v7 are known values, u1(u1v1), u2(u2v2), u5(u5v5), u6(u6v6), u7(u7v7) are fixed on the plane P as boundary points in equal proportions during initialization, and the coordinate values of these points are determined. Let f(u) be the position of a point u on the triangular mesh surface on the plane P, f(u1), f(u2), f(u5), f(u6).f(u7) be the positions of known points, and f(u3) and f(u4) be unknown points inside the mesh; According to formula 1, the formula at u3 is expressed as: k 31 (f(u1)-f(u3))+k 32 (f(u2)-f(u3))+k 37 (f(u7 - f(u3))+k 35 (f(u5)-f(u3))+k 34 (f(u4)-f(u3)) = 0 Equation 5 It should be noted that there seems to be a possible error in the expression in where it says "u7 - f(u3)" which might be a typo. If it was meant to be something like "f(u7)-f(u3)", the translation would be more straightforward. This formula is transformed into: (k 31 +k 32 +k 37 +k 35 +k 34 )f(u3)-k 34 f(u4) = (k 31 f(u1)+k 32 f(u2)+k 37 f(u7)+k 35 f(u5)) Equation 6 In equation 6, all the information on the right side of the equal sign is known. The linear equations about f(u3) and f(u4) are listed. The coefficient matrix of the linear equations is a large sparse matrix. The sparse matrix is processed by the Eigen library. f(u i ) is represented by u i The coordinate position of this point on plane P, the sparse matrix is simplified to two sparse matrices on the plane about (u, v) on plane P, where the left side of equation 7 uses k ij The matrix represented is set to A, then the right side of equation 6 is set to U matrix and V matrix, u, v represent the coordinate matrices of all unknown points, and we get: Solve this system of equations to obtain the coordinates of the unknown points.
3. The optimal conduction area-preserving texture mapping method for three-dimensional model scanning according to claim 2, characterized in that: Boundary extraction: If the given 3D model is a closed triangular mesh with a genus of 0, the triangular mesh needs to be cut, the cutting line is set as the boundary, and then the cutting boundary of the mesh is proportionally mapped to the position associated with the parameter domain boundary of the plane according to the order of the cut side lengths. For closed 3D models, Openflipper is used for manual cutting.
4. The optimal conduction area-preserving texture mapping method for three-dimensional model scanning according to claim 2, characterized in that: Equilibrium mapping with minimum elastic potential energy from curved surface to plane: Discrete surface is approximated by triangular grid. Assume that the triangular grid of the surface is represented by M, and the vertex on the grid defines function f: M→R point p is a triangle on the triangular grid [v i , v j , v k ] is a point inside the triangle, where point p is represented by three vertices v i , v j , v k A linear combination of: p=λ i v i +λ j v j +λ k v k formula 8 And (λ i ,λ j ,λ k ) is the centroid coordinate of point p and satisfies λ i +λ j +λ k =1, the centroid coordinates are calculated as follows: Where A([p,v j , v k ]) indicates p, v j , v k The area of the enclosed triangle, function f is expressed as a linear combination function: f(p)=λ i f(v i )+λ j f(v j )+λ k f(v k ) formula 10 By direct calculation, the harmonic energy of the mapping is expressed as: where w ij Represents the edge [v i , v j ], assuming that the weight of the edge [v i , v j ]The two adjacent triangles are [v i , v j , v k ] and [v i , v j ,v1],θ k and θ1 are the two triangles with v k The vertex angle of and v1, the edge weight is expressed as: The boundary side has only one adjacent triangle, and only one cotangent of the opposite angle is used. The corresponding equation is: The calculation of the equilibrium map with the minimum elastic potential energy is a linear equation system, and the calculation algorithm is as follows: Algorithm 1: Balanced mapping with minimum elastic potential energy Input: a surface triangular mesh M with zero-genus single boundary, in the form of a .m mesh file; 1) Traverse the boundary of the surface triangular grid and obtain the boundary point sequence (v1, v2, ..., v n-1 ); 2) Set the image points of the boundary vertices on the plane: 3) Traverse all edges and calculate the corresponding weight w ij ; 4) For all internal points, construct the discretized Laplace equation for all its adjacent points 5) Solve the linear system to obtain the image point of the internal point; Output: Equilibrium map of the surface grid with the minimum elastic potential energy on the plane 5. The optimal conduction area-preserving texture mapping method for three-dimensional model scanning according to claim 1, characterized in that: Discrete optimal conduction: Assume that μ has compact support Ω on space X, where Ω is a convex region on X, defined as Ω = Suppμ = {x∈X|μ(x) > 0}, and space Y is split into Y = (v1,v2,…,v n-1 ); Define a height vector Contains n real numbers, for each y i ∈Y, let a hyperplane be defined on X as: π i (h): <x,y i >+h i =0, where <, > is defined as The inner product on , the potential energy function is defined as: u h (x):max i {〈x,y i 〉+h i} Equation 15 Let G(h) represent a supported plane π i (h) is an open convex polyhedron, and the projection of G(h) on the partial area of Ω is several polygons. Each cell corresponds to the polygon W i (h) is the projection of a face of the convex polyhedron G(h) on Ω; Convex function u h In each cell W i (h) is a linear function π i (h), the gradient map is: grad u h :W i (h)→y i , i = 1, 2, ..., n, Equation 16 The mapping makes each W i (h) corresponds to an independent point y i , it is agreed that for any given metric μ,v j >0, j=1,…,n, satisfies Then there must be a height vector h that is uniquely determined by adding a constant vector (c,c,…,c), and the convex function u h Induce the decomposition of the cells on Ω, and all the cells satisfy the following area-preserving constraints: Furthermore, the gradient u of the gradient map h Optimize the following conduction cost: E(T):=∫ Ω |x - T(x)| 2 u(x)dx. Equation 18 The global optimal conduction problem is solved by Newton's method, the steps are as follows: First, define a space where height vectors exist: Then, define the energy E(h) as the volume of the polyhedron enclosed by the cylinder generated by G(h) and Ω and subtract a linear term: Then the gradient energy is: Assume that the cell cavity W i (h) and W j (h) The intersection is e on one edge ij =W i (h)∩W j (h)∩Ω, the hyperplane matrix of E(h) is: H0 is convex, the hyperplane matrix is positive definite on H0, the global unique minimum h is an iteration point on H0, and the gradient map gradu h The measure-preserving constraint is satisfied, and further, the gradient mapping is the optimal conduction mapping.
6. The optimal conduction area-preserving texture mapping method for three-dimensional model scanning according to claim 1, characterized in that: Discrete conduction initialization: First, the three-dimensional grid surface is parameterized to a plane, and the result is normalized to a unit disk. This step of parameterization uses a balanced map with the minimum elastic potential energy, and then a target area is assigned to each point on the disk. Define u(v i ) for each point v i The Dirac metric of ∈V is one third of the area of all triangles corresponding to the edges connected to the point: Where [v i ,v j ,v k ] indicates that the triangle is composed of v i ,v j ,v k Consists of three points.
7. The optimal conduction area-preserving texture mapping method for three-dimensional model scanning according to claim 1, characterized in that: Optimal conduction mapping: We need to find a final height vector h = (h1, h2, ..., h n ), first fix a height vector, the hyperplane is composed of π i (h) gives π i (h): <x,y i 〉+h i , the convex function is: u h (x) = max i {<c, y i 〉 + h i} Equation 24 Denote G(h) as the support plane π i The upper envelope of (h), the region where the projection of G(h) generates Ω is a number of polygonal regions Keep the area of each cell W i The virtual variables of each vertex are updated iteratively, that is, the height vector h = (h1, h2, ..., h n ), in each iteration, first calculate the power diagram, by taking each vertex as a point, and taking the weight radius of each vertex as the power of the diagram, and then calculate the dual triangulation of the calculated power diagram, record the length of each edge in the power diagram and the corresponding dual triangulation to generate the hyperplane matrix, solve the gradient energy equation by Newton's method, and update the height energy h = (h1,h2,…,h n ) until each cell cavity is satisfied Less than the set δw, and finally update the position of each vertex as the center of the power Voronoi diagram to obtain the parameterized area-preserving result.
8. The optimal conduction area-preserving texture mapping method for three-dimensional model scanning according to claim 1, characterized in that: Initialize height energy: In the initialization stage, we ensure that every point in the point set Y is in Ω by changing the scale or by displacement transformation, and then calculate the Voronoi diagram with power weights of 0. i =-1 / 2||y i || 2 , where ||y i || 2 is the position of a point in the plane region, ensuring that every cell is non-empty.
9. The optimal conduction area-preserving texture mapping method for three-dimensional model scanning according to claim 1, characterized in that: Calculation of power graph: The area-preserving calculation of the Ω region based on optimal conduction is equivalent to the computational geometric power graph. Given a point set Y = {y1, y2, …, y n }, each point y i will be associated with a value w i As the power of that point, from any point x to y i The power distance is defined as: The cell cavity area is: w i = 2h i + <y i ,y i 〉 Equation 26 The cell cavity area was calculated from the power map.
10. The optimal conduction area-preserving texture mapping method for three-dimensional model scanning according to claim 1, characterized in that: Calculation of the hyperplane matrix: using gradient energy Indicates changes in the cell cavity here As weights, the gradient is then found by calculating the dual triangulation and cell area: Calculate each edge e in the power graph ij and the corresponding dual edge Then generate the hyperplane matrix H(h) = (h ij (h)), where: where h ij is the value at matrix position (i, j); Then use Newton's method to update the height vector: Where ε represents the step size. During the calculation process, ensure that all cells W i (h)∩Ω are all non-empty. Assume that all cells are non-empty at step k, but are updated at step k+1: If some cells in the power diagram have h k+1 If it is empty, it will return to h k , and reduce the step size from ε to 1 / 2ε, then recalculate. If there are still some empty cells, reduce ε again until all power cells are not 0; Let F be the domain (for elementary purposes, let F be ), n-dimensional space F n The hyperplane in is given by the equation: a1x1+…+a n x n = b Equation 31 The defined subset must satisfy a1,…,a n ∈F is a constant that is not entirely zero.
Citation Information
Patent Citations
Texture mapping method based on triangular mesh simplification
CN104680573A
Curved surface discrete point cloud model girdling tool path generation method based on harmonic mapping
CN110516388A
Commodity data display method based on digitization
CN117764686A
Method, device and computer readable storage medium for generating volume foliation
US20210358208A1
Method for implementing conversion of two-dimensional image to three-dimensional scene based on ar
WO2018040511A1
Cited By
Conformal periodic flattening method with deficit curved surface
CN118864232A
