CN114078180A - Three-dimensional hair model generation method and device, electronic equipment and storage medium - Google Patents

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

Info

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

Links

Images

Classifications

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

Abstract

The present disclosure relates to a method, an apparatus, an electronic device and a storage medium for generating a three-dimensional hair model, wherein the generating method comprises: obtaining a hair plane template, wherein the hair plane template comprises a plurality of projection drawings, the projection drawings are obtained by projecting a basic shape model in a plurality of preset view directions, and the basic shape model is a three-dimensional model for representing the shape of a basic hairstyle; selecting a target projection drawing from the hair plane template, and acquiring a drawn hair cluster through the target projection drawing; determining the geometric information of the hair cluster according to the position information of the hair cluster in the target projection drawing and the geometric information of a basic shape model corresponding to the target projection drawing; and generating a three-dimensional hair model according to the geometric information of the hair cluster. By the scheme, the three-dimensional hair modeling generation efficiency can be improved, and the three-dimensional hair modeling difficulty is reduced.

Description

Three-dimensional hair model generation method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of three-dimensional image processing technologies, and in particular, to a method and an apparatus for generating a three-dimensional hair model, an electronic device, and a storage medium.
Background
With the development of computer vision technology, a three-dimensional reconstruction technology appears, and the three-dimensional reconstruction technology describes a real scene into a mathematical model conforming to the logical expression of a computer through the processes of depth data acquisition, preprocessing, point cloud registration and fusion, surface generation and the like. Because the creation of hair can obviously enhance the reality of the virtual image or the virtual character, and the three-dimensional reconstruction technology is the key technology for establishing the virtual reality expressing the objective world in a computer, the problem how to construct a vivid hair model by using the three-dimensional reconstruction technology is urgently needed to be solved.
In the related art, modeling is performed on the hair based on multidirectional constraints, and a complete hair model is reconstructed mainly by using the hair surface geometry, the hair surface direction and the head model geometry which are reconstructed from an image.
However, the existing three-dimensional hair modeling method consumes a lot of time and has the technical problem of low efficiency.
Disclosure of Invention
The present disclosure provides a method and an apparatus for generating a three-dimensional hair model, an electronic device, and a storage medium, so as to at least solve the technical problem of low efficiency in generating a three-dimensional hair model in the related art. The technical scheme of the disclosure is as follows:
according to a first aspect of the embodiments of the present disclosure, there is provided a method for generating a three-dimensional hair model, including:
obtaining a hair plane template, wherein the hair plane template comprises a plurality of projection drawings, the projection drawings are obtained by projecting a basic shape model in a plurality of preset view directions, and the basic shape model is a three-dimensional model for representing the shape of a basic hairstyle;
selecting a target projection drawing from the hair plane template, and acquiring a drawn hair cluster through the target projection drawing;
determining the geometric information of the hair cluster according to the position information of the hair cluster in the target projection drawing and the geometric information of a basic shape model corresponding to the target projection drawing;
and generating a three-dimensional hair model according to the geometric information of the hair cluster.
In one embodiment, the determining the geometric information of the hair cluster according to the position information of the hair cluster in the target projection drawing and the geometric information of the basic shape model corresponding to the target projection drawing includes:
acquiring a preset number of points from the edge contour of the hair cluster as vertexes of the hair cluster, and acquiring position information of each vertex, wherein the position information of each vertex is the position of the vertex in the target projection graph;
and determining the geometric information of each vertex according to the geometric information of the basic shape model corresponding to the target projection drawing and the position information of each vertex, wherein the geometric information of each vertex is the geometric information of each vertex in the basic shape model corresponding to the target projection drawing.
Generating a three-dimensional hair model according to the geometric information of the hair cluster, comprising:
and generating the three-dimensional hair model according to the geometric information of each vertex.
In one embodiment, the geometric information of the base shape model includes texture coordinates and three-dimensional coordinates of the base shape model; determining the geometric information of each vertex according to the geometric information of the basic shape model corresponding to the target projection drawing and the position information of each vertex, including:
obtaining texture coordinates of each vertex according to the geometric information of the basic shape model corresponding to the target projection drawing and the position information of each vertex, wherein the texture coordinates of the vertices are the texture coordinates of the vertices in the basic shape model corresponding to the target projection drawing;
and obtaining the three-dimensional coordinates of each vertex according to the texture coordinates of each vertex and the corresponding relation between the three-dimensional coordinates of the basic shape model and the texture coordinates of the basic shape model, wherein the three-dimensional coordinates of the vertices are the three-dimensional coordinates of the vertices in the basic shape model corresponding to the target projection drawing.
In one embodiment, the generating the three-dimensional hair model according to the geometric information of each vertex comprises:
connecting the vertexes according to a preset rule according to the three-dimensional coordinates of the vertexes to generate a triangular patch;
and rendering the triangular patch according to the texture coordinates of each vertex to generate the three-dimensional hair model.
In one embodiment, the hair plane template is generated by a method comprising:
obtaining the basic shape model;
projecting the basic shape model in each preset view direction to obtain a projection view of the basic shape model in the preset view direction;
and generating the hair plane template according to the projection drawing of the basic shape model in the preset view direction.
In one embodiment, the preset view directions include a front view direction, a rear view direction, a left view direction, and a right view direction.
According to a second aspect of the embodiments of the present disclosure, there is provided a device for generating a three-dimensional hair model, including:
a plane template acquisition module configured to perform acquiring a hair plane template, the hair plane template comprising a plurality of projection views, the projection views being obtained by projecting a basic shape model in a plurality of preset view directions, wherein the basic shape model is a three-dimensional model representing the shape of a basic hairstyle;
a hair cluster acquisition module configured to perform selecting a target projection view from the hair plane template, acquiring a rendered hair cluster through the target projection view;
a hair cluster geometric information determination module configured to determine geometric information of the hair cluster according to the position information of the hair cluster in the target projection drawing and geometric information of a basic shape model corresponding to the target projection drawing;
a hair model generation module configured to perform generating a three-dimensional hair model from the geometric information of the hair cluster.
In one embodiment, the hair cluster geometric information determination module comprises a vertex position information acquisition unit, a vertex geometric information acquisition unit and a hair model generation unit;
the vertex position information acquisition unit is configured to acquire a preset number of points from the edge contour of the hair cluster as vertexes of the hair cluster, and acquire position information of each vertex, wherein the position information of the vertexes is the positions of the vertexes in the target projection graph;
the vertex geometric information acquisition unit is configured to determine geometric information of each vertex according to geometric information of a basic shape model corresponding to the target projection drawing and position information of each vertex, wherein the geometric information of each vertex is the geometric information of each vertex in the basic shape model corresponding to the target projection drawing;
the hair model generating unit is configured to generate the three-dimensional hair model according to the geometrical information of each vertex.
In one embodiment, the geometric information of the base shape model includes texture coordinates and three-dimensional coordinates of the base shape model;
the vertex geometric information obtaining unit is further configured to execute obtaining texture coordinates of each vertex according to geometric information of a basic shape model corresponding to the target projection drawing and position information of each vertex, where the texture coordinates of each vertex are texture coordinates of each vertex in the basic shape model corresponding to the target projection drawing; and obtaining the three-dimensional coordinates of each vertex according to the texture coordinates of each vertex and the corresponding relation between the three-dimensional coordinates of the basic shape model and the texture coordinates of the basic shape model, wherein the three-dimensional coordinates of the vertices are the three-dimensional coordinates of the vertices in the basic shape model corresponding to the target projection drawing.
In one embodiment, the hair model generating unit is further configured to perform connection of the vertexes according to a preset rule according to the three-dimensional coordinates of the vertexes, so as to generate a triangular patch; and rendering the triangular patch according to the texture coordinates of each vertex to generate the three-dimensional hair model.
In one embodiment, the device for generating the three-dimensional hair model further comprises a module for generating a hair plane template;
a generation module of the hair plane template configured to perform obtaining the base shape model; projecting the basic shape model in each preset view direction to obtain a projection view of the basic shape model in the preset view direction; and generating the hair plane template according to the projection drawing of the basic shape model in the preset view direction.
In one embodiment, the preset view directions include a front view direction, a rear view direction, a left view direction, and a right view direction.
According to a third aspect of the embodiments of the present disclosure, there is provided an electronic apparatus including: a processor; a memory for storing the processor-executable instructions; wherein the processor is configured to execute the instructions to implement the method of generating a three-dimensional hair model according to any one of the first aspect.
According to a fourth aspect of embodiments of the present disclosure, there is provided a storage medium, wherein instructions, when executed by a processor of an electronic device, enable the electronic device to perform the method for generating a three-dimensional hair model according to any one of the first aspect.
According to a fifth aspect of embodiments of the present disclosure, there is provided a computer program product comprising a computer program stored in a readable storage medium, from which the at least one processor of the device reads and executes the computer program, causing the device to perform the method of generating a three-dimensional hair model as described in any one of the embodiments of the first aspect.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
acquiring a hair plane template, selecting a target projection drawing from the hair plane template, and acquiring a drawn hair cluster through the target projection drawing; determining the geometric information of the hair cluster according to the position information of the hair cluster in the target projection drawing and the geometric information of a basic shape model corresponding to the target projection drawing; thereby generating a three-dimensional hair model based on the geometric information of the hair switches. Therefore, the scheme of the method and the device for modeling the three-dimensional hair realizes the purpose of completing the three-dimensional hair modeling work by utilizing the plane template, so that the generation efficiency of the three-dimensional hair modeling can be improved, and the difficulty of the three-dimensional hair modeling is reduced.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure and are not to be construed as limiting the disclosure.
Fig. 1 is an application environment diagram illustrating a method of generating a three-dimensional hair model according to an exemplary embodiment.
FIG. 2 is a flow chart illustrating a method of generating a three-dimensional hair model according to an exemplary embodiment.
FIG. 3 is a flow diagram illustrating a method of generating a three-dimensional hair model according to an exemplary embodiment.
Fig. 4 is a flowchart illustrating a step S320 in a method of generating a three-dimensional hair model according to an exemplary embodiment.
Fig. 5 is a flowchart illustrating a step S330 in a method of generating a three-dimensional hair model according to an exemplary embodiment.
Fig. 6a is a schematic diagram illustrating a list of projection views in a hair plane template, according to an exemplary embodiment.
Fig. 6b is a schematic diagram illustrating a projected view in a hair plane template, according to an exemplary embodiment.
Fig. 7 is a flow chart illustrating a manner of generating a hair plane template according to an exemplary embodiment.
FIG. 8a is a flow chart illustrating a method of generating a three-dimensional hair model according to an exemplary embodiment.
Fig. 8 b-8 d are schematic views of hair switches depicted on a projection diagram according to an exemplary embodiment.
Fig. 8 e-8 g are schematic diagrams illustrating a three-dimensional hair model according to an exemplary embodiment.
Fig. 9 is a block diagram illustrating an apparatus for generating a three-dimensional hair model according to an exemplary embodiment.
Fig. 10 is an internal block diagram of an electronic device shown in accordance with an example embodiment.
Detailed Description
In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
The method for generating the three-dimensional hair model provided by the disclosure can be applied to the application environment shown in fig. 1. The terminal 110 performs data interaction with the server 120 through a network, selects a target projection diagram from the hair plane template, and the terminal 110 displays the selected target projection diagram; in response to rendering instructions on the target projection view, corresponding hair clusters are generated on the target projection view. The terminal 110 sends the hair plane template and the hair cluster on the target projection to the server 120. The server 120 acquires a hair plane template, wherein the hair plane template comprises a plurality of projection drawings, and the projection drawings are obtained by projecting a basic shape model in a plurality of preset view directions, wherein the basic shape model is a three-dimensional model representing the shape of a basic hairstyle; acquiring a drawn hair cluster through the target projection drawing; determining the geometric information of the hair cluster according to the position information of the hair cluster in the target projection drawing and the geometric information of the basic shape model corresponding to the target projection drawing; and generating a three-dimensional hair model according to the geometric information of the hair clusters. Therefore, the scheme disclosed by the invention realizes the purpose of completing the three-dimensional hair modeling work by utilizing the plane template, so that the three-dimensional hair modeling generation efficiency can be improved and the three-dimensional hair modeling difficulty is reduced.
The terminal 110 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices, and the server 120 may be implemented by an independent server or a server cluster formed by a plurality of servers.
Fig. 2 is a flowchart illustrating a method for generating a three-dimensional hair model according to an exemplary embodiment, and as shown in fig. 2, the method for generating a three-dimensional hair model may be applied to the server 120 or the terminal 110, and includes the following steps:
in step S210, a hair plane template is 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 may be a three-dimensional model corresponding to two-dimensional hair. The hair planar template may be a planar template for guiding a planar designer in designing a three-dimensional hair model. The planners can design the planar materials of the three-dimensional hair model through the hair plane template. The hair plane template comprises a plurality of projection drawings, and the projection drawings are obtained by projecting the basic shape model in a plurality of preset view directions. The base shape model is a three-dimensional model that characterizes the shape of the base hairstyle. For example, the basic shape model may be a three-dimensional model obtained by summarizing and abstracting the features and shapes of common hair styles, such as long hair, short hair, bang, back head, horse tail, ball, and the like. The surface of the basic shape model is a curved surface to which hairs of various basic hairstyles are attached. The view direction is a direction in which a ray is projected from one face of the basic shape model to the opposite face thereof, and may also be understood as a direction in which a line of sight is projected from one face of the basic shape model to the opposite face thereof, such as from the front to the back of the basic shape model, from the left to the right of the basic shape model, from the top to the bottom of the basic shape model. The preset view direction includes a front view direction, a rear view direction, a left view direction, a right view direction, and the like. The projected view refers to a view obtained by projecting light rays from one face of an object to the opposite face thereof. Specifically, the hair plane template is obtained locally from a computer or loaded from another computer device connected to a computer network.
In step S220, a target projection view is selected from the hair plane template, and the drawn hair cluster is acquired through the target projection view.
The hair is composed of a plurality of groups of hair clusters, and the three-dimensional hair model is also composed of a plurality of hair clusters. The rendered hair cluster is a planar image of the hair cluster constituting the three-dimensional hair model in the target projection view. On the target projection drawing, the designer draws the shape and texture of each hair cluster from the view direction corresponding to the target projection drawing to design the three-dimensional hair model. Specifically, after the hair plane template is obtained, a plurality of projection views included in the hair plane template can be displayed, and a designer selects a target projection view from the hair plane template according to actual design requirements. After the designer finishes drawing the hair cluster on the target projection drawing, the drawn hair cluster can be sent to a server or the current computer background in time, so that the server or the computer background acquires the hair cluster drawn on the target projection drawing. Alternatively, the drawn hair cluster may be stored locally in the computer in advance, and the hair cluster drawn on the target projection drawing may be acquired locally from the computer. The hair cluster drawn on the target projection drawing can also be stored in advance in another computer device connected to a local network of the computer, and the hair cluster drawn on the target projection drawing is acquired from another computer device connected to the local network of the computer.
In step S230, the geometric information of the hair cluster is determined according to the position information of the hair cluster in the target projection drawing and the geometric information of the basic shape model corresponding to the target projection drawing.
The position information of the hair cluster in the target projection drawing refers to the position information of the hair cluster drawn by the designer on the projection drawing relative to the target projection drawing. Geometric information is information or data used to characterize the texture features, spatial structure, spatial location of a three-dimensional model. Each base shape model has corresponding geometric information for characterizing the spatial structure of the base shape model, the spatial position of the vertices, etc. Specifically, at least one hair cluster is drawn on the target projection drawing, and the position information of the drawn hair cluster in the target projection drawing is known, so that the position information of the drawn hair cluster in the target projection drawing can be acquired. In order to accurately and rapidly generate the three-dimensional hair model, geometric information of a basic shape model corresponding to the generated target projection drawing is acquired. Furthermore, the drawn hair cluster is attached to the projection outline of the basic shape model, and the projection of the basic shape model and the basic shape model corresponding to the target projection drawing have a projection relationship, so that the geometric information of the hair cluster can be determined by using the position information of the drawn hair cluster in the target projection drawing and the geometric information of the basic shape model corresponding to the target projection drawing.
In step S240, a three-dimensional hair model is generated based on the geometric information of the hair cluster.
As mentioned above, the hair is composed of a plurality of groups of hair clusters, and the three-dimensional hair model is also composed of a plurality of hair clusters. Specifically, the geometric information of the hair cluster includes texture information and stereoscopic information of the hair cluster. Generating a spatial structure of the hair cluster according to the three-dimensional information of the hair cluster, rendering the surface of the spatial structure of the hair cluster according to the texture information of the hair cluster, and finally forming a three-dimensional hair model by using the rendered hair clusters.
In the method for generating the three-dimensional hair model, a hair plane template is obtained, a target projection drawing is selected from the hair plane template, and a drawn hair cluster is obtained through the target projection drawing; determining the geometric information of the hair cluster according to the position information of the hair cluster in the target projection drawing and the geometric information of the basic shape model corresponding to the target projection drawing; thereby generating a three-dimensional hair model based on the geometric information of the hair clusters. Therefore, the three-dimensional hair modeling work is completed by utilizing the plane template, and according to the three-dimensional hair modeling method, the three-dimensional hair modeling generation efficiency can be improved, and the three-dimensional hair modeling difficulty is reduced.
In an exemplary embodiment, as shown in fig. 3, in step S230, the geometric information of the hair cluster is determined according to the position information of the hair cluster in the target projection drawing and the geometric information of the basic shape model corresponding to the target projection drawing, which may be specifically implemented by the following steps:
in step S310, from the edge contour of the hair cluster, a preset number of points are acquired as vertices of the hair cluster, and position information of each vertex is acquired.
The vertex position information is the position of the vertex in the target projection drawing. The edge profile refers to the boundary line of the outer edge of the drawn hair tuft. The hair cluster is drawn in the target projection image, the edge contour of the hair cluster can be identified in a binarization mode, and the position information of each point in the edge contour is known. For example, the target projection image on which the hair cluster is drawn may be subjected to a gray scale process and a binarization process, and the edge contour of the drawn hair cluster may be extracted. For another example, the target projection drawing and the drawn hair cluster are respectively placed in different layers, the transparency of the target projection drawing and the transparency of the drawn hair cluster are respectively set, and the edge contour of the drawn hair cluster is displayed, so that the edge contour of the drawn hair cluster is extracted. The basic shape model is composed of a plurality of triangular patches, and the vertex of the basic shape model is the vertex of each triangular patch.
Specifically, the basic shape model is projected in each preset view direction, and then the vertexes of the basic shape model are projected in the projection view, and then the corresponding relationship exists between the selected preset number of points and the vertexes of the basic shape model. To generate a three-dimensional hair model using hair clusters in the target projection, a predetermined number of points are selected as vertices. In order to reconstruct a three-dimensional hair model by using the vertices, it is necessary to acquire position information of the vertices in the projection view of the object.
In step S320, geometric information of each vertex is determined based on the geometric information of the base shape model corresponding to the target projection view and the positional information of each vertex.
And the geometrical information of the vertex is the geometrical information of the vertex in the basic shape model corresponding to the target projection drawing. Specifically, the basic shape model is projected in the preset view direction to obtain a projection diagram, a mapping relation exists between each point in the projection diagram and each vertex on the basic shape model, and the selected points with the preset number can find the corresponding vertices in the basic shape model. Then, according to the position information of each vertex on the hair cluster edge contour in the corresponding projection graph, the vertex corresponding to each vertex on the hair cluster edge contour in the basic shape model can be determined, so that the geometric information of the vertices in the basic shape model is determined by combining the geometric information of the basic shape model.
In step S240, a three-dimensional hair model is generated according to the geometric information of the hair cluster, which may be specifically implemented by the following steps:
in step S330, a three-dimensional hair model is generated from the geometric information of each vertex.
The three-dimensional hair model comprises a plurality of groups of hair clusters, and the reconstruction of the three-dimensional hair model is the reconstruction of each hair cluster. And (4) reconstructing each hair cluster by using the planar hair cluster drawn by the target projection diagram. Specifically, a mesh structure of the hair cluster is generated according to the three-dimensional information of each vertex, and the surface of the space structure of the hair cluster is rendered according to the texture information of each vertex, so that a three-dimensional hair model is obtained.
In the method for generating the three-dimensional hair model, the preset number of points are acquired from the edge contour of the hair cluster to serve as the vertexes of the hair cluster, and the position information of each vertex is acquired, so that the geometric information of each vertex is determined according to the geometric information of the basic shape model corresponding to the target projection diagram and the position information of each vertex, and the three-dimensional hair model is generated according to the geometric information of each vertex. Therefore, the method and the device can be used for determining and reconstructing the top point of the three-dimensional model of the hair cluster in the plane projection drawing so as to quickly generate the three-dimensional hair model, and thus, not only can a designer be helped to complete the work of three-dimensional design through a two-dimensional plane template, but also the learning cost of the designer is reduced, and the time spent on design can be reduced.
In an exemplary embodiment, the geometric information of the base shape model includes texture coordinates and three-dimensional coordinates of the base shape model. As shown in fig. 4, in step S320, the geometric information of each vertex is determined according to the geometric information of the basic shape model corresponding to the target projection diagram and the position information of each vertex, which may be specifically implemented by the following steps:
in step S410, texture coordinates of each vertex are obtained from the geometric information of the base shape model corresponding to the target projection drawing and the position information of each vertex.
In step S420, the three-dimensional coordinates of each vertex are obtained according to the texture coordinates of each vertex and the correspondence between the three-dimensional coordinates of the base shape model and the texture coordinates of the base shape model.
And the texture coordinates of the vertex are the texture coordinates of the vertex in the basic shape model corresponding to the target projection drawing. The three-dimensional coordinates of the vertexes are the three-dimensional coordinates of the vertexes in the basic shape model corresponding to the target projection drawing. Texture is the most important factor affecting the fidelity of the three-dimensional model, and texture coordinates are used for rendering the model. The texture coordinates have two coordinate axes U and V, and are therefore referred to as UV coordinates, with U representing the distribution on the lateral coordinates and V representing the distribution on the longitudinal coordinates. Three-dimensional coordinates are information used to characterize the location of the underlying shape model within the world coordinate system. The texture coordinates and the three-dimensional coordinates have a corresponding relationship.
Specifically, because the basic shape model is projected in the preset view direction to obtain the projection diagram, the vertices on the hair cluster edge contour in the target projection diagram can find the corresponding vertices in the basic shape model corresponding to the target projection diagram. And because the mapping relation exists between each point in the projection graph and each vertex on the basic shape model, the vertex corresponding to each vertex on the hair cluster edge outline can be determined in the basic shape model corresponding to the target projection graph according to the position information of each vertex on the hair cluster edge outline in the corresponding projection graph. Since the geometric information of the base shape model corresponding to the target projection view is known, the texture coordinates of the vertices, i.e., the texture coordinates of the vertices in the base shape model corresponding to the target projection view, can be determined. And because the texture coordinates and the three-dimensional coordinates are in one-to-one correspondence, the three-dimensional coordinates of each vertex, namely the three-dimensional coordinates of the vertex in the basic shape model corresponding to the target projection drawing, can be determined according to the texture coordinates of each vertex.
In the method for generating the three-dimensional hair model, the texture coordinates of each vertex are obtained according to the geometric information of the basic shape model corresponding to the target projection drawing and the position information of each vertex; thus, the three-dimensional coordinates of each vertex are obtained according to the texture coordinates of each vertex and the corresponding relationship between the three-dimensional coordinates of the basic shape model and the texture coordinates of the basic shape model. The embodiment realizes the design of the three-dimensional hair model by using the two-dimensional projection drawing, and provides enough freedom degrees including the shape, the texture, the overall view angle and the like of each cluster of hair for a designer so as to complete the design work of the hairstyle.
In an exemplary embodiment, as shown in fig. 5, in step S330, a three-dimensional hair model is generated according to the geometric information of each vertex, which may be implemented by:
in step S510, the vertices are connected according to the three-dimensional coordinates of the vertices and a preset rule, so as to generate a triangular patch.
In step S520, the triangle patch is rendered according to the texture coordinates of each vertex, and a three-dimensional hair model is generated.
Wherein the triangular patch is the minimum composition unit of the three-dimensional model. Specifically, based on the projection relationship existing between the basic shape model and the target projection diagram, a plurality of vertexes corresponding to the vertexes on the hair cluster edge contour are determined in the basic shape model corresponding to the target projection diagram. The vertexes are vertexes forming the three-dimensional hair model, and because vertex connection rules are set in advance, the vertexes are connected according to the three-dimensional coordinates of the vertexes and preset rules to generate a plurality of triangular patches. It will be appreciated that when the vertices are connected, there must be a connection between the triangle patches. And (4) knowing texture coordinates of the vertexes, and filling a texture map in the generated triangular patch by using the texture coordinates of the vertexes for rendering to obtain the three-dimensional hair model.
According to the three-dimensional coordinate of each vertex, the vertices are connected according to a preset rule to generate a triangular patch; and rendering the triangular patch according to the texture coordinates of each vertex to generate a three-dimensional hair model, so that the three-dimensional hair model generated according to the embodiment can more vividly represent various hairstyles.
In an exemplary embodiment, the obtaining of the rendered hair cluster from the target projection drawing may be specifically realized by the following steps: displaying a projection view of the target selected from the hair plane template; in response to rendering instructions on the target projection view, corresponding hair clusters are generated on the target projection view.
Specifically, as shown in fig. 6a, the hair plane template includes a projection view in a front view direction, a projection view in a rear view direction, a projection view in a left view direction, and a projection view in a right view direction. And (3) selecting a proper view angle according to actual requirements, selecting a target projection view from the hair plane template, and displaying the selected target projection view (as shown in fig. 6 b). On the displayed target projection drawing, a designer can trigger a drawing instruction to draw hair clusters on the target projection drawing, and the designer can draw the shape and the texture of each hair cluster. It can be seen that the flexibility of designing the three-dimensional hair model is increased by the embodiment, and the workload of the designer is greatly reduced.
Fig. 7 is a flowchart illustrating a manner of generating a hair plane template according to an exemplary embodiment, as shown in fig. 7, including the steps of:
in step S710, a base shape model is acquired.
In step S720, the basic shape model is projected in each preset view direction, so as to obtain a projection view of the basic shape model in the preset view direction.
In step S730, a hair plane template is generated according to the projection view of the basic shape model in the preset view direction.
Specifically, the features and the shapes of common hairstyles are summarized and abstracted to obtain a basic shape model, and the obtained basic shape model is stored. When a hair cluster needs to be drawn, the basic shape model can be obtained locally from the computer, or can be obtained from another computer device through a network and loaded locally to the computer. In order to facilitate a plane designer to design a three-dimensional model, the basic shape model is projected in each preset view direction to obtain a projection view of the basic shape model in the preset view direction; and generating a hair plane template according to the projection drawing of the basic shape model in each preset view direction.
In the generation mode of the hair plane template, a new path is provided for a plane designer to design a three-dimensional hair model, so that the plane designer can draw a two-dimensional hair cluster image on a projection drawing of a basic shape model to complete the design of the three-dimensional hair model. Through this embodiment not only reduced designer's study cost, helped the work that the plane designer accomplished three-dimensional design moreover. Further, when actually designing a three-dimensional hair model, a designer can select a proper basic shape model and a proper view angle according to the requirements of a specific hair style to generate a hair plane template. And in the hair plane template, selecting a proper position, a proper shape and a proper texture to draw a corresponding hair cluster. When drawing the hair through hair plane template and swarming, whole process is directly controllable for the designer, has both improved designer's work efficiency, also promotes the design effect of three-dimensional hair model.
FIG. 8a is a flow chart illustrating a method of generating a three-dimensional hair model according to an exemplary embodiment, including the steps of:
in step S810, a hair plane template is acquired.
The projection diagram is obtained by projecting a basic shape model in a plurality of preset view directions, wherein the basic shape model is a three-dimensional model for representing the shape of the basic hairstyle. Illustratively, the hair plane template may be in a PSD image format.
In step S820, a target projection view is selected from the hair plane template, and the drawn hair cluster is acquired through the target projection view.
In particular, the terminal may present a target projection view selected from the hair plane template, and generate a corresponding hair cluster on the target projection view in response to a rendering instruction on the target projection view. Illustratively, as shown in FIGS. 8b, 8c, 8d, hair clusters are rendered by the target projection view.
In step S830, a preset number of points are acquired from the edge contour of the hair cluster as vertices of the hair cluster, and position information of each vertex is acquired.
The vertex position information is the position of the vertex in the target projection drawing.
In step S840, texture coordinates of each vertex are obtained based on the geometric information of the base shape model corresponding to the target projection drawing and the position information of each vertex.
And the texture coordinates of the vertex are the texture coordinates of the vertex in the basic shape model corresponding to the target projection drawing.
In step S850, the three-dimensional coordinates of each vertex are obtained from the texture coordinates of each vertex and the correspondence between the three-dimensional coordinates of the base shape model and the texture coordinates of the base shape model.
And the three-dimensional coordinates of the vertex are the three-dimensional coordinates of the vertex in the basic shape model corresponding to the target projection drawing.
In step S860, the vertices are connected according to the three-dimensional coordinates of the vertices and a preset rule, so as to generate a triangular patch.
In step S870, the triangle patch is rendered according to the texture coordinates of each vertex, and a three-dimensional hair model is generated.
Illustratively, the results seen by viewing the generated three-dimensional hair model from different view directions, as shown in fig. 8e, 8f, 8 g.
In the method for generating the three-dimensional hair model, the hair plane template is exemplarily illustrated by taking a PSD image format as an example, on one hand, based on the plane design template, a plane designer is enabled to complete the design work of the three-dimensional hair model, and the operation habit of the plane designer is considered; the drawing work of the designer in the disclosure can be completed in PHOTOSHOP, the learning cost of the designer is very low, and the disclosure can help the flat designer to complete the work of three-dimensional design. On the other hand, when actually designing three-dimensional hair, a designer can select a proper basic shape model and a proper view angle according to the requirements of a specific hair style to generate a PSD template. A target projection view is selected in the PSD template and the corresponding hair cluster is rendered in the appropriate position with the appropriate shape and appropriate texture. It can be seen that the whole drawing process in this disclosure is directly controllable for the designer, then not only be favorable to improving designer's work efficiency through the scheme of this disclosure, can promote the design effect of three-dimensional hair model moreover.
It should be understood that, although the steps in the above-described flowcharts are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a part of the steps in the above-mentioned flowcharts may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of performing the steps or the stages is not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a part of the steps or the stages in other steps.
Fig. 9 is an apparatus block diagram illustrating an apparatus for generating a three-dimensional hair model according to an exemplary embodiment. Referring to fig. 9, the generating apparatus 900 includes a plane template acquiring module 902, a hair cluster acquiring module 904, a hair cluster geometry information determining module 906, and a hair model generating module 908.
A plane template obtaining module 902 configured to perform obtaining a hair plane template, the hair plane template including a plurality of projection views, the projection views being obtained by projecting a basic shape model in a plurality of preset view directions, wherein the basic shape model is a three-dimensional model representing the shape of a basic hairstyle;
a hair cluster obtaining module 904 configured to perform selecting a target projection view from the hair plane template, and obtaining a drawn hair cluster through the target projection view;
a hair cluster geometry information determining module 906 configured to determine the geometry information of the hair cluster according to the position information of the hair cluster in the target projection drawing and the geometry information of the basic shape model corresponding to the target projection drawing;
a hair model generation module 908 configured to perform generating a three-dimensional hair model from the geometric information of the hair switches.
In an exemplary embodiment, the hair cluster geometry information determination module 906 includes a vertex position information acquisition unit, a vertex geometry information acquisition unit, and a hair model generation unit; wherein:
a vertex position information acquisition unit configured to perform acquiring a preset number of points from the edge contour of the hair cluster as vertexes of the hair cluster, and acquiring position information of each vertex, the position information of the vertexes being positions of the vertexes in the target projection drawing;
a vertex geometry information acquisition unit configured to execute determining geometry information of each vertex according to geometry information of a basic shape model corresponding to the target projection drawing and position information of each vertex, wherein the geometry information of the vertex is geometry information of the vertex in the basic shape model corresponding to the target projection drawing;
a hair model generating unit configured to perform generating a three-dimensional hair model from the geometric information of the vertices.
In an exemplary embodiment, the geometric information of the base shape model includes texture coordinates and three-dimensional coordinates of the base shape model;
the vertex geometric information acquisition unit is also configured to execute geometric information of the basic shape model corresponding to the target projection drawing and position information of each vertex to obtain texture coordinates of each vertex, and the texture coordinates of the vertices are texture coordinates of the vertices in the basic shape model corresponding to the target projection drawing; and obtaining the three-dimensional coordinates of each vertex according to the texture coordinates of each vertex and the corresponding relation between the three-dimensional coordinates of the basic shape model and the texture coordinates of the basic shape model, wherein the three-dimensional coordinates of the vertices are the three-dimensional coordinates of the vertices in the basic shape model corresponding to the target projection drawing.
In an exemplary embodiment, the hair model generating unit is further configured to perform connecting the vertices according to the three-dimensional coordinates of the vertices and a preset rule to generate a triangular patch; and rendering the triangular patch according to the texture coordinates of each vertex to generate a three-dimensional hair model.
In an exemplary embodiment, the generating device of the three-dimensional hair model further comprises a generating module of a hair plane template; a hair plane template generation module configured to perform obtaining a base shape model; projecting the basic shape model in each preset view direction to obtain a projection view of the basic shape model in the preset view direction; and generating a hair plane template according to the projection view of the basic shape model in the preset view direction.
In an exemplary embodiment, the preset view directions include a front view direction, a rear view direction, a left view direction, and a right view direction.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Fig. 10 is a block diagram illustrating an apparatus 1000 for generating a three-dimensional hair model according to an exemplary embodiment. For example, the device 1000 may be a server. Referring to fig. 10, device 1000 includes a processing component 1020 that further includes one or more processors and memory resources, represented by memory 1022, for storing instructions, such as application programs, that are executable by processing component 1020. The application programs stored in memory 1022 may include one or more modules that each correspond to a set of instructions. Further, the processing component 1020 is configured to execute instructions to perform the method of generating a three-dimensional hair model described above.
Device 1000 can also include a power component 1024 configured to perform power management for device 1000, a wired or wireless network interface 1026 configured to connect device 1000 to a network, and an input-output (I/O) interface 1028. Device 1000 may operate based on an operating system stored in memory 1022 such as Window 1010 over, Mac O10X, Unix, Linux, FreeB10D, or the like.
In an exemplary embodiment, a storage medium comprising instructions, such as memory 1022 comprising instructions, executable by a processor of device 1000 to perform the above-described method of generating a three-dimensional hair model is also provided. The storage medium may be a non-transitory computer readable storage medium, which may be, for example, an R OM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (10)

1. A method of generating a three-dimensional hair model, comprising:
obtaining a hair plane template, wherein the hair plane template comprises a plurality of projection drawings, the projection drawings are obtained by projecting a basic shape model in a plurality of preset view directions, and the basic shape model is a three-dimensional model for representing the shape of a basic hairstyle;
selecting a target projection drawing from the hair plane template, and acquiring a drawn hair cluster through the target projection drawing;
determining the geometric information of the hair cluster according to the position information of the hair cluster in the target projection drawing and the geometric information of a basic shape model corresponding to the target projection drawing;
and generating a three-dimensional hair model according to the geometric information of the hair cluster.
2. The method for generating a three-dimensional hair model according to claim 1, wherein the determining the geometric information of the hair cluster according to the position information of the hair cluster in the target projection drawing and the geometric information of the basic shape model corresponding to the target projection drawing comprises:
acquiring a preset number of points from the edge contour of the hair cluster as vertexes of the hair cluster, and acquiring position information of each vertex, wherein the position information of each vertex is the position of the vertex in the target projection graph;
and determining the geometric information of each vertex according to the geometric information of the basic shape model corresponding to the target projection drawing and the position information of each vertex, wherein the geometric information of each vertex is the geometric information of each vertex in the basic shape model corresponding to the target projection drawing.
Generating a three-dimensional hair model according to the geometric information of the hair cluster, comprising:
and generating the three-dimensional hair model according to the geometric information of each vertex.
3. The method of generating a three-dimensional hair model according to claim 2, wherein the geometric information of the base shape model includes texture coordinates and three-dimensional coordinates of the base shape model; determining the geometric information of each vertex according to the geometric information of the basic shape model corresponding to the target projection drawing and the position information of each vertex, including:
obtaining texture coordinates of each vertex according to the geometric information of the basic shape model corresponding to the target projection drawing and the position information of each vertex, wherein the texture coordinates of the vertices are the texture coordinates of the vertices in the basic shape model corresponding to the target projection drawing;
and obtaining the three-dimensional coordinates of each vertex according to the texture coordinates of each vertex and the corresponding relation between the three-dimensional coordinates of the basic shape model and the texture coordinates of the basic shape model, wherein the three-dimensional coordinates of the vertices are the three-dimensional coordinates of the vertices in the basic shape model corresponding to the target projection drawing.
4. The method for generating a three-dimensional hair model according to claim 3, wherein the generating the three-dimensional hair model according to the geometric information of each vertex comprises:
connecting the vertexes according to a preset rule according to the three-dimensional coordinates of the vertexes to generate a triangular patch;
and rendering the triangular patch according to the texture coordinates of each vertex to generate the three-dimensional hair model.
5. The method for generating a three-dimensional hair model according to any one of claims 1 to 4, wherein the hair plane template is generated in a manner including:
obtaining the basic shape model;
projecting the basic shape model in each preset view direction to obtain a projection view of the basic shape model in the preset view direction;
and generating the hair plane template according to the projection drawing of the basic shape model in the preset view direction.
6. The method of generating a three-dimensional hair model according to claim 1, wherein the preset view directions include a front view direction, a rear view direction, a left view direction, and a right view direction.
7. An apparatus for generating a three-dimensional hair model, comprising:
a plane template acquisition module configured to perform acquiring a hair plane template, the hair plane template comprising a plurality of projection views, the projection views being obtained by projecting a basic shape model in a plurality of preset view directions, wherein the basic shape model is a three-dimensional model representing the shape of a basic hairstyle;
a hair cluster acquisition module configured to perform selecting a target projection view from the hair plane template, acquiring a rendered hair cluster through the target projection view;
a hair cluster geometric information determination module configured to determine geometric information of the hair cluster according to the position information of the hair cluster in the target projection drawing and geometric information of a basic shape model corresponding to the target projection drawing;
a hair model generation module configured to perform generating a three-dimensional hair model from the geometric information of the hair cluster.
8. The apparatus for generating a three-dimensional hair model according to claim 7, wherein the hair cluster geometry information determining means includes a vertex position information acquiring unit, a vertex geometry information acquiring unit, and a hair model generating unit;
the vertex position information acquisition unit is configured to acquire a preset number of points from the edge contour of the hair cluster as vertexes of the hair cluster, and acquire position information of each vertex, wherein the position information of the vertexes is the positions of the vertexes in the target projection graph;
the vertex geometric information acquisition unit is configured to determine geometric information of each vertex according to geometric information of a basic shape model corresponding to the target projection drawing and position information of each vertex, wherein the geometric information of each vertex is the geometric information of each vertex in the basic shape model corresponding to the target projection drawing;
the hair model generating unit is configured to generate the three-dimensional hair model according to the geometrical information of each vertex.
9. An electronic device, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the method of generating a three-dimensional hair model according to any one of claims 1 to 6.
10. A storage medium in which instructions, when executed by a processor of an electronic device, enable the electronic device to perform a method of generating a three-dimensional hair model as claimed in any one of claims 1 to 6.
CN202010800874.0A 2020-08-11 2020-08-11 Three-dimensional hair model generation method and device, electronic equipment and storage medium Pending CN114078180A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010800874.0A CN114078180A (en) 2020-08-11 2020-08-11 Three-dimensional hair model generation method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010800874.0A CN114078180A (en) 2020-08-11 2020-08-11 Three-dimensional hair model generation method and device, electronic equipment and storage medium

Publications (1)

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

Family

ID=80279779

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010800874.0A Pending CN114078180A (en) 2020-08-11 2020-08-11 Three-dimensional hair model generation method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114078180A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114693856A (en) * 2022-05-30 2022-07-01 腾讯科技(深圳)有限公司 Object generation method and device, computer equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114693856A (en) * 2022-05-30 2022-07-01 腾讯科技(深圳)有限公司 Object generation method and device, computer equipment and storage medium
CN114693856B (en) * 2022-05-30 2022-09-09 腾讯科技(深圳)有限公司 Object generation method and device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
CN107274493B (en) Three-dimensional virtual trial type face reconstruction method based on mobile platform
CN110807451B (en) Face key point detection method, device, equipment and storage medium
US11748934B2 (en) Three-dimensional expression base generation method and apparatus, speech interaction method and apparatus, and medium
CN110675489B (en) Image processing method, device, electronic equipment and storage medium
CN108875524A (en) Gaze estimation method, device, system and storage medium
CN111626218A (en) Image generation method, device and equipment based on artificial intelligence and storage medium
CN111340928A (en) Ray tracing-combined real-time hybrid rendering method and device for Web end and computer equipment
CN107464286B (en) Method, device, equipment and readable medium for repairing holes in three-dimensional city model
CN113870401B (en) Expression generation method, device, equipment, medium and computer program product
CN111382618B (en) Illumination detection method, device, equipment and storage medium for face image
CN115018992B (en) Method and device for generating hair style model, electronic equipment and storage medium
KR20060131145A (en) Randering method of three dimension object using two dimension picture
CN112766027A (en) Image processing method, device, equipment and storage medium
JP2023516656A (en) Efficient localization based on multiple feature types
CN114693856B (en) Object generation method and device, computer equipment and storage medium
CN116097316A (en) Object recognition neural network for modeless central prediction
CN114078180A (en) Three-dimensional hair model generation method and device, electronic equipment and storage medium
CN113822965A (en) Image rendering processing method, device and equipment and computer storage medium
CN116993955A (en) Three-dimensional model heavy topology method, device, equipment and storage medium
CN114078179A (en) Method and device for reconstructing three-dimensional hair model, electronic equipment and storage medium
CN115063330A (en) Hair rendering method and device, electronic equipment and storage medium
CN114529648A (en) Model display method, device, apparatus, electronic device and storage medium
Zhang et al. Single image 3D reconstruction based on control point grid
JP2020013390A (en) Information processing apparatus, information processing program, and information processing method
CN111652807A (en) Eye adjustment method, eye live broadcast method, eye adjustment device, eye live broadcast device, electronic equipment and storage medium

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