Face image editing method, device and equipment and storage medium
By performing expression and stylistic transformations on facial images during video shooting and then fusion them, the problem of the difficulty in flexibly changing facial expressions and styles is solved, enabling diverse and personalized image editing effects and improving the flexibility and interactivity of video or photo shooting.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING QIHOOD TECHNOLOGY CO LTD
- Filing Date
- 2024-12-10
- Publication Date
- 2026-06-12
AI Technical Summary
In existing video shooting and editing technologies, it is difficult to flexibly change and adjust facial expressions and styles in real time, resulting in monotonous video footage that lacks interactivity and entertainment value, and fails to meet users' needs for personalized expression and creative effects.
By acquiring facial information from the original face image, performing expression and stylistic transformations, and then fusing the edited face image with the original face image, diverse expressions and stylistic transformations are achieved. Deep learning models such as convolutional neural networks and generative adversarial networks are used for feature extraction and image editing.
It enables diverse expressions and personalized stylistic transformations during video or image shooting, improving the flexibility of video or image shooting, overcoming the technical shortcomings of fixed facial expressions and styles, and enhancing the interactivity and entertainment value of videos or images.
Smart Images

Figure CN122199712A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and in particular to methods, apparatus, devices and storage media for editing human face images. Background Technology
[0002] With the development of video shooting and editing technologies, the demand for video content creation is becoming increasingly diversified, especially in applications such as social media, the entertainment industry, and virtual reality (VR) and augmented reality (AR), where users' needs for personalized and creative expression are gradually increasing. The diverse variations in facial expressions and styles play a crucial role in many fields (such as filmmaking, short video creation, and live streaming). However, current video shooting and editing technologies still have certain limitations. Especially during real-time video shooting, facial expressions and styles are often fixed, making flexible changes and real-time adjustments difficult. This limitation makes the video visuals appear monotonous, lacking sufficient interactivity and entertainment value, and failing to meet users' needs for personalized expression and creative effects.
[0003] Therefore, how to achieve diverse facial expression changes and personalized stylistic transformations to improve the flexibility of video or photo shooting is a problem that urgently needs to be solved.
[0004] The above content is only used to help understand the technical solution of this application and does not represent an admission that the above content is prior art. Summary of the Invention
[0005] The main objective of this application is to provide a method, apparatus, device, and storage medium for editing facial images, aiming to solve the technical problem that facial expressions and styles are usually fixed during real-time video shooting, making it difficult to flexibly change and adjust them in real time.
[0006] To achieve the above objectives, this application proposes a face image editing method, the method comprising:
[0007] Obtain the original face image and extract facial information from the original face image to obtain image attribute information;
[0008] Based on the image attribute information, the original face image is edited to obtain an edited face image, wherein the image editing includes at least expression transformation and / or stylization transformation;
[0009] The edited face image is fused with the original face image to obtain the target face image.
[0010] In one embodiment, the step of image editing the original face image based on the image attribute information to obtain an edited face image includes:
[0011] Acquire facial expression data and stylization data;
[0012] Based on the image attribute information and the expression data, the original face image is subjected to expression transformation to obtain the face image after expression transformation;
[0013] Based on the image attribute information and the stylization data, the original face image is stylized to obtain a stylized face image;
[0014] The edited face image is determined based on the face image after the expression transformation and / or the face image after the stylization transformation.
[0015] In one embodiment, the step of performing expression transformation on the original face image based on the image attribute information and the expression data to obtain an expression-transformed face image includes:
[0016] Determine the original facial feature point parameters based on the image attribute information;
[0017] Determine the target facial feature point parameters after the expression transformation based on the expression data;
[0018] The offset of each facial feature point is determined based on the original facial feature point parameters and the target facial feature point parameters;
[0019] The original face image is subjected to expression transformation based on the offset of each facial feature point to obtain the expression-transformed face image.
[0020] In one embodiment, the step of performing expression transformation on the original face image based on the offset of each facial feature point to obtain an expression-transformed face image includes:
[0021] An offset matrix is generated based on the offset of each facial feature point.
[0022] Based on the offset matrix, each facial feature point in the original face image is offset to obtain a face image with offset feature points.
[0023] The facial image with the offset feature points is subjected to local region deformation to obtain a facial image with changed expression.
[0024] In one embodiment, the step of performing a stylistic transformation on the original face image based on the image attribute information and the stylization data to obtain a stylized face image includes:
[0025] Facial content features are determined based on the image attribute information;
[0026] Style features are determined based on the stylized data;
[0027] The original face image is stylized based on the facial content features and the style features to obtain the stylized face image.
[0028] In one embodiment, the step of performing a stylistic transformation on the original face image based on the facial content features and the style features to obtain a stylized face image includes:
[0029] The original face image is style-transferred based on the style features to obtain a style-transferred face image;
[0030] The style-transferred face image is corrected based on the facial content features to obtain a stylized face image.
[0031] In one embodiment, the step of performing style transfer on the original face image based on the style features to obtain a style-transferred face image includes:
[0032] Color and texture features are determined based on the style features;
[0033] The original face image is subjected to color style transfer and texture style transfer based on the color features and texture features, respectively, to obtain a style-transferred face image.
[0034] In one embodiment, the step of correcting the style-transferred facial image based on the facial content features to obtain a stylized facial image includes:
[0035] The content loss is determined based on the facial content features and the style-transferred facial image;
[0036] When the content loss reaches a preset loss threshold, the style-transferred face image is corrected to obtain a stylized face image.
[0037] When the content loss does not reach the preset loss threshold, the style-transferred face image is used as the stylized face image.
[0038] In one embodiment, fusing the edited face image with the original face image to obtain the target face image includes:
[0039] The original face image is aligned with its feature points based on the edited face image to obtain the aligned original face image.
[0040] The aligned original face image and the edited face image are fused to obtain a fused face image;
[0041] The fused face image is smoothed to obtain the target face image.
[0042] In one embodiment, fusing features between the aligned original face image and the edited face image to obtain a fused face image includes:
[0043] Global features are extracted from the aligned original face image and the edited face image respectively to obtain the first global feature and the second global feature;
[0044] The first global feature and the second global feature are weighted and averaged to obtain the fused global feature.
[0045] The fused global features are mapped to obtain the fused face image.
[0046] Furthermore, to achieve the above objectives, this application also proposes a face image editing device, which includes:
[0047] The acquisition module is used to acquire the original face image and extract facial information from the original face image to obtain image attribute information;
[0048] An editing module is used to perform image editing on the original face image based on the image attribute information to obtain an edited face image, wherein the image editing includes at least expression transformation and / or stylization transformation;
[0049] The fusion module is used to fuse the edited face image with the original face image to obtain the target face image.
[0050] In one embodiment, the editing module is further configured to acquire facial expression data and stylization data;
[0051] Based on the image attribute information and the expression data, the original face image is subjected to expression transformation to obtain the face image after expression transformation;
[0052] Based on the image attribute information and the stylization data, the original face image is stylized to obtain a stylized face image;
[0053] The edited face image is determined based on the face image after the expression transformation and / or the face image after the stylization transformation.
[0054] In one embodiment, the editing module is further configured to determine the original facial feature point parameters based on the image attribute information;
[0055] Determine the target facial feature point parameters after the expression transformation based on the expression data;
[0056] The offset of each facial feature point is determined based on the original facial feature point parameters and the target facial feature point parameters;
[0057] The original face image is subjected to expression transformation based on the offset of each facial feature point to obtain the expression-transformed face image.
[0058] In one embodiment, the editing module is further configured to generate an offset matrix based on the offset of each facial feature point;
[0059] Based on the offset matrix, each facial feature point in the original face image is offset to obtain a face image with offset feature points.
[0060] The facial image with the offset feature points is subjected to local region deformation to obtain a facial image with changed expression.
[0061] In one embodiment, the editing module is further configured to determine facial content features based on the image attribute information;
[0062] Style features are determined based on the stylized data;
[0063] The original face image is stylized based on the facial content features and the style features to obtain the stylized face image.
[0064] In one embodiment, the editing module is further configured to perform style transfer on the original face image based on the style features to obtain a style-transferred face image;
[0065] The style-transferred face image is corrected based on the facial content features to obtain a stylized face image.
[0066] In one embodiment, the editing module is further configured to determine color features and texture features based on the style features;
[0067] The original face image is subjected to color style transfer and texture style transfer based on the color features and texture features, respectively, to obtain a style-transferred face image.
[0068] In one embodiment, the editing module is further configured to determine content loss based on the facial content features and the style-transferred face image;
[0069] When the content loss reaches a preset loss threshold, the style-transferred face image is corrected to obtain a stylized face image.
[0070] When the content loss does not reach the preset loss threshold, the style-transferred face image is used as the stylized face image.
[0071] In addition, to achieve the above objectives, this application also proposes a face image editing device, the device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the face image editing method as described above.
[0072] In addition, to achieve the above objectives, this application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of the face image editing method described above.
[0073] In addition, to achieve the above objectives, this application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the face image editing method described above.
[0074] This application provides a method for editing facial images. The method involves first acquiring an original facial image and then extracting facial information from the original image to obtain image attribute information. Based on the image attribute information, the original facial image is then edited to obtain an edited facial image. The image editing includes at least expression transformation and / or stylization transformation. The edited facial image is then fused with the original facial image to obtain a target facial image. This method enables diverse expression transformations and personalized stylization transformations, effectively improving the flexibility of video or image capture.
[0075] In summary, this application, by extracting key points from each frame of the original facial image during video shooting, can accurately capture the key features of the face. Based on image attribute information, it can then perform expression transformation and / or stylization transformation on each frame of the original facial image, enabling diverse expression transformations and personalized stylization transformations during video shooting. Furthermore, the edited facial image is then fused with the original facial image, achieving a natural transition between the two, improving image editing effects, ensuring the flexibility of video or image shooting, and overcoming the technical shortcomings of fixed facial expressions and styles during real-time video shooting, which are difficult to flexibly change and adjust in real time. This allows for diverse expression transformations and personalized stylization transformations, effectively improving the flexibility of video or image shooting. Attached Figure Description
[0076] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0077] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0078] Figure 1 This is a flowchart illustrating an embodiment of the applicant's face image editing method.
[0079] Figure 2 This is a flowchart illustrating Embodiment 2 of the applicant's face image editing method;
[0080] Figure 3 This is a schematic diagram of the module structure of the face image editing device according to an embodiment of this application;
[0081] Figure 4 This is a schematic diagram of the device structure of the hardware operating environment involved in the face image editing method of this application embodiment.
[0082] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0083] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.
[0084] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.
[0085] The main solution of this application embodiment is: to acquire an original face image and extract facial information from the original face image to obtain image attribute information; to perform image editing on the original face image based on the image attribute information to obtain an edited face image, wherein the image editing includes at least expression transformation and / or stylization transformation; and to fuse the edited face image with the original face image to obtain a target face image.
[0086] With the development of video shooting and editing technologies, the demand for video content creation is becoming increasingly diversified, especially in applications such as social media, the entertainment industry, and virtual reality (VR) and augmented reality (AR), where users' needs for personalized and creative expression are gradually increasing. The diverse variations in facial expressions and styles play a crucial role in many fields (such as filmmaking, short video creation, and live streaming). However, current video shooting and editing technologies still have certain limitations. Especially during real-time video shooting, facial expressions and styles are often fixed, making flexible changes and real-time adjustments difficult. This limitation makes video footage appear monotonous, lacking sufficient interactivity and entertainment value, and failing to meet users' demands for personalized expression and creative effects. Therefore, how to achieve diverse facial expression changes and personalized stylistic transformations, improving the flexibility of video or image shooting, is a problem that urgently needs to be solved.
[0087] This application extracts key points from each frame of the original facial image during video shooting, accurately capturing key facial features. Based on image attribute information, it performs expression and / or stylistic transformations on each frame of the original facial image, enabling diverse expression changes and personalized stylistic transformations during video shooting. The edited facial image is then fused with the original facial image, achieving a natural transition and improving image editing effects. This ensures the flexibility of video or image shooting and overcomes the technical shortcomings of fixed facial expressions and styles during real-time video shooting, which are difficult to flexibly change and adjust in real time. It enables diverse expression changes and personalized stylistic transformations, effectively improving the flexibility of video or image shooting.
[0088] It should be noted that the executing entity in this embodiment can be a computing service device with data processing, network communication, and program execution functions, such as a tablet computer, personal computer, or mobile phone, or an electronic device or face image editing device capable of performing the above functions. The following description uses a face image editing device as an example to illustrate this embodiment and the subsequent embodiments.
[0089] Based on this, embodiments of this application provide a face image editing method, referring to... Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the applicant's face image editing method.
[0090] In this embodiment, the face image editing method includes steps S10 to S30:
[0091] Step S10: Obtain the original face image and extract facial information from the original face image to obtain image attribute information.
[0092] It should be noted that the original face image can be a real-time frame from a video recording or a static image pre-stored in the device; this embodiment does not impose any specific restrictions on this.
[0093] It is understood that image attribute information includes facial feature point parameters and facial content features. Among them, facial feature point parameters refer to the positional information of key parts such as eyes, nose, mouth, and eyebrows, while facial content features refer to geometric structural features and facial expression features based on the human face. This embodiment does not impose specific limitations on these.
[0094] Specifically, facial information extraction can be achieved using deep learning models, such as convolutional neural networks (CNNs), which can be trained to identify and locate key feature points on a person's face and extract facial content features. During the extraction process, pre-trained models, such as OpenPose or Dlib, can be used, which are capable of efficiently extracting key points and facial features from images.
[0095] Step S20: Based on the image attribute information, perform image editing on the original face image to obtain an edited face image, wherein the image editing includes at least expression transformation and / or stylization transformation.
[0096] It should be noted that image editing includes at least expression transformation and / or stylization transformation. Expression transformation refers to changing the facial expression features of the original face image, which may include, but is not limited to, simulating expressions such as smiling, frowning, and surprise. Stylization transformation involves converting the original image into different artistic styles, such as cartooning, sketching, or oil painting effects. These transformations can be achieved through preset transformation models or algorithms, for example, using generative adversarial networks (GANs) to generate images with specific expressions or styles; this embodiment does not impose specific limitations on this.
[0097] Understandably, when editing images, image attribute information can be used to guide the transformation process, ensuring that the edited image retains the original facial features while achieving a natural transition in expression and style. For example, facial feature point parameters can be used to adjust the precision of expression transformation, while facial content features help maintain the individual characteristics of the person during stylized transformations.
[0098] Step S30: The edited face image is fused with the original face image to obtain the target face image.
[0099] It should be noted that the target face image can be a face image after expression transformation, a face image after stylization transformation, or a face image after both expression transformation and stylization transformation. This embodiment does not impose specific limitations on this.
[0100] Understandably, the fusion process can employ various image processing techniques, such as image blending and image fusion algorithms, to ensure a smooth transition between the edited and original facial images, thereby generating natural and realistic target facial images. During fusion, visual features such as color, brightness, and contrast, as well as the degree of matching of facial feature points, can be considered to ensure a visually seamless fusion while preserving the individual's personality traits and natural expressions.
[0101] In one feasible implementation, step S30 may include: aligning feature points of the original face image with the edited face image to obtain an aligned original face image; fusing features of the aligned original face image and the edited face image to obtain a fused face image; and smoothing the fused face image to obtain a target face image.
[0102] It should be noted that feature point alignment refers to matching and adjusting the feature points in the edited face image with the corresponding feature points in the original face image to ensure consistency in their spatial positions, thereby reducing visual inconsistencies that may occur during the fusion process.
[0103] Understandably, feature fusion, based on feature point alignment, uses algorithms to combine the edited face image with corresponding parts of the aligned original face image, forming a composite image that incorporates features from both. Smoothing further eliminates any unnatural transitions or edges in the fused image, ensuring the visual coherence and naturalness of the final target face image.
[0104] Specifically, smoothing the fused face image can include: applying a Gaussian blur algorithm to initially smooth the fused face image to reduce details and noise, thereby reducing visual abruptness; using edge detection technology to identify edges in the fused image and then softening these edges to reduce the obvious boundaries of the image fusion region; performing local color correction on the fused face image to ensure natural color transitions between different parts of the image and avoid visual differences caused by color inconsistencies; and finally, adjusting the overall brightness and contrast of the image using image enhancement techniques to make the target face image more vivid and lifelike. Through these methods, a target face image with a natural transition that retains the features of the original face image while incorporating edited expressions and / or style features can be obtained.
[0105] In one feasible implementation, the step of fusing features between the aligned original face image and the edited face image to obtain a fused face image includes: extracting global features from the aligned original face image and the edited face image respectively to obtain a first global feature and a second global feature; performing a weighted average fusion of the first global feature and the second global feature to obtain a fused global feature; and mapping based on the fused global feature to obtain the fused face image.
[0106] It should be noted that global feature extraction refers to extracting feature information from an image that can represent the entire image content and style. These features typically include color distribution, texture, shape, spatial layout, etc., which together constitute the global visual representation of the image. The first global feature and the second global feature are all the features of the aligned original face image and the edited face image, respectively.
[0107] Understandably, in this implementation, global feature extraction can be achieved using a pre-trained deep learning model, such as a variant of a convolutional neural network (CNN), which is capable of effectively extracting global features from an image. Weighted average fusion refers to combining the first and second global features according to a certain weight ratio to ensure that the fused global features balance the features of the original and edited images.
[0108] It's worth noting that mapping refers to mapping the fused global features back into the image space to generate the final fused face image. This mapping process can employ deep learning models, such as Generative Adversarial Networks (GANs), which learn how to transform global features into highly realistic images. In this way, it ensures that the fused image is visually consistent with both the original and edited images, while also possessing new facial and / or stylistic features.
[0109] Specifically, the mapping process can also utilize the generator part of a Generative Adversarial Network (GAN), taking the fused global features as input to generate the corresponding face image. A GAN is a deep learning model consisting of a generator and a discriminator. The generator is responsible for generating fake images that are as close to the real image as possible, while the discriminator is responsible for distinguishing between the generated and real images. In this way, a fused face image that is visually highly consistent with both the original and edited face images can be obtained.
[0110] This embodiment provides a method for editing facial images. First, an original facial image is acquired, and facial information is extracted from the original facial image to obtain image attribute information. Based on the image attribute information, the original facial image is edited to obtain an edited facial image. The image editing includes at least expression transformation and / or stylization transformation. The edited facial image is then fused with the original facial image to obtain a target facial image. This method enables diverse expression transformations and personalized stylization transformations, effectively improving the flexibility of video or image capture.
[0111] In summary, this embodiment extracts key points from each frame of the original facial image during video capture, accurately capturing key facial features. Based on image attribute information, it performs expression transformation and / or stylization transformation on each frame of the original facial image, enabling diverse expression transformations and personalized stylization transformations during video capture. The edited facial image is then fused with the original facial image, achieving a natural transition and improving image editing effects. This ensures the flexibility of video or image capture and overcomes the technical shortcomings of fixed facial expressions and styles during real-time video capture, which are difficult to change flexibly and adjust in real time. It effectively improves the flexibility of video or image capture by enabling diverse expression transformations and personalized stylization transformations.
[0112] Based on the first embodiment of this application, in the second embodiment of this application, the content that is the same as or similar to that in Embodiment 1 above can be referred to the above description, and will not be repeated hereafter. Based on this, please refer to... Figure 2 Step S20 further includes steps S201-S204:
[0113] Step S201: Obtain facial expression data and stylization data.
[0114] It should be noted that facial expression data refers to datasets that can represent different facial expression features. These datasets typically contain images or descriptions of various facial expressions, such as happiness, sadness, and surprise. By analyzing this facial expression data, features of specific expressions can be extracted, such as the upturn or downturn of the corners of the mouth, wrinkles at the corners of the eyes, etc., thereby enabling precise control over facial expressions during the editing process.
[0115] Understandably, stylized data refers to datasets that can represent different art styles. These datasets may include different visual effect styles, such as cartoonish or sketch-like styles. By analyzing these stylized data, features of specific styles can be extracted, such as the use of color, the thickness of lines, and the handling of light and shadow, thereby enabling precise control over the style of facial images during the editing process.
[0116] Step S202: Based on the image attribute information and the expression data, the original face image is subjected to expression transformation to obtain the face image after expression transformation.
[0117] It's important to note that the facial expression transformation is achieved by applying features from the expression data to the original facial image, thus altering the expression. For example, if the expression data represents a happy expression, applying these features to the original facial image can make the corners of the mouth turn up and smile lines appear at the corners of the eyes, thereby visually presenting a happy expression.
[0118] It is understood that in this embodiment, the image attribute information includes the original facial feature point parameters. By performing expression transformation on the original face image based on the original facial feature point parameters and expression data, it can be ensured that the transformed expression is consistent with the facial features of the original image, thereby achieving a natural expression transition.
[0119] In one feasible implementation, step S202 may include: determining the original facial feature point parameters based on the image attribute information; determining the target facial feature point parameters after expression transformation based on the expression data; determining the offset of each facial feature point based on the original facial feature point parameters and the target facial feature point parameters; and performing expression transformation on the original face image based on the offset of each facial feature point to obtain the face image after expression transformation.
[0120] It should be noted that the original facial feature point parameters refer to the coordinates of key points used to describe facial features in a face image, including the contour points of the eyes, nose, mouth, eyebrows, etc., as well as key points for changes in facial expressions. For example, by adjusting the feature points around the eyes, different eye expressions can be simulated; by adjusting the feature points at the corners of the mouth, different mouth expressions such as smiling or seriousness can be achieved.
[0121] Understandably, determining the target facial feature point parameters after expression transformation based on expression data includes: analyzing the expression features in the expression data, identifying the key points of expression change corresponding to the original facial feature point parameters, and then calculating the target facial feature point parameters based on the changing trends of these key points. For example, if the expression data represents a surprised expression, then the target facial feature point parameters will include changes in feature points such as widening eyes and raised eyebrows.
[0122] It's worth noting that the offset of each facial feature point refers to the difference between the original facial feature point parameters and the target facial feature point parameters after expression transformation, ensuring the accuracy and naturalness of the expression transformation. By accurately calculating these offsets, the face image after expression transformation can retain the original facial features while exhibiting new expression features.
[0123] In one feasible implementation, the step of performing expression transformation on the original face image based on the offset of each facial feature point to obtain an expression-transformed face image includes: generating an offset matrix based on the offset of each facial feature point; performing offset processing on each facial feature point in the original face image based on the offset matrix to obtain a face image with offset feature points; and performing local region deformation on the face image with offset feature points to obtain an expression-transformed face image.
[0124] It's important to note that each element in the offset matrix corresponds to an offset at a specific location in the image. By applying the offset matrix, each facial feature point in the original face image can be precisely moved, thus achieving expression changes. This offset matrix-based method ensures the coherence and naturalness of expression changes because it is based on the actual movement of facial feature points.
[0125] It is understandable that by applying an offset matrix to each facial feature point in the original face image, a corresponding displacement is generated on the image, which can simulate various facial expression changes, such as smiling, frowning, and surprise, making the facial expression changes more realistic and natural.
[0126] It's worth noting that local region deformation refers to offsetting feature points in the original facial image and then further deforming the local regions surrounding these feature points. This deformation is based on the offset feature point positions, interpolating surrounding pixels to achieve a smooth transition. Through local region deformation, it's possible to ensure that the facial image after expression changes appears more natural while preserving the facial structure and features of the original image.
[0127] Specifically, localized deformation can be achieved using various image processing techniques, such as bilinear interpolation and cubic convolution interpolation. These techniques can recalculate the surrounding pixels based on the offset feature point positions, generating new pixel values and thus achieving smooth image deformation. In this way, natural facial expressions can be effectively simulated, such as the upturned corners of the mouth when smiling and the drooping corners of the eyes when sad, resulting in a facial image with altered expressions.
[0128] Step S203: Based on the image attribute information and the stylization data, perform stylization transformation on the original face image to obtain the stylized face image.
[0129] It should be noted that the stylized face image is created by applying features from the stylized data to the original face image, thereby changing the image style. For example, if the stylized data represents a cartoon style, applying these features to the original face image can make the outline of the person more distinct and the colors more vibrant, thus presenting a cartoonish style visually.
[0130] It is understood that, in this embodiment, the image attribute information includes facial content features. By performing stylistic transformation on the original face image based on the facial content features and stylization data, it can be ensured that the transformed style is consistent with the facial content of the original image, thereby achieving a natural style transition.
[0131] In one feasible implementation, step S203 may include: determining facial content features based on the image attribute information; determining style features based on the stylization data; and performing stylization transformation on the original face image according to the facial content features and the style features to obtain a stylized face image.
[0132] It's important to note that facial content features include facial structure and facial expressions. Facial structure refers to the geometry and proportions of the face, such as the relative positions and sizes of the eyes, nose, and mouth. Facial expressions describe the activity of facial muscles, such as smiling or frowning. By analyzing facial content features, we can ensure that the facial features of the person are preserved during stylization transformation, while stylization features are applied appropriately.
[0133] Understandably, stylization transformation of original facial images based on facial content and style features refers to applying style features to the original image while maintaining the integrity of facial content features. For example, if the stylization data represents a sketch style, applying these features to the original facial image can make the contours of the person clearer and the shadows and highlights more delicate, thus visually presenting the effect of a sketch.
[0134] In a feasible implementation, the specific steps of performing a stylistic transformation on the original face image based on the facial content features and the style features to obtain a stylized face image may include steps A10-A11:
[0135] Step A10: Perform style transfer on the original face image based on the style features to obtain a style-transferred face image.
[0136] It should be noted that style transfer refers to the process of applying an artistic style to another image, so that the target image exhibits the artistic style characteristics of the source image.
[0137] Understandably, style features include color and texture features. Style transfer is performed on the original face image based on these color and texture features to obtain a style-transferred face image. Color features involve the distribution and combination of colors in the image, while texture features describe the texture and structure of patterns in the image. Through style transfer, the colors and textures in the original face image can be replaced with corresponding features in the stylized data, thereby achieving style conversion. For example, replacing the natural colors and textures in the original image with cartoon-style colors and textures can give the face image a cartoonish visual effect.
[0138] Step A11: Based on the facial content features, the style-transferred face image is corrected to obtain the stylized face image.
[0139] It should be noted that, based on style transfer, further adjustments are made to the style-transferred facial image to ensure that the facial features of the person are preserved and emphasized. For example, by enhancing the clarity of the facial contours and adjusting the details of key parts such as the eyes, nose, and mouth, the stylized facial image can maintain its artistic style while still allowing for clear identification of the person's facial features.
[0140] Understandably, correcting style-transferred facial images can include sharpening localized areas of the style-transferred image to highlight facial features. Furthermore, adjusting brightness and contrast can further enhance facial features while maintaining overall stylistic harmony.
[0141] In one feasible implementation, step A10 specifically includes: determining color features and texture features based on the style features; performing color style transfer and texture style transfer on the original face image according to the color features and the texture features respectively, to obtain a style-transferred face image.
[0142] It should be noted that color features refer to the distribution and combination of colors in an image, which determines the image's hue and color harmony. Texture features describe the texture and structure of patterns in an image, affecting the image's visual effect and detail representation.
[0143] As can be understood, color style transfer refers to replacing the color distribution and combination in the original face image with the color features in stylized data, thereby achieving a color style conversion. Texture style transfer, on the other hand, refers to replacing the texture structure in the original face image with the texture features in stylized data, thereby achieving a texture style conversion. In color style transfer, the color distribution from the color features is applied to the original face image, thereby changing the overall tone of the image to conform to the color characteristics of the target style. In texture style transfer, applying texture features to the original face image can change the texture structure of the image, making the image exhibit texture and detail that match the target style.
[0144] It is worth noting that when performing color style transfer and texture style transfer, it is necessary to ensure that these style features are consistent with facial content features in order to avoid unnatural visual effects in the facial images after stylization transformation. For example, in cartoon stylization transformation, the transfer of color features may make the image colors more vivid and saturated, while the transfer of texture features may make the lines of the image simpler and more exaggerated, thus presenting a cartoonish style.
[0145] In one feasible implementation, step A11 specifically includes: determining content loss based on the facial content features and the style-transferred face image; when the content loss reaches a preset loss threshold, correcting the style-transferred face image to obtain a stylized face image; and when the content loss does not reach the preset loss threshold, using the style-transferred face image as the stylized face image.
[0146] It should be noted that content loss refers to the inconsistency that may arise between facial content features and style features during style transfer. The calculation of content loss is based on the difference between facial content features and the style-transferred image. When this difference exceeds a preset loss threshold, it indicates that style transfer may have significantly affected the original facial features and correction is required.
[0147] Understandably, various image processing techniques can be used during the correction process, such as sharpening of local areas, adjustment of brightness and contrast, etc., to highlight facial features and maintain the overall style harmony. Through correction, it can be ensured that the stylized facial image is both visually natural and has the characteristics of the target style.
[0148] Specifically, sharpening localized areas can enhance details in key facial features, such as the eyes, nose, and mouth, making these features more clearly discernible in the stylized image. Adjustments to brightness and contrast help highlight facial features while maintaining overall stylistic harmony. For example, in a cartoon stylized transformation, increasing brightness and contrast can make the outline of the figure more defined and the colors more vibrant, thus visually presenting a cartoonish style.
[0149] Step S204: Determine the edited face image based on the face image after expression transformation and / or the face image after stylization transformation.
[0150] It should be noted that the face image after expression transformation can be used as the edited face image, or the face image after stylization transformation can be used as the edited face image. Alternatively, the face image after expression transformation and the face image after stylization transformation can be merged to obtain an edited face image that has undergone both expression and style transformation. This embodiment does not impose specific limitations on this.
[0151] In this embodiment, by acquiring facial expression data and stylization data, and combining them with image attribute information to perform facial expression transformation and stylization transformation respectively, a facial image after facial expression transformation and a facial image after stylization transformation are obtained. This enables diverse facial expression transformations and personalized stylization transformations. Furthermore, the edited facial image is determined based on the facial image after facial expression transformation and / or the facial image after stylization transformation, effectively improving the flexibility of video or image shooting.
[0152] It should be noted that the above examples are only for understanding this application and do not constitute a limitation on the applicant's face image editing method. Any simple transformations based on this technical concept are within the protection scope of this application.
[0153] This application also provides a face image editing device; please refer to... Figure 3 The face image editing device includes:
[0154] The acquisition module 10 is used to acquire the original face image and extract facial information from the original face image to obtain image attribute information.
[0155] The editing module 20 is used to perform image editing on the original face image based on the image attribute information to obtain an edited face image, wherein the image editing includes at least expression transformation and / or stylization transformation.
[0156] The fusion module 30 is used to fuse the edited face image with the original face image to obtain the target face image.
[0157] This embodiment provides a face image editing device. The device acquires an original face image and extracts facial information from the original face image to obtain image attribute information. Based on the image attribute information, it performs image editing on the original face image to obtain an edited face image. The image editing includes at least expression transformation and / or stylization transformation. The edited face image is then fused with the original face image to obtain a target face image. This device enables diverse expression transformations and personalized stylization transformations, effectively improving the flexibility of video or image capture.
[0158] In summary, this embodiment extracts key points from each frame of the original facial image during video capture, accurately capturing key facial features. Based on image attribute information, it performs expression transformation and / or stylization transformation on each frame of the original facial image, enabling diverse expression transformations and personalized stylization transformations during video capture. The edited facial image is then fused with the original facial image, achieving a natural transition and improving image editing effects. This ensures the flexibility of video or image capture and overcomes the technical shortcomings of fixed facial expressions and styles during real-time video capture, which are difficult to change flexibly and adjust in real time. It effectively improves the flexibility of video or image capture by enabling diverse expression transformations and personalized stylization transformations.
[0159] Optionally, the editing module 20 is further configured to acquire expression data and stylization data; perform expression transformation on the original face image based on the image attribute information and the expression data to obtain an expression-transformed face image; perform stylization transformation on the original face image based on the image attribute information and the stylization data to obtain a stylized face image; and determine the edited face image based on the expression-transformed face image and / or the stylized face image.
[0160] Optionally, the editing module 20 is further configured to determine the original facial feature point parameters based on the image attribute information; determine the target facial feature point parameters after expression transformation based on the expression data; determine the offset of each facial feature point based on the original facial feature point parameters and the target facial feature point parameters; and perform expression transformation on the original face image based on the offset of each facial feature point to obtain the face image after expression transformation.
[0161] Optionally, the editing module 20 is further configured to generate an offset matrix based on the offset of each facial feature point; perform offset processing on each facial feature point in the original face image based on the offset matrix to obtain a face image with offset feature points; and perform local region deformation on the face image with offset feature points to obtain a face image with changed expression.
[0162] Optionally, the editing module 20 is further configured to determine facial content features based on the image attribute information; determine style features based on the stylization data; and perform stylization transformation on the original face image according to the facial content features and the style features to obtain a stylized face image.
[0163] Optionally, the editing module 20 is further configured to perform style transfer on the original face image based on the style features to obtain a style-transferred face image; and to modify the style-transferred face image based on the facial content features to obtain a stylized face image.
[0164] Optionally, the editing module 20 is further configured to determine color features and texture features based on the style features; and to perform color style transfer and texture style transfer on the original face image according to the color features and the texture features respectively, to obtain a style-transferred face image.
[0165] Optionally, the editing module 20 is further configured to determine content loss based on the facial content features and the style-transferred face image; when the content loss reaches a preset loss threshold, correct the style-transferred face image to obtain a stylized face image; and when the content loss does not reach the preset loss threshold, use the style-transferred face image as the stylized face image.
[0166] Optionally, the fusion module 30 is further configured to align feature points of the original face image according to the edited face image to obtain an aligned original face image; fuse the features of the aligned original face image and the edited face image to obtain a fused face image; and smooth the fused face image to obtain a target face image.
[0167] Optionally, the fusion module 30 is further configured to extract global features from the aligned original face image and the edited face image respectively to obtain a first global feature and a second global feature; perform a weighted average fusion of the first global feature and the second global feature to obtain a fused global feature; and perform mapping based on the fused global feature to obtain a fused face image.
[0168] The face image editing device provided in this application, employing the face image editing method described in the above embodiments, can solve the technical problem that facial expressions and styles are usually fixed during real-time video shooting, making flexible changes and real-time adjustments difficult. Compared with the prior art, the beneficial effects of the face image editing device provided in this application are the same as those of the face image editing method provided in the above embodiments, and other technical features in the face image editing device are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.
[0169] This application provides a face image editing device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the face image editing method in Embodiment 1 above.
[0170] The following is for reference. Figure 4 This document illustrates a structural schematic diagram of a face image editing device suitable for implementing embodiments of this application. The face image editing device in this application may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Description), PMPs (Portable Media Players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 4 The face image editing device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.
[0171] like Figure 4As shown, the face image editing device may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1003 into a random access memory (RAM) 1004. The RAM 1004 also stores various programs and data required for the operation of the face image editing device. The processing unit 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, a touchscreen, touchpad, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; storage devices 1003 including, for example, magnetic tape, hard disk, etc.; and communication devices 1009. The communication device 1009 allows the face image editing device to communicate wirelessly or wiredly with other devices to exchange data. Although face image editing devices with various systems are shown in the figures, it should be understood that implementation or possession of all the systems shown is not required. More or fewer systems may be implemented alternatively.
[0172] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from ROM 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.
[0173] The face image editing device provided in this application, employing the face image editing method described in the above embodiments, can solve the technical problem that facial expressions and styles are usually fixed during real-time video shooting, making flexible changes and real-time adjustments difficult. Compared with the prior art, the beneficial effects of the face image editing device provided in this application are the same as those of the face image editing method provided in the above embodiments, and other technical features of this face image editing device are the same as those disclosed in the previous embodiment method, and will not be repeated here.
[0174] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.
[0175] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0176] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, the computer-readable program instructions being used to execute the face image editing method in the above embodiments.
[0177] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.
[0178] The aforementioned computer-readable storage medium may be included in the face image editing device; or it may exist independently and not be assembled into the face image editing device.
[0179] The aforementioned computer-readable storage medium carries one or more programs that, when executed by a face image editing device, cause the face image editing device to: acquire an original face image and extract facial information from the original face image to obtain image attribute information; perform image editing on the original face image based on the image attribute information to obtain an edited face image, wherein the image editing includes at least expression transformation and / or stylization transformation; and fuse the edited face image with the original face image to obtain a target face image.
[0180] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0181] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0182] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.
[0183] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the above-described face image editing method. This solves the technical problem that, during real-time video recording, facial expressions and styles are typically fixed and difficult to flexibly change and adjust in real time. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the face image editing method provided in the above embodiments, and will not be repeated here.
[0184] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the face image editing method described above.
[0185] The computer program product provided in this application can solve the technical problem that facial expressions and styles are usually fixed during real-time video shooting, making it difficult to flexibly change and adjust them in real time. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as those of the facial image editing method provided in the above embodiments, and will not be repeated here.
[0186] The above description is only a part of the embodiments of this application and does not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.
[0187] This invention discloses A1. A method for editing human face images, the method comprising:
[0188] Obtain the original face image and extract facial information from the original face image to obtain image attribute information;
[0189] Based on the image attribute information, the original face image is edited to obtain an edited face image, wherein the image editing includes at least expression transformation and / or stylization transformation;
[0190] The edited face image is fused with the original face image to obtain the target face image.
[0191] A2. The method as described in A1, wherein the step of image editing of the original face image based on the image attribute information to obtain the edited face image includes:
[0192] Acquire facial expression data and stylization data;
[0193] Based on the image attribute information and the expression data, the original face image is subjected to expression transformation to obtain the face image after expression transformation;
[0194] Based on the image attribute information and the stylization data, the original face image is stylized to obtain a stylized face image;
[0195] The edited face image is determined based on the face image after the expression transformation and / or the face image after the stylization transformation.
[0196] A3. The method as described in A2, wherein performing expression transformation on the original face image based on the image attribute information and the expression data to obtain the expression-transformed face image includes:
[0197] Determine the original facial feature point parameters based on the image attribute information;
[0198] Determine the target facial feature point parameters after the expression transformation based on the expression data;
[0199] The offset of each facial feature point is determined based on the original facial feature point parameters and the target facial feature point parameters;
[0200] The original face image is subjected to expression transformation based on the offset of each facial feature point to obtain the expression-transformed face image.
[0201] A4. The method as described in A3, wherein performing expression transformation on the original face image based on the offset of each facial feature point to obtain an expression-transformed face image includes:
[0202] An offset matrix is generated based on the offset of each facial feature point.
[0203] Based on the offset matrix, each facial feature point in the original face image is offset to obtain a face image with offset feature points.
[0204] The facial image with the offset feature points is subjected to local region deformation to obtain a facial image with changed expression.
[0205] A5. The method as described in A2, wherein performing a stylistic transformation on the original face image based on the image attribute information and the stylization data to obtain a stylized face image includes:
[0206] Facial content features are determined based on the image attribute information;
[0207] Style features are determined based on the stylized data;
[0208] The original face image is stylized based on the facial content features and the style features to obtain the stylized face image.
[0209] A6. The method as described in A5, wherein performing a stylistic transformation on the original face image based on the facial content features and the style features to obtain a stylized face image includes:
[0210] The original face image is style-transferred based on the style features to obtain a style-transferred face image;
[0211] The style-transferred face image is corrected based on the facial content features to obtain a stylized face image.
[0212] A7. The method as described in A6, wherein performing style transfer on the original face image based on the style features to obtain a style-transferred face image includes:
[0213] Color and texture features are determined based on the style features;
[0214] The original face image is subjected to color style transfer and texture style transfer based on the color features and texture features, respectively, to obtain a style-transferred face image.
[0215] A8. The method as described in A6, wherein correcting the style-transferred facial image based on the facial content features to obtain a stylized transformed facial image includes:
[0216] The content loss is determined based on the facial content features and the style-transferred facial image;
[0217] When the content loss reaches a preset loss threshold, the style-transferred face image is corrected to obtain a stylized face image.
[0218] When the content loss does not reach the preset loss threshold, the style-transferred face image is used as the stylized face image.
[0219] A9. The method as described in A1, wherein fusing the edited face image with the original face image to obtain the target face image includes:
[0220] The original face image is aligned with its feature points based on the edited face image to obtain the aligned original face image.
[0221] The aligned original face image and the edited face image are fused to obtain a fused face image;
[0222] The fused face image is smoothed to obtain the target face image.
[0223] A10. The method as described in A9, wherein fusing features between the aligned original face image and the edited face image to obtain a fused face image includes:
[0224] Global features are extracted from the aligned original face image and the edited face image respectively to obtain the first global feature and the second global feature;
[0225] The first global feature and the second global feature are weighted and averaged to obtain the fused global feature.
[0226] The fused global features are mapped to obtain the fused face image.
[0227] The present invention also discloses B11. A face image editing device, the face image editing device comprising:
[0228] The acquisition module is used to acquire the original face image and extract facial information from the original face image to obtain image attribute information;
[0229] An editing module is used to perform image editing on the original face image based on the image attribute information to obtain an edited face image, wherein the image editing includes at least expression transformation and / or stylization transformation;
[0230] The fusion module is used to fuse the edited face image with the original face image to obtain the target face image.
[0231] B12. The apparatus as described in B11, wherein the editing module is further configured to acquire facial expression data and stylization data;
[0232] Based on the image attribute information and the expression data, the original face image is subjected to expression transformation to obtain the face image after expression transformation;
[0233] Based on the image attribute information and the stylization data, the original face image is stylized to obtain a stylized face image;
[0234] The edited face image is determined based on the face image after the expression transformation and / or the face image after the stylization transformation.
[0235] B13. The apparatus as described in B12, wherein the editing module is further configured to determine the original facial feature point parameters based on the image attribute information;
[0236] Determine the target facial feature point parameters after the expression transformation based on the expression data;
[0237] The offset of each facial feature point is determined based on the original facial feature point parameters and the target facial feature point parameters;
[0238] The original face image is subjected to expression transformation based on the offset of each facial feature point to obtain the expression-transformed face image.
[0239] B14. The apparatus as described in B13, wherein the editing module is further configured to generate an offset matrix based on the offset of each facial feature point;
[0240] Based on the offset matrix, each facial feature point in the original face image is offset to obtain a face image with offset feature points.
[0241] The facial image with the offset feature points is subjected to local region deformation to obtain a facial image with changed expression.
[0242] B15. The apparatus as described in B12, wherein the editing module is further configured to determine facial content features based on the image attribute information;
[0243] Style features are determined based on the stylized data;
[0244] The original face image is stylized based on the facial content features and the style features to obtain the stylized face image.
[0245] B16. The apparatus as described in B15, wherein the editing module is further configured to perform style transfer on the original face image based on the style features to obtain a style-transferred face image;
[0246] The style-transferred face image is corrected based on the facial content features to obtain a stylized face image.
[0247] B17. The apparatus as described in B16, wherein the editing module is further configured to determine color features and texture features based on the style features;
[0248] The original face image is subjected to color style transfer and texture style transfer based on the color features and texture features, respectively, to obtain a style-transferred face image.
[0249] B18. The apparatus as described in B16, wherein the editing module is further configured to determine content loss based on the facial content features and the style-transferred facial image;
[0250] When the content loss reaches a preset loss threshold, the style-transferred face image is corrected to obtain a stylized face image.
[0251] When the content loss does not reach the preset loss threshold, the style-transferred face image is used as the stylized face image.
[0252] The present invention also discloses C19. A face image editing device, the face image editing device comprising: a memory, a processor, and a face image editing program stored in the memory and executable on the processor, the face image editing program being configured to implement the face image editing method as described above.
[0253] The present invention also discloses D20. A storage medium storing a face image editing program, wherein the face image editing program, when executed by a processor, implements the face image editing method as described above.
Claims
1. A method for editing facial images, characterized in that, The method includes: Obtain the original face image and extract facial information from the original face image to obtain image attribute information; Based on the image attribute information, the original face image is edited to obtain an edited face image, wherein the image editing includes at least expression transformation and / or stylization transformation; The edited face image is fused with the original face image to obtain the target face image.
2. The method as described in claim 1, characterized in that, The step of editing the original face image based on the image attribute information to obtain the edited face image includes: Acquire facial expression data and stylization data; Based on the image attribute information and the expression data, the original face image is subjected to expression transformation to obtain the face image after expression transformation; Based on the image attribute information and the stylization data, the original face image is stylized to obtain a stylized face image; The edited face image is determined based on the face image after the expression transformation and / or the face image after the stylization transformation.
3. The method as described in claim 2, characterized in that, The step of performing expression transformation on the original face image based on the image attribute information and the expression data to obtain the expression-transformed face image includes: Determine the original facial feature point parameters based on the image attribute information; Determine the target facial feature point parameters after the expression transformation based on the expression data; The offset of each facial feature point is determined based on the original facial feature point parameters and the target facial feature point parameters; The original face image is subjected to expression transformation based on the offset of each facial feature point to obtain the expression-transformed face image.
4. The method as described in claim 3, characterized in that, The step of performing expression transformation on the original face image based on the offset of each facial feature point to obtain the expression-transformed face image includes: An offset matrix is generated based on the offset of each facial feature point. Based on the offset matrix, each facial feature point in the original face image is offset to obtain a face image with offset feature points. The facial image with the offset feature points is subjected to local region deformation to obtain a facial image with changed expression.
5. The method as described in claim 2, characterized in that, The step of performing a stylistic transformation on the original face image based on the image attribute information and the stylization data to obtain a stylized face image includes: Facial content features are determined based on the image attribute information; Style features are determined based on the stylized data; The original face image is stylized based on the facial content features and the style features to obtain the stylized face image.
6. The method as described in claim 5, characterized in that, The step of performing a stylistic transformation on the original face image based on the facial content features and the style features to obtain a stylized face image includes: The original face image is style-transferred based on the style features to obtain a style-transferred face image; The style-transferred face image is corrected based on the facial content features to obtain a stylized face image.
7. The method as described in claim 6, characterized in that, The process of performing style transfer on the original face image based on the style features to obtain a style-transferred face image includes: Color and texture features are determined based on the style features; The original face image is subjected to color style transfer and texture style transfer based on the color features and texture features, respectively, to obtain a style-transferred face image.
8. A face image editing device, characterized in that, The face image editing device includes: The acquisition module is used to acquire the original face image and extract facial information from the original face image to obtain image attribute information; An editing module is used to perform image editing on the original face image based on the image attribute information to obtain an edited face image, wherein the image editing includes at least expression transformation and / or stylization transformation; The fusion module is used to fuse the edited face image with the original face image to obtain the target face image.
9. A face image editing device, characterized in that, The face image editing device includes: a memory, a processor, and a face image editing program stored in the memory and executable on the processor, the face image editing program being configured to implement the face image editing method as described in any one of claims 1 to 7.
10. A storage medium, characterized in that, The storage medium stores a face image editing program, which, when executed by a processor, implements the face image editing method as described in any one of claims 1 to 7.