CN114078179A - Method and device for reconstructing three-dimensional hair model, electronic equipment and storage medium - Google Patents

Method and device for reconstructing three-dimensional hair model, electronic equipment and storage medium Download PDF

Info

Publication number
CN114078179A
CN114078179A CN202010800420.3A CN202010800420A CN114078179A CN 114078179 A CN114078179 A CN 114078179A CN 202010800420 A CN202010800420 A CN 202010800420A CN 114078179 A CN114078179 A CN 114078179A
Authority
CN
China
Prior art keywords
hair
basic shape
adjusted
shape model
cluster
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010800420.3A
Other languages
Chinese (zh)
Inventor
孙佳佳
马里千
张国鑫
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN202010800420.3A priority Critical patent/CN114078179A/en
Publication of CN114078179A publication Critical patent/CN114078179A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • G06T3/08
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/40Analysis of texture
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • G06T7/73Determining position or orientation of objects or cameras using feature-based methods
    • G06T7/75Determining position or orientation of objects or cameras using feature-based methods involving models

Abstract

The present disclosure relates to a method, an apparatus, an electronic device and a storage medium for reconstructing a three-dimensional hair model, the method comprising: acquiring a hair cluster to be adjusted and a corresponding basic shape model, wherein the basic shape model is a three-dimensional model representing the shape of a basic hairstyle, and the hair cluster to be adjusted and preset control points are distributed on the basic shape model; adjusting the basic shape model according to the adjustment operation on the preset control point, and determining the three-dimensional coordinate of the basic shape model after adjustment according to the three-dimensional coordinate of the preset control point after adjustment; adjusting the hair cluster to be adjusted on the basic shape model according to the three-dimensional coordinate adjusted by the basic shape model; and generating a three-dimensional hair model according to the adjusted hair cluster. Through the scheme of this disclosure, reduced the adjustment work that the designer was to hair cluster, reduced the time that the adjustment of hair cluster was spent, promoted designer's work efficiency.

Description

Method and device for reconstructing three-dimensional hair model, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of three-dimensional model reconstruction technologies, and in particular, to a method and an apparatus for reconstructing a three-dimensional hair model, an electronic device, and a storage medium.
Background
With the development of computer vision technology, three-dimensional reconstruction techniques have emerged. The three-dimensional reconstruction technology describes a real scene into a mathematical model conforming to the logical expression of a computer through the processes of depth data acquisition, preprocessing, point cloud registration and fusion, surface generation and the like. Because the creation of hair can obviously enhance the reality of the virtual image or the virtual character, and the three-dimensional reconstruction technology is the key technology for establishing the virtual reality expressing the objective world in a computer, the problem how to construct a vivid hair model by using the three-dimensional reconstruction technology is urgently needed to be solved.
In the related art, modeling is performed on the hair based on multidirectional constraints, and a complete hair model is reconstructed mainly by using the hair surface geometry, the hair surface direction and the head model geometry which are reconstructed from an image.
However, in the current three-dimensional hair modeling method, it takes a lot of time to adjust the hair cluster in the hair model.
Disclosure of Invention
The present disclosure provides a method and an apparatus for reconstructing a three-dimensional hair model, an electronic device, and a storage medium, so as to at least solve the technical problem in the related art that a large amount of time is required to adjust a hair cluster in a hair model. The technical scheme of the disclosure is as follows:
according to a first aspect of the embodiments of the present disclosure, there is provided a method for reconstructing a three-dimensional hair model, including:
acquiring a hair cluster to be adjusted and a corresponding basic shape model, wherein the basic shape model is a three-dimensional model representing the shape of a basic hairstyle, and the hair cluster to be adjusted and preset control points are distributed on the basic shape model;
adjusting the basic shape model according to the adjustment operation on the preset control point, and determining the three-dimensional coordinate of the basic shape model after adjustment according to the three-dimensional coordinate of the preset control point after adjustment;
adjusting the hair cluster to be adjusted on the basic shape model according to the three-dimensional coordinate adjusted by the basic shape model;
and generating a three-dimensional hair model according to the adjusted hair cluster.
In one embodiment, the obtaining of the hair bundle to be adjusted and the corresponding basic shape model includes:
acquiring an interested hair cluster and a corresponding original basic shape model, wherein the interested hair cluster is a hair cluster needing to be adjusted, and original control points are distributed on the original basic shape model;
copying the interesting hair cluster and the corresponding original basic shape model to obtain an interesting hair cluster copy and a corresponding original basic shape model copy, wherein original control point copies are distributed on the original basic shape model copy, the interesting hair cluster copy is used as the hair cluster to be adjusted, the corresponding original basic shape model copy is used as the basic shape model, and the original control point copy is used as the preset control point.
In one embodiment, the adjusting the hair bundle to be adjusted on the basic shape model according to the adjusted three-dimensional coordinates of the basic shape model includes:
obtaining the corresponding relation between the three-dimensional coordinates of the basic shape model and the three-dimensional coordinates of the hair cluster to be adjusted through the texture coordinates of the basic shape model;
determining the three-dimensional coordinate of the hair cluster to be adjusted according to the three-dimensional coordinate of the basic shape model after adjustment and the corresponding relation between the three-dimensional coordinate of the basic shape model and the three-dimensional coordinate of the hair cluster to be adjusted;
and adjusting the hair cluster to be adjusted on the basic shape model according to the adjusted three-dimensional coordinate of the hair cluster to be adjusted.
In one embodiment, the generating a three-dimensional hair model according to the adjusted hair cluster includes:
generating a plurality of bone points of the adjusted hair cluster according to the position information of the adjusted hair cluster on the corresponding basic shape model;
and performing skinning operation on the adjusted hair cluster according to the position information of each bone point.
In one embodiment, the bone points are evenly distributed along the length of the adjusted hair cluster.
In one embodiment, the skinning operation on the adjusted hair cluster according to the position information of each bone point includes:
adding bones to the adjusted hair cluster among the bone points according to the position information of the bone points;
acquiring position information of each vertex in the adjusted hair cluster;
acquiring the distance between each vertex and each bone point according to the position information of each vertex and the position information of each bone point;
generating skin weight of each vertex in the adjusted hair cluster according to the distance;
and associating the bones between each vertex and each bone point according to the skinning weight.
In one embodiment, the generation manner of the hair bundle to be adjusted includes:
acquiring a hair plane template, wherein the hair plane template comprises a plurality of projection drawings, and the projection drawings are obtained by projecting a basic shape model in a plurality of preset view directions;
selecting a target projection drawing from the hair plane template, and acquiring a drawn hair cluster through the target projection drawing;
determining the geometric information of the drawn hair cluster according to the position information of the drawn hair cluster in the target projection drawing and the geometric information of a basic shape model corresponding to the target projection drawing;
and generating the hair cluster to be adjusted according to the drawn geometric information of the hair cluster.
In one embodiment, the hair plane template is generated by a method comprising:
obtaining the basic shape model;
projecting the basic shape model in each preset view direction to obtain a projection view of the basic shape model in the preset view direction;
and generating the hair plane template according to the projection drawing of the basic shape model in the preset view direction.
According to a second aspect of the embodiments of the present disclosure, there is provided a reconstruction apparatus of a three-dimensional hair model, including:
the hair adjusting device comprises an acquisition module, a control module and a control module, wherein the acquisition module is configured to acquire a hair cluster to be adjusted and a corresponding basic shape model, the basic shape model is a three-dimensional model representing the shape of a basic hairstyle, and the hair cluster to be adjusted and preset control points are distributed on the basic shape model;
the model adjusting module is configured to perform adjusting operation according to the preset control points, adjust the basic shape model and determine three-dimensional coordinates of the basic shape model after adjustment through the three-dimensional coordinates of the preset control points;
a hair cluster adjusting module configured to perform adjustment of a hair cluster to be adjusted on the basic shape model according to the three-dimensional coordinates adjusted by the basic shape model;
a model generation module configured to perform generating a three-dimensional hair model from the adjusted hair cluster.
In one embodiment, the obtaining module is further configured to perform obtaining of a hair cluster of interest and a corresponding original basic shape model, where the hair cluster of interest is a hair cluster needing to be adjusted, and original control points are distributed on the original basic shape model; copying the interesting hair cluster and the corresponding original basic shape model to obtain an interesting hair cluster copy and a corresponding original basic shape model copy, wherein original control point copies are distributed on the original basic shape model copy, the interesting hair cluster copy is used as the hair cluster to be adjusted, the corresponding original basic shape model copy is used as the basic shape model, and the original control point copy is used as the preset control point.
In one embodiment, the hair cluster adjusting module is further configured to execute the corresponding relationship between the three-dimensional coordinates of the basic shape model and the three-dimensional coordinates of the hair cluster to be adjusted through the texture coordinates of the basic shape model; determining the three-dimensional coordinate of the hair cluster to be adjusted according to the three-dimensional coordinate of the basic shape model after adjustment and the corresponding relation between the three-dimensional coordinate of the basic shape model and the three-dimensional coordinate of the hair cluster to be adjusted; and adjusting the hair cluster to be adjusted on the basic shape model according to the adjusted three-dimensional coordinate of the hair cluster to be adjusted.
In one embodiment, the model generation module comprises a bone point generation unit and a skinning operation unit;
the skeleton point generating unit is configured to execute generating a plurality of skeleton points of the adjusted hair cluster according to the position information of the adjusted hair cluster on the corresponding basic shape model;
the skinning operation unit is configured to perform skinning operation on the adjusted hair cluster according to the position information of each bone point.
In one embodiment, the bone points are evenly distributed along the length of the adjusted hair cluster.
In one embodiment, the skinning operation unit is further configured to perform adding bones between the bone points for the adjusted hair cluster according to the position information of the bone points; acquiring position information of each vertex in the adjusted hair cluster; acquiring the distance between each vertex and each bone point according to the position information of each vertex and the position information of each bone point; generating skin weight of each vertex in the adjusted hair cluster according to the distance; and associating the bones between each vertex and each bone point according to the skinning weight.
In one embodiment, the reconstruction apparatus further includes a to-be-adjusted hair cluster generation module configured to execute to acquire a hair plane template, where the hair plane template includes a plurality of projection views obtained by projecting the basic shape model in a plurality of preset view directions; selecting a target projection drawing from the hair plane template, and acquiring a drawn hair cluster through the target projection drawing; determining the geometric information of the drawn hair cluster according to the position information of the drawn hair cluster in the target projection drawing and the geometric information of a basic shape model corresponding to the target projection drawing; and generating the hair cluster to be adjusted according to the drawn geometric information of the hair cluster.
In one embodiment, the reconstruction apparatus further comprises a hair plane template generation module configured to perform obtaining the base shape model; projecting the basic shape model in each preset view direction to obtain a projection view of the basic shape model in the preset view direction; and generating the hair plane template according to the projection drawing of the basic shape model in the preset view direction.
According to a third aspect of the embodiments of the present disclosure, there is provided an electronic apparatus including:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the method of reconstructing a three-dimensional hair model as described in any embodiment of the first aspect.
According to a fourth aspect of embodiments of the present disclosure, there is provided a storage medium, wherein instructions, when executed by a processor of an electronic device, enable the electronic device to perform the method of reconstructing a three-dimensional hair model as described in any one of the first aspect.
According to a fifth aspect of embodiments of the present disclosure, there is provided a computer program product comprising a computer program stored in a readable storage medium, from which the at least one processor of the device reads and executes the computer program, causing the device to perform the method of reconstructing a three-dimensional hair model as described in any one of the embodiments of the first aspect.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
the method comprises the steps of obtaining a hair cluster to be adjusted and a corresponding basic shape model, wherein the basic shape model is a three-dimensional model representing the shape of a basic hairstyle, and the hair cluster to be adjusted and preset control points are distributed on the basic shape model; adjusting the basic shape model according to the adjustment operation on the preset control point, and determining the three-dimensional coordinate of the basic shape model after adjustment according to the three-dimensional coordinate of the preset control point after adjustment; adjusting the hair cluster to be adjusted on the basic shape model according to the three-dimensional coordinate adjusted by the basic shape model; and generating a three-dimensional hair model according to the adjusted hair cluster. The method and the device adjust the hair clusters to be adjusted by adjusting the preset control points on the basic shape model. Because the number of the preset control points is far smaller than that of the vertexes of the basic shape model, compared with the prior art that the shape of the hair model is changed by adjusting the hair cluster through the vertexes, the time spent on adjusting the hair cluster is shortened, the workload of a designer is reduced, the time required by designing a single material is also reduced, and the generation efficiency of the three-dimensional hair model is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure and are not to be construed as limiting the disclosure.
Fig. 1 is an application environment diagram illustrating a method for reconstructing a three-dimensional hair model according to an exemplary embodiment.
FIG. 2 is a flow chart illustrating a method of reconstructing a three-dimensional hair model according to an exemplary embodiment.
Fig. 3 is a flowchart illustrating a step S210 in a reconstruction method of a three-dimensional hair model according to an exemplary embodiment.
Fig. 4 is a flowchart illustrating a step S230 in a reconstruction method of a three-dimensional hair model according to an exemplary embodiment.
Fig. 5 is a flowchart illustrating a step S240 in a reconstruction method of a three-dimensional hair model according to an exemplary embodiment.
Fig. 6a is a flowchart illustrating a step S510 of a reconstruction method of a three-dimensional hair model according to an exemplary embodiment.
Fig. 6b is a schematic diagram illustrating a distribution of bone points according to an exemplary embodiment.
Fig. 7 is a flowchart illustrating a step S520 in a reconstruction method of a three-dimensional hair model according to an exemplary embodiment.
FIG. 8 is a flow chart illustrating a manner of generating a hair tuft to be adjusted according to an exemplary embodiment.
Fig. 9 is a flow diagram illustrating a manner in which a hair plane template may be generated according to an exemplary embodiment.
FIG. 10 is a flow chart illustrating a method of reconstructing a three-dimensional hair model according to an exemplary embodiment.
Fig. 11 is a block diagram illustrating an apparatus for reconstructing a three-dimensional hair model according to an exemplary embodiment.
Fig. 12 is an internal block diagram of an electronic device shown in accordance with an example embodiment.
Detailed Description
In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
The method for reconstructing the three-dimensional hair model provided by the present disclosure can be applied to the application environment shown in fig. 1. Wherein the terminal 110 interacts with the server 120 through the network. The terminal 110 obtains a hair cluster to be adjusted and a corresponding basic shape model, wherein the basic shape model is a three-dimensional model representing the shape of a basic hairstyle, and the hair cluster to be adjusted and preset control points are distributed on the basic shape model; adjusting the basic shape model according to the adjustment operation on the preset control point, and determining the three-dimensional coordinate of the basic shape model after adjustment according to the three-dimensional coordinate of the preset control point after adjustment; adjusting the hair cluster to be adjusted on the basic shape model according to the three-dimensional coordinate adjusted by the basic shape model; and generating a three-dimensional hair model according to the adjusted hair cluster. The adjustment of the hair cluster to be adjusted is realized by adjusting the preset control points on the basic shape model. Because the quantity of presetting the control point is less than the quantity of the summit of basic shape model far away, adjust the hair cluster of treating to adjust through presetting the control point in this implementation to hair cluster generation three-dimensional hair model after according to the adjustment, for adjusting the shape of hair cluster in order to change the hair model through the summit among the prior art, not only shortened the time that adjustment hair cluster took, and reduced designer's work load, still reduced the required time of designing single material, promoted the generation efficiency of three-dimensional hair model.
The terminal 110 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices, and the server 120 may be implemented by an independent server or a server cluster formed by a plurality of servers.
Fig. 2 is a flowchart illustrating a method for reconstructing a three-dimensional hair model, according to an exemplary embodiment, which is used in the terminal 110 in fig. 1, as shown in fig. 2, and includes the following steps:
in step S210, a hair cluster to be adjusted and a corresponding basic shape model are obtained.
The three-dimensional hair model is a three-dimensional model corresponding to hair with a specific hairstyle, for example, the three-dimensional hair model may be a three-dimensional model corresponding to two-dimensional hair. The basic shape model is a three-dimensional model representing the shape of the basic hairstyle, and can be a three-dimensional model obtained by summarizing and abstracting the characteristics and the shape of a common hairstyle, and the common hairstyle can be long hair, short hair, bang, back head, horse tail, balls and the like. The surface of the basic shape model is a curved surface to which hairs of various basic hairstyles are attached. The basic shape model is distributed with hair clusters to be adjusted and preset control points. It can be understood that if the corresponding hairstyle of the three-dimensional hair model is complicated, a plurality of basic shape models are needed for reconstructing the three-dimensional hair model, the three-dimensional hair model is composed of a plurality of groups of hair clusters, and the hair clusters can be a cluster of hair forming the three-dimensional hair model. The hair tufts are attached to the surface of the basic shape model, and the surface of the basic shape model can correspond to at least one group of hair tufts. And the hair cluster to be adjusted is the hair cluster of which the position and/or the shape are required to be adjusted. The preset control points are feature points for representing the basic hairstyle, the number and the distribution of the preset control points can be preset in combination with actual conditions, and the number of the preset control points is far smaller than the number of the vertexes of the basic shape model, for example, the number of the preset control points can be 41, one of the preset control points is distributed at the position of the tianlinggai, the remaining 40 control points are divided into 10 rows, each row is 4, and the preset control points are uniformly distributed at the same height of the basic shape model. After the position of the preset control point is determined, the vertex of the basic shape model can be generated according to the position of the preset control point through cubic spline interpolation, and a mapping relation exists between the preset control point and the basic shape model. Specifically, the plurality of hair clusters and the respective corresponding base shape models are obtained locally from a computer, or loaded from another computer device connected to a computer network. In order to realistically display a three-dimensional hair model, some or all of the hair switches thereof need to be adjusted. The hair cluster to be adjusted is selected from the basic shape models, and the basic shape models corresponding to the hair cluster to be adjusted are selected as the hair cluster is attached to the corresponding basic shape models.
In step S220, the basic shape model is adjusted according to the adjustment operation on the preset control points, and the adjusted three-dimensional coordinates of the basic shape model are determined according to the adjusted three-dimensional coordinates of the preset control points.
The three-dimensional coordinates of the preset control points are used for representing the position information of the preset control points in a world coordinate system. The three-dimensional coordinates of the base shape model are information for characterizing the position of the base shape model within the world coordinate system. Because the hair clusters are attached to the basic shape model, and the mapping relation exists between the preset control points on the basic shape model and the basic shape model, the basic shape model is adjusted by adjusting the preset control points, and then the hair clusters are adjusted by adjusting the basic shape model.
Specifically, according to the actual requirement of hair styling, the designer adjusts the set control points on the basic shape model, that is, the set control points on the basic shape model are adjusted, and the positions of the preset control points are changed in response to the adjustment instruction of the preset control points. Because a mapping relation exists between the preset control point on the basic shape model and the basic shape model, the position of the basic shape model changes along with the change of the position of the preset control point. And because the hair cluster is attached to the basic shape model, the position of the basic shape model changes, the positions of the hair clusters to be adjusted distributed on the basic shape model also change along with the change, and the position information in the world coordinate system is recorded as three-dimensional coordinates. Therefore, the adjusted three-dimensional coordinates of the basic shape model are determined through the adjusted three-dimensional coordinates of the preset control points. It should be noted that the adjustment instruction is an operation instruction that occurs at a preset control point and is used for adjusting the hair style, and the adjustment instruction may be a drag operation on the preset control point, or may be an adjustment distance input for the preset control point in a display interface of the basic shape model.
In step S230, the hair cluster to be adjusted on the basic shape model is adjusted according to the three-dimensional coordinates adjusted by the basic shape model.
Specifically, a mapping relation exists between a preset control point on the basic shape model and the basic shape model, and the three-dimensional coordinate adjusted by the basic shape model is determined according to the three-dimensional coordinate adjusted by the preset control point. Because the hair clusters are attached to the basic shape model, the position of the basic shape model changes, and the positions of the hair clusters to be adjusted distributed on the basic shape model also change along with the change, the adjusted positions of the hair clusters to be adjusted can be determined according to the three-dimensional coordinates adjusted by the basic shape model, so that the hair clusters to be adjusted can be adjusted according to the adjusted positions of the hair clusters to be adjusted.
In step S240, a three-dimensional hair model is generated from the adjusted hair cluster.
Specifically, according to the actual needs of hair styling, the designer adjusts the basic shape model, and the hair cluster to be adjusted corresponding to the basic shape model is adjusted along with the adjustment of the basic shape model. After the adjustment work of the hair cluster to be adjusted is completed, the adjusted hair cluster can be utilized to generate a final three-dimensional hair model. It will be appreciated that the initial three-dimensional hair model includes a number of hair switches. If part of the hair clusters need to be adjusted, the part of the hair clusters are to-be-adjusted hair clusters, and after the part of the hair clusters are adjusted, the adjusted hair clusters are obtained, so that the other hair clusters except the part of the hair clusters and the adjusted hair clusters are used together to generate a final three-dimensional hair model; and if all the hair clusters need to be adjusted, all the hair clusters are the hair clusters to be adjusted, and after all the hair clusters are adjusted, the adjusted hair clusters are obtained, so that the adjusted hair clusters are used for generating the final three-dimensional hair model.
In the reconstruction method of the three-dimensional hair model, the hair cluster to be adjusted and the corresponding basic shape model are obtained; adjusting the basic shape model according to the adjustment operation on the preset control point, and determining the three-dimensional coordinate of the basic shape model after adjustment according to the three-dimensional coordinate of the preset control point after adjustment; adjusting the hair cluster to be adjusted on the basic shape model according to the three-dimensional coordinate adjusted by the basic shape model; and generating a three-dimensional hair model according to the adjusted hair cluster. In this embodiment, the adjustment of the hair bundle to be adjusted is realized by adjusting the preset control point on the basic shape model. Because the number of the preset control points is far smaller than that of the vertexes of the basic shape model, compared with the prior art that the shape of the hair model is changed by adjusting the hair cluster through the vertexes, the time spent on adjusting the hair cluster is shortened, the workload of a designer is reduced, the time required by designing a single material is also reduced, and the generation efficiency of the three-dimensional hair model is improved.
In an exemplary embodiment, as shown in fig. 3, in step S210, a hair bundle to be adjusted and a corresponding basic shape model are obtained, which may be specifically implemented by the following steps:
in step S310, a hair cluster of interest and a corresponding primitive shape model are obtained.
The hair cluster of interest is a hair cluster needing to be adjusted, for example, the hair cluster of interest can be a hair cluster needing to be adjusted in position and shape in a partial range. Such as straight hair switches to curly hair switches. The hair cluster of interest is distributed on the original basic shape model, and original control points are distributed on the original basic shape model. The original base shape model may be the base shape model for which any operation is performed. In particular, in one aspect, the plurality of hair clusters of interest and their respective raw base shape models may be obtained locally from a computer or loaded from another computer device connected to a computer network. On the other hand, the plurality of hair clusters and the respective corresponding base shape models are obtained locally from a computer, or are loaded from another computer device connected to a computer network. In order to realistically present a three-dimensional hair model, a hair cluster of interest is selected therefrom, since the hair cluster is attached to a corresponding basic shape model, and an original basic shape model to which the hair cluster of interest corresponds is selected.
In step S320, the hair cluster of interest and the corresponding original basic shape model are copied to obtain a hair cluster of interest copy and a corresponding original basic shape model copy, the original basic shape model copy is distributed with original control point copies, the hair cluster of interest copy is used as a hair cluster to be adjusted, the corresponding original basic shape model copy is used as a basic shape model, and the original control point copy is used as a preset control point.
Wherein, be attached to multiunit hair cluster on the basic shape model, the position interact between the multiunit hair cluster adjusts one of them group hair cluster, and other hair clusters also can be along with the adjustment, and this problem can increase the adjustment work that the designer was to the hair cluster. For example, the subsequent adjustment of other hair clusters may affect the adjusted hair clusters, which not only affects the vivid effect of hair styling, but also requires the designer to adjust the adjusted hair clusters again, and thus, the adjustment work of the hair clusters will take a lot of time. In order to avoid the mutual influence among the hair clusters, the freedom degree of operation regulation and control of a designer is increased, the hair clusters to be regulated and the corresponding basic shape models can be separated through copying, and therefore when the hair clusters to be regulated and the corresponding basic shape models are regulated, the positions of other hair clusters cannot be influenced. The interesting hair cluster copy is obtained by copying a source file of the interesting hair cluster, and the basic shape model copy corresponding to the interesting hair cluster copy is obtained by copying a basic shape model corresponding to the source file of the interesting hair cluster. Specifically, the interested hair cluster and the corresponding original basic shape model are selected from a plurality of groups of hair clusters as copy contents, and the interested hair cluster copy and the corresponding original basic shape model copy are generated in response to the pasting instruction of the interested hair cluster and the corresponding original basic shape model. Since the interesting hair cluster copies and the corresponding original basic shape model copies are obtained through the copying operation, original control point copies are distributed on the original basic shape model copies. In order to adjust the interesting hair cluster copy, the interesting hair cluster copy is used as a hair cluster to be adjusted, the corresponding original basic shape model copy is used as a basic shape model, and the original control point copy is used as a preset control point. It should be noted that the hair cluster to be adjusted in the present disclosure may be a hair cluster to be adjusted directly obtained from another computer device locally computed or connected to a computer network, or may be a copy of the hair cluster of interest obtained by copying the hair cluster of interest.
In the reconstruction method of the three-dimensional hair model, the interested hair cluster and the corresponding original basic shape model are obtained; and obtaining a copy of the hair cluster of interest and a corresponding copy of the original basic shape model by copying the hair cluster of interest and the corresponding original basic shape model. Therefore, the hair cluster and the corresponding basic shape model are copied, so that the mutual influence of the hair clusters is effectively avoided; and then the interesting hair cluster copy is adjusted in response to the adjustment instruction of the original control point copy, so that the adjustment work of the hair cluster in the hair model of the designer is reduced, the time spent on hair cluster adjustment is reduced, and the work efficiency of the designer is improved.
In an exemplary embodiment, as shown in fig. 4, in step S230, the hair bundle to be adjusted on the basic shape model is adjusted according to the three-dimensional coordinates adjusted by the basic shape model, which may be specifically implemented by the following steps:
in step S410, a correspondence between the three-dimensional coordinates of the basic shape model and the three-dimensional coordinates of the hair cluster to be adjusted is obtained through the texture coordinates of the basic shape model.
In step S420, the three-dimensional coordinates of the hair cluster to be adjusted are determined according to the three-dimensional coordinates of the basic shape model after adjustment and the corresponding relationship between the three-dimensional coordinates of the basic shape model and the three-dimensional coordinates of the hair cluster to be adjusted.
In step S430, the hair bundle to be adjusted on the basic shape model is adjusted according to the adjusted three-dimensional coordinates of the hair bundle to be adjusted.
The texture coordinates have two coordinate axes of U and V, so the texture coordinates are called UV coordinates, and can be used to define the position information of each point on the picture, where U represents the distribution on the horizontal coordinates and V represents the distribution on the vertical coordinates. The geometric information of the basic shape model is known, the geometric information comprises texture coordinates and three-dimensional coordinates, the texture coordinates and the three-dimensional coordinates are in one-to-one correspondence, and the texture coordinates have invariance. Specifically, the hair cluster to be adjusted is distributed on the basic shape model, and the texture coordinate of the hair cluster to be adjusted can be obtained through the texture coordinate of the basic shape model. Further, because the texture coordinates have invariance and the texture coordinates and the three-dimensional coordinates are in one-to-one correspondence, the correspondence between the three-dimensional coordinates of the basic shape model and the three-dimensional coordinates of the hair cluster to be adjusted can be obtained through the texture coordinates of the basic shape model. And calculating the corresponding relation between the three-dimensional coordinates of the basic shape model and the three-dimensional coordinates of the hair cluster to be adjusted by substituting the three-dimensional coordinates adjusted by the basic shape model, and determining the three-dimensional coordinates adjusted by the hair cluster to be adjusted. And finally, adjusting the hair cluster to be adjusted on the basic shape model according to the adjusted three-dimensional coordinate of the hair cluster to be adjusted.
In the method for reconstructing the three-dimensional hair model, the corresponding relation between the three-dimensional coordinates of the basic shape model and the three-dimensional coordinates of the hair cluster to be adjusted is obtained through the texture coordinates of the basic shape model. Therefore, the three-dimensional coordinate adjusted by the hair cluster to be adjusted is determined according to the three-dimensional coordinate adjusted by the basic shape model and the corresponding relation between the three-dimensional coordinate of the basic shape model and the three-dimensional coordinate of the hair cluster to be adjusted. And finally, adjusting the hair cluster to be adjusted on the basic shape model according to the adjusted three-dimensional coordinate of the hair cluster to be adjusted. Therefore, the embodiment realizes high-precision adjustment of the hair model, and reduces the complexity of adjustment operation of the hair model.
In an exemplary embodiment, as shown in fig. 5, in step S240, a three-dimensional hair model is generated according to the adjusted hair cluster, which may be specifically implemented by the following steps:
in step S510, a plurality of bone points of the adjusted hair cluster are generated according to the position information of the adjusted hair cluster on the corresponding basic shape model.
In step S520, a skinning operation is performed on the adjusted hair cluster according to the position information of each bone point.
In order to increase the reality of the three-dimensional hair model, reasonable internal solid structures (bone structures) can be added to the hair clusters of each group, for example, a preset number of bones are connected end to form the internal solid structures of the current hair cluster. The bone points are joint points constituting an internal solid structure of the three-dimensional hair model, and a piece of bone is added between the adjacent bone points. In order to drive the three-dimensional hair model to produce reasonable motion, bone may be added to the three-dimensional hair model.
Specifically, the hair cluster is attached to the basic shape model, and the hair cluster is adjusted through a preset control point on the basic shape model to obtain an adjusted hair cluster. And if the bone structure needs to be added to the adjusted hair cluster by combining the position information of the adjusted hair cluster, acquiring the position information of the adjusted hair cluster on the corresponding basic shape model, and determining the distribution condition of the bone points according to the acquired position information, thereby generating the corresponding bone points. And acquiring the position information of each skeleton point, and performing covering operation on the adjusted hair cluster by combining the position information of each skeleton point.
In the reconstruction method of the three-dimensional hair model, each skeleton point of the hair cluster is generated according to the position information of the adjusted hair cluster on the corresponding basic shape model; and performing skin covering operation on the adjusted hair cluster according to the position information of each bone point. Thus, the workload of bone binding of a designer is reduced, and the work rate of designing the three-dimensional hair model is improved.
In an exemplary embodiment, each of the bone points is evenly distributed in a length direction of the adjusted hair cluster. Further exemplarily, as shown in fig. 6a, in step S510, a plurality of bone points of the adjusted hair cluster are generated according to the position information of the adjusted hair cluster on the corresponding basic shape model, which may be specifically implemented by the following steps:
in step S610, a root point and a tip point on a hair cluster are acquired.
In step S620, a preset number of points are extracted from the edge contour of the hair cluster as edge points, which are uniformly distributed between the root point and the tip point.
In step S630, bone points on the hair cluster are generated from the hair root points, the hair tip points, and the edge points.
Wherein, the hair cluster comprises a hair root point and a hair tip point. Edge profile refers to the boundary line that constitutes the outer edge of a hair tuft. In particular, in order to bind the three-dimensional hair model to a bone structure, a corresponding bone structure is first generated, the bone structure comprising bone points and bones between adjacent bone points. In order to increase the reality of the three-dimensional hair model, corresponding bone points are generated by combining the actual conditions of the hair clusters. Therefore, first, the root point and the tip point of the hair on the hair cluster need to be obtained; secondly, extracting a preset number of points from the edge contour of the hair cluster as edge points, wherein the edge points are uniformly distributed between the hair root points and the hair tip points; and finally, generating bone points of the hair clusters according to the hair root points of the hair clusters, the hair tip points of the hair clusters and the edge points on the edge contour of the hair clusters.
Further, the middle points of the two edge points positioned on the same height are obtained, and the middle points between the hair root point, the hair tip point and the edge points positioned on the same height are used as the bone points of the hair clusters. Illustratively, as shown in fig. 6b, the hair cluster comprises a root point 610 and a tip point 620, three edge points 630 are uniformly distributed on the edge contour of the copy of the hair cluster, a middle point 640 of the two edge points 630 at the same height is obtained, and the middle point 640 between the root point 610, the tip point 620 and the edge points 630 at the same height is taken as a bone point of the hair cluster.
In the method for reconstructing a three-dimensional hair model, in combination with the actual condition of the hair cluster, the bone points are uniformly distributed in the length direction of the adjusted hair cluster, for example, the midpoint between the hair root point, the hair tip point and the edge point located at the same height is used as the bone point of the hair cluster, so that the reality of the three-dimensional hair model is increased.
In an exemplary embodiment, as shown in fig. 7, in step S520, a skinning operation is performed on the adjusted hair cluster according to the position information of each bone point, which may be specifically implemented by the following steps:
in step S710, bones are added to the adjusted hair cluster between the bone points based on the position information of the bone points.
Wherein, the bone points are joint points which form the internal solid structure of the adjusted hair cluster, and a piece of bone is added between the adjacent bone points. In particular, in order to drive the adjusted hair cluster to produce a reasonable movement, bone may be added between the bone points for the adjusted hair cluster.
In step S720, position information of each vertex in the adjusted hair cluster is acquired.
Specifically, the hair cluster comprises a plurality of vertexes, and after the hair cluster is adjusted through a preset control point, the position information of each vertex in the hair cluster is changed, so that the position information of each vertex in the adjusted hair cluster is obtained.
In step S730, the distance between each vertex and each bone point is acquired based on the position information of each vertex and the position information of each bone point.
Specifically, a hair root point and a hair tip point on a hair cluster are obtained; extracting a preset number of points from the edge outline of the hair cluster copy as edge points, wherein the edge points are uniformly distributed between the hair root points and the hair tip points; and generating skeleton points on the hair cluster copy according to the hair root points, the hair tip points and the edge points, and obtaining the position information of the skeleton points. On the basis of the known position information of each vertex and the position information of each bone point, the distance between each vertex and each bone point is calculated. Further, in order to avoid the interference of the bone points at the far positions, the bone points adjacent to each vertex are selected from the bone points of the hair cluster to calculate the distance between the vertex and the bone points, namely, the vertex is only influenced by two adjacent bone points.
In step S740, skin weights for each vertex in the adjusted hair cluster are generated according to the distances.
And the skinning weight is used for representing the influence of each bone point on any vertex for each vertex in the hair cluster copy. The skinning weight is determined primarily by the distance from the apex to the bone points. The closer the distance, the greater the weight. As above, to avoid interference of more remotely located bone points, only the influence of two bone points adjacent to each vertex on it is considered. Therefore, first, two nearest neighboring bone points with respect to the current vertex are found according to the distance, and the two nearest neighboring bone points d1, d2 from the current vertex are calculated. The skinning weight may then be expressed as:
W1=d2/(d1+d2);
W2=d1/(d1+d2)。
in step S750, the vertices are associated with bones between the bone points according to the skinning weights.
The skeleton structure and the hair cluster are independent from each other, so that the skeleton structure is added to the hair cluster through skin covering operation, and the hair cluster can be driven to move correspondingly through the change of the skeleton structure. In particular, the skinning weight of the vertices in the adjusted hair cluster has been calculated from the distance between the vertices and the bone points. And associating the bones between the top points and the bone points according to the weight of the skin so that the bones drive the hair clusters to move.
According to the method for reconstructing the three-dimensional hair model, the skin covering operation is carried out on the adjusted hair cluster according to the position information of each bone point, so that the hair cluster can be driven to move correspondingly by the change of the bone structure, the technical problem that a static three-dimensional hair model cannot meet the practical requirement in the prior art is solved, and the established three-dimensional hair model is perfected. Not only can the production efficiency of a designer be improved, but also the reality of the three-dimensional hair model is improved through skin operation.
FIG. 8 is a flow chart illustrating a manner of generating a hair tuft to be adjusted, as shown in FIG. 8, including the steps of:
in step S810, a hair plane template is obtained, wherein the hair plane template includes a plurality of projection views, and the projection views are obtained by projecting the basic shape model in a plurality of preset view directions.
The hair plane template may be a plane template for guiding a plane designer to design a three-dimensional hair model. The planners can design the planar materials of the three-dimensional hair model through the hair plane template. The hair plane template comprises a plurality of projection drawings, and the projection drawings are obtained by projecting the basic shape model in a plurality of preset view directions. The base shape model is a three-dimensional model that characterizes the shape of the base hairstyle. For example, the basic shape model may be a three-dimensional model obtained by summarizing and abstracting the features and shapes of common hair styles, such as long hair, short hair, bang, back head, horse tail, ball, and the like. The surface of the basic shape model is a curved surface to which hairs of various basic hairstyles are attached. The view direction is a direction in which a ray is projected from one face of the basic shape model to the opposite face thereof, and may also be understood as a direction in which a line of sight is projected from one face of the basic shape model to the opposite face thereof, such as from the front to the back of the basic shape model, from the left to the right of the basic shape model, from the top to the bottom of the basic shape model. The preset view direction includes a front view direction, a rear view direction, a left view direction, a right view direction, and the like. The projected view refers to a view obtained by projecting light rays from one face of an object to the opposite face thereof. Specifically, the hair plane template is obtained locally from a computer or loaded from another computer device connected to a computer network.
In step S820, a target projection view is selected from the hair plane template, and the drawn hair cluster is acquired through the target projection view.
The hair is composed of a plurality of groups of hair clusters, and the three-dimensional hair model is also composed of a plurality of hair clusters. The rendered hair cluster is a planar image of the hair cluster constituting the three-dimensional hair model in the target projection view. On the target projection drawing, the designer draws the shape and texture of each hair cluster from the view direction corresponding to the target projection drawing to design the three-dimensional hair model. Specifically, after the hair plane template is obtained, a plurality of projection views included in the hair plane template can be displayed, and a designer selects a target projection view from the hair plane template according to actual design requirements. After the designer finishes drawing the hair cluster on the target projection drawing, the drawn hair cluster can be sent to a server or the current computer background in time, so that the server or the computer background acquires the hair cluster drawn on the target projection drawing. Alternatively, the drawn hair cluster may be stored locally in the computer in advance, and the hair cluster drawn on the target projection drawing may be acquired locally from the computer. The hair cluster drawn on the target projection drawing can also be stored in advance in another computer device connected to a local network of the computer, and the hair cluster drawn on the target projection drawing is acquired from another computer device connected to the local network of the computer.
In step S830, geometric information of the drawn hair cluster is determined according to the position information of the drawn hair cluster in the target projection view and geometric information of the base shape model corresponding to the target projection view.
The position information of the hair cluster in the target projection drawing refers to the position information of the hair cluster drawn by the designer on the projection drawing relative to the target projection drawing. Geometric information is information or data used to characterize the texture features, spatial structure, spatial location of a three-dimensional model. Each base shape model has corresponding geometric information for characterizing the spatial structure of the base shape model, the spatial position of the vertices, etc. Specifically, at least one hair cluster is drawn on the target projection drawing, and the position information of the drawn hair cluster in the target projection drawing is known, so that the position information of the drawn hair cluster in the target projection drawing can be acquired. In order to accurately and rapidly generate the three-dimensional hair model, geometric information of a basic shape model corresponding to the generated target projection drawing is acquired. Furthermore, the drawn hair cluster is attached to the projection outline of the basic shape model, and the projection of the basic shape model and the basic shape model corresponding to the target projection drawing have a projection relationship, so that the geometric information of the hair cluster can be determined by using the position information of the drawn hair cluster in the target projection drawing and the geometric information of the basic shape model corresponding to the target projection drawing.
In step S840, a hair cluster to be adjusted is generated according to the drawn geometric information of the hair cluster.
As mentioned above, the hair is composed of a plurality of groups of hair clusters, and the three-dimensional hair model is also composed of a plurality of hair clusters. Specifically, the geometric information of the hair cluster includes texture information and stereoscopic information of the hair cluster. Generating a spatial structure of the hair cluster according to the three-dimensional information of the hair cluster, and rendering the surface of the spatial structure of the hair cluster according to the texture information of the hair cluster to generate the hair cluster to be adjusted.
In the method for generating the hair cluster to be adjusted, a target projection drawing is selected from the hair plane template by acquiring the hair plane template, and the drawn hair cluster is acquired through the target projection drawing; determining the geometric information of the hair cluster according to the position information of the hair cluster in the target projection drawing and the geometric information of the basic shape model corresponding to the target projection drawing; thereby generating a three-dimensional hair model based on the geometric information of the hair clusters. Therefore, the three-dimensional hair modeling work is completed by utilizing the plane template, and according to the three-dimensional hair modeling method, the three-dimensional hair modeling generation efficiency can be improved, and the three-dimensional hair modeling difficulty is reduced.
Fig. 9 is a flow chart illustrating a manner of generating a hair plane template according to an exemplary embodiment, as shown in fig. 9, including the steps of:
in step S910, a base shape model is acquired.
In step S920, the basic shape model is projected in each preset view direction, so as to obtain a projection view of the basic shape model in the preset view direction.
In step S930, a hair plane template is generated according to the projection view of the basic shape model in the preset view direction.
Specifically, the features and the shapes of common hairstyles are summarized and abstracted to obtain a basic shape model, and the obtained basic shape model is stored. When a hair cluster needs to be drawn, the basic shape model can be obtained locally from the computer, or can be obtained from another computer device through a network and loaded locally to the computer. In order to facilitate a plane designer to design a three-dimensional model, the basic shape model is projected in each preset view direction to obtain a projection view of the basic shape model in the preset view direction; and generating a hair plane template according to the projection drawing of the basic shape model in each preset view direction.
In the generation mode of the hair plane template, a new path is provided for a plane designer to design a three-dimensional hair model, so that the plane designer can draw a two-dimensional hair cluster image on a projection drawing of a basic shape model to complete the design of the three-dimensional hair model. Through this embodiment not only reduced designer's study cost, helped the work that the plane designer accomplished three-dimensional design moreover. Further, when actually designing a three-dimensional hair model, a designer can select a proper basic shape model and a proper view angle according to the requirements of a specific hair style to generate a hair plane template. And in the hair plane template, selecting a proper position, a proper shape and a proper texture to draw a corresponding hair cluster. When drawing the hair through hair plane template and swarming, whole process is directly controllable for the designer, has both improved designer's work efficiency, also promotes the design effect of three-dimensional hair model.
Fig. 10 is a flowchart illustrating a method for reconstructing a three-dimensional hair model, as shown in fig. 10, for use in the terminal 110 of fig. 1, according to an exemplary embodiment, including the steps of:
in step S1002, a base shape model is acquired.
In step S1004, the basic shape model is projected in each preset view direction, so as to obtain a projection view of the basic shape model in the preset view direction.
In step S1006, a hair plane template is generated according to the projection view of the basic shape model in the preset view direction.
In step S1008, a hair plane template is obtained, which includes a plurality of projection views obtained by projecting the basic shape model in a plurality of preset view directions.
In step S1010, a target projection view is selected from the hair plane template, and a drawn hair cluster is acquired through the target projection view.
In step S1012, geometric information of the drawn hair cluster is determined according to the position information of the drawn hair cluster in the target projection view and the geometric information of the base shape model corresponding to the target projection view.
In step S1014, a hair cluster to be adjusted is generated according to the drawn geometric information of the hair cluster.
In step S1016, a hair cluster to be adjusted and a corresponding basic shape model are obtained, where the basic shape model is a three-dimensional model representing the shape of a basic hairstyle, and the hair cluster to be adjusted and preset control points are distributed on the basic shape model.
Specifically, an interested hair cluster and a corresponding original basic shape model are obtained, the interested hair cluster is a hair cluster needing to be adjusted, and original control points are distributed on the original basic shape model; copying the interesting hair cluster and the corresponding original basic shape model to obtain an interesting hair cluster copy and a corresponding original basic shape model copy, distributing original control point copies on the original basic shape model copy, taking the interesting hair cluster copy as a hair cluster to be adjusted, taking the corresponding original basic shape model copy as a basic shape model, and taking the original control point copy as a preset control point.
In step S1018, the basic shape model is adjusted according to the adjustment operation on the preset control point, and the adjusted three-dimensional coordinates of the basic shape model are determined by the adjusted three-dimensional coordinates of the preset control point.
In step S1020, a corresponding relationship between the three-dimensional coordinates of the basic shape model and the three-dimensional coordinates of the hair bundle to be adjusted is obtained through the texture coordinates of the basic shape model.
In step S1022, the adjusted three-dimensional coordinates of the hair bundle to be adjusted are determined according to the adjusted three-dimensional coordinates of the basic shape model and the corresponding relationship between the three-dimensional coordinates of the basic shape model and the three-dimensional coordinates of the hair bundle to be adjusted.
In step S1024, the hair cluster to be adjusted on the basic shape model is adjusted according to the adjusted three-dimensional coordinates of the hair cluster to be adjusted.
Specifically, in response to an adjustment instruction of a preset control point on the basic shape model copy, adjusting the basic shape model copy, and acquiring a three-dimensional coordinate of the adjusted basic shape model copy; acquiring texture coordinates of the hair cluster copy corresponding to the basic shape model copy; converting texture coordinates of the hair cluster copy according to the adjusted three-dimensional coordinates of the basic shape model copy to obtain three-dimensional coordinates of the hair cluster copy; and adjusting the hair cluster copy corresponding to the basic shape model copy according to the three-dimensional coordinates of the hair cluster copy.
In step S1026, a plurality of skeleton points of the adjusted hair cluster are generated according to the position information of the adjusted hair cluster on the corresponding basic shape model.
Wherein the bone points are evenly distributed in the length direction of the adjusted hair cluster. Specifically, a hair root point and a hair tip point on a hair cluster are obtained; extracting a preset number of points from the edge outline of the hair cluster as edge points, wherein the edge points are uniformly distributed between the hair root points and the hair tip points; and taking the middle point between the hair root point, the hair tip point and the edge point positioned on the same height as the bone point on the hair cluster.
In step S1028, a skinning operation is performed on the adjusted hair cluster according to the position information of each bone point.
Specifically, according to the position information of each skeleton point, adding skeleton for the adjusted hair cluster among the skeleton points; acquiring position information of each vertex in the adjusted hair cluster; acquiring the distance between each vertex and each bone point according to the position information of each vertex and the position information of each bone point;
generating skin weight of each vertex in the adjusted hair cluster according to the distance; and associating the bones between each vertex and each bone point according to the skinning weight.
It should be understood that, although the steps in the above-described flowcharts are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a part of the steps in the above-mentioned flowcharts may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of performing the steps or the stages is not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a part of the steps or the stages in other steps.
Fig. 11 is an apparatus block diagram illustrating an apparatus for reconstructing a three-dimensional hair model according to an exemplary embodiment. Referring to fig. 11, the reconstruction apparatus 1100 includes an acquisition module 1102, a model adjustment module 1104, a hair cluster adjustment module 1106, and a model generation module 1108.
An obtaining module 1102 configured to perform obtaining a hair cluster to be adjusted and a corresponding basic shape model, where the basic shape model is a three-dimensional model representing a shape of a basic hairstyle, and the basic shape model is distributed with the hair cluster to be adjusted and preset control points;
a model adjusting module 1104 configured to perform an adjusting operation on the basic shape model according to the preset control points, and determine three-dimensional coordinates of the basic shape model after the adjusting operation is performed by the preset control points;
a hair cluster adjusting module 1106 configured to perform adjustment of the hair cluster to be adjusted on the basic shape model according to the three-dimensional coordinates adjusted by the basic shape model;
a model generation module 1108 configured to perform generating a three-dimensional hair model from the adjusted hair cluster.
In an exemplary embodiment, the obtaining module 1102 is further configured to perform obtaining a hair cluster of interest and a corresponding original basic shape model, where the hair cluster of interest is a hair cluster needing to be adjusted, and original control points are distributed on the original basic shape model; copying the interesting hair cluster and the corresponding original basic shape model to obtain an interesting hair cluster copy and a corresponding original basic shape model copy, wherein original control point copies are distributed on the original basic shape model copy, the interesting hair cluster copy is used as the hair cluster to be adjusted, the corresponding original basic shape model copy is used as the basic shape model, and the original control point copy is used as the preset control point.
In an exemplary embodiment, the hair cluster adjusting module 1106 is further configured to execute the corresponding relationship between the three-dimensional coordinates of the basic shape model and the three-dimensional coordinates of the hair cluster to be adjusted by using the texture coordinates of the basic shape model; determining the three-dimensional coordinate of the hair cluster to be adjusted according to the three-dimensional coordinate of the basic shape model after adjustment and the corresponding relation between the three-dimensional coordinate of the basic shape model and the three-dimensional coordinate of the hair cluster to be adjusted; and adjusting the hair cluster to be adjusted on the basic shape model according to the adjusted three-dimensional coordinate of the hair cluster to be adjusted.
In an exemplary embodiment, the model generation module 1108 includes a skeletal point generation unit and a skinning operation unit;
the skeleton point generating unit is configured to execute generating a plurality of skeleton points of the adjusted hair cluster according to the position information of the adjusted hair cluster on the corresponding basic shape model;
the skinning operation unit is configured to perform skinning operation on the adjusted hair cluster according to the position information of each bone point.
In an exemplary embodiment, each of the bone points is evenly distributed in a length direction of the adjusted hair cluster.
In an exemplary embodiment, the skinning operation unit is further configured to perform adding a skeleton for the adjusted hair cluster between the skeleton points according to the position information of the skeleton points; acquiring position information of each vertex in the adjusted hair cluster; acquiring the distance between each vertex and each bone point according to the position information of each vertex and the position information of each bone point; generating skin weight of each vertex in the adjusted hair cluster according to the distance; and associating the bones between each vertex and each bone point according to the skinning weight.
In an exemplary embodiment, the reconstruction apparatus further comprises a to-be-adjusted hair cluster generation module configured to execute to acquire a hair plane template, the hair plane template comprising a plurality of projection views, the projection views being obtained by projecting the basic shape model in a plurality of preset view directions; selecting a target projection drawing from the hair plane template, and acquiring a drawn hair cluster through the target projection drawing; determining the geometric information of the drawn hair cluster according to the position information of the drawn hair cluster in the target projection drawing and the geometric information of a basic shape model corresponding to the target projection drawing; and generating the hair cluster to be adjusted according to the drawn geometric information of the hair cluster.
In an exemplary embodiment, the reconstruction apparatus further comprises a hair plane template generation module configured to perform obtaining the base shape model; projecting the basic shape model in each preset view direction to obtain a projection view of the basic shape model in the preset view direction; and generating the hair plane template according to the projection drawing of the basic shape model in the preset view direction.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Fig. 12 is a block diagram illustrating an apparatus 1200 for reconstructing a three-dimensional hair model according to an exemplary embodiment. For example, device 1200 may be a server. Referring to fig. 12, device 1200 includes a processing component 1220 that further includes one or more processors, and memory resources, represented by memory 1222, for storing instructions, such as application programs, that are executable by processing component 1220. The application programs stored in memory 1222 may include one or more modules that each correspond to a set of instructions. Further, the processing component 1220 is configured to execute instructions to perform the above-described three-dimensional hair model reconstruction method.
The device 1200 may also include a power supply component 1224 configured to perform power management of the device 1200, a wired or wireless network interface 1226 configured to connect the device 1200 to a network, and an input-output (I/O) interface 1228. The device 1200 may operate based on an operating system stored in memory 1222 such as Window 1212 erver, Mac O12X, Unix, Linux, FreeB12D, or the like.
In an exemplary embodiment, a storage medium comprising instructions, such as memory 1222 comprising instructions, executable by a processor of device 1200, for performing the above-described method of reconstructing a three-dimensional hair model is also provided. The storage medium may be a non-transitory computer readable storage medium, which may be, for example, a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (10)

1. A method of reconstructing a three-dimensional hair model, comprising:
acquiring a hair cluster to be adjusted and a corresponding basic shape model, wherein the basic shape model is a three-dimensional model representing the shape of a basic hairstyle, and the hair cluster to be adjusted and preset control points are distributed on the basic shape model;
adjusting the basic shape model according to the adjustment operation on the preset control point, and determining the three-dimensional coordinate of the basic shape model after adjustment according to the three-dimensional coordinate of the preset control point after adjustment;
adjusting the hair cluster to be adjusted on the basic shape model according to the three-dimensional coordinate adjusted by the basic shape model;
and generating a three-dimensional hair model according to the adjusted hair cluster.
2. The method for reconstructing a three-dimensional hair model according to claim 1, wherein said obtaining a hair cluster to be adjusted and a corresponding basic shape model comprises:
acquiring an interested hair cluster and a corresponding original basic shape model, wherein the interested hair cluster is a hair cluster needing to be adjusted, and original control points are distributed on the original basic shape model;
copying the interesting hair cluster and the corresponding original basic shape model to obtain an interesting hair cluster copy and a corresponding original basic shape model copy, wherein original control point copies are distributed on the original basic shape model copy, the interesting hair cluster copy is used as the hair cluster to be adjusted, the corresponding original basic shape model copy is used as the basic shape model, and the original control point copy is used as the preset control point.
3. The method for reconstructing a three-dimensional hair model according to claim 1, wherein the adjusting the hair cluster to be adjusted on the basic shape model according to the three-dimensional coordinates adjusted by the basic shape model comprises:
obtaining the corresponding relation between the three-dimensional coordinates of the basic shape model and the three-dimensional coordinates of the hair cluster to be adjusted through the texture coordinates of the basic shape model;
determining the three-dimensional coordinate of the hair cluster to be adjusted according to the three-dimensional coordinate of the basic shape model after adjustment and the corresponding relation between the three-dimensional coordinate of the basic shape model and the three-dimensional coordinate of the hair cluster to be adjusted;
and adjusting the hair cluster to be adjusted on the basic shape model according to the adjusted three-dimensional coordinate of the hair cluster to be adjusted.
4. The method for reconstructing a three-dimensional hair model according to claim 1, wherein the generating a three-dimensional hair model from the adjusted hair clusters comprises:
generating a plurality of bone points of the adjusted hair cluster according to the position information of the adjusted hair cluster on the corresponding basic shape model;
and performing skinning operation on the adjusted hair cluster according to the position information of each bone point.
5. The method for reconstructing a three-dimensional hair model according to claim 4, wherein the skinning operation on the adjusted hair cluster according to the position information of each bone point comprises:
adding bones to the adjusted hair cluster among the bone points according to the position information of the bone points;
acquiring position information of each vertex in the adjusted hair cluster;
acquiring the distance between each vertex and each bone point according to the position information of each vertex and the position information of each bone point;
generating skin weight of each vertex in the adjusted hair cluster according to the distance;
and associating the bones between each vertex and each bone point according to the skinning weight.
6. The method for reconstructing a three-dimensional hair model according to any one of claims 1 to 5, wherein the manner of generating the hair cluster to be adjusted comprises:
acquiring a hair plane template, wherein the hair plane template comprises a plurality of projection drawings, and the projection drawings are obtained by projecting a basic shape model in a plurality of preset view directions;
selecting a target projection drawing from the hair plane template, and acquiring a drawn hair cluster through the target projection drawing;
determining the geometric information of the drawn hair cluster according to the position information of the drawn hair cluster in the target projection drawing and the geometric information of a basic shape model corresponding to the target projection drawing;
and generating the hair cluster to be adjusted according to the drawn geometric information of the hair cluster.
7. The method of claim 6, wherein the hair plane template is generated by a method comprising:
obtaining the basic shape model;
projecting the basic shape model in each preset view direction to obtain a projection view of the basic shape model in the preset view direction;
and generating the hair plane template according to the projection drawing of the basic shape model in the preset view direction.
8. An apparatus for reconstructing a three-dimensional hair model, comprising:
the hair adjusting device comprises an acquisition module, a control module and a control module, wherein the acquisition module is configured to acquire a hair cluster to be adjusted and a corresponding basic shape model, the basic shape model is a three-dimensional model representing the shape of a basic hairstyle, and the hair cluster to be adjusted and preset control points are distributed on the basic shape model;
the model adjusting module is configured to perform adjusting operation according to the preset control points, adjust the basic shape model and determine three-dimensional coordinates of the basic shape model after adjustment through the three-dimensional coordinates of the preset control points;
a hair cluster adjusting module configured to perform adjustment of a hair cluster to be adjusted on the basic shape model according to the three-dimensional coordinates adjusted by the basic shape model;
a model generation module configured to perform generating a three-dimensional hair model from the adjusted hair cluster.
9. An electronic device, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the method of reconstructing a three-dimensional hair model according to any of claims 1 to 7.
10. A storage medium having instructions that, when executed by a processor of an electronic device, enable the electronic device to perform a method of reconstructing a three-dimensional hair model according to any one of claims 1 to 7.
CN202010800420.3A 2020-08-11 2020-08-11 Method and device for reconstructing three-dimensional hair model, electronic equipment and storage medium Pending CN114078179A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010800420.3A CN114078179A (en) 2020-08-11 2020-08-11 Method and device for reconstructing three-dimensional hair model, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010800420.3A CN114078179A (en) 2020-08-11 2020-08-11 Method and device for reconstructing three-dimensional hair model, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114078179A true CN114078179A (en) 2022-02-22

Family

ID=80279765

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010800420.3A Pending CN114078179A (en) 2020-08-11 2020-08-11 Method and device for reconstructing three-dimensional hair model, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114078179A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210374995A1 (en) * 2020-06-01 2021-12-02 Beijing Dajia Internet Information Technology Co., Ltd. Method and electronic device for processing images

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210374995A1 (en) * 2020-06-01 2021-12-02 Beijing Dajia Internet Information Technology Co., Ltd. Method and electronic device for processing images
US11625904B2 (en) * 2020-06-01 2023-04-11 Beijing Dajia Internet Information Technology Co., Ltd. Method and electronic device for processing images

Similar Documents

Publication Publication Date Title
CN107274493B (en) Three-dimensional virtual trial type face reconstruction method based on mobile platform
Hu et al. Single-view hair modeling using a hairstyle database
US11868515B2 (en) Generating textured polygon strip hair from strand-based hair for a virtual character
US9202312B1 (en) Hair simulation method
Franco et al. A distributed approach for real time 3D modeling
Shen et al. Deepsketchhair: Deep sketch-based 3d hair modeling
Hu et al. Capturing braided hairstyles
WO2002009037A2 (en) Modeling human beings by symbol manipulation
KR20160041570A (en) Apparatus and method for generating montage, recording medium for performing the method
Xiao et al. Sketchhairsalon: Deep sketch-based hair image synthesis
Bao et al. A survey of image-based techniques for hair modeling
CN107221024B (en) Virtual object hair processing method and device, storage medium and electronic equipment
CN114078179A (en) Method and device for reconstructing three-dimensional hair model, electronic equipment and storage medium
US11010952B1 (en) Method and user interface for generating tangent vector fields usable for generating computer-generated imagery
CN111047675A (en) Method and device for simulating hair
Yu et al. A hybrid image-cad based system for modeling realistic hairstyles
US11710270B2 (en) Method for scattering points in a uniform arbitrary distribution across a target mesh for a computer animated creature
Liu et al. Three-dimensional cartoon facial animation based on art rules
CN114078180A (en) Three-dimensional hair model generation method and device, electronic equipment and storage medium
Bao et al. Realistic hair modeling from a hybrid orientation field
Liu et al. Interactive modeling of trees using VR devices
CA3169005A1 (en) Face mesh deformation with detailed wrinkles
CN116912433B (en) Three-dimensional model skeleton binding method, device, equipment and storage medium
US11783516B2 (en) Method for controlling digital feather generations through a user interface in a computer modeling system
Wang et al. Virtual Campus Roaming System

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination