Virtual human hair redirection method and device, electronic equipment and storage medium

By redirecting the hair roots and hair rods of the virtual face shape, combining the radial basis function deformation field and texture map deformation, the problem of hair style and face shape is solved, and the perfect adaptation and natural presentation of hair on different face shapes is achieved.

CN119991414APending Publication Date: 2025-05-13MOFA (SHANGHAI) INFORMATION TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411938537.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-26
Publication Date
2025-05-13

AI Technical Summary

Technical Problem

When certain hairstyles are combined with different face shapes in the prior art, the hairstyle cannot perfectly adapt to the face shape, resulting in a shift in the hair position.

Method used

By obtaining the template face corresponding to the target face, the hair roots and hair rods of the template face are redirected to obtain the target hair roots and hair rods corresponding to the target face, and the hair of the target face is generated. This method uses a radial basis function deformation field to process the hair root position and deform the shadow texture map and scalp detail texture map to ensure the adaptation of the hair on different face shapes.

Benefits of technology

It achieves the perfect adaptation of hair on different face shapes, enhances the naturalness and authenticity of virtual people's hair, meets user needs, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119991414A_ABST
    Figure CN119991414A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of virtual digital humans, and provides a virtual human hair redirection method and device, electronic equipment and a storage medium, and the method comprises the steps: obtaining a template human face corresponding to a target human face; performing redirection processing on the hair root and the hair rod of the template face to obtain a target hair root and a target hair rod corresponding to the target face; and generating the hair of the target face. According to the method, the face shape difference between the target face and the template face is considered, so that the hairstyle of the template face cannot be perfectly matched with the target face, the hair roots and the hair stems of the template face are subjected to redirection processing, the target hair roots and the target hair stems corresponding to the target face are obtained, and the face shape difference between the target face and the template face is obtained. Therefore, the presentation effect of the hair on the template human face is the same as the presentation effect of the hair on the target human face and is not influenced by the face shape difference, so that the hair style of the template human face can be perfectly matched with the target human faces with different face shapes, the user requirements are met, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of virtual digital humans, and in particular to a method, device, electronic device and storage medium for redirecting virtual human hair. Background Art

[0002] With the continuous development of 3D virtual human technology, 3D video generation platforms allow users to create personalized 3D virtual human images as characters in 3D videos on the platform. Specifically, users can choose different hairstyles, face shapes, facial features, decorations, and clothing for 3D virtual humans to create personalized 3D virtual humans.

[0003] However, when combining certain hairstyles with different face shapes, the relative positions of the hair and facial features (especially the ears) may shift, that is, the hairstyle cannot be perfectly adapted to different face shapes. Summary of the invention

[0004] The present invention provides a method, device, electronic device and storage medium for redirecting virtual human hair, which are used to solve the defect in the prior art that certain hairstyles are combined with different face shapes, and the hairstyles cannot be perfectly adapted to different face shapes.

[0005] The present invention provides a method for redirecting virtual human hair, comprising the following steps: Obtain a template face corresponding to the target face; Redirecting the hair roots and hair shafts of the template face to obtain target hair roots and target hair shafts corresponding to the target face; Generate hair for the target face.

[0006] According to a method for redirecting hair of a virtual person provided by the present invention, the redirection processing step of the hair roots of the template face includes: Selecting at least one first position reference point from the face mesh vertices of the template face, and selecting a second position reference point corresponding to the first position reference point from the target face mesh vertices of the target face; constructing a radial basis function deformation field based on position information of the first position reference point and the second position reference point in the side view; Using the radial basis function deformation field to process the position information of the source hair roots in the side view of the template face, and determine the position information of the target hair roots in the side view of the target face; Based on the position information of the target hair root and the spatial curved surface of the target face, the spatial position of the target hair root is determined.

[0007] According to a method for virtual human hair redirection provided by the present invention, the method further comprises: Deforming the shadow texture map and the scalp detail texture map adapted to the template face to obtain a target shadow texture map and a target scalp detail texture map adapted to the target face; Applying the target shadow texture map and the target scalp detail texture map to the target human face.

[0008] According to a method for redirecting hair of a virtual person provided by the present invention, the redirection processing step of the hair shaft of the template face includes: The spatial position of the target stem is determined based on the relative position of the stem control point on the face, the shape of the curve on which the stem is located, and the relative length between the stem and the face.

[0009] According to a method for redirecting virtual human hair provided by the present invention, the spatial position of the target hair shaft is determined based on the relative position of the hair shaft control point on the human face, the shape of the curve where the hair shaft is located, and the relative length between the hair shaft and the human face, including: Sampling the hair rod of the template face to obtain a guide hair rod, and determining a guide hair rod control point based on the guide hair rod; The spatial position of the target rod is determined based on the relative position of the guide rod control point on the face, the shape of the curve where the guide rod is located, and the relative length between the guide rod and the face.

[0010] According to a method for redirecting virtual human hair provided by the present invention, the step of determining the relative position of the guide hair rod control point on the human face comprises: Determine at least one face mesh vertex in the template face that is adjacent to the guide rod control point; The relative position is determined based on the spatial position information of the guide rod control point and the at least one face mesh vertex.

[0011] According to a method for redirecting virtual human hair provided by the present invention, the step of determining the relative length between the hair guide rod and the human face comprises: Determine the correspondence between the guide rod control point and the central axis of the face; wherein the central axis is composed of a plurality of longitudinal line segments connected at the ends, and the correspondence is determined based on the longitudinal coordinates of the guide rod control point and the endpoints of the longitudinal line segments; The relative length between the guide rod and the human face is determined based on the longitudinal line segment corresponding to the guide rod control point.

[0012] According to a method for redirecting hair of a virtual person provided by the present invention, the central axis of the face also includes a reference point of the lower part of the nose and a reference point of the tip of the chin, and determining the corresponding relationship between the guide hair rod control point and the central axis of the face includes: In response to the longitudinal coordinate of the guide rod control point being between the longitudinal coordinates of the nose lower reference point and the chin tip reference point, the longitudinal coordinate of the guide rod control point is identified based on a position ratio of a certain longitudinal line segment.

[0013] The present invention also provides a device for redirecting virtual human hair, comprising the following units: An acquisition unit, used for acquiring a template face corresponding to a target face; A redirection processing unit, configured to perform redirection processing on the hair roots and hair shafts of the template face to obtain target hair roots and target hair shafts corresponding to the target face; A generating unit is used to generate hair of the target face.

[0014] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, any of the above methods for redirecting virtual human hair is implemented.

[0015] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for redirecting virtual human hair as described in any one of the above is implemented.

[0016] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the method for redirecting hair of a virtual person as described above is implemented.

[0017] The method, device, electronic device and storage medium for redirecting virtual human hair provided by the present invention obtain a template face corresponding to a target face; redirect the hair roots and hair shafts of the template face to obtain target hair roots and target hair shafts corresponding to the target face; and generate hair for the target face. The method takes into account the difference in face shape between the target face and the template face, which results in the inability of the hairstyle of the template face to perfectly match the target face, thereby redirecting the hair roots and hair shafts of the template face to obtain target hair roots and target hair shafts corresponding to the target face, so that the presentation effect of the hair on the template face is the same as the presentation effect of the hair on the target face, and will not be affected by the difference in face shape, thereby allowing the hairstyle of the template face to perfectly match the target faces of different face shapes, meet user needs, and improve user experience. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0019] Figure 1 It is a schematic diagram of the incompatibility of hairstyle and face shape in the related art.

[0020] Figure 2 It is a flow chart of the method for redirecting virtual human hair provided by the present invention.

[0021] Figure 3 It is a schematic diagram of the face mesh of a 3D virtual human provided by the present invention.

[0022] Figure 4 It is a schematic diagram of selecting position reference points at the face mesh vertices of a template face provided by the present invention.

[0023] Figure 5 It is a schematic diagram of the distribution of position reference points and source hair roots in the side view of the template face provided by the present invention.

[0024] Figure 6 It is a schematic diagram of the distribution of position reference points formed by directly migrating source hair roots to target human face and target hair roots in the side view of the target human face in the prior art provided by the present invention.

[0025] Figure 7 It is a schematic diagram of the distribution of position reference points and target hair roots in a side view of a target face formed after deforming source hair roots using a radial basis function deformation field provided by the present invention.

[0026] Figure 8 It is a schematic diagram of the central axis reference point in the template face provided by the present invention.

[0027] Fig. 9 It is a structural schematic diagram of a device for redirecting virtual human hair provided by the present invention.

[0028] Fig.10 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

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

[0030] The terms "first", "second", etc. in the present invention are used to distinguish similar objects, rather than to describe a specific order or precedence. It should be understood that the terms used in this way can be interchangeable where appropriate, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of the same type.

[0031] With the continuous development of 3D virtual human technology, 3D video generation platforms allow users to create personalized 3D virtual human images as characters in 3D videos on the platform. Specifically, users can choose different hairstyles, face shapes, facial features, decorations, and clothing for 3D virtual humans to create personalized 3D virtual humans.

[0032] It can be understood that hairstyle refers to the length, color and shape of the hair that can be observed by the naked eye. When combining hairstyles with different face shapes, the hair color can remain unchanged, maintaining the same visual effect on different face shapes, but the length and shape of the hair will be affected by the face shape, showing different visual effects on different face shapes, that is, it cannot perfectly adapt to different face shapes.

[0033] Specifically, the virtual person's hair can be divided into two parts according to the location: the hair root and the hair shaft. The hair root refers to the root of the hair that is closely connected to the scalp and is the starting point of hair growth. The hair shaft refers to the visible part of the hair, which is exposed outside the scalp and specifically includes the middle part and the hair tip. For some short hair styles, when they are applied to the template face, the hair root and the auricle are in close contact, but when they are applied to some faces, the hair root and the auricle cannot be kept in close contact, and the distance is far, requiring manual adjustment. Similarly, for some long hair styles, when they are applied to the template face, the hair tip is in close contact with the ear, but when they are applied to some faces, the hair tip and the auricle cannot be kept in close contact.

[0034] Simply put, different people have different facial shapes and facial features, especially the position, shape, size and other features of the ears. As a result, a hairstyle that fits the ears of the template face cannot continue to fit when migrated to some faces, and the hair needs to be redirected according to the head shape and facial features.

[0035] Figure 1is a schematic diagram of the incompatibility between hairstyle and face shape in the related art, such as Figure 1 As shown, the hair roots of the face on the right are tightly attached to the back of the ears, while the same hairstyle applied to the face on the left has the hair roots farther away from the ears, indicating that the hairstyle is not suitable for the face on the left.

[0036] In order to solve the above problem, the present invention provides a method for virtual human hair redirection.

[0037] Figure 2 FIG. 1 is a flow chart of a method for redirecting hair of a virtual person provided by the present invention. Figure 2 As shown, the method includes step 110 , step 120 and step 130 .

[0038] Step 110: Acquire a template face corresponding to the target face.

[0039] Specifically, a template face corresponding to the target face can be obtained. Here, the template face refers to a face that is adapted to the hairstyle selected by the user for the target face. Different hairstyles are pre-configured on the corresponding template faces for display, so that users can intuitively experience the display effects of different hairstyles and choose their favorite hairstyles. The template face of a 3D virtual person is a pre-designed 3D face with a specific shape and features. This template face is usually used as the basic framework for creating a target face of a 3D virtual person, which can greatly simplify the hair redirection process of a 3D virtual person.

[0040] It is understandable that the template face ensures that the generated 3D virtual human has a certain standardization in shape and features, which is convenient for subsequent processing and application. Furthermore, based on the template face, it can be further modified and customized to meet specific needs.

[0041] Among them, the target face of the 3D virtual human refers to the 3D model of the real human face that is obtained through some means (such as scanning, shooting, etc.) and needs to be restored or simulated.

[0042] The acquired target face of the 3D virtual human can be used in various application scenarios, such as 3D video generation, virtual makeup trial, virtual anchor, game character, etc., which is not specifically limited in the embodiment of the present invention.

[0043] Step 120, redirecting the hair roots and hair shafts of the template face to obtain target hair roots and target hair shafts corresponding to the target face.

[0044] Specifically, considering that when the hairstyle of the template face is applied to the target face, there will be a problem of hairstyle mismatch, therefore, it is necessary to redirect the hair roots and hair shafts of the template face to obtain the target hair roots and target hair shafts corresponding to the target face.

[0045] Furthermore, the face of a 3D virtual person can be regarded as an irregular surface in three-dimensional space. The roots of the hair are directly in contact with the scalp and attached to the scalp. Therefore, when redirecting the hair, it is necessary to ensure that the coordinates of the roots in three-dimensional space are located on the surface that constitutes the face. In addition, the hair roots and hair shafts together constitute the hair as a whole. The position of the hair roots determines the position of the hair in three-dimensional space, and the shape and length of the hair shafts determine the shape and length of the hair in three-dimensional space.

[0046] Therefore, the hair roots of the target face can be relocated to the spatial position of the target hair roots, and the hair shafts of the target face can be redirected to the spatial position of the target hair shafts.

[0047] Here, the spatial position of the target hair roots is used to reflect the position information of the hair roots in the target face of the 3D virtual person in three-dimensional space. The spatial position of the target hair roots is obtained by deforming the source hair roots in the face template. The deformation is based on the differences in face shape and facial features (especially ears) between the template face and the target face.

[0048] The spatial position of the target rod is used to reflect the position information of the rod in the target face of the 3D virtual person.

[0049] Step 130, generating hair of the target face.

[0050] Specifically, after redirecting the hair roots and hair shafts of the template face to obtain the target hair roots and target hair shafts corresponding to the target face, the hair of the target face can be generated based on the target hair roots and target hair shafts. This can be achieved by some geometric modeling techniques, such as polygonal mesh modeling, curve modeling, etc., which are not specifically limited in the embodiments of the present invention. In this way, the hair of the generated target face is perfectly adapted to the characteristics and style of the target face.

[0051] In addition, in order to make the 3D virtual human's hair more realistic in visual effects, the scalp of the 3D virtual human will be textured, that is, the scalp will be colored using a map to make it visually close to a scalp covered with hair. This can be achieved using shadow texture maps (shadow mask) and scalp detail texture maps (detail mask).

[0052] It should be understood that the hair roots of the 3D virtual person are located in the scalp part, and the deformation process causes the position of the target hair roots to be offset compared to the source hair roots, so the coverage area of ​​the scalp on the face needs to be adjusted accordingly. Specifically, the source shadow texture map (source shadowmask) and the source scalp detail texture map (source detail mask) adapted to the template face can be deformed into the target shadow texture map (target shadow mask) and the target scalp detail texture map (target detail mask) adapted to the target face by texture mapping, and then the target shadow texture map and the target scalp detail texture map are used to color the scalp part of the target face.

[0053] It should be noted that the method provided by the embodiment of the present invention can be applied to the field of 3D virtual human video generation. On the one hand, it not only improves the realism and naturalness of the virtual human, but also improves production efficiency and reduces costs, while enhancing the personalized customization capabilities of the virtual characters and expanding the application fields and market demand.

[0054] In addition, the method provided by the embodiment of the present invention can also be applied to the field of virtual makeup trial. In the field of virtual makeup trial, by comparing the template face and the target face, and reconstructing and generating hair that matches the target face, a more realistic and personalized makeup trial experience can be provided to the user. The method provided by the embodiment of the present invention can also be applied to the field of game and animation production. In game and animation production, the virtual human hair reconstruction method based on the target hair root and the target hair shaft can generate more realistic and vivid character hair, improving the realism of the game and the visual effect of the animation.

[0055] The method provided by the embodiment of the present invention obtains a template face corresponding to a target face; redirects the hair roots and hair shafts of the template face to obtain target hair roots and target hair shafts corresponding to the target face; and generates hair for the target face. The method takes into account the difference in face shape between the target face and the template face, which results in the inability of the hairstyle of the template face to perfectly match the target face, thereby redirecting the hair roots and hair shafts of the template face to obtain target hair roots and target hair shafts corresponding to the target face, so that the presentation effect of the hair on the template face is the same as the presentation effect of the hair on the target face, and will not be affected by the difference in face shape, thereby enabling the hairstyle of the template face to perfectly match the target faces of different face shapes, meeting user needs and improving user experience.

[0056] Based on the above embodiment, the steps of redirecting the hair roots of the template face include: Step 210, selecting at least one first position reference point from the face mesh vertices of the template face, and selecting a second position reference point corresponding to the first position reference point from the target face mesh vertices of the target face; Step 220, constructing a radial basis function deformation field based on the position information of the first position reference point and the second position reference point in the side view; Step 230, using the radial basis function deformation field to process the position information of the source hair root in the side view of the template face, and determine the position information of the target hair root in the side view of the target face; Step 240, determining the spatial position of the target hair root based on the position information of the target hair root and the spatial surface of the target face.

[0057] To facilitate subsequent explanations, the face mesh of a 3D virtual human is first explained. Figure 3 is a schematic diagram of a face grid of a 3D virtual person provided by the present invention, such as Figure 3 As shown in the figure, the face of a 3D virtual person can be regarded as an irregular surface in three-dimensional space. In order to facilitate the processing of the irregular surface, the irregular surface can be first segmented into countless triangles or quadrilaterals, thereby forming a face mesh as shown in the figure above. The face mesh consists of face mesh lines and face mesh vertices. A face mesh vertex refers to each node or endpoint on the mesh in the face mesh.

[0058] Figure 4 is a schematic diagram of selecting position reference points at the face mesh vertices of the template face provided by the present invention, such as Figure 4 As shown, at least one vertex is selected from the face mesh vertices of the template face as the first position reference point, usually some mesh vertices of the scalp part and the mesh vertices of the auricle part are selected, and a second position reference point corresponding to the first position reference point is selected from the face mesh vertices of the target face. Due to the differences in the face shape and auricle part of the template face and the target face, the position reference points of the temples and auricle parts of the two are offset in the side view.

[0059] Here, the radial basis function deformation field can be constructed with the help of the position information of the first position reference point and the corresponding second position reference point in the side view to realize the deformation of the source root in the face template. As the name implies, the radial basis function deformation field is a deformation field constructed based on the radial basis function. The radial basis function is a real-valued function whose value depends only on the distance from the origin or any point c, denoted as or Here, the position information of the first position reference point may be a two-dimensional coordinate vector , the position information of the second position reference point can be a two-dimensional coordinate vector .

[0060] That is, the two-dimensional coordinate vector of the first position reference point can be , and the two-dimensional coordinate vector of the second position reference point , construct and train the radial basis function deformation field, the initial formula of the radial basis function deformation field is as follows: in, and is the number of location reference points, and Indicates i (or j ) two-dimensional coordinate vectors of position reference points, and for The constant coefficient of the function, The function is the radial basis function, and the expression is , and represents independent linear transformations.

[0061] It should be noted that many constant coefficients in the initial formula and The value of has not yet been determined and cannot be used directly to deform the position information of the source root. Therefore, it is necessary to determine the values ​​of many constant coefficients first.

[0062] Specifically, the radial basis function deformation field is trained using the position information of the first position reference point on the template face and the corresponding second position reference point on the target face, that is, the two-dimensional coordinate vector of the position reference point of the template face and the target face on the side view is and Substitute into the function respectively and , in order to calculate the many constant coefficients in the corresponding formula of the radial basis function deformation field and The value of , so that the final formula corresponding to the trained radial basis function deformation field is as follows: After the radial basis function deformation field is trained, the position information of the source root in the template face on the side view (for example, the two-dimensional coordinate vector ) Input the trained radial basis function deformation field to obtain the position information of the target hair root in the side view of the target face. For example, the two-dimensional coordinate vector Among them, the source hair roots refer to the hair roots in the template face, and the target hair roots refer to the hair roots in the target face.

[0063] Finally, the two-dimensional coordinate vector can be based on the position information of the target root, for example and the spatial surface of the target face to determine the spatial position of the target hair root. Here, the spatial position of the target hair root is used to reflect the position information of the target hair root in the three-dimensional space, and the spatial position of the target hair root can be the three-dimensional coordinate of the target hair root, thereby realizing the deformation from the source hair root to the target hair root.

[0064] Based on the above description, it can be seen that the face of a 3D virtual person can be regarded as an irregular curved surface in a three-dimensional space, so the three-dimensional coordinates of the target hair root must be located on the curved surface of the target face. After calculating the two-dimensional coordinates of the target hair root in the side view of the target face, combined with the spatial curved surface of the target face, the three-dimensional coordinates of the target hair root in the three-dimensional space can be determined.

[0065] It is understandable that, since the position information of the target hair root in the side view of the target face is a two-dimensional coordinate, and the spatial position of the target hair root is a three-dimensional coordinate, the process of determining the spatial position of the target hair root on the target face is essentially a process of converting the two-dimensional coordinate to the three-dimensional coordinate. In the field of image processing, there are many ways to achieve the above-mentioned conversion of the two-dimensional coordinate to the three-dimensional coordinate.

[0066] Here, the embodiment of the present invention uses the centroid coordinates to complete this conversion. Specifically, the position information of the target hair root can be used to determine the cell where each target hair root is located in the two-dimensional grid under the side view of the target face, and the centroid coordinates of the target hair root in the cell are calculated according to the vertex position of the cell.

[0067] It can be understood that each target root has a corresponding barycentric coordinate, which can also be called an area coordinate or a centroid coordinate, and is a coordinate calculated with reference to the vertex position of the cell where the target root is located. In a two-dimensional grid, the vertex position of each cell is a two-dimensional coordinate. Among them, the barycentric coordinate is a way to describe the internal position of a point relative to a triangle or quadrilateral (i.e., a cell).

[0068] Thereafter, the cells and centroid coordinates corresponding to each target hair root are applied to the face mesh of the target face, and the spatial position of the target hair root on the target face can be obtained. It can be understood that the spatial surface of the target face is a three-dimensional mesh, and the vertex position of each cell in the three-dimensional mesh is a three-dimensional coordinate. The cell where each target hair root is located in the two-dimensional mesh is consistent with the cell where the corresponding target hair root is located in the spatial surface of the target face.

[0069] Therefore, according to the centroid coordinates of each target hair root and the vertex position of the cell where the corresponding target hair root is located in the facial grid of the target face, the spatial position of the target hair root on the target face can be calculated, that is, the centroid coordinates of each target hair root are multiplied by the vertex position of the cell where the corresponding target hair root is located in the facial grid of the target face to obtain the spatial position of the corresponding target hair root on the target face.

[0070] For example, the centroid coordinates of the target hair root are (u, v, w), and the coordinates of the vertex position of the cell corresponding to the target hair root in the spatial surface of the target face are A (x1, y1, z1), B (x2, y2, z2), and C (x3, y3, z3).

[0071] Then, the coordinates (X, Y, Z) of the target root P in three-dimensional space can be calculated by the following formula: X=ux1+vx2+wx3 Y=uy1+vy2+wy3 Z=uz1+vz2+wz3 In addition, if a more precise position is required, surface fitting or interpolation techniques can be used to estimate the exact spatial position of the target hair root based on the position information of surrounding points.

[0072] Figure 5 is a schematic diagram of the distribution of position reference points and source hair roots in the side view of the template face provided by the present invention, Figure 6 The present invention provides a schematic diagram of the distribution of the position reference points formed by directly migrating the source hair roots to the target face and the target hair roots in the side view of the target face. Figure 7 : is a schematic diagram of the distribution of the position reference points and the target hair roots in the side view of the target face formed after the source hair roots are deformed using the radial basis function deformation field provided by the present invention, such as Figure 5 , Figure 6 and Figure 7 As shown, Figure 5 The central reference point is the red dot, and the origin root is the blue area. Figure 6 The middle position reference point is a black dot, and the target hair root is a green area. Figure 7 The middle position reference point is a black dot, and the target hair root is a green area.

[0073] It can be seen that a radial basis function deformation field from the template face to the target face is constructed based on the coordinate offset of the hair root reference point, and the position information of the source hair root is deformed using the deformation field to obtain the position information of the target hair root. The coordinate offset between the source hair root and the target hair root is applied to the entire hair, so that the hairstyle and face shape of the 3D virtual person are perfectly adapted.

[0074] Based on the above embodiment, the method further includes: Step 310, deforming the shadow texture map and the scalp detail texture map adapted to the template face to obtain a target shadow texture map and a target scalp detail texture map adapted to the target face; Step 320: Apply the target shadow texture map and the target scalp detail texture map to the target face.

[0075] Specifically, in order to make the virtual person's hair more realistic in visual effect, the virtual person's scalp will be textured, that is, the scalp will be colored using a map to make it visually close to a scalp covered with hair. This can be achieved using shadow texture maps and scalp detail texture maps.

[0076] It should be understood that the hair roots of the virtual person are located in the scalp, and the deformation process causes the position of the target hair roots to be offset compared to the source hair roots. Therefore, the coverage area of ​​the scalp on the human face also needs to be adjusted accordingly.

[0077] Therefore, the shadow texture map adapted to the template face is deformed to obtain a target shadow texture map adapted to the target face, and then the scalp detail texture map adapted to the template face is deformed to obtain a target scalp detail texture map adapted to the target face. Finally, the target shadow texture map and the target scalp detail texture map are applied to the target face.

[0078] Here, the shadow texture map is usually an image containing face shadow information, which is used to enhance the three-dimensional sense and realism of the face. The scalp detail texture map contains the detail information of the scalp, such as hair follicles, scalp texture, etc. Among them, the deformation processing method includes texture mapping and Dirichlet free deformation method, etc., which are not specifically limited in the embodiment of the present invention.

[0079] The template face is a standard face model used to determine the adaptation position and size of the texture map, and the target face is the face model to which the texture map is ultimately applied.

[0080] Before applying the shadow texture map and the scalp detail texture map to the target face, they may need to be merged into one texture map, which usually involves image synthesis techniques, such as superposition, blending, etc., which are not specifically limited in the embodiments of the present invention.

[0081] Based on the above embodiment, the redirection processing step of the hairpin of the template face includes: Step 410, determining the spatial position of the target stem based on the relative position of the stem control point on the human face, the shape of the curve on which the stem is located, and the relative length between the stem and the human face.

[0082] Specifically, the strand can be viewed as a curve containing a number of strand control points. The coordinates of these strand control points in three-dimensional space determine the shape and length of the strand. Therefore, the redirection of the strand is essentially the redirection of the spatial positions of the strand control points corresponding to the strand in three-dimensional space.

[0083] In addition, based on the above description, it can be known that in order to make the hairstyle maintain the same visual effect on different face shapes, the key is to adjust the length and shape of the hair to adapt to different face shapes, and the length and shape of the hair mainly depends on the hair shaft. Therefore, the embodiment of the present invention determines the spatial position of the target hair shaft based on the relative position of the hair shaft control point on the face, the shape of the curve where the hair shaft is located, and the relative length of the hair shaft and the face, so that the target hair shaft and the target face are perfectly adapted.

[0084] It should be noted that the human face here includes a template face and a target face, that is, the spatial position of the target stem can be determined based on the relative positions of the stem control points on the template face and the target face, the shape of the curve on which the stem is located, and the relative lengths of the stem and the template face and the target face.

[0085] Based on the above embodiment, step 410 includes: Step 411, sampling the hair rod of the template face to obtain a guide hair rod, and determining the guide hair rod control point based on the guide hair rod; Step 412, determining the spatial position of the target rod based on the relative position of the guide rod control point on the human face, the shape of the curve where the guide rod is located, and the relative length between the guide rod and the human face.

[0086] Specifically, considering that the number of all hair rods of the template face is huge, it would take a lot of computing power and time to deform all of the hair rods. In order to reduce the consumption of computing power and time, the embodiment of the present invention selects some hair rods from all the hair rods as templates for deformation processing by sampling, which are hereinafter referred to as guide hair rods.

[0087] Specifically, all hair rods of the template face may be sampled at a preset ratio (eg, 1 / 10) to obtain the guide hair rods of the template face.

[0088] Based on the above description, it can be known that each hair rod in the embodiment of the present invention corresponds to a number of hair rod control points, and the guide hair rod is sampled from all hair rods. Accordingly, each guide hair rod also corresponds to a number of guide hair rod control points to determine the shape and length of the guide hair rod.

[0089] It should be noted that, in order to generate all the redirected target hairpins based on all the redirected guide hairpins after the redirection is completed, it is first necessary to establish a linear relationship between the hairpins and the guide hairpins in the template face: For each hair bar of the template face, determine the two nearest guide hair bars, record them as guide hair bar 1 and guide hair bar 2, and calculate the corresponding hair bar according to the following formula: , and Values: in, and are the coefficients corresponding to guide rod 1 and guide rod 2 respectively, and are the vectors corresponding to the guide rod 1 and the guide rod 2 respectively, and the vectors are composed of the numerical sequence of the three-dimensional coordinates of the guide rod control points corresponding to the guide rods, is the vector corresponding to the rod, which is composed of the numerical sequence of the three-dimensional coordinates of the rod control point corresponding to the rod. is the compensation vector, the dimension of which is , , Similarly, the elements of this vector are constants in the linear relationship between the guide rod and the rod at the three-dimensional coordinates of the control point.

[0090] From the above description, we can see that for each hair rod of the template face, the vector corresponding to , corresponding to the only , , , and , thereby establishing a linear relationship between each firing rod and the two nearest guide firing rods.

[0091] It should be noted that the linear relationship between the hairpin and the guide hairpin established in the template face in the embodiment of the present invention remains unchanged between the guide hairpin and the target hairpin after redirection.

[0092] Therefore, after redirection, the spatial position of the target hairpin after the hairpin redirection in the target face can be determined based on the first guiding hairpin vector corresponding to the redirected guiding hairpin 1 and the second guiding hairpin vector corresponding to the redirected guiding hairpin 2, as well as the first coefficient corresponding to the first guiding hairpin vector and the second coefficient corresponding to the second guiding hairpin vector.

[0093] The spatial position of the target serve can be expressed in the form of a target serve vector, and the calculation formula of the target serve vector is as follows: in, represents the first guiding rod vector corresponding to the redirected guiding rod 1, represents the second guiding rod vector corresponding to the redirected guiding rod 2, wherein the first guiding rod vector The second guide rod vector is composed of the numerical sequence of the three-dimensional coordinates of the guide rod control point corresponding to the redirected guide rod 1. It is composed of the numerical sequence of the three-dimensional coordinates of the guide rod control point corresponding to the redirected guide rod 2, and Still represent the coefficients corresponding to the redirected guide rod 1 and the guide rod 2 respectively, represents the target launch vector, which is composed of the numerical sequence of the three-dimensional coordinates of the launch control point corresponding to the target launch. represents the compensation vector, the dimension of which is the same as , , Similarly, the elements of this vector are constants in the linear relationship between the redirected guide rod and the target rod at the three-dimensional coordinates of the control point, , and Keep the value unchanged before and after redirection.

[0094] Among them, the first guiding launch vector and the second guide launch vector They are all based on the three-dimensional coordinate vectors of the guide rod control points corresponding to the redirected guide rod 1 and guide rod 2 respectively. Sure.

[0095] Considering that for some long hair styles, when adapting to different faces, the relative position of the hair ends and facial features needs to remain unchanged. For example, when the hairstyle is adapted to the template face, the hair ends are located at the earlobes. Then, when migrating the hairstyle to the target face, it is also necessary to ensure that the hair ends are located at the earlobes of the target face. Therefore, the relative length of the guide rod and the face needs to be considered.

[0096] Furthermore, the spatial position of the target rod can be determined based on the relative position of the guide rod control point on the face, the shape of the curve where the guide rod is located, and the relative length between the guide rod and the face.

[0097] Here, the relative position of the hair guide rod control point on the face can be determined based on the position information of the face mesh vertices near the hair guide rod control point and the three-dimensional coordinate compensation vector corresponding to each face mesh vertex.

[0098] The method provided by the embodiment of the present invention can, on the one hand, accurately determine the spatial position information of the guide hair rod by clarifying the relative position of the guide hair rod control point on the face, thereby avoiding deviation during the operation process; on the other hand, by utilizing the shape of the curve where the guide hair rod is located, it can better fit the contour and features of the face, so that the generated target face is more natural and smooth visually; according to the relative length of the guide hair rod and the face, the length of the hair rod can be flexibly adjusted, which helps to keep the hair tips relative to the facial features at all times.

[0099] Furthermore, the spatial position of the target hair rod can be optimized with multiple constraints based on the relative position of the guide hair rod control point on the human face, the shape of the curve on which the guide hair rod is located, and the relative length of the guide hair rod and the human face. It can be understood that the multi-constraint joint optimization not only considers a single constraint condition, but also optimizes by combining multiple constraint relationships, so that the final spatial position of the target hair rod is more robust, that is, it can maintain good stability and accuracy under different conditions, thereby further improving the accuracy and reliability of virtual human hair redirection.

[0100] Based on the above embodiment, the step of guiding the relative position of the shooting rod control point on the face of a person includes: Step 510, determining at least one face mesh vertex adjacent to the guide rod control point in the template face; Step 520: Determine the relative position based on the spatial position information of the guide rod control point and at least one face mesh vertex.

[0101] Specifically, at least one face mesh vertex adjacent to the guide rod control point in the template face is first determined, and further, at least one face mesh vertex closest to the guide rod control point in the template face can be determined. Here, three adjacent and closest face mesh vertices can be selected, and the face mesh vertex numbers are respectively , , .

[0102] It should be noted that, in the template face mesh, for a given guide hairpin control point, the distance between it and all face mesh vertices is calculated. The distance can be calculated using methods such as Euclidean distance. Among all the calculated distances, find the mesh vertex with the smallest distance to the guide hairpin control point. This point is the face mesh vertex that is closest to the guide hairpin control point. Since the three face mesh vertices that are closest to the guide hairpin control point in the template face need to be determined in the embodiment of the present invention, all calculated distances are arranged from small to large, and the first three face mesh vertices with smaller distances are taken as the three face mesh vertices that are adjacent to the guide hairpin control point in the template face.

[0103] Then, based on the spatial position information of the guide rod control point and at least one face mesh vertex, the relative position is determined.

[0104] The spatial position information may be a three-dimensional coordinate vector. For example, based on the three-dimensional coordinate vector of the guide rod control point and the three-dimensional coordinate vector of the first face mesh vertex, the three-dimensional coordinate vector of the guide rod control point and the three-dimensional coordinate vector of the second face mesh vertex, and the three-dimensional coordinate vector of the guide rod control point and the three-dimensional coordinate vector of the third face mesh vertex, a three-dimensional coordinate compensation vector is determined. The formula of the three-dimensional coordinate compensation vector is as follows: in, is the three-dimensional coordinate vector of the control point guiding the launch, , , are the three-dimensional coordinate vectors of the first face mesh vertex, the second face mesh vertex, and the third face mesh vertex, respectively. , , They are the three-dimensional coordinate compensation vectors between the guide hair rod control point and the face mesh vertex, thereby establishing a corresponding relationship between each guide hair rod control point and the three nearest adjacent face mesh vertices.

[0105] Based on the above embodiment, the step of determining the relative length between the guide rod and the face of the person includes: Step 610, determining the correspondence between the guide rod control point and the central axis of the face; wherein the central axis is composed of a plurality of longitudinal line segments connected at the ends, and the correspondence is determined based on the longitudinal coordinates of the guide rod control point and the endpoints of the longitudinal line segments.

[0106] Specifically, for some long hair styles, when adapting to different faces, the ends of the hair need to maintain a relative position with the facial features. For example, when the hairstyle is adapted to the template face, the ends of the hair are located at the earlobes, so when migrating the hairstyle to the target face, it is also necessary to ensure that the ends of the hair are located at the earlobes of the target face.

[0107] That is, the correspondence between the guide rod control point and the central axis of the face is first determined, wherein the central axis is composed of a number of longitudinal line segments connected at the ends, and the correspondence is determined based on the longitudinal coordinates of the guide rod control point and the endpoints of the longitudinal line segments.

[0108] Step 620: Determine the relative length between the guide rod and the human face based on the longitudinal line segment corresponding to the guide rod control point.

[0109] It should be noted that the central axis of the face refers to the line starting from the forehead and connecting the center of the eyebrows, nose, lips, and chin. This line is the main axis of the face and plays a decisive role in the symmetry and balance of the face.

[0110] Specifically, the longitudinal coordinates of each guide rod control point can be determined and compared with the longitudinal coordinates of the endpoints of the longitudinal line segment. By comparing these longitudinal coordinates, it is determined which longitudinal line segment on the central axis the guide rod control point corresponds to, that is, the corresponding relationship is determined.

[0111] For example, the central axis of the face model includes ten longitudinal line segments of the face grid. The longitudinal coordinate of the guide rod control point is 6.4, which belongs to the interval range of the central axis [0, 10]. The length of the longitudinal line segment is 1, and 6.4 corresponds to the 7th longitudinal line segment of the central axis.

[0112] Based on the above embodiment, the central axis of the face also includes a reference point of the lower part of the nose and a reference point of the tip of the chin, and step 610 includes: Step 611, in response to the longitudinal coordinate of the guide rod control point being between the longitudinal coordinates of the nose lower reference point and the chin tip reference point, the longitudinal coordinate of the guide rod control point is identified based on a position ratio of a certain longitudinal line segment.

[0113] Specifically, the central axis of the face also includes a reference point of the lower part of the nose and a reference point of the tip of the chin. Figure 8 is a schematic diagram of the central axis reference points in the template face provided by the present invention, such as Figure 8 As shown, the embodiment of the present invention uses the central axis reference point of the template face as a reference for guiding the control point of the hairpin in the longitudinal direction, mainly for the lower face area (i.e., from the lower part of the nose to the tip of the chin).

[0114] In response to the longitudinal coordinate of the leading hairpin control point being between the longitudinal coordinates of the nose lower reference point and the chin tip reference point, the longitudinal coordinate of the leading hairpin control point is identified based on a position ratio of a certain longitudinal line segment.

[0115] For example, the central axis of the face model from the tip of the chin to the lower part of the nose contains ten longitudinal segments of the face grid, the longitudinal coordinate value of the reference point of the tip of the chin is 0, the longitudinal coordinate value of the reference point of the lower part of the nose is 10, and the longitudinal coordinate value of the guide rod control point is 6.4, which belongs to the interval range of the central axis [0, 10]. Then 6.4 corresponds to 2 / 5 of the 7th longitudinal segment of the central axis, and the longitudinal coordinate of the guide rod control point can be marked as 2 / 5 of the 7th longitudinal segment. Thus, the longitudinal mapping relationship between the guide rod control point and the central axis reference point of the template face is established.

[0116] It should be noted that if the longitudinal coordinate of the guide rod control point is much larger than the longitudinal coordinate of the reference point at the lower part of the nose or much smaller than the longitudinal coordinate of the reference point at the tip of the chin, there is no need to process the value.

[0117] It is understandable that by marking with the position ratio of a certain longitudinal line segment, the longitudinal coordinate of the guide rod control point can be bound to a relative position on the central axis of the face. Compared with directly marking the position with length or other methods, the method of marking based on the position ratio can keep the hair tip relative to the facial features of different people, and keep the relative length of the redirected hair and the target face unchanged.

[0118] In the method provided by the embodiment of the present invention, in response to the longitudinal coordinate of the guide hair rod control point being between the longitudinal coordinates of the lower nose reference point and the chin tip reference point, the longitudinal coordinate of the guide hair rod control point is identified based on the position ratio of a certain longitudinal line segment, thereby ensuring the accuracy of the spatial position of the target hair rod, thereby maintaining the relative position of the hair tips and the facial features of different people.

[0119] Based on the above embodiment, after determining the relative position of the hairpin control point on the face, that is, the position information of the face mesh vertices near the guide hairpin control point, and the three-dimensional coordinate compensation vector corresponding to each face mesh vertex, the three-dimensional coordinates of the guide hairpin control point can be redirected: According to the mesh vertex number , , Determine three target face mesh vertices in the target face, and record the three-dimensional coordinate vectors of the target face mesh vertices as , , , the target face mesh vertices correspond one-to-one to the three face mesh vertices determined in step 510. Combined with the three-dimensional coordinate compensation vector calculated in step 520 , , , establish the following constraints to keep the relative positions of the rod control points on the face unchanged before and after redirection, which is the first constraint relationship: in, Represents the three-dimensional coordinate vector of the guide rod control point after redirection, that is, the target three-dimensional coordinate vector, , , represents the three-dimensional coordinate compensation vector, , , The 3D coordinate vectors of the target face mesh vertices representing the target face.

[0120] It should be noted that the target face mesh vertices of the target face are based on the mesh vertex numbers , , Three target face mesh vertices are determined in the target face, and the target face mesh vertices correspond one-to-one to the first face mesh vertex, the second face mesh vertex, and the third face mesh vertex.

[0121] It should be understood that the first constraint relationship in the embodiment of the present invention can be established based on any number of face mesh vertices, and the above example does not constitute a limitation to the embodiment of the present invention.

[0122] It can be understood that the Laplace operator smoothing term is a smoothing technique commonly used in image processing and computer graphics. By minimizing the smoothing term, the hair of the generated target face can be made more visually natural and smooth.

[0123] Therefore, a second constraint relationship can be established based on the first Laplacian operator smoothing term corresponding to the original guiding rod matrix and the second Laplacian operator smoothing term corresponding to the redirected guiding rod matrix to keep the shape of the rod curve unchanged before and after the redirection. That is, the formula of the second constraint relationship is as follows: in, represents the redirection guide rod matrix, represents the original guide rod matrix, represents the second Laplacian smoothing term corresponding to the redirection guide rod matrix, Represents the first Laplacian smoothing term corresponding to the original guide rod matrix.

[0124] The Laplacian smoothing term of the curve guiding the launch control point is established based on the following formula: in, is the Laplace matrix, defined as , L , D , A The number of rows and columns of the three matrices are the same, which is the number of control points of the guide rod.

[0125] D is the degree matrix of the curve. The diagonal elements of the degree matrix are used to represent the number of edges emitted by each guide rod control point, and the other elements are 0.

[0126] A is the adjacency matrix of the curve, the diagonal elements of the adjacency matrix are all 0, and the other elements are used to represent the adjacency relationship between the control points of the guide rod. If it is 0, it means no adjacency, and if it is 1, it means adjacency.

[0127] Therefore, the Laplacian matrixL ( ) is used to indicate the number of edges emitted by each guide rod control point, and the other elements are used to indicate the adjacency relationship between the guide rod control points. If it is 0, it means no adjacency, and if it is -1, it means adjacency.

[0128] Correspondingly, the Laplace operator smoothing term of the curve where the control point of the guide rod is located after redirection is: The original guide rod matrix includes the three-dimensional coordinate vectors of each guide rod control point before redirection, and the formula is as follows: in, is the original guide rod matrix, , … Indicates all the original guide rods corresponding to ( n ) The three-dimensional coordinate vector of the control point that guides the launch.

[0129] The redirected guide rod matrix includes the three-dimensional coordinate vectors of each guide rod control point after redirection, and the formula is as follows: in, To redirect the guide rod matrix, , … Indicates all the corresponding redirection guide rods ( n ) The three-dimensional coordinate vector of the control point that guides the launch.

[0130] After substituting the original guide rod matrix and the redirected guide rod matrix into the second constraint relationship, the second constraint relationship can be transformed into: Finally, based on the corresponding relationship between the relative lengths of the guide rod and the face, the y-axis coordinate of the guide rod control point is determined. The corresponding line segment and position ratio of the central axis are recorded as , determined based on the y-axis coordinate of the central axis reference point in the target face The corresponding y-axis coordinate , thereby establishing the third constraint relationship , The y-axis coordinate of the guide rod control point after redirection.

[0131] In summary, weights are assigned to the first constraint relationship, the second constraint relationship, and the third constraint relationship, and the above constraint relationships are optimized jointly to obtain the three-dimensional coordinate vectors of all the control points of the guide rod after redirection: , thereby determining the guide rod vector corresponding to all the guide rods after redirection .

[0132] It should be noted that when performing joint optimization, different weights can be assigned to the first constraint relationship, the second constraint relationship, and the third constraint relationship, or the same weight can be assigned to the first constraint relationship, the second constraint relationship, and the third constraint relationship. The embodiment of the present invention does not specifically limit this.

[0133] Based on each rod , , , and , combined with the target launch vector calculation formula , interpolate and calculate the target launch vector corresponding to all the target launches after redirection , transfer all the redirected target shots to the target face.

[0134] The device for redirecting the hair of a virtual person provided by the present invention is described below. The device for redirecting the hair of a virtual person described below and the method for redirecting the hair of a virtual person described above can be referred to each other.

[0135] Based on any of the above embodiments, the present invention provides a device for redirecting virtual human hair. Fig. 9 Schematic diagram of the structure of the device for redirecting virtual human hair provided by the present invention. Fig. 9 As shown, the device comprises: An acquisition unit 910 is used to acquire a template face corresponding to a target face; The redirection unit 920 is used to redirect the hair roots and hair shafts of the template face to obtain target hair roots and target hair shafts corresponding to the target face; The generating unit 930 is used to generate the hair of the target face.

[0136] The device provided by the embodiment of the present invention obtains a template face corresponding to a target face; redirects the hair roots and hair shafts of the template face to obtain target hair roots and target hair shafts corresponding to the target face; and generates hair for the target face. The method takes into account the difference in face shape between the target face and the template face, which results in the inability of the hairstyle of the template face to perfectly match the target face, thereby redirecting the hair roots and hair shafts of the template face to obtain target hair roots and target hair shafts corresponding to the target face, so that the presentation effect of the hair on the template face is the same as the presentation effect of the hair on the target face, and will not be affected by the difference in face shape, thereby allowing the hairstyle of the template face to perfectly match the target faces of different face shapes, meet user needs, and improve user experience.

[0137] Based on any of the above embodiments, it also includes a root redirection processing unit, and the root redirection processing unit is specifically used to: Selecting at least one first position reference point from the face mesh vertices of the template face, and selecting a second position reference point corresponding to the first position reference point from the target face mesh vertices of the target face; Constructing a radial basis function deformation field based on position information of the first position reference point and the second position reference point in the side view; Using a radial basis function deformation field to process the position information of the source hair root in the side view of the template face, and determine the position information of the target hair root in the side view of the target face; Based on the position information of the target hair root and the spatial surface of the target face, the spatial position of the target hair root is determined.

[0138] Based on any of the above embodiments, a texture mapping unit is further included, and the texture mapping unit is specifically used for: Deforming the shadow texture map and the scalp detail texture map adapted to the template face to obtain a target shadow texture map and a target scalp detail texture map adapted to the target face; Apply a target shadow texture map and a target scalp detail texture map to the target face.

[0139] Based on any of the above embodiments, it also includes a hair rod redirection processing unit and a hair root redirection processing unit, which are specifically used for: The spatial position determination unit is used to determine the spatial position of the target rod based on the relative position of the rod control point on the face, the shape of the curve where the rod is located, and the relative length between the rod and the face.

[0140] Based on any of the above embodiments, determining a spatial location unit is specifically used for: The hair rod of the template face is sampled to obtain a guide hair rod, and based on the guide hair rod, a guide hair rod control point is determined; The spatial position of the target rod is determined based on the relative position of the guide rod control point on the face, the shape of the curve where the guide rod is located, and the relative length between the guide rod and the face.

[0141] Based on any of the above embodiments, it further includes a relative position determining unit, the relative position determining unit is specifically used to: Determine at least one face mesh vertex adjacent to the guide rod control point in the template face; Based on the spatial position information of the guide rod control point and at least one face mesh vertex, a relative position is determined.

[0142] Based on any of the above embodiments, it also includes: A corresponding relationship determination unit, used to determine the corresponding relationship between the guide rod control point and the central axis of the face; wherein the central axis is composed of a plurality of longitudinal line segments connected at the ends, and the corresponding relationship is determined based on the longitudinal coordinates of the guide rod control point and the endpoints of the longitudinal line segments; The relative length determining unit is used to determine the relative length between the guide rod and the human face based on the longitudinal line segment corresponding to the guide rod control point.

[0143] Based on any of the above embodiments, the central axis of the face also includes a reference point of the lower part of the nose and a reference point of the tip of the chin, and the corresponding relationship determination unit is specifically used to: In response to the longitudinal coordinate of the leading hairpin control point being between the longitudinal coordinates of the nose lower reference point and the chin tip reference point, the longitudinal coordinate of the leading hairpin control point is identified based on a position ratio of a certain longitudinal line segment.

[0144] Fig.10 is a schematic diagram of the structure of the electronic device provided by the present invention, such as Fig.10 As shown, the electronic device may include: a processor 1010, a communication interface 1020, a memory 1030 and a communication bus 1040, wherein the processor 1010, the communication interface 1020 and the memory 1030 communicate with each other through the communication bus 1040. The processor 1010 may call the logic instructions in the memory 1030 to execute the method for redirecting the hair of a virtual person, the method comprising: obtaining a template face corresponding to a target face; redirecting the hair roots and hair shafts of the template face to obtain target hair roots and target hair shafts corresponding to the target face; and generating the hair of the target face.

[0145] In addition, the logic instructions in the above-mentioned memory 1030 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0146] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the method of virtual human hair redirection provided by the above methods, which method includes: obtaining a template face corresponding to a target face; redirecting the hair roots and hair shafts of the template face to obtain target hair roots and target hair shafts corresponding to the target face; and generating the hair of the target face.

[0147] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, it is implemented to execute the method for virtual human hair redirection provided by the above-mentioned methods, the method comprising: obtaining a template face corresponding to a target face; redirecting the hair roots and hair shafts of the template face to obtain target hair roots and target hair shafts corresponding to the target face; and generating the hair of the target face.

[0148] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0149] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0150] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for redirecting virtual human hair, characterized in that: include: Obtain a template face corresponding to the target face; Redirecting the hair roots and hair shafts of the template face to obtain target hair roots and target hair shafts corresponding to the target face; Generate hair for the target face.

2. The method for redirecting virtual human hair according to claim 1, characterized in that: The step of redirecting the hair roots of the template face comprises: Selecting at least one first position reference point from the face mesh vertices of the template face, and selecting a second position reference point corresponding to the first position reference point from the target face mesh vertices of the target face; constructing a radial basis function deformation field based on position information of the first position reference point and the second position reference point in the side view; Using the radial basis function deformation field to process the position information of the source hair roots in the side view of the template face, and determine the position information of the target hair roots in the side view of the target face; Based on the position information of the target hair root and the spatial curved surface of the target face, the spatial position of the target hair root is determined.

3. The method for redirecting virtual human hair according to claim 1, characterized in that: The method further comprises: Deforming the shadow texture map and the scalp detail texture map adapted to the template face to obtain a target shadow texture map and a target scalp detail texture map adapted to the target face; Applying the target shadow texture map and the target scalp detail texture map to the target human face.

4. The method for virtual human hair redirection according to any one of claims 1 to 3, characterized in that: The step of redirecting the hairpin of the template face comprises: The spatial position of the target stem is determined based on the relative position of the stem control point on the face, the shape of the curve on which the stem is located, and the relative length between the stem and the face.

5. The method for redirecting virtual human hair according to claim 4, characterized in that: The determining of the spatial position of the target stem based on the relative position of the stem control point on the face, the shape of the curve where the stem is located, and the relative length between the stem and the face includes: Sampling the hair rod of the template face to obtain a guide hair rod, and determining a guide hair rod control point based on the guide hair rod; The spatial position of the target rod is determined based on the relative position of the guide rod control point on the face, the shape of the curve where the guide rod is located, and the relative length between the guide rod and the face.

6. The method for redirecting virtual human hair according to claim 5, characterized in that: The step of determining the relative position of the guide rod control point on the face of the person comprises: Determine at least one face mesh vertex in the template face that is adjacent to the guide rod control point; The relative position is determined based on the spatial position information of the guide rod control point and the at least one face mesh vertex.

7. The method for redirecting virtual human hair according to claim 5, characterized in that: The step of determining the relative length between the guide rod and the human face comprises: Determine the correspondence between the guide rod control point and the central axis of the face; wherein the central axis is composed of a plurality of longitudinal line segments connected at the ends, and the correspondence is determined based on the longitudinal coordinates of the guide rod control point and the endpoints of the longitudinal line segments; The relative length between the guide rod and the human face is determined based on the longitudinal line segment corresponding to the guide rod control point.

8. The method for redirecting virtual human hair according to claim 7, characterized in that: The central axis of the human face also includes a reference point of the lower part of the nose and a reference point of the tip of the chin. The determining of the corresponding relationship between the guide rod control point and the central axis of the human face includes: In response to the longitudinal coordinate of the guide rod control point being between the longitudinal coordinates of the nose lower reference point and the chin tip reference point, the longitudinal coordinate of the guide rod control point is identified based on a position ratio of a certain longitudinal line segment.

9. A device for redirecting virtual human hair, characterized in that: include: An acquisition unit, used for acquiring a template face corresponding to a target face; A redirection processing unit, configured to perform redirection processing on the hair roots and hair shafts of the template face to obtain target hair roots and target hair shafts corresponding to the target face; A generating unit is used to generate hair of the target face.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the method for virtual human hair redirection as claimed in any one of claims 1 to 8 is implemented.

11. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for virtual human hair redirection as claimed in any one of claims 1 to 8 is implemented.

12. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for resetting virtual human hair as claimed in any one of claims 1 to 8 is implemented.