Hair processing method and apparatus, and electronic device and storage medium

By dividing the hair data into guided hair and ordinary hair, and using the simulated posture change characteristics of the guided hair, the problem of low authenticity of hair rendering images in the existing technology is solved, and a more realistic and natural rendering is achieved. Hair dynamic simulation effect.

WO2024212842A1PCT designated stage expired Publication Date: 2024-10-17BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/085495
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-04-12
Filing Date
2024-04-02
Publication Date
2024-10-17

AI Technical Summary

Technical Problem

In existing technology, in short video generation and game production, in order to achieve real hair dynamic simulation, it is difficult to simulate each hair independently under the requirement of real-time rendering. Usually only the guide hair is simulated, resulting in ordinary hair. The pose attributes of the hair are overwritten, resulting in low authenticity and poor visual effects of the generated hair rendering image.

Method used

By obtaining the hair data, it is divided into guided hair and ordinary hair, simulation is performed based on the initial posture of the guided hair, its motion information is obtained, and this information is applied to the initial posture of the ordinary hair, so as to Realize the position changes of hair, thereby generating more realistic rendering images.

Benefits of technology

The authenticity and visual effects of hair rendering images are improved. By guiding the simulated posture change characteristics of hair, the initial posture characteristics of ordinary hair are retained, and the performance of hair details is enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024085495_17102024_PF_FP_ABST
    Figure CN2024085495_17102024_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the embodiments of the present disclosure are a hair processing method and apparatus, and an electronic device and a storage medium. The method comprises: acquiring hair data, and dividing the hair data into guide hair and ordinary hair; processing the guide hair on the basis of an initial pose thereof, so as to obtain a simulation pose of the guide hair; according to the simulation pose and the initial pose of the guide hair, obtaining motion information of the guide hair, wherein the motion information represents a posture change feature of the simulation pose of the guide hair relative to the initial pose of the guide hair; and obtaining a hair rendering image according to the motion information and an initial pose of the ordinary hair.
Need to check novelty before this filing date? Find Prior Art

Description

Hair processing method, device, electronic device and storage medium

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application is based on and claims priority to the Chinese patent application with application number 202310397317.2 and application date April 12, 2023. The disclosed content of the Chinese patent application is hereby introduced as a whole into this application. Technical Field

[0003] The embodiments of the present disclosure relate to the field of image processing technology, and in particular to a hair processing method, device, electronic device, and storage medium. Background Art

[0004] Currently, in fields such as short video generation and game production, in order to pursue more realistic visual effects, human or animal hair is dynamically simulated on a hair-by-hair basis to produce realistic visual effects. In this process, it is necessary to simulate the motion state of the hair based on the hair data to obtain the simulated pose of the hair in the next frame of the image, and then render based on the simulated pose to realize the movement of the hair.

[0005] However, due to the huge number of hair strands contained in hair data, it is difficult to achieve independent simulation of each hair strand while meeting the real-time rendering requirements. Therefore, the solutions in related technologies usually only simulate the guide hairs in the hair data, and then apply the simulated pose of the guide hairs to other ordinary hairs to achieve simulation of all hair strands.

[0006] Summary of the Invention

[0007] Embodiments of the present disclosure provide a hair processing method, device, electronic device, and storage medium.

[0008] In a first aspect, an embodiment of the present disclosure provides a hair treatment method, comprising:

[0009] The method includes obtaining hair data and dividing the hair data into guide hair and ordinary hair; processing the guide hair based on its initial posture to obtain a simulated posture of the guide hair; obtaining motion information of the guide hair based on the simulated posture and the initial posture of the guide hair, the motion information representing posture change characteristics of the simulated posture of the guide hair relative to the initial posture of the guide hair; and obtaining a hair rendering image based on the motion information and the initial posture of the ordinary hair.

[0010] In a second aspect, an embodiment of the present disclosure provides a hair treatment device, comprising:

[0011] An acquisition module is used to acquire hair data and divide the hair data into guide hair and ordinary hair;

[0012] a simulation module, configured to process the guide hair based on its initial posture to obtain a simulated posture of the guide hair;

[0013] a processing module, configured to obtain motion information of the guide hair according to the simulated pose and the initial pose of the guide hair, wherein the motion information represents a posture change feature of the simulated pose of the guide hair relative to the initial pose of the guide hair;

[0014] A rendering module is used to obtain a hair rendering image according to the motion information and the initial position of the ordinary hair.

[0015] In a third aspect, an embodiment of the present disclosure provides an electronic device, including:

[0016] a processor, and a memory communicatively connected to the processor;

[0017] The memory stores computer-executable instructions;

[0018] The processor executes the computer-executable instructions stored in the memory to implement the hair processing method as described in the first aspect and various possible designs of the first aspect.

[0019] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions. When a processor executes the computer-executable instructions, the hair processing method described in the first aspect and various possible designs of the first aspect is implemented.

[0020] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements the hair processing method described in the first aspect and various possible designs of the first aspect.

[0021] The hair processing method, device, electronic device, and storage medium provided in this embodiment obtain hair data representing the initial pose of a guide hairline and the initial pose of a corresponding ordinary hairline; simulate the guide hairline based on the hair data to obtain a simulated pose of the guide hairline; obtain motion information of the guide hairline based on the simulated pose and the initial pose of the guide hairline, the motion information representing the posture change characteristics of the simulated pose of the guide hairline relative to the initial pose of the guide hairline; and obtain a hair rendering image based on the motion information and the initial pose of the ordinary hairline. Motion information representing the posture change characteristics of the guide hairline is obtained based on the simulated pose of the guide hairline, and the motion information is used as the pose change amount to redirect the ordinary hairline so that the ordinary hairline obtains a corresponding simulation result based on the original initial pose of the ordinary hairline and the motion information, thereby obtaining a hair rendering image. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure or related technologies, the following is a brief introduction to the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0023] FIG1 is a diagram illustrating an application scenario of a hair treatment method provided by an embodiment of the present disclosure;

[0024] FIG2 is a first flow chart of a hair treatment method according to an embodiment of the present disclosure;

[0025] FIG3 is a schematic diagram of a hair posture provided by an embodiment of the present disclosure;

[0026] FIG4 is a schematic diagram of the positions of a guide hair and a normal hair provided by an embodiment of the present disclosure;

[0027] FIG5 is a flowchart of a specific implementation of step S102 in the embodiment shown in FIG2 ;

[0028] FIG6 is a schematic diagram of a particle motion state of a hair particle provided by an embodiment of the present disclosure;

[0029] FIG7 is a flowchart of a specific implementation of step S103 in the embodiment shown in FIG2 ;

[0030] FIG8 is a schematic diagram of a process for generating a simulated pose of ordinary hair according to an embodiment of the present disclosure;

[0031] FIG9 is a second flow chart of the hair treatment method provided by an embodiment of the present disclosure;

[0032] FIG10 is a flowchart of a specific implementation of step S203 in the embodiment shown in FIG9 ;

[0033] FIG11 is a flowchart of another specific implementation of step S203 in the embodiment shown in FIG9 ;

[0034] FIG12 is a schematic diagram of a virtual hair particle provided by an embodiment of the present disclosure;

[0035] FIG13 is a schematic diagram of generating weighted motion information provided by an embodiment of the present disclosure;

[0036] FIG14 is a flowchart of a specific implementation of step S208 in the embodiment shown in FIG9 ;

[0037] FIG15 is a structural block diagram of a hair processing device provided by an embodiment of the present disclosure;

[0038] FIG16 is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure;

[0039] FIG17 is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0040] To make the objectives, technical solutions, and advantages of the embodiments of the present disclosure more clear, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present disclosure without making any creative efforts shall fall within the scope of protection of the present disclosure.

[0041] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0042] The following explains the application scenarios of the embodiments of the present disclosure:

[0043] Figure 1 illustrates an application scenario for the hair processing method provided by an embodiment of the present disclosure. The hair processing method provided by an embodiment of the present disclosure can be applied to application scenarios such as video special effects generation and real-time game rendering. More specifically, in an application scenario involving real-time rendering of video special effects, as shown in Figure 1, the method provided by an embodiment of the present disclosure can be applied to a terminal device, such as a smartphone or personal computer. Figure 1 uses a smartphone as an example for illustration. The terminal device runs a target application that requires hair special effects rendering, such as a game application or a short video application. When the target application running on the terminal device requires dynamic display of a person's or animal's hair (i.e., the hair's position changes with the person's or animal's position), the terminal device dynamically renders each strand of hair. For example, in the case of the hair of the person shown in Figure 1, the hair processing method provided by an embodiment of the present disclosure dynamically simulates and renders each strand of hair, thereby achieving the goal of dynamically displaying the person's or animal's hair within the target application's image display interface.

[0044] In the related art, dynamic rendering of human or animal hair typically requires first simulating the motion of the hair based on the hair data to obtain a simulated pose of the hair in the next frame of the image. Rendering is then performed based on this simulated pose, thereby making the hair appear in motion. However, due to the large number of hairs contained in the hair data, it is difficult to independently simulate each hair while meeting the real-time rendering requirements. Therefore, solutions in the related art typically simulate a small number of guide hairs in the hair data, and then apply the simulated pose of each guide hair to the corresponding large number of ordinary hairs, thereby achieving rapid simulation of all hairs. However, in the above-mentioned solutions in the related art, after applying the simulated pose of the guide hair to the corresponding ordinary hair, the pose attributes of the ordinary hair are overwritten, resulting in a high degree of pose similarity between the large number of ordinary hairs corresponding to the same guide hair, which leads to a loss of hair details. Consequently, using these hairs with high pose similarity for image rendering results in low authenticity and poor visual effects in the generated hair-rendered image. The presently disclosed embodiments provide a hair processing method to address the above-mentioned problems.

[0045] Referring to FIG2 , FIG2 is a flow chart of a hair treatment method according to an embodiment of the present disclosure. The method of this embodiment can be applied in a terminal device, and the hair treatment method includes:

[0046] Step S101: Acquire hair data, and divide the hair data into guide hair and ordinary hair.

[0047] For example, as described in the aforementioned application scenarios, hair data is data used to represent the hair strands that make up a person's or animal's hair. For example, the hair data is used to represent the initial pose of a guide hair strand and the initial pose of a normal hair strand corresponding to the guide hair strand. The pose of the corresponding hair strand can be determined using the hair data. The pose refers to the position and posture of the hair strand. Figure 3 is a schematic diagram of hair strand poses provided by an embodiment of the present disclosure. Taking the rendering of a person's hair as an example, as shown in Figure 3, the numerous hair strands that make up the hair strand include hair strand A and hair strand B. The pose corresponding to hair strand A is pose pos_1, and the pose corresponding to hair strand B is pose pos_2. As shown in the figure, hair strand A and hair strand B are located at different positions. Furthermore, hair strand A and hair strand B have different poses. More specifically, hair strand A corresponds to "straight hair," while hair strand B corresponds to "curly hair." The poses corresponding to the hair strands can be used to distinguish the positions and postures of different hair strands, thereby enabling hair strands at different positions to exhibit different hair postures.

[0048] Furthermore, hair data includes two types of hair data: guide hair data and regular hair data. Guide hairs are used to represent the overall style, distribution, and / or direction of a person's or animal's hair, acting like a "skeleton." In subsequent steps, simulations are performed on the guide hairs by calculating their pose changes and their constraints with other elements in the virtual environment, thereby achieving hair movement and interaction with the external environment. Regular hairs, on the other hand, are used to fill in the gaps between the guide hairs, adding volume to the overall hair. Regular hairs do not require motion-based simulation, and therefore require less computational effort than simulations of guide hairs. Typically, one guide hair corresponds to multiple regular hairs, for example, with a guide hair to regular hair ratio of 1:100. By having a small number of guide hairs and corresponding regular hairs, the computational effort of hair simulation can be reduced.

[0049] Furthermore, the hair data includes the corresponding initial pose data of the guide hair and the normal hair in their initial states, namely, the initial pose and initial orientation. The hair data can be used to determine the initial pose of the guide hair and the initial poses of a group of normal hairs corresponding to the guide hair. FIG4 is a schematic diagram of the poses of the guide hair and normal hairs according to an embodiment of the present disclosure. As shown in FIG4 , according to the hair data, hair A (denoted as A in the figure) is the guide hair, and hairs A_1, A_2, A_3, and A_4 (denoted as A_1, A_2, A_3, and A_4, respectively) located near hair A are normal hairs. Hair A has an initial pose pos_1, hair A_2 has an initial pose pos_2, hair A_3 has an initial pose pos_3, and hair A_4 has an initial pose pos_4. As shown in the figure, different ordinary hair strands corresponding to the same guide hair strand are located at different positions and have different postures, that is, different initial postures. In subsequent processing steps, each ordinary hair strand will be simulated based on its different initial postures, so that it retains some of its initial posture.

[0050] The initial poses of the guide hair strands (initial poses) and the initial poses of the normal hair strands (initial poses) can be preset based on the specific needs of the target application or randomly generated, and are not specifically limited here. Within a group of normal hair strands corresponding to the same guide hair strand, the initial poses of the normal hair strands may not be exactly the same.

[0051] Step S102: processing the guide hair based on its initial posture to obtain a simulated posture of the guide hair.

[0052] For example, based on the guide hair in the hair data, the guide hair is simulated, i.e., the position of the guide hair in the next frame is predicted and simulated, i.e., the simulated position. In one implementation where the position of the guide hair changes in the next frame, one possible implementation is: the guide hair undergoes random motion, i.e., based on the initial position of the guide hair, the initial position is randomly altered within a certain range to obtain a position different from the initial position, i.e., the simulated position. More specifically, for example, the guide hair and ordinary hair in the hair data are both composed of multiple hair particles, with a fixed distance between the hair particles. Therefore, adjacent hair particles are subject to a distance constraint. By applying a random position offset to each hair particle of the guide hair, the simulated position of the guide hair can be obtained.

[0053] In another possible implementation, to simulate the actual appearance of hair in an environment, the simulated pose of the guide hair is simulated based on the environment's influence on the guide hair, such as the movement of hair caused by the movement of a person or animal in the image. Specifically, the hair data includes the initial coordinates of the hair particles that constitute the guide hair. As shown in FIG5 , the specific implementation of step S102 includes:

[0054] Step S1021: Acquire the particle motion state of the hair particle guiding the hair, wherein the particle motion state represents the motion speed and / or motion acceleration of the hair particle.

[0055] Step S1022: obtaining simulation coordinates according to the initial coordinates of the hair particle and the corresponding particle motion state.

[0056] Step S1023: obtaining a simulated pose of the guide hair according to the simulated coordinates of at least two hair particles of the guide hair.

[0057] For example, in this embodiment, the hair particles of the guide hair are hair particles, and correspondingly, the hair particles of the ordinary hair are hair particles of the ordinary hair, which will be described in subsequent steps. The particle motion state of the hair particle, i.e., the velocity and / or acceleration of the hair particle in the motion state, is generated by the pulling force exerted on the hair particle by other hair particles adjacent to the guide hair. Optionally, the velocity and acceleration of the hair particle can also be generated by the restraining force exerted on the hair particle by external objects in the image environment (e.g., other hairs, obstacles in the environment, etc.).

[0058] FIG6 is a schematic diagram illustrating the motion state of a hair particle according to an embodiment of the present disclosure. As shown in the figure, a guide hair L1 includes hair particles P1, P2, and P3 (P1, P2, and P3 in the figure). Hair particle P1 is a hair root particle with coordinates , i.e., hair particle P1 is located on the surface of a head model (corresponding to the hair root on the scalp). When the head model moves, it drives hair particle P1 to move, causing hair particle P1 to move accordingly. Subsequently, hair particle P2, adjacent to hair particle P1, is subjected to the traction force N1 of hair particle P1 and moves, causing hair particle P2 to generate a corresponding velocity v2 and acceleration a3 (in the same direction as N1). Furthermore, hair particle P3, adjacent to hair particle P2, is also subjected to the traction force N2 of hair particle P2, generating a corresponding velocity v3 and acceleration a3 (in the same direction as N2). Among them, the speed and acceleration of the hair particles shown in the figure are only for illustration. The corresponding particle motion state of each hair particle is affected by the specific model parameters of the guiding hair and can be obtained by simulation based on the model parameters of the guiding hair using existing dynamic simulation tools. The specific implementation method will not be repeated here.

[0059] Furthermore, illustratively, after obtaining the particle motion state of each hair particle on the guide hair, the initial coordinates of the corresponding hair particle are updated according to the particle motion state of each hair particle on the guide hair in the hair data, and the corresponding simulation coordinates of each hair particle are obtained. Specifically, the method for calculating the simulation coordinates according to the initial coordinates of the hair particle and the corresponding particle motion state can be implemented by formula (1): t+1 =x t +v t ×dt+a t ×dt 2 (1)

[0060] Among them, x t+1 is the position coordinate of the hair particle at time t+1, x t is the position coordinate of the hair particle at time t, v t is the velocity of the hair particle at time t, a t is the acceleration of the hair particle at time t, and dt is the time interval between two moments (e.g., time t and time t+1). t+1 That is, the simulation coordinate; x t That is, the initial coordinate, v t and a t That is, the particle motion state. For example, after obtaining the simulation coordinates, to achieve dynamic rendering of the hair, the simulation coordinates at time t = 2 can be further calculated based on the simulation coordinates at time t = 1. That is, the initial coordinates in the above step are updated to the simulation coordinates at time t = 1, and then the simulation coordinates at time t = 2 are calculated based on the updated initial coordinates, thereby achieving real-time dynamic simulation of the hair. The specific process is similar and will not be repeated here.

[0061] Then, based on the simulated coordinates of at least two hair particles of the guide hair, the simulated pose of the guide hair can be obtained. For example, the simulated coordinates of the hair particles corresponding to the guide hair are three-dimensional coordinates, which can be represented by an array. Combining the simulated coordinates of each hair particle yields the corresponding simulated pose, which can be represented by an array, matrix, or structure, and will not be further described.

[0062] Step S103: obtaining motion information of the guide hair according to the simulated posture and the initial posture, where the motion information represents a posture change feature of the simulated posture of the guide hair relative to the initial posture.

[0063] Exemplarily, after obtaining the simulated pose of the guide hair, a comparative calculation is performed based on the simulated pose and the initial pose in the hair data to obtain a posture change characteristic between the simulated pose and the initial pose, i.e., motion information. Exemplarily, the motion information can be represented by a mapping vector between the coordinates of the hair particles of the guide hair in the initial pose and the coordinates of the hair particles in the simulated pose. Specifically, the initial pose includes the initial coordinates of at least two hair particles corresponding to the guide hair; the simulated pose includes the simulated coordinates of at least two hair particles corresponding to the guide hair. As shown in FIG7 , the specific implementation steps of step S103 include:

[0064] Step S1031: Obtaining a coordinate transformation vector of the hair particle according to the initial coordinates of the hair particle and the corresponding simulation coordinates.

[0065] Step S1032: obtaining motion information of the guiding hair according to the coordinate change vectors of at least two hair particle points.

[0066] For example, for the same hair point in the guide hair, when the guide hair is in the initial position and in the simulated position, if the guide hair moves, the hair point has corresponding different coordinates, namely the initial coordinate and the simulated coordinate. For example, the initial coordinate is x0 and the simulated coordinate is x1. There is a mapping relationship between the initial coordinate and the simulated coordinate: x1 = T(x2)

[0067] T represents the coordinate transformation between the initial and simulated coordinates, i.e., the coordinate transformation vector of the hair particle. Subsequently, the motion information of the guiding hair is derived based on the combination of the coordinate transformation vectors of at least two hair particles. For example, if guiding hair A includes three hair particles, P1, P2, and P3, then the motion information corresponding to guiding hair A is Info = [T1, T2, T3], where T1 is the coordinate transformation vector of hair particle P1, T2 is the coordinate transformation vector of hair particle P2, and T3 is the coordinate transformation vector of hair particle P3.

[0068] Step S104: obtaining a hair rendering image based on the motion information and the initial pose of the normal hair.

[0069] For example, after obtaining the motion information of the guide hair, the motion information of the guide hair is transmitted to the corresponding ordinary hair, so that the ordinary hair produces the same posture change as the guide hair on the basis of the initial posture (initial posture), thereby obtaining a second simulated hair corresponding to the ordinary hair. Thereafter, image rendering is performed based on the second simulated hair to obtain a hair rendering image.

[0070] Exemplarily, the specific implementation of step S104 includes:

[0071] Step S1041: simulating the initial posture of the normal hair based on the motion information to obtain a simulated posture of the normal hair.

[0072] Step S1042: performing image rendering based on the simulated pose of ordinary hair to obtain a hair rendering image.

[0073] Figure 8 is a schematic diagram of a process for generating a simulated pose of ordinary hair, provided by an embodiment of the present disclosure. As shown in Figure 8, motion information is used to characterize the posture change characteristics of the guiding hair. For example, the posture change characteristics represented by the motion information in the figure are a 30-degree clockwise rotation of the guiding hair. After this motion information is transmitted to the ordinary hair, the ordinary hair rotates based on the motion information, using the same posture change characteristics, based on the initial pose, to generate a simulated pose. Subsequently, based on the simulation result of the ordinary hair, i.e., the simulated pose, a renderer, for example, performs image rendering to obtain a hair-rendered image composed of ordinary hair. The hair-rendered image can then be displayed on a corresponding display interface according to the needs of the target application. Through the above steps, the ordinary hair retains its original hair characteristics (initial position) while integrating the motion information of the guide hair, thereby indirectly achieving the external environment driving the ordinary hair. Because the initial positions of the ordinary hairs in a group of ordinary hairs corresponding to the same guide hair are not exactly the same, the second simulated hairs of the ordinary hairs in the group of ordinary hairs corresponding to the same guide hair are also not exactly the same. This creates more differences between different ordinary hairs, making the generated hair rendering image more realistic and natural.

[0074] In this embodiment, hair data is acquired to represent the initial pose of a guide hair and the initial pose of a corresponding ordinary hair. Based on the hair data, the guide hair is simulated to obtain a simulated pose of the guide hair. Motion information of the guide hair is obtained based on the simulated pose and the initial pose, and the motion information represents the pose change characteristics of the simulated pose of the guide hair relative to the initial pose. A hair rendering image is obtained based on the motion information and the initial pose of the ordinary hair. Motion information representing the pose change characteristics of the guide hair is obtained based on the simulated pose of the guide hair. The motion information is used as the pose change amount to redirect the ordinary hair. Based on the original initial pose of the ordinary hair, the motion information is combined with the corresponding motion information to obtain a corresponding simulation result, thereby obtaining a hair rendering image. Because the initial poses of the ordinary hairs vary, the simulation results after redirection based on the corresponding motion information are affected by the initial poses of the ordinary hairs, resulting in differences in the simulation results for the ordinary hairs. This preserves hair details and improves the authenticity and visual quality of the hair rendering image.

[0075] Referring to FIG9 , FIG9 is a second flow chart of a hair treatment method according to an embodiment of the present disclosure. This embodiment is described in detail based on the embodiment shown in FIG2 , with the addition of a step of correcting motion information. The hair treatment method includes:

[0076] Step S201: Acquire hair data, where the hair data includes initial coordinates of hair particles constituting guide hairs and initial coordinates of hair particles constituting ordinary hairs.

[0077] Step S202: Acquire the particle motion state of the hair particle guiding the hair.

[0078] For example, the hair data includes the initial positions of different guide hair strands, represented by the initial coordinates of their hair particle points. Correspondingly, the hair data also includes the initial positions of the corresponding normal hair strands, represented by the initial coordinates of their hair particle points. Subsequently, when the guide hair strands exhibit motion or a tendency to move, the hair particle points of the guide hair strands each have a corresponding particle motion state, including, for example, the velocity and acceleration of the first particle hair strand. The particle motion state can be acquired using a dynamics simulation tool, as described in the embodiment illustrated in FIG2 and will not be further elaborated here.

[0079] Step S203: obtaining simulation coordinates according to the initial coordinates of the hair particle guiding the hair and the corresponding particle motion state.

[0080] For example, after obtaining the particle motion state of the hair particle, the initial coordinates of the hair particle are transformed according to the particle motion state to obtain the corresponding simulation coordinates. For example, the particle motion state includes the first motion velocity of the hair particle and the first motion acceleration of the hair particle. The simulation coordinates can be obtained by integrating the first motion velocity and the first motion acceleration once and twice, respectively, and then adding them to the initial coordinates. For specific implementation methods, please refer to the relevant description of formula (1) in the embodiment shown in Figure 2. Of course, it is understandable that in other possible implementation methods, the simulation coordinates can also be obtained by only integrating the first motion velocity once, or only integrating the first motion acceleration twice, which will not be repeated here.

[0081] In a possible implementation, as shown in FIG10 , the specific implementation of step S203 includes:

[0082] Step S2031: Obtaining a first attenuation speed corresponding to the hair particle according to the first movement speed of the hair particle.

[0083] Step S2032: Correcting the motion state of the hair particle according to the first attenuation speed to obtain a first corrected motion state.

[0084] Step S2033: obtaining simulation coordinates according to the initial coordinates of the hair particle and the corresponding first corrected motion state.

[0085] In real-world conditions, hair strands in human hair are subject to external forces such as friction during movement, creating frictional damping. To enhance the visual realism of hair strands during hair image rendering, this embodiment applies a matching decay rate to the hair strands by guiding their motion velocity. The first velocity of the hair strands is positively correlated with the corresponding first decay rate; that is, the greater the first velocity, the greater the first decay rate. Subsequently, the corresponding first decay rate is subtracted from the first velocity to obtain the motion state of the hair strands on the guided hair strands after applying frictional damping, namely, the first corrected motion state, such as the corrected velocity and acceleration of the hair strands. Simulated coordinates are then derived based on the initial coordinates of the hair strands and the corresponding first corrected motion state, further improving the accuracy of the simulated coordinates and enhancing the realism of the hair rendering. The method for obtaining the corresponding simulated coordinates based on the initial coordinates of the hair strands and the corresponding motion state (the first corrected motion state) has been described in previous embodiments and will not be repeated here.

[0086] In another possible implementation, as shown in FIG11 , the specific implementation of step S203 includes:

[0087] Step S2034: setting a virtual hair particle of the guide hair, where the virtual hair particle is located in the extension direction of one side of the hair tip particle of the guide hair.

[0088] Step S2035: Based on the position constraint relationship between the virtual hair particle and the hair tip particle, obtain the second attenuation speed corresponding to the hair tip particle, wherein the direction of the second attenuation speed is opposite to the direction of the line connecting the adjacent hair particles from the hair tip particle to the hair tip particle.

[0089] Step S2036: Correcting the motion state of the hair particle according to the second attenuation speed to obtain a second corrected motion state.

[0090] Step S2037: obtaining simulation coordinates according to the initial coordinates of the hair particle and the corresponding second corrected motion state.

[0091] For example, the motion of each hair particle on the guiding hair strand is primarily driven by the pulling force of its neighboring hair particles. For example, the hair particle at the root of the guiding hair strand (i.e., the root particle) is directly fixed to the surface of the head model and primarily influenced by the head model's constraint force. Therefore, its position remains fixed as the head model moves, acting as the driving force for the guiding hair strand's motion. Consequently, the root particle's position remains stable. Furthermore, the hair particles in the middle portion of the guiding hair strand are subject to the constraints of the adjacent hair particles on both sides (bidirectional constraint). Therefore, the motion of the hair particles in the middle portion is generally stable. However, the last hair particle at the outer end of the guiding hair strand (i.e., the tip particle) is only constrained by the adjacent hair particles on one side. Therefore, during simulation, its motion becomes unstable, resulting in the visual appearance of "abnormal hair tip jitter."

[0092] To address the aforementioned issues, in an embodiment of the present disclosure, a virtual hair particle is generated after the hair particle of the guiding hair. The coordinates of the virtual hair particle can be determined based on the coordinates of the hair tip particle and at least one hair particle preceding the hair tip particle. More specifically, for example, the corresponding hair curvature and the distance between hair particles are calculated based on the coordinates of the hair tip particle and at least one hair particle immediately preceding the hair tip particle. The simulated coordinates of the virtual hair particle are then obtained based on the calculated hair curvature and distance between hair particles. Figure 12 is a schematic diagram of a virtual hair particle provided by an embodiment of the present disclosure. As shown in Figure 12, the coordinates of the hair tip particle P1 of the guiding hair and the two hair particles P2 and P3 preceding the hair tip particle (shown as P1, P2, and P3 in the figure) are obtained based on hair data. The position of the virtual hair particle P0 (shown as P0 in the figure) is then determined based on the distance between the coordinates of P1, P2, and P3 and the corresponding hair curvature, completing the construction of the virtual hair particle.

[0093] Next, based on a dynamics simulation tool and utilizing the positional constraint relationship between the virtual hair particle and the hair tip particle, a second decay velocity corresponding to the hair tip particle is calculated. This second decay velocity is a velocity component of the hair tip particle caused by the traction force exerted by the virtual hair particle on the hair tip particle. The direction of the second decay velocity is opposite to the direction of the line connecting the hair tip particle to the adjacent hair particles. Furthermore, based on the second decay velocity pair of the hair tip particle, the particle motion state of the hair particle is corrected to obtain a second corrected motion state, such as a corrected motion velocity and a corrected motion acceleration. Simulation coordinates are then obtained based on the corrected second corrected motion state and the initial coordinates of the hair particle. The specific implementation is similar to the method for obtaining simulation coordinates based on the first corrected motion state and the initial coordinates of the hair particle, which has been described in detail in the previous embodiment and will not be repeated here.

[0094] In the steps of this embodiment, virtual hair particles are constructed to constrain hair tip particles, thereby improving the motion stability of the hair tip particles and enhancing the visual effect of the hair rendering image.

[0095] Of course, it is understandable that the two methods of obtaining simulation coordinates in the embodiments corresponding to Figures 10 and 11 above can also be used in combination. That is, in one possible implementation method, the first corrected motion state and the second corrected motion state corresponding to the hair particle are respectively obtained, and then the initial coordinates are transformed based on the first corrected motion state and the second corrected motion state in sequence to obtain simulation coordinates, thereby obtaining more accurate simulation coordinates and improving the visual effect of the hair rendering image.

[0096] Step S204: obtaining a simulated pose of the guide hair according to the simulated coordinates of at least two hair particles of the guide hair.

[0097] Optionally, after step S204, the method further includes:

[0098] Step S205: Obtain constraint information of the guide hairs, and correct the simulation pose according to the constraint information to obtain a corrected simulation pose, wherein the constraint information is used to limit the hair length and / or hair shape of the guide hairs, and / or the distance between at least two guide hairs.

[0099] For example, the guide hairs may also be configured with constraint information, which is used to limit the length and / or shape of the guide hairs, and / or the distance between at least two guide hairs. More specifically, for example, the constraint information is used to limit the length of the guide hairs to within a preset length range; the constraint information is used to limit the shape of the guide hairs, such as curvature, to within a preset curvature range, thereby ensuring the actual authenticity of the guide hairs; and the constraint information is used to limit the distance between the guide hairs to be greater than a length threshold, thereby ensuring the rationality of the guide hair distribution and improving the overall visual effect of the hair rendering image.

[0100] Furthermore, the constraint information for the guide hair can be pre-set as needed or automatically generated based on a human or animal appearance model, which will not be described in detail here. After obtaining the simulated pose, the simulated pose of the guide hair is corrected using the above constraint information to obtain a corrected simulated pose, thereby making the simulation result of the guide hair more realistic and improving the rendering effect of subsequent hair rendering images.

[0101] Step S206: obtaining motion information of the guide hair according to the simulated posture or the corrected simulated posture and the initial posture, wherein the motion information includes coordinate transformation vectors corresponding to the hair particles constituting the guide hair.

[0102] In the embodiment shown in FIG2 , a specific implementation method for determining motion information based on the simulated pose and initial pose of the guided hairline has been described, which is similar to the specific implementation method for determining motion information based on the corrected simulated pose and initial pose in the steps of this embodiment. Details will not be repeated here, and reference may be made to the specific description under the relevant steps in the embodiment shown in FIG2 .

[0103] Optionally, after step S206, the method further includes:

[0104] Step S207: Obtaining guidance data corresponding to the hair strand data, and obtaining weighted motion information corresponding to each common hair strand based on the guidance data. The guidance data is used to characterize the mapping relationship and mapping weight between the guidance hair strand and the corresponding common hair strand.

[0105] Exemplarily, the guidance data is data that characterizes the mapping relationship and mapping weight between the guide hair strands and the corresponding ordinary hair strands, wherein the guidance data may be data included in the hair strand data or may be independent data corresponding to the hair strand data. In one possible implementation, the guidance data includes an index identifier corresponding to each guide hair strand and a hair strand identifier of the ordinary hair strand corresponding to each guide hair strand. Furthermore, the guidance data also includes a mapping right corresponding to each ordinary hair strand, wherein the mapping right is, for example, a normalized value that characterizes the degree to which the ordinary hair strand is affected by the movement of the guide hair strand, with a value range of, for example, (0, 1). After weighting the motion information corresponding to each ordinary hair strand using the mapping weight, weighted motion information corresponding to each ordinary hair strand is obtained.

[0106] FIG13 is a schematic diagram of generating weighted motion information provided by an embodiment of the present disclosure. As shown in FIG13 , the corresponding motion information generated based on the simulated posture of the guide hair A is motion information Info_A, which is used to rotate the guide hair 30 degrees counterclockwise. Based on the guidance data, the normal hair strands corresponding to the guide hair strand A include normal hair strand A_1, normal hair strand A_2, and normal hair strand A_3 (shown as A_1, A_2, and A_3 in the figure), and the mapping weight coef_w corresponding to normal hair strand A_1 is 1, the mapping weight coef_w corresponding to normal hair strand A_2 is 0.7, and the mapping weight coef_w corresponding to normal hair strand A_1 is 0.3. Based on the guidance data, weighted motion information Info_A1 is generated for normal hair strand A_1, which is used to rotate normal hair strand A_1 counterclockwise by 30 degrees (shown as 30 in the figure, the same below). The weighted motion information Info_A2 is generated for normal hair strand A_2, which is used to rotate normal hair strand A_2 counterclockwise by 21 degrees (the product of 30 degrees and a weight coefficient of 0.7, the same below). The weighted motion information Info_A3 is generated for normal hair strand A_3, which is used to rotate normal hair strand A_3 counterclockwise by 9 degrees.

[0107] In this embodiment, the mapping weights of the ordinary hair corresponding to the guide hair are further determined through the guide data, thereby making the expression styles of the ordinary hair more diverse, increasing the hair details, and improving the rendering effect of the hair rendering image.

[0108] Step S208: simulating the initial posture of the normal hair based on the motion information or the weighted motion information to obtain a simulated posture of the normal hair.

[0109] In a possible implementation, as shown in FIG14 , the specific implementation of step S208 includes:

[0110] Step S2081: Based on the correspondence between the guide hair and the ordinary hair, obtain the hair particle points of the ordinary hair corresponding to the hair particle points of the guide hair.

[0111] Step S2082: Obtain the target coordinate change vector corresponding to the hair particle of each ordinary hair according to the weighted motion information or the weighted motion information.

[0112] Step S2083: obtaining the simulation coordinates corresponding to the hair particle points of the ordinary hair based on the coordinate changes of the hair particle points of the ordinary hair and the corresponding initial coordinates.

[0113] Step S2084: obtaining a simulated pose of the ordinary hair according to the simulated coordinates of at least two hair particles of the ordinary hair.

[0114] For example, based on the guidance data, the hair particles of the ordinary hair strands corresponding to the hair particles of the corresponding guide hair strands are obtained. The number of hair particles of each ordinary hair strand is the same as the number of hair particles of the corresponding guide hair strand. Therefore, based on the particle index of the hair particle point and the particle index of the hair particle point of the ordinary hair strand, the hair particle point of the ordinary hair strand corresponding to the hair particle point can be obtained. Subsequently, based on the weighted motion information or the weighted motion information containing the coordinate change vector corresponding to the hair particle point of each guide hair strand, the target coordinate change vector corresponding to the hair particle point of each ordinary hair strand is obtained based on the mapping relationship determined in the previous step. The specific implementation of the coordinate change vector has been described in the relevant steps of the embodiment shown in FIG. 2 and will not be repeated here. Furthermore, the initial coordinates corresponding to the hair particles of the ordinary hair are transformed by the target coordinate change vector, so that the motion information of the guide hair is transferred to the corresponding ordinary hair, so that the ordinary hair performs a similar motion to the guide hair, and the simulation coordinates corresponding to the hair particles of the ordinary hair are obtained. Then, based on the set of simulation coordinates of the hair particles of at least two ordinary hairs of each ordinary hair, the simulation posture of the ordinary hair is obtained.

[0115] Step S209: performing image rendering based on the simulated pose of ordinary hair to obtain a hair rendering image.

[0116] In this embodiment, the implementation of step S204 and step 209 has been introduced in step S102 and step 104 in the embodiment shown in FIG. 2 , and will not be repeated here.

[0117] Corresponding to the hair treatment method of the above embodiment, FIG15 is a structural block diagram of a hair treatment device provided by an embodiment of the present disclosure. For ease of illustration, only the parts relevant to the embodiment of the present disclosure are shown. Referring to FIG15 , the hair treatment device 3 includes:

[0118] An acquisition module 31 is configured to acquire hair data, where the hair data is used to represent the initial position of the guide hair and the initial position of the common hair corresponding to the guide hair;

[0119] A simulation module 32 is used to simulate the guide hair based on the hair data to obtain a simulated pose of the guide hair;

[0120] A processing module 33 is configured to obtain motion information of the guide hair according to the simulated pose and the initial pose, wherein the motion information represents a posture change characteristic of the simulated pose of the guide hair relative to the initial pose;

[0121] The rendering module 34 is configured to obtain a hair rendering image based on the motion information and the initial position of the normal hair.

[0122] In one embodiment of the present disclosure, the hair data includes initial coordinates of hair particles constituting the guide hair; the simulation module 32 is specifically configured to: obtain a particle motion state of the hair particles of the guide hair, wherein the particle motion state represents a velocity and / or acceleration of the hair particles; obtain simulation coordinates based on the initial coordinates of the hair particles and the corresponding particle motion state; and obtain a simulated pose of the guide hair based on the simulation coordinates of at least two hair particles of the guide hair.

[0123] In one embodiment of the present disclosure, the particle motion state includes a first motion speed of the hair particle. When the simulation module 32 obtains the simulation coordinates based on the initial coordinates of the hair particle and the corresponding particle motion state, it is specifically used to: obtain a first attenuation speed corresponding to the hair particle based on the first motion speed of the hair particle; correct the particle motion state of the hair particle based on the first attenuation speed to obtain a first corrected motion state; and obtain the simulation coordinates based on the initial coordinates of the hair particle and the corresponding first corrected motion state.

[0124] In one embodiment of the present disclosure, the hair particles of the guiding hair include hair tip particles. When the simulation module 32 obtains the simulation coordinates based on the initial coordinates of the hair particles and the corresponding particle motion states, it is specifically used to: generate a virtual hair particle after the hair tip particles of the guiding hair; obtain a second decay speed corresponding to the hair tip particles based on the position constraint relationship between the virtual hair particle and the hair tip particles, wherein the direction of the second decay speed is opposite to the direction of the line connecting the adjacent hair particles from the hair tip particles to the hair tip particles; correct the particle motion state of the hair particle based on the second decay speed to obtain a second corrected motion state; and obtain the simulation coordinates based on the initial coordinates of the hair particle and the corresponding second corrected motion state.

[0125] In one embodiment of the present disclosure, the rendering module 34 is specifically configured to: simulate the initial posture of ordinary hair based on motion information to obtain a simulated posture of ordinary hair; and perform image rendering based on the simulated posture of ordinary hair to obtain a hair rendering image.

[0126] In one embodiment of the present disclosure, the motion information includes coordinate transformation vectors corresponding to the hair particles constituting the guide hair, and the initial posture includes the initial coordinates of at least two hair particles of the ordinary hair. When the rendering module 34 simulates the initial posture of the ordinary hair based on the motion information to obtain the simulated posture of the ordinary hair, it is specifically configured to: obtain the hair particles of the ordinary hair corresponding to the guide hair in the ordinary hair corresponding to the guide hair; obtain the coordinate change vectors corresponding to the hair particles of each ordinary hair according to the motion information; obtain the simulated coordinates corresponding to the hair particles of the ordinary hair based on the coordinate change amount and the corresponding initial coordinates of the hair particles of the ordinary hair; and obtain the simulated posture of the ordinary hair according to the simulated coordinates of the hair particles of the at least two ordinary hair.

[0127] In one embodiment of the present disclosure, the initial posture includes the initial coordinates of at least two hair particles corresponding to the guide hair; the simulation posture includes the simulation coordinates of at least two hair particles corresponding to the guide hair; the processing module 33 is specifically used to: obtain the coordinate transformation vector of the hair particle based on the initial coordinates and the corresponding simulation coordinates of the hair particle; and obtain the motion information of the guide hair based on the coordinate change vectors of the at least two hair particles.

[0128] In one embodiment of the present disclosure, the acquisition module 31 is further configured to: obtain guidance data corresponding to the hair strand data, the guidance data being used to characterize the mapping relationship and mapping weights between the guide hair strands and the corresponding ordinary hair strands; and the rendering module 34 is specifically configured to: obtain weighted motion information corresponding to each ordinary hair strand based on the guidance data; and obtain a hair strand rendered image based on the weighted motion information of the ordinary hair strands and the initial pose of the ordinary hair strands.

[0129] In one embodiment of the present disclosure, after simulating the guide hair based on the hair data to obtain a simulated pose of the guide hair, the simulation module 32 is further configured to: obtain constraint information of the guide hair, where the constraint information is used to limit the length and / or shape of the guide hair, and / or the distance between at least two guide hairs; and correct the simulated pose based on the constraint information to obtain a corrected simulated pose. The processing module 33 is specifically configured to: obtain motion information of the guide hair based on the corrected simulated pose and the initial pose of the guide hair.

[0130] The acquisition module 31, simulation module 32, processing module 33 and rendering module 34 are connected in sequence. The hair processing device 3 provided in this embodiment can implement the technical solution of the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.

[0131] FIG16 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. As shown in FIG16 , the electronic device 4 includes:

[0132] A processor 41, and a memory 42 communicatively connected to the processor 41;

[0133] Memory 42 stores computer-executable instructions;

[0134] The processor 41 executes the computer-executable instructions stored in the memory 42 to implement the hair processing method in the embodiments shown in Figures 2 to 14.

[0135] Optionally, the processor 41 and the memory 42 are connected via a bus 43 .

[0136] The relevant explanations can be understood by referring to the relevant descriptions and effects corresponding to the steps in the embodiments corresponding to Figures 2 to 14, and no further details will be given here.

[0137] An embodiment of the present disclosure provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are executed by a processor, they are used to implement the hair processing method provided in any of the embodiments corresponding to Figures 2 to 14 of the present disclosure.

[0138] The present disclosure provides a computer program product, including a computer program. When the computer program is executed by a processor, the computer program implements the hair treatment method in the embodiments shown in FIG. 2 to FIG. 14 .

[0139] Referring to FIG17 , a schematic diagram of the structure of an electronic device 900 suitable for implementing an embodiment of the present disclosure is shown. The electronic device 900 may be a terminal device or a server. The terminal device may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, personal digital assistants (PDAs), tablet computers (Portable Android Devices, PADs), portable multimedia players (PMPs), vehicle-mounted terminals (e.g., vehicle-mounted navigation terminals), and fixed terminals such as digital TVs and desktop computers. The electronic device shown in FIG17 is merely an example and should not limit the functionality and scope of use of the embodiments of the present disclosure.

[0140] As shown in FIG17 , the electronic device 900 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage device 908 into a random access memory (RAM) 903. Various programs and data required for the operation of the electronic device 900 are also stored in the RAM 903. The processing device 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.

[0141] Typically, the following devices may be connected to the I / O interface 905: an input device 906 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 907 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 908 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 909. The communication device 909 may allow the electronic device 900 to communicate with other devices wirelessly or by wire to exchange data. Although FIG. 17 shows an electronic device 900 having various devices, it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have alternatively.

[0142] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network via the communication device 909, or installed from the storage device 908, or installed from the ROM 902. When the computer program is executed by the processing device 901, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.

[0143] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, 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 above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or component. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, radio frequency (RF), etc., or any suitable combination thereof.

[0144] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0145] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the method shown in the above embodiment.

[0146] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet Service Provider).

[0147] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0148] The units involved in the embodiments described in this disclosure may be implemented in software or hardware. In some cases, the name of a unit does not limit the unit itself. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses."

[0149] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.

[0150] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can 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 can 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.

[0151] The above description is merely a preferred embodiment of the present disclosure and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but also includes other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned disclosed concepts. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this disclosure.

[0152] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details have been included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0153] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.

Claims

1. A hair treatment method, include: Acquire hair data, and divide the hair data into guide hair and common hair; Processing the guide hair based on its initial posture to obtain a simulated posture of the guide hair; According to the simulation posture and the initial posture of the guide hair, motion information of the guide hair is obtained, wherein the motion information represents a posture change feature of the simulation posture of the guide hair relative to the initial posture of the guide hair; A hair rendering image is obtained according to the motion information and the initial position and posture of the ordinary hair.

2. The method according to claim 1, wherein the initial posture of the guide hair is processed to obtain the simulated posture of the guide hair, include: Acquiring a particle motion state of the hair particle guiding the hair, wherein the particle motion state represents a motion speed and / or motion acceleration of the hair particle; According to the initial coordinates of the hair particles and the corresponding particle motion states, a simulation coordinate is obtained; The simulated position and posture of the guide hair is obtained according to the simulated coordinates of at least two hair particle points of the guide hair.

3. The method according to claim 2, wherein the particle motion state comprises a first motion speed of the hair particle, and the simulation coordinates are obtained according to the initial coordinates of the hair particle and the corresponding particle motion state. include: According to the first movement speed of the hair particle, a first attenuation speed corresponding to the hair particle is obtained; Correcting the particle motion state of the hair particle according to the first decay speed to obtain a first corrected motion state; The simulation coordinates are obtained according to the initial coordinates of the hair particle and the corresponding first corrected motion state.

4. The method according to claim 2, wherein the at least two hair particle points of the guiding hair include a hair tip particle point, and the simulation coordinates are obtained according to the initial coordinates of the hair particle points and the corresponding particle point motion states, include: Setting a virtual hair particle of the guide hair, wherein the virtual hair particle is located in an extension direction of one side of the hair tip particle of the guide hair; According to the position constraint relationship between the virtual hair particle point and the hair tip particle point, a second decay speed corresponding to the hair tip particle point is obtained, wherein the direction of the second decay speed is opposite to the direction of the line connecting the hair tip particle point to the adjacent hair particle point of the hair tip particle point; The particle motion state of the hair particle is corrected according to the second attenuation speed to obtain a second corrected motion state; The simulation coordinates are obtained according to the initial coordinates of the hair particle and the corresponding second corrected motion state.

5. The method according to any one of claims 1 to 4, wherein the hair rendering image is obtained according to the motion information and the initial position of the ordinary hair, include: Based on the motion information, the initial posture of the ordinary hair is processed to obtain a simulated posture of the ordinary hair; Image rendering is performed based on the simulated posture of the ordinary hair to obtain the hair rendering image.

6. The method according to claim 5, wherein The initial posture of the ordinary hair is simulated based on the motion information to obtain a simulated posture of the ordinary hair, include: Based on the correspondence between the guide hair and the ordinary hair, obtaining the hair particle points of the ordinary hair corresponding to the hair particle points of the guide hair; According to the motion information, a coordinate change corresponding to the hair particle of the ordinary hair is obtained; Based on the coordinate change of the hair particle point of the ordinary hair and the initial coordinate of the hair particle point of the ordinary hair, the simulation coordinate corresponding to the hair particle point of the ordinary hair is obtained; The simulated position and posture of the common hair is obtained according to the simulated coordinates of at least two hair particles of the common hair.

7. The method according to any one of claims 1 to 6, wherein the initial position of the guide hair comprises the initial coordinates of at least two hair particles corresponding to the guide hair; and the simulation position comprises the simulation coordinates of the at least two hair particles corresponding to the guide hair; The obtaining the motion information of the guide hair according to the simulation posture and the initial posture of the guide hair comprises: Obtaining a coordinate transformation amount of the hair particle point according to the initial coordinates of the hair particle point and the corresponding simulation coordinates; The motion information of the guide hair is obtained according to the coordinate changes of at least two of the hair particles.

8. The method according to any one of claims 1 to 7, further comprising: include: Acquire guide data corresponding to the hair data, wherein the guide data is used to characterize a mapping relationship and a mapping weight between the guide hair and the corresponding ordinary hair; The step of obtaining a hair rendering image according to the motion information and the initial position of the ordinary hair includes: Obtaining weighted motion information corresponding to each of the common hairs according to the guidance data; A hair rendering image is obtained according to the weighted motion information of the common hair and the initial position and posture of the common hair.

9. The method according to any one of claims 1 to 8, wherein after the guide hair is processed based on the hair data to obtain the simulated pose of the guide hair, include: Acquiring constraint information of the guide hair, wherein the constraint information is used to limit the hair length and / or hair shape of the guide hair, and / or the distance between at least two of the guide hairs; Correcting the simulation pose according to the constraint information to obtain a corrected simulation pose; The obtaining the motion information of the guide hair according to the simulation posture and the initial posture of the guide hair comprises: The motion information of the guide hair is obtained according to the corrected simulation posture of the guide hair and the initial posture of the guide hair.

10. A hair treatment device, include: An acquisition module, used for acquiring hair data and dividing the hair data into guide hair and ordinary hair; A simulation module, used for processing the guide hair based on its initial posture to obtain a simulation posture of the guide hair; a processing module, configured to obtain motion information of the guide hair according to the simulated pose and the initial pose of the guide hair, wherein the motion information represents a posture change feature of the simulated pose of the guide hair relative to the initial pose of the guide hair; A rendering module is used to obtain a hair rendering image according to the motion information and the initial position of the ordinary hair.

11. An electronic device, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the hair processing method according to any one of claims 1 to 9.

12. A computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when a processor executes the computer-executable instructions, the hair processing method according to any one of claims 1 to 9 is implemented.

13. A computer program, comprising computer executable instructions, and when a processor executes the computer executable instructions, the hair processing method according to any one of claims 1 to 9 is implemented.

14. A computer program product, wherein the computer program product stores computer-executable instructions, and when a processor executes the computer-executable instructions, the hair processing method according to any one of claims 1 to 9 is implemented.

Citation Information

Patent Citations

  • Data-driven real-time hair motion simulation method

    CN103942090A

  • Data processing method and device based on hair image

    CN112862807A

  • Hair processing method and device, electronic equipment and computer readable storage medium

    CN115294256A

  • Hair processing method and device, electronic equipment and storage medium

    CN116416360A

  • Dynamic detail adaptive hair modeling and editing

    US10685499B1