Method, device, equipment and medium for generating three-dimensional hair model of virtual image

By determining the target hair in the initial hair model of the three-dimensional virtual image and performing grafting processing, the problem of uneven hair lengths is solved, the model effect and production efficiency are improved, and the designer's construction cost is reduced.

CN116894917BActive Publication Date: 2024-10-18BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310732941.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-20
Publication Date
2024-10-18
Estimated Expiration
2043-06-20

AI Technical Summary

Technical Problem

In the existing hair models of three-dimensional virtual images, the hair lengths are uneven, resulting in poor overall results. Moreover, the cost for designers to build hair models is high and the production efficiency is low.

Method used

By determining the target hair corresponding to the current hair in the initial hair model, and grafting the current hair based on the target node, a target hair model with consistent length is generated to ensure the consistency of the hair length.

Benefits of technology

It improves the effect of the three-dimensional hair model of the virtual image, reduces the cost for designers to build hair models, and improves the production efficiency of hair models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116894917B_ABST
    Figure CN116894917B_ABST
Patent Text Reader

Abstract

The present disclosure provides a method, device, equipment and medium for generating a three-dimensional hair model of a virtual image, which relates to the field of artificial intelligence technology, specifically computer vision, augmented reality, virtual reality, deep learning and other technical fields, and can be applied to scenes such as the metaverse and digital humans. The method for generating a three-dimensional hair model of a virtual image includes: for a current hair in an initial hair model, determining a target hair corresponding to the current hair in the initial hair model; determining a target node in the target hair; and based on the target node, performing a grafting process on the current hair to generate a target hair model. The present disclosure can improve the effect of the three-dimensional hair model of the virtual image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence technology, specifically computer vision, augmented reality, virtual reality, deep learning and other technical fields, and can be applied to scenes such as the metaverse and digital humans, and in particular to a method, device, equipment and medium for generating a three-dimensional hair model of a virtual image. Background Art

[0002] Three-dimensional virtual images have wide application value in social networking, live broadcasting, games and other scenarios. The hair modeling in virtual images is complex and the number of hair is large. It is costly for designers to build hair. Hair reconstruction technology can reduce the cost of designers building hair models and improve the production efficiency of hair models. Summary of the invention

[0003] The present disclosure provides a method, device, equipment and medium for generating a three-dimensional hair model of a virtual image.

[0004] According to one aspect of the present disclosure, a method for generating a three-dimensional hair model of a virtual image is provided, comprising: for a current hair in an initial hair model, determining a target hair corresponding to the current hair in the initial hair model; wherein the length of the current hair is less than the length of the target hair, and the distance between the current hair and the target hair satisfies a preset condition; determining a target node in the target hair; wherein the target node is a node within a target area, and the target area is a hair area on the target hair whose length is greater than that of the current hair; and based on the target node, performing a grafting process on the current hair to generate a target hair model.

[0005] According to another aspect of the present disclosure, a device for generating a three-dimensional hair model of a virtual image is provided, comprising: a first determination module, for determining, in an initial hair model, a target hair corresponding to a current hair in the initial hair model; wherein the length of the current hair is less than the length of the target hair, and the distance between the current hair and the target hair satisfies a preset condition; a second determination module, for determining a target node in the target hair; wherein the target node is a node within a target region, and the target region is a hair region on the target hair whose length is greater than that of the current hair; and a generation module, for performing a grafting process on the current hair based on the target node to generate a target hair model.

[0006] According to another aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute any method as described in any of the above aspects.

[0007] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute any one of the methods according to any one of the above aspects.

[0008] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, the computer program implements any one of the methods described in any one of the above aspects.

[0009] According to the technical solution disclosed in the present invention, the effect of the three-dimensional hair model of the virtual image can be improved.

[0010] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.

[0012] Figure 1 is a schematic diagram according to a first embodiment of the present disclosure;

[0013] Figure 2 is a schematic diagram of a three-dimensional hair model of a virtual image provided according to an embodiment of the present disclosure;

[0014] Figure 3 is a schematic diagram of a hair provided according to an embodiment of the present disclosure;

[0015] Figure 4 is a schematic diagram of a target node on a target hair according to an embodiment of the present disclosure;

[0016] Figure 5 is a schematic diagram of an application scenario provided according to an embodiment of the present disclosure;

[0017] Figure 6 is a schematic diagram according to a second embodiment of the present disclosure;

[0018] Figure 7 is a schematic diagram comparing an initial hair model and a target hair model provided according to an embodiment of the present disclosure;

[0019] Figure 8 is a schematic diagram according to a third embodiment of the present disclosure;

[0020] Fig. 9 It is a schematic diagram of an electronic device used to implement the method for generating a three-dimensional hair model of a virtual character according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0021] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0022] In the related art, the three-dimensional hair model generated based on the hair reconstruction technology may have uneven hair lengths, resulting in poor effect of the overall three-dimensional hair model.

[0023] In order to improve the effect of the three-dimensional hair model, the present disclosure provides the following embodiments.

[0024] Figure 1 is a schematic diagram according to the first embodiment of the present disclosure. This embodiment provides a method for generating a three-dimensional hair model of a virtual image, the method comprising:

[0025] 101. For a current hair in an initial hair model, determine a target hair corresponding to the current hair in the initial hair model; wherein a length of the current hair is less than a length of the target hair, and a distance between the current hair and the target hair satisfies a preset condition.

[0026] 102. Determine a target node in the target hair; wherein the target node is a node in a target region, and the target region is a hair region on the target hair that is longer than the current hair.

[0027] 103. Based on the target node, perform grafting processing on the current hair to generate a target hair model.

[0028] The initial hair model may be generated by using a hair reconstruction technique, and the hair in the initial hair model may have uneven lengths.

[0029] For example, the initial hair model can be Figure 2 As shown, the initial hair model may include n hairs, where n is the total number of hairs.

[0030] The current hair refers to a hair currently being processed in the initial hair model, and can be represented by the i-th hair, where i=1, 2, ...n.

[0031] The target hair refers to a hair in the initial hair model that corresponds to the current hair. Different from the current hair, it can be represented by the jth hair.

[0032] Among them, len i <len j ,len i is the length of the current hair (the i-th hair), len j is the length of the target hair (the jth hair).

[0033] In addition, the distance between the current hair and the target hair meets a preset condition. For example, relative to other hairs, the distance between the target hair and the current hair is the smallest, and the distance is less than a preset threshold.

[0034] Hair is composed of multiple nodes. For example, each hair includes m nodes. Each node of the hair can be represented by a node vector, and the node vector can be represented by the three-dimensional coordinates of the node. The order of the nodes is the connection relationship between the nodes.

[0035] For example, Figure 3 As shown, each hair strand may be composed of m=5 nodes, the starting node is the hair root node, which is located at the scalp; and the end node is the hair tip node.

[0036] Since the target hair length is greater than the current hair length, Figure 4 As shown, the region of the target hair whose length is greater than the current hair is called the target region, and the nodes within the target region are called target nodes.

[0037] Since the length of the current hair is less than the length of the target hair, in order to avoid the problem of uneven lengths, the current hair may be grafted to ensure that the length of the processed current hair is consistent with the length of the target hair.

[0038] The grafting process refers to increasing the length of the current hair so that the increased length of the current hair is consistent with the length of the target hair.

[0039] Specifically, the current hair may be grafted based on the node vector corresponding to the target node to obtain the current hair with increased length.

[0040] By traversing each hair of the initial hair model, the shorter hairs can be grafted to obtain hairs with the same length. The model composed of these hairs with the same length can be called the target hair model.

[0041] In this embodiment, since the current hair is of shorter length, the shorter hair can be lengthened by grafting the current hair, thereby ensuring the overall consistency of the hair length in the target hair model and improving the effect of the three-dimensional hair model of the virtual image.

[0042] In order to better understand the embodiments of the present disclosure, application scenarios to which the embodiments of the present disclosure can be applied are described.

[0043] Figure 5 302 is a schematic diagram of an application scenario provided by an embodiment of the present disclosure. The scenario includes: a user terminal 501 and a server 502. The user terminal 501 may include: a personal computer (PC), a mobile phone, a tablet computer, a laptop computer, a smart wearable device, etc. The server 302 may be a cloud server or a local server. The user terminal 501 and the server 502 may communicate using a communication network, and the communication network may include, for example, a wired network and / or a wireless network.

[0044] The server 502 may use a three-dimensional hair reconstruction technology to generate an initial hair model; and update the initial hair model to obtain a target hair model. The update process may specifically refer to grafting the shorter hairs. Both the initial hair model and the target hair model may be displayed by the user terminal 501.

[0045] In combination with the above application scenarios, the present disclosure also provides the following embodiments.

[0046] Figure 6 is a schematic diagram according to a second embodiment of the present disclosure. This embodiment provides a method for generating a three-dimensional hair model of a virtual image, the method comprising:

[0047] 601. For a current hair in an initial hair model, determine a target hair corresponding to the current hair in the initial hair model; wherein a length of the current hair is less than a length of the target hair, and a distance between the current hair and the target hair satisfies a preset condition.

[0048] Among them, for the current hair, a candidate hair whose length is greater than the current hair can be determined in the initial hair model; for any node in the current hair, the distance between any node and any line segment of the candidate hair is determined; and the candidate hair with the smallest distance and less than a preset threshold is used as the target hair.

[0049] For example, the current hair is represented by the i-th hair, and then any hair in the initial hair model except the current hair (represented by the j-th hair) can be traversed. Assuming that the length of the j-th hair is greater than the length of the i-th hair, the j-th hair is taken as a candidate hair.

[0050] like Figure 3 As shown, the hair is composed of nodes, and two adjacent nodes can form a line segment. Assume Figure 3 The five nodes are represented by A (hair root node), B, C, D, and E (hair tip nodes), and four line segments AB, BC, CD, and DE can be formed. The sum of the lengths of these four line segments is the length of the corresponding hair. The length of each line segment can be calculated using the three-dimensional position coordinates of the corresponding node. For example, for line segment AB, the three-dimensional position coordinates of A and B can be used to calculate it.

[0051] After determining the candidate hair, for any node of the current hair, the distance between the node and each line segment of each candidate hair can be calculated. Assume that the distance is expressed by V ij In other words, the distance between any node of the current hair and any line segment of any candidate hair can be obtained. After obtaining the distance, a distance less than a preset threshold can be selected as a candidate distance, and the minimum distance can be selected from the candidate distances, and the candidate hair corresponding to the minimum distance can be used as the target hair.

[0052] In this embodiment, since hair that is closer to the current hair is usually used for grafting in practice, by selecting the candidate hair with the smallest distance and less than a preset threshold as the target hair, the accuracy of the target hair can be improved and the grafting effect can be enhanced.

[0053] 602. Determine a target node in the target hair; wherein the target node is a node in a target region, and the target region is a hair region on the target hair that is longer than the current hair.

[0054] Among them, the distance between the hair tip node of the current hair and any line segment of the target hair can be determined, and the line segment with the minimum distance is used as a candidate line segment; a boundary node is determined from two nodes corresponding to the candidate line segment; and the node between the hair tip node of the target hair and the boundary node is used as the target node.

[0055] For example, the nodes of the target hair include A, B, C, D, and E, and any line segment of the target hair refers to a line segment formed by any two adjacent nodes, that is, any one of AB, BC, CD, and DE.

[0056] Assuming that the hair tip node of the current hair is E0, the distance between E0 and any one of the above four line segments (AB, BC, CD, DE) can be calculated. Assuming that the distance between E0 and CD is the smallest, line segment CD is a candidate line segment. Afterwards, the boundary node can be determined from the two nodes (C, D) corresponding to the candidate line segment. Assuming that node D is the boundary node, the node between node D and the hair tip node of the target hair (i.e., node E) is used as the target node, that is, node D and node E are used as target nodes.

[0057] In this embodiment, since the target node is a node within the target area, the target area is an area whose length is greater than the current hair, that is, the area between the boundary node and the hair tip node of the target hair, the target node can be determined efficiently and accurately by taking the node between the hair tip node of the target hair and the boundary node as the target node.

[0058] Among them, the demarcation node is determined from the two nodes corresponding to the candidate line segment, and the distance between the hair tip node of the current hair and each of the two nodes of the candidate line segment can be determined; and the node with the smallest distance is used as the demarcation node.

[0059] For example, if the candidate line segment is line segment CD, the distance V between the hair tip node E0 and the node C of the current hair can be calculated respectively. E0-C , and the distance V between node E0 and node D E0-D , assuming V E0-D <V E0-C , then node D is used as the boundary node.

[0060] In this embodiment, the boundary node of the target hair is usually closest to the hair tip node of the current hair, so determining the boundary node based on the distance between nodes can improve the accuracy of the boundary node.

[0061] 603. Downsample the original nodes of the current hair to generate first nodes, where the number of the first nodes is a first number, which is the number of nodes between the root node of the target hair and the boundary node.

[0062] The number of nodes of each hair strand is the same. For example, if each hair strand includes m nodes, the number of original nodes of the current hair strand is m.

[0063] Assuming that the node numbers are arranged in ascending order from the root node to the branch node, that is, the number of the root node is 1, the number of the branch node is m, and the number of the boundary node is k, then the first number is k.

[0064] Therefore, the m original nodes of the current hair may be downsampled to k first nodes.

[0065] Specifically, a bilinear interpolation algorithm may be used to perform the above-mentioned downsampling.

[0066] 604. Generate second nodes based on the vector difference between the node vectors corresponding to the target nodes, the number of the second nodes being a second number, and the sum of the second number and the first number being the number of nodes of the original nodes.

[0067] Among them, k first nodes can be obtained by downsampling. Since the number of nodes of each hair needs to be m, (mk) nodes can be generated based on the target node.

[0068] That is, the (mk) nodes to be generated may be referred to as second nodes, and the second nodes may be generated based on the vector difference between the node vectors corresponding to the target nodes.

[0069] For example, the sequence number of the target node is k+1, k+2, ..., m, and the vector difference refers to the vector difference between two adjacent target nodes. The vector difference can be expressed as: vec k+1 ,vec k+2 , ..., vec m .

[0070] For each second node, the previous second node of the second node can be summed with the corresponding vector difference, and the initial value of the second node is the last first node.

[0071] For example, the second node can be represented as Node k+1 ,Node k+2 , ..., Node m , then Node k+1 =Node k +vec k+1 ,Node k+2 =Node k+1 +vec k+2 , ..., Node m =Node m-1 +vec m .

[0072] 605. Combine the first node and the second node to obtain the current hair after grafting.

[0073] For example, the first node is represented as: 1 ,Node 2 , ..., Node k , these k first nodes are obtained by downsampling the original nodes of the current hair;

[0074] The second node is represented by:k+1 ,Node k+2 , ..., Node m , this (mk) second node is obtained by the vector difference corresponding to the target node;

[0075] Afterwards, the first node and the second node are combined to obtain the current hair after the grafting process, that is, the current hair after the grafting process is composed of the following nodes: Node 1 ,Node 2 , ..., Node k ,Node k+1 ,Node k+2 , ..., Node m .

[0076] 606. Generate the target hair model based on the current hair after the grafting process.

[0077] The current hair is any hair in the initial hair model. By traversing each hair in the initial hair model and repeatedly executing 601-605, the current hair after grafting can be obtained, and the current hair after grafting is used as the hair in the target hair model.

[0078] In addition, for the current hair in the initial hair model, there may not be a target hair that is longer than the current hair, so the current hair in the initial hair model can be used as the hair in the target hair model. The current hair directly used as the hair in the target hair model and the current hair after the grafting process are combined into the target hair model.

[0079] Among them, Figure 7 As shown, for the initial hair model 701, the hair lengths thereof are uneven. After grafting the shorter hairs, a target hair model 702 can be generated. The hair lengths in the target hair model 702 are substantially consistent.

[0080] In this embodiment, the original nodes of the current hair are downsampled based on the boundary node to generate a first node, and the second node can be generated through the vector difference corresponding to the target node. Then, by combining the first node and the second node, the current hair after grafting can be obtained, so that the current hair can be grafted accurately and efficiently, thereby improving the target hair model effect.

[0081] Figure 8 is a schematic diagram according to the third embodiment of the present disclosure. This embodiment provides a device for generating a three-dimensional hair model of a virtual image, such as Figure 8 As shown, the device 800 includes: a first determination module 801, a second determination module 802 and a generation module 803.

[0082] The first determination module 801 is used to determine, for a current hair in an initial hair model, a target hair corresponding to the current hair, wherein the length of the current hair is less than the length of the target hair, and the distance between the current hair and the target hair satisfies a preset condition; the second determination module 802 is used to determine a target node in the target hair, wherein the target node is a node within a target area, and the target area is a hair area on the target hair whose length is greater than the current hair; the generation module 803 is used to perform a grafting process on the current hair based on the target node to generate a target hair model.

[0083] In this embodiment, since the current hair is of shorter length, the shorter hair can be lengthened by grafting the current hair, thereby ensuring the overall consistency of the hair length in the target hair model and improving the effect of the three-dimensional hair model of the virtual image.

[0084] In some embodiments, the first determination module 801 is further used to: for the current hair, determine, in the initial hair model, a candidate hair whose length is greater than the current hair; for any node in the current hair, determine the distance between any node and any line segment of the candidate hair; and select the candidate hair with the smallest distance that is less than a preset threshold as the target hair.

[0085] In this embodiment, since hair that is closer to the current hair is usually used for grafting in practice, by selecting the candidate hair with the smallest distance and less than a preset threshold as the target hair, the accuracy of the target hair can be improved and the grafting effect can be enhanced.

[0086] In some embodiments, the second determination module 802 is further used to: determine the distance between the hair tip node of the current hair and any line segment of the target hair, and use the line segment with the minimum distance as a candidate line segment; determine a boundary node from two nodes corresponding to the candidate line segment; and use the node between the hair tip node of the target hair and the boundary node as the target node.

[0087] In this embodiment, since the target node is a node within the target area, the target area is an area whose length is greater than the current hair, that is, the area between the boundary node and the hair tip node of the target hair, the target node can be determined efficiently and accurately by taking the node between the hair tip node of the target hair and the boundary node as the target node.

[0088] In some embodiments, the second determination module 802 is further used to: determine the distance between the hair tip node of the current hair and each of the two nodes of the candidate line segment; and use the node with the smallest distance as the boundary node.

[0089] In this embodiment, the boundary node of the target hair is usually closest to the hair tip node of the current hair, so determining the boundary node based on the distance between nodes can improve the accuracy of the boundary node.

[0090] In some embodiments, the generating module 803 is further used to: downsample the original nodes of the current hair to generate first nodes, the number of the first nodes is a first number, and the first number is the number of nodes between the hair root node and the boundary node of the target hair; based on the vector difference between the node vectors corresponding to the target nodes, generate second nodes, the number of the second nodes is a second number, and the sum of the second number and the first number is the number of nodes of the original nodes; combine the first node and the second node to obtain the current hair after the grafting process; generate the target hair model based on the current hair after the grafting process.

[0091] In this embodiment, the original nodes of the current hair are downsampled based on the boundary node to generate a first node, and the second node can be generated through the vector difference corresponding to the target node. Then, by combining the first node and the second node, the current hair after grafting can be obtained, so that the current hair can be grafted accurately and efficiently, thereby improving the target hair model effect.

[0092] It can be understood that in the embodiments of the present disclosure, the same or similar contents in different embodiments can be referenced to each other.

[0093] It can be understood that the “first”, “second”, etc. in the embodiments of the present disclosure are only used for distinction and do not indicate the degree of importance, time sequence, etc.

[0094] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0095] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.

[0096] Fig. 9A schematic block diagram of an example electronic device 900 that can be used to implement an embodiment of the present disclosure is shown. The electronic device 900 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0097] like Fig. 9 As shown, the electronic device 900 includes a computing unit 901, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 902 or a computer program loaded from a storage unit 909 into a random access memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the electronic device 900 can also be stored. The computing unit 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.

[0098] Multiple components in the electronic device 900 are connected to the I / O interface 905, including: an input unit 906, such as a keyboard, a mouse, etc.; an output unit 907, such as various types of displays, speakers, etc.; a storage unit 908, such as a disk, an optical disk, etc.; and a communication unit 909, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 909 allows the electronic device 900 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0099] The computing unit 901 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 901 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit 901 performs the various methods and processes described above, such as the method for generating a three-dimensional hair model of a virtual image. For example, in some embodiments, the method for generating a three-dimensional hair model of a virtual image may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 908. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 900 via the ROM 902 and / or the communication unit 909. When the computer program is loaded into the RAM 903 and executed by the computing unit 901, one or more steps of the method for generating a three-dimensional hair model of a virtual image described above may be performed. Alternatively, in other embodiments, the computing unit 901 may be configured to execute the method for generating a three-dimensional hair model of a virtual character in any other appropriate manner (for example, by means of firmware).

[0100] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0101] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0102] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0103] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0104] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.

[0105] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server of a distributed system, or a server combined with a blockchain.

[0106] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0107] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A method for generating a three-dimensional hair model of a virtual image, comprising: For a current hair in an initial hair model, determining a target hair corresponding to the current hair in the initial hair model; wherein the length of the current hair is less than the length of the target hair, and the distance between the current hair and the target hair meets a preset condition; Determine a target node in the target hair; wherein the target node is a node within a target region, and the target region is a region of hair on the target hair that is longer than the current hair; Based on the target node, grafting is performed on the current hair to generate a target hair model; the grafting is to increase the length of the current hair so that the increased length of the current hair is consistent with the length of the target hair; The current hair after grafting is obtained by combining a first node and a second node, wherein the first node is obtained by downsampling an original node of the current hair, and the second node is obtained by a vector difference corresponding to a target node.

2. The method according to claim 1, wherein: The step of determining, for a current hair in the initial hair model, a target hair corresponding to the current hair, comprises: For the current hair, determining, in the initial hair model, a candidate hair whose length is greater than that of the current hair; For any node in the current hair, determine the distance between the any node and any line segment of the candidate hair; The candidate hair with the smallest distance that is smaller than a preset threshold is used as the target hair.

3. The method according to claim 1, wherein: The determining of the target node in the target hair comprises: Determine the distance between the hair tip node of the current hair and any line segment of the target hair, and use the line segment with the minimum distance as a candidate line segment; Determine a boundary node among two nodes corresponding to the candidate line segment; The node between the hair tip node of the target hair and the boundary node is used as the target node.

4. The method according to claim 3, wherein: The step of determining a boundary node between two nodes corresponding to the candidate line segment includes: Determine the distance between the hair tip node of the current hair and each of the two nodes of the candidate line segment; The node with the smallest distance is taken as the boundary node.

5. The method according to claim 3, wherein: The grafting process is performed on the current hair based on the target node to generate a target hair model, including: Downsampling the original nodes of the current hair to generate first nodes, where the number of the first nodes is a first number, which is the number of nodes between the root node of the target hair and the boundary node; Generate second nodes based on the vector difference between the node vectors corresponding to the target nodes, the number of the second nodes is a second number, and the sum of the second number and the first number is the number of nodes of the original nodes; Combining the first node and the second node to obtain a current hair after grafting; Based on the current hair after the grafting process, the target hair model is generated.

6. A device for generating a three-dimensional hair model of a virtual image, comprising: A first determination module is used to determine, for a current hair in an initial hair model, a target hair corresponding to the current hair, wherein the length of the current hair is less than the length of the target hair, and the distance between the current hair and the target hair satisfies a preset condition; A second determination module is used to determine a target node in the target hair; wherein the target node is a node within a target area, and the target area is a hair area on the target hair that is longer than the current hair; A generating module, configured to perform a grafting process on the current hair based on the target node to generate a target hair model; the grafting process is to increase the length of the current hair so that the increased length of the current hair is consistent with the length of the target hair; The current hair after grafting is obtained by combining a first node and a second node, wherein the first node is obtained by downsampling an original node of the current hair, and the second node is obtained by a vector difference corresponding to a target node.

7. The device according to claim 6, wherein: The first determining module is further configured to: For the current hair, determining, in the initial hair model, a candidate hair whose length is greater than that of the current hair; For any node in the current hair, determine the distance between the any node and any line segment of the candidate hair; The candidate hair with the smallest distance that is smaller than a preset threshold is used as the target hair.

8. The device according to claim 6, wherein: The second determining module is further used for: Determine the distance between the hair tip node of the current hair and any line segment of the target hair, and use the line segment with the minimum distance as a candidate line segment; Determine a boundary node among two nodes corresponding to the candidate line segment; The node between the hair tip node of the target hair and the boundary node is used as the target node.

9. The device according to claim 8, wherein: The second determining module is further used for: Determine the distance between the hair tip node of the current hair and each of the two nodes of the candidate line segment; The node with the smallest distance is taken as the boundary node.

10. The device according to claim 8, wherein: The generating module is further used for: Downsampling the original nodes of the current hair to generate first nodes, where the number of the first nodes is a first number, which is the number of nodes between the root node of the target hair and the boundary node; Generate second nodes based on the vector difference between the node vectors corresponding to the target nodes, the number of the second nodes is a second number, and the sum of the second number and the first number is the number of nodes of the original nodes; Combining the first node and the second node to obtain a current hair after grafting; Based on the current hair after the grafting process, the target hair model is generated.

11. An electronic device, comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 5.

12. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-5.

13. A computer program product, comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Virtual hair style modeling method of images and videos

    CN103606186A