Hair model processing method and device based on physical simulation, equipment and medium

Through the hair model processing method based on physical simulation, using stress parameters and differential adjustment technology, the problem of inefficient hair styling processing is solved, and efficient and real hair styling treatment is achieved.

CN119693539AInactive Publication Date: 2025-03-25NEW SIGHT DIGITAL TECH CO LTD SHANDONG
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411671428.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-21
Publication Date
2025-03-25
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Traditional hair styling treatment methods rely on manual adjustments, which leads to inefficiency in handling complex hair styling and difficult to achieve ideal results.

Method used

The hair model processing method based on physical simulation is adopted, and the hair model to be processed is obtained, the stress parameters are determined, and the data of multiple simulated hair models are used for differential adjustments to generate simulated morphological data.

Benefits of technology

While maintaining the sense of reality, it greatly reduces the calculation amount and processing time, improves the overall efficiency and operability of hair styling processing, and improves the authenticity and detailed performance of hair styling processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119693539A_ABST
    Figure CN119693539A_ABST
Patent Text Reader

Abstract

The invention provides a hair model processing method and device based on physical simulation, electronic equipment and a storage medium, and relates to the technical field of analogue simulation, and the method comprises the steps: obtaining a to-be-processed first hair model; determining a first stress parameter of a first hair model based on the modeling data of the target model, wherein the first hair model is arranged in the target model; a second hair model in the multiple simulated hair models is determined, the second hair model is any one simulated hair model in the multiple simulated hair models, and the similarity between a second stress parameter of the second hair model and the first stress parameter meets a preset condition; calling simulation form data of the second hair model; based on the difference condition of the first stress parameter and the second stress parameter, adjusting the simulation form data to obtain simulation form data of the first hair model. The hair styling device can improve the hair styling treatment efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of simulation, and in particular to a hair model processing method, device, equipment and medium based on physical simulation. Background Art

[0002] With the development of computer graphics, hair styling technology has been widely used in film and television production, game design, virtual reality and other fields. This technology uses complex algorithms and rendering techniques to simulate realistic hair effects, enhancing the realism of characters and scenes. In film and television production, hair styling technology helps animated characters and special effects scenes to be more vivid and enhances the audience's visual experience; in game design, realistic hair effects make game characters more attractive and interactive. Through continuous technological innovation and optimization, hair styling processing plays an increasingly important role in these fields.

[0003] Traditional hair styling methods mainly rely on manual adjustment. Although they can simulate the real effect of hair to a certain extent, manual adjustment takes a lot of time and effort, and requires adjusting the position and shape of each hair. This leads to low efficiency when processing complex hair styling and difficulty in achieving ideal results. Therefore, a method is needed to improve the efficiency of hair styling. Summary of the invention

[0004] The present application provides a hair model processing method, device, equipment and medium based on physical simulation, which can improve the efficiency of hair styling processing.

[0005] In a first aspect of the present application, a hair model processing method based on physical simulation is provided, the method comprising: Acquire a first hair model to be processed; determining a first force parameter of the first hair model based on modeling data of a target model, wherein the first hair model is set on the target model; Determine a second hair model among the multiple simulated hair models, where the second hair model is any one of the multiple simulated hair models, and similarity between a second force parameter of the second hair model and the first force parameter meets a preset condition; Retrieving the simulation morphology data of the second hair model; Based on the difference between the first force parameter and the second force parameter, the simulation morphology data is adjusted to obtain the simulation morphology data of the first hair model.

[0006] By adopting the above technical solution, combined with the method of physical simulation and difference adjustment, the hair model data under various force conditions is pre-calculated and stored, and the force difference of feature points is used to directly adjust the hair shape, thus avoiding complex real-time physical simulation calculations. This method can significantly reduce the amount of calculation and processing time while maintaining realism through preset force parameters and rapid adjustment, thereby improving the overall efficiency and operability of hair styling processing.

[0007] Optionally, the determining the first force parameter of the first hair model based on the modeling data of the target model specifically includes: Acquiring first motion data of the target model; determining a first influencing parameter of the first predefined motion data on the first hair model; Acquire first geometric parameters of the first hair model; The first force parameter is generated based on the first influencing parameter and the first geometric parameter.

[0008] By adopting the above technical solution, the motion data, influencing parameters and geometric parameters of the target model are accurately analyzed to generate accurate force parameters, thereby achieving real force simulation of the hair model under various motion conditions. This method ensures that the hair model can show realistic physical behavior in the simulation, improves the authenticity and detail expression of hair modeling, and optimizes the processing efficiency, making the hair simulation more natural and dynamic.

[0009] Optionally, before determining the second hair model among the multiple simulated hair models, the method further includes: Obtain hair motion videos captured by multiple cameras; Acquire the simulated hair of each video frame included in the marked hair motion video; Acquire second motion data of a user corresponding to the simulated hair in the hair motion video; Determining a second influencing parameter of the predefined second motion data on the simulated hair; Acquiring a second geometric parameter of the simulated hair; The second force parameter is generated based on the second influencing parameter and the second geometric parameter.

[0010] By adopting the above technical solution, multiple cameras shoot and accurately mark hair movement videos, and combine the user's movement data, impact parameters and geometric parameters to generate multiple force parameters of simulated hair models. This method ensures that the force simulation of the simulated hair model in various complex motion scenes is more accurate and diverse, improves the realism of the simulated hair model, and makes the hair styling process more realistic.

[0011] Optionally, before retrieving the simulation morphology data of the second hair model, the method further includes: Extracting a plurality of simulation feature points of the simulated hair; Determine the simulation position data of the simulation feature points at each moment, the simulation morphology data being a collection of the simulation position data; The simulated hair model is constructed according to the simulated morphological data.

[0012] By adopting the above technical solution, multiple feature points of simulated hair are extracted and their simulated position data at each moment are determined, and a detailed simulated hair model is constructed. This process ensures that the simulated hair model can accurately reflect the dynamic form of hair in various motion states, thereby improving the accuracy and realism of hair modeling, making the final generated hair model closer to the actual situation in terms of visual effects and physical behavior.

[0013] Optionally, determining the simulation position data of the simulation feature point at each moment specifically includes: Obtaining a first projection matrix of a first camera and a second projection matrix of a second camera, wherein the first camera and the second camera are any two cameras among the plurality of cameras; Acquire a first coordinate of the simulation feature point in the image plane of the first camera, and acquire a second coordinate of the simulation feature point in the image plane of the second camera; The simulation position data is calculated based on the first projection matrix, the second projection matrix, the first coordinate and the second coordinate, and is calculated by solving the following formula: ; Wherein, (X, Y, Z) is the simulation position data, (x1, y1) is the first coordinate, (x2, y2) is the second coordinate, P1 mn is the first projection matrix, P2 mn is the second projection matrix, m,n∈(1,2,3,4).

[0014] By adopting the above technical solution, using the projection matrix of multiple cameras and the coordinates of feature points on the image plane, the multi-view geometry method is used to accurately calculate the position data of the simulated feature points in three-dimensional space. This method can accurately reconstruct the three-dimensional form of simulated hair at each moment, improve the accuracy and realism of the hair simulation model, provide high-quality basic data for hair modeling processing, and ensure that the final hair dynamic effect is more realistic and detailed.

[0015] Optionally, the determining a second hair model among the multiple simulated hair models specifically includes: Calculating the force difference between each of the first force parameters and the corresponding second force parameter; Calculate an average value based on the multiple force differences to obtain a force mean value; It is determined whether the mean force value is greater than or equal to a preset difference. If the mean force value is greater than or equal to the preset difference, the simulated hair model corresponding to the second force parameter is the second hair model.

[0016] By adopting the above technical solution, the force differences between the various simulated hair models are compared, the average value is calculated, and compared with the preset difference, so as to screen out a second hair model with a force similar to that of the first hair model. The simulated hair model that matches the force condition of the target model can be effectively determined, ensuring the authenticity and accuracy of the hair simulation, thereby improving the efficiency and accuracy of the hair styling process.

[0017] Optionally, adjusting the simulation morphology data based on the difference between the first force parameter and the second force parameter to obtain the simulation morphology data of the first hair model specifically includes: Based on the first force parameter, determining a first force value of a first feature point included in the first hair model; Based on the second force parameter, determining a second force value of a second feature point corresponding to the first feature point, the second hair model including the second feature point; Calculating a target force difference value according to the first force value and the second force value; Determine a distance adjustment parameter corresponding to the target force difference, where the distance adjustment parameter is an adjustment parameter of the first feature point; Acquire initial position data of the second feature point according to the simulation morphology data; According to the initial position data and the adjustment parameters, the adjustment position data is obtained, and a set of a plurality of the adjustment position data is the simulation morphology data.

[0018] By adopting the above technical solution, the force parameter difference between the first hair model and the second hair model is compared, and the force difference is calculated and applied to adjust the simulation morphology data, thereby obtaining the simulation morphology data of the first hair model. The hair model can be accurately adjusted according to different force conditions to ensure that the simulation morphology data is consistent with the actual force conditions, thereby improving the authenticity and accuracy of the hair modeling process, and making the final hair model closer to the actual situation in terms of visual effects and physical behavior.

[0019] In a second aspect of the present application, a hair model processing device based on physical simulation is provided, the device comprising an acquisition module, a processing module and a judgment module, wherein: The acquisition module is used to acquire a first hair model to be processed; The processing module is used to determine a first force parameter of the first hair model based on modeling data of a target model, wherein the first hair model is set on the target model; The judgment module is used to determine a second hair model among the multiple simulated hair models, where the second hair model is any one of the multiple simulated hair models, and the similarity between the second force parameter of the second hair model and the first force parameter meets a preset condition; The acquisition module is used to retrieve the simulation morphological data of the second hair model; The processing module is used to adjust the simulation morphology data based on the difference between the first force parameter and the second force parameter to obtain the simulation morphology data of the first hair model.

[0020] Optionally, the acquisition module is used to acquire first motion data of the target model; The judgment module is used to determine a predefined first influence parameter of the first motion data on the first hair model; The acquisition module is used to acquire the first geometric parameter of the first hair model; The processing module is used to generate the first force parameter based on the first influencing parameter and the first geometric parameter.

[0021] Optionally, the acquisition module is used to acquire hair movement videos captured by multiple cameras; The acquisition module is used to acquire the simulated hair of each video frame included in the marked hair motion video; The acquisition module is used to acquire the second motion data of the user corresponding to the simulated hair in the hair motion video; The judging module is used to determine a second influencing parameter of the predefined second motion data on the simulated hair; The acquisition module is used to acquire the second geometric parameter of the simulated hair; The processing module is used to generate the second force parameter based on the second influencing parameter and the second geometric parameter.

[0022] Optionally, the acquisition module is used to extract a plurality of simulation feature points of the simulated hair; The processing module is used to determine the simulation position data of the simulation feature points at each moment, and the simulation morphology data is a collection of the simulation position data; The processing module is used to construct the simulated hair model according to the simulated morphological data.

[0023] Optionally, the acquisition module is used to acquire a first projection matrix of a first camera and a second projection matrix of a second camera, wherein the first camera and the second camera are any two cameras among the plurality of cameras; The acquisition module is used to acquire the first coordinates of the simulation feature point in the image plane of the first camera, and acquire the second coordinates of the simulation feature point in the image plane of the second camera; The processing module is used to calculate the simulation position data based on the first projection matrix, the second projection matrix, the first coordinate and the second coordinate, and solves and calculates by the following formula: ; Wherein, (X, Y, Z) is the simulation position data, (x1, y1) is the first coordinate, (x2, y2) is the second coordinate, P1 mn is the first projection matrix, P2 mn is the second projection matrix, m,n∈(1,2,3,4).

[0024] Optionally, the processing module is used to calculate the force difference between each first force parameter and the corresponding second force parameter; The processing module is used in the judging module to calculate an average value based on a plurality of the force differences to obtain a force mean value; The judgment module is used to judge whether the average force value is greater than or equal to a preset difference. If the average force value is greater than or equal to the preset difference, the simulated hair model corresponding to the second force parameter is the second hair model.

[0025] Optionally, the processing module is used to determine a first force value of a first feature point included in the first hair model based on the first force parameter; The processing module is configured to determine, based on the second force parameter, a second force value of a second feature point corresponding to the first feature point, wherein the second hair model includes the second feature point; The processing module is used to calculate a target force difference value according to the first force value and the second force value; The processing module is used to determine a distance adjustment parameter corresponding to the target force difference, where the distance adjustment parameter is an adjustment parameter of the first feature point; The acquisition module is used to acquire the initial position data of the second feature point according to the simulation morphology data; The processing module is used to obtain the adjusted position data according to the initial position data and the adjustment parameters, and a set of multiple adjusted position data is the simulated morphology data.

[0026] In the third aspect of the present application, an electronic device is provided, including a processor, a memory, a user interface and a network interface, the memory is used to store instructions, the user interface and the network interface are both used to communicate with other devices, and the processor is used to execute the instructions stored in the memory so that the electronic device executes any one of the methods described above.

[0027] In a fourth aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores instructions, and when the instructions are executed, any of the methods described above is executed.

[0028] In summary, one or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages: This application combines physical simulation and difference adjustment methods, pre-calculates and stores hair model data under various force conditions, and directly adjusts the hair shape using the force differences of feature points, thereby avoiding complex real-time physical simulation calculations. This method can significantly reduce the amount of calculation and processing time while maintaining realism through preset force parameters and rapid adjustment, thereby improving the overall efficiency and operability of hair styling processing. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1 It is a flow chart of a hair model processing method based on physical simulation disclosed in an embodiment of the present application; Figure 2 It is a module schematic diagram of a hair model processing device based on physical simulation disclosed in an embodiment of the present application; Figure 3 It is a structural schematic diagram of an electronic device disclosed in an embodiment of the present application.

[0030] Explanation of the reference numerals: 201, acquisition module; 202, processing module; 203, judgment module; 301, processor; 302, communication bus; 303, user interface; 304, network interface; 305, memory. DETAILED DESCRIPTION

[0031] In order to enable technicians in this field to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this application, not all of the embodiments.

[0032] In the description of the embodiments of the present application, words such as "for example" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "for example" or "for example" is intended to present related concepts in a specific way.

[0033] In the description of the embodiments of the present application, the meaning of the term "multiple" refers to two or more. For example, multiple systems refer to two or more systems, and multiple screen terminals refer to two or more screen terminals. In addition, the terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. The terms "include", "comprise", "have" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.

[0034] With the development of computer graphics, hair styling technology has been widely used in film and television production, game design, virtual reality and other fields. Through complex algorithms and rendering techniques, this technology can simulate realistic hair effects and enhance the realism of characters and scenes. However, although the traditional manual adjustment method can simulate the real effect of hair to a certain extent, it is time-consuming and labor-intensive, inefficient, and difficult to handle complex hair styling because it requires adjusting the position and shape of hair strands one by one. Therefore, a method is needed to improve the efficiency of hair styling processing.

[0035] This embodiment discloses a hair model processing method based on physical simulation. Figure 1 , including the following steps: S110, obtaining a first hair model to be processed.

[0036] The hair model processing method based on physical simulation disclosed in the embodiment of the present application is applied to a server, and the server includes but is not limited to electronic devices such as mobile phones, tablet computers, wearable devices, PCs (Personal Computers), etc., and can also be a background server running a hair model processing method based on physical simulation. The server can be implemented as an independent server or a server cluster composed of multiple servers.

[0037] The embodiment of the present application relates to a hair model, including a first hair model and a simulation hair model, both of which are long-hair models in a modeling scene, that is, the length of the hair model has a first geometric parameter greater than 30 cm. The target model refers to a character model in the modeling scene, and the hair model of the target model is the first hair model.

[0038] S120: Determine a first force parameter of the first hair model based on the modeling data of the target model.

[0039] In a possible implementation, determining a first force parameter of a first hair model based on modeling data of a target model specifically includes: acquiring first motion data of the target model; determining a first influence parameter of a predefined first motion data on the first hair model; acquiring a first geometric parameter of the first hair model; and generating a first force parameter based on the first influence parameter and the first geometric parameter.

[0040] Specifically, based on actual scenarios, factors that affect the movement of human hair include gravity: gravity has a significant impact on the overall movement and droop of hair, determining the natural droop and swinging effect of hair. Wind and air resistance: external wind and air resistance will affect the swing and flutter of hair. Physical properties of hair: including the mass, length, elasticity and stiffness of hair, which determine the degree of curvature and movement of hair. Collision and interaction: Collisions and interactions between hair and between hair and other objects (such as body, clothing, etc.) need to be considered to avoid hair penetration or unnatural interweaving.

[0041] According to the movement of the constructed target model in the actual scene, the actions of the target model in the motion data are analyzed, such as the rotation and tilt of the head, the jumping and running of the character, etc. These actions have a great influence on the force and movement of the hair. The motion data includes the specific head rotation angle, tilt angle, jump height and running speed of the target model. Based on these motion data, they are converted into the first influencing parameters predefined for the first hair model. The first influencing parameters include gravity influencing parameters, acceleration influencing parameters, and angular velocity influencing parameters. This conversion process can be realized through physical engines such as Bullet Physics and PhysX, and will not be further elaborated here.

[0042] The first geometric parameters of the hair model are exported from the 3D modeling software. The first geometric parameters usually include the length, density, curvature, connected mass points and elastic properties of the hair. The focus is on the mass point position, that is, the three-dimensional coordinates of each mass point in the hair model. Finally, based on the first influence parameter and the first geometric parameter, the first force parameter is generated, that is, the total force data of each mass point is calculated by combining the motion data and the first geometric parameter.

[0043] S130: Determine a second hair model among a plurality of simulated hair models.

[0044] In a possible embodiment, before determining the second hair model among multiple simulated hair models, the method also includes: obtaining a captured hair movement video; obtaining simulated hair in each video frame contained in the marked hair movement video; obtaining second motion data of the user corresponding to the simulated hair in the hair movement video; determining a second influencing parameter of the predefined second motion data on the simulated hair; obtaining second geometric parameters of the simulated hair; and generating second force parameters based on the second influencing parameter and the second geometric parameters.

[0045] Specifically, in order to make the movement of the first hair model more realistic, the real hair movement is photographed, and motion data is constructed based on the real hair movement, thereby controlling the movement of the first hair model to achieve automated styling processing.

[0046] Therefore, it is necessary to prepare a certain number of simulation morphological change data of different simulation hair models in advance. The simulation hair model is a model built based on real hair movement.

[0047] First, use high-frame rate, high-resolution video equipment (such as professional cameras, etc.) to shoot hair movement videos from multiple different angles to capture the hair movement of people in specific actions (head rotation, tilt, jump, run, etc.), and ensure that the shooting angle can clearly capture the movement of hair. Then convert the hair movement video containing real simulated hair into multiple video frames, which can be processed by extracting frames, and extract one video frame from every three consecutive video frames. Use image annotation tools (such as LabelMe, VGG Image Annotator) to manually mark the hair in each frame. The marking method can be polygons, points, lines, etc. The marked multiple frames of simulated hair do not necessarily have to be the same real hair, because the movement of hair will affect each other, and the movement of adjacent strands of hair can be almost regarded as the same, so the marked simulated hair only needs to be similar.

[0048] Use a motion capture system (such as Vicon, OptiTrack) to synchronously collect the user's motion data in the hair motion video, usually including the position information, speed and acceleration of the user's head. Analyze the user's motion data, such as head rotation, tilt, character jumping, running, etc., which have a great impact on the force and movement of the hair. Use the physics engine to simulate the second motion data to simulate the second influencing parameters of the hair. The second influencing parameters include gravity influencing parameters, acceleration influencing parameters, and angular velocity influencing parameters.

[0049] Furthermore, the force parameters of the first hair model (first force parameters) and the force parameters of the second hair model (second force parameters) are obtained from the previous step. Each force parameter can be represented by a vector F1 (first force parameter) and F2 (second force parameter), where F i =|Fi , x , F i , y , F i , z | represents the components in the x, y, and z directions. For each corresponding mass point, calculate the difference between the first force parameter and the second force parameter ΔF=F1−F2. The specific calculation formula is: ΔF x =F1, x −F2, x , ΔF y =F1, y −F2, y , ΔF z =F1, z −F2, z Finally, based on ΔF x , ΔF y , ΔF z Calculate the Euclidean distance and get the difference vector.

[0050] According to the formula in the previous step, calculate the force difference of all mass points, store the force difference of all mass points in a set, and calculate the average value. Define a preset difference threshold as a benchmark for judging whether the force mean meets the condition. Compare the force mean with the preset difference to judge whether the condition is met. If the condition is met, confirm that the simulated hair model corresponding to the second force parameter is the second hair model, which is used to adjust the first hair model.

[0051] S140, retrieving simulation morphological data of the second hair model.

[0052] In a possible embodiment, before calling the simulation morphological data of the second hair model, the method also includes: extracting multiple simulation feature points of the simulated hair; determining the simulation position data of the simulation feature points at each moment, where the simulation morphological data is a collection of simulation position data; and constructing a simulated hair model based on the simulation morphological data.

[0053] Specifically, according to the simulated hair obtained in step S130, multiple key feature points are selected from the simulated hair. These simulated feature points can be the root, end, middle key nodes, etc. of the hair. The root feature point is usually fixed on the scalp and is used to determine the starting point of the hair. The end feature point is the end of the hair and is used to observe the final movement state of the hair. The middle feature point is a point evenly distributed along the length of the hair, which is used to capture the deformation and bending of the hair.

[0054] You can manually mark key frames or use automatic marking algorithms to extract the key points of hair in each frame. These key points are the simulation feature points. At the same time, ensure that the timestamps of all video frames are synchronized so that the simulation positions of feature points at different times can be uniformly calculated. Ensure that the time of all cameras is synchronized. You can use synchronization signals or timestamp calibration tools to ensure that each frame of video has an accurate timestamp.

[0055] Then use feature matching algorithms (such as SIFT, SURF, ORB) to match feature points under different camera angles. Ensure the correspondence between the same physical point under different camera angles. Perform camera calibration to obtain the camera's intrinsic parameters (such as focal length, optical center position, distortion coefficient) and extrinsic parameters (such as rotation matrix and translation vector). You can use calibration algorithms such as Zhang Zhengyou calibration method.

[0056] The triangulation method solves the three-dimensional coordinates of the feature points based on the projection matrices of the two cameras and the image coordinates of the corresponding feature points. The projection matrix contains the intrinsic and extrinsic parameters of the camera. Using multi-view geometry technology (triangulation method), the coordinates of the feature points in three-dimensional space are calculated through the perspectives of different cameras.

[0057] First, obtain the first projection matrix of the first camera and the second projection matrix of the second camera. The first camera and the second camera are any two cameras from multiple cameras. When processing dynamic scenes, the camera may shoot from multiple positions and angles, and each shooting position and angle has a corresponding projection matrix. These projection matrices are different because the position (external parameters) and possible internal settings (intrinsic parameters) of the camera change. In a multi-camera system, each camera has its own projection matrix. These matrices are defined according to their respective intrinsic and extrinsic parameters and are used to shoot the same scene from their respective perspectives. Projection matrix Pi mn It is usually expressed as: P = K[R|t], where K is the camera's intrinsic parameter matrix, which describes the camera's internal properties (focal length, principal point offset, distortion coefficient, etc.). R|t is the camera's extrinsic parameter matrix, which consists of a rotation matrix R and a translation vector t, describing the camera's rotation and translation relative to the world coordinate system.

[0058] The function of the projection matrix is ​​to transform a point (X, Y, Z) in the three-dimensional world coordinate system into a point (x, y) in the two-dimensional image coordinate system. The formula is as follows: ; This means: ; Where λ is a scaling factor. For the first camera, its projection matrix is ​​P1 mn , for the second camera, its projection matrix is ​​P2mn .

[0059] From the perspective of the first camera, the following equations are available: ; From the perspective of the first camera, the following equations are available: ; The above four equations can be used to solve the three-dimensional coordinates (X, Y, Z). By expressing these equations in matrix form and solving them, the exact position of the three-dimensional point can be obtained.

[0060] To make it clearer, we can rewrite the equation as follows: ; Among them, (X, Y, Z) is the simulation position data, (x1, y1) is the first coordinate, (x2, y2) is the second coordinate, P1 mn is the first projection matrix, P2 mn is the second projection matrix, m,n∈(1,2,3,4).

[0061] This is an overdetermined system of equations (usually more than three equations to determine three unknowns), which can be solved by optimization methods such as least squares method to obtain the simulation position data of the simulation feature points.

[0062] Suppose in a multi-view system, there are two cameras A and B. The projection matrix of each camera is as follows: S150, adjusting the simulation morphology data based on the difference between the first force parameter and the second force parameter to obtain simulation morphology data of the first hair model.

[0063] In a possible implementation, based on the difference between the first force parameter and the second force parameter, the simulation morphological data is adjusted to obtain the simulation morphological data of the first hair model, specifically including: determining a first force value of a first feature point included in the first hair model based on the first force parameter; determining a second force value of a second feature point corresponding to the first feature point based on the second force parameter, wherein the second hair model includes the second feature point; calculating a target force difference based on the first force value and the second force value; determining a distance adjustment parameter corresponding to the target force difference, wherein the distance adjustment parameter is an adjustment parameter of the first feature point; obtaining initial position data of the second feature point based on the simulation morphological data; obtaining adjusted position data based on the initial position data and the adjustment parameter, wherein a collection of multiple adjusted position data is the simulation morphological data.

[0064] Specifically, force parameters are extracted from the first hair model, and the force value of each first feature point is determined according to the first feature point (such as the root, the end, and the key node) in the selected first hair model to obtain the first force value. For details, reference can be made to the step of determining the force parameters in step S120. Similarly, force parameters are extracted from the second hair model, and the force value of each second feature point is determined according to the second feature point (such as the root, the end, and the key node) in the selected second hair model to obtain the second force value. Find the second feature point corresponding to the feature point in the first hair model in the second hair model, and for each feature point, calculate the difference between the first force value and the second force value. Force difference formula: ΔF=F1−F2, where F1 is the first force value, F2 is the second force value, and ΔF is the force difference.

[0065] Establish the mapping relationship between the force difference and the distance adjustment parameter in advance, the mapping formula is: Δd=f(ΔF), the mapping relationship here can be obtained by fitting the experimental data or simulation data, or it can be determined by a simple proportional relationship. Finally, calculate the distance adjustment parameter of each first feature point according to the force difference, that is, the movement amount of the first feature point in the three directions of XYZ in the three-dimensional space.

[0066] Extract the initial position of each feature point in the second hair model from the simulation data, usually a three-dimensional coordinate point. Calculate the adjusted position of each feature point based on the initial position and the adjustment parameter. Adjustment formula: P new =P in +Δd·n, where P new To adjust the position, P in is the adjusted position, Δd is the adjustment parameter, and n is the unit vector of the force direction of the first feature point. All the adjusted position data are collected to obtain the simulated morphological data of the hair model under the new force condition, and the adjusted position data of all feature points are integrated into an overall hair morphological model.

[0067] By adopting the technical solution of the present application, the physical simulation and difference adjustment methods are combined, the hair model data under various force conditions are pre-calculated and stored, and the force difference of the feature points is used to directly adjust the hair shape, thereby avoiding complex real-time physical simulation calculations. This method can significantly reduce the amount of calculation and processing time while maintaining realism through preset force parameters and rapid adjustment, thereby improving the overall efficiency and operability of hair styling processing.

[0068] This embodiment also discloses a hair model processing device based on physical simulation, referring to Figure 2 The device includes an acquisition module 201, a processing module 202 and a judgment module 203, wherein: The acquisition module 201 is used to acquire a first hair model to be processed.

[0069] The processing module 202 is used to determine a first force parameter of a first hair model based on modeling data of a target model, and the first hair model is set on the target model.

[0070] The judgment module 203 is used to determine a second hair model among multiple simulated hair models, where the second hair model is any one of the multiple simulated hair models, and the similarity between the second force parameter of the second hair model and the first force parameter meets a preset condition.

[0071] The acquisition module 201 is used to retrieve the simulation morphological data of the second hair model.

[0072] The processing module 202 is used to adjust the simulation morphology data based on the difference between the first force parameter and the second force parameter to obtain the simulation morphology data of the first hair model.

[0073] In a possible implementation, the acquisition module 201 is configured to acquire first motion data of the target model.

[0074] The judgment module 203 is used to determine a first influencing parameter of the predefined first motion data on the first hair model.

[0075] The acquisition module 201 is used to acquire first geometric parameters of a first hair model.

[0076] The processing module 202 is used to generate a first force parameter based on the first influencing parameter and the first geometric parameter.

[0077] In a possible implementation, the acquisition module 201 is used to acquire hair movement videos captured by multiple cameras.

[0078] The acquisition module 201 is used to acquire the simulated hair of each video frame included in the marked hair motion video.

[0079] The acquisition module 201 is used to acquire second motion data of the user corresponding to the simulated hair in the hair motion video.

[0080] The judgment module 203 is used to determine a second influence parameter of the predefined second motion data on the simulated hair.

[0081] The acquisition module 201 is used to acquire the second geometric parameters of the simulated hair.

[0082] The processing module 202 is used to generate a second force parameter based on the second influencing parameter and the second geometric parameter.

[0083] In a possible implementation, the acquisition module 201 is used to extract a plurality of simulation feature points of the simulated hair.

[0084] The processing module 202 is used to determine the simulation position data of the simulation feature points at each moment, and the simulation morphology data is a collection of the simulation position data.

[0085] The processing module 202 is used to construct a simulated hair model according to the simulated morphological data.

[0086] In a possible implementation, the acquisition module 201 is used to acquire a first projection matrix of a first camera and a second projection matrix of a second camera, where the first camera and the second camera are any two cameras from a plurality of cameras.

[0087] The acquisition module 201 is used to acquire the first coordinates of the simulation feature point on the image plane of the first camera, and acquire the second coordinates of the simulation feature point on the image plane of the second camera.

[0088] The processing module 202 is used to calculate the simulation position data based on the first projection matrix, the second projection matrix, the first coordinate and the second coordinate, and solve the calculation by the following formula: ; Among them, (X, Y, Z) is the simulation position data, (x1, y1) is the first coordinate, (x2, y2) is the second coordinate, P1 mn is the first projection matrix, P2 mn is the second projection matrix, m,n∈(1,2,3,4).

[0089] In a possible implementation, the processing module 202 is used to calculate the force difference between each first force parameter and the corresponding second force parameter.

[0090] The processing module 202 is used for the judging module 203, which is used for calculating an average value according to a plurality of force differences to obtain a force mean value.

[0091] The judgment module 203 is used to judge whether the average force value is greater than or equal to the preset difference. If the average force value is greater than or equal to the preset difference, the simulated hair model corresponding to the second force parameter is the second hair model.

[0092] In a possible implementation, the processing module 202 is configured to determine a first force value of a first feature point included in the first hair model based on the first force parameter.

[0093] The processing module 202 is used to determine a second force value of a second feature point corresponding to the first feature point based on a second force parameter, and the second hair model includes the second feature point.

[0094] The processing module 202 is used to calculate a target force difference value according to the first force value and the second force value.

[0095] The processing module 202 is used to determine a distance adjustment parameter corresponding to the target force difference, where the distance adjustment parameter is an adjustment parameter of the first feature point.

[0096] The acquisition module 201 is used to acquire the initial position data of the second feature point according to the simulation morphology data.

[0097] The processing module 202 is used to obtain adjusted position data according to the initial position data and the adjustment parameters, and a set of multiple adjusted position data is the simulation morphology data.

[0098] It should be noted that: when the device provided in the above embodiment realizes its function, only the division of the above functional modules is used as an example. In actual application, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0099] This embodiment also discloses an electronic device, referring to Figure 3 The electronic device may include: at least one processor 301 , at least one communication bus 302 , a user interface 303 , a network interface 304 , and at least one memory 305 .

[0100] The communication bus 302 is used to realize the connection and communication between these components.

[0101] The user interface 303 may include a display screen (Display) and a camera (Camera). Optionally, the user interface 303 may also include a standard wired interface and a wireless interface.

[0102] The network interface 304 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).

[0103] Among them, the processor 301 may include one or more processing cores. The processor 301 uses various interfaces and lines to connect various parts in the entire server, and executes various functions of the server and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 305, and calling data stored in the memory 305. Optionally, the processor 301 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 301 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 301, and it can be implemented separately through a chip.

[0104] The memory 305 may include a random access memory (RAM) or a read-only memory (ROM). Optionally, the memory includes a non-transitory computer-readable storage medium. The memory 305 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 305 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 305 may also be at least one storage device located away from the aforementioned processor 301. The memory 305 as a computer storage medium may include an operating system, a network communication module, a user interface 303 module, and an application program for a hair model processing method based on physical simulation.

[0105] exist Figure 3In the electronic device shown, the user interface 303 is mainly used to provide an input interface for the user and obtain data input by the user; and the processor 301 can be used to call an application program stored in the memory 305 for a hair model processing method based on physical simulation. When executed by one or more processors 301, the electronic device executes one or more methods in the above-mentioned embodiments.

[0106] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the order of the actions described, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required for the present application.

[0107] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0108] In the several embodiments provided in this application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some service interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.

[0109] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0110] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0111] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a memory 305 and includes several instructions for a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned memory 305 includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk.

[0112] The present application also discloses a computer-readable storage medium, wherein the computer-readable storage medium stores instructions. When executed by one or more processors 301, the electronic device executes one or more of the methods described in the above embodiments.

[0113] The above is only an exemplary embodiment of the present disclosure, and the scope of the present disclosure cannot be limited thereto. That is, any equivalent changes and modifications made according to the teachings of the present disclosure are still within the scope of the present disclosure. After considering the disclosure of the specification and practice, those skilled in the art will easily think of other embodiments of the present disclosure. This application is intended to cover any variation, use or adaptive change of the present disclosure, which follows the general principles of the present disclosure and includes common knowledge or customary technical means in the technical field not recorded in the present disclosure. The description and examples are regarded as exemplary only, and the scope and spirit of the present disclosure are defined by the claims.

Claims

1. A hair model processing method based on physical simulation, characterized in that: The method comprises: Acquire a first hair model to be processed; determining a first force parameter of the first hair model based on modeling data of a target model, wherein the first hair model is set on the target model; Determine a second hair model among the multiple simulated hair models, where the second hair model is any one of the multiple simulated hair models, and similarity between a second force parameter of the second hair model and the first force parameter meets a preset condition; Retrieving the simulation morphology data of the second hair model; Based on the difference between the first force parameter and the second force parameter, the simulation morphology data is adjusted to obtain the simulation morphology data of the first hair model.

2. The hair model processing method based on physical simulation according to claim 1, characterized in that: The determining the first force parameter of the first hair model based on the modeling data of the target model specifically includes: Acquiring first motion data of the target model; determining a first influencing parameter of the first predefined motion data on the first hair model; Acquire first geometric parameters of the first hair model; The first force parameter is generated based on the first influencing parameter and the first geometric parameter.

3. The hair model processing method based on physical simulation according to claim 1, characterized in that: Before determining the second hair model among the plurality of simulated hair models, the method further comprises: Obtain hair motion videos captured by multiple cameras; Acquire the simulated hair of each video frame included in the marked hair motion video; Acquire second motion data of a user corresponding to the simulated hair in the hair motion video; Determining a second influencing parameter of the predefined second motion data on the simulated hair; Acquiring a second geometric parameter of the simulated hair; The second force parameter is generated based on the second influencing parameter and the second geometric parameter.

4. The hair model processing method based on physical simulation according to claim 3, characterized in that: Before calling the simulation morphological data of the second hair model, the method further includes: Extracting a plurality of simulation feature points of the simulated hair; Determine the simulation position data of the simulation feature points at each moment, the simulation morphology data being a collection of the simulation position data; The simulated hair model is constructed according to the simulated morphological data.

5. The hair model processing method based on physical simulation according to claim 4, characterized in that: Determining the simulation position data of the simulation feature points at each moment specifically includes: Obtaining a first projection matrix of a first camera and a second projection matrix of a second camera, wherein the first camera and the second camera are any two cameras among the plurality of cameras; Acquire a first coordinate of the simulation feature point in the image plane of the first camera, and acquire a second coordinate of the simulation feature point in the image plane of the second camera; The simulation position data is calculated based on the first projection matrix, the second projection matrix, the first coordinate and the second coordinate, and is calculated by solving the following formula: ; Wherein, (X, Y, Z) is the simulation position data, (x1, y1) is the first coordinate, (x2, y2) is the second coordinate, P1 mn is the first projection matrix, P2 mn is the second projection matrix, m,n∈(1,2,3,4).

6. The hair model processing method based on physical simulation according to claim 1, characterized in that: The determining of a second hair model among the plurality of simulated hair models specifically comprises: Calculating the force difference between each of the first force parameters and the corresponding second force parameter; Calculate an average value based on the multiple force differences to obtain a force mean value; It is determined whether the mean force value is greater than or equal to a preset difference. If the mean force value is greater than or equal to the preset difference, the simulated hair model corresponding to the second force parameter is the second hair model.

7. The hair model processing method based on physical simulation according to claim 1, characterized in that: The adjusting the simulation morphology data based on the difference between the first force parameter and the second force parameter to obtain the simulation morphology data of the first hair model specifically includes: Based on the first force parameter, determining a first force value of a first feature point included in the first hair model; Based on the second force parameter, determining a second force value of a second feature point corresponding to the first feature point, the second hair model including the second feature point; Calculating a target force difference value according to the first force value and the second force value; Determine a distance adjustment parameter corresponding to the target force difference, where the distance adjustment parameter is an adjustment parameter of the first feature point; Acquire initial position data of the second feature point according to the simulation morphology data; According to the initial position data and the adjustment parameters, the adjustment position data is obtained, and a set of a plurality of the adjustment position data is the simulation morphology data.

8. A hair model processing device based on physical simulation, characterized in that: The device comprises an acquisition module (201), a processing module (202) and a judgment module (203), wherein: The acquisition module (201) is used to acquire a first hair model to be processed; The processing module (202) is used to determine a first force parameter of the first hair model based on modeling data of a target model, the first hair model being arranged on the target model; The judgment module (203) is used to determine a second hair model among the multiple simulated hair models, the second hair model being any one of the multiple simulated hair models, and the similarity between the second force parameter of the second hair model and the first force parameter meets a preset condition; The acquisition module (201) is used to retrieve the simulation morphological data of the second hair model; The processing module (202) is used to adjust the simulation morphology data based on the difference between the first force parameter and the second force parameter to obtain the simulation morphology data of the first hair model.

9. An electronic device, characterized in that: The electronic device comprises a processor (301), a memory (305), a user interface (303), a network interface (304) and a memory (305), wherein the memory (305) is used to store instructions, the user interface (303) and the network interface (304) are both used to communicate with other devices, and the processor (301) is used to execute the instructions stored in the memory (305) so that the electronic device executes the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed, the method according to any one of claims 1 to 7 is performed.

Citation Information

Cited By

  • Hair curling simulation methods, devices, electronic equipment and storage media

    CN122571969A