CN111369644A - Face image makeup trial processing method and device, computer equipment and storage medium - Google Patents

Face image makeup trial processing method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN111369644A
CN111369644A CN202010129222.9A CN202010129222A CN111369644A CN 111369644 A CN111369644 A CN 111369644A CN 202010129222 A CN202010129222 A CN 202010129222A CN 111369644 A CN111369644 A CN 111369644A
Authority
CN
China
Prior art keywords
image
makeup
pixel
mask
pixel point
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010129222.9A
Other languages
Chinese (zh)
Inventor
孙宇超
王东媛
姚聪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Kuangshi Technology Co Ltd
Beijing Megvii Technology Co Ltd
Original Assignee
Beijing Kuangshi Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Kuangshi Technology Co Ltd filed Critical Beijing Kuangshi Technology Co Ltd
Priority to CN202010129222.9A priority Critical patent/CN111369644A/en
Publication of CN111369644A publication Critical patent/CN111369644A/en
Priority to PCT/CN2020/119543 priority patent/WO2021169307A1/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/60Editing figures and text; Combining figures or text

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)

Abstract

The application relates to a makeup trial processing method and device for a face image, computer equipment and a storage medium. The method comprises the following steps: acquiring an image of a part to be made up on a face image, further acquiring a mask image of the part to be made up, and then fusing the mask image and the image of the part to be made up to obtain a make-up trial image. The makeup trial image obtained by the method integrates attributes such as original skin color in the image of the part to be made up and color of the makeup trial product in the mask image, so that a real makeup trial effect is generated.

Description

Face image makeup trial processing method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of image processing technologies, and in particular, to a makeup trial processing method and apparatus for a human face image, a computer device, and a storage medium.
Background
With the development of the time diversification technology, makeup is becoming a new need for users. In order to meet the requirements of makeup in different degrees, makeup brands continuously develop makeup products with different effects, and a plurality of electronic application products showing the makeup trial effect appear in succession.
The existing electronic application products for showing the makeup trial effect usually adopt a virtual makeup trial algorithm to show the face image after makeup so as to show the makeup trial effect. In addition, the virtual makeup trying algorithm usually adopts a pattern pasting mode, namely, a position needing makeup is firstly detected and then a preset makeup trying pattern is directly covered on the position needing makeup so as to present a makeup trying effect.
However, the existing method for displaying the makeup trial effect has the problems of poor display effect and low trueness.
Disclosure of Invention
Therefore, there is a need to provide a makeup trying processing method, device, computer equipment and storage medium for a face image, which can effectively improve the display effect and improve the makeup reality.
In a first aspect, a method for processing a makeup test of a face image includes:
acquiring a part image to be made up on a face image;
acquiring a mask image of a part image to be made up; the mask image is used for rendering the image of the part to be made up;
and fusing the mask image and the image of the part to be made up to obtain a makeup trial image.
In one embodiment, the step of fusing the mask image and the image of the part to be made up to obtain the image of the part to be made up includes:
determining the pixel value of a first pixel point which is larger than or equal to a preset threshold value on a part image to be made up;
determining the pixel value of a second pixel point smaller than a preset threshold value on the part image to be made up;
and determining the makeup trial image according to the pixel value of the first pixel point, the pixel value of the second pixel point and the mask image.
In one embodiment, determining a makeup trial image according to the pixel value of the first pixel point, the pixel value of the second pixel point, and the mask image includes:
obtaining a pixel value of a target first pixel point through a first fusion mode according to a pixel value of the first pixel point on the part image to be made up and a pixel value corresponding to the first pixel point on the mask image;
obtaining a pixel value of a target second pixel point through a second fusion mode according to the pixel value of the second pixel point on the part image to be made up and the pixel value corresponding to the second pixel point on the mask image;
and determining the makeup trial image according to the pixel value of the target first pixel point and the pixel value of the target second pixel point.
In one embodiment, the first fusing mode is a color filtering mode, and the second fusing mode is a positive lamination mode.
In one embodiment, before fusing the mask image and the image of the part to be made up, the method further comprises:
carrying out fuzzy processing on the image of the part to be made up to obtain a middle image of the part to be made up;
acquiring a pixel difference value between a pixel value of a pixel point on a to-be-made-up part image and a pixel value of a corresponding pixel point on a middle to-be-made-up part image;
if the pixel difference value is larger than the preset pixel threshold value, performing brightness weakening treatment on pixel points on the to-be-made-up part image corresponding to the pixel difference value to obtain a treated to-be-made-up part image;
fusing the mask image and the image of the part to be made up, comprising the following steps:
and fusing the mask image and the processed image of the part to be made up.
In one embodiment, before fusing the mask image and the image of the part to be made up, the method further comprises:
adjusting corresponding parameters of the mask image according to preset adjusting parameters to obtain the mask image with the adjusted parameters; the adjusting parameters comprise a saturation threshold and/or a brightness threshold;
fusing the mask image and the image of the part to be made up, comprising the following steps:
and fusing the mask image with the to-be-made-up part image after the parameters are adjusted.
In one embodiment, acquiring a to-be-made-up part image on a face image comprises:
carrying out key point detection on the face image to obtain key points on the face image;
determining dense key points representing the boundary of the part to be made up according to the key points;
and determining the part image to be made up according to the dense key points.
In one embodiment, after the mask image and the image of the part to be made up are fused to obtain the image of the part to be made up, the method further includes:
and fusing the makeup trial image and the face image to obtain a complete makeup trial image.
In one embodiment, acquiring a mask image of a part image to be made up, includes:
acquiring preset makeup parameters; the makeup parameters comprise a makeup color parameter, a makeup brightness parameter and a makeup paillette parameter;
and determining a mask image according to the makeup parameters.
In a second aspect, a makeup trial processing device for a face image, the device comprising:
the first acquisition module is used for acquiring a part image to be made up on the face image;
the second acquisition module is used for acquiring a mask image of the part image to be made up; the mask image is used for rendering the image of the part to be made up;
and the fusion module is used for fusing the mask image and the image of the part to be made up to obtain a makeup trying image.
In a third aspect, a computer device comprises a memory storing a computer program and a processor implementing the steps of the method of the first aspect when the processor executes the computer program.
In a fourth aspect, a computer-readable storage medium has stored thereon a computer program which, when being executed by a processor, carries out the steps of the method of the first aspect.
The makeup trial processing method, the makeup trial processing device, the computer equipment and the storage medium of the face image comprise the following steps: acquiring an image of a part to be made up on a face image, further acquiring a mask image of the part to be made up, and then fusing the mask image and the image of the part to be made up to obtain a make-up trial image. The makeup trial image obtained by the method integrates attributes such as original skin color in the image of the part to be made up and color of the makeup trial product in the mask image, so that a real makeup trial effect is generated.
Drawings
FIG. 1 is a diagram illustrating an internal structure of a computer device according to an embodiment;
FIG. 2 is a schematic flow chart illustrating a makeup trial processing method for a face image according to an embodiment;
FIG. 3 is a flowchart illustrating the step S103 according to an embodiment;
FIG. 4 is a flowchart illustrating the step S203 according to an embodiment;
FIG. 5 is a schematic flow chart illustrating a makeup trial processing method for a face image according to an embodiment;
FIG. 6 is a flowchart illustrating the step S101 according to an embodiment;
FIG. 7 is a flowchart illustrating the step S502 according to an embodiment;
FIG. 8 is a flowchart illustrating the step S102 according to an embodiment;
FIG. 9 is a block diagram of a makeup trial processing apparatus for a face image according to an embodiment;
FIG. 10 is a block diagram of a makeup trial processing apparatus for a face image according to an embodiment;
FIG. 11 is a block diagram of a makeup trial processing apparatus for a face image according to an embodiment;
FIG. 12 is a block diagram of a makeup trial processing apparatus for a face image according to an embodiment;
FIG. 13 is a block diagram of a makeup trial processing apparatus for a face image according to an embodiment;
FIG. 14 is a block diagram of a makeup trial processing apparatus for a face image according to an embodiment;
fig. 15 is a block diagram of a makeup trial processing apparatus for a face image in one embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
In one embodiment, a computer device is provided, which may be a terminal or a server, and its internal structure diagram may be as shown in fig. 1. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The communication interface of the computer device is used for carrying out wired or wireless communication with an external terminal, and the wireless communication can be realized through WIFI, an operator network, NFC (near field communication) or other technologies. The computer program is executed by a processor to realize a makeup trial processing method of the face image. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the architecture shown in fig. 1 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In an embodiment, as shown in fig. 2, a makeup trial processing method for a face image is provided, which is described by taking the method as an example applied to the computer device in fig. 1, and this embodiment relates to a specific method for processing a makeup trial position image by the computer device, and the method includes the following steps:
s101, obtaining an image of a part to be made up on the face image.
The image of the part to be made up is a photo or a video image obtained by shooting a human face by using equipment or a device with a shooting or image pickup function, such as a mobile phone, a camera, a video camera, and the like, and the part to be made up can be any part on the human face, such as eyes, lips, cheeks, and the like.
Specifically, when the computer equipment needs to show a makeup effect, the computer equipment can shoot a face image through a connecting camera or a built-in camera, so that a part image to be made up is obtained according to the face image; optionally, the computer device may also directly shoot the part to be made up on the face through the camera to obtain an image of the part to be made up; optionally, the computer device may also import a face image shot by a user mobile phone or other recording devices, and further obtain a to-be-makeup part image according to the face image. Optionally, the computer device may also directly acquire the image of the part to be made up on the face image in other manners, for example, directly download and acquire the image of the part to be made up on the face image from a network. This embodiment is not limited thereto.
S102, obtaining a mask image of the part image to be made up, wherein the mask image is used for rendering the part image to be made up.
The mask image may also be referred to as a cover plate image, and is generally used for rendering an image. In this embodiment, when the computer device acquires the image of the part to be made up, the mask image of the part to be made up may be generated by setting parameters for making up. Wherein, the parameters of the makeup can be the color, the glossiness, the brightness, the paillette, the highlight and the like of various makeup products. The parameter of applying makeup may be a parameter selected by the user according to actual application requirements and preferences, for example, when the user needs to apply makeup on the lip region, the user may input a favorite brand of makeup product or favorite makeup color on the interface of the computer device, and the computer device generates a mask image of the lip region image according to the attribute or the makeup color of the makeup product selected by the user, so that the computer device uses the mask image to realize the display of the effect of applying makeup on the lip region.
And S103, fusing the mask image and the image of the part to be made up to obtain a makeup trial image.
When the computer equipment acquires the mask image of the part image to be made up, the mask image of the part image to be made up and the part image to be made up can be further fused to render the part to be made up on the face image, so that the part to be made up on the face image can be made up, and the make up trial image with the make up effect can be obtained. The fusion processing process realizes the fusion of attributes such as colors and the like of the makeup trial product in the mask image on the basis of the original skin color of the image of the part to be made up, so that the finally obtained makeup trial image is the result of the fusion of the attributes of the makeup trial product and the skin color of the part to be made up.
The makeup trial processing method of the face image comprises the following steps: acquiring an image of a part to be made up on a face image, further acquiring a mask image of the part to be made up, and then fusing the mask image and the image of the part to be made up to obtain a make-up trial image. The makeup trial image obtained by the method integrates attributes such as original skin color in the image of the part to be made up and color of the makeup trial product in the mask image, so that a real makeup trial effect is generated.
In an embodiment, as shown in fig. 3, the step S103 "fusing the mask image and the image of the part to be made up to obtain the image to be made up" includes:
s201, determining the pixel value of a first pixel point which is larger than or equal to a preset threshold value on the part image to be made up.
The preset threshold may specifically be any value from 0 to 255, and the specific value may be determined according to the actual application requirement, for example, the preset threshold in this embodiment may be 128. The first pixel point represents a pixel point in a high-brightness area on the image of the part to be made up. In this embodiment, when the computer device obtains the image of the part to be made up, the first pixel point whose pixel value is greater than or equal to the preset threshold value, that is, the first pixel point in the high-brightness region, may be extracted from the image, so that the first pixel point and the corresponding pixel point on the mask image may be used for fusion.
S202, determining the pixel value of a second pixel point smaller than a preset threshold value on the part image to be made up.
And the second pixel points represent pixel points in a low-brightness area on the image of the part to be made up. In this embodiment, when the computer device obtains the image of the part to be made up, the second pixel point whose pixel value is smaller than the preset threshold value, that is, the second pixel point in the high-brightness region, may be extracted from the image, so that the second pixel point and the corresponding pixel point on the mask image may be used for fusion.
S203, determining a makeup trial image according to the pixel value of the first pixel point, the pixel value of the second pixel point and the mask image.
When the computer equipment acquires the first pixel point and the second pixel point, the pixel value of the first pixel point and the pixel value of the corresponding pixel point on the mask image can be further fused, and the pixel value of the second pixel point and the pixel value of the corresponding pixel point on the mask image can be further fused, so that the trial makeup image is obtained.
In an embodiment, as shown in fig. 4, the step S203 "determining a makeup trying image according to the pixel value of the first pixel point, the pixel value of the second pixel point, and the mask image" includes:
s301, obtaining the pixel value of the target first pixel point through a first fusion mode according to the pixel value of the first pixel point on the part image to be made up and the pixel value corresponding to the first pixel point on the mask image.
Specifically, the computer device may divide the color of the to-be-tried-made-up portion image into R, G, B colors of three channels, and change the colors of the three channels, specifically, may adjust the region, where the color of the to-be-tried-made-up portion image is lower than the preset threshold color, in a first fusion manner. For example, the value of the preset threshold color may be 128.
For example, the first fusion method may be a color filtering method, and may specifically be represented by the following relation (1), so as to obtain a pixel value of the target first pixel point:
Figure BDA0002395336180000071
wherein C represents the pixel value of the target first pixel point and also represents the color values of the three channels R, G, B of the target first pixel point; a represents the pixel value of a first pixel point on the part image to be made up, and also represents the color values of three channels R, G, B of the first pixel point on the part image to be made up; b represents the pixel value on the mask image corresponding to the first pixel point and also represents the color values of the three channels R, G, B on the mask image corresponding to the first pixel point pair.
In this embodiment, when the computer device determines the pixel value of the first pixel point on the part image to be made up and the pixel value corresponding to the first pixel point on the mask image, the pixel value of the first pixel point on the part image to be made up and the pixel value corresponding to the first pixel point on the mask image may be further substituted into the variables a and B in the relational expression (1), so as to obtain the pixel value C of the target first pixel point.
And S302, obtaining the pixel value of the target second pixel point through a second fusion mode according to the pixel value of the second pixel point on the part image to be made up and the pixel values of the second pixel point on the mask image.
Specifically, the area of the to-be-made-up part image with the color higher than the preset threshold color can be adjusted in a second fusion mode.
Optionally, the second fusion mode may be positive film lamination, and may specifically be represented by the following relation (2), so as to obtain a pixel value of the target second pixel point:
Figure BDA0002395336180000081
wherein C represents the pixel value of the target second pixel point and also represents the color values of the three channels R, G, B of the target second pixel point; a represents the pixel value of a second pixel point on the part image to be made up, and also represents the color values of three channels R, G, B of the second pixel point on the part image to be made up; b represents the pixel value corresponding to the second pixel point on the mask image and also represents the color values of the three channels R, G, B corresponding to the second pixel point on the mask image.
In this embodiment, when the computer device determines the pixel value of the second pixel point on the part image to be made up and the pixel value corresponding to the second pixel point on the mask image, the pixel value of the second pixel point on the part image to be made up and the pixel value corresponding to the second pixel point on the mask image may be further substituted into the variables a and B in the relational expression (2), so as to obtain the pixel value C of the target second pixel point.
And S303, determining a makeup trial image according to the pixel value of the target first pixel point and the pixel value of the target second pixel point.
When the computer device obtains the pixel value of the target first pixel point and the pixel value of the target second pixel point based on the methods of S301 and S302, the pixel values of all the pixel points on the makeup trial image can be determined according to the pixel value of the target first pixel point and the pixel value of the target second pixel point, and the makeup trial image is obtained.
Optionally, in the above fusion process, the computer device may further perform pixel point by pixel point, that is, on the one hand, the size of the pixel value of each pixel point on the image to be made up is determined, and then the corresponding relation (1) or (2) is selected according to the size of the pixel value of each pixel point, and the pixel value of each pixel point on the image to be made up and the pixel value of the corresponding pixel point on the mask image are substituted into the corresponding relation (1) or (2) for calculation, so as to obtain the pixel value of each pixel point on the image to be made up, that is, the image to be made up is obtained equivalently. When the above process is specifically implemented, the GPU mode can be adopted for acceleration, so as to improve the rate of obtaining the makeup trial image, and achieve a real-time processing effect.
It should be noted that, in the makeup trial image obtained by the method described in the embodiment of fig. 4, compared with the original image of the part to be made up trial, the changed color of the makeup area on the image is mainly a high-brightness area, and the color of the dark area is basically kept unchanged, so that the shadow effect and the high-brightness effect on the part to be made up are also kept, the stereoscopic impression and the saturation of the part to be made up are improved, the makeup effect on the makeup trial image is more real, and the makeup trial image is more in line with the actual makeup effect.
In practical applications, there is also an application scenario, that is, if a user selects a matte makeup product for makeup, for example, a mask lipstick, the effect after makeup is certainly not high, and therefore, before a mask image and a makeup part image to be tried are fused, a highlight weakening process needs to be performed on the makeup part image to be tried, and this process, as shown in fig. 5, includes:
s401, performing fuzzy processing on the image of the part to be made up to obtain an intermediate image of the part to be made up.
Specifically, when the computer device obtains the image of the part to be made up, the image of the part to be made up may be further subjected to a blurring process, for example, a gaussian blurring process, so as to achieve an effect of smoothing the pixel values of the pixels on the image of the part to be made up, thereby removing the pixels with a high pixel value on the image of the part to be made up, and removing the pixels with a low pixel value on the image of the part to be made up, so that there are no highlight pixels on the image of the part to be made up, which is equivalent to achieving a highlight removal effect. In this embodiment, after the computer device performs the blurring processing on the image of the part to be made up, the processed image of the part to be made up, that is, the image of the middle part to be made up, may be obtained.
S402, obtaining a pixel difference value between the pixel value of the pixel point on the image of the part to be made up and the pixel value of the corresponding pixel point on the image of the middle part to be made up.
When the computer device obtains the intermediate to-be-made-trial position image based on the step of S401, the difference between the pixel value of the pixel point on the to-be-made-trial position image and the pixel value of the pixel point on the intermediate to-be-made-trial position image may be further calculated, so as to obtain the pixel difference between the pixel value of the pixel point on the to-be-made-trial position image and the pixel value of the corresponding pixel point on the intermediate to-be-made-trial position image. In practical application, the highlight pixel points may exist in the pixel points on the part image to be tried to be made up, which are larger than the middle part image to be tried to be made up, and if the highlight pixel points are determined from the pixel points on the part image to be tried to be made up, which are larger than the middle part image to be tried to be made up, the highlight processing can be weakened on the highlight pixel points by the computer equipment, so that highlight on the part image to be tried to be made up is eliminated.
And S403, if the pixel difference value is larger than the preset pixel threshold value, performing brightness weakening treatment on the pixel point on the to-be-made-up part image corresponding to the pixel difference value to obtain the treated to-be-made-up part image.
When the computer device obtains the pixel difference value based on the step in S402, the pixel difference value may be further compared with the preset pixel threshold, and the pixel point on the to-be-tried-made-up portion image corresponding to the pixel difference value larger than the preset pixel threshold is subjected to brightness weakening processing, so that the pixel value of the pixel point on the to-be-tried-made-up portion image may be reduced, that is, the brightness of the pixel point on the to-be-tried-made-up portion image may be weakened. The image of the part to be made up after being processed by the method is the image of the part to be made up after the highlight brightness is weakened.
Correspondingly, the specific implementation of S103 "fusing the mask image and the image of the part to be made up" includes: and fusing the mask image and the processed image of the part to be made up.
When the computer device obtains the processed image of the part to be made up, the processed image of the part to be made up and the mask image are fused to obtain the image of the part to be made up according to the method described in the foregoing embodiment. The processed image of the part to be made up in a trial manner is an image subjected to blurring processing, namely an image subjected to highlight weakening, so that the make-up trial image can achieve a make-up effect of a matte surface.
In another application scenario, if the difference between the color of the makeup product selected by the user and the color of the part to be made up is relatively large (for example, the color of the makeup product is green, and the color of the part to be made up is black), the difference between the effect after making up and the actual makeup effect is determined to exist, so that some processing needs to be performed on the mask image before the mask image and the image of the part to be made up are fused, and the makeup effect on the fused image can better meet the real makeup effect after the mask image is fused with the image of the part to be made up. The treatment process comprises the following steps: adjusting corresponding parameters of the mask image according to preset adjusting parameters to obtain the mask image with the adjusted parameters; the adjustment parameters include a saturation threshold and/or a brightness threshold.
In this embodiment, when the mask image is obtained, the computer device may further adjust parameters such as saturation and brightness of the mask image according to preset parameters such as saturation and/or brightness, so that a difference between attributes such as saturation and/or brightness of the mask image after the parameters are adjusted and attributes of the mask image to be made up is reduced, so that when the mask image after the parameters are adjusted is used for blending, a make-up effect on the blended image is more real.
Correspondingly, the specific implementation of S103 "fusing the mask image and the image of the part to be made up" includes: and fusing the mask image with the to-be-made-up part image after the parameters are adjusted.
When the computer device obtains the mask image after the parameters are adjusted, the mask image after the parameters are adjusted and the image of the part to be made up are fused according to the method in the embodiment to obtain the image of the make up trial. The mask image after the parameters are adjusted is an image after the parameters are adjusted according to actual requirements, so that the makeup trial image can solve the problem of unreal makeup effect caused by large difference between the mask image and the image of the part to be made up.
In an embodiment, as shown in fig. 6, a specific implementation manner of the step S101 "acquiring a to-be-made-up part image on a face image" includes:
s501, obtaining a face image through image acquisition equipment.
The image acquisition equipment can be a video camera, a mobile phone and other equipment with a photographing or shooting function. The image acquisition equipment can acquire a face image and also can acquire a video image containing the face image. In this embodiment, the computer device may acquire the face image through the image acquisition device, may also acquire the video image, and when acquiring the video image, may split the video image into images with faces by using a frame rate. It should be noted that when the computer device acquires the video stream, real-time cosmetic processing on each frame of the video stream can be realized according to the method described in the foregoing embodiment, so as to obtain a cosmetic video.
And S502, determining the image of the part to be made up according to the face image.
When the computer equipment acquires the face image, the part image to be made up on the face image can be further determined. Specifically, when the computer device acquires the face image, the part to be made up on the face image can be detected according to a corresponding detection method, so as to obtain the part image to be made up. Optionally, when the computer device acquires the face image, the part to be made up on the face image can be determined according to an instruction input by the user, so that the part image to be made up is obtained.
In an embodiment, as shown in fig. 7, a specific implementation manner of the step S502 "determining a part image to be made up according to a face image" or the step S101 "acquiring the part image to be made up on the face image" includes:
s601, carrying out key point detection on the face image to obtain key points on the face image.
The key points can represent key points of five sense organs on the face image, and can also represent key points of other parts on the face image. In this embodiment, the computer device may detect the key points on the face image by using a deep learning algorithm or other detection methods, so as to obtain the key points on the face image.
And S602, determining dense key points representing the boundary of the part to be made up according to the key points.
When the computer equipment obtains the key points on the face image, the key points on the face image can be further detected through a dense key point detection mode or other detection modes to obtain dense key points, and the real boundary of the part to be made up or the position of the part to be made up can be accurately obtained through the dense key points.
And S603, determining the image of the part to be made up according to the dense key points.
Because the real boundary of the part to be made up or the position of the part to be made up can be accurately obtained through the dense key points, the part image to be made up can be determined according to the dense key points. For example, if the boundary of the real eye part can be accurately obtained through the dense key points, the image of the part to be made up can be determined from the face image according to the position of the boundary.
In practical application, after the step S103 "blending the mask image and the image of the part to be made up to obtain the image to be made up", the method for processing the facial image to be made up includes the following steps: and fusing the makeup trial image and the face image to obtain a complete makeup trial image.
When the computer equipment performs makeup processing on the face image according to the method described in the foregoing embodiment to obtain the makeup trial image, the makeup trial image representing the makeup trial effect can be fused with the originally completed face image to obtain a complete makeup trial image, so that the user can experience the makeup trial effect more comprehensively according to the makeup trial image.
In an embodiment, as shown in fig. 8, a specific implementation of the step S102 "acquiring a mask image of a part image to be made up" includes:
s701, acquiring preset makeup parameters; the makeup parameters comprise a makeup color parameter, a makeup brightness parameter and a makeup paillette parameter.
The makeup parameters may include parameters that reflect attributes of various makeup products, specifically, makeup color parameters, makeup brightness parameters, makeup paillette parameters, and the like of various makeup products, for example, if makeup is performed on an eye part, the makeup parameters of the eye part may specifically include a color of an eye shadow, a paillette of the eye shadow, a gradual change effect of the eye shadow, and the like; when making up the lip part, the making-up parameters of the lip part may specifically include the color of the lip glaze, the highlight of the lip glaze, the saturation of the color of the lip glaze, and the like. The makeup parameters can be set according to the requirements of the user. In this embodiment, the user may input the makeup parameters by selecting items or inputting commands on the display interface of the computer device, and the computer device may obtain the makeup parameters input or selected by the user. The method for inputting may be specifically input through a keyboard or voice, and this embodiment is not limited thereto. For example, if the computer device needs to perform makeup processing on the eye parts on the face image, the user may select a red makeup color, that is, may select a makeup parameter of the color on the computer device, and then the computer device may obtain the red makeup parameter.
S702, determining a mask image according to the makeup parameters.
After the steps are completed, the computer equipment can generate a mask image containing the makeup parameter attribute according to the makeup parameter. For example, as in the above example, after the computer device obtains the red makeup parameters, a red mask image for the makeup eye may be generated according to the red makeup parameters.
The method provided by the embodiment can generate the effects of various makeup products by modifying the makeup parameters, so that the problem of large quantity of the makeup products is solved. Compared with the traditional off-line trial makeup, the trial makeup processing method for the face image greatly saves the trial makeup cost, reduces the risks of cross infection and the like of the off-line trial makeup, and greatly improves the safety of the trial makeup.
It should be understood that although the various steps in the flow charts of fig. 2-8 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2-8 may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed in turn or alternately with other steps or at least some of the other steps.
In one embodiment, as shown in fig. 9, there is provided a makeup trial processing apparatus for a face image, including: a first obtaining module 11, a second obtaining module 12 and a fusion module 13, wherein:
the first acquisition module 11 is used for acquiring a part image to be made up on the face image;
the second obtaining module 12 is configured to obtain a mask image of the part image to be made up, where the mask image is used to render the part image to be made up;
and the fusion module 13 is used for fusing the mask image and the image of the part to be made up to obtain a makeup trying image.
In one embodiment, as shown in fig. 10, the fusion module 13 includes:
the first determining unit 131 is configured to determine a pixel value of a first pixel point on the to-be-made-up part image, where the pixel value is greater than or equal to a preset threshold;
a second determining unit 132, configured to determine a pixel value of a second pixel point smaller than a preset threshold on the to-be-made-up area image;
the third determining unit 133 is configured to determine a makeup trial image according to the pixel value of the first pixel, the pixel value of the second pixel, and the mask image.
In an embodiment, the third determining unit 133 is specifically configured to obtain a pixel value of a target first pixel point through a first fusion mode according to a pixel value of the first pixel point on the image of the part to be made up and a pixel value corresponding to the first pixel point on the mask image; obtaining a pixel of a target second pixel point through a second fusion mode according to a pixel value of the second pixel point on the part image to be made up and a pixel value corresponding to the second pixel point on the mask image; and determining the makeup trial image according to the pixel value of the target first pixel point and the pixel value of the target second pixel point.
In an embodiment, as shown in fig. 11, before the fusion module 13, the makeup-trying processing apparatus for the face image further includes:
the first processing module 14 is configured to perform fuzzy processing on the image of the part to be made up to obtain an intermediate image of the part to be made up;
the third obtaining module 15 is configured to obtain a pixel difference between a pixel value of a pixel point on the to-be-tried-made-up region image and a pixel value of a corresponding pixel point on the middle to-be-made-up region image;
the second processing module 16 is configured to perform brightness weakening processing on a pixel point on the to-be-made-up partial image corresponding to the pixel difference value when the pixel difference value is greater than the preset pixel threshold value, so as to obtain a processed to-be-made-up partial image;
correspondingly, the fusion module 13 is specifically configured to fuse the mask image and the processed image of the part to be made up.
In an embodiment, as shown in fig. 12, before the fusion module 13, the makeup-trying processing device for the face image further includes:
the adjusting module 17 is configured to adjust corresponding parameters of the mask image according to preset adjusting parameters to obtain a mask image with adjusted parameters; the adjustment parameters include a saturation threshold and/or a brightness threshold.
Correspondingly, the fusion module 13 is specifically configured to fuse the mask image after the parameters are adjusted and the image of the part to be made up.
In an embodiment, as shown in fig. 13, the first obtaining module 11 includes:
the first detection unit 111 is configured to perform key point detection on the face image to obtain key points on the face image;
a second detecting unit 112, configured to determine dense key points representing the boundary of the part to be made up according to the key points;
and a fourth determining unit 113, configured to determine the part image to be made up according to the dense key points.
In an embodiment, as shown in fig. 14, after the fusion module 13, the makeup-trying processing apparatus for the face image further includes:
and the integrated image fusing module 18 is used for fusing the makeup trial image and the face image to obtain an integrated makeup trial image.
In an embodiment, as shown in fig. 15, the second obtaining module 12 includes:
an obtaining unit 121, configured to obtain preset makeup parameters; the makeup parameters comprise a makeup color parameter, a makeup brightness parameter and a makeup paillette parameter;
a fifth determining unit 122, configured to determine the mask image according to the makeup parameters.
For the specific limitation of the makeup trying processing device for the face image, reference may be made to the above limitation on the makeup trying processing method for the face image, and details are not described here. All or part of the modules in the makeup processing device for the face image can be realized by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory having a computer program stored therein, the processor implementing the following steps when executing the computer program:
acquiring a part image to be made up on a face image;
acquiring a mask image of a part image to be made up; the mask image is used for rendering the image of the part to be made up;
and fusing the mask image and the image of the part to be made up to obtain a makeup trial image.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
acquiring a part image to be made up on a face image;
acquiring a mask image of a part image to be made up; the mask image is used for rendering the image of the part to be made up;
and fusing the mask image and the image of the part to be made up to obtain a makeup trial image.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (12)

1. A makeup trial processing method for a face image, the method comprising:
acquiring a part image to be made up on a face image;
acquiring a mask image of the part to be made up; the mask image is used for rendering the image of the part to be made up;
and fusing the mask image and the image of the part to be made up to obtain a makeup trial image.
2. The method according to claim 1, wherein the fusing the mask image and the image of the part to be made up to obtain a make-up trial image comprises:
determining the pixel value of a first pixel point which is larger than or equal to a preset threshold value on the part image to be made up;
determining the pixel value of a second pixel point smaller than the preset threshold value on the part image to be made up;
and determining the makeup trial image according to the pixel value of the first pixel point, the pixel value of the second pixel point and the mask image.
3. The method of claim 2, wherein determining the makeup trial image according to the pixel values of the first pixel, the pixel values of the second pixel, and the mask image comprises:
obtaining a pixel value of a target first pixel point through a first fusion mode according to the pixel value of the first pixel point on the part image to be made up and the pixel value corresponding to the first pixel point on the mask image;
obtaining a pixel value of a target second pixel point through a second fusion mode according to the pixel value of the second pixel point on the part image to be made up and the pixel value corresponding to the second pixel point on the mask image;
and determining the makeup trial image according to the pixel value of the target first pixel point and the pixel value of the target second pixel point.
4. The method of claim 3, wherein the first fusing means is color filtering and the second fusing means is positive lamination.
5. The method according to any one of claims 1 to 4, wherein before the fusing the mask image and the image of the part to be made up, the method further comprises:
carrying out fuzzy processing on the image of the part to be made up to obtain an image of the middle part to be made up;
acquiring a pixel difference value between a pixel value of a pixel point on the to-be-made-up part image and a pixel value of a corresponding pixel point on the middle to-be-made-up part image;
if the pixel difference value is larger than a preset pixel threshold value, performing brightness weakening treatment on pixel points on the to-be-made-up part image corresponding to the pixel difference value to obtain a treated to-be-made-up part image;
the fusing the mask image and the image of the part to be made up, comprising:
and fusing the mask image and the processed image of the part to be made up.
6. The method according to any one of claims 1 to 4, wherein before the fusing the mask image and the image of the part to be made up, the method further comprises:
adjusting corresponding parameters of the mask image according to preset adjusting parameters to obtain a mask image with the adjusted parameters; the adjustment parameter comprises a saturation threshold and/or a brightness threshold;
the fusing the mask image and the image of the part to be made up, comprising:
and fusing the mask image after the parameters are adjusted and the image of the part to be made up.
7. The method according to claim 6, wherein the obtaining of the image of the part to be made up on the face image comprises:
carrying out key point detection on the face image to obtain key points on the face image;
determining dense key points representing the boundary of the part to be made up according to the key points;
and determining the part image to be made up according to the dense key points.
8. The method according to claim 1, wherein after the mask image and the image of the part to be made up are fused to obtain the image of the part to be made up, the method further comprises:
and fusing the makeup trial image and the face image to obtain a complete makeup trial image.
9. The method of claim 1, wherein the obtaining a mask image of the area to be made up comprises:
acquiring preset makeup parameters; the makeup parameters comprise a makeup color parameter, a makeup brightness parameter and a makeup paillette parameter;
and determining the mask image according to the makeup parameters.
10. A makeup-trying processing device for a face image, characterized by comprising:
the first acquisition module is used for acquiring a part image to be made up on the face image;
the second acquisition module is used for acquiring a mask image of the part image to be made up; the mask image is used for rendering the image of the part to be made up;
and the fusion module is used for fusing the mask image and the image of the part to be made up to obtain a makeup trying image.
11. A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor implements the steps of the method of any one of claims 1 to 9 when executing the computer program.
12. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 9.
CN202010129222.9A 2020-02-28 2020-02-28 Face image makeup trial processing method and device, computer equipment and storage medium Pending CN111369644A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202010129222.9A CN111369644A (en) 2020-02-28 2020-02-28 Face image makeup trial processing method and device, computer equipment and storage medium
PCT/CN2020/119543 WO2021169307A1 (en) 2020-02-28 2020-09-30 Makeup try-on processing method and apparatus for face image, computer device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010129222.9A CN111369644A (en) 2020-02-28 2020-02-28 Face image makeup trial processing method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN111369644A true CN111369644A (en) 2020-07-03

Family

ID=71208234

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010129222.9A Pending CN111369644A (en) 2020-02-28 2020-02-28 Face image makeup trial processing method and device, computer equipment and storage medium

Country Status (2)

Country Link
CN (1) CN111369644A (en)
WO (1) WO2021169307A1 (en)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112381709A (en) * 2020-11-13 2021-02-19 北京字节跳动网络技术有限公司 Image processing method, model training method, device, equipment and medium
CN112686820A (en) * 2020-12-29 2021-04-20 北京旷视科技有限公司 Virtual makeup method and device and electronic equipment
CN112712479A (en) * 2020-12-24 2021-04-27 厦门美图之家科技有限公司 Dressing method, system, mobile terminal and storage medium
CN112767285A (en) * 2021-02-23 2021-05-07 北京市商汤科技开发有限公司 Image processing method and device, electronic equipment and storage medium
CN112766234A (en) * 2021-02-23 2021-05-07 北京市商汤科技开发有限公司 Image processing method and device, electronic equipment and storage medium
WO2021169307A1 (en) * 2020-02-28 2021-09-02 北京旷视科技有限公司 Makeup try-on processing method and apparatus for face image, computer device, and storage medium
CN113762212A (en) * 2021-09-27 2021-12-07 北京市商汤科技开发有限公司 Image processing method and device, electronic equipment and storage medium
CN113761994A (en) * 2020-08-07 2021-12-07 北京沃东天骏信息技术有限公司 Method, device, equipment and computer readable medium for processing image
CN113837020A (en) * 2021-08-31 2021-12-24 北京新氧科技有限公司 Cosmetic progress detection method, device, equipment and storage medium
WO2023273247A1 (en) * 2021-06-28 2023-01-05 展讯通信(上海)有限公司 Face image processing method and device, computer readable storage medium, terminal
WO2023273246A1 (en) * 2021-06-28 2023-01-05 展讯通信(上海)有限公司 Facial image processing method and apparatus, and computer-readable storage medium and terminal

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113689363B (en) * 2021-09-07 2024-03-29 北京顺势兄弟科技有限公司 Portrait image processing method and device, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105023252A (en) * 2015-07-14 2015-11-04 厦门美图网科技有限公司 Method and system for enhancement processing of beautified image and shooting terminal
CN108564526A (en) * 2018-03-30 2018-09-21 北京金山安全软件有限公司 Image processing method and device, electronic equipment and medium
CN109063560A (en) * 2018-06-28 2018-12-21 北京微播视界科技有限公司 Image processing method, device, computer readable storage medium and terminal
EP3582187A1 (en) * 2018-06-15 2019-12-18 Beijing Xiaomi Mobile Software Co., Ltd. Face image processing method and apparatus
CN110728618A (en) * 2018-07-17 2020-01-24 阿里巴巴集团控股有限公司 Virtual makeup trying method, device and equipment and image processing method

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101408974B (en) * 2008-11-18 2010-09-22 深圳市迅雷网络技术有限公司 Image-processing method and apparatus
CN108230331A (en) * 2017-09-30 2018-06-29 深圳市商汤科技有限公司 Image processing method and device, electronic equipment, computer storage media
CN108596828B (en) * 2018-04-18 2022-03-18 网易(杭州)网络有限公司 Image floodlight processing method and device, electronic equipment and storage medium
CN109712090A (en) * 2018-12-18 2019-05-03 维沃移动通信有限公司 A kind of image processing method, device and mobile terminal
CN110390632B (en) * 2019-07-22 2023-06-09 北京七鑫易维信息技术有限公司 Image processing method and device based on dressing template, storage medium and terminal
CN111369644A (en) * 2020-02-28 2020-07-03 北京旷视科技有限公司 Face image makeup trial processing method and device, computer equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105023252A (en) * 2015-07-14 2015-11-04 厦门美图网科技有限公司 Method and system for enhancement processing of beautified image and shooting terminal
CN108564526A (en) * 2018-03-30 2018-09-21 北京金山安全软件有限公司 Image processing method and device, electronic equipment and medium
EP3582187A1 (en) * 2018-06-15 2019-12-18 Beijing Xiaomi Mobile Software Co., Ltd. Face image processing method and apparatus
CN109063560A (en) * 2018-06-28 2018-12-21 北京微播视界科技有限公司 Image processing method, device, computer readable storage medium and terminal
CN110728618A (en) * 2018-07-17 2020-01-24 阿里巴巴集团控股有限公司 Virtual makeup trying method, device and equipment and image processing method

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021169307A1 (en) * 2020-02-28 2021-09-02 北京旷视科技有限公司 Makeup try-on processing method and apparatus for face image, computer device, and storage medium
CN113761994B (en) * 2020-08-07 2024-05-21 北京沃东天骏信息技术有限公司 Method, apparatus, device and computer readable medium for processing image
CN113761994A (en) * 2020-08-07 2021-12-07 北京沃东天骏信息技术有限公司 Method, device, equipment and computer readable medium for processing image
CN112381709A (en) * 2020-11-13 2021-02-19 北京字节跳动网络技术有限公司 Image processing method, model training method, device, equipment and medium
CN112381709B (en) * 2020-11-13 2022-06-21 北京字节跳动网络技术有限公司 Image processing method, model training method, device, equipment and medium
CN112712479A (en) * 2020-12-24 2021-04-27 厦门美图之家科技有限公司 Dressing method, system, mobile terminal and storage medium
CN112686820A (en) * 2020-12-29 2021-04-20 北京旷视科技有限公司 Virtual makeup method and device and electronic equipment
CN112767285A (en) * 2021-02-23 2021-05-07 北京市商汤科技开发有限公司 Image processing method and device, electronic equipment and storage medium
CN112766234A (en) * 2021-02-23 2021-05-07 北京市商汤科技开发有限公司 Image processing method and device, electronic equipment and storage medium
CN112767285B (en) * 2021-02-23 2023-03-10 北京市商汤科技开发有限公司 Image processing method and device, electronic device and storage medium
WO2022179026A1 (en) * 2021-02-23 2022-09-01 北京市商汤科技开发有限公司 Image processing method and apparatus, electronic device, and storage medium
WO2023273246A1 (en) * 2021-06-28 2023-01-05 展讯通信(上海)有限公司 Facial image processing method and apparatus, and computer-readable storage medium and terminal
WO2023273247A1 (en) * 2021-06-28 2023-01-05 展讯通信(上海)有限公司 Face image processing method and device, computer readable storage medium, terminal
CN113837020A (en) * 2021-08-31 2021-12-24 北京新氧科技有限公司 Cosmetic progress detection method, device, equipment and storage medium
CN113837020B (en) * 2021-08-31 2024-02-02 北京新氧科技有限公司 Cosmetic progress detection method, device, equipment and storage medium
CN113762212A (en) * 2021-09-27 2021-12-07 北京市商汤科技开发有限公司 Image processing method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
WO2021169307A1 (en) 2021-09-02

Similar Documents

Publication Publication Date Title
CN111369644A (en) Face image makeup trial processing method and device, computer equipment and storage medium
CN109829930B (en) Face image processing method and device, computer equipment and readable storage medium
US9142054B2 (en) System and method for changing hair color in digital images
CN110675310A (en) Video processing method and device, electronic equipment and storage medium
CN111127591B (en) Image hair dyeing processing method, device, terminal and storage medium
JP2000134486A (en) Image processing unit, image processing method and storage medium
CN110503599B (en) Image processing method and device
CN111652123A (en) Image processing method, image synthesizing method, image processing apparatus, image synthesizing apparatus, and storage medium
CN113132696A (en) Image tone mapping method, device, electronic equipment and storage medium
TWI742173B (en) Information processing apparatus, program and information processing method
CN111275648B (en) Face image processing method, device, equipment and computer readable storage medium
CN113450431B (en) Virtual hair dyeing method, device, electronic equipment and storage medium
US20240013358A1 (en) Method and device for processing portrait image, electronic equipment, and storage medium
CN110730303B (en) Image hair dyeing processing method, device, terminal and storage medium
CN112419218A (en) Image processing method and device and electronic equipment
CN112258442A (en) Image fusion method and device, computer equipment and storage medium
CN109934168B (en) Face image mapping method and device
WO2023103813A1 (en) Image processing method and apparatus, device, storage medium, and program product
CN111462158A (en) Image processing method and device, intelligent device and storage medium
CN113691737B (en) Video shooting method and device and storage medium
CN113610723B (en) Image processing method and related device
CN113240760B (en) Image processing method, device, computer equipment and storage medium
CN113408452A (en) Expression redirection training method and device, electronic equipment and readable storage medium
CN113487497A (en) Image processing method and device and electronic equipment
CN112511890A (en) Video image processing method and device and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20200703