A Planar Shape Mapping Method

By constructing a triangular grid structure in the plane shape domain, using the gridless method to represent the mapping function, and solving it through segmented linear approximation and iterative numerical methods, the problems of unsmooth mapping and low computational efficiency in the existing technology are solved, and the mapping is achieved Smooth natural and efficient calculations of plane shape mapping.

CN114170064BActive Publication Date: 2024-11-19HANGZHOU JINGTU TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010956190.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-11
Publication Date
2024-11-19
Estimated Expiration
2040-09-11

AI Technical Summary

Technical Problem

The existing plane shape mapping methods cannot ensure smooth and natural mapping, inefficient computing, and are prone to local self-intersection.

Method used

Use triangular mesh division with boundary constraints, set the radial basis function sampling center point and control point, calculate the geodesic distance field, construct the energy equation of the plane shape, and solve the mapping function through segmented linear approximation and iterative numerical methods to ensure that The smooth and natural and computational efficiency of the mapping results.

Benefits of technology

The smooth natural results of plane shape mapping are realized, the calculation efficiency is improved, and the local self-intersection phenomenon is avoided. The method is simple, efficient and easy to promote.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114170064B_ABST
    Figure CN114170064B_ABST
Patent Text Reader

Abstract

The present invention provides a planar shape mapping method, which constructs a triangular mesh structure in a planar shape domain, adopts a meshless method to represent a mapping function, and performs approximate discretization processing on the deformation energy in the mapping function by adopting a piecewise linear approximation method. Meanwhile, the local non-flipping constraint in the mapping function is controlled, so that the calculation framework thereof follows the traditional mesh domain method, and the calculated mapping result is smooth and natural without local self-intersection. The method of the present invention is simple, efficient, highly controllable, and easy to promote.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of graphics and image processing, and in particular to a plane shape mapping method. Background Art

[0002] Currently, there are two commonly used planar shape mapping methods: grid method and gridless method.

[0003] The grid method is to divide the plane shape into discrete grids and express the mapping as a piecewise linear function, and then use the geometric optimization method to solve it. This method can flexibly control various forms of deformation errors, but its mapping function is inherently non-smooth due to the piecewise linear characteristics. In order to obtain a relatively smooth visual mapping, the discrete grid needs to be encrypted, which reduces the computational efficiency.

[0004] The meshless method usually uses a linear mixed smooth radial basis function to represent the mapping function, so it has an analytical form and its natural smoothness makes it popular. For example, the commonly used radial basis function method often considers less the control of mapping deformation error in practical applications, resulting in large deformation distortion and even local self-intersection. Although some methods consider the control of deformation error, their numerical calculation methods are relatively complex and time-consuming, affecting the real-time performance of mapping calculations. Summary of the invention

[0005] In view of the above-mentioned shortcomings of the prior art, the object of the present invention is to provide a planar shape mapping method for solving the problems in the prior art that the planar mapping cannot be smooth and natural, the calculation efficiency is low, and there are local self-intersections.

[0006] The present invention provides a planar shape mapping method, the method comprising the following steps:

[0007] Triangulate the interior of a planar shape with boundary constraints;

[0008] A plurality of radial basis function sampling center points are set at the boundary and inside of the plane shape to obtain a sampling center set C, and a plurality of control points are set at the boundary and inside of the plane shape to obtain a control point set P;

[0009] Taking each radial basis function sampling center point in the sampling center set C as a source point, calculating the geodesic distance from each radial basis function sampling center point to all mesh vertices in the triangular mesh, and obtaining a geodesic distance field;

[0010] Move the control point set P to the target point set Q;

[0011] Substituting the geodesic distance field into a smooth radial basis function, and constructing an energy equation for planar shape mapping according to a control point set P and a target point set Q;

[0012] The energy equation is approximately discretized by using a piecewise linear approximation method to obtain a first equation;

[0013] The first equation is solved by an iterative numerical method to obtain a mapping function of the plane shape.

[0014] In one embodiment of the present invention, the triangulation of the interior of the planar shape with boundary constraints includes:

[0015] The Delaunay triangulation method is used to triangulate the interior of the planar shape.

[0016] In one embodiment of the present invention, taking each radial basis function sampling center point in the sampling center set C as a source point, calculating the geodesic distance from each radial basis function sampling center point to all mesh vertices of the triangular mesh includes:

[0017] The heat kernel method is adopted, with each radial basis function sampling center point in the sampling center set C as a source point, to calculate the geodesic distance from each radial basis function sampling center point to all mesh vertices in the triangular mesh.

[0018] In one embodiment of the present invention, the energy equation is expressed as:

[0019]

[0020] Where, f is a two-dimensional plane mapping function;

[0021] E d is the deformation energy;

[0022] E f Constrain energy for control points;

[0023] ω is a constant coefficient;

[0024] det(·) is the determinant operator;

[0025] is the deformation gradient.

[0026] In one embodiment of the present invention, the deformation energy is expressed as:

[0027]

[0028] Among them, A Ω is the total area of ​​the plane shape;

[0029] D(·) is the deformation metric function.

[0030] In one embodiment of the present invention, the expression of the control point constraint energy is:

[0031]

[0032] Among them, d max is the mesh’s bounding box diameter;

[0033] n is the number of control points;

[0034] p i are the control points in the control point set P;

[0035] q i are the target points in the target point set Q.

[0036] In one embodiment of the present invention, the expression of the two-dimensional plane mapping function is:

[0037]

[0038] Among them, u is the coordinate of any point in the plane space, and m is the number of radial basis function sampling center points;

[0039] φ(r) is the smooth radial basis function;

[0040] r i is the geodesic distance from the i-th radial basis function sampling center point to point u;

[0041] λ i =(λ i 1 ,λ i 2 ) T ∈R 2×1 is the basis function coefficient;

[0042] A is a 2×2 coefficient matrix;

[0043] t is a constant coefficient vector.

[0044] In one embodiment of the present invention, the step of approximately discretizing the energy equation using a piecewise linear approximation method includes:

[0045] The deformation energy is first discretized, and then the discretized deformation energy is approximated using a piecewise linear approximation method to obtain a first equation, wherein the expression of the first equation is:

[0046]

[0047] Wherein, the triangular mesh includes N mesh vertices and M triangle units;

[0048] A M is the total area of ​​the triangular mesh;

[0049] M is the number of triangles used to divide the plane shape;

[0050] A i is the area of ​​the triangular unit;

[0051] For each triangle T i The mean gradient of the deformation function on .

[0052] In one embodiment of the present invention, the gradient mean It can be expressed as a linear Jacobian matrix function, expressed as

[0053]

[0054] Among them, u i,j (j=1,2,3) is a triangle T i The coordinates of the three vertices;

[0055] f(u i,j ) is the vertex u i,j The new coordinates after mapping.

[0056] In one embodiment of the present invention, the adopting an iterative numerical method to solve the first equation includes:

[0057] The first equation is converted into an unconstrained nonlinear optimization problem to form a new optimization objective function, and a nonlinear iterative numerical method is used to solve it. The coefficients <λ, A, t> in the two-dimensional plane mapping function and the optimization objective function value are iteratively updated until the optimization objective function converges, thereby obtaining a mapping function of a plane shape.

[0058] As described above, a planar shape mapping method of the present invention constructs a triangular mesh structure in the planar shape domain, adopts a meshless method to represent the mapping function, and approximates the discretization of the deformation energy in the mapping function by piecewise linear approximation. At the same time, the no-flip constraint in the mapping function is controlled, so that its calculation framework follows the traditional mesh domain method, and the calculated mapping results are smooth and natural. The method of the present invention is simple, efficient, highly controllable, and easy to promote. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] Figure 1 It is a schematic flow chart of the planar shape mapping method in the first embodiment of the present invention.

[0060] Figure 2 It is a schematic diagram of a first planar shape in the first embodiment of the present invention.

[0061] Figure 3 Display as Figure 2 Schematic diagram of the sampling center set distribution.

[0062] Figure 4 Display as Figure 2 Schematic diagram of the control point set distribution.

[0063] Figure 5 Display as Figure 2 Schematic diagram of texture mapping.

[0064] Figure 6 It is a schematic diagram showing a second planar shape in the first embodiment of the present invention.

[0065] Figure 7 Display as Figure 6 Schematic diagram of texture mapping.

[0066] Figure 8 It is a schematic diagram of a third planar shape in the first embodiment of the present invention.

[0067] Fig. 9 Display as Figure 8 Schematic diagram of texture mapping. DETAILED DESCRIPTION

[0068] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.

[0069] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and thus the drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.

[0070] See also Figure 1 The first embodiment of the present invention relates to a planar shape mapping method, which is as follows:

[0071] Step 101, performing triangular meshing with boundary constraints on the interior of the plane shape.

[0072] Specifically, the boundary of the planar shape is sampled, and the interior of the planar shape is divided into a triangular mesh using Delaunay triangulation with shape boundary sampling point constraints, wherein the triangular mesh includes N mesh vertices (V) and M triangle units (F), wherein the mesh vertex includes coordinate information and subscript information, and the triangle unit includes subscript information of three vertices.

[0073] See also Figure 2 , Figure 2 The first plane shape in the figure is a human model, in which mesh vertices and triangle units together constitute an initial triangular mesh subdivision schematic diagram.

[0074] Step 102, multiple radial basis function sampling center points are set at the boundary and inside of the plane shape to obtain a sampling center set C, and multiple control points are set at the boundary and inside of the plane shape to obtain a control point set P.

[0075] Specifically, by interactively setting, multiple radial basis function sampling center points are set at the boundary and inside of the plane shape to obtain a sampling center set C, where the sampling center set C = {c1, c2, ..., c m}.

[0076] By interactively setting multiple control points on the boundary and inside of the plane shape, a control point set P is obtained, where the control point set P = {p1, p2, ..., p n}.

[0077] See also Figure 2 In the simulation environment, according to the triangular mesh (S) constructed after meshing the first plane shape, multiple radial basis function sampling center points and control points are interactively set on the boundary and inside of the triangular mesh by clicking the mouse, so as to realize the plane shape mapping driven by dragging the control points with the mouse. Due to the requirement of calculation accuracy, the number of triangular meshes can be within 1,000. Figure 2 In the triangular mesh subdivision schematic diagram shown, the number of vertices of the triangular mesh is 233.

[0078] The triangular mesh has 349 triangular units, each of which is composed of 3 mesh vertices. Each mesh vertex can be denoted as Vi, where the subscript i=0, 1, 2, ..., 999. All mesh vertices and triangular units are stored in two matrix objects respectively.

[0079] In this implementation, the method for determining the sampling center set C and the control point set P may be as follows:

[0080] When the sampling center mode is selected, the input points are all radial basis function sampling center points. In this mode, input point c1, point c2, point c3, point c4... in sequence to obtain the sampling center set C;

[0081] When the control point mode is selected, the input points are all control points. Specifically, in this mode, by inputting point p1, point p2, point p3, point p4, etc. in sequence, the control point set P can be obtained.

[0082] Step 103: Taking each radial basis function sampling center point in the sampling center set C as a source point, the geodesic distance from each radial basis function sampling center point to all mesh vertices in the triangular mesh is calculated to obtain a geodesic distance field.

[0083] Specifically, each radial basis function sampling center point in the sampling center set C is taken as the heat source center, and the heat kernel method is used to calculate the geodesic distance (r) from each radial basis function sampling center point to all mesh vertices in the triangular mesh to obtain the geodesic distance field.

[0084] It should be noted that when using the thermal motion equation to calculate the geodesic distance on a triangular mesh, since the sampling center of the mouse interaction may not coincide with the mesh vertex, the barycentric coordinates need to be used for accurate approximation during the calculation, that is,

[0085] r=λ1r1+λ2r2+λ3r3

[0086] Among them, λ1, λ2 and λ3 represent the centroid coordinates of the triangular unit where each radial basis function sampling center point is located, and r1, r2 and r3 represent the geodesic distances between each radial basis function sampling center point and each vertex of the triangular unit where each radial basis function sampling center point is located.

[0087] Step 104: Move the control point set P to the target point set Q.

[0088] Specifically, according to the position of the initial control points on the plane shape, each control point is moved to a new position by dragging the mouse to form a target point set Q;

[0089] See also Figure 3 , Figure 3 The square in the figure indicates the sampling center set C.

[0090] See also Figure 4 , Figure 4 The dots in are indicated as the control point set P, where the arrow direction indicates the moving direction of each control point.

[0091] Step 105: Substitute the geodesic distance field into the smooth radial basis function, and construct an energy equation for planar shape mapping based on the control point set P and the target point set Q.

[0092] Specifically, Figure 2 The two-dimensional plane mapping function in can be expressed as:

[0093]

[0094] Among them, u is the coordinate of any point in the plane space, and m is the number of control points;

[0095] φ(r) is the smooth radial basis function;

[0096] r i is the geodesic distance;

[0097] λ i =(λ i 1 ,λ i 2 ) T ∈R 2×1 is the basis function coefficient;

[0098] A is the coefficient matrix;

[0099] t is a constant coefficient vector.

[0100] It should be noted that the smooth radial basis function φ(r) is usually selected as the radial basis function. Common radial basis functions include: φ(r)=r 2 lnr, Among them, r is a user-selected parameter;

[0101] The radial basis function can also use a local compact support function. in, d is the distance from the point to the sampling center, r max is the maximum radius of the affected area;

[0102] In this implementation, the radial basis function uses a local compact support function, where d is the distance from each mesh vertex to the radial basis function sampling center point. The default value of r in this implementation is max =0.5d max .

[0103] To continue, the geodesic distance field is substituted into the smooth radial basis function φ(r), and the energy equation of the planar shape mapping is constructed according to the control point set P and the target point set Q. The expression of the energy equation is:

[0104]

[0105] Among them, ω is a constant coefficient, which is used to balance the deformation energy and the control point constraint energy so that it can satisfy the control point constraint as much as possible.

[0106] In this implementation, the value range of ω is 100 to 100000. Figure 2 In the original plane shape, the weight is 1000;

[0107] Maximum radius r max=0.5d max ;

[0108] det(·) is a determinant operator, and its corresponding constraint is to prevent local flipping of the mapping;

[0109] is the deformation gradient.

[0110] Further explanation:

[0111] E d is the deformation energy, expressed as:

[0112] E f is the control point constraint energy, the expression is:

[0113] Where f is a smooth two-dimensional plane mapping function f:Ω→R without local flipping 2 , the mapping can be obtained by solving the above energy equation;

[0114] A Ω is the total area of ​​the plane shape;

[0115] D(·)= is a deformation metric function, which can be set as a symmetric Dirichlet deformation energy function in this embodiment, and the specific expression is: where ||*|| F is the F-norm.

[0116] is the deformation gradient;

[0117] d max is the mesh bounding box diameter, which is used to eliminate the influence of mesh size on the energy function;

[0118] n is the number of control points;

[0119] p i are the control points in the control point set P;

[0120] q i are the target points in the target point set Q.

[0121] Step 106: Approximately discretize the energy equation using a piecewise linear approximation method to obtain a first equation.

[0122] Specifically, in order to improve the computational efficiency, the deformation energy E is calculated by combining the discretization idea of ​​the grid method. d Discretization is performed, that is, according to the triangular mesh, the deformation energy of each triangular unit is constructed and accumulated, then the deformation energy E d It can be expressed as:

[0123]

[0124] Among them, A M is the total area of ​​the triangular mesh;

[0125] M is the number of triangles used to divide the plane shape;

[0126] A i is the area of ​​the triangular unit;

[0127] For each triangle T i The mean gradient of the deformation function on .

[0128] Then, the linear approximation idea of ​​the grid method is used to approximate the discretized deformation energy, that is, the mapping function inside the triangle is approximated as a linear distribution, so that the deformation gradient becomes a constant vector, and the deformation error is evenly distributed inside the triangle. The discretized and approximated deformation energy equation is recorded as the first equation, and the expression of the first equation is:

[0129]

[0130] Further explanation, the gradient mean It can be expressed as a linear Jacobian matrix function, expressed as

[0131]

[0132] Among them, u i,j (j=1,2,3) is a triangle T i The coordinates of the three vertices;

[0133] f(u i,j ) is the vertex u i,j The new coordinates after mapping.

[0134] Step 107: using an iterative numerical method to solve the first equation to obtain a mapping function of the plane shape.

[0135] Specifically, since the symmetric Dirichlet deformation energy function implies the inequality constraint in the first equation Therefore, the optimization equation can be transformed into an unconstrained optimization problem.

[0136] The computational framework of the SLIM (Scalable Locally Injective Mappings, iterative minimization) method is adopted to transform the first equation into an unconstrained nonlinear optimization problem to form a new optimization objective function. The nonlinear iterative numerical method is then used to numerically solve the first equation. Through the idea of ​​alternating iteration, the coefficients <λ,A,t> in the two-dimensional plane mapping function are continuously updated until the optimization objective function converges, thereby obtaining the mapping function of the plane shape.

[0137] The computational framework of the SLIM method is adopted. Its algorithmic idea is to construct a proxy energy function with a simple form that supports local or global alternating iterative optimization when solving the problem, such as the classic ARAP (As-Rigid-As-Possible, deformation algorithm) weighted form, so that it meets certain conditions and is similar to the original nonlinear energy function in properties and behavior, such as the symmetric Dirichlet energy. The original energy function is minimized by solving a simple proxy function through alternating optimization.

[0138] It should be noted that each iteration mainly implements the following three steps:

[0139] a. Update the agent energy function;

[0140] b. Solve for the extreme value of the proxy energy function;

[0141] c. Update variables through local line search.

[0142] In each iteration, the position coordinates of the mesh vertices are updated, and the energy function value is updated according to the position coordinates. This cycle is repeated until the energy function value converges and the iteration is terminated. Finally, the optimal mapping function f:Ω→R is obtained. 2 , calculate the final position coordinates of the mesh vertices.

[0143] In this embodiment, when the number of iterations reaches 15, the energy function value tends to be stable.

[0144] See also Figure 5 , Figure 2 After the first plane shape in is processed by the plane shape mapping method in this embodiment, the following is obtained: Figure 5 Schematic diagram of texture mapping shown.

[0145] See also Figure 6 and Figure 7 , Figure 6 The second plane shape processed by this embodiment is shown. After being squeezed from the periphery of the disk to the inner center in the direction of the arrow, the second plane shape will be obviously mapped. Figure 7 The figure shows a schematic diagram of texture mapping after the second plane shape is mapped, which is relatively smooth and natural.

[0146] See also Figure 8 and Fig. 9 , Figure 8 The third plane shape processed by this embodiment is shown. After the square disk is twisted in the direction of the arrow, the third plane shape will be obviously mapped. Fig. 9 The figure shows a schematic diagram of texture mapping after the third plane shape is mapped, which is relatively smooth and natural.

[0147] It can be seen that this embodiment combines the discretization of the grid method and the approximate idea to process the deformation energy, which can improve the speed of equation calculation, and the iterative numerical method can prevent local flipping in the mapping, making the mapped graphics smoother and more natural.

[0148] A second embodiment of the present invention relates to a storage medium having a computer program stored thereon, and when the program is executed by a processor, any one of the methods described in the first embodiment is implemented.

[0149] In summary, a planar shape mapping method of the present invention constructs a triangular mesh structure in the planar shape domain, uses a meshless method to represent the mapping function, and uses a piecewise linear approximation method to approximate discretization of the deformation energy in the mapping function, while controlling the non-flipping constraint in the mapping function, so that its calculation framework follows the traditional mesh domain method, and the calculated mapping result is smooth and natural; the method of the present invention is simple and efficient, has strong controllability, and is easy to promote. Therefore, the present invention effectively overcomes various shortcomings in the prior art and has a high industrial utilization value.

[0150] The above embodiments are merely illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Anyone familiar with the art may modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by a person of ordinary skill in the art without departing from the spirit and technical concept disclosed by the present invention shall still be covered by the claims of the present invention.

Claims

1. A planar shape mapping method, It is characterized in that The method comprises the following steps: Perform triangulated meshing with boundary constraints on the interior of the plane shape of the character model; A plurality of radial basis function sampling center points are set at the boundary and inside of the plane shape of the character model to obtain a sampling center set C, and a plurality of control points are set at the boundary and inside of the plane shape of the character model to obtain a control point set P; Taking each radial basis function sampling center point in the sampling center set C as a source point, calculating the geodesic distance from each radial basis function sampling center point to all mesh vertices in the triangular mesh, and obtaining a geodesic distance field; Move the control point set P to the target point set Q; Substitute the geodesic distance field into the smooth radial basis function, and construct the energy equation of the plane shape texture mapping of the character model according to the control point set P and the target point set Q; the expression of the energy equation is: Where f is a two-dimensional plane mapping function; E d is the deformation energy; E f is the control point constraint energy; ω is a constant coefficient; det(·) is the determinant operator; is the deformation gradient; The expression of the deformation energy is: Among them, A Ω is the total area of ​​the plane shape of the character model; D(·) is the deformation measurement function; The expression of the control point constraint energy is: Among them, d max is the mesh bounding box diameter; n is the number of control points; p i are the control points in the control point set P; q i are the target points in the target point set Q; The expression of the two-dimensional plane mapping function is: Where u is the coordinate of any point in the plane space, m is the number of sampling center points of the radial basis function; φ(r) is the smooth radial basis function; r i is the geodesic distance from the i-th radial basis function sampling center point to point u; is the basis function coefficient; A is a 2×2 coefficient matrix; t is a constant coefficient vector; The energy equation is approximately discretized by piecewise linear approximation, including: The deformation energy is first discretized, and then the discretized deformation energy is approximated by piecewise linear approximation to obtain a first equation, wherein the expression of the first equation is: The triangular mesh includes N mesh vertices and M triangle units; A M is the total area of ​​the triangular mesh; M is the number of triangles that the plane shape of the character model is divided into; A i is the area of ​​the triangular unit; For each triangle T i The mean gradient of the upper deformation function; The gradient mean It is approximately expressed as a linear Jacobian matrix function, expressed as Among them, u i,j (j=1, 2, 3) is a triangle T i The three vertex coordinates of f(u i,j ) is the vertex u i,j The new coordinates after mapping; The energy equation is approximately discretized by using a piecewise linear approximation method to obtain a first equation; The first equation is solved by adopting an iterative numerical method to obtain a texture mapping function of the plane shape of the character model, and obtain a texture mapping result of the character model.

2. The planar shape mapping method according to claim 1, It is characterized in that Triangulating the interior of a planar shape with boundary constraints involves: The Delaunay triangulation method is used to triangulate the interior of the planar shape.

3. The planar shape mapping method according to claim 1, It is characterized in that Taking each radial basis function sampling center point in the sampling center set C as a source point, calculating the geodesic distance from each radial basis function sampling center point to all mesh vertices in the triangular mesh includes: The heat kernel method is adopted, with each radial basis function sampling center point in the sampling center set C as a source point, to calculate the geodesic distance from each radial basis function sampling center point to all mesh vertices in the triangular mesh.

4. The planar shape mapping method according to claim 1, It is characterized in that The adopting an iterative numerical method to solve the first equation comprises: The first equation is converted into an unconstrained nonlinear optimization problem to form a new optimization objective function, and a nonlinear iterative numerical method is used to solve it. The coefficients <λ, A, t> in the two-dimensional plane mapping function and the optimization objective function value are iteratively updated until the optimization objective function converges, thereby obtaining a mapping function of a plane shape.