Virtual face discrete configuration parameter generation method and virtual face model generation method

Through semantic segmentation and feature extraction technology, discrete configuration parameters of virtual faces matching real faces are generated, which solves the problems of difficulty and cost of generation in the existing technology, and achieves more efficient and flexible parameter generation.

CN119810879APending Publication Date: 2025-04-11JILIN ANIMATION INST +1
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411682706.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-22
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

The prior art is difficult to optimize both continuous and discrete parameters at the same time when generating discrete configuration parameters of virtual faces, and requires a large amount of manual labeling data, which increases the problem of generation cost and poor adaptability.

Method used

By obtaining real face images, semantic segmentation and binarized mask image generation, regional image feature data are extracted, preset discrete configuration parameters are matched, and virtual face discrete configuration parameters are generated that match real faces.

Benefits of technology

It reduces the difficulty and cost of generating discrete configuration parameters of virtual faces, improves generation efficiency and adaptability, and can adapt to different virtual face custom systems more quickly.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119810879A_ABST
    Figure CN119810879A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a virtual face discrete configuration parameter generation method, a virtual face model generation method, computing equipment, a computer storage medium and a computer program product. The virtual face discrete configuration parameter generation method comprises the following steps: acquiring a human face image of a real person; performing semantic segmentation on the real human face image to obtain a human face semantic segmentation map containing a plurality of areas; respectively generating a corresponding binary mask graph for each region of the face semantic segmentation graph; obtaining region images corresponding to the plurality of regions from the real human face image according to the plurality of binarized mask images; performing feature extraction on the plurality of regional images to obtain face feature data; and determining a target face discrete configuration parameter matched with the face feature data from preset face discrete configuration parameters. According to the technical scheme provided by the embodiment of the invention, the generation difficulty and the generation cost of the virtual face discrete configuration parameters are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of image processing technology, and in particular to a method for generating discrete configuration parameters of a virtual face, a method for generating a virtual face model, a computing device, a computer storage medium, and a computer program product. Background Art

[0002] In a virtual interactive environment dominated by role-playing, users usually hope to have a unique character image. Therefore, a virtual face customization system is often used in some virtual interactive environments, which to a certain extent facilitates users to create their favorite character images and meets users' personalized requirements for character images.

[0003] In the virtual face customization system, users can create character images by adjusting face configuration parameters. Among them, face configuration parameters include continuous configuration parameters and discrete configuration parameters. Continuous configuration parameters can be used to adjust continuous shapes such as face shape, nose shape, mouth shape, etc. Discrete configuration parameters can be used to adjust discrete makeup such as lip color, skin color, hairstyle, etc.

[0004] Since the face configuration parameter input interface of the virtual face customization system usually provides hundreds or thousands of adjustable virtual face configuration parameters, it takes a lot of time and effort to adjust the facial image to the user's satisfaction. Therefore, deep learning technology can be used in related technologies to generate face configuration parameters based on real face photos.

[0005] In the process of realizing the concept of this application, the inventors found that the deep learning technology in the related art works better when generating continuous configuration parameters alone, but it is difficult to simultaneously mix and optimize the generation of continuous configuration parameters and discrete configuration parameters of the deep learning model during model training, and more manually annotated training data is required to improve model performance, which increases the generation cost of discrete configuration parameters. In addition, the adaptability of the deep learning model is poor, and it is often necessary to re-annotate the training data and retrain the model for different virtual face customization systems.

[0006] Therefore, how to reduce the difficulty and cost of generating discrete configuration parameters of virtual faces is a technical problem that needs to be solved urgently. Summary of the invention

[0007] Embodiments of the present application provide a method for generating discrete configuration parameters of a virtual face, a method for generating a virtual face model, a computing device, a computer storage medium, and a computer program product.

[0008] In a first aspect, an embodiment of the present application provides a method for generating discrete configuration parameters of a virtual face, comprising:

[0009] Get real face images;

[0010] Performing semantic segmentation on the real human face image to obtain a face semantic segmentation map containing multiple regions;

[0011] Generating a corresponding binary mask image for each area of ​​the face semantic segmentation image;

[0012] Acquire regional images corresponding to the multiple regions respectively from the real face image according to the multiple binary mask images;

[0013] Extracting features from the plurality of area images to obtain facial feature data;

[0014] Determine target face discrete configuration parameters that match the face feature data from preset face discrete configuration parameters.

[0015] In a second aspect, an embodiment of the present application provides a method for generating a virtual face model, comprising:

[0016] Get real face images;

[0017] Acquire face continuous configuration parameters and face discrete configuration parameters from the real face image, wherein the face discrete configuration parameters are generated by the following operations: semantically segment the face image to obtain a face semantic segmentation map containing multiple regions; generate a corresponding binary mask map for each region of the face semantic segmentation map; acquire region images corresponding to the multiple regions from the real face image according to the multiple binary mask maps; perform feature extraction on the multiple region images to obtain face feature data; and determine the face discrete configuration parameters that match the face feature data from the preset face discrete configuration parameters;

[0018] The face continuous configuration parameters and the face discrete configuration parameters are input into a virtual face customization system to obtain a virtual face model that matches the real face image.

[0019] In a third aspect, an embodiment of the present application provides a device for generating discrete configuration parameters of a virtual face, comprising:

[0020] The first acquisition module is used to acquire a real person face image;

[0021] A semantic segmentation module, used to perform semantic segmentation on the real face image to obtain a face semantic segmentation map containing multiple regions;

[0022] A mask image generation module, used to generate a corresponding binary mask image for each area of ​​the face semantic segmentation image;

[0023] A region image generation module, used for acquiring region images corresponding to the plurality of regions respectively from the real person face image according to the plurality of binary mask images;

[0024] A feature extraction module, used to extract features from the plurality of area images to obtain facial feature data;

[0025] The parameter generation module is used to determine the target face discrete configuration parameters that match the face feature data from the preset face discrete configuration parameters.

[0026] In a fourth aspect, an embodiment of the present application provides a virtual face model generation device, comprising:

[0027] The second acquisition module is used to acquire a real person face image;

[0028] A parameter acquisition module, used to acquire face continuous configuration parameters and face discrete configuration parameters from the real face image, wherein the face discrete configuration parameters are generated by the following operations: semantically segmenting the face image to obtain a face semantic segmentation map containing multiple regions; generating a corresponding binary mask map for each region of the face semantic segmentation map; acquiring region images corresponding to the multiple regions from the real face image according to the multiple binary mask maps; performing feature extraction on the multiple region images to obtain face feature data; and determining the face discrete configuration parameters matching the face feature data from preset face discrete configuration parameters;

[0029] The model generation module is used to input the discrete configuration parameters of the face into the virtual face customization system to obtain a virtual face model that matches the real face image.

[0030] In a fifth aspect, an embodiment of the present application provides a computing device, including a processing component and a storage component;

[0031] The storage component stores one or more computer instructions; the one or more computer instructions are used to be called and executed by the processing component to implement the method for generating discrete configuration parameters of a virtual face provided in an embodiment of the present application, or to implement the method for generating a virtual face model provided in an embodiment of the present application.

[0032] In a sixth aspect, a computer storage medium is provided in an embodiment of the present application, storing a computer program. When the computer program is executed by a computer, the method for generating discrete configuration parameters of a virtual face provided in an embodiment of the present application is implemented, or the method for generating a virtual face model provided in an embodiment of the present application is implemented.

[0033] In the seventh aspect, a computer program product is provided in an embodiment of the present application, and the computer program product includes a computer program code. When the computer program code is executed by a computer, the method for generating discrete configuration parameters of a virtual face provided in an embodiment of the present application is implemented, or the method for generating a virtual face model provided in an embodiment of the present application is implemented.

[0034] In an embodiment of the present application, by adopting the following methods: obtaining a real face image; performing semantic segmentation on the real face image to obtain a face semantic segmentation map containing multiple regions; generating a corresponding binary mask map for each region of the face semantic segmentation map; obtaining regional images corresponding to the multiple regions from the real face image according to the multiple binary mask maps; performing feature extraction on the multiple regional images to obtain face feature data; and determining target face discrete configuration parameters that match the face feature data from preset face discrete configuration parameters, the face feature data of the real face image is obtained by image calculation and processing, and the target face discrete configuration parameters are determined from the preset face discrete configuration parameters based on the face feature data, thereby reducing the difficulty and cost of generating virtual face discrete configuration parameters.

[0035] These and other aspects of the present application will become more clearly understood in the description of the following embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0037] Figure 1 A flowchart of a method for generating discrete configuration parameters of a virtual face provided by an embodiment of the present application is shown;

[0038] Figure 2 A flowchart of a method for generating a virtual face model provided by another embodiment of the present application is shown;

[0039] Figure 3 A block diagram of a device for generating discrete configuration parameters of a virtual face provided in an embodiment of the present application is shown;

[0040] Figure 4 A block diagram of a virtual face model generating device provided in an embodiment of the present application is shown;

[0041] Figure 5 A block diagram of a computing device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0042] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.

[0043] In some of the processes described in the specification and claims of this application and the above-mentioned figures, multiple operations that appear in a specific order are included, but it should be clearly understood that these operations may not be executed in the order in which they appear in this article or executed in parallel. The serial numbers of the operations, such as 101, 102, etc., are only used to distinguish between different operations, and the serial numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions of "first", "second", etc. in this article are used to distinguish different messages, devices, modules, etc., do not represent the order of precedence, and do not limit the "first" and "second" to be different types.

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

[0045] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.

[0046] The implementation details of the technical solution of the embodiment of the present application are elaborated in detail below.

[0047] Figure 1 A flowchart of a method for generating discrete configuration parameters of a virtual face provided by an embodiment of the present application is shown. Figure 1 As shown, the method for generating discrete configuration parameters of a virtual face may specifically include the following steps:

[0048] 101, obtaining a real person face image;

[0049] 102, performing semantic segmentation on the real face image to obtain a face semantic segmentation map containing multiple regions;

[0050] 103, generating a corresponding binary mask image for each region of the face semantic segmentation image;

[0051] 104, acquiring region images corresponding to a plurality of regions respectively from the real person face image according to a plurality of binary mask images;

[0052] 105, extracting features from the multiple region images to obtain facial feature data;

[0053] 106 , determining a target face discrete configuration parameter that matches the face feature data from preset face discrete configuration parameters.

[0054] The real person face image may include a photo of a real person, such as a photo of the user himself, a photo of a friend, a photo of a family member, etc. In order to better extract features from the real person face image to generate discrete configuration parameters of the target face, a real person face image that meets preset requirements may be used. The preset requirements may be, for example, that the real person face needs to be in the middle of the real person face image, the upper part needs to include hair, the lower part needs to include the real person's jaw, and even a certain width of the neck needs to be exposed.

[0055] It is understandable that the original image used by the user may not meet the above preset requirements. The original image may contain some background information other than the real person's face. Therefore, the original image can be preprocessed in advance to output a real person's face image that meets the preset requirements.

[0056] Optionally, the process of obtaining a real person face image can be implemented as follows:

[0057] Get the original image containing the real person's face image;

[0058] Extract facial feature points from the original image;

[0059] Based on the extracted facial feature points and the facial feature points in the preset standard facial image, the original image is aligned to the standard facial image;

[0060] Based on the alignment result, the original image is cropped according to the edge of the standard face image to obtain a real face image.

[0061] In practical applications, an original image containing a real person's face image can be obtained, and then facial feature points in the original image can be extracted. Then, a standard face image can be obtained, which is a face image that meets the preset requirements. Facial feature points in the standard face image can be extracted in advance, and then the original image can be aligned to the standard face image according to the facial feature points in the original image with reference to the facial feature points in the standard face image.

[0062] Since there are more than one facial feature points in the two images, the two images can be aligned as a whole. The overall alignment process can be understood as taking the center points of multiple facial feature points and aligning the center points of the two images. Alternatively, the shortest path between each group of facial feature points of the same category in the two images can be calculated.

[0063] After alignment, the original image can be cropped along the edge of the standard face image, so that a real face image that meets the preset requirements can be obtained.

[0064] In some optional embodiments, before extracting the facial feature points in the original image, it is also possible to detect whether the original image contains a face; if the face is not detected in the original image, a prompt message is output, wherein the prompt message is used to prompt the user that the face is not detected in the original image. If the face can be detected in the original image, the subsequent steps can be continued.

[0065] In some embodiments of the present application, when it is detected that an original image contains a human face, if the original image includes multiple human faces, a face with the largest area among the multiple faces may be selected.

[0066] In other embodiments of the present application, when it is detected that the original image contains a face, if the original image includes multiple faces, the user's selection operation can be obtained to determine the face selected by the user through the selection operation, and determine whether the face selected by the user meets the preset threshold. If it is determined that the face meets the preset threshold, the face selected by the user through the selection operation is aligned and cropped. The preset threshold can be, for example, a pre-set judgment standard, such as the clarity and integrity of the face.

[0067] In an embodiment of the present application, a face semantic segmentation model can be used to perform semantic segmentation on a real face image. The face semantic segmentation model can be a pre-trained deep learning model that can segment an input real face image into different regions and assign a classification number to each pixel. In an embodiment of the present application, the face semantic segmentation model can segment a face image into seven categories: background, face, lips, nose, eyes, eyebrows, and hair, corresponding to numbers 0, 1, 2, 3, 4, 5, and 6, respectively.

[0068] For a given real face image, after being processed by the face semantic segmentation model, a face semantic segmentation map I of size (H, W) can be obtained. class, where H is the height and W is the width. Each position in the face semantic segmentation map corresponds to a pixel position in the real face image I. For example, the value of position (x, y) in the face semantic segmentation map is 2, indicating that the pixel at position (x, y) in the real face image I belongs to the lip area.

[0069] Such a segmentation process can help with subsequent image processing and analysis tasks. For example, specific color discrete configuration parameters can be generated according to different regions, or contour discrete configuration parameters can be generated for specific parts. At the same time, by clarifying the category to which each pixel belongs, the semantic regions of the face can be extracted more accurately, providing more accurate reference information for extracting facial feature data.

[0070] In an embodiment of the present application, for each region in the face semantic segmentation map, a corresponding binary mask map can be generated respectively. The binary mask map can be generated by traversing each pixel position in the face semantic segmentation map.

[0071] If the value of a position in the face semantic segmentation map is equal to the current classification number, then in the corresponding binary mask map, the value of the position is set to 1, which can indicate that in the real face image, the pixel at the position belongs to the area represented by the current classification number.

[0072] If the value of a position in the face semantic segmentation map is not equal to the classification number, then in the binary mask map, the value of the position is set to 0, which may mean that the pixel at the position does not belong to the area represented by the current classification number.

[0073] The process of generating a binary mask map can be expressed by the following formula:

[0074] If I class (x, y)==i, then I mask,i (x, y) = 1, otherwise I mask,i (x, y) = 0;

[0075] Among them, I class (x, y) can represent the value of the classification number stored at the position (x, y) in the face semantic segmentation map, i can represent the classification number, I mask , i It can represent the binary mask image corresponding to the classification number i.

[0076] In an embodiment of the present application, the real person face image can be multiplied pixel by pixel with multiple binary mask images, only the pixel information of the corresponding area is retained, and the pixels of other areas are changed to 0, so as to obtain the regional image corresponding to each semantic area from the real person face image according to the binary mask image.

[0077] In an embodiment of the present application, before determining the regional image based on the binary mask image, the binary mask image may be eroded and expanded. By performing erosion and expansion operations on the binary mask image, noise pixels in the boundary area may be removed to make the contour clearer and more complete, so as to extract a more accurate regional image.

[0078] Among them, the erosion operation is a morphological processing method. Using a reasonable convolution kernel and number of iterations can gradually "erode" the pixels in the boundary area, thereby removing some noise that may be generated during image acquisition or segmentation; dilation is a morphological processing method. Using a reasonable convolution kernel and number of iterations for dilation operation can merge the noise contours in the boundary area.

[0079] In the embodiments of the present application, various image processing and deep learning techniques may be used, such as color statistics, texture analysis, shape feature extraction and other feature extraction methods. Different types of features may be extracted for different regions. For example, color features may be extracted for the face region and the lip region; and contour features of the hair region may be extracted.

[0080] After feature extraction, a set of facial feature data describing the features of each area of ​​the face can be obtained, and these data can be used as a basis for subsequent matching with feature data corresponding to preset facial discrete configuration parameters.

[0081] A series of discrete face configuration parameters can be pre-stored in the virtual face customization system. The discrete face configuration parameters may include, for example, contour configuration parameters and color configuration parameters. The contour configuration parameters may be used to adjust the hairstyle of the virtual face, and the color configuration parameters may adjust the lip color and skin color.

[0082] By using a certain matching algorithm, for example, a distance measurement method such as weighted Euclidean distance, Hausdorff distance, etc., the extracted facial feature data is compared with the feature data corresponding to the preset facial discrete configuration parameters. A set of target facial discrete configuration parameters closest to the current facial feature data can be found from the preset facial discrete configuration parameters. The target facial discrete configuration parameters can be used to input into the virtual face customization system so that it can generate a virtual face that matches the real face image based on the target facial discrete configuration parameters.

[0083] In an embodiment of the present application, by adopting the following methods: obtaining a real face image; performing semantic segmentation on the real face image to obtain a face semantic segmentation map containing multiple regions; generating a corresponding binary mask map for each region of the face semantic segmentation map; obtaining regional images corresponding to multiple regions from the real face image according to multiple binary mask maps; performing feature extraction on multiple regional images to obtain face feature data; and determining target face discrete configuration parameters that match the face feature data from preset face discrete configuration parameters, the face feature data of the real face image is obtained by image calculation and processing, and the target face discrete configuration parameters are determined from the preset face discrete configuration parameters based on the face feature data, thereby reducing the difficulty and cost of generating virtual face discrete configuration parameters.

[0084] In some embodiments, the facial feature data includes color feature data and contour feature data.

[0085] In some embodiments, feature extraction is performed on multiple region images to obtain facial feature data, which can be specifically implemented as follows:

[0086] Extract color features from any area image to generate color feature data;

[0087] Extract contour features from any area image to generate contour feature data;

[0088] The color feature data and the contour feature data are used as the face feature data.

[0089] In the embodiments of the present application, by extracting color feature data and contour feature data of a real face image, the features of a certain area of ​​the real face can be more comprehensively characterized, so as to provide rich information for subsequent matching with preset face discrete configuration parameters.

[0090] In some embodiments, color feature extraction is performed on any area image to generate color feature data, which can be specifically implemented as follows:

[0091] Calculate the color average of the regional image to generate color feature data.

[0092] For a specific face region image, such as a facial region, a lip region, etc., the average color value of all pixels in the region can be calculated, and the average color value can reflect the overall color characteristics of the corresponding region. The color value may include a color value in an RGB color space or other color space.

[0093] For example, for a facial region image, you can traverse each pixel in the image, obtain its RGB value, then add up the R, G, and B components of all pixels, and divide by the total number of pixels to get the average R, G, and B value of the facial region. This average RGB value is used as the color feature data of the facial region.

[0094] In some embodiments, the preset face discrete configuration parameters include preset color configuration parameters and preset contour configuration parameters, the preset color configuration parameters have corresponding color configuration parameter feature data, and the preset contour configuration parameters have corresponding contour configuration parameter feature data.

[0095] In some embodiments, determining the target face discrete configuration parameters that match the face feature data from the preset face discrete configuration parameters can be specifically implemented as follows:

[0096] Determining target color configuration parameters from preset color configuration parameters based on similarity calculation results of the color feature data and the color configuration parameter feature data;

[0097] Determining target profile configuration parameters from preset profile configuration parameters based on similarity calculation results of the profile feature data and the profile configuration parameter feature data;

[0098] The target color configuration parameters and the target contour configuration parameters are used as the target face discrete configuration parameters.

[0099] In the embodiments of the present application, the preset color configuration parameters may include various preset color options, which cover different skin tones, lip gloss colors, etc., and each color option may have corresponding color configuration parameter characteristic data. For example, there may be multiple different RGB value combinations to represent different facial skin tones, and multiple specific RGB values ​​to represent different lip gloss colors. The preset contour configuration parameters may represent various preset contour shape options, and each contour shape option may have corresponding contour configuration parameter characteristic data, such as different hairstyle contours, etc. These contours may be represented by a series of coordinate points or specific shape descriptors.

[0100] The similarity between the color feature data and the color configuration parameter feature data corresponding to each preset color configuration parameter can be calculated using a similarity calculation method such as weighted Euclidean distance, so that based on the similarity calculation result, the parameter closest to the color feature data is selected from the preset color configuration parameters as the target color configuration parameter.

[0101] A similarity calculation method such as the shape scene distance or Hausdorff distance in OpenCV can be used to calculate the similarity between the contour feature data and the contour configuration parameter feature data corresponding to each preset contour configuration parameter. Based on the similarity calculation result, the parameter that is most similar to the contour feature data is determined from the preset contour configuration parameters as the target contour configuration parameter.

[0102] In some embodiments, based on the similarity calculation results of the color feature data and the color configuration parameter feature data, determining the target color configuration parameters from the preset color configuration parameters can be specifically implemented as follows:

[0103] For any candidate color configuration parameter in the preset color configuration parameters, determine the difference between the candidate color configuration parameter feature data and the color feature data corresponding to the candidate color configuration parameter on multiple color channels, and the average value on the red channel;

[0104] Obtaining color similarity between candidate color configuration parameter feature data and color feature data based on differences and average values ​​on multiple color channels;

[0105] A target color configuration parameter is determined from a plurality of candidate color configuration parameters based on the similarity.

[0106] In the embodiment of the present application, since different color spaces (such as RGB and HSV) have large errors when using simple Euclidean distance to calculate color similarity, the embodiment of the present application can use the RGB color space to perform weighted calculation of Euclidean distance to perform similarity calculation. The specific calculation method is as follows:

[0107] First, we can calculate the average value on the red channel Average value on red channel It can be obtained by adding the red channel value of the preset color configuration parameter and the red channel value of the color average and dividing the result by 2.

[0108] Then, △R, △G, and △B can be calculated, which represent the difference between the candidate color configuration parameters and the color average value in the red, green, and blue channels respectively.

[0109] Among them, △R, △G, and △B are calculated by the following formula:

[0110] △R=C pre,R -C avg,R ;

[0111] △G=C pre,G -C avg,G ;

[0112] △B=C pre,B -C avg,B .

[0113] Among them, C pre The candidate color configuration parameter feature data corresponding to the candidate color configuration parameter can be represented, C avg Can represent the color average.

[0114] Finally, the distance value of color similarity is calculated according to the following formula. This formula can make the calculation of color similarity more accurate by weighting the difference between different color channels. Among them, the calculation of weights takes into account the average value of the red channel, which can better adapt to different color situations. Smaller distance values ​​indicate that the colors are more similar. By comparing the distance values ​​between different preset makeup and the actual area image, the closest preset makeup effect can be found.

[0115]

[0116] Among them, Dist represents the similarity.

[0117] In some embodiments, based on the similarity calculation result of the profile feature data and the profile configuration parameter feature data, determining the target profile configuration parameter from the preset profile configuration parameters can be specifically implemented as follows:

[0118] For any candidate contour configuration parameter in the preset contour configuration parameters, determining contour similarity between contour feature data and feature data of the candidate contour configuration parameter corresponding to the candidate contour configuration parameter;

[0119] A target contour configuration parameter is determined from a plurality of candidate contour configuration parameters based on the contour similarity.

[0120] For any candidate contour configuration parameter among the preset contour configuration parameters, the contour similarity between the contour feature data and the candidate contour configuration parameter feature data corresponding to the candidate contour configuration parameter may be determined.

[0121] Contour feature data is extracted from a specific area of ​​a real face image, and describes the actual contour shape of the area. For example, for a hairstyle area, the contour feature data can be a series of coordinate points representing the hair shape or a specific shape descriptor. Candidate contour configuration parameters are possible contour options pre-set by the system. For example, in the preset contour configuration parameters, there may be multiple different hairstyle contours as candidate contour configuration parameters.

[0122] The method of determining the similarity of contours can use specific algorithms, such as shape scene distance or Hausdorff distance in OpenCV. These algorithms calculate the similarity by comparing the shape differences of two contours. For example, shape scene distance considers the overall structure and distribution of the two shapes, while Hausdorff distance measures the maximum mismatch between two sets.

[0123] According to the similarity result, the candidate contour configuration parameter with the highest similarity can be selected as the target contour configuration parameter. For example, if the shape scene distance is used, the candidate contour configuration parameter with the smallest distance is considered to be the most similar to the contour of the real face, and is thus determined as the target contour configuration parameter.

[0124] In this way, the target contour configuration parameters that best match the contour features of the real face image can be found from multiple preset candidate contour configuration parameters, providing accurate contour information for the generation of a virtual face model.

[0125] Figure 2 A flowchart of a method for generating a virtual face model provided by another embodiment of the present application is shown. Figure 2 As shown, the virtual face model generation method may specifically include the following steps:

[0126] 201, obtaining a real person face image;

[0127] 202, obtaining face continuous configuration parameters and face discrete configuration parameters from a real person face image, wherein the face discrete configuration parameters are generated by the following operations: performing semantic segmentation on the face image to obtain a face semantic segmentation map containing multiple regions; generating a corresponding binary mask map for each region of the face semantic segmentation map; obtaining region images corresponding to the multiple regions from the real person face image according to the multiple binary mask maps; performing feature extraction on the multiple region images to obtain face feature data; and determining the face discrete configuration parameters matching the face feature data from the preset face discrete configuration parameters;

[0128] 203 , inputting the face continuous configuration parameters and the face discrete configuration parameters into the virtual face customization system to obtain a virtual face model that matches the real face image.

[0129] The specific implementation method of obtaining the face discrete configuration parameters of real face images can be referred to Figure 1 The method for generating discrete configuration parameters of the virtual face shown will not be repeated here.

[0130] After the continuous face configuration parameters and the discrete face configuration parameters are input into the virtual face customization system, the virtual face customization system can generate an initial face model based on the continuous face configuration parameters, and then generate a makeup configuration of the initial face model based on the discrete face configuration parameters, thereby generating a virtual face model by merging the makeup configuration and the initial face model.

[0131] Figure 3 A block diagram of a device for generating discrete configuration parameters of a virtual face provided in an embodiment of the present application is shown. Figure 3 As shown, the virtual face discrete configuration parameter generating device includes:

[0132] The first acquisition module 301 is used to acquire a real person face image;

[0133] The semantic segmentation module 302 is used to perform semantic segmentation on the real face image to obtain a face semantic segmentation map containing multiple regions;

[0134] The mask image generation module 303 is used to generate a corresponding binary mask image for each area of ​​the face semantic segmentation image;

[0135] The region image generation module 304 is used to obtain region images corresponding to multiple regions from the real face image according to multiple binary mask images;

[0136] A feature extraction module 305 is used to extract features from multiple region images to obtain facial feature data;

[0137] The parameter generation module 306 is used to determine the target face discrete configuration parameters that match the face feature data from the preset face discrete configuration parameters.

[0138] In some embodiments, the facial feature data includes color feature data and contour feature data.

[0139] In some embodiments, the feature extraction module 305 is specifically used to:

[0140] Extract color features from any area image to generate color feature data;

[0141] Extract contour features from any area image to generate contour feature data;

[0142] The color feature data and the contour feature data are used as the face feature data.

[0143] In some embodiments, the feature extraction module 305 is specifically used to:

[0144] Calculate the color average of the regional image to generate color feature data.

[0145] In some embodiments, the preset face discrete configuration parameters include preset color configuration parameters and preset contour configuration parameters, the preset color configuration parameters have corresponding color configuration parameter feature data, and the preset contour configuration parameters have corresponding contour configuration parameter feature data.

[0146] In some embodiments, the parameter generation module 306 is specifically used to:

[0147] Determining target color configuration parameters from preset color configuration parameters based on similarity calculation results of the color feature data and the color configuration parameter feature data;

[0148] Determining target profile configuration parameters from preset profile configuration parameters based on similarity calculation results of the profile feature data and the profile configuration parameter feature data;

[0149] The target color configuration parameters and the target contour configuration parameters are used as the target face discrete configuration parameters.

[0150] In some embodiments, the parameter generation module 306 is specifically used to:

[0151] For any candidate color configuration parameter in the preset color configuration parameters, determine the difference between the candidate color configuration parameter feature data and the color feature data corresponding to the candidate color configuration parameter on multiple color channels, and the average value on the red channel;

[0152] Obtaining color similarity between candidate color configuration parameter feature data and color feature data based on differences and average values ​​on multiple color channels;

[0153] A target color configuration parameter is determined from a plurality of candidate color configuration parameters based on the similarity.

[0154] In some embodiments, the parameter generation module 306 is specifically used to:

[0155] For any candidate contour configuration parameter in the preset contour configuration parameters, determining contour similarity between contour feature data and feature data of the candidate contour configuration parameter corresponding to the candidate contour configuration parameter;

[0156] A target contour configuration parameter is determined from a plurality of candidate contour configuration parameters based on the contour similarity.

[0157] Figure 3 The virtual face discrete configuration parameter generation device can be executed Figure 1 The implementation principle and technical effect of the method for generating discrete configuration parameters of virtual human faces in the embodiment shown are not described in detail. The specific manner in which each module and unit performs operations in the virtual human face model generating device in the above embodiment has been described in detail in the embodiment of the method, and will not be described in detail here.

[0158] Figure 4 A block diagram of a virtual face model generation device provided in an embodiment of the present application is shown. Figure 4 As shown, the virtual face model generating device may include:

[0159] The second acquisition module 401 is used to acquire a real person face image;

[0160] The parameter acquisition module 402 is used to acquire face continuous configuration parameters and face discrete configuration parameters from a real face image, wherein the face discrete configuration parameters are generated by the following operations: semantically segmenting the face image to obtain a face semantic segmentation map containing multiple regions; generating a corresponding binary mask map for each region of the face semantic segmentation map; acquiring region images corresponding to the multiple regions from the real face image according to the multiple binary mask maps; performing feature extraction on the multiple region images to obtain face feature data; and determining the face discrete configuration parameters matching the face feature data from the preset face discrete configuration parameters;

[0161] The model generation module 403 is used to input the discrete configuration parameters of the face into the virtual face customization system to obtain a virtual face model that matches the real face image.

[0162] Figure 4 The virtual face model generation device can perform Figure 2 The implementation principle and technical effect of the virtual face model generation method of the embodiment shown are not repeated here. The specific way in which each module and unit performs operations in the virtual face model generation device in the above embodiment has been described in detail in the embodiment of the method, and will not be elaborated here.

[0163] In a possible design, the virtual face discrete configuration parameter generation device and the virtual face model generation device provided in the embodiments of the present application can be implemented as a computing device, such as Figure 5 As shown, the computing device may include a storage component 501 and a processing component 502;

[0164] The storage component 501 stores one or more computer instructions, wherein the one or more computer instructions are called and executed by the processing component 502 to implement the virtual face discrete configuration parameter generation method and virtual face model generation method provided in the embodiments of the present application.

[0165] Of course, the computing device may also include other components, such as input / output interfaces, communication components, etc. The input / output interface provides an interface between the processing component and the peripheral interface module, which may be an output device, an input device, etc. The communication component is configured to facilitate wired or wireless communication between the computing device and other devices.

[0166] Among them, the computing device can be a physical device or an elastic computing host provided by a cloud computing platform, etc. In this case, the computing device can refer to a cloud server, and the above-mentioned processing components, storage components, etc. can be basic server resources rented or purchased from the cloud computing platform.

[0167] When the computing device is a physical device, it can be implemented as a distributed cluster consisting of multiple servers or terminal devices, or as a single server or a single terminal device.

[0168] The embodiment of the present application also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a computer, the virtual face discrete configuration parameter generation method and the virtual face model generation method provided in the embodiment of the present application can be implemented.

[0169] The embodiments of the present application also provide a computer program product, including a computer program. When the computer program is executed by a computer, the virtual face discrete configuration parameter generation method and the virtual face model generation method provided in the embodiments of the present application can be implemented.

[0170] The processing components in the above corresponding embodiments may include one or more processors to execute computer instructions to complete all or part of the steps in the above method. Of course, the processing components may also be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above method.

[0171] The storage component is configured to store various types of data to support operations in the device. The storage component can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0172] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0173] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0174] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0175] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for generating discrete configuration parameters of a virtual face, characterized in that: include: Get real face images; Performing semantic segmentation on the real human face image to obtain a face semantic segmentation map containing multiple regions; Generating a corresponding binary mask image for each area of ​​the face semantic segmentation image; Acquire regional images corresponding to the multiple regions respectively from the real face image according to the multiple binary mask images; Extracting features from the plurality of area images to obtain facial feature data; Determine target face discrete configuration parameters that match the face feature data from preset face discrete configuration parameters.

2. The method according to claim 1, characterized in that The facial feature data includes color feature data and contour feature data; The extracting features of the plurality of regional images to obtain facial feature data comprises: Extracting color features from any of the regional images to generate color feature data; Extracting contour features from any of the regional images to generate contour feature data; The color feature data and the contour feature data are used as the face feature data.

3. The method according to claim 2, characterized in that The extracting color features from any of the regional images to generate color feature data comprises: The color average value of the regional image is calculated to generate the color feature data.

4. The method according to claim 3, characterized in that The preset face discrete configuration parameters include preset color configuration parameters and preset contour configuration parameters, the preset color configuration parameters have corresponding color configuration parameter feature data, and the preset contour configuration parameters have corresponding contour configuration parameter feature data; The step of determining the target face discrete configuration parameters that match the face feature data from the preset face discrete configuration parameters comprises: Determining target color configuration parameters from the preset color configuration parameters based on a similarity calculation result between the color feature data and the color configuration parameter feature data; Determining target profile configuration parameters from the preset profile configuration parameters based on a similarity calculation result between the profile feature data and the profile configuration parameter feature data; The target color configuration parameters and the target contour configuration parameters are used as the target face discrete configuration parameters.

5. The method according to claim 4, characterized in that The determining the target color configuration parameters from the preset color configuration parameters based on the similarity calculation result of the color feature data and the color configuration parameter feature data comprises: For any candidate color configuration parameter in the preset color configuration parameters, determine the difference between the candidate color configuration parameter feature data corresponding to the candidate color configuration parameter and the color feature data on multiple color channels, and the average value on the red channel; Obtaining color similarity between the candidate color configuration parameter feature data and the color feature data based on the difference values ​​on multiple color channels and the average value; The target color configuration parameter is determined from a plurality of candidate color configuration parameters based on the similarity.

6. The method according to claim 5, characterized in that The determining of target profile configuration parameters from the preset profile configuration parameters based on the similarity calculation result of the profile feature data and the profile configuration parameter feature data comprises: For any candidate contour configuration parameter in the preset contour configuration parameters, determining contour similarity between the contour feature data and the candidate contour configuration parameter feature data corresponding to the candidate contour configuration parameter; The target contour configuration parameter is determined from a plurality of candidate contour configuration parameters based on the contour similarity.

7. A method for generating a virtual face model, characterized in that: include: Get real face images; Acquire a face continuous configuration parameter and a face discrete configuration parameter from the real face image, wherein the face discrete configuration parameter is generated by the following operations: semantically segmenting the face image to obtain a face semantic segmentation map containing multiple regions; generating a corresponding binary mask map for each region of the face semantic segmentation map; acquiring region images corresponding to the multiple regions from the real face image according to the multiple binary mask maps; and performing feature extraction on the multiple region images to obtain face feature data; Determining a discrete face configuration parameter that matches the facial feature data from preset discrete face configuration parameters; The face continuous configuration parameters and the face discrete configuration parameters are input into a virtual face customization system to obtain a virtual face model that matches the real face image.

8. A computing device, characterized in that including a processing component and a storage component; The storage component stores one or more computer instructions; the one or more computer instructions are used to be called and executed by the processing component to implement the method for generating discrete configuration parameters of a virtual face as described in any one of claims 1 to 6, or to implement the method for generating a virtual face model as described in claim 7.

9. A computer storage medium, characterized in that A computer program is stored, and when the computer program is executed by a computer, the method for generating discrete configuration parameters of a virtual face as described in any one of claims 1 to 6 is implemented, or the method for generating a virtual face model as described in claim 7 is implemented.

10. A computer program product, characterized in that The computer program product includes computer program code, and when the computer program code is executed by a computer, it implements the method for generating discrete configuration parameters of a virtual face as described in any one of claims 1 to 6, or implements the method for generating a virtual face model as described in claim 7.

Citation Information

Patent Citations

  • Method and device for creating face model and electronic device

    CN110111418A

  • Animation image generation method and device

    CN114219704A

  • Image processing method, image processing system and electronic equipment

    CN114266695A

  • Skin color determination method and device, electronic equipment and storage medium

    CN115908450A

  • Method and system for preprocessing images

    US20170004378A1