Makeup material image acquisition method and system, electronic equipment and storage medium

By using deep learning and facial mask technology, we have achieved efficient and automated production of makeup image materials and high fidelity in makeup effects. This solves the problems of cumbersome operation and poor consistency in traditional digital beauty and beautification technologies, and improves the reusability and cross-platform adaptability of makeup materials.

CN121053151APending Publication Date: 2025-12-02GUANGZHOU HUYA INFORMATION TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202511193970.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-25
Publication Date
2025-12-02

AI Technical Summary

Technical Problem

Traditional digital beauty and makeup technologies are cumbersome to operate, require high levels of professional skills from users, have low reuse rates of makeup materials, lack unified standards, and produce inconsistent makeup effects, making it difficult to meet personalized needs.

Method used

By acquiring a facial reference image and a standard frontal face base image, and using deep learning and AI-driven image processing algorithms for makeup transfer, combined with a preset facial mask and intensity parameters, facial frame features are removed and the image is segmented into independent makeup material images, achieving efficient and automated makeup effect restoration and adaptation.

Benefits of technology

It has achieved efficient and automated production of makeup image materials, improved the fidelity and adaptability of makeup effects, reduced the cost of manual retouching, enhanced the reusability and cross-platform adaptability of makeup materials, and improved the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121053151A_ABST
    Figure CN121053151A_ABST
Patent Text Reader

Abstract

The invention relates to the field of computer image processing, in particular to a makeup material image acquisition method and system, electronic equipment and a storage medium, and the method comprises the steps: acquiring a human face reference image and a front face standard base map, and the human face reference image comprises a reference makeup; processing the front face standard base image according to the reference makeup of the face reference image to obtain a front face standard image with makeup; removing the face frame features of the front face standard base map from the front face standard image with the makeup to obtain a makeup image; and processing the makeup image based on a preset face mask image to obtain a plurality of makeup material images. According to the method, high restoration and natural transition of makeup effects of all parts in makeup migration can be ensured, and the making effect of makeup material images is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer image processing, and more specifically, to a method, system, electronic device, and storage medium for acquiring makeup material images. Background Technology

[0002] Recently, digital beauty and facial enhancement technology (hereinafter referred to as digital beauty and facial enhancement) is a technology that uses digital technology to modify and enhance facial features. Its core lies in simulating various makeup effects such as foundation, eyeshadow, lip color, blush, etc. It can quickly achieve visual effects such as brightening skin tone, enhancing facial features, and switching makeup styles. It is widely used in selfie applications, short video creation, e-commerce makeup trials, and film and television special effects.

[0003] Traditional digital makeup enhancement primarily relies on preset filters, fixed templates, or manual parameter adjustments. Users need to repeatedly adjust multiple parameters such as color, intensity, and area selection to achieve the desired effect, making the process cumbersome and time-consuming. Professional-grade image creation, on the other hand, depends on manual drawing or image processing software, requiring layer-by-layer adjustments to color, texture, and area distribution tailored to the target makeup style. This demands extremely high levels of user expertise. Furthermore, different makeup styles often lack a unified output standard, resulting in low reusability of makeup images and difficulty in meeting the personalized needs of a large user base. Although deep learning-based image style transfer technology has improved automation in recent years, issues such as insufficient local detail reproduction still exist. Summary of the Invention

[0004] This invention provides a method, system, electronic device, and storage medium for acquiring makeup material images, which are used to ensure high fidelity and natural transition of makeup effects in different parts during makeup migration, thereby improving the production effect of makeup material images.

[0005] According to a first aspect of this application, a method for acquiring makeup material images is provided, the method comprising: Obtain a face reference image and a frontal standard base image, wherein the face reference image includes a reference makeup look; The standard frontal image is processed based on the reference makeup of the face reference image to obtain a standard frontal image with makeup. Remove the facial frame features from the standard frontal image with makeup to obtain the makeup image; The makeup image is processed based on a preset facial mask to obtain several makeup material images.

[0006] Understandably, by transferring the reference makeup from a facial reference image to a standard frontal face base image and removing facial framework features, a clean makeup image is extracted. Then, based on a pre-set facial mask, the makeup image is finely segmented and divided, quickly generating multi-dimensional, highly adaptable standard makeup material images. This technical approach significantly improves the automation and output quality of makeup material image production, enabling the makeup effect to not only completely reproduce the reference makeup but also flexibly decompose into independent application images. It achieves accurate replication and efficient decoupling of the reference makeup, effectively solving the problems of low efficiency and poor consistency in traditional manual image retouching, and providing high-quality basic makeup material support for scenarios such as virtual makeup try-ons and content creation.

[0007] Optionally, the step of processing the frontal standard base image based on the reference makeup of the face reference image to obtain a frontal standard image with makeup includes: The reference makeup of the face reference image is transferred to the frontal standard base image, and the reference makeup transferred to the frontal standard base image is processed using preset intensity parameters to obtain a frontal standard image with makeup.

[0008] Understandably, by using controllable intensity parameters to drive makeup transfer, the reference makeup features in the face reference image are accurately mapped to the frontal standard base image. While preserving the core aesthetic characteristics of the reference makeup, the similarity between the reference makeup in the face reference image and the makeup in the frontal standard base image is adjusted by dynamically adjusting the intensity parameters. This effectively solves problems such as color difference, detail distortion, and skin tone and light and shadow fusion when transferring cross-face features, significantly improving the naturalness and realism of makeup transfer, and providing a stable and reliable technical foundation for the mass production of high-quality makeup material images.

[0009] Optionally, the method further includes: making each pixel of the makeup image transparent; The step involves processing the makeup image, which has undergone transparency processing, based on a preset facial mask image, to obtain several makeup material images.

[0010] Understandably, by applying pixel-by-pixel transparency to the makeup image, a semi-transparent makeup layer with dynamic adjustment capabilities is constructed. Combined with a preset facial mask, precise regional cropping and layer extraction are achieved, which can efficiently generate makeup material images adapted to different application scenarios. This not only preserves the integrity of makeup details but also allows makeup parts to be independently peeled off and flexibly superimposed, significantly improving the reusability and cross-scene adaptability of makeup materials.

[0011] Optionally, the makeup image is processed based on a preset facial mask to obtain several makeup material images, including: Based on a preset facial mask image, non-facial areas are removed from the makeup image; Obtain the region mask based on the facial mask image; Based on the aforementioned part mask, the makeup image after removing non-facial areas is segmented to obtain the makeup material image.

[0012] Understandably, the system segments makeup images based on a pre-set facial mask. By first removing redundant information from non-facial areas to lock in the effective range, and then deriving multi-dimensional part masks from the facial mask, the system finally achieves accurate region segmentation of the makeup image based on the part masks, forming modular makeup material images with clear semantic features. This realizes the structured decomposition of makeup images, ensuring the integrity and independence of each makeup part, while improving the accuracy and efficiency of material extraction. The generated makeup material images can be directly used in scenarios such as virtual makeup try-ons and beauty tutorials, significantly reducing the cost of manual image retouching and enhancing cross-platform adaptability.

[0013] Optionally, the method further includes: performing a first edge smoothing process on the part mask, and using the part mask with the first edge smoothing process to perform the step of performing region segmentation on the makeup image with the non-face region removed based on the part mask to obtain a makeup material image.

[0014] Understandably, by introducing a first edge smoothing process to smooth the edges of the part mask image, jagged artifacts and burrs at the mask edges are effectively eliminated, making the contours of areas such as lips and eyeshadow smoother and more natural. When performing region segmentation based on the mask after edge smoothing, the scope of makeup application can be accurately defined, avoiding makeup overflow or loss caused by rough edges, and significantly improving the edge clarity and visual texture of the makeup material image.

[0015] Optionally, the part mask image includes one or more of the following: lip mask image, eyeshadow mask image, colored contact lens mask image, and face makeup mask image. The step of obtaining the region mask based on the facial mask image includes: Extract one or more of the following from the face mask image: preliminary lip mask image, preliminary eyeshadow mask image, colored contact lens mask image, and preliminary face makeup mask image; Remove the oral cavity region from the preliminary lip mask image to obtain the lip mask image; Remove the eyelash area and the colored contact lens area from the preliminary eyeshadow mask to obtain the eyeshadow mask; Remove the eyeshadow area, contact lens area, and lip area from the preliminary face makeup mask to obtain the face makeup mask.

[0016] Understandably, by using individual part masks to achieve a refined breakdown of makeup elements, several independent part masks are generated based on the facial mask. Interference areas are then selectively corrected and removed to form accurate part masks with clear semantic boundaries and no overlap. This allows for the independent extraction and combination of makeup parts, preserving the detailed features of the original makeup while eliminating cross-regional interference. This significantly improves the purity and adaptability of the makeup material images, providing a high-fidelity basic unit for subsequent modular applications, while also greatly reducing the cost of manual image retouching.

[0017] Optionally, after processing the makeup image based on a preset facial mask to obtain several makeup material images, the method further includes: Obtain the makeup boundary of the makeup material image, obtain the shortest distance between the pixels in the makeup material image and the makeup boundary, and perform a second edge smoothing process on the pixels whose shortest distance is less than a preset threshold; And / or, Obtain noise pixels in the makeup material image, obtain a denoising region of a preset size centered on the noise pixels, calculate the pixel mean of the denoising region, and replace the pixel value of the noise pixels with the pixel mean.

[0018] Understandably, by analyzing the makeup boundary and dynamically identifying pixels adjacent to the boundary, a second edge smoothing process is applied to pixels with a shortest distance less than a preset threshold, effectively eliminating minor burrs and color level breaks, making the makeup edges more natural. A denoising algorithm based on the average of image features is used to accurately locate and correct granular noise, suppressing random noise while preserving the details of the makeup texture. This not only enhances the visual integrity of the makeup material image but also improves its purity and versatility, taking into account rendering compatibility across different devices and the stability of cross-platform applications.

[0019] According to a second aspect of this application, a system for acquiring makeup material images is provided, the system comprising: The acquisition module is used to acquire a face reference image and a frontal standard background image, wherein the face reference image includes a reference makeup; The makeup transfer module is used to process the frontal standard base image based on the reference makeup of the face reference image to obtain a frontal standard image with makeup. The makeup image acquisition module is used to remove the facial frame features of the standard frontal face image from the standard frontal face image with makeup to obtain the makeup image; The makeup material image acquisition module is used to process the makeup image based on a preset facial mask to obtain several makeup material images.

[0020] According to a third aspect of this application, an electronic device is provided, comprising: Memory, used to store one or more computer programs; A processor, when the one or more computer programs are executed by the processor, implements the makeup material image acquisition method described in the first aspect above.

[0021] According to a fourth aspect of this application, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions, the computer instructions being configured to cause a processor to execute and implement the makeup material image acquisition method described in the first aspect above.

[0022] Based on any of the above aspects, embodiments of this application provide a method, system, electronic device, and storage medium for acquiring makeup material images. The method involves acquiring a face reference image and a frontal standard background image, wherein the face reference image includes a reference makeup look; processing the frontal standard background image based on the reference makeup look of the face reference image to obtain a frontal standard image with makeup; removing facial frame features from the frontal standard background image with makeup to obtain a makeup image; and processing the makeup image based on a preset facial mask to obtain several makeup material images. This application can achieve the following benefits: • Standardized makeup material image format: By using preset facial mask images and subdivided part masks, makeup images are segmented into standardized and modular makeup material images, thereby achieving structured output of makeup material images. This ensures that the generated makeup material images have a unified format, making it easy to directly and seamlessly call and integrate them on different platforms or systems. This significantly reduces the cost of cross-scene adaptation, not only improving the efficiency of makeup material management but also laying the technical foundation for large-scale applications.

[0023] • Improve the extraction accuracy of makeup material images: In the makeup migration stage, an intensity parameter is introduced to dynamically adjust the migration effect of the reference makeup on the frontal standard background image, avoiding the loss of details of the reference makeup; then, edge smoothing is used to effectively eliminate jagged edges and achieve a natural transition of the edges of the makeup material image; in addition, the mask images of each part are finely corrected to ensure that the extracted makeup material images are pure and free of redundant backgrounds; combined with the boundary optimization processing and noise reduction algorithm based on pixel-level shortest distance judgment, blurred edges are further corrected and noise interference is suppressed, finally generating high-fidelity, high-definition makeup material images.

[0024] • Achieving efficient automation and high-quality output: A complete automated makeup image acquisition process has been built, requiring no manual intervention from reference makeup input to multi-part makeup image output. Through the deep integration of makeup transfer and image segmentation technologies, the features of the reference makeup can be quickly analyzed and accurately mapped to a standard frontal face image, significantly shortening the production cycle. Simultaneously, intensity and threshold parameters can be flexibly adjusted to modify makeup style and output quality, adapting to different user needs. This not only solves the problems of low efficiency and poor consistency in traditional manual image retouching but also meets the needs of batch applications through batch production capabilities, significantly improving the efficiency of digital beauty content production and user experience. Attached Figure Description

[0025] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0026] Figure 1 This is an illustrative application scenario diagram of a method for acquiring makeup material images provided in this embodiment.

[0027] Figure 2 This is a flowchart of a method for acquiring makeup material images provided in this embodiment.

[0028] Figure 3 This is a schematic diagram of an image processing algorithm provided in this embodiment.

[0029] Figure 4 This is a flowchart for obtaining makeup material images provided in this embodiment.

[0030] Figure 5 This is a flowchart of a method for obtaining a part mask image provided in this embodiment.

[0031] Figure 6 This is a schematic diagram of a mask image for various parts provided in this embodiment.

[0032] Figure 7 This is a schematic diagram of the functional modules of a makeup material image acquisition system provided in this embodiment.

[0033] Figure 8 This is a schematic diagram of the structure of the electronic device provided in this embodiment. Detailed Implementation

[0034] The accompanying drawings are for illustrative purposes only and should not be construed as limiting the scope of this application. To better illustrate the following embodiments, some components in the drawings may be omitted, enlarged, or reduced, and do not represent the actual dimensions of the product; it is understandable to those skilled in the art that some well-known structures and their descriptions may be omitted in the drawings.

[0035] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0036] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0037] Digital beauty and facial enhancement technology (hereinafter referred to as digital beauty and facial enhancement) is a technology that uses digital technology to modify and enhance facial features. Its core lies in simulating various makeup effects such as foundation, eyeshadow, lip color, and blush. It can quickly achieve visual effects such as brightening skin tone, enhancing facial features, and switching makeup styles. It is widely used in selfie applications, short video creation, e-commerce makeup trials, and film and television special effects. In existing technologies, digital beauty enhancement mainly includes two typical implementation schemes: one is the traditional image processing method, which relies on the overlay of preset filters or the adjustment of parameters such as color saturation and brush stroke intensity to achieve basic makeup effects. However, it requires repeated adjustments to multiple control dimensions to approach the ideal state. Especially when users try to switch styles or make fine adjustments, the lengthy trial and error process significantly reduces the efficiency of the experience. The second is image processing software or deep learning makeup transfer models based on professional-grade materials. Although these can adjust the color, texture, and regional distribution layer by layer according to the target makeup style, they require a high level of professional skills from users and fail to fully adapt to the anatomical features of the face and the specific needs of each makeup area, resulting in frequent problems such as blurred eyeshadow boundaries, harsh blush transitions, and poor lip color adherence. More importantly, the existing technology system lacks a unified standardized output interface for beauty materials, which hinders the interoperability and sharing of beauty materials between different platforms. This technical bottleneck seriously restricts the large-scale implementation of personalized digital beauty enhancement services.

[0038] This embodiment provides a technical solution that can solve the above problems. The specific implementation of this application will be described in detail below with reference to the accompanying drawings.

[0039] An exemplary diagram illustrating an application scenario of a method for acquiring makeup material images provided in this application embodiment. Figure 1 As shown, the application scenario includes at least a server 100 and a terminal 200 that can communicate with the server 100. The server 100 has functions such as image acquisition and image processing; the terminal 200 has functions such as image acquisition, image processing, and image display.

[0040] Understandably, the server 100 can be an independent electronic device or a cluster of multiple electronic devices; the terminal 200 can be a smartphone terminal, personal computer, tablet computer, vehicle terminal, etc., but is not limited to these.

[0041] In one possible implementation, server 100 and terminal 200 may each execute a makeup material image acquisition method provided in the embodiments of this application. Alternatively, the makeup material image acquisition method provided in the embodiments of this application may be partially executed in server 100 and partially executed in terminal 200.

[0042] like Figure 2As shown, this embodiment provides a method for acquiring makeup material images, which can be further divided into the following steps: S100. Obtain a face reference image and a frontal standard base image, wherein the face reference image includes a reference makeup; In this embodiment, the face reference image can be a face image with reference makeup that can reflect the corresponding makeup style. Preferably, since this embodiment can process and recognize face reference images of different specifications or types, the face reference image can be a face image from different angles, such as a frontal face image or a side face image. Furthermore, the resolution and size of the face reference image are not particularly limited, which makes the method provided in this embodiment more compatible and reliable, and can adapt to processing a large number of face reference images of different specifications and makeup styles.

[0043] In this embodiment, the reference makeup is a makeup look formed by beautifying the face with makeup materials. The reference makeup includes, but is not limited to, makeup effects such as eyeshadow, lip color, blush, and colored contact lenses. The reference makeup composed of makeup effects on different parts of the face can reflect a certain makeup style.

[0044] In this embodiment, the frontal standard base image is a frontal standard image containing a face without makeup. The frontal standard base image can provide a standardized framework for reference makeup, so that reference makeup on face reference images of different specifications can be transferred to the frontal standard base image, thereby maintaining a unified makeup format and facilitating subsequent processing and application.

[0045] S200. The frontal standard base image is processed according to the reference makeup of the face reference image to obtain a frontal standard image with makeup. In this embodiment, an image processing algorithm based on deep learning and artificial intelligence is selected to transfer the reference makeup of the face reference image onto the frontal standard base image, while maintaining the makeup features and naturalness of the face reference image. It can also achieve batch processing of multiple face reference images to improve processing efficiency.

[0046] In a preferred embodiment, an intensity parameter can be preset to adjust the makeup in the frontal standard image, enabling dynamic adjustment from slight borrowing to complete replication of the reference makeup. Specifically, when the intensity parameter is at a low value, only the color tendency and texture features of the reference makeup can be extracted and integrated into the face standard base image, preserving the original skin tone base of the face standard base image while imparting a slight makeup effect. As the value of the intensity parameter gradually increases, the projection weight of the reference makeup also increases, thereby achieving a high degree of synchronization with the reference makeup and obtaining a frontal standard image that completely replicates the reference makeup. In this embodiment, the introduction of the intensity parameter enables flexible and controllable adjustment of the makeup in the frontal standard image, achieving a visually beautifying balance of the makeup in the frontal standard image.

[0047] Specifically, the step of processing the frontal standard base image based on the reference makeup of the facial reference image to obtain a frontal standard image with makeup includes: The reference makeup of the face reference image is transferred to the frontal standard base image, and the reference makeup transferred to the frontal standard base image is processed using preset intensity parameters to obtain a frontal standard image with makeup.

[0048] In this embodiment, the selected image processing algorithm specifically accepts three input parameters: a face reference image, a frontal standard background image, and an intensity parameter. Specifically, as follows: Figure 3 As shown, it can be processed using the following formula: in, To obtain a standard image of a face with makeup, For image processing algorithms, This is a standard frontal view image. For facial reference images, This refers to the strength parameter.

[0049] In this embodiment, the intensity parameter can be adjusted appropriately. Through experiments, a better makeup migration result can be obtained when the intensity parameter is in the range of 1.3-2.5. Preferably, in this embodiment, the intensity parameter is set to 1.8.

[0050] In this embodiment, the image processing algorithm can process facial reference images of different sizes or types. If the facial reference image is a frontal face image, the image processing algorithm can identify the reference makeup of the entire face in the facial reference image, and based on the adjustment of the intensity parameter, migrate the reference makeup of the entire face to the position corresponding to the frontal standard base image; if the facial reference image is a profile face image, the image processing algorithm can identify the reference makeup of half of the face in the facial reference image, and based on the adjustment of the intensity parameter and the principle of facial symmetry, fill the other half of the face with the identified reference makeup of half of the face to generate the reference makeup of the entire face, and then migrate the reference makeup of the entire face to the position corresponding to the frontal standard base image. If the face reference image is a face image from other angles, the makeup transfer method is similar to that described above. Based on the adjustment of intensity parameters and the principle of face symmetry, the makeup of the obscured face position is filled with the identified reference makeup to generate the reference makeup of the entire face. Subsequently, the reference makeup of the entire face is transferred to the position corresponding to the frontal standard base image, thereby achieving compatible processing of face reference images of faces from different angles.

[0051] S300: Remove the facial frame features of the standard frontal image from the standard frontal image with makeup to obtain the makeup image; In this embodiment, the obtained standard frontal image with makeup often includes the facial frame features of the standard frontal base image. These facial frame features mainly refer to the core structural features that constitute the basic shape of the face, used to anchor the spatial distribution and geometric relationships of various facial organs. However, in actual digital makeup and beautification, the makeup image is usually overlaid on the face requiring digital makeup and beautification to achieve the effect. Therefore, in digital makeup and beautification, only the corresponding reference makeup is needed. The facial frame features of the standard frontal base image cannot achieve the beautification effect and may also create unnecessary synthesis errors. Therefore, it is necessary to remove the facial frame features of the standard frontal base image.

[0052] Understandably, a standard frontal face image with makeup is formed by weighted overlay and fusion of a reference image of a face with reference makeup and a standard frontal face image. Therefore, if a standardized makeup image is needed, it can be processed using the following formula: in, The makeup image is described above. Preferably, after obtaining the makeup image, the minimum and maximum pixel values ​​of each pixel in the makeup image can be calculated, and the pixel values ​​of each pixel can be standardized based on the minimum and maximum values.

[0053] Specifically, after obtaining the makeup image, each pixel of the makeup image is made transparent; The step involves processing the makeup image, which has undergone transparency processing, based on a preset facial mask image, to obtain several makeup material images.

[0054] In this embodiment, to facilitate subsequent segmentation of the makeup image, it is necessary to perform transparency processing on the makeup image. Specifically, an transparency channel can be added to the makeup image. It is understood that the makeup image is a conventional RGB (Red-Green-Blue) format image. After adding a transparency value, the makeup image can be converted into an RGBA (Red-Green-Blue-Alpha) format image. For a pixel of the makeup image, its RGB format pixel value is obtained. ,in The x and y coordinates of the pixel in the makeup image are given respectively, and an opacity value is added to the RGB pixel. The transparency value of this pixel Specifically, it is calculated using the following formula: in, You can take 255.

[0055] S400. The makeup image is processed based on a preset facial mask to obtain several makeup material images.

[0056] Understandably, a facial mask is an indicator image that labels and divides various parts of a human face based on the semantic features of each part, including the eyes and mouth. This is used for subsequent segmentation of makeup images of different facial parts, enabling the acquisition of makeup material images for each part. Preferably, the facial mask is obtained by inputting a standard frontal face base image into a semantic segmentation model. Since the makeup image is obtained from the standard frontal face base image, the facial mask can be segmented according to the same semantic structure as the makeup image, ensuring a one-to-one correspondence between the facial mask and each facial part in the makeup image.

[0057] In this embodiment, based on the preset facial mask and RGBA format makeup image, a more detailed makeup material image can be obtained, thereby ensuring that the makeup effect of each part of the makeup material image can be highly reproduced and transition naturally.

[0058] Specifically, such as Figure 4 As shown, the process of processing the makeup image based on a preset facial mask to obtain several makeup material images may include the following steps: S410. Based on a preset facial mask image, remove non-facial areas from the makeup image; In this embodiment, the face mask image includes regions that define the various parts of the face and regions outside the face areas. For example, the regions that define the various parts of the face include areas that can reflect facial makeup, such as the eyes and mouth, while the regions outside the face include areas around the face that generally do not reflect facial makeup, such as hair and ears. In this embodiment, since the focus is on extracting facial makeup material images, it is necessary to remove non-face areas from the makeup image to avoid unnecessary errors. Specifically, the transparency values ​​of the pixels in the makeup image corresponding to the black areas in the face mask image are... If set to a preset value, these non-face areas will be invisible in the makeup image, thus completing the removal of non-face areas from the makeup image. Specifically, this is achieved in the following way: in, This is a facial mask image. The transparency value is The corresponding pixel value in the face mask image, preferably, is... Set to 0; where the pixel value corresponding to the pixel in the face mask image is 0. When the pixel is located outside the face area, the pixel value corresponding to the pixel in the face mask image is not [value missing]. At this time, the pixel is located in the face area, preferably. It can be set to 0.

[0059] S420. Obtain a part mask based on the face mask; In this embodiment, since the facial mask image includes regions that have been divided into different parts of the face, it is necessary to segment each region to obtain several part masks, thereby facilitating the accurate acquisition of makeup material images for each part later. Preferably, each part mask image is obtained by combining the facial mask image and using image retouching techniques for precise creation.

[0060] Specifically, the location mask image includes one or more of the following: lip mask image, eyeshadow mask image, colored contact lens mask image, and face makeup mask image. like Figure 5 As shown, obtaining the region mask based on the facial mask may include the following steps: S421. Segment one or more of the following from the face mask image: preliminary lip mask image, preliminary eyeshadow mask image, colored contact lens mask image, and preliminary face makeup mask image; In this embodiment, one or more makeup effects from the lips, eyeshadow, contact lenses, and face makeup can be extracted to form a representative makeup material image or one that forms a distinct makeup style. It is understood that during the initial segmentation of the face mask, a large area of ​​the face may be cropped. For example, the cropped lip mask may include the area inside the mouth, but the lip makeup material image typically only shows the lip color. Therefore, it is necessary to remove the area inside the mouth from the lip mask to reduce unnecessary errors.

[0061] Understandably, since the contact lens mask is usually the area of ​​the human eyeball, the initially cropped contact lens mask can be directly used as a reference for extracting the contact lens makeup material image later, without the need for further cropping.

[0062] S422. Remove the oral cavity region from the preliminary lip mask image to obtain the lip mask image; In this embodiment, the oral cavity area of ​​the initial lip mask is removed, while the lip area is retained. A more detailed lip makeup image can then be obtained based on this lip mask.

[0063] S423. Remove the eyelash area and the colored contact lens area from the preliminary eyeshadow mask image to obtain the eyeshadow mask image; In this embodiment, the eyelash area and the contact lens area of ​​the initial eyeshadow mask are removed, leaving only the eyeshadow area. This avoids repeated extraction and interference of the contact lens makeup when extracting makeup material images later. A more refined eyeshadow makeup material image can then be obtained based on this eyeshadow mask.

[0064] S424. Remove the eyeshadow area, contact lens area and lip area from the preliminary face makeup mask to obtain the face makeup mask.

[0065] In this embodiment, the eyeshadow area, contact lens area, and lip area of ​​the initial face makeup mask are removed, leaving only the face makeup area. This avoids repeated extraction and interference of contact lens makeup and lip makeup when extracting makeup material images later. A more detailed face makeup material image can then be obtained based on this face makeup mask.

[0066] Specifically, the method further includes: performing a first edge smoothing process on the part mask, and using the part mask with the first edge smoothing process to perform the step of performing region segmentation on the makeup image with the non-face region removed based on the part mask to obtain a makeup material image.

[0067] For example, such as Figure 6 As shown, Figure 6This is a schematic diagram of the mask images for various parts provided in this embodiment, including face mask image, lip mask image, eyeshadow mask image, colored contact lens mask image, and face makeup mask image.

[0068] In this embodiment, the mask images of each part obtained from the facial mask image may have jagged edges or other segmentation errors at their boundaries. Therefore, it is necessary to perform a first edge smoothing process on each part mask image. Preferably, in this embodiment, feathering technology or other edge smoothing methods are used to perform the first edge smoothing process on the edge pixels of each part mask image to achieve a natural and smooth transition of the edges in each part mask image. Performing the first edge smoothing process on each part mask image can directly affect the corresponding obtained makeup material image, so that the edges of the makeup material image can also transition naturally and smoothly.

[0069] S430. Based on the part mask image, perform region segmentation on the makeup image after removing non-face areas to obtain makeup material images.

[0070] In this embodiment, by segmenting the makeup image after removing non-face areas according to the mask images of each part, corresponding makeup material images can be obtained. For example, segmenting the makeup image after removing non-face areas according to the lip mask image yields a lip makeup material image; segmenting the makeup image after removing non-face areas according to the eyeshadow mask image yields an eyeshadow makeup material image; segmenting the makeup image after removing non-face areas according to the contact lens mask image yields a contact lens makeup material image; and segmenting the makeup image after removing non-face areas according to the face makeup mask image yields a face makeup material image.

[0071] Understandably, if the obtained facial reference image only contains eyeshadow makeup, and the human reference image is processed according to the above method to obtain a makeup image, then only the eyeshadow area in this makeup image contains makeup data. During segmentation, the aforementioned lip mask, eyeshadow mask, contact lens mask, and face makeup mask can be used to segment the makeup image, obtaining corresponding lip makeup material images, eyeshadow makeup material images, contact lens makeup material images, and face makeup material images. However, among the obtained makeup material images, only the eyeshadow makeup material image contains makeup data. Preferably, in this embodiment, each obtained makeup material image is treated as a single makeup material for a specific makeup style. In the makeup material where only the eyeshadow makeup material image contains makeup data, when it is subsequently applied, the makeup effect applied to the user is only the eyeshadow makeup effect. Therefore, the makeup effect of the facial reference image can be well reproduced without changing the makeup style embodied in the facial reference image.

[0072] Specifically, after processing the makeup image based on a preset facial mask to obtain several makeup material images, the method further includes: Obtain the makeup boundary of the makeup material image, obtain the shortest distance between the pixels in the makeup material image and the makeup boundary, and perform a second edge smoothing process on the pixels whose shortest distance is less than a preset threshold; In this embodiment, the obtained makeup material image may still exhibit uneven edges, therefore a second edge smoothing process is required to obtain a more refined makeup material image. Specifically, it is necessary to first obtain the makeup boundary of the makeup material image, and simultaneously obtain the shortest distance between each pixel in the makeup material image and the makeup boundary. The pixel value of each pixel is then processed based on the shortest distance, which can be achieved using the following formula: in, The makeup image is located in The transparency value of a pixel. For the preset threshold, This is the shortest distance between the pixel and the boundary of the makeup. For smoothing parameters, preferably, It can be set to 0.5. It can be set to 1. It can be set to 1.

[0073] Specifically, the method further includes: Obtain noise pixels in the makeup material image, obtain a denoising region of a preset size centered on the noise pixels, calculate the pixel mean of the denoising region, and replace the pixel value of the noise pixels with the pixel mean.

[0074] In this embodiment, during the makeup transfer process, some noisy pixels may exist. Processing these noisy pixels can yield a more refined makeup image, improving the user experience. Specifically, a region containing a preset number of noisy pixels is marked using high-frequency signals or other marking methods. The pixels in this region are then iterated through one by one to find the noisy pixels. A denoising region of a preset size is then obtained centered on each noisy pixel. Preferably, the denoising region of the preset size can be a 7*7 square area. Finally, the pixel mean of each pixel in the denoising region is calculated, and the pixel values ​​of the noisy pixels are replaced with the pixel mean, completing the noise pixel elimination process.

[0075] like Figure 7 As shown in the illustration, this application also provides a system for acquiring makeup material images. Optionally, the system includes: The module includes: Module 511 for acquiring makeup images, Module 512 for makeup transfer, Module 513 for acquiring makeup image assets, and Module 514 for acquiring makeup material images. The acquisition module 511 is used to acquire a face reference image and a frontal standard background image, wherein the face reference image includes a reference makeup; In this embodiment, the acquisition module 511 can be used to perform... Figure 2 For a detailed description of the acquisition module 511, please refer to the description of step S100 shown.

[0076] The makeup transfer module 512 is used to process the frontal standard base image based on the reference makeup of the face reference image to obtain a frontal standard image with makeup. In this embodiment, the makeup transfer module 512 can be used to perform... Figure 2 For a detailed description of the makeup transfer module 512, please refer to the description of step S200 shown.

[0077] The makeup image acquisition module 513 is used to remove the facial frame features of the frontal standard image from the frontal standard image with makeup to obtain the makeup image; In this embodiment, the makeup image acquisition module 513 can be used to perform... Figure 2 For a detailed description of the makeup image acquisition module 513, see step S300 shown below. For a detailed description of step S300, please refer to the description of step S300.

[0078] The makeup material image acquisition module 514 is used to process the makeup image based on a preset facial mask to obtain several makeup material images; In this embodiment, the makeup material image acquisition module 514 can be used to perform... Figure 2 For a detailed description of the makeup material image acquisition module 514 shown in step S400, please refer to the description of step S400.

[0079] This application also provides an electronic device, the structure of which is as follows: Figure 8 As shown, the electronic device includes a memory 611, a processor 612, a communication module 613, and an input / output interface 614, etc. Optionally, the memory 611, the processor 612, the communication module 613, and the input / output interface 614 can be connected and communicate with each other through a bus 615.

[0080] The memory 611 is used to store one or more computer programs and to transfer the code of the computer programs to the processor 612; when the one or more computer programs are executed by the processor 612, a method for acquiring makeup material images in this application embodiment is implemented.

[0081] Optionally, the electronic device can be connected to a network via communication module 613 to communicate with other devices, such as terminals or servers, to achieve data interaction. The electronic device can be various forms of digital computers, exemplarily such as desktop computers, servers, workbenches, mainframes, or other types of computers. The electronic device can also be various forms of mobile terminals, exemplarily such as smartphones, tablets, wearable devices (such as helmets, glasses, watches, etc.), and other similar mobile terminals.

[0082] Optionally, the electronic device can connect to required input / output devices, such as a keyboard or display device, via the input / output interface 614. The electronic device itself may have a display device, and other display devices can also be connected externally via the input / output interface 614. Optionally, a storage device, such as a hard disk, can also be connected via the input / output interface 614 to store data from the electronic device, read data from the storage device, or store data from the storage device in the memory 611. It is understood that the input / output interface 614 can be a wired interface or a wireless interface. Depending on the actual application scenario, the device connected to the input / output interface 614 can be a component of the electronic device or an external device connected to the electronic device when needed.

[0083] Optionally, the memory 611 may be a volatile memory and / or a non-volatile memory. The volatile memory may be a random access memory, etc., and the non-volatile memory may be a read-only memory, a programmable read-only memory, an erasable programmable read-only memory, an electrically erasable programmable read-only memory, or a flash memory, etc.

[0084] Optionally, the computer program stored in the memory 611 can be divided into one or more modules, which are stored in the memory 611 and executed by the processor 612 to perform the method provided in this embodiment. The one or more modules can be a series of computer program instruction segments capable of performing specific functions, which describe the execution process of the computer program in the electronic device.

[0085] Optionally, the processor 612 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the processor 612 include, but are not limited to, a central processing unit, a graphics processing unit, a digital signal processor, various special-purpose artificial intelligence computing chips, various processors running machine learning model algorithms, and can also be any suitable controller, microcontroller, processor, etc. The processor 612 executes the various methods and processes of this embodiment, exemplarily, such as a method for acquiring makeup material images according to an embodiment of this application.

[0086] Optionally, the bus 615 may include a path for transmitting information. Depending on its function, the bus 615 may be divided into an address bus, a data bus, a control bus, etc.

[0087] In an optional implementation, this application embodiment also provides a computer storage medium storing a computer program thereon, which, when executed by a computer, enables the computer to perform the methods described in the above method embodiments. Part or all of the computer program can be loaded and / or installed on the memory 611 of an electronic device. When the computer program is executed by the processor 612, one or more steps of a makeup material image acquisition method according to an embodiment of this application can be performed.

[0088] Optionally, the computer-readable storage medium may be a random access memory, a read-only memory, a programmable read-only memory, an erasable programmable read-only memory, an electrically erasable programmable read-only memory, etc.

[0089] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the technical solution of the present invention, and are not intended to limit the specific implementation of the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the claims of the present invention should be included within the protection scope of the claims of the present invention.

Claims

1. A method for acquiring makeup material images, characterized in that, The method includes: Obtain a face reference image and a frontal standard base image, wherein the face reference image includes a reference makeup look; The standard frontal image is processed based on the reference makeup of the face reference image to obtain a standard frontal image with makeup. Remove the facial frame features from the standard frontal image with makeup to obtain the makeup image; The makeup image is processed based on a preset facial mask to obtain several makeup material images.

2. The method according to claim 1, characterized in that, The step of processing the standard frontal image based on the reference makeup of the facial reference image to obtain a standard frontal image with makeup includes: The reference makeup of the face reference image is transferred to the frontal standard base image, and the reference makeup transferred to the frontal standard base image is processed using preset intensity parameters to obtain a frontal standard image with makeup.

3. The method according to claim 1, characterized in that, The method further includes: making each pixel of the makeup image transparent; The step involves processing the makeup image, which has undergone transparency processing, based on a preset facial mask image, to obtain several makeup material images.

4. The method according to any one of claims 1 to 3, characterized in that, The makeup image is processed based on a preset facial mask to obtain several makeup material images, including: Based on a preset facial mask image, non-facial areas are removed from the makeup image; Obtain the region mask based on the facial mask image; Based on the aforementioned part mask, the makeup image after removing non-facial areas is segmented to obtain the makeup material image.

5. The method according to claim 4, characterized in that, The method further includes: performing a first edge smoothing process on the part mask, and using the part mask with the first edge smoothing process to perform the step of performing region segmentation on the makeup image with the non-face region removed based on the part mask to obtain a makeup material image.

6. The method according to claim 4, characterized in that, The location mask image includes one or more of the following: lip mask image, eyeshadow mask image, colored contact lens mask image, and face makeup mask image. The step of obtaining the region mask based on the facial mask image includes: Extract one or more of the following from the face mask image: preliminary lip mask image, preliminary eyeshadow mask image, colored contact lens mask image, and preliminary face makeup mask image; Remove the oral cavity region from the preliminary lip mask image to obtain the lip mask image; Remove the eyelash area and the colored contact lens area from the preliminary eyeshadow mask to obtain the eyeshadow mask; Remove the eyeshadow area, contact lens area, and lip area from the preliminary face makeup mask to obtain the face makeup mask.

7. The method according to claim 1, characterized in that, After processing the makeup image based on a preset facial mask to obtain several makeup material images, the method further includes: Obtain the makeup boundary of the makeup material image, obtain the shortest distance between the pixels in the makeup material image and the makeup boundary, and perform a second edge smoothing process on the pixels whose shortest distance is less than a preset threshold; And / or, Obtain noise pixels in the makeup material image, obtain a denoising region of a preset size centered on the noise pixels, calculate the pixel mean of the denoising region, and replace the pixel value of the noise pixels with the pixel mean.

8. A system for acquiring makeup material images, characterized in that, The system includes: The acquisition module is used to acquire a face reference image and a frontal standard background image, wherein the face reference image includes a reference makeup; The makeup transfer module is used to process the frontal standard base image based on the reference makeup of the face reference image to obtain a frontal standard image with makeup. The makeup image acquisition module is used to remove the facial frame features of the standard frontal face image from the standard frontal face image with makeup to obtain the makeup image; The makeup material image acquisition module is used to process the makeup image based on a preset facial mask to obtain several makeup material images.

9. An electronic device, characterized in that, include: Memory, used to store one or more computer programs; A processor, when the one or more computer programs are executed by the processor, implements a method for acquiring makeup material images as described in any one of claims 1-7.

10. A computer-readable storage medium storing computer instructions for causing a processor to execute and implement a method for acquiring makeup material images as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Makeup processing method and device, electronic equipment and readable storage medium

    CN111815533A

  • Makeup migration method based on generative adversarial network

    CN115345773A

  • Virtual makeup changing method, system and equipment and storage medium

    CN115936796A