+

CN114078179B - Three-dimensional hair model reconstruction method, device, electronic device and storage medium - Google Patents

Three-dimensional hair model reconstruction method, device, electronic device and storage medium Download PDF

Info

Publication number
CN114078179B
CN114078179B CN202010800420.3A CN202010800420A CN114078179B CN 114078179 B CN114078179 B CN 114078179B CN 202010800420 A CN202010800420 A CN 202010800420A CN 114078179 B CN114078179 B CN 114078179B
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.)
Active
Application number
CN202010800420.3A
Other languages
Chinese (zh)
Other versions
CN114078179A (en
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/CN114078179B/en
Publication of CN114078179A publication Critical patent/CN114078179A/en
Application granted granted Critical
Publication of CN114078179B publication Critical patent/CN114078179B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/08Projecting images onto non-planar surfaces, e.g. geodetic screens
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/40Analysis of texture
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Computer Graphics (AREA)
  • Geometry (AREA)
  • Software Systems (AREA)
  • Processing Or Creating Images (AREA)

Abstract

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 hair style, the hair cluster to be adjusted and preset control points are distributed on the basic shape model, adjusting the basic shape model according to adjustment operation on the preset control points, determining three-dimensional coordinates of the adjusted basic shape model through the three-dimensional coordinates of the adjusted preset control points, adjusting the hair cluster to be adjusted on the basic shape model according to the three-dimensional coordinates of the adjusted basic shape model, and generating a three-dimensional hair model according to the hair cluster after adjustment. Through the scheme of the present disclosure, the adjustment work of the designer to the hair cluster is reduced, the time spent for hair cluster adjustment is reduced, and the work efficiency of the designer is improved.

Description

Reconstruction method and device for three-dimensional hair model, electronic equipment and storage medium
Technical Field
The disclosure relates to the technical field of three-dimensional model reconstruction, in particular to a three-dimensional hair model reconstruction method, a three-dimensional hair model reconstruction device, electronic equipment and a storage medium.
Background
With the development of computer vision technology, three-dimensional reconstruction technology has emerged. The three-dimensional reconstruction technology is used for describing 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. Since the creation of hair can significantly enhance the realism of an avatar or virtual character, and the three-dimensional reconstruction technique is a key technique for creating virtual reality expressing an objective world in a computer, how to construct a realistic hair model using the three-dimensional reconstruction technique is an urgent problem to be solved.
In the related art, the hair is modeled based on multidirectional constraints, and a complete hair model is reconstructed mainly by using the hair surface geometry, the hair surface direction and the hair model geometry reconstructed from the 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, an apparatus, an electronic device, and a storage medium for reconstructing a three-dimensional hair model, so as to at least solve the technical problem that a lot of time is required to adjust hair clusters in the hair model in the related art. The technical scheme of the present disclosure is as follows:
according to a first aspect of 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 hair style, and the hair cluster to be adjusted and preset control points are distributed on the basic shape model;
according to the adjustment operation on the preset control points, the basic shape model is adjusted, and the three-dimensional coordinates of the adjusted basic shape model are determined through the three-dimensional coordinates of the adjusted preset control points;
According to the three-dimensional coordinates of the adjusted basic shape model, adjusting the hair cluster to be adjusted on the basic shape model;
And generating a three-dimensional hair model according to the adjusted hair cluster.
In one embodiment, the obtaining 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 to be adjusted, and original control points are distributed on the original basic shape model;
copying the hair cluster of interest and a corresponding original basic shape model to obtain a hair cluster copy of interest and a corresponding original basic shape model copy, wherein original control point copies are distributed on the original basic shape model copy, the hair cluster copy of interest 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 cluster to be adjusted on the basic shape model according to the adjusted three-dimensional coordinates of the basic shape model includes:
obtaining a 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 coordinates of the hair cluster to be adjusted according to the three-dimensional coordinates of the basic shape model after adjustment and 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;
and adjusting the hair cluster to be adjusted on the basic shape model according to the three-dimensional coordinates of the hair cluster to be adjusted after adjustment.
In one embodiment, the generating a three-dimensional hair model from the adjusted hair cluster includes:
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;
and performing skin operation on the adjusted hair cluster according to the position information of each bone point.
In one embodiment, the bone points are uniformly distributed along the length of the adjusted hair bundle.
In one embodiment, the performing a skinning operation on the adjusted hair bundle according to the position information of each bone point includes:
Adding bone to the adjusted hair cluster between 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 weights of all vertexes in the adjusted hair cluster according to the distance;
And associating bones between each vertex and each bone point according to the skin weight.
In one embodiment, the generating manner of the hair cluster to be adjusted includes:
acquiring a hair plane template, wherein the hair plane template comprises a plurality of projection images, and the projection images are obtained by projecting a basic shape model in a plurality of preset view directions;
Selecting a target projection diagram from the hair plane template, and acquiring drawn hair clusters through the target projection diagram;
Determining the geometric information of the drawn hair cluster according to the position information of the drawn hair cluster in the target projection diagram and the geometric information of a basic shape model corresponding to the target projection diagram;
and generating the hair cluster to be adjusted according to the geometric information of the drawn hair cluster.
In one embodiment, the method for generating the hair flat template includes:
Acquiring the basic shape model;
projecting the basic shape model in each preset view direction to obtain a projection diagram of the basic shape model in the preset view direction;
and generating the hair plane template according to a projection diagram of the basic shape model in the preset view direction.
According to a second aspect of embodiments of the present disclosure, there is provided a reconstruction device of a three-dimensional hair model, comprising:
The hair style 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 hair style, and the hair cluster to be adjusted and a preset control point are distributed on the basic shape model;
The model adjustment module is configured to perform adjustment operation on the preset control points, adjust the basic shape model and determine three-dimensional coordinates of the adjusted basic shape model through the three-dimensional coordinates of the adjusted preset control points;
a hair cluster adjustment module configured to perform adjustment of hair clusters to be adjusted on the basic shape model according to the three-dimensional coordinates adjusted by the basic shape model;
The model generation module is configured to generate a three-dimensional hair model according to the adjusted hair cluster.
In one embodiment, the obtaining module 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 to be adjusted, original control points are distributed on the original basic shape model, copy the hair cluster of interest and the corresponding original basic shape model to obtain a hair cluster copy of interest and a corresponding original basic shape model copy, the original basic shape model copy is distributed with an original control point copy, the hair cluster copy of interest 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 obtain a 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 executing the texture coordinates of the basic shape model, determine the three-dimensional coordinates of the hair cluster to be adjusted according to the three-dimensional coordinates of the basic shape model after adjustment and 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, and adjust the hair cluster to be adjusted on the basic shape model according to the three-dimensional coordinates of the hair cluster to be adjusted.
In one embodiment, the model generating module comprises a skeleton point generating unit and a skin operating unit;
The skeleton point generation unit is configured to perform generation of 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 skin operation unit is configured to perform skin operation on the adjusted hair bundle according to the position information of each bone point.
In one embodiment, the bone points are uniformly distributed along the length of the adjusted hair bundle.
In one embodiment, the skin operation unit is further configured to perform adding bone for the adjusted hair cluster between the bone points according to the position information of the bone points, obtain the position information of each vertex in the adjusted hair cluster, obtain 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, generate the skin weight of each vertex in the adjusted hair cluster according to the distance, and correlate the bone between each vertex and each bone point according to the skin weight.
In one embodiment, the reconstruction device further comprises a hair cluster generation module to be adjusted, wherein the hair cluster generation module is configured to be executed to acquire a hair plane template, the hair plane template comprises a plurality of projection images, the projection images are obtained by projecting a basic shape model in a plurality of preset view directions, a target projection image is selected from the hair plane template, a drawn hair cluster is acquired through the target projection image, the geometric information of the drawn hair cluster is determined according to the position information of the drawn hair cluster in the target projection image and the geometric information of the basic shape model corresponding to the target projection image, and the hair cluster to be adjusted is generated according to the geometric information of the drawn hair cluster.
In one embodiment, the reconstruction device further includes a hair plane template generating module configured to perform obtaining the basic shape model, project 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 generate the hair plane template according to the projection view of the basic shape model in the preset view direction.
According to a third aspect of embodiments of the present disclosure, there is provided 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 as described in any of the embodiments of the first aspect.
According to a fourth aspect of embodiments of the present disclosure, there is provided a storage medium, which when executed by a processor of an electronic device, enables the electronic device to perform the method of reconstructing a three-dimensional hair model as set forth in any one of the embodiments 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 at least one processor of a 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 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 hair style, the hair cluster to be adjusted and preset control points are distributed on the basic shape model, adjusting the basic shape model according to adjustment operation on the preset control points, determining three-dimensional coordinates of the adjusted basic shape model through the three-dimensional coordinates of the adjusted preset control points, adjusting the hair cluster to be adjusted on the basic shape model according to the three-dimensional coordinates of the adjusted basic shape model, and generating a three-dimensional hair model according to the adjusted hair cluster. The method and the device realize adjustment of the hair cluster 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 the number of the vertexes of the basic shape model, compared with the traditional technology that the hair cluster is adjusted through the vertexes to change the shape of the hair model, the time spent for adjusting the hair cluster is shortened, the workload of a designer is reduced, the time required for designing a single material is also reduced, and therefore 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 disclosure and together with the description, serve to explain the principles of the disclosure and do not constitute an undue limitation on the disclosure.
Fig. 1 is an application environment diagram illustrating a method of reconstructing a three-dimensional hair model according to an exemplary embodiment.
Fig. 2 is a flowchart 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 method of reconstructing a three-dimensional hair model according to an exemplary embodiment.
Fig. 4 is a flowchart illustrating a step S230 in a method of reconstructing a three-dimensional hair model according to an exemplary embodiment.
Fig. 5 is a flowchart illustrating a step S240 in a method of reconstructing a three-dimensional hair model according to an exemplary embodiment.
Fig. 6a is a flowchart illustrating a step S510 in a method of reconstructing a three-dimensional hair model according to an exemplary embodiment.
Fig. 6b is a schematic diagram illustrating a bone point distribution according to an exemplary embodiment.
Fig. 7 is a flowchart illustrating a step S520 in a method of reconstructing a three-dimensional hair model according to an exemplary embodiment.
Fig. 8 is a flowchart illustrating a method of generating hair tufts to be adjusted according to an exemplary embodiment.
Fig. 9 is a flowchart illustrating a manner in which a hair flat template is generated, according to an exemplary embodiment.
Fig. 10 is a flowchart illustrating a method of reconstructing a three-dimensional hair model, according to an exemplary embodiment.
Fig. 11 is a block diagram illustrating a three-dimensional hair model reconstruction device according to an exemplary embodiment.
Fig. 12 is an internal structural diagram of an electronic device, which is shown according to an exemplary embodiment.
Detailed Description
In order to enable those skilled in the art to better understand the technical solutions of the present disclosure, the technical solutions of 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 foregoing figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the disclosure described herein may be capable of operation in sequences other than those illustrated or described herein. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present disclosure as detailed in the accompanying claims.
The reconstruction method of the three-dimensional hair model provided by the disclosure can be applied to an application environment shown in fig. 1. Wherein the terminal 110 interacts with the server 120 through a 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 hair style, the hair cluster to be adjusted and preset control points are distributed on the basic shape model, the basic shape model is adjusted according to adjustment operation on the preset control points, the three-dimensional coordinates of the adjusted basic shape model are determined through the three-dimensional coordinates of the adjusted preset control points, the hair cluster to be adjusted on the basic shape model is adjusted according to the three-dimensional coordinates of the adjusted basic shape model, and the three-dimensional hair model is generated according to the adjusted hair cluster. And adjusting the preset control points on the basic shape model to realize the adjustment of the hair cluster to be adjusted. Because the number of the preset control points is far smaller than that of the vertexes of the basic shape model, the hair cluster to be adjusted is adjusted through the preset control points in the implementation, and the three-dimensional hair model is generated according to the hair cluster after adjustment.
The terminal 110 may be, but not limited to, various personal computers, notebook computers, smartphones, tablet computers, and portable wearable devices, and the server 120 may be implemented as a stand-alone server or a server cluster composed of a plurality of servers.
Fig. 2 is a flowchart illustrating a method of reconstructing a three-dimensional hair model according to an exemplary embodiment, which is used in the terminal 110 of fig. 1, as shown in fig. 2, and includes the steps of:
in step S210, a hair bundle to be adjusted and a corresponding basic shape model are acquired.
The three-dimensional hair model is a three-dimensional model corresponding to hair with a specific hairstyle, for example, the three-dimensional hair model can be a three-dimensional model corresponding to secondary hair. The basic shape model is a three-dimensional model representing the shape of a basic hair style, the basic shape model can be a three-dimensional model obtained by summarizing and abstracting the characteristics and the shape of a common hair style, and the common hair style can be long hair, short hair, bang, back head, horsetail, balls and the like. The surface of the basic shape model is a curved surface to which the hair of various basic hairstyles is attached. The basic shape model is distributed with hair clusters to be adjusted and preset control points. It will be appreciated that if the three-dimensional hair model corresponds to a complex hair style, the reconstruction of the three-dimensional hair model requires a plurality of basic shape models, the three-dimensional hair model being composed of a plurality of groups of hair clusters, which may be a cluster of hair constituting 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 may correspond to at least one set of hair tufts. And the hair bundle to be adjusted is a hair bundle requiring adjustment of position and/or shape. The preset control points are characteristic points for representing the basic hairstyle, the number and the distribution condition of the preset control points can be preset in combination with the actual condition, the number of the preset control points is far smaller than the number of 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 other 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, generating the vertex of the basic shape model according to the position of the preset control point through cubic spline interpolation, and then, a mapping relation exists between the preset control point and the basic shape model. In particular, the number of hair clusters and their respective corresponding basic shape models are obtained locally from a computer or loaded from another computer device connected to the computer network. To realistically display a three-dimensional hair model, some or all of the hair clusters therein need to be adjusted. From which the hair cluster to be adjusted is selected, and the basic shape model corresponding to the hair cluster to be adjusted is selected, because the hair cluster is attached to the corresponding basic shape model.
In step S220, 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 according to the adjusted three-dimensional coordinates of the preset control point.
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 characterizing the position of the base shape model within the world coordinate system. Because the hair cluster is attached to the basic shape model, and a mapping relation exists between the preset control point on the basic shape model and the basic shape model, the adjustment of the basic shape model is realized through the adjustment of the preset control point, and the adjustment of the hair cluster is realized through the adjustment of the basic shape model.
Specifically, according to the actual demand 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 undergo an adjustment operation, and the positions of the preset control points are changed in response to the adjustment instruction of the preset control points. Because of the mapping relation between the preset control points on the basic shape model and the basic shape model, the position of the basic shape model changes along with the position of the preset control points after the position of the preset control points changes. And because the hair clusters are attached to the basic shape model, the positions of the basic shape model change, the positions of the hair clusters to be adjusted distributed on the basic shape model also change, and the position information in the world coordinate system is recorded as three-dimensional coordinates. Therefore, the three-dimensional coordinates after the adjustment of the basic shape model are determined by the three-dimensional coordinates after the adjustment of the preset control points. The adjustment instruction is an operation instruction that occurs at a preset control point and is used for adjusting the styling of the hair, and the adjustment instruction may be a drag operation on the preset control point, or may be an adjustment distance for inputting the preset control point in a display interface of the basic shape model, or the like.
In step S230, the hair cluster to be adjusted on the basic shape model is adjusted according to the three-dimensional coordinates of the adjusted basic shape model.
Specifically, a mapping relationship exists between a preset control point on the basic shape model and the basic shape model, and the three-dimensional coordinates of the basic shape model after adjustment are determined through the three-dimensional coordinates of the preset control point after adjustment. The hair clusters are attached to the basic shape model, the positions of the basic shape model change, and the positions of the hair clusters to be adjusted distributed on the basic shape model also change, so that the positions of the hair clusters to be adjusted can be determined according to the three-dimensional coordinates of the hair clusters to be adjusted after adjustment of the basic shape model, and the hair clusters to be adjusted are adjusted according to the positions of the hair clusters to be adjusted after adjustment.
In step S240, a three-dimensional hair model is generated from the adjusted hair cluster.
Specifically, according to the actual demand 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 of the hair bundle to be adjusted is completed, a final three-dimensional hair model can be generated by using the adjusted hair bundle. It will be appreciated that the initial three-dimensional hair model includes a plurality of hair tufts therein. If all the hair clusters need to be adjusted, all the hair clusters are to be adjusted, after the adjustment is completed on all the hair clusters, the adjusted hair clusters are obtained, so that the three-dimensional hair model is generated by utilizing the other hair clusters except the part and the adjusted hair clusters.
The three-dimensional hair model reconstruction method comprises the steps of obtaining a hair cluster to be adjusted and a corresponding basic shape model, adjusting the basic shape model according to adjustment operation on the preset control point, determining three-dimensional coordinates of the adjusted basic shape model according to the three-dimensional coordinates of the adjusted preset control point, adjusting the hair cluster to be adjusted on the basic shape model according to the three-dimensional coordinates of the adjusted basic shape model, and generating a three-dimensional hair model according to the adjusted hair cluster. In this embodiment, the adjustment of the hair cluster to be adjusted is achieved by adjusting the preset control point on the basic shape model. Because the number of the preset control points is far smaller than the number of the vertexes of the basic shape model, compared with the traditional technology that the hair cluster is adjusted through the vertexes to change the shape of the hair model, the time spent for adjusting the hair cluster is shortened, the workload of a designer is reduced, the time required for 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 cluster to be adjusted and a corresponding basic shape model are obtained, which may be specifically implemented by the following steps:
in step S310, the hair cluster of interest and the corresponding original basic shape model are acquired.
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 hair straightening hair strands that are tuned to hair curling hair strands. The hair clusters of interest are distributed on an original basic shape model with original control points distributed on the original basic shape model. The original base shape model may be a base shape model that is any operation performed. In particular, in one aspect, a number of hair clusters of interest and their respective corresponding raw base shape models may be obtained locally from a computer or loaded from another computer device connected to a computer network. In another aspect, the number of hair tufts and their respective corresponding basic shape models are obtained locally from a computer or loaded from another computer device connected to the computer network. In order to realistically display the three-dimensional hair model, a hair cluster of interest is selected therefrom, since the hair cluster is attached to the corresponding basic shape model, and the 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 duplicated to obtain a hair cluster copy of interest and a corresponding original basic shape model copy, original control point copies are distributed on the original basic shape model copy, the hair cluster copy of interest 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, the basic shape model is attached with a plurality of groups of hair clusters, the positions among the plurality of groups of hair clusters are mutually influenced, one group of hair clusters is adjusted, other hair clusters can be adjusted along with the adjustment, and the problem can increase the adjustment work of a designer on the hair clusters. For example, subsequent adjustments to other hair tufts can affect the hair tufts that have been adjusted, not only can the realistic effect of hair styling be affected, but the need for a designer to readjust the hair tufts that have been adjusted can take a significant amount of time to adjust the hair tufts. In order to avoid the mutual influence between hair clusters, the freedom degree of operation regulation of a designer is increased, and the hair clusters to be regulated and the corresponding basic shape models can be independent through replication, so that the positions of other hair clusters are not influenced when the hair clusters to be regulated and the corresponding basic shape models are regulated. The copy of the hair cluster of interest is obtained by copying the source file of the hair cluster of interest, and the copy of the basic shape model corresponding to the copy of the hair cluster of interest is obtained by copying the basic shape model corresponding to the source file of the hair cluster of interest. Specifically, selecting an interesting hair cluster and a corresponding original basic shape model from a plurality of groups of hair clusters as copy contents, and responding to a pasting instruction of the interesting hair cluster and the corresponding original basic shape model to generate an interesting hair cluster copy and a corresponding original basic shape model copy. Since the hair cluster replica of interest and the corresponding original base shape model replica are obtained by a replication operation, the original control point replica is distributed on the original base shape model replica. In order to adjust the hair cluster copy of interest, the hair cluster copy of interest is taken as a hair cluster to be adjusted, a corresponding original basic shape model copy is taken as a basic shape model, and an original control point copy is taken as a preset control point. It should be noted that, in the present disclosure, the hair cluster to be adjusted may be a hair cluster to be adjusted directly obtained from a computing device local or another computer device 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 method for reconstructing the three-dimensional hair model, the hair cluster of interest and the corresponding original basic shape model are obtained, and the hair cluster copy of interest and the corresponding original basic shape model copy are obtained by copying the hair cluster of interest and the corresponding original basic shape model. Therefore, the embodiment effectively avoids the mutual influence of the hair clusters by providing the copying function of the hair clusters and the corresponding basic shape model, and further adjusts the interesting hair cluster copy in response to the adjusting instruction of the original control point copy, thereby not only reducing the adjusting work of the hair clusters in the hair model of the designer, but also reducing the time spent for adjusting the hair clusters, and improving the working efficiency of the designer.
In an exemplary embodiment, as shown in fig. 4, in step S230, the adjustment of the hair bundle to be adjusted on the basic shape model according to the three-dimensional coordinates adjusted by the basic shape model may be specifically implemented by the following steps:
In step S410, the 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 by the texture coordinates of the basic shape model.
In step S420, the three-dimensional coordinates of the hair bundle to be adjusted are determined according to the three-dimensional coordinates of the basic shape model after adjustment and the correspondence between the three-dimensional coordinates of the basic shape model and the three-dimensional coordinates of the hair bundle to be adjusted.
In step S430, the hair cluster to be adjusted on the basic shape model is adjusted according to the three-dimensional coordinates of the hair cluster to be adjusted.
The texture coordinates have two coordinate axes, namely U and V, and are called UV coordinates, and can be used for defining the position information of each point on the picture, wherein U represents the distribution on the transverse coordinates, and V represents the distribution on the longitudinal coordinates. Geometric information of the basic shape model is known, the geometric information includes 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 coordinates of the hair cluster to be adjusted can be obtained through the texture coordinates of the basic shape model. Further, as the texture coordinates have invariance and a one-to-one correspondence between the texture coordinates and the three-dimensional coordinates, 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 substituting the three-dimensional coordinates of the basic shape model after adjustment into 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, calculating, and determining the three-dimensional coordinates of the hair cluster to be adjusted after adjustment. And finally, adjusting the hair cluster to be adjusted on the basic shape model according to the three-dimensional coordinates 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. And determining the three-dimensional coordinates of the hair cluster to be adjusted according to the three-dimensional coordinates of the basic shape model after adjustment and 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. And finally, adjusting the hair cluster to be adjusted on the basic shape model according to the three-dimensional coordinates of the hair cluster to be adjusted. Therefore, the embodiment realizes high-precision adjustment of the hair model, and reduces the complexity of the 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:
In step S510, a plurality of skeletal 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, the adjusted hair bundle is subjected to a skinning operation according to the position information of each bone point.
In order to increase the realism of the three-dimensional hair model, a reasonable internal solid structure (skeleton structure) may be added to each group of hair clusters, for example, a preset number of skeletons are connected end to form the internal solid structure of the current hair cluster. Skeletal points are nodes forming the internal solid structure of the three-dimensional hair model, and a piece of bone is added between adjacent skeletal points. To drive the three-dimensional hair model to produce reasonable movements, 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, so that the adjusted hair cluster is obtained. And adding a skeleton structure to the hair cluster by combining the position information of the hair cluster after adjustment, acquiring the position information of the hair cluster after adjustment on the corresponding basic shape model, and determining the distribution condition of skeleton points according to the acquired position information so as to generate corresponding skeleton points. And acquiring the position information of each bone point, and performing skin operation on the adjusted hair cluster by combining the position information of each bone point.
In the method for reconstructing 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 the skin operation is carried out on the adjusted hair cluster according to the position information of each skeleton point. Therefore, the binding workload 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 skeletal points is uniformly distributed along the length of the adjusted hair bundle. Further exemplary, as shown in fig. 6a, in step S510, a number of skeletal 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, root points and tip points on the hair bundle are acquired.
In step S620, a predetermined 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, skeletal points on the hair bundle are generated from the root points, the tip points and the edge points.
Wherein the hair cluster comprises a hair root point and a hair tip point. The edge profile refers to the boundary line that forms the outer edge of the hair tuft. In particular, in order to bind a three-dimensional hair model to a bone structure, it is necessary to first generate a corresponding bone structure comprising bone points and bone between adjacent bone points. To increase the realism of a three-dimensional hair model, corresponding skeletal points are generated in combination with the actual condition of the hair cluster. Therefore, firstly, the root points and the tip points on the hair cluster are required to be acquired, then, a preset number of points are extracted from the edge contour of the hair cluster to serve as edge points, the edge points are uniformly distributed between the root points and the tip points, and finally, the skeleton points of the hair cluster are generated according to the root points of the hair cluster, the tip points of the hair cluster and the edge points on the edge contour of the hair cluster.
Further, the midpoints of the two edge points at the same height are obtained, and the midpoints between the root point, the tip point and the edge points at the same height are taken as skeleton points of the hair cluster. Illustratively, as shown in fig. 6b, the hair bundle comprises a root point 610 and a tip point 620, three edge points 630 are uniformly distributed on the edge contour of the hair bundle copy, the midpoints 640 of the two edge points 630 on the same height are obtained, and the midpoint 640 between the root point 610, the tip point 620 and the edge points 630 on the same height is taken as the skeleton point of the hair bundle.
In the above method for reconstructing a three-dimensional hair model, in combination with the actual situation of the hair cluster, the skeleton points are uniformly distributed in the length direction of the adjusted hair cluster, for example, the midpoint between the root point, the tip point and the edge point located at the same height is used as the skeleton point of the hair cluster, so as to increase the reality of the three-dimensional hair model.
In an exemplary embodiment, as shown in fig. 7, in step S520, the skin operation is performed on the adjusted hair bundle according to the position information of each bone point, which may be specifically implemented by the following steps:
In step S710, bone is added to the adjusted hair cluster between the bone points according to the position information of the bone points.
Wherein the bone points are articulation points forming the internal solid structure of the hair cluster after adjustment, and a bone is added between adjacent bone points. In particular, bone may be added between the bone points for the adjusted hair cluster in order to drive the adjusted hair cluster into a reasonable motion.
In step S720, positional information of each vertex in the adjusted hair bundle is acquired.
Specifically, the hair cluster comprises a plurality of vertexes, after the hair cluster is adjusted through the preset control points, the position information of each vertex in the hair cluster is changed, and 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 obtained based on the position information of each vertex and the position information of each bone point.
The method comprises the steps of obtaining root points and tip points on a hair cluster, extracting a preset number of points from the edge contour of a hair cluster copy to serve as edge points, enabling the edge points to be uniformly distributed between the root points and the tip points, and generating skeleton points on the hair cluster copy according to the root points, the tip points and the edge points, wherein the position information of the skeleton points can be known. The distance between each vertex and each bone point is calculated on the basis of the position information of each vertex and the position information of each bone point. Further, to avoid interference with distant bone points, bone points adjacent to each vertex are selected from the bone points of the hair cluster for calculation of the distance between the vertex and the bone point, i.e., the vertex is only affected by two bone points adjacent thereto.
In step S740, skin weights for each vertex in the adjusted hair bundle are generated based on the distance.
The skin weight is used for representing the influence of each bone point on any vertex in the hair cluster copy. Skin weights are determined primarily based on the distance from the vertex to the bone point. The closer the distance, the greater the weight. As above, to avoid interference with distant bone points, only the effect of two bone points adjacent to each vertex on it is considered. Therefore, first, two bone points nearest to the current vertex are found according to the distance, and the two bone points d1 and d2 from the current vertex to the nearest neighbor are calculated. Then the skin weight can be expressed as:
W1=d2/(d1+d2);
W2=d1/(d1+d2)。
in step S750, bones between each vertex and each bone point are associated according to the skin weights.
Wherein, because the skeleton structure and the hair cluster are mutually independent, through the skin operation, the skeleton structure is added to the hair cluster, and the change of the skeleton structure can drive the hair cluster to generate corresponding movement. Specifically, the skin weights of the vertices in the adjusted hair bundle have been calculated from the distance between the vertices and the skeletal points. And then the bones between the vertexes and the bone points are related according to the skin weights, so that the bones drive the hair cluster to move.
In the reconstruction method of the three-dimensional hair model, the skin 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 the static three-dimensional hair model in the traditional technology cannot meet the actual demand is solved, and the established three-dimensional hair model is perfected. Not only can the production efficiency of designer be promoted, the reality of three-dimensional hair model is promoted through the skin operation moreover.
Fig. 8 is a flowchart illustrating a method of generating hair clusters to be adjusted according to an exemplary embodiment, as shown in fig. 8, including the steps of:
In step S810, a hair plane template is acquired, the hair plane template including a plurality of projection views, the projection views being obtained by projecting the basic shape model in a plurality of preset view directions.
The hair flat template may be a flat template for guiding a flat designer to design a three-dimensional hair model. A flat designer can design a flat stock of a three-dimensional hair model through a hair flat template. The hair plane template comprises a plurality of projection patterns, and the projection patterns are obtained by projecting the basic shape model in a plurality of preset view directions. The basic shape model is a three-dimensional model characterizing the shape of the basic hair style. For example, the basic shape model may be a three-dimensional model obtained by summarizing and abstracting the characteristics and shape of a common hair style, which may be long hair, short hair, bang, back head, horsetail, balls, etc. The surface of the basic shape model is a curved surface to which the hair of various basic hairstyles is attached. The view direction is the direction in which light rays are projected from one face of the basic shape model to the opposite face thereof, and can be understood as the 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 rear of the basic shape model, from the left to the right of the basic shape model, and from the top to the bottom of the basic shape model. The preset view directions include a front view direction, a rear view direction, a left view direction, a right view direction, and the like. A projection view refers to a view of light projected from one face of an object to the opposite face. In particular, the hair flat template is obtained locally from a computer or loaded from another computer device connected to a computer network.
In step S820, a target projection map is selected from the hair plane template, and the drawn hair cluster is acquired from the target projection map.
Wherein the hair is composed of several groups of hair clusters, and the three-dimensional hair model is composed of several hair clusters. The drawn hair bundle is a planar image of the hair bundle constituting the three-dimensional hair model in the target projection view. On the target projection diagram, a designer draws the shape and texture of each hair cluster from the view direction corresponding to the target projection diagram to design a three-dimensional hair model. Specifically, after the hair flat template is obtained, a plurality of projection images included in the hair flat template can be displayed, and a designer selects a target projection image from the hair flat template according to actual design requirements. After the designer finishes the drawing of the hair cluster on the target projection chart, the drawn hair cluster can be immediately sent to a server or a current computer background, so that the server or the computer background acquires the hair cluster drawn on the target projection chart. Alternatively, the drawn hair clusters may be stored locally in the computer, and the hair clusters drawn on the target projection map may be obtained locally from the computer. The hair cluster drawn on the target projection graph may also be stored in advance in another computer device connected to the local network of computers, and the hair cluster drawn on the target projection graph is obtained from the other computer device connected to the local network of computers.
In step S830, the 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 basic shape model corresponding to the target projection view.
The position information of the hair cluster in the target projection chart refers to the position information of the designer drawing the hair cluster on the target projection chart, wherein the drawn hair cluster is relative to the target projection chart. Geometric information is information or data used to characterize texture features, spatial structures, spatial locations of a three-dimensional model. Each base shape model has corresponding geometric information characterizing the spatial structure of the base shape model, the spatial positions of the vertices, etc. Specifically, at least one hair cluster is drawn on the target projection chart, and the position information of the drawn hair cluster in the target projection chart is known, so that the position information of the drawn hair cluster in the target projection chart can be obtained. In order to accurately and quickly generate a three-dimensional hair model, geometric information of a basic shape model corresponding to a generated target projection image is acquired. Further, the drawn hair cluster is attached to the projection contour of the basic shape model, and a projection relation exists between the projection of the basic shape model and the basic shape model corresponding to the target projection graph, so that the geometric information of the hair cluster can be determined by utilizing the position information of the drawn hair cluster in the target projection graph and the geometric information of the basic shape model corresponding to the target projection graph.
In step S840, hair clusters to be adjusted are generated from the geometric information of the drawn hair clusters.
As mentioned above, the hair is made up of several groups of hair clusters, and the three-dimensional hair model is likewise made up of several hair clusters. Specifically, the geometric information of the hair bundle includes texture information and stereoscopic information of the hair bundle. Generating a space structure of the hair cluster according to the three-dimensional information of the hair cluster, and rendering the surface of the space structure of the hair cluster according to the texture information of the hair cluster to generate the hair cluster to be adjusted.
The method for generating the hair cluster to be adjusted comprises the steps of obtaining a hair plane template, selecting a target projection image from the hair plane template, obtaining the drawn hair cluster through the target projection image, determining the geometric information of the hair cluster according to the position information of the hair cluster in the target projection image and the geometric information of a basic shape model corresponding to the target projection image, and generating a three-dimensional hair model according to the geometric information of the hair cluster. Therefore, the embodiment realizes the modeling work of completing the three-dimensional hair by using the plane template, so that the generating efficiency of the three-dimensional hair modeling can be improved and the difficulty of the three-dimensional hair modeling is reduced according to the embodiment.
Fig. 9 is a flowchart illustrating a method of generating a hair flat template according to an exemplary embodiment, as shown in fig. 9, including the steps of:
In step S910, a basic shape model is acquired.
In step S920, the basic shape model is projected in each preset view direction, so as to obtain a projection diagram of the basic shape model in the preset view direction.
In step S930, a hair plane template is generated from the projection view of the basic shape model in the preset view direction.
Specifically, the characteristics and the shapes of the common hairstyles are summarized and abstracted to obtain a basic shape model, and the obtained basic shape model is stored. The basic shape model may be obtained locally from the computer when it is desired to draw the hair cluster, or may be obtained from another computer device via a network and loaded locally to the computer. In order to facilitate the design of the three-dimensional model by a plane designer, the basic shape model is projected in each preset view direction to obtain a projection diagram of the basic shape model in the preset view direction, and the hair plane template is generated according to the projection diagram of the basic shape model in each preset view direction.
In the generation mode of the hair flat template, a new path is provided for a flat designer to design a three-dimensional hair model, so that the flat designer can complete the design of the three-dimensional hair model by drawing a two-dimensional hair cluster image on a projection diagram of the basic shape model. The embodiment not only reduces the learning cost of the designer, but also helps the plane designer complete the work of three-dimensional design. Further, when actually designing a three-dimensional hair model, a designer may select an appropriate basic shape model and an appropriate viewing angle according to the needs of a specific hair style, and generate a hair plane template. In the hair plane template, a proper position, a proper shape and a proper texture are selected to draw corresponding hair clusters. When the hair cluster is drawn through the hair plane template, the whole process is directly controllable relative to a designer, so that the working efficiency of the designer is improved, and the design effect of the three-dimensional hair model is also improved.
Fig. 10 is a flowchart illustrating a method of reconstructing a three-dimensional hair model according to an exemplary embodiment, which is used in the terminal 110 of fig. 1, as shown in fig. 10, and includes the steps of:
In step S1002, a basic shape model is acquired.
In step S1004, the basic shape model is projected in each preset view direction, so as to obtain a projection diagram of the basic shape model in the preset view direction.
In step S1006, a hair plane template is generated from a projection view of the basic shape model in a preset view direction.
In step S1008, a hair flat template is acquired, the hair flat template including a plurality of projection views, the projection views being obtained by projecting the basic shape model in a plurality of preset view directions.
In step S1010, a target projection map is selected from the hair plane template, and the drawn hair cluster is acquired from the target projection map.
In step S1012, geometric information of the drawn hair bundle is determined according to the position information of the drawn hair bundle in the target projection view and the geometric information of the basic shape model corresponding to the target projection view.
In step S1014, hair tufts to be adjusted are generated from the geometric information of the drawn hair tufts.
In step S1016, a hair cluster to be adjusted and a corresponding basic shape model are obtained, wherein the basic shape model is a three-dimensional model representing the shape of a basic hair style, and the hair cluster to be adjusted and preset control points are distributed on the basic shape model.
The method comprises the steps of obtaining an interested hair cluster and a corresponding original basic shape model, wherein the interested hair cluster is a hair cluster needing to be adjusted, original control points are distributed on the original basic shape model, copying the interested hair cluster and the corresponding original basic shape model to obtain an interested 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 interested hair cluster copy as the 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 according to the adjusted three-dimensional coordinates of the preset control point.
In step S1020, 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 by the texture coordinates of the basic shape model.
In step S1022, the three-dimensional coordinates of the hair bundle to be adjusted are determined according to the three-dimensional coordinates of the basic shape model after adjustment and the correspondence 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 three-dimensional coordinates of the hair cluster to be adjusted.
The method comprises the steps of responding to an adjustment instruction of a preset control point on a basic shape model copy, adjusting the basic shape model copy, obtaining three-dimensional coordinates of the adjusted basic shape model copy, obtaining texture coordinates of hair cluster copies corresponding to the basic shape model copy, converting the texture coordinates of the hair cluster copies according to the three-dimensional coordinates of the adjusted basic shape model copy to obtain three-dimensional coordinates of the hair cluster copies, and adjusting the hair cluster copies corresponding to the basic shape model copy according to the three-dimensional coordinates of the hair cluster copies.
In step S1026, a plurality of skeletal 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, each skeleton point is evenly distributed along the length direction of the hair cluster after adjustment. The method comprises the steps of obtaining a root point and a tip point on a hair cluster, extracting a preset number of points from the edge contour of the hair cluster to serve as edge points, uniformly distributing the edge points between the root point and the tip point, and taking the midpoint among the root point, the tip point and the edge point at the same height as a skeleton point on the hair cluster.
In step S1028, the adjusted hair bundle is skinned according to the position information of each bone point.
Specifically, according to the position information of each bone point, adding bones for the adjusted hair cluster between the bone points, acquiring the position information of each vertex in the adjusted hair cluster, and according to the position information of each vertex and the position information of each bone point, acquiring the distance between each vertex and each bone point;
generating skin weights of all vertexes in the hair cluster after adjustment according to the distance; and associating bones between each vertex and each bone point according to the skin weight.
It should be understood that, although the steps in the above-described flowcharts are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least some of the steps in the flowcharts described above may include a plurality of steps or stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of execution of the steps or stages is not necessarily sequential, but may be performed in turn or alternately with at least a part of other steps or stages.
Fig. 11 is a device block diagram illustrating a three-dimensional hair model reconstruction device according to an exemplary embodiment. Referring to fig. 11, the reconstruction device 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, wherein the basic shape model is a three-dimensional model representing a shape of a basic hairstyle, and the hair cluster to be adjusted and a preset control point are distributed on the basic shape model;
A model adjustment module 1104 configured to perform adjustment of the basic shape model according to the adjustment operation on the preset control point, and determine the adjusted three-dimensional coordinates of the basic shape model by the adjusted three-dimensional coordinates of the preset control point;
a hair cluster adjustment module 1106 configured to perform adjustment of hair clusters to be adjusted on the basic shape model according to the three-dimensional coordinates of the basic shape model;
The model generation module 1108 is configured to perform generating a three-dimensional hair model from the adjusted hair clusters.
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 to be adjusted, and the original basic shape model is distributed with original control points, copy the hair cluster of interest and the corresponding original basic shape model to obtain a hair cluster copy and a corresponding original basic shape model copy, and the original basic shape model copy is distributed with original control point copy, where the hair cluster copy of interest 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 adjustment module 1106 is further configured to obtain a correspondence between the three-dimensional coordinates of the basic shape model and the three-dimensional coordinates of the hair cluster to be adjusted by performing texture coordinates of the basic shape model, determine the three-dimensional coordinates of the hair cluster to be adjusted according to the three-dimensional coordinates of the basic shape model after adjustment and the correspondence between the three-dimensional coordinates of the basic shape model and the three-dimensional coordinates of the hair cluster to be adjusted, and adjust the hair cluster to be adjusted on the basic shape model according to the three-dimensional coordinates of the hair cluster to be adjusted.
In an exemplary embodiment, the model generation module 1108 includes a skeletal point generation unit and a skin manipulation unit;
The skeleton point generation unit is configured to perform generation of 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 skin operation unit is configured to perform skin operation on the adjusted hair bundle according to the position information of each bone point.
In an exemplary embodiment, each of the skeletal points is uniformly distributed along the length of the adjusted hair bundle.
In an exemplary embodiment, the skin operation unit is further configured to perform adding bone for the adjusted hair bundle between the bone points according to the position information of the bone points, obtain the position information of each vertex in the adjusted hair bundle, obtain 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, generate the skin weight of each vertex in the adjusted hair bundle according to the distance, and correlate the bone between each vertex and each bone point according to the skin weight.
In an exemplary embodiment, the reconstruction device further comprises a hair cluster generation module to be adjusted, wherein the hair cluster generation module is configured to be executed to acquire a hair plane template, the hair plane template comprises a plurality of projection images, the projection images are obtained by projecting a basic shape model in a plurality of preset view directions, a target projection image is selected from the hair plane template, a drawn hair cluster is acquired through the target projection image, the geometric information of the drawn hair cluster is determined according to the position information of the drawn hair cluster in the target projection image and the geometric information of the basic shape model corresponding to the target projection image, and the hair cluster to be adjusted is generated according to the geometric information of the drawn hair cluster.
In an exemplary embodiment, the reconstruction device further includes a hair flat template generating module configured to perform obtaining the basic shape model, project the basic shape model in each of the preset view directions to obtain a projection view of the basic shape model in the preset view direction, and generate the hair flat template according to the projection view of the basic shape model in the preset view direction.
The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.
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 applications, executable by processing component 1220. The application programs stored in memory 1222 may include one or more modules each corresponding to a set of instructions. In addition, the processing component 1220 is configured to execute instructions to perform the above-described method of reconstructing a three-dimensional hair model.
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. Device 1200 may operate based on an operating system stored in memory 1222, such as Window12 12erver,Mac O12 X,Unix,Linux,FreeB12D or the like.
In an exemplary embodiment, a storage medium is also provided, such as a memory 1222 including instructions executable by a processor of the apparatus 1200 to perform the above-described method of reconstructing a three-dimensional hair model. The storage medium may be a non-transitory computer readable storage medium, which may be, for example, ROM, random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
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 adaptations, 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 is to be understood that the present disclosure is not limited to the precise arrangements and instrumentalities shown in the drawings, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (17)

1. A method for reconstructing a three-dimensional hair model, comprising:
acquiring an interested hair cluster and a corresponding original basic shape model, wherein the interested hair cluster is a hair cluster to be adjusted, and original control points are distributed on the original basic shape model;
Copying the interesting hair cluster and a 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 a hair cluster to be adjusted, the corresponding original basic shape model copy is used as the basic shape model, the original control point copies are used as preset control points, the basic shape model is a three-dimensional model representing the shape of a basic hair style, and the hair cluster to be adjusted and the preset control points are distributed on the basic shape model;
according to the adjustment operation on the preset control points, the basic shape model is adjusted, and the three-dimensional coordinates of the adjusted basic shape model are determined through the three-dimensional coordinates of the adjusted preset control points;
according to the three-dimensional coordinates of the basic shape model after adjustment and 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, adjusting the hair cluster to be adjusted on 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 the adjusting the hair cluster to be adjusted on the basic shape model according to the three-dimensional coordinates of the basic shape model and the correspondence between the three-dimensional coordinates of the basic shape model and the three-dimensional coordinates of the hair cluster to be adjusted comprises:
obtaining a 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 coordinates of the hair cluster to be adjusted according to the three-dimensional coordinates of the basic shape model after adjustment and 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;
and adjusting the hair cluster to be adjusted on the basic shape model according to the three-dimensional coordinates of the hair cluster to be adjusted after adjustment.
3. The method of claim 1, wherein generating the three-dimensional hair model from the adjusted hair clusters comprises:
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;
and performing skin operation on the adjusted hair cluster according to the position information of each bone point.
4. A method of reconstructing a three-dimensional hair model according to claim 3, wherein said bone points are uniformly distributed along the length of said adjusted hair bundle.
5. A method of reconstructing a three-dimensional hair model according to claim 3, wherein said performing a skinning operation on said adjusted hair bundle based on the positional information of each of said skeletal points comprises:
Adding bone to the adjusted hair cluster between 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 weights of all vertexes in the adjusted hair cluster according to the distance;
And associating bones between each vertex and each bone point according to the skin weight.
6. The method for reconstructing a three-dimensional hair model according to any one of claims 1 to 5, wherein said generating means of hair clusters to be adjusted comprises:
acquiring a hair plane template, wherein the hair plane template comprises a plurality of projection images, and the projection images are obtained by projecting a basic shape model in a plurality of preset view directions;
Selecting a target projection diagram from the hair plane template, and acquiring drawn hair clusters through the target projection diagram;
Determining the geometric information of the drawn hair cluster according to the position information of the drawn hair cluster in the target projection diagram and the geometric information of a basic shape model corresponding to the target projection diagram;
and generating the hair cluster to be adjusted according to the geometric information of the drawn hair cluster.
7. The method for reconstructing a three-dimensional hair model according to claim 6, wherein said generating means of said hair flat template comprises:
Acquiring the basic shape model;
projecting the basic shape model in each preset view direction to obtain a projection diagram of the basic shape model in the preset view direction;
and generating the hair plane template according to a projection diagram of the basic shape model in the preset view direction.
8. A three-dimensional hair model reconstruction device, comprising:
the acquisition module is configured to acquire an interesting hair cluster and a corresponding original basic shape model, wherein the interesting 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 a 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 a hair cluster to be adjusted, the corresponding original basic shape model copy is used as the basic shape model, the original control point copies are used as preset control points, the basic shape model is a three-dimensional model representing the shape of a basic hair style, and the hair cluster to be adjusted and the preset control points are distributed on the basic shape model;
The model adjustment module is configured to perform adjustment operation on the preset control points, adjust the basic shape model and determine three-dimensional coordinates of the adjusted basic shape model through the three-dimensional coordinates of the adjusted preset control points;
The hair cluster adjusting module is configured to execute three-dimensional coordinates adjusted according to the basic shape model and 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, and adjust the hair cluster to be adjusted on the basic shape model;
The model generation module is configured to generate a three-dimensional hair model according to the adjusted hair cluster.
9. The device for reconstructing a three-dimensional hair model according to claim 8, wherein the hair cluster adjustment module is further configured to obtain a correspondence between the three-dimensional coordinates of the basic shape model and the three-dimensional coordinates of the hair cluster to be adjusted by performing texture coordinates of the basic shape model, determine the three-dimensional coordinates of the hair cluster to be adjusted according to the three-dimensional coordinates of the basic shape model after adjustment and the correspondence between the three-dimensional coordinates of the basic shape model and the three-dimensional coordinates of the hair cluster to be adjusted, and adjust the hair cluster to be adjusted on the basic shape model according to the three-dimensional coordinates of the hair cluster to be adjusted.
10. The device for reconstructing a three-dimensional hair model according to claim 8, wherein said model generating module comprises a skeletal point generating unit and a skin operating unit;
The skeleton point generation unit is configured to perform generation of 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 skin operation unit is configured to perform skin operation on the adjusted hair bundle according to the position information of each bone point.
11. The device for reconstructing a three-dimensional hair model of claim 10, wherein each of said skeletal points is uniformly distributed along the length of said adjusted hair bundle.
12. The apparatus according to claim 10, wherein the skin operation unit is further configured to perform adding bone for the adjusted hair bundle between the bone points according to the position information of the bone points, acquiring the position information of each vertex in the adjusted hair bundle, acquiring a 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 a skin weight of each vertex in the adjusted hair bundle according to the distance, and associating the bone between each vertex and each bone point according to the skin weight.
13. The three-dimensional hair model reconstruction device according to any one of claims 8 to 12, further comprising a hair cluster to be adjusted generation module configured to be executed to acquire a hair plane template including a plurality of projection views projected in a plurality of preset view directions by a basic shape model, select a target projection view from the hair plane template, acquire a drawn hair cluster by the target projection view, determine geometric information of the drawn hair cluster according to position information of the drawn hair cluster in the target projection view and geometric information of the basic shape model to which the target projection view corresponds, and generate the hair cluster to be adjusted according to the geometric information of the drawn hair cluster.
14. The device for reconstructing a three-dimensional hair model according to claim 13, further comprising a hair plane template generation module configured to perform acquisition of the basic shape model, project the basic shape model in each of the preset view directions to obtain a projection view of the basic shape model in the preset view direction, and generate the hair plane template according to the projection view of the basic shape model in the preset view direction.
15. 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 one of claims 1 to 7.
16. A storage medium, which when executed by a processor of an electronic device, causes the electronic device to perform the method of reconstructing a three-dimensional hair model according to any one of claims 1 to 7.
17. A computer program product comprising instructions which, 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 Three-dimensional hair model reconstruction method, device, electronic device and storage medium Active CN114078179B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010800420.3A CN114078179B (en) 2020-08-11 2020-08-11 Three-dimensional hair model reconstruction method, device, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010800420.3A CN114078179B (en) 2020-08-11 2020-08-11 Three-dimensional hair model reconstruction method, device, electronic device and storage medium

Publications (2)

Publication Number Publication Date
CN114078179A CN114078179A (en) 2022-02-22
CN114078179B true CN114078179B (en) 2025-07-11

Family

ID=80279765

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010800420.3A Active CN114078179B (en) 2020-08-11 2020-08-11 Three-dimensional hair model reconstruction method, device, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN114078179B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113763228B (en) * 2020-06-01 2024-03-19 北京达佳互联信息技术有限公司 Image processing method, device, electronic equipment and storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102800129A (en) * 2012-06-20 2012-11-28 浙江大学 Hair modeling and portrait editing method based on single image

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW201224994A (en) * 2010-12-13 2012-06-16 Nat Univ Chung Cheng Three-dimensional information representation method featuring non-uniform sampling
CN110288716B (en) * 2019-06-14 2023-08-08 北京达佳互联信息技术有限公司 Image processing method, device, electronic equipment and storage medium

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102800129A (en) * 2012-06-20 2012-11-28 浙江大学 Hair modeling and portrait editing method based on single image

Also Published As

Publication number Publication date
CN114078179A (en) 2022-02-22

Similar Documents

Publication Publication Date Title
US11868515B2 (en) Generating textured polygon strip hair from strand-based hair for a virtual character
Hu et al. Single-view hair modeling using a hairstyle database
Shen et al. Deepsketchhair: Deep sketch-based 3d hair modeling
Hu et al. Capturing braided hairstyles
Xiao et al. Sketchhairsalon: Deep sketch-based hair image synthesis
CN103606186A (en) Virtual hair style modeling method of images and videos
WO2002009037A2 (en) Modeling human beings by symbol manipulation
CN113570634B (en) Object three-dimensional reconstruction method, device, electronic equipment and storage medium
WO2021171118A1 (en) Face mesh deformation with detailed wrinkles
Wan et al. Data-driven facial expression synthesis via Laplacian deformation
CN114359453B (en) A three-dimensional special effects rendering method, device, storage medium and equipment
CN116912433B (en) Three-dimensional model skeleton binding method, device, equipment and storage medium
CN109859134A (en) A kind of processing method and terminal of makeups material
US20220108511A1 (en) Method and User Interface for Generating Tangent Vector Fields Usable for Generating Computer Generated Imagery
CN107221024B (en) Virtual object hair processing method and device, storage medium and electronic equipment
Bao et al. A survey of image-based techniques for hair modeling
CN114049287A (en) Face model fusion method, device, equipment and computer readable storage medium
CN111047675A (en) Method and device for simulating hair
US11710270B2 (en) Method for scattering points in a uniform arbitrary distribution across a target mesh for a computer animated creature
CN114078179B (en) Three-dimensional hair model reconstruction method, device, electronic device and storage medium
CN114078180B (en) Method, device, electronic device and storage medium for generating three-dimensional hair model
CN114758108B (en) Virtual object driving method, device, storage medium and computer equipment
Yu et al. A hybrid image-cad based system for modeling realistic hairstyles
Liu et al. Three-dimensional cartoon facial animation based on art rules
Liu et al. Interactive modeling of trees using VR devices

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
GR01 Patent grant
GR01 Patent grant
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载