Three-dimensional model fusion method and system and computer program product
By calculating the plane matrix and alignment transformation parameters of non-collinear feature points on the three-dimensional model, spatial transformation and coordinate correction are performed, which solves the problem of low fusion efficiency of the three-dimensional model in the existing technology, realizes automatic fusion and precise alignment, and improves the efficiency of the three-dimensional model. Computational efficiency and model naturalness.
Patent Information
- Application Number
- CN202410815157.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-21
- Publication Date
- 2024-08-23
AI Technical Summary
In the existing technology, 3D model fusion relies on manual operations, which is inefficient and difficult to meet the needs of batch production.
By determining the non-collinear feature points on the three-dimensional model, the plane matrix is calculated, the alignment transformation parameters are obtained, the spatial transformation is performed, and the automatic fusion of the three-dimensional model is realized by correcting the coordinate data.
It realizes automatic alignment and fusion of 3D models, improves efficiency, ensures calculation accuracy, reduces calculation amount, and generates more natural fusion models.
Smart Images

Figure CN118537495A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer graphics technology, and in particular to a three-dimensional model fusion method, system and computer program product. Background Art
[0002] In the application field of computer graphics, it is necessary to make three-dimensional models, including mixing or fusing different three-dimensional models. In the prior art, the fusion of three-dimensional models depends on manual operation of staff, which is inefficient.
[0003] To this end, some embodiments of this specification provide a more efficient three-dimensional model fusion method and system. Summary of the invention
[0004] One or more embodiments of the present specification provide a three-dimensional model fusion method, including: determining a first plane based on three non-collinear feature points on a first three-dimensional model; determining a second plane based on three non-collinear feature points on a second three-dimensional model; the three feature points on the first three-dimensional model correspond one-to-one to the three feature points on the second three-dimensional model; obtaining alignment transformation parameters based on the first plane and the second plane; the alignment transformation parameters are used to characterize the spatial transformation parameters for aligning the second three-dimensional model with the first three-dimensional model; obtaining transformation coordinate data of one or more points of the second three-dimensional model based on the alignment transformation parameters and initial coordinate data of one or more points on the second three-dimensional model; obtaining fused coordinate data of one or more points of the fused three-dimensional model based on the initial coordinate data of one or more points on the first three-dimensional model and the transformation coordinate data of one or more points on the second three-dimensional model.
[0005] According to the method described in one or more embodiments of the present specification, the method of determining the first plane based on three non-collinear feature points on the first three-dimensional model includes: obtaining the plane matrix of the first plane based on the initial coordinate data of the three non-collinear feature points on the first three-dimensional model; the method of determining the second plane based on the three non-collinear feature points on the second three-dimensional model includes: obtaining the plane matrix of the second plane based on the initial coordinate data of the three non-collinear feature points on the second three-dimensional model.
[0006] According to the method described in one or more embodiments of the present specification, the alignment transformation parameters are obtained based on the first plane and the second plane, including: calculating the alignment transformation matrix based on the plane matrix of the first plane and the plane matrix of the second plane, and using the alignment transformation matrix as the alignment transformation parameters; the spatial transformation includes one or more of the following: translation, scaling, and rotation.
[0007] According to the method described in one or more embodiments of this specification, one or more points on the first three-dimensional model correspond one-to-one to one or more points on the second three-dimensional model.
[0008] According to the method described in one or more embodiments of this specification, the first three-dimensional model and the second three-dimensional model have the same point-surface topological structure.
[0009] According to the method described in one or more embodiments of the present specification, the method of obtaining fused coordinate data of one or more points of the fused three-dimensional model based on the initial coordinate data of one or more points on the first three-dimensional model and the transformed coordinate data of one or more points on the second three-dimensional model includes: correcting the transformed coordinate data of one or more points on the second three-dimensional model to obtain corrected coordinate data of one or more points on the second three-dimensional model; calculating the initial coordinate data of one or more points on the first three-dimensional model and the corrected coordinate data of corresponding points on the second three-dimensional model to obtain fused coordinate data of one or more points of the fused three-dimensional model.
[0010] According to the method described in one or more embodiments of the present specification, the transformed coordinate data of one or more points on the second three-dimensional model are corrected to obtain corrected coordinate data of one or more points on the second three-dimensional model, including: determining a first distance value based on initial coordinate data of a midpoint of a first feature point and a second feature point on the second three-dimensional model and initial coordinate data of a third feature point on the second three-dimensional model; determining a second distance value based on transformed coordinate data of a midpoint of the first feature point and the second feature point on the second three-dimensional model and transformed coordinate data of the third feature point on the second three-dimensional model; correcting the transformed coordinate data of one or more points on the second three-dimensional model based on the distance correction value to obtain corrected coordinate data of one or more points on the second three-dimensional model; wherein the distance correction value reflects the ratio of the first distance value to the second distance value.
[0011] According to the method described in one or more embodiments of the present specification, the correction of the transformed coordinate data of more than one point on the second three-dimensional model to obtain the corrected coordinate data of more than one point on the second three-dimensional model includes: determining a first distance value based on initial coordinate data of a midpoint of a first feature point and a second feature point on the second three-dimensional model and initial coordinate data of a third feature point on the second three-dimensional model; determining a second distance value based on the transformed coordinate data of the midpoint of the first feature point and the second feature point on the second three-dimensional model and the transformed coordinate data of the third feature point on the second three-dimensional model; correcting the transformed coordinate data of more than one point on the second three-dimensional model based on the distance correction value to obtain intermediate coordinate data of more than one point on the second three-dimensional model; wherein the distance correction value reflects the ratio of the first distance value to the second distance value; determining a height correction value based on the difference between the initial coordinate data of a first preset point on the first three-dimensional model and the intermediate coordinate data of a second preset point on the second three-dimensional model corresponding to the first preset point; and correcting the intermediate coordinate data of more than one point on the second three-dimensional model based on the height correction value to obtain the corrected coordinate data of more than one point on the second three-dimensional model.
[0012] According to the method described in one or more embodiments of the present specification, the first preset point is a midpoint between a first feature point and a second feature point on the first three-dimensional model.
[0013] According to the method described in one or more embodiments of the present specification, the intermediate coordinate data of one or more points on the second three-dimensional model are corrected based on the height correction value to obtain corrected coordinate data of one or more points on the second three-dimensional model, including: updating the height component in the intermediate coordinate data of one or more points on the second three-dimensional model based on the height correction value to obtain corrected coordinate data of one or more points on the second three-dimensional model.
[0014] According to the method described in one or more embodiments of this specification, the first feature point is the left eye positioning point, the second feature point is the right eye positioning point, and the third feature point is the midpoint of the upper lip.
[0015] According to the method described in one or more embodiments of the present specification, the initial coordinate data of one or more points on the first three-dimensional model and the corrected coordinate data of the corresponding points on the second three-dimensional model are calculated to obtain the fused coordinate data of one or more points of the fused three-dimensional model, including: determining the difference between the initial coordinate data of one or more points on the first three-dimensional model and the corrected coordinate data of the corresponding points on the second three-dimensional model; based on the initial coordinate data of one or more points on the first three-dimensional model and the corresponding difference, obtaining the fused coordinate data of one or more points of the fused three-dimensional model.
[0016] According to the method described in one or more embodiments of the present specification, the fused coordinate data of one or more points of the fused three-dimensional model is obtained based on the initial coordinate data of one or more points on the first three-dimensional model and the corresponding differences, including performing the following processing on each of the more than one points on the first three-dimensional model: calculating the product of the difference corresponding to the point, the first weight value and the second weight value; wherein the first weight value is positively correlated with the degree of fusion of the point, and the second weight value is negatively correlated with the degree to which the point is masked; based on the initial coordinate data of the point and the product, obtaining the fused coordinate data of the point corresponding to the point on the fused three-dimensional model.
[0017] According to the method described in one or more embodiments of the present specification, the second weight value corresponding to the point on the first three-dimensional model and / or the second three-dimensional model that is farther away from the facial area is closer to 0.
[0018] One or more embodiments of the present specification also provide a three-dimensional model fusion system, including: a first plane determination module, used to determine the first plane based on three non-collinear feature points on the first three-dimensional model; a second plane determination module, used to determine the second plane based on three non-collinear feature points on the second three-dimensional model; the three feature points on the first three-dimensional model correspond one-to-one to the three feature points on the second three-dimensional model; a transformation parameter determination module, used to obtain alignment transformation parameters based on the first plane and the second plane; the alignment transformation parameters are used to characterize the spatial transformation parameters for aligning the second three-dimensional model with the first three-dimensional model; a coordinate transformation module, used to obtain transformation coordinate data of one or more points of the second three-dimensional model based on the alignment transformation parameters and initial coordinate data of one or more points on the second three-dimensional model; a fusion module, used to obtain fused coordinate data of one or more points of the fused three-dimensional model based on the initial coordinate data of one or more points on the first three-dimensional model and the transformed coordinate data of one or more points on the second three-dimensional model.
[0019] One or more embodiments of the present specification further provide a computer program product, including computer instructions or a computer program, which, when at least part of the computer instructions or the computer program is executed by a processor, can implement the method described in one or more embodiments of the present specification. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] This specification will be further explained by way of exemplary embodiments, which will be described in detail by way of the accompanying drawings. The same numbers in the drawings represent the same structures or steps.
[0021] Figure 1 It is an example of a three-dimensional model shown in some embodiments of this specification.
[0022] Figure 2 It is an exemplary flow chart of the three-dimensional model fusion method shown in some embodiments of this specification.
[0023] Figure 3 It is a schematic diagram of feature points on a three-dimensional model according to some embodiments of this specification.
[0024] Figure 4 is an exemplary flow chart of the steps of obtaining fused coordinate data according to some embodiments of this specification.
[0025] Figure 5 It is a schematic diagram of the eye height difference between different facial models shown in some embodiments of this specification.
[0026] Figure 6 is an exemplary flow chart of the steps of obtaining corrected coordinate data according to some embodiments of the present specification.
[0027] Figure 7 is an example of a mask model according to some embodiments of the present specification.
[0028] Figure 8 This is an example of a first three-dimensional model and a second three-dimensional model to be fused according to some embodiments of this specification.
[0029] Fig. 9 This is an example of comparison between a fused 3D model obtained by using some embodiments of this specification and a fused 3D model obtained by other methods.
[0030] Fig.10 It is an exemplary block diagram of a three-dimensional model fusion system according to some embodiments of the present specification. DETAILED DESCRIPTION
[0031] In order to more clearly illustrate the technical solutions of the embodiments of this specification, the embodiments will be described in detail below with reference to the accompanying drawings. Obviously, the contents described below are some examples or embodiments of this specification. For ordinary technicians in this field, without paying creative work, the technical solutions or means disclosed in this specification can also be applied to other scenarios based on these technical contents.
[0032] It should be understood that the "system", "device", "unit" and / or "module" used in this specification is a method for distinguishing different components, elements, parts, portions or assemblies at different levels. However, if other words can achieve the same purpose, the words can be replaced by other expressions.
[0033] Unless otherwise specified, technical terms used in this specification to describe components, elements, etc. do not refer to the singular, but may also include the plural. Generally speaking, terms such as "include", "comprise", etc. only indicate that the steps, elements, or components that have been clearly identified are included, and these steps, elements, and components do not constitute an exclusive list, such as the method or device described may also include other steps or components.
[0034] Flowcharts are used in this specification to illustrate the operation steps performed by the device or system of the relevant embodiments, but unless otherwise specified, the order used to describe these steps should not be understood as a limitation on the order in which the steps are performed. A person of ordinary skill in the art can adjust the order in which these steps are performed based on the knowledge and information conveyed by the embodiments of this specification, and the adjustment includes but is not limited to swapping the order, merging multiple steps, and splitting a certain step.
[0035] Computer graphics technology is widely used in movie stunts, virtual reality, animation and video games. In some embodiments of this specification, the shapes in three-dimensional computer graphics are called objects. The shape or outline of an object is often characterized by a three-dimensional model. A three-dimensional model may include multiple points or faces, each of which may include spatial parameters of its position or posture in three-dimensional space. The three-dimensional model may also be referred to as a three-dimensional body. The surface appearance of an object can be described by a material. In some embodiments, a material may include attribute information such as color, metallicity, and glossiness.
[0036] Rendering is a very important technical content in computer graphics technology, which includes the process of drawing objects based on three-dimensional models and surface materials for visual display on display devices. In the application field of computer graphics, there is a need to mix or fuse different three-dimensional models. Taking facial models as an example, by mixing facial models with different expressions or different faces, a facial model with a new expression or face can be obtained. It can be considered that by mixing different three-dimensional models, a large number of new three-dimensional models of the same type but with differences in details can be derived in a short time based on a limited number of basic three-dimensional models.
[0037] Figure 1 It is an example of a three-dimensional model shown in some embodiments of this specification. Figure 1Two facial models of different sizes are shown. In some embodiments, the facial model may include only a three-dimensional facial area, or the facial model may further include a complete head, or the facial model may also include a neck and part of the shoulder area. In the actual mixing process, due to the large differences in facial structures such as head circumference and facial features of different facial models, or the different rotation angles of different facial models, the staff is required to manually scale the size of the model to be mixed and / or adjust the rotation angle of the model to ensure a more natural fusion effect. However, manual adjustment of the three-dimensional model to be mixed is inefficient and difficult to meet the needs of completing large-scale production in a short time.
[0038] To this end, some embodiments of this specification propose a method that can automatically complete the matching and fusion of three-dimensional models through a computer, so as to efficiently achieve the natural fusion of three-dimensional models, and can be run in batches to improve the fusion efficiency.
[0039] Figure 2 is an exemplary flow chart of a 3D model fusion method according to some embodiments of this specification. In some embodiments, Figure 2 The process 200 shown can be executed by a computing device, for example, it can be implemented by a 3D model fusion system 1000 deployed on the computing device. In some embodiments, the computing device can be a desktop computer, a laptop computer, a mobile phone, a VR device, a tablet computer, etc. In some embodiments, the computing device can be a user-end device, a server-end device, or a cloud device. Figure 2 As shown, process 200 includes the following steps.
[0040] Step 210 , determining a first plane based on three non-collinear feature points on the first three-dimensional model. In some embodiments, step 210 may be implemented by the first plane determining module 1010 .
[0041] In some embodiments, the three-dimensional model is composed of more than one basic surface (such as a triangular surface), and the vertices of each triangular surface can be regarded as more than one point on the three-dimensional model. Any three non-collinear points can uniquely determine a plane. In some embodiments, a plane can be determined based on three non-collinear feature points on the first three-dimensional model. For the sake of distinction, it may be called the first plane. Among them, the three feature points generally come from different basic surfaces on the three-dimensional model.
[0042] Feature points can be representative or positioning points in a three-dimensional model. Taking a facial model as an example, feature points can include eye positioning points, mouth positioning points, nose positioning points, ear positioning points, etc. Eye positioning points can specifically be the inner canthus point of the eyelid (or inner corner point of the eye), the outer canthus point of the eye, the middle point of the upper eyelid, etc. Mouth positioning points can specifically be the corner point of the mouth, the peak point of the lip, the middle point of the upper lip, etc. Nose positioning points can be the nose wings on both sides, the nose tip, etc. Ear positioning points can be the top of the auricle, the center point of the earlobe, etc. Figure 3 is a schematic diagram of feature points on a three-dimensional model according to some embodiments of this specification. Taking a face model as an example, three feature points that are not collinear on the first three-dimensional model may be left eye positioning points, P A (Example can be the inner canthus point of the left eyelid), right eye positioning point P B (Example can be the inner canthus point of the right eyelid) and the mouth positioning point P C (An exemplary point may be the midpoint of the upper lip).
[0043] In some embodiments, the plane matrix of the first plane can be obtained based on the coordinate data of the three non-collinear feature points on the first three-dimensional model in the first space (in order to distinguish or refer to the initial coordinate data, it can be understood that the initial coordinate data can be relative to the transformed or corrected coordinate data). The plane matrix is a representation of the plane in matrix form.
[0044] In some embodiments of this specification, space mainly refers to three-dimensional space. Specifically, space can be represented by a three-dimensional coordinate system. The origin position and coordinate axis direction of the three-dimensional coordinate system can determine the establishment basis of the space. The three-dimensional coordinate system of the first space can be flexibly set according to actual needs. Figure 1 As an example, the origin of the three-dimensional coordinate system of the first space can be set at the lower left corner, the horizontal direction is taken as the direction of the x-axis, where horizontal rightward is positive, the vertical direction is taken as the y-direction, where vertical upward is positive, and the Figure 1 The direction of the plane is taken as the direction of the z-axis, where the distance from Figure 1 The direction of the observer is positive. For example, based on Figure 1 The left facial model shown in the figure establishes a three-dimensional coordinate system in the first space. Specifically, the origin of the three-dimensional coordinate system in the first space can be set at the center point or approximate center point of the head in the left facial model. The direction of the x-axis is determined based on the direction parallel to the straight line where the eyes are located, and the direction from the left eye to the right eye is positive; the direction of the y-axis is determined based on the direction that passes through the head vertically from top to bottom, and the vertical upward direction is positive; the direction of the z-axis is determined based on the direction that passes through the nose tip and passes through the head front and back, and the direction from the nose tip to the back of the head is positive. Let's assume that the three feature points mentioned above are P A1, P B1 and P C1 , and its coordinate data in the first space are respectively ( x 1 , ya 1 , za 1 )、( xb 1 , yb 1 , zb 1 )as well as( xc 1 , yc 1 , z 1 ).
[0045] In some embodiments, the plane equation of the first plane can be calculated based on the initial coordinate data of the three feature points, and its form is A 1 x +B 1 y +C 1 z +D 1 =0, where coefficient A 1 , B 1 , C 1 , D 1 It can be calculated from the initial coordinate data of the three feature points in the first space. Further, a fourth-order determinant can be obtained based on the plane equation of the first plane, and a 4×4 matrix corresponding to the fourth-order determinant is used as the plane matrix of the first plane.
[0046] In some other embodiments, the first plane can be determined by the point and the normal line. Specifically, the initial three-dimensional coordinate values of the three feature points are promoted to the corresponding initial homogeneous coordinate values, that is, the fourth dimension data is added on the basis of each three-dimensional coordinate value and set to "1". P A1 The initial homogeneous coordinates of are ( x 1 , ya 1 , za 1 , 1). Further, the initial homogeneous coordinate values of each feature point can be calculated by the following formula to obtain the plane matrix of the first plane.
[0047] (1).
[0048] (2).
[0049] (3).
[0050] (4).
[0051] In the formula, P A1 , P B1 as well as P C1 They represent the initial homogeneous coordinate values of the three feature points, that is, 4-dimensional vectors; the symbol × represents the cross product between vectors, and the result is a vector of the same dimension; It can be regarded as a feature point P B1 Point to feature point P A1 A 4-dimensional vector, which lies in the first plane, can be regarded as the normal vector of the first plane, can be viewed as a 4-dimensional vector lying in the first plane, , , , P A1 They can all be written in column vector form, and when spliced together, we can get a plane matrix of the first plane with a dimension of 4×4 M 1 .
[0052] It should be understood that the three-dimensional coordinate values, homogeneous coordinate values, and coordinate data described in some embodiments of this specification are essentially equivalent and can be converted into each other.
[0053] Step 220 , determining a second plane based on three non-collinear feature points on the second three-dimensional model. In some embodiments, step 220 may be implemented by the second plane determining module 1020 .
[0054] In some implementations, a plane can be determined based on three non-collinear feature points among the one or more points on the second three-dimensional model, which is referred to as the second plane for distinction. For the description of the feature points, please refer to the relevant description in step 210, which will not be repeated here.
[0055] In some embodiments, three non-collinear feature points on the second three-dimensional model can correspond one-to-one to three feature points on the first three-dimensional model, and "correspondence" can be understood as feature points of the same type. Continuing with the facial model as an example, the three non-collinear feature points on the second three-dimensional model corresponding to the feature points of the first three-dimensional model can be the left eye positioning point (exemplarily the inner canthus point of the left eyelid), the right eye positioning point (exemplarily the inner canthus point of the right eyelid) and the mouth positioning point (exemplarily the midpoint of the upper lip). In other embodiments, feature points corresponding to each other can be understood as having the same or corresponding serial numbers in the point-surface topological structure of each three-dimensional model. More descriptions about the point-surface topological structure and "correspondence" can also be found in the relevant description of step 250, which will not be repeated here.
[0056] In some embodiments, the plane matrix of the second plane can be obtained based on the initial coordinate data of the three non-collinear feature points on the second three-dimensional model in the first space. M 2 . About the first space and obtaining the plane matrix of the second plane M 2 For more description, please refer to the relevant description in step 210, which will not be repeated here.
[0057] In some embodiments of the present specification, unless otherwise specified, the acquisition of coordinate data, the transformation and correction of coordinate data, and the operations between coordinate data are all performed in a three-dimensional coordinate system in the same space (such as the first space).
[0058] Step 230 : Acquire alignment transformation parameters based on the first plane and the second plane. In some embodiments, step 230 may be implemented by the transformation parameter determination module 1030 .
[0059] The alignment transformation parameters can reflect the spatial transformation that aligns one 3D model with another 3D model. "Alignment" can be understood as the coordinate data of at least some points (such as preset feature points) of one 3D model and another 3D model being the same, or the shape (or structure) and size of at least some points (such as preset feature points) on one 3D model being the same as the shape and size of the corresponding points on another 3D model. As an example, suppose three feature points on the first 3D model are P A , P B and P CThe three feature points on the second three-dimensional model form an equilateral triangle with a side length of 2 units. After the first three-dimensional model is aligned with the second three-dimensional model, the corresponding three feature points on the second three-dimensional model also form an equilateral triangle with a side length of 2 units, wherein the unit length can be 5 mm, 2 cm or 1 m, etc. In some embodiments, the spatial transformation may include one or more of translation, rotation and scaling, that is, a three-dimensional model may be aligned with another three-dimensional model by translation or rotation or scaling or a combination of two or more of the above three methods. Specifically, the alignment transformation parameters may further include one or more of the translation factor, rotation factor and scaling factor on the three coordinate axes (such as the x-axis, y-axis and z-axis) of the three-dimensional coordinate system of the space. That is to say, for a three-dimensional model, the coordinate data of the points on the three-dimensional model can be changed by the alignment transformation parameters to align it with another three-dimensional model.
[0060] In some embodiments, the alignment transformation matrix can be calculated based on the plane matrix of the first plane and the plane matrix of the second plane, and the alignment transformation matrix is used as the alignment transformation parameter. As an example, the alignment transformation matrix can be calculated based on the following formula (5), where: T To align the transformation matrix, M 1 is the plane matrix of the first plane, M 2 is the plane matrix of the second plane.
[0061] (5).
[0062] Among them, the alignment transformation matrix T It can be deduced from this: Assume there is an alignment transformation matrix T , which can make formula (6) valid, then formula (7) is valid, and further formula (5) is valid.
[0063] (6).
[0064] (7).
[0065] Alignment Transformation Matrix TIt can directly reflect the spatial transformation required to align the second plane with the first plane. Since the three feature points on the first three-dimensional model are all located on the first plane, and the three feature points on the second three-dimensional model are all located on the second plane, the alignment transformation matrix can at least approximately or at least partially reflect the spatial transformation of aligning the second three-dimensional model with the first three-dimensional model. In some embodiments, the alignment transformation matrix can be used to characterize the spatial transformation parameters for aligning the second three-dimensional model with the first three-dimensional model. When the three-dimensional model is a facial model, the plane determined by the feature points on each three-dimensional model can approximately replace the facial area of the model, so when the facial model is fused, it can ensure that the fusion calculation has good accuracy. Using plane matrices corresponding to different three-dimensional models to determine the spatial transformation required to align the three-dimensional models can effectively reduce the amount of calculation and improve the calculation efficiency while ensuring the calculation accuracy.
[0066] Step 240 , based on the alignment transformation parameter and the initial coordinate data of one or more points on the second three-dimensional model, obtain the transformed coordinate data of one or more points on the second three-dimensional model. In some embodiments, step 240 may be implemented by the coordinate transformation module 1040 .
[0067] In some embodiments, the initial coordinate data of each of the more than one points on the second three-dimensional model may be calculated with the alignment transformation parameter to obtain the transformed coordinate data of each point.
[0068] Taking the alignment transformation parameters including the alignment transformation matrix as an example, the transformation coordinate data of one or more points on the second three-dimensional model can be calculated by formula (8). In the formula, P 2 represents the initial homogeneous coordinate value of a point on the second three-dimensional model, P 2 ’ The transformed homogeneous coordinate value representing the aforementioned point. In some embodiments, the coordinate values of the first three digits can be further extracted from the transformed homogeneous coordinate value to obtain the transformed three-dimensional coordinate value, which is used as the transformed coordinate data.
[0069] P 2 ’ = TP 2 (8).
[0070] Step 250 , based on the initial coordinate data of one or more points on the first three-dimensional model and the transformed coordinate data of one or more points on the second three-dimensional model, obtain fused coordinate data of one or more points of the fused three-dimensional model. In some embodiments, step 250 may be implemented by the fusion module 1050 .
[0071] In some embodiments, the initial coordinate data of one or more points on the first three-dimensional model and the transformed coordinate data of the corresponding points on the second three-dimensional model can be directly calculated to obtain the fused coordinate data of one or more points of the fused three-dimensional model. It should be understood that the fused coordinate data is intended to represent that the data is the result of fusing the coordinate data of the points on the first three-dimensional model and the coordinate data of the corresponding points on the second three-dimensional model, and it is still coordinate data in essence.
[0072] In some embodiments, one or more points on the first three-dimensional model correspond to a point on the second three-dimensional model one by one. Similar to feature points, "correspondence" can be understood as the position of the point or the part represented by the point having the same type. Taking the facial model as an example, the nose tip point on the first three-dimensional model corresponds to the nose tip point on the second three-dimensional model. In some other embodiments, the first three-dimensional model and the second three-dimensional model to be fused may further have the same point-surface topological structure. The point-surface topological structure can be characterized by the sequence number of the point, the point group constituting the surface, and the order of the points. The sequence number of the point is used to uniquely identify a point. More than three points form a basic surface, and multiple basic surfaces constitute the outline of the three-dimensional model. The order of the points refers to the order between the points when more than three points form a basic surface. If three points form a basic triangular surface of the three-dimensional model, the order of the three points can be represented by the first order, the second order, and the third order respectively, and the front, back, or normal direction of the basic surface can be uniquely determined based on the order of the points. As an example, the front and back of the basic surface can be determined based on the right-hand rule. Make the encircling direction of the four fingers of the right hand except the thumb consistent with the order of the three points on the basic surface, and the direction of the thumb is the positive direction of the basic surface. The same point-surface topological structure of two 3D models means that the two 3D models have one-to-one correspondence or the same point numbers, the same surface composition, and the same point order on the corresponding basic surface. By changing the coordinate data of each point on the 3D model, a 3D model with at least one different size, rotation, position and shape can be obtained. Figure 1 Taking the facial model shown in the figure as an example, the left facial model and the right facial model have the same point-surface topological structure. By adjusting the coordinate data of each point on the three-dimensional model, two left and right facial models with different details such as head circumference, expression, and facial contour can be obtained. When two three-dimensional models have the same point-surface topological structure, "correspondence" can be more specifically understood as the order numbers of the points corresponding to or being the same.
[0073] Specifically, the fused coordinate data of one or more points on the fused three-dimensional model can be calculated using formula (9).
[0074] (9).
[0075] In the formula, P 1Represents initial coordinate data of a point on the first three-dimensional model, which may be in the form of three-dimensional coordinate values or homogeneous coordinate values; P 2 ’ Transformed coordinate data representing a point on the second three-dimensional model corresponding to the aforementioned point; P final Represents the fused coordinate data of corresponding points on the fused 3D model; α is the weight coefficient (or first weight value), which can be a value from the numerical range (0,1] and can be preset. It is not difficult to understand that the weight coefficient α To a certain extent, it can determine the degree of fusion of the two 3D models. The weight coefficient α It can be positively correlated with the degree of fusion, and the specific weight coefficient α The larger the value of , the closer the fused 3D model is to the second 3D model, and vice versa. α The value of can be 0.2, 0.3, 0.5, 1, etc. In some embodiments, the first weight value corresponding to each point on the three-dimensional model α Can be equal.
[0076] Some embodiments of the present specification determine alignment transformation parameters through plane matrices corresponding to different three-dimensional models, which can save labor costs and effectively improve computing efficiency while ensuring fusion accuracy.
[0077] As mentioned above, when the alignment transformation parameters are derived from the alignment transformation matrix calculated from the plane matrices corresponding to different three-dimensional models, since the plane matrix cannot fully represent the corresponding three-dimensional model, when the two three-dimensional models to be fused have large differences in form or size, the transformed coordinate data of the second three-dimensional model obtained in step 240 may have some degree of undesirable deformation (such as distortion) relative to the initial coordinate data. Taking the facial model as an example, the undesirable deformation may be the widening of the facial area, the relative position shift of the facial features, etc.
[0078] Figure 4 is an exemplary flow chart of the steps of obtaining fused coordinate data according to some embodiments of this specification. In some embodiments, Figure 4 The process 400 shown can be executed by a computing device, for example, it can be implemented by the fusion module 1050 in the three-dimensional model fusion system 1000 deployed on the computing device. In some embodiments, the computing device can be a desktop computer, a laptop computer, a mobile phone, a VR device, a tablet computer, etc. In some embodiments, the computing device can be a user-end device, a server-end device, or a cloud device. In some embodiments, the process 400 can be a specific implementation method of step 250. Figure 4As shown, process 400 includes the following steps.
[0079] Step 410, correcting the transformed coordinate data of one or more points on the second three-dimensional model to obtain corrected coordinate data of one or more points on the second three-dimensional model.
[0080] In some embodiments, the transformed coordinate data of one or more points on the second three-dimensional model may be modified to weaken or eliminate the aforementioned undesirable deformation. As an example, the modification may specifically include a change in the scaling ratio and / or a translation of the coordinate data of the point.
[0081] In some embodiments, the first distance value can be determined based on the initial coordinate data of the midpoint between the first feature point and the second feature point on the second three-dimensional model and the initial coordinate data of the third feature point on the second three-dimensional model. The second distance value is determined based on the transformed coordinate data of the midpoint between the first feature point and the second feature point on the second three-dimensional model and the transformed coordinate data of the third feature point on the second three-dimensional model. The transformed coordinate data of more than one point on the second three-dimensional model are corrected based on the distance correction value to obtain the corrected coordinate data of more than one point on the second three-dimensional model. Among them, the distance correction value reflects the ratio of the first distance value to the second distance value. In some embodiments, the first feature point, the second feature point and the third feature point can be the three feature points used to determine the second plane, or can be other feature points on the second three-dimensional model except the three feature points used to determine the second plane, or part of the first feature point, the second feature point and the third feature point comes from the three feature points used to determine the second plane, and the embodiments of this specification are not limited to this.
[0082] Taking the facial model as an example, the first feature point may be the left eye positioning point, the second feature point may be the right eye positioning point, and the third feature point may be the midpoint of the upper lip. More specifically, the inner canthus point of the left eyelid, the inner canthus point of the right eyelid, and the midpoint of the upper lip are selected as the aforementioned three feature points. The bridge of the nose of the first three-dimensional model is higher than that of the second three-dimensional model, which can be intuitively understood as the inclination of the first plane is greater than that of the second plane. After processing from step 210 to step 240, the distance from the straight line where the two eyes of the transformed second three-dimensional model are located to the midpoint of the upper lip may be compressed relative to the initial second three-dimensional model, and the transformed second three-dimensional model is visually "flattened".
[0083] To this end, a first distance value from the straight line where the two eyes are located to the midpoint of the upper lip in the initial second three-dimensional model, and a second distance value from the straight line where the two eyes are located to the midpoint of the upper lip in the transformed second three-dimensional model can be calculated; based on the distance correction value, the transformed coordinate data of more than one point on the second three-dimensional model are calculated to obtain corrected coordinate data of more than one point on the second three-dimensional model; wherein the distance correction value reflects the ratio of the first distance value to the second distance value.
[0084] Taking the first distance value as an example, the first distance value can be calculated based on the initial coordinate data of the midpoint of the left eye positioning point and the right eye positioning point on the second three-dimensional model and the initial coordinate data of the midpoint of the upper lip on the second three-dimensional model. Among them, the first distance value can be the Euclidean distance, cosine distance, etc. between the two points. Among them, the initial coordinate data of the midpoint of the left eye positioning point and the right eye positioning point can be the average of the initial coordinate data of the inner canthus point of the left eye eyelid and the initial coordinate data of the inner canthus point of the right eye eyelid. In a similar way, the second distance value can be obtained.
[0085] In some embodiments, the ratio of the first distance value to the second distance value may be calculated and used as the distance correction value. β 1 can be equal to h 1 / h 2 ,h 1 is the first distance value, h 2 is the second distance value. In other embodiments, the distance correction value β 1 can be equal to h 1 / h 2 The product of the first correction coefficient and the first correction coefficient can adjust the degree of scaling correction. Exemplarily, the first correction coefficient can be a value between (0, 1), such as 0.2, 0.5, etc.
[0086] In some embodiments, the transformed coordinate data of more than one point on the second three-dimensional model may be multiplied by the distance correction value β 1 , and obtain the corrected coordinate data. As an example, the corrected coordinate data of the point on the second three-dimensional model can be calculated by formula (10). In the formula, P 2 ’ Represents the transformed coordinate data of a point on the second 3D model, P 2 ” Represents the corrected coordinate data of the point on the second 3D model.
[0087] (10).
[0088] In some embodiments of the present specification, the above-mentioned scaling correction can compensate for the unexpected compression or stretching transformation of the second three-dimensional model during the transformation process, while retaining the rotation transformation effect of the second three-dimensional model. Taking the facial model as an example, the first plane and the second plane can respectively represent the facial areas of the first three-dimensional model and the second three-dimensional model. Therefore, the transformed second three-dimensional model calculated based on the alignment transformation matrix can be basically aligned with the first three-dimensional model in terms of rotation angle, so retaining the rotation transformation effect of the second three-dimensional model is of practical significance.
[0089] In some embodiments, after the transformation coordinate data of more than one point on the second three-dimensional model is scaled and corrected, the position of the feature point may be shifted relative to the feature point of the first three-dimensional model. Figure 5 It is a schematic diagram of the eye height difference between different facial models shown in some embodiments of this specification. Figure 5 The right 3D model in the figure is the result of the transformation and scaling correction of the second 3D model. The right 3D model can be aligned with the first 3D model (i.e., the left 3D model) in terms of rotation angle and size, but the binocular positioning points of the right 3D model are offset relative to the binocular positioning points of the first 3D model. In order to make the fusion result more natural, it is necessary to correct or compensate for this undesired translation or offset.
[0090] Figure 6 FIG. 1 is an exemplary flow chart of the steps of obtaining corrected coordinate data according to other embodiments of this specification. Figure 6 As shown, process 600 may include the following steps.
[0091] Step 610: Determine a first distance value based on initial coordinate data of a midpoint between the first feature point and the second feature point on the second three-dimensional model and initial coordinate data of a third feature point on the second three-dimensional model.
[0092] Step 620: Determine a second distance value based on the transformed coordinate data of the midpoint between the first feature point and the second feature point on the second three-dimensional model and the transformed coordinate data of the third feature point on the second three-dimensional model.
[0093] Step 630, based on the distance correction value, the transformed coordinate data of one or more points on the second three-dimensional model are corrected to obtain the intermediate coordinate data of one or more points on the second three-dimensional model. The distance correction value reflects the ratio of the first distance value to the second distance value.
[0094] For the description of steps 610 to 630, please refer to the relevant description of the scaling correction process above, wherein the intermediate coordinate data of the second three-dimensional model obtained in step 630 is the corrected coordinate data of the second three-dimensional model obtained by the aforementioned scaling correction process. It can be understood that steps 640 and 650 are performed on the basis of the aforementioned scaling correction. Similar to the aforementioned scaling correction process, the first feature point, the second feature point and the third feature point on the second three-dimensional model in process 600 may be the three feature points used to determine the second plane, or other feature points on the second three-dimensional model except the three feature points used to determine the second plane, or part of the first feature point, the second feature point and the third feature point comes from the three feature points used to determine the second plane, and the embodiment of this specification does not limit this. The first three-dimensional model may have feature points corresponding to the first feature point, the second feature point and the third feature point on the second three-dimensional model, which may be referred to as the first feature point, the second feature point and the third feature point on the first three-dimensional model in sequence. More descriptions about "correspondence" can be found in the previous text and will not be repeated here.
[0095] Step 640 , determining a height correction value based on a difference between initial coordinate data of a first preset point on the first three-dimensional model and intermediate coordinate data of a second preset point on the second three-dimensional model corresponding to the first preset point.
[0096] The preset point can be a point of any part in the three-dimensional model, and can be flexibly set according to actual needs. Taking the facial model as an example, the preset point can be an eye positioning point, a mouth positioning point, an ear positioning point, a nose positioning point, etc. In some embodiments, the preset point can be determined based on the first feature point and the second feature point of the three-dimensional model. As an example, the first feature point or the second feature point on the three-dimensional model can be used as the preset point, or the midpoint between the first feature point and the second feature point on the three-dimensional model can be used as the preset point. Further, the height correction value can be determined based on the height component of the difference between the initial coordinate data of the midpoint between the first feature point and the second feature point on the first three-dimensional model and the intermediate coordinate data of the midpoint between the first feature point and the second feature point on the second three-dimensional model. Continuing to take the facial model as an example, the height correction value can reflect the eye height difference between the first three-dimensional model and the current second three-dimensional model. Therefore, the first preset point can be the left eye positioning point, the right eye positioning point, or the midpoint between the left eye positioning point and the right eye positioning point on the first three-dimensional model. Correspondingly, the second preset point can be the left eye positioning point, the right eye positioning point, or the midpoint between the left eye positioning point and the right eye positioning point on the second three-dimensional model. Specifically, the initial coordinate data of the left eye positioning point on the first three-dimensional model can be subtracted from the intermediate coordinate data of the left eye positioning point on the second three-dimensional model to obtain the difference between the two, and the height component of the difference (such as the value corresponding to the y coordinate in the difference) can be determined as the height correction value. Alternatively, the initial coordinate data of the right eye positioning point on the first three-dimensional model can be calculated and subtracted from the intermediate coordinate data of the right eye positioning point on the second three-dimensional model to obtain the difference between the two, and the height component of the difference (such as the value corresponding to the y coordinate in the difference) can be determined as the height correction value. Alternatively, the height correction value can be represented by the height component of the difference between the initial coordinate data of the midpoint of the left eye positioning point and the right eye positioning point on the first three-dimensional model and the intermediate coordinate data of the midpoint of the left eye positioning point and the right eye positioning point on the second three-dimensional model, wherein the initial coordinate data of the midpoint of the left eye positioning point and the right eye positioning point on the first three-dimensional model can be obtained based on the average value of the initial coordinate data of the left eye positioning point and the right eye positioning point, and the intermediate coordinate data of the midpoint of the left eye positioning point and the right eye positioning point on the second three-dimensional model can be obtained based on the average value of the intermediate coordinate data of the left eye positioning point and the right eye positioning point.
[0097] Step 650: Correct the intermediate coordinate data of one or more points on the second three-dimensional model based on the height correction value to obtain corrected coordinate data of one or more points on the second three-dimensional model.
[0098] In some embodiments, the height component of the intermediate coordinate data of one or more points on the second three-dimensional model may be updated based on the height correction value. More specifically, the height correction value may be superimposed on the height component of the intermediate coordinate data of one or more points on the second three-dimensional model to obtain the corrected coordinate data of one or more points on the second three-dimensional model. Taking the face model as an example, when the height correction value is positive, it means that the eye height of the first three-dimensional model is higher than the eye height of the second three-dimensional model. Through the height correction, the eye height of the current second three-dimensional model can be increased to align with the eye height of the first three-dimensional model; when the height correction value is negative, it means that the eye height of the first three-dimensional model is lower than the eye height of the second three-dimensional model. Through the height correction, the eye height of the current second three-dimensional model can be lowered to align with the eye height of the first three-dimensional model.
[0099] In the process of facial model fusion, the fusion of eyes has a greater visual impact on the overall fusion effect of the model. Correcting the height of the second 3D model based on the eye height can effectively improve the fusion accuracy and make the fusion result more natural.
[0100] Step 420 , calculate the initial coordinate data of one or more points on the first three-dimensional model and the revised coordinate data of the corresponding points on the second three-dimensional model to obtain fused coordinate data of one or more points of the fused three-dimensional model.
[0101] In some embodiments, the description of determining the fused coordinate data of one or more points of the fused three-dimensional model can be referred to the relevant instructions of step 250. The only difference is that the transformed coordinate data of one or more points of the second three-dimensional model in step 250 needs to be replaced by the corrected coordinate data here.
[0102] In the actual fusion process, sometimes it is necessary to fuse the local areas of the two 3D models to be fused. Taking the face model as an example, in actual fusion, it is often necessary to fuse only the face area. In order to improve the fusion efficiency, in some embodiments of this specification, a weight value reflecting the degree of masking can also be introduced, which may be referred to as the second weight value for the sake of distinction. The second weight value is negatively correlated with the degree of masking. When the degree of masking is greater, the second weight value is smaller. Figure 7 is an example of a mask model according to some embodiments of this specification, Figure 7 The mask model shown is drawn based on the second weight value corresponding to each point of the three-dimensional model. The value range of the second weight value can be [0,1], where the second weight value of the points in the black area is equal to 0 or close to 0, and the second weight value of the points in the white area is equal to 1 or close to 1. Figure 7The region 701 shown is the facial region, and the second weight value of the internal points is equal to 1. The second weight value corresponding to the point farther from the facial region 701 on the three-dimensional model is closer to 0. For example, the second weight value of the point in region 702 can be set to 0. In some embodiments, the second weight value of each point on the three-dimensional model can be pre-configured, and the computing device or fusion module 1050 obtains the second weight value by accessing a database or storage medium. In some embodiments, the mask model can have the same point-surface topology result as the first three-dimensional model and / or the second three-dimensional model. Therefore, each point on the mask model corresponds to each point of the first three-dimensional model and / or the second three-dimensional model one by one. By obtaining the mask model, the second weight value of more than one point on the first three-dimensional model and / or the second three-dimensional model can be obtained.
[0103] In some other embodiments, the fused coordinate data of more than one point of the fused three-dimensional model may be calculated using formula (11).
[0104] (11).
[0105] In the formula, P 1 Represents initial coordinate data of a point on the first three-dimensional model, which may be in the form of three-dimensional coordinate values or homogeneous coordinate values; P 2 ” Represents corrected coordinate data of a point on the second three-dimensional model corresponding to the aforementioned point; P final Represents the fused coordinate data of corresponding points on the fused 3D model; α is the weight coefficient (or called the first weight value); w is the second weight value.
[0106] It should be understood that the fusion method shown in formula (11) is also applicable to the embodiment of fusion based on the transformed coordinate data of the second three-dimensional model in step 250. In this case, P 2 ” Replace with P 2 ’ .
[0107] Figure 8 This is an example of a first three-dimensional model and a second three-dimensional model to be fused according to some embodiments of this specification. Figure 8 The 3D model 801 in the figure is the second 3D model, and the 3D model 802 and the 3D model 803 represent different first 3D models. The first 3D model can also be called a base model, that is, the fused 3D model basically inherits the first 3D model in terms of size, rotation, position, etc. Figure 8The first three-dimensional model 802 and the first three-dimensional model 803 are shown to have the same size, but different rotations (eg, orientations) and positions.
[0108] Fig. 9 This is an example of comparison between a fused 3D model obtained by using some embodiments of this specification and a fused 3D model obtained by other methods. Fig. 9 The three-dimensional model 901 is the second three-dimensional model (which can be regarded as the same three-dimensional model as the second three-dimensional model 801), and the three-dimensional model 903 is a fused three-dimensional model obtained based on the first three-dimensional model 803 and the second three-dimensional model 801 according to the fusion method shown in some embodiments of this specification. The three-dimensional model 902 is a fused three-dimensional model obtained based on the first three-dimensional model 802 and the second three-dimensional model 801 according to other methods, and the other methods can be fusion methods that omit the alignment of the three-dimensional models.
[0109] from Fig. 9 It can be seen from the figure that if the 3D models to be fused are not manually aligned in advance, the size of the fused 3D model 902 obtained may be closer to the second 3D model 901. If the rotation of the second 3D model 801 is greatly different from that of the first 3D model 802, the fusion result may be further away from the expectation. Using the fusion method described in some embodiments of this specification, the alignment of the second 3D model 801 and the first 3D model 803 can be automatically achieved. Even if the size and orientation of the first 3D model 803 are greatly different from those of the second 3D model 801, intuitively, the fusion only occurs in the facial region of the first 3D model 803, that is, the size and rotation of the fused 3D model 903 can be well inherited from the basic model. Generally speaking, more features of the basic model (such as hairstyle, head shape, etc.) are needed in subsequent 3D animation or game design. Therefore, the fused model obtained based on some embodiments of this specification can be directly used as a subsequent character model for 3D animation or game design, further improving the efficiency of 3D animation or game production.
[0110] It should be noted that, although the embodiments of this specification are mainly described with reference to the fusion process of two 3D models, they are also applicable to the fusion process of more than three 3D models. As an example, the 3D model E can be used as the base model, the 3D model F can be fused with it, the fusion result can be used as the new base model G, and the 3D model H can be fused with the base model G, thereby the 3D models E, F, and H can be fused.
[0111] Fig.10 is an exemplary block diagram of a 3D model fusion system shown in some embodiments of this specification. Fig.10 As shown, the three-dimensional model fusion system 1000 may include the following modules.
[0112] The first plane determining module 1010 is configured to determine a first plane based on three non-collinear feature points on the first three-dimensional model.
[0113] The second plane determining module 1020 is used to determine the second plane based on three non-collinear feature points on the second three-dimensional model; the three feature points on the first three-dimensional model correspond one-to-one to the three feature points on the second three-dimensional model.
[0114] The transformation parameter determination module 1030 is used to obtain alignment transformation parameters based on the first plane and the second plane; the alignment transformation parameters are used to represent spatial transformation parameters for aligning the second three-dimensional model with the first three-dimensional model.
[0115] The coordinate transformation module 1040 is used to obtain the transformed coordinate data of one or more points of the second three-dimensional model based on the alignment transformation parameters and the initial coordinate data of one or more points on the second three-dimensional model.
[0116] The fusion module 1050 is used to obtain fused coordinate data of one or more points of the fused three-dimensional model based on the initial coordinate data of one or more points on the first three-dimensional model and the transformed coordinate data of one or more points on the second three-dimensional model.
[0117] For more information about each module, see Figure 2 , Figure 4 or Figure 6 The relevant description of will not be repeated here. It should be understood that Fig.10 The system and its modules shown can be implemented in various ways. For example, in some embodiments, the system and its modules can be implemented by hardware, software, or a combination of software and hardware. Among them, the hardware part can be implemented using dedicated logic; the software part can be stored in a memory and executed by an appropriate instruction execution system, such as a microprocessor or dedicated design hardware. Those skilled in the art will understand that the above methods and systems can be implemented using computer executable instructions and / or control codes contained in a processor, such as a disk, CD or DVD-ROM, etc., and such codes are provided in a carrier medium or a memory of a programmable device. The system and its modules of this specification can not only be implemented by hardware circuits such as ultra-large-scale integrated circuits or gate arrays, semiconductors such as logic chips, transistors, etc., or programmable hardware devices such as field programmable gate arrays, programmable logic devices, etc., but can also be implemented by software executed by various types of processors, and can also be implemented by a combination of the above hardware circuits and software (e.g., firmware).
[0118] It should be noted that the above description of the system and its modules is only for convenience of description and does not limit this specification to the scope of the embodiments. It is understandable that for those skilled in the art, after understanding the principle of the system, it is possible to arbitrarily combine the modules without deviating from this principle to form a subsystem connected to other modules. Or some modules may be split to obtain more modules or multiple units under the module. Such variations are all within the scope of the disclosure of this specification.
[0119] Some embodiments of the present specification also provide a computer program product, including computer instructions. When at least part of the computer instructions are executed by a processor, the present specification can be implemented. Figure 2 , Figure 4 or Figure 6 In some embodiments, the computer program product may only involve computer instructions, which may be carried by a storage medium, a processing device, or a terminal device. In other embodiments, the computer program product may also be a storage medium, a processing device, or a terminal device containing the aforementioned computer instructions. Among them, the processing device or the terminal device may further include a processor and a storage medium.
[0120] In some embodiments, the processor may be a combination of one or more of the following processors: a central processing unit (CPU), an application specific integrated circuit (ASIC), an application specific instruction set processor (ASIP), a graphics processing unit (GPU), a physical processing unit (PPU), a digital signal processor (DSP), a field programmable gate array (FPGA), a programmable logic device (PLD), a programmable logic controller (PLC), a reduced instruction set computer (RISC), and a microprocessor.
[0121] In some embodiments, the storage medium may include a combination of one or more of the following: a mass storage, a removable storage, a volatile read-write memory, and a read-only memory (ROM). Exemplary mass storage may include a magnetic disk, an optical disk, a solid-state hard disk, and the like. Exemplary removable storage may include a flash disk, a floppy disk, an optical disk, a memory card, a compressed hard disk, a magnetic tape, and the like. Exemplary volatile read-write memory may include a random access memory (RAM). Exemplary random access memory may include a dynamic random access memory (DRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), a static random access memory (SRAM), a thyristor random access memory (T-RAM), and a zero capacitance memory (Z-RAM), and the like. Exemplary read-only memory may include a masked read-only memory (MROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a compact disk read-only memory (CD-ROM), and a digital multifunction hard disk read-only memory, and the like.
[0122] The beneficial effects that may be brought about by the embodiments of this specification include but are not limited to: (1) Automatic alignment in the process of three-dimensional model fusion is realized, and batch processing of model fusion is realized. (2) The spatial transformation required for aligning three-dimensional models is determined based on the plane matrices corresponding to different three-dimensional models, which can effectively reduce the amount of calculation and improve the calculation efficiency while ensuring the calculation accuracy. (3) Through scaling correction and / or height correction, the distortion introduced in the alignment transformation can be compensated, making the final fusion result more natural. (4) The introduction of a second weight value reflecting the degree of masking can limit the fusion to the target area (such as the facial area), so that the fused three-dimensional model can better inherit other features of the basic model, thereby improving the production efficiency of animation or games. It should be noted that different embodiments may produce different beneficial effects. In different embodiments, the beneficial effects that may be produced may be any one or a combination of the above, or any other beneficial effects that may be obtained.
[0123] The basic concepts have been described above. Obviously, for those skilled in the art, the above detailed disclosure is only for example and does not constitute a limitation of this specification. Although not explicitly stated here, those skilled in the art may make various modifications, improvements and corrections to this specification. Such modifications, improvements and corrections are taught in this specification, so such modifications, improvements and corrections still belong to the spirit and scope of the exemplary embodiments of this specification.
Claims
1. A 3D model fusion method, It is characterized in that include: Determine a first plane based on three non-collinear feature points on the first three-dimensional model; Determine a second plane based on three non-collinear feature points on the second three-dimensional model; the three feature points on the first three-dimensional model correspond one-to-one to the three feature points on the second three-dimensional model; Based on the first plane and the second plane, acquiring alignment transformation parameters; The alignment transformation parameters are used to represent spatial transformation parameters for aligning the second three-dimensional model with the first three-dimensional model; Based on the alignment transformation parameter and initial coordinate data of one or more points on the second three-dimensional model, obtaining transformed coordinate data of one or more points on the second three-dimensional model; Based on the initial coordinate data of one or more points on the first three-dimensional model and the transformed coordinate data of one or more points on the second three-dimensional model, fused coordinate data of one or more points on the fused three-dimensional model are obtained.
2. The method according to claim 1, It is characterized in that The determining the first plane based on the three non-collinear feature points on the first three-dimensional model includes: acquiring a plane matrix of the first plane based on initial coordinate data of the three non-collinear feature points on the first three-dimensional model; The determining the second plane based on the three non-collinear feature points on the second three-dimensional model includes: acquiring a plane matrix of the second plane based on initial coordinate data of the three non-collinear feature points on the second three-dimensional model.
3. The method according to claim 2, It is characterized in that The acquiring alignment transformation parameters based on the first plane and the second plane includes: Based on the plane matrix of the first plane and the plane matrix of the second plane, an alignment transformation matrix is calculated, and the alignment transformation matrix is used as the alignment transformation parameter; The spatial transformation includes one or more of the following: translation, scaling, and rotation.
4. The method according to claim 1, It is characterized in that One or more points on the first three-dimensional model correspond one-to-one to one or more points on the second three-dimensional model.
5. The method according to claim 4, It is characterized in that The first three-dimensional model and the second three-dimensional model have the same point-surface topological structure.
6. The method according to claim 4, It is characterized in that The step of acquiring fused coordinate data of one or more points of the fused three-dimensional model based on initial coordinate data of one or more points on the first three-dimensional model and transformed coordinate data of one or more points on the second three-dimensional model comprises: Correcting the transformed coordinate data of one or more points on the second three-dimensional model to obtain corrected coordinate data of one or more points on the second three-dimensional model; The initial coordinate data of one or more points on the first three-dimensional model and the corrected coordinate data of corresponding points on the second three-dimensional model are calculated to obtain fused coordinate data of one or more points of the fused three-dimensional model.
7. The method according to claim 6, It is characterized in that The step of correcting the transformed coordinate data of one or more points on the second three-dimensional model to obtain corrected coordinate data of one or more points on the second three-dimensional model includes: determining a first distance value based on initial coordinate data of a midpoint between the first feature point and the second feature point on the second three-dimensional model and initial coordinate data of a third feature point on the second three-dimensional model; Determine a second distance value based on transformed coordinate data of a midpoint between the first feature point and the second feature point on the second three-dimensional model and transformed coordinate data of a third feature point on the second three-dimensional model; Correcting the transformed coordinate data of one or more points on the second three-dimensional model based on the distance correction value to obtain corrected coordinate data of one or more points on the second three-dimensional model; The distance correction value reflects the ratio of the first distance value to the second distance value.
8. The method according to claim 6, It is characterized in that The step of correcting the transformed coordinate data of one or more points on the second three-dimensional model to obtain corrected coordinate data of one or more points on the second three-dimensional model includes: Determine a first distance value based on initial coordinate data of a midpoint between the first feature point and the second feature point on the second three-dimensional model and initial coordinate data of a third feature point on the second three-dimensional model; Determine a second distance value based on transformed coordinate data of a midpoint between the first feature point and the second feature point on the second three-dimensional model and transformed coordinate data of a third feature point on the second three-dimensional model; Correcting the transformed coordinate data of one or more points on the second three-dimensional model based on the distance correction value to obtain intermediate coordinate data of one or more points on the second three-dimensional model; wherein the distance correction value reflects the ratio of the first distance value to the second distance value; determining a height correction value based on a difference between initial coordinate data of a first preset point on the first three-dimensional model and intermediate coordinate data of a second preset point on the second three-dimensional model corresponding to the first preset point; The intermediate coordinate data of one or more points on the second three-dimensional model are corrected based on the height correction value to obtain corrected coordinate data of one or more points on the second three-dimensional model.
9. The method according to claim 8, It is characterized in that The first preset point is a midpoint between a first feature point and a second feature point on the first three-dimensional model.
10. The method according to claim 8, It is characterized in that The step of correcting the intermediate coordinate data of one or more points on the second three-dimensional model based on the height correction value to obtain the corrected coordinate data of one or more points on the second three-dimensional model includes: The height component in the intermediate coordinate data of one or more points on the second three-dimensional model is updated based on the height correction value to obtain the corrected coordinate data of one or more points on the second three-dimensional model.
11. The method according to claim 7 or 8, It is characterized in that The first feature point is the left eye positioning point, the second feature point is the right eye positioning point, and the third feature point is the middle point of the upper lip.
12. The method according to claim 6, It is characterized in that The step of calculating the initial coordinate data of one or more points on the first three-dimensional model and the corrected coordinate data of corresponding points on the second three-dimensional model to obtain fused coordinate data of one or more points on the fused three-dimensional model includes: Determining differences between initial coordinate data of one or more points on the first three-dimensional model and revised coordinate data of corresponding points on the second three-dimensional model; Based on the initial coordinate data of one or more points on the first three-dimensional model and the corresponding differences, fused coordinate data of one or more points on the fused three-dimensional model are obtained.
13. The method according to claim 12, It is characterized in that The obtaining of fused coordinate data of one or more points of the fused three-dimensional model based on the initial coordinate data of one or more points on the first three-dimensional model and the corresponding difference includes performing the following processing on each of the one or more points on the first three-dimensional model: Calculate the product of the difference corresponding to the point, the first weight value, and the second weight value; wherein the first weight value is positively correlated with the degree of fusion of the point, and the second weight value is negatively correlated with the degree to which the point is masked; Based on the initial coordinate data of the point and the product, fused coordinate data of a point on the fused three-dimensional model corresponding to the point is obtained.
14. The method according to claim 13, It is characterized in that The second weight value corresponding to a point on the first three-dimensional model and / or the second three-dimensional model that is farther from the facial area is closer to 0.
15. A three-dimensional model fusion system, It is characterized in that include: A first plane determining module, used to determine a first plane based on three non-collinear feature points on the first three-dimensional model; A second plane determination module, used to determine a second plane based on three non-collinear feature points on the second three-dimensional model; the three feature points on the first three-dimensional model correspond one-to-one to the three feature points on the second three-dimensional model; A transformation parameter determination module, configured to obtain alignment transformation parameters based on the first plane and the second plane; The alignment transformation parameters are used to represent spatial transformation parameters for aligning the second three-dimensional model with the first three-dimensional model; A coordinate transformation module, configured to obtain transformed coordinate data of one or more points of the second three-dimensional model based on the alignment transformation parameter and initial coordinate data of one or more points on the second three-dimensional model; A fusion module is used to obtain fused coordinate data of one or more points of the fused three-dimensional model based on initial coordinate data of one or more points on the first three-dimensional model and transformed coordinate data of one or more points on the second three-dimensional model.
16. A computer program product, comprising computer instructions or a computer program, wherein when at least part of the computer instructions or the computer program is executed by a processor, the method according to any one of claims 1 to 14 can be implemented.
Citation Information
Cited By
Virtual interaction scene-oriented 3D model compression and rendering optimization system
CN121330142A
A 3D model compression and rendering optimization system for virtual interaction scenarios
CN121330142B
