A hair strand model reconstruction method, device, storage medium and computer program product

CN122906247APending Publication Date: 2026-10-13MIGU CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611055534.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-15
Publication Date
2026-10-13

AI Technical Summary

Technical Problem

[0003]然而,采用直接替换或投影的方式,或采用启发式手段进行外推的方式,处理穿模点在头模局部凹陷区域或发丝密集区域,容易出现修复后的发丝穿模修复失败以及发丝结构扭曲的问题

Benefits of technology

[0010]本申请提供一种发丝模型重建方法、设备、存储介质及计算机程序产品,该方法包括:获取初始发丝模型对应的各发丝节点的初始位置信息;构建目标函数和/或几何约束项,并以目标函数和/或几何约束项作为约束条件,调整初始位置信息,得到各发丝节点的目标位置信息;其中,目标函数用于评估初始发丝模型与调整后的发丝模型的形态相似性,几何约束项用于约束目标位置信息处于初始发丝模型绑定的三维头模之外;基于目标位置信息,确定重建后的发丝模型。采用上述实现方案,在获取到发丝模型各发丝节点的初始位置信息之后,通过构造两种约束函数,针对各发丝节点的初始位置信息进行调整时,以调整后的各发丝节点的位置信息在三维头模之外,且要求调整后的发丝模型与初始发丝模型形态相似作为约束条件,得到各发丝模型最终的目标位置信息。若以该目标位置信息重构发丝模型,因目标位置信息满足在三维头模之外,且与初始发丝模型的形态相似,从而重构的发丝模型能够在保证视觉自然性的前提下消除发丝穿模现象。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122906247A_ABST
    Figure CN122906247A_ABST
Patent Text Reader

Abstract

The application provides a hair strand model reconstruction method, device, storage medium and computer program product. The method comprises the following steps: obtaining initial position information of each hair strand node corresponding to an initial hair strand model; constructing a target function and / or a geometric constraint term, and adjusting the initial position information by taking the target function and / or the geometric constraint term as a constraint condition to obtain target position information of each hair strand node; wherein the target function is used to evaluate the shape similarity between the initial hair strand model and the adjusted hair strand model, and the geometric constraint term is used to constrain the target position information to be outside a three-dimensional head model bound by the initial hair strand model; and determining a reconstructed hair strand model based on the target position information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and in particular to a method, apparatus, storage medium, and computer program product for reconstructing a hair model. Background Technology

[0002] In related technologies, the binding methods for digital human hair models and 3D head models typically employ two approaches. One approach is a geometric backtracking strategy based on simple projection or nearest-point replacement. This involves directly projecting the penetration point onto the surface of the 3D head model after detecting that a hair node has penetrated the 3D head model, or replacing the original position with the nearest point on the 3D head model, thereby correcting the penetration point. The other approach is a hair structure adjustment strategy based on heuristic post-processing, which aims to keep the hair away from the interior of the 3D head model.

[0003] However, using direct replacement or projection methods, or using heuristic extrapolation to handle the clipping point in the local concave area of ​​the head mold or the dense hair area, can easily lead to problems such as failed clipping repair and hair structure distortion. Summary of the Invention

[0004] In view of this, embodiments of this application provide a method, apparatus, storage medium, and computer program product for reconstructing a hair model, which can eliminate the phenomenon of hair clipping while ensuring visual naturalness.

[0005] The technical solution of this application is implemented as follows: In a first aspect, this application provides a method for reconstructing a hair model, the method comprising: Obtain the initial position information of each hair node corresponding to the initial hair model; Construct an objective function and / or geometric constraints, and use the objective function and / or geometric constraints as constraints to adjust the initial position information to obtain the target position information of each hair node; wherein, the objective function is used to evaluate the morphological similarity between the initial hair model and the adjusted hair model, and the geometric constraints are used to constrain the target position information to be outside the three-dimensional head model bound to the initial hair model; Based on the target location information, the reconstructed hair model is determined.

[0006] Secondly, this application provides a hair model reconstruction device, the device comprising: The acquisition unit is used to acquire the initial position information of each hair node corresponding to the initial hair model; A construction unit is used to construct an objective function and / or geometric constraints, and to adjust the initial position information using the objective function and / or the geometric constraints as constraints to obtain the target position information of each hair node; wherein, the objective function is used to evaluate the morphological similarity between the initial hair model and the adjusted hair model, and the geometric constraints are used to constrain the target position information to be outside the three-dimensional head model bound to the initial hair model; The determining unit is used to determine the reconstructed hair model based on the target location information.

[0007] Thirdly, this application provides a hair model reconstruction device, the device comprising: a processor and a memory; the processor implements the above-described hair model reconstruction method when executing the running program stored in the memory.

[0008] Fourthly, this application provides a storage medium storing a computer program thereon, which, when executed by a processor, implements the above-described hair model reconstruction method.

[0009] Fifthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the above-described hair model reconstruction method.

[0010] This application provides a method, device, storage medium, and computer program product for reconstructing a hair model. The method includes: obtaining the initial position information of each hair node corresponding to an initial hair model; constructing an objective function and / or geometric constraints, and using the objective function and / or geometric constraints as constraints to adjust the initial position information to obtain the target position information of each hair node; wherein, the objective function is used to evaluate the morphological similarity between the initial hair model and the adjusted hair model, and the geometric constraints are used to constrain the target position information to be outside the three-dimensional head model bound to the initial hair model; and determining the reconstructed hair model based on the target position information. Using the above implementation scheme, after obtaining the initial position information of each hair node of the hair model, by constructing two constraint functions, when adjusting the initial position information of each hair node, the constraint condition is that the adjusted position information of each hair node is outside the three-dimensional head model, and the adjusted hair model is required to be morphologically similar to the initial hair model, thus obtaining the final target position information of each hair model. If the hair model is reconstructed using the target location information, since the target location information is outside the three-dimensional head model and similar in shape to the initial hair model, the reconstructed hair model can eliminate the hair clipping phenomenon while ensuring visual naturalness. Attached Figure Description

[0011] Figure 1 This is a schematic flowchart of a hair model reconstruction method provided in an embodiment of this application; Figure 2This is a schematic diagram of the overall process of a hair model reconstruction method provided in an embodiment of this application; Figure 3 A schematic diagram of the composition structure of a hair model reconstruction device provided in this application embodiment. Figure 1 ; Figure 4 A schematic diagram of the composition structure of a hair model reconstruction device provided in this application embodiment. Figure 2 . Detailed Implementation

[0012] In order to gain a more detailed understanding of the features and technical content of the embodiments of this application, the technical solution of this application will be further described in detail below with reference to the accompanying drawings and specific embodiments. The accompanying drawings are for reference only and are not intended to limit the embodiments of this application.

[0013] Unless otherwise defined, all technical and scientific terms used in the embodiments of this application have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in the embodiments of this application is for the purpose of describing the embodiments of this application only and is not intended to limit this application.

[0014] In the following description, references to "some embodiments" refer to a subset of all possible embodiments. It is understood that "some embodiments" may be the same or different subsets of all possible embodiments and may be combined with each other without conflict. It should also be noted that the terms "first / second / third" used in the embodiments of this application are merely for distinguishing similar objects and do not represent a specific ordering of objects. It is understood that "first / second / third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein.

[0015] In related technologies, the methods for binding hair models to 3D head models mainly include the following two categories: The first type of method is a geometric backtracking strategy based on simple projection or nearest-point replacement. This type of method, upon detecting a hairline node penetrating the head mold, directly projects the penetration point onto the head mold surface, or replaces the original position with the nearest point on the head mold, thereby correcting the penetration point. Typically, ray detection or a signed distance field (SDF) is used to determine whether the point is located inside the head mold; if it is a penetration point, nearest-point projection is used to eliminate internal penetration.

[0016] The second type of method is a heuristic post-processing-based hair structure adjustment strategy. After the initial hair binding is complete, this type of method heuristically adjusts the hair shape, such as through local filtering, curvature constraints, or spatial stretching, to move the hair away from the head mold's interior. Some methods combine this with simple extrapolation based on the head mold's normal direction, but most lack rigorous constraint modeling. The adjustment process relies on fixed parameters and manual rules, lacking generalization ability.

[0017] Disadvantages of related technologies: Among related technologies, the hair-through-mold repair method suffers from the following key problems, which severely restrict the stability and geometric fidelity of this method in complex digital human scenarios: 1. Lack of optimized modeling in clipping repair. Currently, most clipping points are handled by direct replacement or projection, without modeling the position adjustment process of hair nodes from a global optimization perspective. It is impossible to make a reasonable trade-off between "externality" constraints (i.e., constraints to prevent clipping) and "smoothness" requirements (i.e., maintaining the curve shape). The repair quality depends on the local geometry of the projection points, and artifacts such as curve abrupt changes and jumps are prone to occur.

[0018] 2. Lack of clear constraint modeling and solution mechanisms. Currently, there is a lack of mathematical modeling for the physical and geometric constraint that "hair strands must be located outside the head mold," and extrapolation is only performed using heuristic methods, which is difficult to generalize to arbitrary head mold shapes. Especially in local concave areas or areas with dense hair strands in the head mold, problems such as repair failure or structural distortion are prone to occur.

[0019] 3. Severe distortion of hair strand shape. Methods based on nearest-point replacement or direct projection usually cannot maintain the continuity and natural curvature of the original hair structure, especially when the clipping points are densely distributed. After repair, the hair strands will show unnatural bends, sudden contractions, or reverse curls, which seriously affect the visual realism and hairstyle consistency.

[0020] 4. Root node fixation cannot be considered holistically. Some methods lack handling for the fixation of hair root nodes, which may cause the hair to drift as a whole during the repair process, destroying the attachment relationship with the scalp and reducing the quality of subsequent animation binding or rendering.

[0021] This application addresses the problems in related technologies, such as hair structure easily becoming clipped after being attached to the head mold surface, lack of optimized modeling in the repair process, and abrupt changes in hair curvature. It proposes a three-dimensional hair clipping repair method based on normal constraint quadratic programming optimization. The overall idea of ​​this method is to use the root node of each hair model as a fixed anchor point, construct rigid inequality constraints using the normal vector of the head mold surface (ensuring that the hair nodes are outside the three-dimensional head mold), and combine this with second-order smoothing regularization to establish a constrained minimization optimization model (ensuring that the curvature remains consistent with the original hair model). While preserving the continuity of hair morphology, it forcibly constrains all non-root nodes to be located outside the head mold surface, thereby efficiently eliminating the clipping problem while ensuring visual naturalness. This method is independent of the specific head mold topology, possesses good versatility and geometric adaptability, and is particularly suitable for the fine-tuning of digital human hair structures under complex head mold conditions.

[0022] The detailed technical solutions of this application embodiment are as follows: This application provides a method for reconstructing a hair model, such as... Figure 1 As shown, this method aims to achieve automated repair of the curvature structure of hair models attached to the surface of a 3D head model when clipping occurs. This repair is characterized by high geometric accuracy and strong morphological continuity, ensuring that the hair remains completely outside the 3D head model while preserving its natural shape, thus meeting the requirements of high-quality digital human modeling and rendering. It effectively solves the problems of traditional clipping repair methods, which rely on projection replacement or heuristic extrapolation and lack optimized modeling and curvature preservation mechanisms, easily leading to hair deformation distortion, structural abrupt changes, or detachment from the scalp. This method may include: S101. Obtain the initial position information of each hair node corresponding to the initial hair model.

[0023] In this embodiment of the application, the initial hair model can also be referred to as the hair model to be repaired.

[0024] In this embodiment, the initial hair model consists of multiple hair nodes, which are connected sequentially to form the initial hair model.

[0025] In this embodiment of the application, before preprocessing the initial hair model using the constructed objective function and / or geometric constraint terms, it is necessary to obtain the initial position information of each hair node corresponding to the initial hair model. Specifically, the initial position information of each hair node corresponding to the initial hair model can be obtained by the following method: based on the preset hair reconstruction algorithm or the preset animation model binding result, the initial position information of each hair node corresponding to the initial hair model is generated.

[0026] In the embodiments of this application, the initial position information is usually represented in the form of coordinates, such as the three-dimensional coordinates of each hair node.

[0027] In the embodiments of this application, the three-dimensional coordinates of each hair node in the initial three-dimensional hair model can usually be obtained through a three-dimensional hair reconstruction algorithm or the binding result of an animation model.

[0028] In the embodiments of this application, the three-dimensional hair reconstruction algorithm can automatically generate the approximate spatial distribution of each three-dimensional hair model and provide the initial position information of each hair node of the specific three-dimensional hair model.

[0029] In this embodiment of the application, the animation model binding result can be based on the manual production of the artist. That is, if the artist has completed the animation binding of the hair model and the character, the initial position of each hair node of the initial three-dimensional hair model can be read directly from the motion binding model.

[0030] In this embodiment of the application, the three-dimensional coordinates of each hair node in the initial three-dimensional hair model are usually stored in .ply format. In this embodiment of the application, the three-dimensional coordinates of each hair node stored in .ply format are used as the input of the algorithm in the subsequent position adjustment process.

[0031] It should be noted that, in this embodiment of the application, the stored data of each hair node in the initial hair model has the following characteristics: 1. All initial 3D hair models have been arranged in root-tip order; where the root is the side of the 3D hair model that is closest to the scalp of the 3D head model, and the tip is the end of the 3D hair model that is furthest from the scalp of the 3D head model.

[0032] 2. Each initial 3D hair model contains a fixed number of sampling nodes (i.e., hair nodes), usually N=100.

[0033] 3. The data of the initial 3D hair model is encoded in the vertex attribute of the PLY file in the form of point cloud, with a total number of sampling nodes of N×M, where M is the number of 3D hair strands.

[0034] It should be noted that this storage method is not limited to storing data related to the initial hair model, but is also applicable to storing the reconstructed 3D hair model.

[0035] S102. Construct the objective function and / or geometric constraint terms, and use the objective function and / or geometric constraint terms as constraint conditions to adjust the initial position information and obtain the target position information of each hair node.

[0036] The objective function is used to evaluate the morphological similarity between the initial hair model and the adjusted hair model, while the geometric constraint term is used to constrain the target position information to be outside the 3D head model bound to the initial hair model.

[0037] In the embodiments of this application, the objective function may also be called a smoothness objective function (such as second-order difference regularization).

[0038] In the embodiments of this application, geometric constraint terms may also be referred to as geometric inequality constraint terms.

[0039] In this embodiment, during the repair process of a 3D hair model through a mold, in addition to ensuring that all hair nodes of each 3D hair do not penetrate the 3D head mold, it is also necessary to preserve the geometric shape of the original 3D hair model as much as possible to avoid obvious abrupt changes, broken lines, or shape distortions in the repair result. Therefore, this embodiment introduces a smoothness regularization term based on second-order difference as the main component of the optimization objective function. The specific process of constructing the objective function using the smoothness regularization term based on second-order difference is as follows: construct the first geometric parameter term corresponding to each hair node of the initial hair model, and the second geometric parameter term corresponding to each hair node of the adjusted hair model; construct the objective function based on the first and second geometric parameter terms.

[0040] In the embodiments of this application, each three-dimensional hair strand model is essentially a continuously varying curve in three-dimensional space, and its shape is determined by the spatial arrangement of each hair strand node. If the hair strand nodes are evenly distributed and have a natural direction, then it should have a small second-order difference change in a discrete sense.

[0041] It should be noted that the second-order difference is the difference of the first-order difference, and is used to measure the curvature of a point in a discrete sequence relative to its neighbors.

[0042] In this embodiment of the application, the second-order difference is defined as shown in the following formula (1): (1) in, It is the discrete second-order difference of the i-th intermediate hair node, used to measure the geometric offset of the hair node between its preceding and following hair nodes. This indicates the intermediate hair node. express The next hair node, express The previous hair node.

[0043] In this embodiment of the application, the aim of repairing clipping in a 3D hair model is to optimize the hair nodes. It can still maintain the curvature trend consistent with the corresponding hair nodes in the original three-dimensional hair model. In order to maintain the shape of the original three-dimensional hair model as much as possible during the optimization process, a smoothness objective function is introduced in this embodiment to penalize the difference between the structure of the optimized three-dimensional hair model and the structure of the original three-dimensional hair model. The objective function is composed of the first geometric parameter term (i.e., the first second-order difference) of each hair node corresponding to the constructed initial hair model, and the second geometric parameter term (i.e., the second second-order difference) of each hair node corresponding to the constructed adjusted hair model. The constructed first geometric parameter term and the second geometric parameter term are as shown in the aforementioned formula (1).

[0044] It should be noted that the aforementioned formula (1) represents the second geometric parameter term, but the first geometric parameter term is constructed in the same way.

[0045] Therefore, the final objective function can be expressed as the following formula (2): (2) Where N refers to the total number of hair nodes on each 3D hair model. This represents the second-order difference of the initial 3D hair model at the i-th hair node position. The second-order difference of the optimized 3D hair model at the corresponding i-th hair node position; This represents the Euclidean norm, which is the length of the vector.

[0046] In this embodiment, the objective function compares the local differences between the optimized 3D hair model and the original 3D hair model point by point. The optimized 3D hair model makes... Minimize the curvature characteristics of the original 3D hair model and avoid "straightening" or "distorting" the curves.

[0047] It should be noted that the credible logic of formula (2) can be understood as constraining the three-dimensional hair model in solving the clipping process by penalizing the change in the second-order difference (i.e., discrete curvature). Geometric deformation ensures that the optimized 3D hair strands retain their original curved shape as much as possible, avoiding unnatural folds or excessive straightening.

[0048] In one embodiment of this application, in order to improve the solution efficiency and cooperate with the geometric inequality constraint term joint modeling, the above loss function (i.e., the objective function, as shown in formula (2)) can also be transformed into a standard quadratic form expression, and the loop operation of calculating the difference for each hair node is transformed into a global matrix multiplication, that is, the objective function is constructed in another form. The specific implementation method is as follows: construct the position information matrix and sparse matrix of each hair node corresponding to the adjusted hair model, wherein the sparse matrix represents the calculation coefficients corresponding to each hair node; construct the first geometric parameter matrix of each hair node corresponding to the initial hair model; construct the objective function based on the position information matrix, the sparse matrix and the first geometric parameter matrix.

[0049] In this embodiment, each 3D hair model is assumed to consist of N hair nodes. In one case, this embodiment optimizes only the hair nodes other than the root node. The optimization variable is then denoted as the initial position information of the remaining hair nodes. The initial position information of each hair node in the optimization variable is arranged sequentially and flattened into a column vector. The specific construction method is as follows: ,in, .

[0050] In this embodiment of the application, a sparse matrix is ​​constructed, which can be denoted as A. , is used to represent the second-order difference structure of each internal hair node. The second-order difference structure refers to the coefficients arranged in a specific pattern in the sparse matrix A (essentially a one-dimensional discrete Laplace operator matrix). Each row of the sparse matrix A contains difference coefficients [1, -2, 1]. Thus, when matrix A is multiplied by the flattened hair node position vector p, the resulting vector is directly the second-order difference set of all internal hair nodes.

[0051] In this embodiment of the application, when constructing the first geometric parameter matrix, each parameter in the initial hair model is calculated sequentially. The three-dimensional second-order difference value, and each of the initial hair model structures The three-dimensional second-order difference values ​​are concatenated into a column vector. This yields the first geometric parameter matrix.

[0052] It should be noted that the three-dimensional second-order difference can be understood as calculating the second-order difference value of each hair node in the x, y, and z directions respectively.

[0053] It should be noted that, The calculation method can refer to the calculation method of the aforementioned formula (1), the only difference being that the position information of each hair node adopts the position information of each node of the initial hair model.

[0054] In this embodiment of the application, based on the above structural definitions, the smoothness objective function in the hair model repair process can be expressed as shown in the following formula (3): (3) It should be noted that the purpose of formula (3) above is to optimize p so that the optimized hair model fits the shape corresponding to b. The result is a vector, where each element represents the degree of curvature of the corresponding hair node. It can be simply understood that the total sum of squared errors between the "actual curvature" and the "ideal curvature" is calculated using the above formula (3), and the optimization goal is to make the curvature of the new hair model closer to b.

[0055] In this embodiment of the application, in order to jointly construct the overall optimization problem with the position constraint term (i.e., the geometric inequality constraint term), the above formula (3) can be further transformed into the standard quadratic programming form, as shown in the following formula (4): (4) in, , represents the quadratic term of the objective function after weighted regularization, where I refers to the identity matrix (a matrix with all 1s on the main diagonal and all 0s elsewhere). This represents the strength of the smoothing term (regularization factor).

[0056] ,in It is a vector formed by expanding the position information of each hair node except the root node in the initial hair model (before optimization).

[0057] It should be noted that the specific derivation process from formula (3) to formula (4) is as follows: When converting formula (3) into a standard quadratic programming form, in order to ensure stability near the hair root node, the original objective function can be implicitly modified. Add a pointer to the original position The regularization penalty term is applied to the convergence. The resulting initial objective function is shown in formula (5) below: (5) Expanding the above formula (5) (using the property that the square of a vector norm is equal to its transpose multiplied by itself), we get the following formula (6): (6) Continue multiplying to get the following formula (7): (7) In the optimization process of finding the extreme value, the constant term (the term that is independent of the unknown quantity p, such as...) , The constant term does not affect the gradient and can be omitted directly. After removing the constant term and reorganizing the quadratic and linear terms, we get the following formula (8): (8) At this time, ,make Then we can obtain the standard form of quadratic programming, namely formula (4).

[0058] It should be noted that this objective function has the following advantages: G is a symmetric positive definite matrix, which guarantees the convexity of the objective function.

[0059] It can be directly combined with linear inequality constraints (such as normal extrapolation) to form constrained quadratic programming problems, and is applicable to solvers such as quadprog and cvxpy.

[0060] Matrix modeling is highly versatile and adaptable to hair structures of any length.

[0061] In this embodiment, during the hair model clipping repair process, if only a smoothness objective function (such as a second-order difference) is used for optimization, although the smoothness of the curve can be maintained, it cannot guarantee that the repaired hair model will completely detach from the interior of the 3D head model. Therefore, this embodiment further introduces a geometric inequality constraint based on the normal of the 3D head model to ensure that the optimized hair nodes are always "outside" the surface of the 3D head model mesh in space, effectively avoiding clipping.

[0062] In this embodiment of the application, the specific construction process of the geometric inequality constraint term (i.e., the extrapolation constraint discovered based on the three-dimensional head model) is as follows: For each hair node, obtain the first position information corresponding to the first hair node closest to the initial position information of each hair node; obtain the target region of the first position information on the three-dimensional head model, and determine the normal vector of the target region; construct the geometric constraint term based on the normal vector, the first position information, and the target position information after adjusting the initial position information.

[0063] In this embodiment of the application, the three-dimensional head model can acquire the specific information of the three-dimensional head model while acquiring the position information of each hair node.

[0064] In this embodiment of the application, for each hair node to be optimized First, find the surface of the three-dimensional head model that matches... Recent hair node The coordinate information. Among them, determining... The specific method can be based on the shortest Euclidean distance from a point to the mesh. In practical engineering implementations, spatial acceleration data structures such as KD-Tree or BVH (hierarchical bounding box) are typically used to calculate the distance from the hair node to all faces on the surface of the 3D head model triangular mesh, and the intersection point of the surfaces corresponding to the minimum distance is taken as the nearest point. .

[0065] It should be noted that, This refers to all hair nodes involved in the optimization. In this embodiment, the anti-clipping constraint is universally applied to all hair nodes in the optimization model, ensuring that the optimizer can guarantee that the final generated overall hair shape will not experience new clipping phenomena at any position during global solution.

[0066] In the embodiments of this application, when determining Afterwards, and be able to obtain that Based on the triangular facet information of the 3D head model, determine the unit normal vector of that triangular facet. .

[0067] It should be noted that the 3D head model is composed of multiple triangular facets, and the specific method of determining the normal vectors of the triangular facets can be found in relevant technologies, which will not be elaborated here.

[0068] In this embodiment of the application, in order to ensure that the repaired hair node is located outside the normal vector, a geometric inequality constraint term as shown in the following formula (9) can be constructed: (9) in express and The inner product, , which is a very small number, to avoid calculation errors caused by coplanarity with the surface.

[0069] It should be noted that in formula (9) This indicates the position information of the hair node after adjustment.

[0070] It should be noted that, through the above vector dot product operation, the vector... It is a vector pointing from a point on the scalp surface of the 3D head model to a hair node. This is the unit normal vector pointing outward from the scalp surface of the 3D head model. The inner product of these two vectors is greater than 0, meaning that the angle between them is always acute. Geometrically, this strictly restricts the hair nodes to be located only within the half-space pointed to by the normal vector, thus explicitly ensuring that the nodes are located on the 'outer side' of the 3D head model.

[0071] This constraint forms a linear inequality for each hair node, and can also be expressed as the following formula (10): (10) In this embodiment of the application, after constructing the smoothness objective function and the geometric inequality constraint terms, the initial position information of each hair node is adjusted using the smoothness objective function and / or the geometric inequality constraint terms as constraint conditions to obtain the target position information of each hair node, that is, the optimized position information of each hair node. The specific method is as follows: under the constraint of the geometric constraint terms, the minimum value of the objective function is used as the condition for iteration, and the set of position information with the minimum value of the objective function is taken as the target position information of each hair node.

[0072] In this embodiment, the smoothness objective function and the anti-mating constraint (i.e., geometric inequality constraint term) are modeled as a unified quadratic programming problem with inequality constraints. This problem can be solved using a standard optimizer (such as quadprog), which outputs new position information for each hair node. This new position information satisfies both geometric fit and avoids mating distortion.

[0073] In practice, the smoothness objective function is the goal that the optimizer needs to minimize. This function can limit the optimizer to "keep the hair model in its original natural curvature as much as possible".

[0074] The geometric inequality constraint is a bottom-line rule that the optimizer must follow when solving for new positional information. It forces that the hair nodes be located on the outside of the scalp normal of the 3D head model and must never penetrate the 3D head model.

[0075] The optimizer is the mathematical engine that performs the calculations. Based on the two conditions mentioned above, it is responsible for automatically finding a set of objective functions for smoothness that allow p to perform the calculations, without violating the anti-mold-breaking constraint. The new coordinates of the hair node that reaches the minimum value (i.e., the optimal solution).

[0076] Finally, under the constraints of the smoothness objective function and the geometric inequality constraint terms, the optimizer iterates and outputs the optimal set of new position information for each hair node after multiple iterations. This set of new position information is then determined as the target position information for each optimized hair node.

[0077] S103. Based on the target location information, determine the reconstructed hair model.

[0078] In this embodiment of the application, after the above-mentioned optimization solution process is completed and the optimized target position information of each hair node is determined, the hair model is restructured based on the optimized target position information and geometric consistency is corrected.

[0079] In this embodiment, the target position information of the optimized hair nodes is sequentially connected into a continuous spatial curve, and smoothing and resampling are performed to maintain the continuity and naturalness of the shape, thereby obtaining the reconstructed hair model.

[0080] In this embodiment, after reconstructing the hair model, geometric features such as tangentiality, curvature, and length distribution are recalculated to restore the smoothness and physical plausibility of the overall structure. Finally, the processed hair model is exported as a standard format (such as PLY or OBJ) and re-bonded to the surface of the 3D head model for subsequent rendering, animation, or digital human generation.

[0081] It's important to note that the process of recalculating geometric features such as tangency, curvature, and length distribution is part of the post-processing and 3D asset standardization and packaging stage after the optimization solution is completed. Since the optimizer outputs only a set of pure, discrete 3D spatial coordinate points, to make this data usable downstream, these discrete points need to be reconnected and fitted into spline curves (i.e., the curves of the reconstructed hair model). This completes the geometric information such as tangents and curvature required by the rendering engine. Finally, all the data is packaged and saved in a common 3D file format (.PLY or .OBJ), thus completing the conversion from "pure mathematical data" to "usable graphical assets," ensuring that it can be successfully read and rendered by downstream pipelines such as UE5 or Maya.

[0082] In one embodiment of this application, to maintain the adhesion stability between the hair model and the 3D head model during the hair model optimization process, the first hair node (i.e., the hair root node) of each hair model can be regarded as an anchor point and set as immutable. Only the remaining N-1 non-root hair nodes, excluding the hair root node, are optimized as optimization variables. The specific implementation is as follows: From each hair node, the second hair node is determined; using the objective function and / or geometric constraint terms as constraint conditions, the initial position information of the remaining hair nodes, except for the initial position information of the second hair node, is adjusted to obtain the target position information of the remaining hair nodes; correspondingly, based on the target position information of the remaining hair nodes and the initial position information of the second hair node, the reconstructed hair model is determined.

[0083] In this embodiment, when optimizing the position information of each hair node in the hair model, the optimization of the hair root node is not included. At this time, in the default input initial hair model data, the hair root node has already been correctly attached to the surface of the 3D head model (i.e., its accuracy is guaranteed by the previous 3D reconstruction or binding process). Therefore, the subsequent focus is on fixing the hair root node and then optimizing the position information of the remaining N-1 hair nodes through the smoothness objective function and geometric inequality constraints to solve problems such as clipping.

[0084] It should be noted that if the root node of the hair is found to be severely deviated in practice, it is necessary to go back to the upstream data source (such as the 3D reconstruction process) for adjustment.

[0085] It should be noted that the embodiments of this application require the provision of a triangular mesh model of a three-dimensional head model, which is usually given in .obj file format.

[0086] In this embodiment of the application, the root node of the hair strand is used as the anchor point. Since the position information of the initial hair strand model is stored sequentially from root to tip, the initial position information of the second hair strand node can be directly determined from it. The position information of the root node of the hair strand (i.e. the second hair strand node) is removed from the initial position information of each hair strand node, and only the remaining initial position information is adjusted.

[0087] In this embodiment of the application, after obtaining the remaining initial position information, the initial position information of the remaining hair nodes, except for the initial position information of the hair root node, is adjusted using the objective function and / or geometric constraint terms as constraint conditions to obtain the target position information of the remaining hair nodes.

[0088] It should be noted that the method of adjusting the initial position information of the remaining hair nodes based on the objective function and / or geometric constraints is the same as the method of adjusting the initial position information of each hair node in the previous embodiment, and will not be repeated here.

[0089] In this application, after adjusting the initial position information of the remaining hair nodes except the root node, the initial position information of the root node and the optimized target position information of the remaining hair nodes except the root node are connected in sequence to form a continuous spatial curve, and smoothing and resampling are performed to maintain the continuity and naturalness of the shape, thereby obtaining the reconstructed hair model.

[0090] In this embodiment, after reconstructing the hair model, geometric features such as tangentiality, curvature, and length distribution are recalculated to restore the smoothness and physical plausibility of the overall structure. Finally, the processed hair model is exported as a standard format (such as PLY or OBJ) and re-bonded to the surface of the 3D head model for subsequent rendering, animation, or digital human generation.

[0091] It is understood that the hair model reconstruction method provided in this application, after obtaining the initial position information of each hair node in the hair model, constructs two constraint functions to adjust the initial position information of each hair node. The constraint condition is that the adjusted position information of each hair node is outside the three-dimensional head model, and the adjusted hair model is similar in shape to the initial hair model. This yields the final target position information of each hair model. If the hair model is reconstructed using this target position information, because the target position information satisfies the conditions of being outside the three-dimensional head model and similar in shape to the initial hair model, the reconstructed hair model can eliminate the hair clipping phenomenon while ensuring visual naturalness.

[0092] Based on the above embodiments, this application also provides a schematic diagram of the overall process of a hair model reconstruction method, as shown below. Figure 2 As shown, the specific steps include: S1. Read the initial position information of the initial hair model and the three-dimensional head model data.

[0093] S2. Construct the compliance objective function and / or geometric inequality constraint terms.

[0094] S3. Under the constraints of the smoothness objective function and / or geometric inequality constraints, an optimizer is used to solve for the target position information optimized from the initial position information.

[0095] S4. Based on the target location information, reconstruct the hair model and complete the binding of the reconstructed hair model with the 3D head model data.

[0096] Based on the above embodiments, by constructing an inequality constraint system based on the three-dimensional head model normal vector and combining it with the curve smoothness regularization term, the model is uniformly modeled as a constrained quadratic programming problem, achieving an optimal balance between geometric legality and visual continuity, ensuring that the repair result neither clips through the mold nor does it maintain the natural hair shape, and possessing good stability, versatility and scalability.

[0097] The above implementation method is adopted: 1. Introduce a linear inequality constraint model based on the normal vector of the three-dimensional head model surface, and construct an explicit geometric constraint matrix with the constraint condition that "the point must be located outside the normal of the corresponding surface".

[0098] Technical effect: Effectively prevents hair nodes from being trapped in the 3D head model mesh, ensuring that each hair node is outside the mesh, and achieving precise repair of the clipping point.

[0099] 2. Construct a quadratic programming optimization problem with normal constraints, using the second difference of the curve as a smoothing regularization term, and combining the original position information of the hair nodes as a reconstruction prior, to adjust the position of local nodes without sacrificing the overall shape.

[0100] Effect: Preserves the original curvature and spatial continuity of the hair model, avoiding abrupt curve changes and structural damage caused by directly replacing the projection.

[0101] 3. Retain the root node of the hair strand as the fixed anchor point in the optimization process, and only adjust the constraints of the other hair strand nodes to keep the attachment point of the hair strand model stable and improve the structural consistency with the scalp of the 3D head model.

[0102] Effect: Enhances the scalp binding stability of the repaired hair strands, facilitating subsequent animation-driven or simulation rendering.

[0103] 4. The method employs explicit second-order difference matrix construction and efficient solvers (such as quadprog) for optimization, ensuring numerical stability and time efficiency under large-scale hair data processing.

[0104] Results: It can process tens of thousands of hairs without sacrificing accuracy, meeting the high concurrency requirements of industrial-grade digital human modeling.

[0105] This application proposes a high-precision geometric repair mechanism that combines smoothness reconstruction and spatial extrapolation constraints to address the problems of clipping, deformation, and discontinuity that occur during the migration or repair of hair models. Although related technologies can also avoid clipping through traditional collision detection or distance field-based methods, this application's embodiment has higher controllability and mathematical completeness in terms of geometric consistency and morphological smoothness, effectively avoiding model clipping while maintaining the original curvature characteristics. This method does not depend on the specific head model topology, has a certain degree of versatility and scalability, and can be integrated into digital human hairstyle generation, automatic model repair, and hair asset processing workflows, providing technical support for improving the realism of the model and the stability of subsequent algorithm training.

[0106] Based on the above embodiments, another embodiment of this application provides a hair model reconstruction device 1, such as... Figure 3 As shown, the hair model reconstruction device 1 includes: The acquisition unit 10 is used to acquire the initial position information of each hair node corresponding to the initial hair model.

[0107] The construction unit 11 is used to construct the objective function and / or geometric constraint terms, and to adjust the initial position information using the objective function and / or geometric constraint terms as constraints to obtain the target position information of each hair node; wherein, the objective function is used to evaluate the morphological similarity between the initial hair model and the adjusted hair model, and the geometric constraint terms are used to constrain the target position information to be outside the three-dimensional head model bound to the initial hair model.

[0108] The determination unit 12 is used to determine the reconstructed hair model based on the target location information.

[0109] In one embodiment, the construction unit 11 is further configured to construct a first geometric parameter item corresponding to each hair node of the initial hair model, and a second geometric parameter item corresponding to each hair node of the adjusted hair model.

[0110] The construction unit 11 is also used to construct the objective function based on the first geometric parameter term and the second geometric parameter term.

[0111] In one embodiment, the construction unit 11 is further configured to construct the position information matrix and sparse matrix of each hair node corresponding to the adjusted hair model, wherein the sparse matrix represents the calculation coefficients corresponding to each hair node.

[0112] The building unit 11 is also used to construct the first geometric parameter matrix of each hair node corresponding to the initial hair model.

[0113] The construction unit 11 is also used to construct the objective function based on the position information matrix, the sparse matrix, and the first geometric parameter matrix.

[0114] In one embodiment, the acquisition unit 10 is further configured to acquire, for each hair node, the first position information corresponding to the first hair node whose initial position information is closest to that of each hair node.

[0115] The acquisition unit 10 is also used to acquire the target area of ​​the first position information on the three-dimensional head model and determine the normal vector of the target area.

[0116] The construction unit 11 is also used to construct geometric constraint terms based on the normal vector, the first position information, and the target position information after adjusting the initial position information.

[0117] In one embodiment, the determining unit 12 is further configured to determine a second hair node from each hair node.

[0118] The construction unit 11 is also used to adjust the initial position information of the remaining hair nodes, except for the initial position information of the second hair node, using the objective function and / or geometric constraint terms as constraints, so as to obtain the target position information of the remaining hair nodes.

[0119] The determining unit 12 is also used to determine the reconstructed hair model based on the target position information of the remaining hair nodes and the initial position information of the second hair node.

[0120] In one embodiment, the construction unit 11 is further configured to iterate under the constraints of geometric constraints, using the minimum value of the objective function as a condition, and use the set of position information with the minimum value of the objective function as the target position information of each hair node.

[0121] In one embodiment, the acquisition unit 10 is further configured to generate initial position information of each hair segment corresponding to the initial hair model based on a preset hair reconstruction algorithm or a preset animation model binding result.

[0122] This application provides a hair model reconstruction device that obtains the initial position information of each hair node corresponding to an initial hair model; constructs an objective function and / or geometric constraints, and uses the objective function and / or geometric constraints as constraints to adjust the initial position information to obtain the target position information of each hair node; wherein, the objective function is used to evaluate the morphological similarity between the initial hair model and the adjusted hair model, and the geometric constraints are used to constrain the target position information to be outside the three-dimensional head model bound to the initial hair model; based on the target position information, the reconstructed hair model is determined. Therefore, the hair model reconstruction device proposed in this application, after obtaining the initial position information of each hair node of the hair model, constructs two constraint functions, and when adjusting the initial position information of each hair node, uses the constraint that the adjusted position information of each hair node is outside the three-dimensional head model and that the adjusted hair model is morphologically similar to the initial hair model as a constraint to obtain the final target position information of each hair model. If the hair model is reconstructed using the target location information, since the target location information is outside the three-dimensional head model and similar in shape to the initial hair model, the reconstructed hair model can eliminate the hair clipping phenomenon while ensuring visual naturalness.

[0123] Figure 4 This is a schematic diagram of the composition of a hair model reconstruction device 1 provided in an embodiment of this application. In practical applications, based on the same disclosed concept of the above embodiments, such as... Figure 4 As shown, the hair model reconstruction device 1 of this application embodiment includes a processor 13, a memory 14 and a communication bus 15.

[0124] In specific embodiments, the acquisition unit 10, construction unit 11, and determination unit 12 described above can be implemented by a processor 13 located on the hair model reconstruction device 1. The processor 13 can be at least one of the following: Application Specific Integrated Circuit (ASIC), Digital Signal Processor (DSP), Digital Signal Processing Device (DSPD), Programmable Logic Device (PLD), Field Programmable Gate Array (FPGA), CPU, controller, microcontroller, and microprocessor. It is understood that for different devices, the electronic device used to implement the above processor functions can also be other types, and this application embodiment does not impose specific limitations.

[0125] In this embodiment, the communication bus 15 is used to realize the connection communication between the processor 13 and the memory 14; when the processor 13 executes the running program stored in the memory 14, it implements the following hair model reconstruction method: Obtain the initial position information of each hair node corresponding to the initial hair model; construct an objective function and / or geometric constraints, and use the objective function and / or geometric constraints as constraints to adjust the initial position information to obtain the target position information of each hair node; wherein, the objective function is used to evaluate the morphological similarity between the initial hair model and the adjusted hair model, and the geometric constraints are used to constrain the target position information to be outside the 3D head model bound to the initial hair model; based on the target position information, determine the reconstructed hair model.

[0126] In one embodiment, the processor 13 is further configured to construct a first geometric parameter term corresponding to each hair node of the initial hair model, and a second geometric parameter term corresponding to each hair node of the adjusted hair model; and to construct an objective function based on the first geometric parameter term and the second geometric parameter term.

[0127] In one embodiment, the processor 13 is further configured to construct a position information matrix and a sparse matrix for each hair node corresponding to the adjusted hair model, wherein the sparse matrix represents the calculation coefficients corresponding to each hair node; construct a first geometric parameter matrix for each hair node corresponding to the initial hair model; and construct an objective function based on the position information matrix, the sparse matrix and the first geometric parameter matrix.

[0128] In one embodiment, the processor 13 is further configured to: obtain, for each hair node, first position information corresponding to the first hair node closest to the initial position information of each hair node; obtain the target region of the first position information on the three-dimensional head model and determine the normal vector of the target region; and construct geometric constraint terms based on the normal vector, the first position information and the target position information after adjusting the initial position information.

[0129] In one embodiment, the processor 13 is further configured to: determine a second hair node from each hair node; adjust the initial position information of the remaining hair nodes, excluding the initial position information of the second hair node, using the objective function and / or geometric constraint terms as constraints, to obtain the target position information of the remaining hair nodes; and determine the reconstructed hair model based on the target position information of the remaining hair nodes and the initial position information of the second hair node.

[0130] In one embodiment, the processor 13 is further configured to iterate under the constraints of geometric constraints, using the minimum value of the objective function as a condition, and use the set of position information with the minimum value of the objective function as the target position information of each hair node.

[0131] In one embodiment, the processor 13 is further configured to generate initial position information of each hair segment corresponding to the initial hair model based on a preset hair reconstruction algorithm or a preset animation model binding result.

[0132] Based on the above embodiments, this application provides a storage medium storing a computer program thereon. The computer-readable storage medium stores one or more programs, which can be executed by one or more processors and applied in a hair model reconstruction device. The computer program implements the hair model reconstruction method as described above.

[0133] Based on the above embodiments, this application provides a computer program product, including a computer program that can be executed by one or more processors and applied in a hair model reconstruction device. The computer program implements the hair model reconstruction method as described above.

[0134] It should be noted that, in the embodiments of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0135] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solutions of the embodiments of this application, or the parts that contribute to the related technology, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as read-only memory (ROM) / random access memory (RAM), magnetic disk, optical disk), and includes several instructions to cause an image display device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the embodiments of this application.

[0136] The above description is merely a specific implementation of the embodiments of this application, but the protection scope of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the protection scope of this application.

Claims

1. A method for reconstructing a hair model, characterized in that, The method includes: Obtain the initial position information of each hair node corresponding to the initial hair model; Construct an objective function and / or geometric constraints, and use the objective function and / or geometric constraints as constraints to adjust the initial position information to obtain the target position information of each hair node; wherein, the objective function is used to evaluate the morphological similarity between the initial hair model and the adjusted hair model, and the geometric constraints are used to constrain the target position information to be outside the three-dimensional head model bound to the initial hair model; Based on the target location information, the reconstructed hair model is determined.

2. The method according to claim 1, characterized in that, The objective function to be constructed includes: Construct the first geometric parameter item corresponding to each hair node of the initial hair model, and the second geometric parameter item corresponding to each hair node of the adjusted hair model; The objective function is constructed based on the first geometric parameter term and the second geometric parameter term.

3. The method according to claim 1, characterized in that, The objective function to be constructed includes: Construct the position information matrix and sparse matrix of each hair node corresponding to the adjusted hair model, wherein the sparse matrix represents the calculation coefficients corresponding to each hair node; Construct the first geometric parameter matrix of each hair node corresponding to the initial hair model; The objective function is constructed based on the location information matrix, the sparse matrix, and the first geometric parameter matrix.

4. The method according to claim 1, characterized in that, The constructed geometric constraints include: For each hair node, obtain the first position information corresponding to the first hair node whose initial position information is closest to that of each hair node; Obtain the target region of the first position information on the three-dimensional head model, and determine the normal vector of the target region; Based on the normal vector, the first position information, and the target position information after adjusting the initial position information, a geometric constraint term is constructed.

5. The method according to claim 1, characterized in that, The step of adjusting the initial position information using the objective function and / or the geometric constraint terms as constraints to obtain the target position information of each hair node includes: From the aforementioned hair nodes, determine the second hair node; Using the objective function and / or the geometric constraint terms as constraints, adjust the initial position information of the remaining hair nodes, except for the initial position information of the second hair node, to obtain the target position information of the remaining hair nodes; Correspondingly, determining the reconstructed hair model based on the target location information includes: Based on the target position information of the remaining hair nodes and the initial position information of the second hair node, the reconstructed hair model is determined.

6. The method according to claim 1, characterized in that, The step of adjusting the initial position information using the objective function and / or the geometric constraint terms as constraints to obtain the target position information of each hair node includes: Under the constraints of the geometric constraints, the algorithm iterates with the minimum value of the objective function as the condition, and the set of position information with the minimum value of the objective function is taken as the target position information of each hair node.

7. The method according to claim 1, characterized in that, The step of obtaining the initial position information of each hair node corresponding to the initial hair model includes: Based on the preset hair reconstruction algorithm or the preset animation model binding result, the initial position information of each hair segment corresponding to the initial hair model is generated.

8. A hair model reconstruction device, characterized in that, The hair model reconstruction device includes a processor and a memory; the processor executes the running program stored in the memory to implement the method as described in any one of claims 1 to 7.

9. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 7.

10. A computer program product, comprising a computer program, characterized in that, The computer program, when executed by a processor, implements the method as described in any one of claims 1 to 7.