Facial microplasty effect simulation method, system, device and storage medium
By constructing a facial structure model and matching it with a celebrity sample database, and combining aging feature recognition and mirror symmetry constraints, high-quality facial micro-plastic surgery simulation images are generated, which solves the problem of insufficient adaptability of facial bone structure and improves the simulation effect.
Patent Information
- Application Number
- CN202610696231.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-20
- Publication Date
- 2026-07-10
AI Technical Summary
Existing facial micro-plastic surgery simulation technology lacks adaptability to facial bone structure, resulting in uncoordinated adjustments in local areas, imbalance of the overall facial structure, and low naturalness of simulation results.
By acquiring facial image data of target users, a facial structure model is constructed, and similarity calculation is performed with a celebrity sample library to determine the target style model. Style structure parameters are extracted, and simulated facial images are generated by combining aging feature recognition and mirror symmetry constraints to achieve facial structure adjustment and aging correction.
It improves the structural matching degree and simulation naturalness between the simulation results of facial micro-plastic surgery and the target style model, and overcomes the problem of insufficient adaptability of facial bone structure.
Smart Images

Figure CN122369090A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of simulation, and in particular to a method, system, device and storage medium for simulating the effects of facial micro-plastic surgery. Background Technology
[0002] With the development of digital medical aesthetics technology, computer vision technology, and 3D image processing technology, facial minimally invasive cosmetic surgery effect simulation is gradually being applied in scenarios such as medical aesthetic consultation, pre-operative plan design, and personalized image management. By analyzing users' facial images and generating corresponding post-operative simulation effects, users can be provided with an intuitive preview of the results before the actual minimally invasive cosmetic surgery procedure. This assists users in choosing a treatment plan and improves communication efficiency during the medical aesthetic service process. Therefore, facial minimally invasive cosmetic surgery effect simulation technology is gradually becoming one of the important research directions in the field of intelligent medical aesthetics.
[0003] Related technical methods typically employ facial landmark detection, facial region segmentation, and image deformation processing to locate the eyes, nose, jaw, and facial contour areas in a user's facial image. Then, based on preset beautification parameters, local scaling parameters, or template deformation rules, the corresponding areas are adjusted to generate a simulated facial image. Some technical solutions also combine facial feature matching or style template matching to stylize the target user's face, thereby achieving a certain degree of facial beautification effect.
[0004] Although facial key point localization and local image deformation processing can achieve a visual simulation of the effects of facial micro-plastic surgery, when performing stylized micro-plastic surgery simulations for different users, there is a problem of insufficient adaptability of facial bone structure, which can easily lead to uncoordinated adjustments in local areas, imbalance of the overall facial structure, and low naturalness of the simulation results. Summary of the Invention
[0005] This invention aims to overcome the problem of insufficient adaptation of facial bone structure in the process of facial micro-plastic surgery simulation, and thus provides a method, system, device and storage medium for simulating the effect of facial micro-plastic surgery.
[0006] In view of this, a first aspect of the present invention provides a method for simulating the effect of facial micro-plastic surgery, comprising: acquiring facial image data of a target user; performing key point detection on the facial image data and extracting facial structural features to construct a facial structural model; calculating the similarity between the facial structural model and a preset celebrity sample library to determine the target style model with the highest matching degree with the target user, and extracting the corresponding style structural parameters; determining the structural offset of each key facial region in the target style model based on the style structural parameters, and mapping the structural offset to the corresponding region position of the facial structural model to generate structural adjustment parameters; performing aging feature recognition on the facial image data, extracting aging feature data, and sorting the aging feature data to generate an aging feature sequence; constructing facial structural deformation rules based on the structural adjustment parameters and the aging feature sequence, and using the facial structural deformation rules to perform regional deformation calculations on the facial structural model to obtain an adjusted facial structural model; and applying mirror symmetry constraints to the adjusted facial structural model to generate a corresponding simulated facial image.
[0007] Optionally, the steps of acquiring facial image data of the target user, performing keypoint detection on the facial image data, and extracting facial structural features to construct a facial structural model include: acquiring facial image data of the target user through a multi-angle image acquisition module, and preprocessing the facial image data to obtain a standardized facial image; inputting the standardized facial image into a pre-trained cascaded convolutional neural network keypoint detection model to locate the facial regions in the standardized facial image, thereby extracting a multi-dimensional keypoint coordinate set; wherein, the multi-dimensional keypoint coordinate set includes the coordinates of the highest point of the brow bone, the coordinates of the inner and outer endpoints of the brow bone, the coordinates of the highest point of the cheekbone, the coordinate sequence of the outer contour of the cheekbone, the coordinates of the apex of the bridge of the nose, the coordinate sequence of the contours of both sides of the bridge of the nose, the coordinates of the mandibular angle, and the coordinates of the contour of the bottom of the mandible. The sequence involves: calculating the brow bone arch curvature parameters based on the coordinates of the highest point of the brow bone and the coordinates of the inner and outer endpoints of the brow bone; calculating the cheekbone prominence value based on the coordinates of the highest point of the cheekbone and the outer contour coordinates of the cheekbone; calculating the nasal bridge lateral contour curve parameters based on the coordinates of the nasal bridge apex and the nasal bridge lateral contour coordinates; and calculating the mandibular contour curve parameters based on the mandibular angle coordinates and the mandibular base contour coordinates. The facial midline of the target user is obtained, and the brow bone arch curvature parameters, cheekbone prominence value, nasal bridge lateral contour curve parameters, and mandibular contour curve parameters are divided into left and right sections using the facial midline as a symmetry reference to obtain the facial parameters for the left and right sections. The multi-dimensional key point coordinate set and the facial parameters are then fused using a 3D reconstruction algorithm to construct a facial structure model.
[0008] Optionally, the celebrity sample library stores facial structure models and corresponding skeletal structure feature vectors of several celebrity samples. The skeletal structure feature vectors include brow bone arch curvature parameters, cheekbone prominence measurements, nasal bridge side profile curve parameters, and mandibular profile curve parameters. The step of calculating the similarity between the facial structure model and the preset celebrity sample library to determine the target style model with the highest matching degree with the target user and extracting the corresponding style structure parameters includes: calculating the cosine similarity between the skeletal structure feature vector corresponding to the facial structure model and the skeletal structure feature vectors of each celebrity sample in the preset celebrity sample library to obtain a similarity score sequence between the target user and each celebrity sample; sorting the celebrity samples in the celebrity sample library in descending order according to the similarity score sequence, and selecting the facial structure model corresponding to the celebrity sample with the highest similarity score as the target style model; extracting the structural parameters corresponding to each key facial region from the target style model, and using all the structural parameters as the style structure parameters corresponding to the target style model.
[0009] Optionally, the step of determining the structural offset of each key facial region in the target style model based on the style structure parameters, and mapping the structural offset to the corresponding region position in the facial structure model to generate structural adjustment parameters includes: performing item-by-item subtraction operations on the structural parameter values of each key facial region in the style structure parameters and the structural parameter values of the corresponding region in the facial structure model to obtain the structural offset; establishing a region coordinate mapping relationship based on the key point coordinate set of each key facial region in the facial structure model, mapping the structural offset of each key facial region to the corresponding key point coordinate position in the facial structure model according to the region coordinate mapping relationship; performing interpolation diffusion calculation on the structural offset using the spatial weight distribution of the key point coordinate positions in each region to generate a coordinate adjustment vector for each key point coordinate in each region, and using all coordinate adjustment vectors as structural adjustment parameters.
[0010] Optionally, the step of identifying aging features in the facial image data, extracting aging feature data, and sorting the aging feature data to generate an aging feature sequence includes: performing local texture enhancement on the facial image data; segmenting and locating the enhanced facial image data to obtain the glabellar line region, nasolabial fold region, and cheekbone region; extracting a vertical cross-sectional gray-level gradient profile along the glabellar line direction in the glabellar line region, calculating the gray-level gradient extremum to obtain the glabellar line depth value; extracting a coordinate sequence of continuous contour points along the extension direction of the nasolabial fold region, calculating the arc length integral of the coordinate sequence to obtain the nasolabial fold length value; extracting the vertical distance between the lowest point coordinates of the cheekbone contour and a standard reference baseline in the cheekbone region, using the vertical distance as the cheekbone sagging value; based on the glabellar line depth value, nasolabial fold length value, and cheekbone sagging value as aging feature data, normalizing and scoring the aging feature data using a preset hierarchical scoring function to obtain a score value corresponding to each aging feature; and sorting each aging feature in descending order according to the score value to generate an aging feature sequence.
[0011] Optionally, the step of constructing facial structure deformation rules based on the structural adjustment parameters and the aging feature sequence, and using the facial structure deformation rules to perform regional deformation calculations on the facial structure model to obtain the adjusted facial structure model includes: constructing facial structure deformation rules based on the key point coordinate adjustment vectors in the structural adjustment parameters and the score values of each aging feature in the aging feature sequence; applying corresponding coordinate adjustment vectors to the key point coordinates of the brow bone region, cheekbone region, bridge of the nose region, and jaw region in the facial structure model according to the facial structure deformation rules, and performing smooth deformation propagation calculations on the non-key point coordinates in each region to complete the structural enhancement processing; applying inverse displacement correction vectors positively correlated with the score values of each aging feature to the glabellar line region, nasolabial fold region, and cheekbone region according to the processing priority from high to low in the aging feature sequence, to perform region-by-region deformation correction on each aging feature region to complete the aging correction processing; and using the facial structure model after the structural enhancement processing and the aging correction processing as the adjusted facial structure model.
[0012] Optionally, the step of applying mirror symmetry constraints to the adjusted facial structure model to generate a corresponding simulated facial image includes: taking the facial midline of the adjusted facial structure model as the axis of symmetry, extracting the coordinate pairs of symmetrical key points on the left and right sides, calculating the deviation value of each symmetrical key point coordinate pair relative to the axis of symmetry, identifying symmetrical key point coordinate pairs whose deviation values exceed a preset symmetry threshold as asymmetrical point pairs; applying equal and opposite correction offsets to the left and right coordinates of the asymmetrical point pairs so that the corrected left and right coordinates satisfy the mirror symmetry constraint conditions relative to the axis of symmetry, thereby obtaining a facial structure model after mirror symmetry constraint processing; using the key point coordinate set of the facial structure model after mirror symmetry constraint processing as a deformation control field to perform pixel-level spatial mapping transformation on the facial image data, thereby generating a simulated facial image corresponding to the facial structure model after mirror symmetry constraint processing.
[0013] A second aspect of this invention provides a simulation system for facial micro-plastic surgery effects, comprising: an image acquisition module for acquiring facial image data of a target user, performing key point detection on the facial image data, extracting facial structural features to construct a facial structural model; a style matching module for calculating the similarity between the facial structural model and a preset celebrity sample library, determining the target style model with the highest matching degree to the target user, and extracting the corresponding style structural parameters; a data mapping module for determining the structural offset of each key facial region in the target style model based on the style structural parameters, and mapping the structural offset to the corresponding region position of the facial structural model to generate structural adjustment parameters; a data sorting module for recognizing aging features in the facial image data, extracting aging feature data, and sorting the aging feature data to generate an aging feature sequence; a rule construction module for constructing facial structural deformation rules based on the structural adjustment parameters and the aging feature sequence, using the facial structural deformation rules to perform regional deformation calculations on the facial structural model to obtain an adjusted facial structural model; and a simulation module for applying mirror symmetry constraints to the adjusted facial structural model to generate a corresponding simulated facial image.
[0014] A third aspect of the present invention provides an electronic device, including a memory and a processor, wherein the memory stores a computer program executable on the processor, and the processor executes the computer program to implement the above-described method for simulating facial micro-plastic surgery effects.
[0015] A fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, the computer program causing a processor, when run by a processor, to perform a simulation method for facial micro-plastic surgery effects as described in any of the above embodiments.
[0016] The technical solution of this invention has the following advantages: By acquiring facial image data of the target user, a facial structure model is constructed to realize the digital expression of the target user's bone structure features; by calculating the cosine similarity between the facial structure model and the bone structure in the celebrity sample library, the target style model with the highest matching degree with the target user is determined, and the corresponding style structure parameters are extracted to achieve bone style matching between the target user and the target style model; by calculating the offset between the style structure parameters and the structural parameters of the corresponding region of the facial structure model, and combining the regional coordinate mapping relationship and interpolation diffusion calculation to generate structural adjustment parameters, the structured deformation control of key facial regions is realized; by identifying, scoring and ranking aging features, and performing structural enhancement processing and aging correction processing on the facial structure model, and combining mirror symmetry constraints and thin plate spline transformation algorithms to generate simulated facial images, the visualization simulation of facial micro-plastic surgery effects is realized, thereby improving the structural matching degree and simulation naturalness between the simulation results of facial micro-plastic surgery effects and the target style model, and overcoming the problem of insufficient facial bone structure adaptability in the process of facial micro-plastic surgery simulation. Attached Figure Description
[0017] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0018] Figure 1 A flowchart illustrating a method for simulating the effects of facial micro-plastic surgery, provided in an embodiment of the present invention; Figure 2 A schematic block diagram of the structure of the cascaded convolutional neural network keypoint detection model provided in the embodiments of the present invention; Figure 3 A schematic diagram of the process for cosine similarity matching of bone structure feature vectors provided in an embodiment of the present invention; Figure 4 This is a schematic diagram of the structural offset calculation process provided in an embodiment of the present invention; Figure 5 This is a schematic diagram of radial basis function interpolation diffusion provided in an embodiment of the present invention; Figure 6 This is a schematic diagram illustrating the process of facial aging feature recognition, quantitative scoring, and ranking provided in an embodiment of the present invention. Figure 7 A flowchart illustrating the adjusted three-dimensional facial structure model provided in an embodiment of the present invention; Figure 8A schematic block diagram of a facial micro-plastic surgery effect simulation system provided in an embodiment of the present invention; Figure 9 A schematic block diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0019] The technical solution of the present invention will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0020] In the description of this invention, it should be noted that the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0021] Furthermore, the technical features involved in the different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0022] like Figure 1 As shown, this application provides a simulation method for facial micro-plastic surgery effects. It can generate micro-plastic surgery simulation images adapted to the facial structure of the target user based on the target user's facial bone structure and facial aging characteristics, thereby improving the structural harmony and naturalness of the simulation results. The simulation method specifically includes: Step S1: Obtain facial image data of the target user, perform key point detection on the facial image data, extract facial structural features, and construct a facial structural model.
[0023] Facial image data includes two-dimensional image data and corresponding pixel grayscale data corresponding to the facial region of the target user. The facial image data acquisition device includes mobile terminal camera, depth camera or medical aesthetic image acquisition device. When performing key point detection on the facial image data, the brow bone region, cheekbone region, bridge of nose region and jaw region in the facial region are located, and the coordinates of the structural key points in the corresponding regions are extracted to construct a facial structure model corresponding to the actual facial structure of the target user. The facial structure model includes the spatial coordinate information of key points in the facial region of the target user, the contour boundary information and the regional structural parameter information.
[0024] For example, the target user faces the image acquisition device with a natural expression. The image acquisition device acquires a frontal image of the target user with an image resolution of 1920×1080 pixels and an image acquisition distance of 0.8 meters. After acquiring the facial image data, key points are located on the left and right brow bone edges, the outer contours of the left and right cheekbones, the central axis area of the bridge of the nose, and the edge area of the jaw. The coordinate information of the key points in the corresponding areas is extracted to generate the corresponding facial structure model.
[0025] like Figure 2 As shown, in another example, step S1 may also preferably be performed as follows: The multi-angle image acquisition module acquires facial image data from three angles: front, left 45°, and right 45°. The facial image data is then preprocessed by grayscale normalization, contrast enhancement, and noise filtering to obtain a standardized facial image.
[0026] The multi-angle image acquisition module includes image acquisition units corresponding to the frontal, left 45°, and right 45° directions, with an image acquisition time interval of less than 0.5 seconds for each direction. Gray-level normalization uses linear gray-level stretching to map the pixel gray-level values in the facial image data to a gray-level range of 0 to 255. Contrast enhancement uses the CLAHE adaptive histogram equalization algorithm to locally enhance the contrast of the facial region. Noise filtering uses a Gaussian filtering algorithm to smooth the random noise in the facial image data, with the convolution kernel size of the Gaussian filtering algorithm set to 5×5. The mean brightness deviation of the facial region in the standardized facial image is controlled within ±5%.
[0027] For example, images of the target user are captured from three directions: facing forward, 45° to the left, and 45° to the right, resulting in three facial images, each with a resolution of 1920×1080 pixels. Gray-level normalization is then performed on the three facial images, mapping the original gray-level range from 18 to 231 to 0 to 255. The CLAHE adaptive histogram equalization algorithm is used to enhance the local contrast of the brow bone and cheekbone regions to 1.4 times the original contrast. Finally, a Gaussian filtering algorithm is used to smooth high-frequency noise in the facial images to obtain a standardized facial image.
[0028] Standardized facial images are input into a pre-trained cascaded convolutional neural network keypoint detection model to locate facial regions in the standardized facial images, thereby extracting a multi-dimensional keypoint coordinate set. The multi-dimensional keypoint coordinate set includes the coordinates of the highest point of the brow bone, the coordinates of the inner and outer endpoints of the brow bone, the coordinates of the highest point of the cheekbone, the coordinate sequence of the outer contour of the cheekbone, the coordinates of the apex of the bridge of the nose, the coordinate sequence of the contours of both sides of the bridge of the nose, the coordinates of the mandibular angle, and the coordinate sequence of the contour of the bottom of the mandible.
[0029] The cascaded convolutional neural network keypoint detection model is constructed using the MTCNN cascaded convolutional neural network algorithm. The model includes a coarse localization network and a fine localization network. The coarse localization network performs initial localization of facial regions in a standardized facial image and outputs initial keypoint coordinate regions. The fine localization network performs local feature regression based on the initial keypoint coordinate regions to output the corresponding multi-dimensional keypoint coordinate set. Specifically, the zygomatic bone outer contour coordinate sequence includes 12 contour point coordinates evenly distributed along the zygomatic bone outer contour; the nasal bridge side contour coordinate sequence includes 16 contour point coordinates distributed along the left and right edges of the nasal bridge; and the mandibular base contour coordinate sequence includes 20 contour point coordinates distributed along the mandibular edge. All keypoint coordinates are represented in three-dimensional coordinate form.
[0030] For example, the cascaded convolutional neural network keypoint detection model is trained on the WFLW face keypoint dataset with 7,500 sets of face images as training samples. The coarse localization network locates the facial region as a target region with a side length of 320 pixels, and the fine localization network outputs a multi-dimensional keypoint coordinate set containing 78 keypoint coordinates. Among them, the coordinates of the highest point of the brow bone are represented by three-dimensional coordinates (x1, y1, z1), the coordinates of the mandibular angle are represented by three-dimensional coordinates (x2, y2, z2), and the coordinate sequence of the outer contour of the zygomatic bone includes 12 contour point coordinates from P1 to P12.
[0031] The brow bone arch curvature parameters are calculated based on the coordinates of the highest point of the brow bone and the coordinates of the inner and outer endpoints of the brow bone.
[0032] Specifically, an arch-shaped fitting curve for the brow bone region is constructed based on the coordinates of the highest point of the brow bone and the coordinates of the inner and outer endpoints of the brow bone. The curvature change value of the arch-shaped fitting curve relative to the midline of the face is calculated, and the curvature change value is used as the brow bone arch curvature parameter.
[0033] The bow-shaped fitting curve was constructed using a cubic Bezier curve fitting algorithm. The coordinates of the highest point of the brow bone were used as the top control point of the Bezier curve, and the coordinates of the inner and outer endpoints of the brow bone were used as the boundary control points of the Bezier curve. The curvature change value was obtained by calculating the rate of change of the radius of curvature of the Bezier curve at each sampling point. The rate of change of the radius of curvature was expressed as the ratio of the curvature difference between adjacent sampling points to the sampling distance. The facial midline was formed by connecting the coordinates of the apex of the bridge of the nose and the coordinates of the center point of the chin.
[0034] For example, in the left brow bone region, the coordinates of the highest point of the brow bone are (132, 284, 16), the coordinates of the inner endpoint of the brow bone are (118, 291, 11), and the coordinates of the outer endpoint of the brow bone are (176, 279, 13). Based on the cubic Bezier curve fitting algorithm, a curve fitting for the left brow bone arch is generated. 20 sampling points are uniformly extracted along the curve length direction. By calculating the rate of change of curvature between the 20 sampling points, the curvature parameter of the left brow bone arch is obtained as 0.37.
[0035] The prominence of the cheekbone is calculated based on the coordinates of the highest point of the cheekbone and the coordinate sequence of the outer contour of the cheekbone.
[0036] Specifically, the outer contour surface of the cheekbone region is constructed based on the coordinates of the highest point of the cheekbone and the coordinate sequence of the outer contour of the cheekbone. The lateral distance from the highest point of the cheekbone to the midline of the face and the outward expansion range of the outer contour surface are calculated. The lateral distance and the outward expansion range are used as the prominence measure of the cheekbone.
[0037] The outer contour surface is constructed using the Delaunay triangular mesh reconstruction algorithm. Adjacent coordinate points in the coordinate sequence of the outer contour of the cheekbone form a continuous triangular mesh. The lateral distance is obtained by calculating the Euclidean distance between the coordinates of the highest point of the cheekbone and the midline of the face. The outward expansion variation is obtained by calculating the rate of change of the angle between the normal vector of each triangular mesh in the outer contour surface and the midline of the face.
[0038] For example, in the right cheekbone region, the coordinates of the highest point of the cheekbone are (412, 308, 28), corresponding to a lateral distance of 41.2 mm from the highest point of the cheekbone to the midline of the face. The coordinate sequence of the outer contour of the cheekbone includes 12 contour points from Q1 to Q12. The corresponding outer contour surface is generated by the Delaunay triangular mesh reconstruction algorithm, and the outward expansion variation of the right cheekbone region is calculated to be 0.46. The lateral distance of 41.2 mm and the outward expansion variation of 0.46 are used as the corresponding cheekbone prominence measurement values.
[0039] The parameters of the lateral contour curve of the bridge of the nose are calculated based on the coordinates of the apex of the bridge of the nose and the coordinate sequences of the contours on both sides of the bridge of the nose.
[0040] Specifically, the side profile curve of the nasal bridge region is constructed based on the coordinate sequence of the nasal bridge apex and the contour coordinate sequence of the two sides of the nasal bridge. The continuous change value of the curvature of the side profile curve and the height difference between the nasal bridge apex and the nasal root region are calculated. The continuous change value of curvature and the height difference are used as the parameters of the nasal bridge side profile curve.
[0041] The lateral contour curve was constructed using a B-spline curve fitting algorithm, with each contour point in the contour coordinate sequence on both sides of the bridge of the nose serving as the control point of the B-spline curve. The continuous curvature change value was obtained by calculating the change value of the second derivative of the B-spline curve at continuous sampling positions. The nasal root region was located using contour points in the contour coordinate sequence on both sides of the bridge of the nose that are close to the inner regions of the eyes, and the height difference was represented by the difference between the coordinates of the nasal bridge apex and the average height of the nasal root region.
[0042] For example, in the nasal bridge region, the coordinates of the nasal bridge vertex are (256, 214, 31), the average height of the nasal root region is 19 mm, and the height difference between the nasal bridge vertex and the nasal root region is calculated to be 12 mm; the side profile curve of the nasal bridge region is generated based on the B-spline curve fitting algorithm, 15 continuous sampling points are extracted in the nasal bridge length direction, and the corresponding curvature continuous change value is calculated to be 0.29.
[0043] The parameters of the mandibular contour curve are calculated based on the coordinates of the mandibular angle and the contour of the mandibular base.
[0044] Specifically, the lower edge contour curve of the mandibular region is constructed based on the coordinate sequence of the mandibular angle and the contour of the mandibular base. The change value of the turning angle and the change value of the contour smoothness of the lower edge contour curve are calculated, and the change value of the turning angle and the change value of the contour smoothness are used as the parameters of the mandibular contour curve.
[0045] The lower edge contour curve is constructed using the Catmull-Rom spline curve algorithm, with each contour point in the mandibular bottom contour coordinate sequence serving as the spline curve control point; the change value of the turning angle is obtained by calculating the change value of the angle between adjacent tangent directions at the mandibular angle coordinate position; the contour smoothing change value is obtained by calculating the curvature fluctuation amplitude of the spline curve at continuous sampling point positions.
[0046] For example, in the mandibular region, the coordinates of the mandibular angle are (198, 486, 24), and the coordinate sequence of the mandibular base contour includes 20 contour points from J1 to J20. The lower edge contour curve is constructed based on the Catmull-Rom spline curve algorithm, and the change value of the turning angle in the mandibular angle region is calculated to be 23°, and the contour smoothing change value is 0.18.
[0047] Obtain the facial midline of the target user, and divide the brow bone arch curvature parameter, cheekbone prominence value, nasal bridge side contour curve parameter, and mandibular contour curve parameter into left and right sections based on the facial midline as the symmetry reference, to obtain the facial parameters of the left and right sections.
[0048] The facial midline is determined by fitting the coordinates of the nasal root center point, philtrum center point, and chin center point. Specifically, the coordinates of the nasal root center point below the nasal bridge apex, the philtrum center point in the upper lip region, and the chin center point in the lower jaw contour coordinate sequence are extracted. A linear least squares fitting algorithm is used to calculate the central fitting line passing through the coordinates of the nasal root center point, philtrum center point, and chin center point, and this central fitting line is used as the facial midline. When dividing the face into left and right sections, the structural parameters located on the left side of the facial midline are divided into left-side facial parameters, and the structural parameters located on the right side of the facial midline are divided into right-side facial parameters. The facial parameters after left and right division are stored in the form of independent parameter sets.
[0049] For example, the coordinates of the center point of the nasal root are (256, 214, 31), the coordinates of the center point of the philtrum are (258, 302, 27), and the coordinates of the center point of the chin are (260, 521, 19). Based on the linear least squares fitting algorithm, the corresponding center fitting line is generated with the equation x = 0.018y + 252.1, and this center fitting line is used as the facial midline. The left brow bone arch curvature parameter of 0.37 is assigned to the left region facial parameter set, and the right cheekbone prominence measurement value is assigned to the right region facial parameter set.
[0050] The facial midline is determined by fitting the coordinates of the nasal root center point, the philtrum center point, and the chin center point. Specifically, the coordinates of the nasal root center point below the nasal bridge apex, the philtrum center point in the upper lip region, and the chin center point in the lower jaw contour coordinate sequence are extracted. Then, a central fitting line passing through the coordinates of the nasal root center point, the philtrum center point, and the chin center point is calculated based on the least squares linear fitting algorithm. This central fitting line is taken as the facial midline. The least squares linear fitting algorithm is a linear least squares fitting algorithm.
[0051] For example, when the coordinates of the center point of the nasal root are (321, 188), the coordinates of the center point of the philtrum are (325, 402), and the coordinates of the center point of the chin are (330, 671), the equation of the center fitting line is calculated using the linear least squares fitting algorithm as x = 0.018y + 317.6. This center fitting line is then used as the facial midline to divide the left and right facial parameters into regions.
[0052] The multi-dimensional key point coordinate set and facial parameters corresponding to the facial images from three angles are fused using a 3D reconstruction algorithm to construct a 3D facial structure model that includes structural parameters of the brow bone region, cheekbone region, bridge of nose region, and jaw region.
[0053] The 3D reconstruction algorithm is constructed using the Structure from Motion algorithm based on multi-view stereo reconstruction. The Structure from Motion algorithm calculates the spatial disparity between corresponding key points by matching the coordinate sets of multi-dimensional key points from three angles: front, left 45°, and right 45°. The algorithm then optimizes the 3D spatial coordinates using a bundle adjustment algorithm. Facial parameters are mapped to the corresponding 3D key point regions to form a 3D facial structure model that includes structural parameters of the brow bone region, cheekbone region, bridge of the nose region, and jaw region. All key points in the 3D facial structure model are represented using a unified 3D coordinate system.
[0054] For example, the coordinates of the bridge of the nose in the frontal facial image are (256, 214), the coordinates of the bridge of the nose in the left 45° facial image are (241, 219), and the coordinates of the bridge of the nose in the right 45° facial image are (268, 217). The Structure from Motion algorithm calculates the spatial disparity based on the corresponding key point positions in the three angles, and obtains the three-dimensional coordinates (256, 214, 31) of the bridge of the nose through the bundle adjustment algorithm. Based on the coordinates of all key points and the facial parameters of the left and right partitions, a three-dimensional facial structure model containing 78 three-dimensional key points is generated.
[0055] Step S2: Calculate the similarity between the facial structure model and the preset celebrity sample library, determine the target style model with the highest matching degree with the target user, and extract the corresponding style structure parameters.
[0056] The three-dimensional facial structure model constructed in step S1 is processed into structural feature vectorization. The brow bone arch curvature parameters, cheekbone prominence measurement values, nasal bridge side contour curve parameters, and mandibular contour curve parameters are combined according to a unified parameter dimension to form the bone structure feature vector corresponding to the target user. The corresponding bone structure feature vectors of each celebrity sample in the preset celebrity sample library are read, and the structural similarity between the target user and each celebrity sample is quantified by vector similarity calculation. Based on the quantification calculation results, the target style model that is closest to the target user's bone structure is determined, and the corresponding style structure parameters are extracted from the target style model.
[0057] For example, the brow bone arch curvature parameter corresponding to the target user is set to 0.73, the cheekbone prominence value is set to 18.6mm, the nasal bridge side contour curve parameter is set to 0.81, and the mandibular contour curve parameter is set to 0.67. These parameters are then combined in a fixed order to form a four-dimensional skeletal structure feature vector. The skeletal structure feature vectors corresponding to each celebrity sample in the celebrity sample library are matched one by one with the skeletal structure feature vectors of the target user to obtain the similarity score for each celebrity sample. When the similarity score corresponding to a certain celebrity sample reaches 0.93, the three-dimensional facial structure model corresponding to that celebrity sample is determined as the target style model, and the corresponding brow bone arch height value, cheekbone prominence vector, nasal bridge vertex height value, and mandibular contour curve control point coordinates are extracted as style structure parameters.
[0058] Furthermore, the celebrity sample library in step S2 stores three-dimensional facial structure models of several celebrity samples and corresponding bone structure feature vectors. The bone structure feature vectors include brow bone arch curvature parameters, cheekbone prominence measurement values, nasal bridge side profile curve parameters, and mandibular contour curve parameters.
[0059] In this step, each celebrity sample in the celebrity sample library is preprocessed using the same facial structure extraction method as in step S1 to ensure that the parameter dimensions between the target user and the celebrity sample remain consistent. The facial image data corresponding to each celebrity sample includes a frontal image, a left 45° image, and a right 45° image, and a corresponding 3D facial structure model is constructed based on a 3D reconstruction algorithm. The brow bone arch curvature parameters, cheekbone prominence measurement, nasal bridge side profile curve parameters, and mandibular contour curve parameters are extracted from each 3D facial structure model and stored in the celebrity sample library according to a unified data format. The celebrity sample library is managed using a structured index table, which includes a celebrity sample identifier, facial structure model number, bone structure feature vector number, and corresponding parameter fields to ensure that the corresponding bone structure feature vector can be quickly retrieved during similarity calculation.
[0060] For example, the brow bone arch curvature parameter of a certain celebrity sample in the celebrity sample library is 0.75, the cheekbone prominence measurement is 19.1mm, the nasal bridge profile curve parameter is 0.84, and the mandibular profile curve parameter is 0.71. These parameters are stored in a structured index table in the form of "celebrity sample number - structural parameter number - parameter value". When the target user inputs the bone structure feature vector, the corresponding celebrity sample's bone structure feature vector can be quickly retrieved through the index field.
[0061] like Figure 3 As shown, in another example, step S2 may also preferably be performed as follows: The cosine similarity between the bone structure feature vector corresponding to the facial structure model and the bone structure feature vector of each celebrity sample in the preset celebrity sample library is calculated to obtain the similarity score sequence between the target user and each celebrity sample.
[0062] Cosine similarity calculation uses the cosine distance algorithm to calculate the cosine value of the angle between two skeletal structure feature vectors, representing the degree of structural similarity. Before calculating cosine similarity, the skeletal structure feature vectors corresponding to the target user and the celebrity samples are normalized to eliminate the influence between different parameter dimensions. The normalization process uses a maximum-minimum value normalization method, compressing the values of each structural parameter based on the maximum and minimum values of the corresponding parameters in the celebrity sample database. After normalization, the skeletal structure feature vectors are multiplied and added item by item according to their corresponding dimensions, and the magnitude of each vector is calculated to obtain the corresponding cosine similarity score. The cosine similarity scores of all celebrity samples are then arranged in the order of calculation to form a similarity score sequence.
[0063] For example, the normalized skeletal structure feature vector corresponding to the target user is (0.73, 0.62, 0.81, 0.67), and the normalized skeletal structure feature vector corresponding to a certain celebrity sample is (0.75, 0.60, 0.84, 0.71). Performing dimension-wise multiplication and summation on the two vectors yields a vector dot product of 1.87. Then, the magnitudes of the two vectors are calculated separately, and a cosine similarity score of 0.93 is obtained using the cosine distance algorithm. After performing cosine similarity calculations on all celebrity samples in the same way, a similarity score sequence containing the corresponding scores of all celebrity samples is formed.
[0064] The celebrity samples in the celebrity sample library are sorted in descending order according to the similarity score sequence, and the facial structure model corresponding to the celebrity sample with the highest similarity score is selected as the target style model.
[0065] The similarity score sequence is sorted by numerical value, and a correspondence is established between the score and the celebrity sample number. When the similarity scores of multiple celebrity samples are close, local weight correction calculations are performed on the corresponding brow bone region, nasal bridge region, and jaw region to improve the stability of the target style model matching results. The local weight correction calculation is determined based on the parameter change range of the corresponding region of the target user. When the structural change range of a certain region is higher than the preset change threshold, the proportion of the corresponding region in the similarity score is increased. After the correction is completed, the comprehensive score is recalculated, and the facial structure model corresponding to the celebrity sample with the highest score is selected as the target style model.
[0066] For example, when the similarity score corresponding to the first celebrity sample is 0.93 and the similarity score corresponding to the second celebrity sample is 0.92, local weight correction is performed on the nasal bridge region corresponding to the target user; when the change in the nasal bridge profile curve parameter corresponding to the target user reaches 1.3 times the preset change threshold, the weight corresponding to the nasal bridge region is increased from 0.25 to 0.4, and the comprehensive score is recalculated; after recalculation, the comprehensive score corresponding to the first celebrity sample is 0.95 and the comprehensive score corresponding to the second celebrity sample is 0.91, then the facial structure model corresponding to the first celebrity sample is determined as the target style model.
[0067] Structural parameters corresponding to each key facial region are extracted from the target style model. These structural parameters include the brow bone region's arch height value and the distance between its inner and outer endpoints, the cheekbone region's prominence vector and the outer contour curvature value, the bridge of the nose region's vertex height value and the coordinates of the control points of the contour curves on both sides, and the jaw region's contour curve control point coordinates and the jaw angle value. All structural parameters are used as the style structural parameters corresponding to the target style model.
[0068] Regional parameter extraction is performed on key facial regions in the target style model. Specifically, the brow bone arch height is obtained by reading the vertical distance between the highest point of the brow bone and the line connecting its inner and outer endpoints; the distance between the inner and outer endpoints of the brow bone is obtained by calculating the Euclidean distance between their coordinates. The cheekbone prominence vector is obtained by reading the spatial offset direction and distance of the highest point of the cheekbone relative to the facial midline; the outer contour curvature is calculated by curve fitting the outer contour coordinate sequence of the cheekbone. The nasal bridge apex height is obtained by reading the vertical distance between the nasal bridge apex coordinates and the nasal root reference plane; the coordinates of the control points of the lateral contour curves are obtained by Bezier curve fitting the nasal bridge contour curve. The control point coordinates of the mandibular contour curve are obtained by spline curve fitting the mandibular bottom contour coordinate sequence; the mandibular angle is obtained by reading the angle change between the left and right mandibular angle coordinates. After all parameters are extracted, all structural parameters are combined according to a fixed field order to form the style structure parameters corresponding to the target style model.
[0069] For example, in the target style model, the brow bone region has an arch height of 5.6 mm and a distance between its inner and outer endpoints of 34.2 mm; the zygomatic bone region has a prominence vector with spatial directions of (0.62, 0.41, 0.18) and an outer contour curvature of 0.77; the nasal bridge region has a apex height of 12.4 mm and control point coordinates for its two sides of the contour curves of (15.2, 21.6, 8.1) and (16.0, 22.4, 8.5) respectively; the mandibular region has five sets of contour control point coordinates and a mandibular angle of 118°; combining these structural parameters forms the style structure parameters corresponding to the target style model.
[0070] Step S3: Determine the structural offset of each key facial region in the target style model based on the style structure parameters, and map the structural offset to the corresponding region position of the facial structure model to generate structural adjustment parameters.
[0071] The structural differences between the facial structure model corresponding to the target user and the target style model are quantitatively analyzed, and the structural offset is determined based on the parameter differences corresponding to each key facial region. A region mapping relationship is established for the obtained structural offset, and the structural offset is converted into the coordinate adjustment vector corresponding to each key point according to the key point coordinate distribution in the corresponding region of the target user's facial structure model. Based on the spatial positional relationship between each key point, the structural offset is smoothed and diffused to obtain continuous structural adjustment parameters.
[0072] For example, when the vertex height of the nose bridge region corresponding to the target user is 9.8mm, and the vertex height of the nose bridge region corresponding to the target style model is 12.4mm, the difference of 2.6mm between the two is determined as the vertex height offset of the nose bridge region. The vertex height offset of the nose bridge region is mapped to the coordinate position of the key point of the nose bridge region, and the corresponding coordinate adjustment vector is generated based on the distance relationship between the key points around the nose bridge region, so that the deformation process of the nose bridge region is in a continuous transition state.
[0073] like Figure 4 and Figure 5 As shown, in another example, step S3 may also preferably be performed as follows: The structural parameter values of each key facial region in the style structure parameters are subtracted from the structural parameter values of the corresponding regions in the 3D facial structure model item by item to obtain the brow bone region's arch height offset and the offset of the distance between the inner and outer endpoints, the cheekbone region's prominence offset vector and the outer contour curvature offset, the bridge of the nose region's vertex height offset and the coordinate offset of the control points of the contour curves on both sides, and the jaw region's contour curve control point coordinate offset and jaw angle offset. The set of each offset constitutes the structural offset of each key facial region.
[0074] The structural parameters corresponding to the target user and the structural parameters corresponding to the target style model are matched item by item according to the same field order, and the change between the corresponding parameters is obtained by difference calculation. Among them, coordinate parameters are calculated by three-dimensional coordinate difference, angle parameters are calculated by angle difference, and curvature parameters are calculated by normalized difference. After completing the difference calculation of all parameters, multiple offsets corresponding to the same region are classified into regions to form a set of structural offsets for the corresponding region. The set of structural offsets includes parameter type identifier, parameter offset direction, offset value, and region number.
[0075] For example, if the brow bone height of the target user is 4.8mm and the brow bone height of the target style model is 5.6mm, then 0.8mm is determined as the brow bone height offset; if the mandibular angle of the target user is 123° and the mandibular angle of the target style model is 118°, then -5° is determined as the mandibular angle offset; after combining the above offsets in the form of "region number-parameter type-offset value", a set of structural offsets corresponding to each key facial region is formed.
[0076] Based on the key point coordinate set of each key facial region in the 3D facial structure model, a regional coordinate mapping relationship is established. The structural offset of each key facial region is mapped to the corresponding key point coordinate positions of the brow bone region, cheekbone region, bridge of nose region and jaw region in the facial structure model according to the regional coordinate mapping relationship.
[0077] A key point numbering table is established for each key facial region in the 3D facial structure model, and a region coordinate mapping relationship is constructed based on the key point numbering table. The region coordinate mapping relationship includes region number, key point number, spatial coordinate position, and adjacent key point relationship. The region number in the structural offset is matched with the region number in the region coordinate mapping relationship, and the position of the structural offset is determined according to the corresponding key point number. For regions with a large number of coordinate control points, a distance-weighted mapping allocation method is adopted so that the structural offset can be allocated to multiple key point coordinate positions according to the spatial distance ratio.
[0078] For example, the key points corresponding to the bridge of the nose are numbered N1 to N12, among which the key point number corresponding to the apex coordinate of the bridge of the nose is N6. When the height offset of the apex of the bridge of the nose is 2.6mm, the structural offset corresponding to 2.6mm is mapped to key point N6, and the corresponding offset is distributed to key points N4, N5, N7 and N8 according to the distance ratio between key point N6 and adjacent key points, so that the overall deformation of the bridge of the nose remains continuous.
[0079] The spatial weight distribution of key point coordinates in each region is used to interpolate and diffuse the structural offset, generating a coordinate adjustment vector for each key point coordinate in each region. All coordinate adjustment vectors are then used as structural adjustment parameters.
[0080] The spatial weight distribution is calculated based on the Euclidean distance between the coordinates of each non-key point and the coordinates of adjacent key points. Specifically, with the coordinates of the non-key points as the center, the coordinates of multiple key points within a preset neighborhood are obtained, the Euclidean distance between the coordinates of the non-key points and the coordinates of each key point is calculated, and the spatial weight value corresponding to each key point is calculated using an inverse distance weighting algorithm; where the smaller the distance, the larger the spatial weight value; the inverse distance weighting algorithm is the Inverse DistanceWeighting algorithm.
[0081] For example, when the Euclidean distances between a non-critical point coordinate and the coordinates of three critical points are 2.1mm, 3.4mm and 5.2mm respectively, after normalization calculation according to the reciprocal of the distance, spatial weight values of 0.51, 0.31 and 0.18 are obtained respectively, and the structural offset is weighted and diffused according to each spatial weight value.
[0082] A spatial weight matrix is established for key points in each region. The spatial weight matrix is constructed based on the Euclidean distance between key points, the adjacency relationship of regions, and surface continuity parameters. The structural offset is interpolated and diffused using a radial basis function interpolation algorithm, so that the structural offset gradually decays and diffuses from the core key point to the surrounding key points. The radial basis function interpolation algorithm adopts the form of Gaussian radial basis function, using the distance between key points as the attenuation factor. After the interpolation and diffusion are completed, the three-dimensional coordinate adjustment vectors corresponding to each key point are obtained, and they are combined according to the key point numbering order to form the structural adjustment parameters.
[0083] For example, in the cheekbone region, the key point corresponding to the highest point of the cheekbone is set as the core key point, and the corresponding prominence offset vector is set to (2.1mm, 1.3mm, 0.6mm). Gaussian radial basis functions are used to perform interpolation diffusion calculations on the surrounding key points. When the distance between a certain adjacent key point and the core key point is 4mm, the corresponding attenuation weight value is 0.72, and the coordinate adjustment vector corresponding to the adjacent key point is (1.51mm, 0.94mm, 0.43mm). After completing the interpolation diffusion calculations for all key points, the coordinate adjustment vectors corresponding to all key points are combined to form the structural adjustment parameters.
[0084] Step S4: Perform aging feature recognition on facial image data, extract aging feature data, sort the aging feature data, and generate an aging feature sequence.
[0085] The system analyzes aging-related regions in facial image data corresponding to target users and identifies corresponding aging features based on texture change features, contour change features, and soft tissue displacement features. Each identified aging feature is quantified to obtain corresponding aging feature data. The severity of each aging feature data is scored and ranked to form an aging feature sequence.
[0086] For example, perform texture analysis and contour analysis on the forehead area, the areas on both sides of the nose wings, and the apple muscle area corresponding to the target user, and identify the frown line area, the nasolabial fold area, and the apple muscle area; calculate the frown line depth value, the nasolabial fold length value, and the apple muscle sag value respectively, and obtain the corresponding score values through a unified scoring rule; when the score value corresponding to the frown line is 0.86, the score value corresponding to the nasolabial fold is 0.74, and the score value corresponding to the apple muscle is 0.69, arrange the three aging features in descending order according to the score values to form the corresponding aging feature sequence.
[0087] Such as Figure 6 and Figure 7 As shown, in another example, step S4 can also be preferably the following method: Perform local texture enhancement on the facial image data, and use a pre-trained semantic segmentation network to perform segmentation and localization on the enhanced facial image data to obtain the frown line area, the nasolabial fold area, and the apple muscle area.
[0088] Perform local texture enhancement processing on the forehead area, the nose wing area, and the cheek area in the facial image data respectively to increase the gray level difference between the aging texture area and the surrounding skin area; among them, local texture enhancement performs gray level enhancement processing on the local area through an adaptive histogram equalization algorithm, and uses a bilateral filtering algorithm to perform edge smoothing processing on the enhanced local area; after completing the local texture enhancement, input the enhanced facial image data into a pre-trained semantic segmentation network, and perform pixel-level region segmentation on the frown line area, the nasolabial fold area, and the apple muscle area; among them, the semantic segmentation network outputs the segmentation results of the corresponding regions through the feature fusion method between the encoding layer and the decoding layer by using the U-Net semantic segmentation algorithm; after completing the segmentation, generate the corresponding region mask data according to the pixel coordinate range corresponding to the segmentation region.
[0089] For example, perform adaptive histogram equalization processing on the forehead area using an 8×8 pixel window, so that the gray level difference between the frown line area and the surrounding skin area is increased from 12 to 37; after inputting the enhanced facial image data into the U-Net semantic segmentation network, output the pixel region number W1 corresponding to the frown line area, the pixel region number F1 corresponding to the nasolabial fold area, and the pixel region number A1 corresponding to the apple muscle area; among them, the pixel coordinate range corresponding to the frown line area is (125, 84) to (188, 142), and the pixel coordinate range corresponding to the nasolabial fold area is (142, 196) to (236, 341).
[0090] Extract the vertical section gray level gradient profile along the frown line direction of the frown line area, and calculate the gray level gradient extreme value to obtain the frown line depth value.
[0091] Extract the main texture direction in the area of the frown lines, and establish a grayscale cross-section perpendicular to the direction of the frown lines based on the main texture direction; among them, the main texture direction is extracted by the gradient direction of the Sobel edge detection algorithm; in the direction of the vertical cross-section, count the grayscale change of continuous pixel points, and construct a grayscale gradient profile curve; by calculating the difference between the maximum gradient value and the minimum gradient value in the grayscale gradient profile curve, obtain the grayscale gradient extreme value corresponding to the area of the frown lines; calculate the depth value of the frown lines based on the grayscale gradient extreme value and the corresponding texture width to characterize the depression degree of the area of the frown lines.
[0092] For example, it is detected that the main texture direction in the area of the frown lines is 78°, and a grayscale cross-section perpendicular to 78° is established; after counting the grayscale of continuous pixel points on the cross-section, the maximum grayscale gradient value is 46 and the minimum grayscale gradient value is -18, then the difference in the corresponding grayscale gradient extreme value is 64; when the corresponding texture width is 5.2 mm, substituting the corresponding relationship between 64 and 5.2 mm into the preset depth conversion rule, the depth value of the frown lines is obtained as 2.8 mm.
[0093] Extract the coordinate sequence of continuous contour points along the extension direction of the nasolabial folds in the area of the nasolabial folds, and calculate the arc length integral of the coordinate sequence to obtain the length value of the nasolabial folds.
[0094] Extract the edge contour in the area of the nasolabial folds, and use the contour tracking method to determine the corresponding extension direction of the nasolabial folds; among them, contour extraction is performed by using the Canny edge detection algorithm to detect the edges in the area of the nasolabial folds; after completing the edge detection, connect the continuous edge points and generate a coordinate sequence of continuous contour points according to the edge continuity; accumulate the Euclidean distances between adjacent contour points in the coordinate sequence segment by segment, and obtain the length value of the nasolabial folds based on the integral result of all Euclidean distances.
[0095] For example, a coordinate sequence containing 52 contour points is extracted in the area of the nasolabial folds, where the average distance between adjacent contour points is 1.4 mm; after accumulating the Euclidean distances between all adjacent contour points, the total arc length integral value corresponding to the nasolabial folds is 72.8 mm, and 72.8 mm is determined as the length value of the nasolabial folds.
[0096] Extract the vertical distance between the lowest point coordinate of the apple muscle contour in the area of the apple muscles and the standard reference baseline, and use the vertical distance as the apple muscle sag value.
[0097] The contour edges of the apple cheek region are extracted, and the coordinates of the lowest point corresponding to the apple cheek region are determined based on the contour edges. Specifically, the contour extraction of the apple cheek region is performed by fitting the contour edges of the apple cheek using an active contour model algorithm. After the contour fitting is completed, the point with the largest vertical coordinate value in the contour curve is selected as the coordinates of the lowest point of the apple cheek contour. At the same time, a standard reference baseline is established based on the coordinates of the pupil center and the lower edge of the nasal wing corresponding to the target user. The vertical distance between the coordinates of the lowest point of the apple cheek contour and the standard reference baseline is calculated, and the vertical distance is used as the apple cheek drooping value.
[0098] For example, the coordinates of the lowest point of the apple cheek contour are obtained as (236, 412) based on the contour curve of the apple cheek region; a standard reference baseline is established based on the midpoint of the line connecting the centers of the left and right pupils and the center point of the lower edge of the nasal wing; when the vertical distance between the coordinates of the lowest point of the apple cheek contour and the standard reference baseline is 13.6mm, 13.6mm is determined as the apple cheek droop value.
[0099] Based on the depth of glabellar lines, the length of nasolabial folds, and the sagging of cheekbones as aging characteristic data, the aging characteristic data are normalized and scored using a preset grading scoring function to obtain the score value corresponding to each aging characteristic.
[0100] The tiered scoring function uses a linearly normalized scoring function, the specific expression of which is: Si = (Vi) Vmin) / (Vmax) Vmin); Where Si represents the score of the corresponding aging feature, ranging from 0 to 1; Vi represents the current aging feature data; Vmin represents the minimum reference value of the corresponding aging feature; Vmax represents the maximum reference value of the corresponding aging feature; when Vi is less than Vmin, Si is 0; when Vi is greater than Vmax, Si is 1.
[0101] For example, when the depth of the glabellar lines is 2.8mm, the corresponding minimum reference value is 0mm, and the maximum reference value is 4.0mm, the glabellar line score is 0.70 after substituting it into the linear normalized scoring function.
[0102] A grading scoring interval was established for the depth of glabellar lines, the length of nasolabial folds, and the sagging of the cheekbones. A preset grading scoring function was constructed based on each grading scoring interval. The preset grading scoring function includes a minimum feature value, a maximum feature value, a scoring interval threshold, and a normalized output range. Linear normalization was used to transform the numerical values of each aging feature data, and the transformed results were limited to between 0 and 1. When an aging feature data exceeds the corresponding scoring interval threshold, the corresponding score value is output as the maximum value of 1; when an aging feature data is lower than the minimum value of the corresponding scoring interval, the corresponding score value is output as the minimum value of 0.
[0103] The scoring range for the depth of the glabellar lines was set to 0mm to 4mm. When the depth of the glabellar lines was 2.8mm, the corresponding score after substituting into the linear normalized scoring function was 0.70. The scoring range for the length of the nasolabial folds was set to 0mm to 80mm. When the length of the nasolabial folds was 72.8mm, the corresponding score was 0.91. The scoring range for the sagging of the cheekbones was set to 0mm to 15mm. When the sagging of the cheekbones was 13.6mm, the corresponding score was 0.91.
[0104] The aging features are sorted in descending order of their scores to generate an aging feature sequence consisting of aging feature identifiers and their corresponding quantitative scores.
[0105] The scores corresponding to all aging features are sorted, and a mapping relationship between aging feature identifiers and corresponding scores is established. The aging feature identifiers include the glabellar line identifier, the nasolabial fold identifier, and the cheekbone identifier. After the scores are sorted, the sorting results are combined in the form of "aging feature identifier - score - sorting number" to generate the corresponding aging feature sequence. When multiple aging features have the same score, the sorting order is re-sorted based on the area of the corresponding region.
[0106] For example, when the score for frown lines is 0.70, the score for nasolabial folds is 0.91, and the score for cheekbones is 0.91, the area of the nasolabial fold region is compared with the area of the cheekbones region. When the area of the cheekbones region is greater than the area of the nasolabial fold region, the sorting number corresponding to the cheekbones identifier is set to 1, the sorting number corresponding to the nasolabial fold identifier is set to 2, and the sorting number corresponding to the frown lines identifier is set to 3. Finally, an aging feature sequence including "cheekbones-A1-0.91-1", "nasolabial folds-F1-0.91-2", and "frowning lines-W1-0.70-3" is generated.
[0107] Step S5: Construct facial structure deformation rules based on structural adjustment parameters and aging feature sequences, and use the facial structure deformation rules to perform regional deformation calculations on the facial structure model to obtain the adjusted facial structure model.
[0108] The key point coordinate adjustment vectors of each region in the structural adjustment parameters are categorized into regions, and corresponding regional deformation rule sets are established for the brow bone region, cheekbone region, bridge of the nose region, jaw region, glabellar line region, nasolabial fold region, and cheekbone region. The score values in the aging feature sequence are normalized to construct the correction intensity parameters corresponding to each aging feature region. Based on the direction, amplitude, and spatial distribution of the key point coordinate adjustment vectors of each region, local deformation calculations are performed on the corresponding regions in the facial structure model to ensure that the deformation results of each region are consistent with the structural change trend of the corresponding region in the target style model. Local correction calculations corresponding to the score values are performed on the glabellar line region, nasolabial fold region, and cheekbone region to reduce the degree of depression, sagging, and texture depth of the aging feature regions. The deformation results of all regions are subjected to boundary smoothing and fusion processing to reduce the contour abruptness at the region connection positions, resulting in the adjusted facial structure model.
[0109] For example, the coordinate adjustment vector corresponding to the brow bone region is defined as an upward shift vector along the facial normal direction, the coordinate adjustment vector corresponding to the cheekbone region is defined as an outward expansion vector along the horizontal direction of the face, the coordinate adjustment vector corresponding to the bridge of the nose region is defined as an upward lifting vector along the central axis of the bridge of the nose, and the coordinate adjustment vector corresponding to the jaw region is defined as a contraction vector along the outer edge of the jaw. The score value of the glabellar line region is converted into a texture weakening coefficient, the score value of the nasolabial fold region is converted into a depression correction coefficient, and the score value of the cheekbone region is converted into a lifting correction coefficient. When the score value of the glabellar line region is 0.82, a smooth correction displacement along the outer normal direction of the face is applied to the key points corresponding to the glabellar line region. When the score value of the cheekbone region is 0.76, an upward correction displacement along the vertical direction is applied to the lower edge key points of the cheekbone region to obtain the local contour structure after the cheekbone is lifted.
[0110] In another example, step S5 may also be preferably performed as follows: Based on the coordinate adjustment vectors of each key point in the structural adjustment parameters and the score values of each aging feature in the aging feature sequence, facial structural deformation rules are constructed. The facial structural deformation rules include structural enhancement processing rules with coordinate adjustment vectors as deformation driving quantities, and aging correction processing rules with score values to determine the correction intensity and processing priority.
[0111] The coordinate adjustment vectors in the structural adjustment parameters are encapsulated according to region categories, and corresponding structural enhancement processing rules are established for the brow bone region, cheekbone region, nasal bridge region, and mandibular region. A scoring level mapping table is established for the scoring values in the aging feature sequence, and different correction intensity coefficients and processing priorities are assigned to different scoring intervals. Among them, the higher the scoring value, the higher the corresponding region correction priority and the larger the correction displacement amplitude. A unified rule scheduling table is established for the structural enhancement processing rules and the aging correction processing rules to perform corresponding region deformation operations based on region category, scoring value, and coordinate adjustment vectors.
[0112] For example, a score range of 0.0 to 0.3 is defined as a mild correction level, a score range of 0.3 to 0.6 is defined as a moderate correction level, and a score range of 0.6 to 1.0 is defined as a severe correction level. When the score of the nasolabial fold area is 0.71, the correction level corresponding to the nasolabial fold area is defined as a severe correction level, and the depression correction processing of the nasolabial fold area is performed first. The coordinate adjustment vector of the bridge of the nose is defined as a continuous lifting vector in the direction of the height of the bridge of the nose, and continuous surface deformation calculation is performed on the bridge of the nose according to the structural enhancement processing rules to obtain the bridge of the nose contour structure corresponding to the target style model.
[0113] Based on the structural enhancement processing sub-rules of the facial structure deformation rules, corresponding coordinate adjustment vectors are applied to the key point coordinates of the brow bone region, cheekbone region, bridge of nose region and jaw region in the 3D facial structure model, respectively. Then, based on the radial basis function interpolation algorithm, smooth deformation propagation calculation is performed on the coordinates of non-key points in each region to complete the structural enhancement processing.
[0114] Corresponding coordinate adjustment vectors are applied to the key point coordinates in the brow bone, cheekbone, bridge of the nose, and mandible regions to change the spatial position of the key points in each region. A radial basis function interpolation algorithm is used to perform continuous surface fitting calculations on the region mesh after the key point coordinates have changed. Specifically, the radial basis function interpolation algorithm uses the Thin Plate Spline radial basis function interpolation algorithm to perform displacement propagation calculations on non-key points in the region through the deformed key points to generate a continuous and smooth regional deformation surface. Attenuation weights are set at the region edge positions to reduce the degree of deformation abruptness at the region boundary positions.
[0115] For example, in the nasal bridge region, an upward coordinate adjustment vector is applied to the key points at the apex of the nasal bridge, and an inward contraction coordinate adjustment vector is applied to the key points on both sides of the nasal bridge contour. The Thin Plate Spline radial basis function interpolation algorithm is used to perform continuous interpolation calculations on the internal grid points of the nasal bridge region, so that the nasal bridge region forms a smooth raised surface. In the mandibular region, an inward contraction coordinate adjustment vector is applied to the key points of the mandibular angle, and an upward smooth displacement is applied to the key points of the mandibular bottom contour to form a narrowed mandibular contour structure.
[0116] Based on the aging correction sub-rules of the facial structure deformation rules, and according to the processing priority from high to low score values in the aging feature sequence, inverse displacement correction vectors positively correlated with the score values of each aging feature are applied to the glabellar lines, nasolabial folds, and cheekbones. The inverse displacement correction vector is obtained by multiplying the score value by a preset correction coefficient, and the specific expression is as follows: Di= ki×Si; Where Di represents the reverse displacement correction vector of the corresponding region, in mm; ki represents the correction coefficient of the corresponding region, in mm, representing the maximum correction displacement amplitude of the corresponding region when the score value is 1; Si represents the score value of the corresponding region, ranging from 0 to 1; the negative sign indicates that the correction direction is opposite to the aging deformation direction.
[0117] For example, when the cheekbone area score is 0.91, corresponding to a correction factor of 6mm, the calculated reverse displacement correction vector for the cheekbone area is: The distance is 5.46mm, and the apple cheek area is lifted and corrected based on the reverse displacement correction vector.
[0118] The aging correction process is completed by performing region-by-region deformation correction on each aging characteristic region.
[0119] The processing priority is determined based on the score value. When multiple aging features have the same score value, deformation correction is performed in a fixed order: frown lines, nasolabial folds, and cheekbones. Among them, a score value greater than 70 corresponds to a high-priority area, a score value between 40 and 70 corresponds to a medium-priority area, and a score value less than 40 corresponds to a low-priority area.
[0120] For example, when the score for frown lines is 82, the score for nasolabial folds is 65, and the score for cheekbones is 41, the deformation correction is performed region by region in the order of frown lines, nasolabial folds, and cheekbones.
[0121] Prioritize the score values of each region in the aging feature sequence, and perform deformation correction calculations on regions with higher score values first; apply a reverse outward expansion displacement correction vector along the texture depression direction to the glabellar line region to reduce the depression depth of the glabellar line region; apply an outward expansion correction displacement along the normal direction of the nasolabial fold region to reduce the ravine degree of the nasolabial fold region; apply an upward lifting correction displacement to the cheekbone region to increase the contour height of the cheekbone region; and dynamically adjust the amplitude of the correction displacement according to the score value.
[0122] For example, when the score for the glabellar line area is 0.88, an outward normal correction displacement with an amplitude of 2.4mm is applied to the key point corresponding to the glabellar line area; when the score for the nasolabial fold area is 0.64, a smooth expansion correction displacement with an amplitude of 1.8mm is applied to the nasolabial fold area; when the score for the cheekbone area is 0.79, a vertical upward correction displacement with an amplitude of 2.1mm is applied to the lowest key point of the cheekbone area, so that the cheekbone area forms a lifted contour structure.
[0123] The three-dimensional facial structure model after structural enhancement and aging correction is used as the adjusted facial structure model.
[0124] The region meshes after structural enhancement and aging correction are uniformly merged, and continuity constraint calculations are performed on the region connection boundaries to reduce contour discontinuities between regions. Mesh smoothing and outlier correction calculations are performed on the adjusted 3D facial structure model to generate a continuous and stable facial structure surface. The key point coordinates, region contour curves, and region surface data in the adjusted 3D facial structure model are uniformly updated to form the final adjusted facial structure model.
[0125] For example, curvature continuity constraint calculations are performed on the connection boundary between the brow bone region and the forehead region to ensure a smooth connection between the brow bone region and the forehead region after lifting; edge transition smoothing calculations are performed on the connection region between the jaw region and the neck region to reduce the contour abruptness caused by jaw contraction; after all regions are fused, an adjusted 3D facial structure model corresponding to the target style model is obtained.
[0126] Step S6: Apply mirror symmetry constraints to the adjusted facial structure model to generate the corresponding simulated facial image.
[0127] Symmetry detection is performed on the left and right symmetrical key points in the adjusted facial structure model to identify the spatial offset differences between the left and right sides; mirror correction is performed on key points whose offset differences exceed a preset symmetry threshold to reduce the inconsistency of the left and right regions; regional control meshes are regenerated for the mirror-corrected key points, and image deformation calculations are performed on the facial image data based on the corrected regional control meshes; skin color fusion and edge smoothing are performed on the deformed facial image data to obtain a simulated facial image.
[0128] For example, when the key point of the left cheekbone region is offset by 3.2mm relative to the key point of the right cheekbone region, the key points of the left and right cheekbone regions are applied with opposite directions and the same magnitude to make the left and right cheekbone regions mirror symmetrical with respect to the midline of the face; after performing symmetrical correction on the contour key points of the bridge of the nose region, a simulation image of the bridge of the nose region consistent with the corrected structural model is generated.
[0129] In another example, step S6 may also be preferably performed as follows: Using the facial midline of the adjusted facial structure model as the axis of symmetry, extract the coordinate pairs of symmetrical key points on the left and right sides, calculate the deviation value of each symmetrical key point coordinate pair relative to the axis of symmetry, and identify symmetrical key point coordinate pairs whose deviation value exceeds the preset symmetry threshold as asymmetrical point pairs.
[0130] The preset symmetry threshold is determined based on the proportion of face width. Specifically, the horizontal distance between the highest points of the left and right cheekbones is used as the face width benchmark, and 3% of the face width benchmark is defined as the preset symmetry threshold.
[0131] For example, when the lateral distance between the highest points of the left and right cheekbones is 142mm, 4.26mm is set as the preset symmetry threshold. When the deviation of any symmetrical key point coordinate pair from the facial midline exceeds 4.26mm, the corresponding symmetrical key point coordinate pair is identified as an asymmetrical point pair.
[0132] The facial midline is constructed using the coordinates of the center point of the nose tip, the center point of the philtrum, and the center point of the chin. A correspondence table of key points on the left and right sides is established based on the facial midline, and mirror matching calculations are performed on the key points on both sides. The difference in horizontal distance and vertical height from the left and right key points to the facial midline is calculated. Key points whose difference in horizontal distance or vertical height exceeds a preset symmetry threshold are identified as asymmetrical point pairs. The preset symmetry threshold is determined based on the facial width ratio.
[0133] For example, when the face width is 140mm, the preset symmetry threshold is defined as 2% of the face width, i.e., 2.8mm; when the difference in distance from the left mandibular angle key point to the facial midline is 3.5mm, the key point pair is identified as an asymmetrical key point pair; when the height difference between the key points in the left and right brow bone regions is 1.2mm, since it does not exceed the preset symmetry threshold of 2.8mm, the original key point position remains unchanged.
[0134] Equal and opposite correction offsets are applied to the left and right coordinates of the asymmetrical point pairs to ensure that the corrected left and right coordinates satisfy the mirror symmetry constraint condition relative to the axis of symmetry, thereby completing the mirror symmetry constraint processing and obtaining the facial structure model after mirror symmetry constraint processing.
[0135] For the identified asymmetric points, calculate the mid-symmetric position of the key points on the left and right sides; based on the mid-symmetric position, apply equal reverse correction displacements to the key points on the left and right sides to keep the distance from the key points on the left and right sides to the facial midline consistent; perform local surface continuity constraint calculations on the corrected key points to reduce the regional tortuosity phenomenon generated after key point correction; regenerate the facial structure surface for all corrected key points to obtain the facial structure model after mirror symmetry constraint processing.
[0136] For example, when the left cheekbone key point is 72mm from the midline of the face and the right cheekbone key point is 68mm from the midline of the face, the intermediate symmetrical distance is calculated to be 70mm. A 2mm inward correction displacement is applied to the left cheekbone key point and a 2mm outward correction displacement is applied to the right cheekbone key point to keep the left and right cheekbone key points mirror symmetrical with respect to the midline of the face.
[0137] Using the keypoint coordinate set of the facial structure model after mirror symmetry constraint processing as the deformation control field, a thin-plate spline transformation-based algorithm is employed to perform pixel-level spatial mapping transformation on the facial image data, generating a simulated facial image corresponding to the mirror symmetry constraint-processed facial structure model. Skin tone consistency correction and edge smoothing fusion processing are then performed on the simulated facial image. Specifically, skin tone consistency correction is based on the Lab color space. Both the simulated and original facial images are converted to the Lab color space, and the mean values of the luminance and color channels of the facial region are statistically analyzed. A histogram matching algorithm is then used to adjust the pixel distribution of the corresponding channels in the simulated facial image, ensuring that the skin tone parameters of the simulated and original facial images are consistent. This histogram matching algorithm is the Histogram Matching algorithm.
[0138] For example, when the mean value of the L channel of the original facial image is 68 and the mean value of the L channel of the simulated facial image is 74, the mean value of the L channel of the simulated facial image is adjusted to the range of 69 to 71 by using a histogram matching algorithm to complete the skin color consistency correction.
[0139] The processed simulated facial image is compared and combined with the original facial image side by side to output the simulation result of the micro-plastic surgery effect in the form of a comparison image combination.
[0140] The keypoint coordinates after mirror symmetry constraint processing are used as the control point set, and the original keypoint coordinates are used as the source point set. A spatial mapping relationship between the source point set and the control point set is established using the Thin Plate Spline transformation algorithm. Based on the spatial mapping relationship, pixel-by-pixel deformation calculations are performed on the pixel positions in the facial image data to generate a simulated facial image consistent with the adjusted facial structure model. Skin color consistency correction in Lab color space is performed on the simulated facial image, and Gaussian smoothing fusion processing is performed on the region edges to reduce the jaggedness of the region boundaries. The simulated facial image and the original facial image are combined side by side and output at a uniform resolution.
[0141] For example, the pixel coordinates of the bridge of the nose in the original facial image are mapped to the adjusted control point positions of the bridge of the nose using the Thin Plate Spline transformation algorithm, so that the bridge of the nose in the simulated facial image has a raised visual effect; Gaussian smoothing with a radius of 5 pixels is applied to the edge of the cheek area to reduce the transitional abruptness of the cheek area edge; the original facial image and the simulated facial image are output in a left-right comparison form to show the simulation effect before and after facial micro-plastic surgery.
[0142] In this embodiment, facial image data of the target user is acquired, and a three-dimensional facial structure model containing structural parameters of the brow bone region, cheekbone region, bridge of the nose region, and jaw region is constructed based on a multi-dimensional key point coordinate set, thereby realizing the digital expression of the target user's bone structure features. By calculating the cosine similarity between the bone structure feature vector corresponding to the facial structure model and the bone structure feature vector in a celebrity sample database, the target style model with the highest matching degree with the target user is determined, and the corresponding style structure parameters are extracted, achieving bone style matching between the target user and the target style model. The style structure parameters are then compared with the structural parameters of the corresponding regions of the facial structure model. Offset calculation, combined with regional coordinate mapping and interpolation diffusion calculation to generate structural adjustment parameters, achieves structured deformation control of key facial regions; by identifying, scoring and ranking aging features of the glabellar lines, nasolabial folds and cheek area, differentiated correction is achieved for different aging feature regions; by constructing facial structure deformation rules, structural enhancement and aging correction processing are performed on the 3D facial structure model, and simulated facial images are generated by combining mirror symmetry constraints and thin plate spline transformation algorithms, realizing the visualization simulation of facial micro-plastic surgery effects, thereby improving the structural matching degree and simulation naturalness between the simulated facial micro-plastic surgery effect results and the target style model.
[0143] like Figure 8 As shown, this application example also provides a simulation system 10 for facial micro-plastic surgery effects, specifically including an image acquisition module 11, a style matching module 12, a data mapping module 13, a data sorting module 14, a rule construction module 15, and a simulation module 16.
[0144] in: The image acquisition module 11 is used to acquire facial image data of the target user, perform key point detection on the facial image data, extract facial structural features, and construct a facial structural model.
[0145] The style matching module 12 is used to calculate the similarity between the facial structure model and the preset celebrity sample library, determine the target style model with the highest matching degree with the target user, and extract the corresponding style structure parameters.
[0146] The data mapping module 13 is used to determine the structural offset of each key facial region in the target style model based on the style structure parameters, and to map the structural offset to the corresponding region position of the facial structure model to generate structural adjustment parameters.
[0147] The data sorting module 14 is used to identify aging features from facial image data, extract aging feature data, and sort the aging feature data to generate an aging feature sequence.
[0148] The rule construction module 15 is used to construct facial structure deformation rules based on structural adjustment parameters and aging feature sequences. The facial structure deformation rules are used to perform regional deformation calculations on the facial structure model to obtain the adjusted facial structure model.
[0149] The simulation module 16 is used to apply mirror symmetry constraints to the adjusted facial structure model and generate the corresponding simulated facial image.
[0150] In this embodiment, the image acquisition module 11 performs multi-dimensional key point detection and facial structure feature extraction on the target user's facial image data, and constructs a facial structure model including structural parameters of the brow bone region, cheekbone region, bridge of nose region, and jaw region by combining the facial midline partitioning rules, so that the facial structure model can accurately reflect the bone structure features of the target user; the style matching module 12 calculates the cosine similarity between the bone structure feature vector corresponding to the facial structure model and the bone structure feature vector in the celebrity sample library, and determines the target style model according to the similarity score sequence, so that the target style model maintains a high degree of matching with the target user's original bone structure; the data mapping module 13 performs region mapping and interpolation diffusion calculation on the structural parameter difference between the target style model and the facial structure model to generate the corresponding key points. The structural adjustment parameters ensure continuity and regional correlation in the deformation adjustment process of key facial regions. The data sorting module 14 identifies and scores aging features in the glabellar lines, nasolabial folds, and cheek area, giving the aging feature correction process a clear priority. The rule construction module 15 constructs facial structural deformation rules based on the structural adjustment parameters and aging feature sequences, performing structural enhancement and aging correction processing on each region, ensuring the adjusted facial structural model simultaneously satisfies style approximation and aging correction effects. The simulation module 16 applies mirror symmetry constraints and pixel-level spatial mapping transformations to the adjusted facial structural model, generating a simulated facial image corresponding to the target style model, thereby improving the structural consistency, regional coordination, and visual realism of the facial micro-plastic surgery simulation results.
[0151] like Figure 9 As shown, this application example also provides an electronic device 20, including a memory 21 and a processor 22. The memory 21 stores a computer program that can run on the processor 22. When the processor 22 executes the computer program, it implements the above-mentioned simulation method for facial micro-plastic surgery effects.
[0152] In this embodiment, the memory 21 stores a computer program for simulating the facial micro-plastic surgery effect. The processor 22 calls the computer program to perform facial image data acquisition, key point detection, facial structure model construction, similarity calculation of celebrity sample library, structural offset mapping, aging feature sorting, facial structure deformation rule construction, and mirror symmetry constraint processing. This enables the electronic device 20 to automatically generate a corresponding simulated facial image based on the target user's facial structure features. At the same time, the processor 22 performs regional deformation control on the key point coordinates corresponding to each key facial region and performs regional correction processing in combination with the aging feature score value. This allows the simulation result to achieve style convergence adjustment and aging correction adjustment while maintaining the target user's original facial features. In addition, the processor 22 calls the thin plate spline transformation algorithm and skin color consistency correction algorithm to perform spatial mapping processing and edge fusion processing on the simulated facial image, so that the generated simulated facial image has high facial structure coordination and visual continuity.
[0153] This application also provides a computer-readable storage medium having a computer program stored thereon, which, when run by a processor, causes the processor to perform a simulation method for facial micro-plastic surgery effects as described above.
[0154] In this embodiment, a computer program for simulating the facial micro-plastic surgery effect is stored in a computer-readable storage medium. When the processor runs the computer program, it can perform tasks such as acquiring facial image data of the target user, extracting key point coordinates, constructing a facial structure model, matching style from a celebrity sample library, generating structural adjustment parameters, identifying and ranking aging features, constructing facial structure deformation rules, and performing mirror symmetry constraint processing, thereby generating a corresponding simulated facial image. Furthermore, the computer program performs structural parameter offset calculations and interpolation diffusion processing on the brow bone region, cheekbone region, bridge of the nose region, and jaw region respectively, ensuring regional continuity in the deformation process of each region. By performing scoring, ranking, and reverse displacement correction processing on the frown lines region, nasolabial folds region, and cheek area, the facial aging feature correction process has clear quantitative basis and processing priority. By performing mirror symmetry constraints and pixel-level spatial mapping transformation on the adjusted facial structure model, the output simulated facial image has high structural symmetry and visual simulation effect.
[0155] It should be noted that those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the device and each module described above can be referred to the corresponding process in the aforementioned Embodiment 1, and will not be repeated here.
[0156] The above embodiments are merely illustrative examples for clear explanation and are not intended to limit the implementation. Those skilled in the art will recognize that other variations or modifications can be made based on the above description. It is neither necessary nor possible to exhaustively list all possible implementations. However, obvious variations or modifications derived therefrom are still within the scope of protection of this invention.
Claims
1. A method for simulating the effects of facial micro-plastic surgery, characterized in that, include: Acquire facial image data of the target user, perform key point detection on the facial image data, extract facial structural features, and construct a facial structural model; The facial structure model is compared with a preset celebrity sample library to calculate the similarity, determine the target style model with the highest matching degree with the target user, and extract the corresponding style structure parameters. Based on the style structure parameters, the structural offset of each key facial region in the target style model is determined, and the structural offset is mapped to the corresponding region position of the facial structure model to generate structural adjustment parameters; The facial image data is subjected to aging feature recognition, aging feature data is extracted, and the aging feature data is sorted to generate an aging feature sequence; Based on the structural adjustment parameters and the aging feature sequence, facial structure deformation rules are constructed, and the facial structure model is subjected to regional deformation calculation using the facial structure deformation rules to obtain the adjusted facial structure model. The adjusted facial structure model is subjected to mirror symmetry constraints to generate a corresponding simulated facial image.
2. The simulation method for facial micro-plastic surgery effects according to claim 1, characterized in that, The steps of acquiring facial image data of the target user, performing key point detection on the facial image data, and extracting facial structural features to construct a facial structural model include: Facial image data of the target user is acquired by a multi-angle image acquisition module, and the facial image data is preprocessed to obtain a standardized facial image; The standardized facial image is input into a pre-trained cascaded convolutional neural network keypoint detection model to locate the facial regions in the standardized facial image, thereby extracting a multi-dimensional keypoint coordinate set; wherein, the multi-dimensional keypoint coordinate set includes the coordinates of the highest point of the brow bone, the coordinates of the inner and outer endpoints of the brow bone, the coordinates of the highest point of the cheekbone, the coordinate sequence of the outer contour of the cheekbone, the coordinates of the apex of the bridge of the nose, the coordinate sequence of the contours of both sides of the bridge of the nose, the coordinates of the mandibular angle, and the coordinate sequence of the contour of the bottom of the mandible. The brow bone arch curvature parameter is calculated based on the coordinates of the highest point of the brow bone and the coordinates of the inner and outer endpoints of the brow bone. The cheekbone prominence value is calculated based on the coordinates of the highest point of the cheekbone and the coordinate sequence of the outer contour of the cheekbone. The nasal bridge side contour curve parameter is calculated based on the coordinates of the apex of the bridge of the nose and the coordinate sequence of the two sides of the bridge of the nose. The mandibular contour curve parameter is calculated based on the coordinates of the mandibular angle and the coordinate sequence of the bottom of the mandible. Obtain the facial midline of the target user, and divide the brow bone arch curvature parameter, cheekbone prominence value, nasal bridge side contour curve parameter and mandibular contour curve parameter into left and right sections based on the facial midline as a symmetry reference to obtain the facial parameters of the left and right sections. The multi-dimensional key point coordinate set and the facial parameters are fused using a 3D reconstruction algorithm to construct a facial structure model.
3. The simulation method for facial micro-plastic surgery effects according to claim 1, characterized in that, The celebrity sample library stores facial structure models and corresponding bone structure feature vectors of several celebrity samples. The bone structure feature vectors include brow bone arch curvature parameters, cheekbone prominence measurement values, nasal bridge side profile curve parameters, and mandibular profile curve parameters. The step of calculating the similarity between the facial structure model and a preset star sample library, determining the target style model with the highest matching degree for the target user, and extracting the corresponding style structure parameters includes: Performing cosine similarity calculations on the bone structure feature vectors corresponding to the facial structure model and the bone structure feature vectors of each star sample in the preset star sample library respectively to obtain a similarity score sequence between the target user and each star sample; Sorting the star samples in the star sample library in descending order according to the similarity score sequence, and selecting the facial structure model corresponding to the star sample with the highest similarity score as the target style model; Extracting the structure parameters corresponding to each facial key area from the target style model, and taking all the structure parameters as the style structure parameters corresponding to the target style model.
4. The simulation method for facial micro-plastic surgery effects according to claim 1, characterized in that, The step of determining the structural offset of each facial key area in the target style model based on the style structure parameters and mapping the structural offset to the corresponding area position of the facial structure model to generate the structure adjustment parameters includes: Performing a term-by-term subtraction operation on the numerical values of the structure parameters of each facial key area in the style structure parameters and the numerical values of the structure parameters of the corresponding area in the facial structure model to obtain the structural offset; Establishing a regional coordinate mapping relationship based on the key point coordinate sets of each facial key area in the facial structure model, and mapping the structural offsets of each facial key area to the corresponding key point coordinate positions of the facial structure model according to the regional coordinate mapping relationship; Performing interpolation diffusion calculation on the structural offset using the spatial weight distribution of the key point coordinate positions of each area to generate a coordinate adjustment vector for each key point coordinate within each area, and taking all the coordinate adjustment vectors as the structure adjustment parameters.
5. The simulation method for facial micro-plastic surgery effects according to claim 1, characterized in that, The step of performing aging feature recognition on the facial image data, extracting aging feature data, and sorting the aging feature data to generate an aging feature sequence includes: Performing local texture enhancement on the facial image data, and performing segmentation and positioning on the enhanced facial image data to obtain the glabellar line area, nasolabial fold area, and malar area; Extracting the vertical cross-section gray-scale gradient profile along the glabellar line direction of the glabellar line area, and calculating the gray-scale gradient extreme value to obtain the glabellar line depth value; Extracting the coordinate sequence of continuous contour points along the nasolabial fold extension direction of the nasolabial fold area, and calculating the arc length integral of the coordinate sequence to obtain the nasolabial fold length value; Extracting the vertical distance between the lowest point coordinate of the malar contour in the malar area and the standard reference baseline, and taking the vertical distance as the malar sag value; Taking the glabellar line depth value, nasolabial fold length value, and malar sag value as aging feature data, and performing normalized scoring on the aging feature data through a preset hierarchical scoring function to obtain the scoring values corresponding to each aging feature; Sorting each aging feature in descending order according to the scoring value to generate an aging feature sequence.
6. The simulation method for facial micro-plastic surgery effects according to claim 1, characterized in that, The steps of constructing facial structure deformation rules based on the structural adjustment parameters and the aging feature sequence, and using the facial structure deformation rules to perform regional deformation calculations on the facial structure model to obtain the adjusted facial structure model include: Based on the adjustment vectors of the coordinates of each key point in the structural adjustment parameters and the score values of each aging feature in the aging feature sequence, facial structure deformation rules are constructed. According to the facial structure deformation rules, corresponding coordinate adjustment vectors are applied to the key point coordinates of the brow bone region, cheekbone region, bridge of nose region and jaw region in the facial structure model, and smooth deformation propagation calculation is performed on the coordinates of non-key points in each region to complete the structural enhancement process. According to the facial structure deformation rules and the processing priority from high to low in the aging feature sequence, reverse displacement correction vectors that are positively correlated with the aging feature score are applied to the frown lines, nasolabial folds and cheek area respectively, so as to perform region-by-region deformation correction of each aging feature area and complete the aging correction process. The facial structure model after the aforementioned structural enhancement and aging correction processes is used as the adjusted facial structure model.
7. The simulation method for facial micro-plastic surgery effects according to claim 1, characterized in that, The step of applying mirror symmetry constraints to the adjusted facial structure model to generate a corresponding simulated facial image includes: Using the facial midline of the adjusted facial structure model as the axis of symmetry, extract the coordinate pairs of symmetrical key points on the left and right sides, calculate the deviation value of each symmetrical key point coordinate pair relative to the axis of symmetry, and identify symmetrical key point coordinate pairs whose deviation value exceeds a preset symmetry threshold as asymmetrical point pairs. Equal and opposite correction offsets are applied to the left and right coordinates of the asymmetric point pair so that the corrected left and right coordinates satisfy the mirror symmetry constraint condition relative to the axis of symmetry, thus obtaining the facial structure model after mirror symmetry constraint processing. The key point coordinate set of the facial structure model after the mirror symmetry constraint processing is used as the deformation control field to perform pixel-level spatial mapping transformation on the facial image data, generating a simulated facial image corresponding to the facial structure model after the mirror symmetry constraint processing.
8. A simulation system for facial micro-plastic surgery effects, characterized in that, include: The image acquisition module is used to acquire facial image data of the target user, perform key point detection on the facial image data, extract facial structural features, and construct a facial structural model. The style matching module is used to calculate the similarity between the facial structure model and a preset celebrity sample library, determine the target style model with the highest matching degree with the target user, and extract the corresponding style structure parameters. The data mapping module is used to determine the structural offset of each key facial region in the target style model based on the style structure parameters, and to map the structural offset to the corresponding region position of the facial structure model to generate structural adjustment parameters. The data sorting module is used to identify aging features in the facial image data, extract aging feature data, and sort the aging feature data to generate an aging feature sequence. The rule construction module is used to construct facial structure deformation rules based on the structural adjustment parameters and the aging feature sequence, and to perform regional deformation calculations on the facial structure model using the facial structure deformation rules to obtain the adjusted facial structure model. The simulation module is used to apply mirror symmetry constraints to the adjusted facial structure model and generate a corresponding simulated facial image.
9. An electronic device, characterized in that, The method includes a memory and a processor, the memory storing a computer program that can run on the processor, and the processor executing the computer program to implement the simulation method for facial micro-plastic surgery effects as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, It stores a computer program that, when run by a processor, causes the processor to perform a simulation method for facial micro-plastic surgery effects as described in any one of claims 1 to 7.