CN111047533A - Beautifying method and device for face image - Google Patents
Beautifying method and device for face image Download PDFInfo
- Publication number
- CN111047533A CN111047533A CN201911254845.2A CN201911254845A CN111047533A CN 111047533 A CN111047533 A CN 111047533A CN 201911254845 A CN201911254845 A CN 201911254845A CN 111047533 A CN111047533 A CN 111047533A
- Authority
- CN
- China
- Prior art keywords
- beautified
- opacity
- pixels
- area
- face
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 45
- 238000002156 mixing Methods 0.000 claims abstract description 20
- 238000004590 computer program Methods 0.000 claims description 18
- 238000004364 calculation method Methods 0.000 claims description 14
- 239000003086 colorant Substances 0.000 claims description 9
- 230000002708 enhancing effect Effects 0.000 claims 1
- 230000008569 process Effects 0.000 abstract description 6
- 230000000694 effects Effects 0.000 abstract description 3
- 230000003993 interaction Effects 0.000 abstract description 2
- 230000006870 function Effects 0.000 description 9
- 238000010586 diagram Methods 0.000 description 8
- 235000009967 Erodium cicutarium Nutrition 0.000 description 4
- 239000000203 mixture Substances 0.000 description 2
- 238000013500 data storage Methods 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 210000004279 orbit Anatomy 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/77—Retouching; Inpainting; Scratch removal
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10024—Color image
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30196—Human being; Person
- G06T2207/30201—Face
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Image Analysis (AREA)
- Image Processing (AREA)
Abstract
The invention belongs to the technical field of image processing, and particularly discloses a beautifying method and a beautifying device for a face image, wherein the beautifying method comprises the steps of identifying a to-be-beautified area of a face in the face image, obtaining RGB values of pixels in the to-be-beautified area, obtaining brightness values of the pixels through the RGB values, detecting a relatively-bright area in the face according to the brightness values, and finally carrying out color mixing to beautify the RGB values of the pixels in the to-be-beautified area so as to achieve the effect of automatically beautifying details of a local area of the face. Compared with the prior art, the processing process is simple in steps and does not involve complex operation, so that the occupied operation resource is small, meanwhile, the whole processing process does not need interaction operation of a user and is automatically carried out, and the condition that the existing figure beautifying method needs complex manual operation is avoided.
Description
Technical Field
The application belongs to the technical field of image processing, and particularly relates to a beautifying method and device for a face image, a storage medium and electronic equipment.
Background
Along with the development of intelligent equipment, the function of shooing of intelligent equipment is more and more powerful. In the function of taking a picture, the intelligent device can support high-definition shooting, and the beautifying software installed on the intelligent device has more and more abundant beautifying functions on the picture, for example, the beautifying software can support the beautifying of the face in the picture, so that the face in the picture looks younger and more beautiful.
Therefore, the beautifying software on the current intelligent equipment can beautify the portrait,
however, when the beautifying software on the existing intelligent terminal executes the beautifying function, the user needs to perform corresponding interactive operation to complete the beautifying function. For example, the user is required to perform operations such as finger smearing, touch control, etc. to complete the operation, which is not necessary for the ordinary user to perform the corresponding operation. In addition, although a hardware of the current intelligent device is very detailed, there is a certain gap with a personal computer, and some image processing software or algorithms consume a lot of computing resources if running on the intelligent device, and the execution process may be unsmooth.
Disclosure of Invention
The invention provides a beautifying method and device of a face image, a storage medium and electronic equipment, which are used for solving the problems of large occupied resources and inconvenience of the existing beautifying method of the face image.
According to a first aspect of the present application, there is provided a method for beautifying a face image, including: acquiring a face image to be beautified; acquiring a region to be beautified of a face in the face image; counting RGB information of pixels meeting a preset opacity range in an image of the area to be beautified, and calculating brightness values of the pixels meeting the preset opacity range according to the RGB information; dividing the pixels meeting the preset opacity range into a first pixel set and a second pixel set based on the brightness values, and calculating the average RGB value of the pixels in the first pixel set; reading the RGB value of the pixel in the area to be beautified, and performing normal mode color mixing under a preset opacity based on the RGB value of the pixel and the average RGB value to obtain a result color; and setting the RGB values of all the pixels in the area to be beautified as result colors corresponding to the pixels respectively to generate a target image beautified by the face.
In some embodiments, the acquiring the area to be beautified of the face in the face image includes: acquiring a face key point in the face image; and drawing the area to be beautified of the face in the face image according to the face key points.
In some embodiments, the counting RGB information of pixels in the image of the area to be beautified, which satisfy the preset opacity range, and calculating the brightness value of the pixels satisfying the preset opacity range according to the RGB information includes: traversing all pixels in the area to be beautified, and judging whether the opacity of each pixel meets a preset opacity range; and if the opacity of the pixel meets the preset opacity range, acquiring the RGB value of the pixel, and calculating the brightness value of the pixel according to the RGB value.
In some embodiments, the preset opacity includes a base color opacity and a blend color opacity, and the normal mode color blending is calculated by the formula: the resulting color is base color opacity + mixed color opacity.
In some embodiments, the base color opacity is greater than the mixed color opacity.
In some embodiments, the area to be beautified comprises at least one of the following areas in a human face: the left eye pouch region, the right eye pouch region, the left stature line region, the right stature line region, the left fishtail line region, the right fishtail line region.
According to the second aspect of the present application, there is also provided an beautifying apparatus for a face image, comprising: the image acquisition module is configured to acquire a face image to be beautified; the beautification area identification module is configured to acquire an area to be beautified of the face in the face image; the brightness value calculation module is configured to count RGB information of pixels meeting a preset opacity range in an image of the area to be beautified, and calculate the brightness value of the pixels meeting the preset opacity range according to the RGB information; an RGB value calculation module configured to divide the pixels satisfying the preset opacity range into a first pixel set and a second pixel set based on the luminance values, and calculate an average RGB value of the pixels in the first pixel set; the color mixing calculation module is configured to read the RGB value of the pixel in the area to be beautified, and perform normal mode color mixing under a preset opacity based on the RGB value of the pixel and the average RGB value to obtain a result color; and the beautified image generation module is configured to set the RGB values of all the pixels in the area to be beautified as result colors corresponding to the pixels respectively, and generate a target image for beautifying the face.
According to a third aspect of the present application, there is further provided a storage medium, where a computer program is stored, and the computer program executes the beautifying method for a face image according to any one of the first aspect.
According to a fourth aspect of the present application, there is further provided a processor, wherein the processor is configured to run a computer program, and when the computer program runs, the method for beautifying a face image according to any one of the first aspect is performed.
According to a fifth aspect of the present application, there is also provided an electronic device, comprising: at least one processor, at least one memory including a computer program; the processor is configured to run the computer program in the memory, and when the computer program runs, the beautifying method for the face image according to any one of the first aspect is performed.
The method comprises the steps of identifying the area to be beautified of the face in the face image, obtaining RGB values of pixels in the area to be beautified, obtaining brightness values of the pixels through the RGB values, detecting the area with higher brightness in the face according to the brightness values, and finally mixing colors to beautify the RGB values of the pixels in the area to be beautified, so that the effect of automatically beautifying details of the local area of the face is achieved. Compared with the prior art, the processing process is simple in steps and does not involve complex operation, so that the occupied operation resource is small, meanwhile, the whole processing process does not need interaction operation of a user and is automatically carried out, and the condition that the existing figure beautifying method needs complex manual operation is avoided.
Drawings
Fig. 1 is a flowchart illustrating an implementation of a method for beautifying a face image according to an embodiment of the present application.
Fig. 2 is a flowchart illustrating an implementation of the step S12 provided in an embodiment of the present application.
Fig. 3 is a flowchart of an implementation of the above step S13 provided in some embodiments of the present application.
Fig. 4 is a schematic structural diagram of an apparatus for beautifying a face image according to an embodiment of the present application.
Fig. 5 is a schematic structural diagram of a beautifying area recognition module 42 in the beautifying apparatus for face images shown in fig. 4 according to an embodiment of the present application.
Fig. 6 is a schematic structural diagram of a luminance value calculating module 43 in the beautifying apparatus for face images shown in fig. 4 according to an embodiment of the present application.
FIG. 7 is a schematic block diagram of an electronic device suitable for use in implementing some embodiments of the present application.
Detailed Description
Example 1
Fig. 1 is a flowchart illustrating an implementation of a method for beautifying a face image according to an embodiment of the present application.
As shown in fig. 1, the beautifying method for the face image includes the following steps.
And S11, acquiring the face image to be beautified.
In step S11, the face image includes at least one of an image and a video, and if the face image is an image, the face image may be a single-frame image or a multi-frame image sequence; if the video is a video, the video can be a single frame image or a continuous image sequence in the video. The specific type of the face image is not limited in the present application.
The color mode of the face image is an RGB mode, and the calculation in the subsequent steps is also performed based on the RGB values of the pixels.
And S12, acquiring the area to be beautified of the face in the face image.
In step S11, to the extent that the type of the face image is continued, the image format of the face image may be any format of image, and the present application is not limited in this way.
In addition, as for the source of the face image, any one of the following image sources can be included: reading locally; shooting and obtaining locally; downloaded from a database or server over a network, etc.
In some exemplary embodiments, the area to be beautified includes at least one area where an eye pocket, a statute line and a fishtail line of a human face in the human face image are located. For example, the face region may include at least one region of a left eye pocket, a right eye pocket, a left stature, a right stature, a left fishtail, and a right fishtail.
S13, counting the RGB information of the pixels meeting the preset opacity range in the image of the area to be beautified, and calculating the brightness value of the pixels meeting the preset opacity range according to the RGB information.
In step S13, the preset opacity range may include at least one of opacity greater than 40%, opacity greater than 45%, opacity greater than 50%, opacity greater than 55%, opacity greater than 60%, and opacity greater than 65%. For example, in an exemplary embodiment, in combination with the above-listed face regions, the preset opacity range is greater than 50%.
Where the RGB information includes R, G, B values for each pixel, in an exemplary embodiment, assuming the luminance value of a pixel is L, the luminance value of a pixel can be calculated by the following equation (1):
L=R*0.30+G*0.59+B*0.11,L∈[0,255]……(1)。
s14, dividing the pixels meeting the preset opacity range into a first pixel set and a second pixel set based on the brightness value, and calculating the average RGB value of the pixels in the first pixel set;
in step S14, for the purpose of continuing the calculation of the luminance values of the pixels, after the luminance value of each pixel is obtained, the maximum luminance value L of the pixel in the area to be beautified is countedmaxAnd a minimum luminance value LminThen, according to the brightness value of each pixel, the pixels of the area to be beautified can be divided into two pixel sets, namely a first pixel set and a second pixel set, wherein the range of the brightness values of the pixels in the first pixel set is [ L', L [ ]max]That is, the pixels in the first set of pixels are the pixels with the brightness in the brighter portion, and the rest of the pixels belong to the second set of pixels, and the range of the brightness values of the pixels in the second set of pixels is [ LminL'), i.e. the pixels in the second set of pixels are pixels with a luminance in the darker partAnd (4) element. Wherein L' can be calculated by the following formula (2):
L′=(Lmax-Lmin)*(1-LighterPart)+Lmin,LighterPart∈[0,1]……(2);
the LighterPart indicates the coefficient of the area to be beautified, and the coefficients of different areas to be beautified can be different. For example, in an exemplary embodiment, the area to be beautified may include six areas, namely, a left pouch, a right pouch, a left french mark, a right french mark, a left fishtail, and a right fishtail, and since the depths of the french marks are greater than those of the pouches and the fishtails and the ranges are distributed in a slender manner, LighterPart may be set to 0.5 for the left and right french mark areas; for the left eye pocket, right eye pocket, left crow's foot, right crow's foot regions, LighterPart may be set to 0.33.
Specifically, after the first pixel set is obtained, the average RGB value is calculated for the pixels in the first pixel set. Continuing with the above example, in an exemplary embodiment, the average RGB value is obtained by performing average statistics on the RGB values of the pixels in the first set of pixels. For example: the average RGB value of the skin tone for the lighter area portion of the left eye pouch may be (207,117,153); the average RGB value of the skin color for the lighter area portion of the right eye pouch may be (205, 189, 172); the average RGB value of the skin color of the brighter area portion of the left stature line may be (175, 125, 99); the average RGB value of the skin tone for the lighter regions of the right grain may be (199, 173, 159); the average RGB value of the skin color for the brighter region portion of the left crow's foot print may be (199, 164, 132); the average RGB value of the skin color of the portion of the bright area of the right crow's foot print may be (200, 187, 171).
S15, reading the RGB value of the pixel in the area to be beautified, and carrying out normal mode color mixing under preset opacity based on the RGB value of the pixel and the average RGB value.
In step S15, since the area to be beautified may include a plurality of image areas, the RGB values of the pixels of the area to be beautified should include the RGB value of each pixel in the image area where each area to be beautified is located, and the RGB values are the initial RGB values in the face image where the area to be beautified is located.
Specifically, the color mixing calculation based on the RGB values of the pixels and the average RGB value is performed for each pixel in the area to be beautified. For example, an area a to be beautified is provided with pixels a1 and a2 … … Ai, i is an integer greater than 0, where RGB values of each pixel are known, then, for the pixel a1, the RGB values are used as primary colors according to the pixel a1, an average RGB value is used as a mixed color, normal mode color mixing is performed under a preset opacity, and then, an initial RGB value of the pixel is replaced by a result value after color mixing, so as to serve as a pixel of an image after beautification.
More specifically, the opacity of the primary color subjected to normal mode color mixing and the color mixing is different. Typically, the opacity of the primary colors is higher than the opacity of the color mixture. In an exemplary embodiment, the preset opacity includes a base color opacity and a mixed color opacity, wherein the normal mode color mixing may be calculated by the following formula (2):
the result color primary color opacity + mixed color opacity … … (3)
The primary color opacity and the mixed color opacity can be a specific opacity value or an opacity range. In some embodiments, the base color opacity is greater than the mixed color opacity. For example, the mixed color opacity may be an opacity of 70% or less, i.e., the mixed color opacity ranges from [0, 70% ], and the base color opacity may be an opacity of 100%.
And S16, setting the RGB values of all the pixels in the area to be beautified as result colors corresponding to the pixels respectively, and generating a target image for beautifying the face.
According to the embodiment, the effects of reducing the bags under the eyes, the statute lines and the fishtail lines can be effectively achieved by detecting the local skin color and processing the image, when the method is used, the complicated manual operation of a user can be avoided, meanwhile, the performance requirement of a main body executing the method is not high, and the method has the characteristics of simplicity and high efficiency.
Fig. 2 is a flowchart illustrating an implementation of the step S12 provided in an embodiment of the present application.
Referring to fig. 2, in a possible embodiment, the obtaining of the area to be beautified of the face in the face image may include the following steps.
And S21, acquiring the key points of the face in the face image.
Specifically, the face key points in the face image may be obtained by face recognition. Because the face recognition can be realized by adopting the means of the prior art, the specific method for acquiring the key points of the face is not obvious.
And S22, drawing the area to be beautified of the face in the face image according to the face key points.
Specifically, under the condition that the key points of the face are obtained, various areas to be beautified can be drawn according to the key point information. For example, a left pouch area to be beautified is drawn according to two acquired face key points of the left eye corner of the human eye and one acquired face key point of the lower eye socket of the left eye. Or, the area to be beautified can be obtained by performing area calculation according to the obtained face points.
The to-be-beautified area comprises a to-be-beautified area of a left face and a to-be-beautified area of a right face in a human face, and specifically, the to-be-beautified area comprises at least one of six areas, namely a left eye pocket, a right eye pocket, a left stature line, a right stature line, a left fishtail line and a right fishtail line, which are drawn according to the left face and the right face in a distinguishing mode.
The method for acquiring the area to be beautified provided by the embodiment is realized based on the acquired face key points, does not need to perform complex operation on the image, can be realized only by performing simple drawing calculation according to the face key points, and does not need to occupy larger operation resources.
Fig. 3 is a flowchart of an implementation of the above step S13 provided in some embodiments of the present application.
Referring to fig. 3, counting RGB information of pixels satisfying a preset opacity range in an image of the area to be beautified, and calculating a luminance value of the pixels satisfying the preset opacity range according to the RGB information may include the following steps:
s31, traversing all pixels in the area to be beautified, and judging whether the opacity of each pixel meets the preset opacity range;
s32, if the opacity of the pixel meets the preset opacity range, acquiring the RGB value of the pixel, and calculating the brightness value of the pixel according to the RGB value.
In step S31, the preset opacity range is one opacity value or opacity range set in advance. For example, the preset opacity range may be set to have an opacity greater than 50%, that is, pixels having an opacity not greater than 50% may be traversed in the area to be beautified, so that all the pixel sets having an opacity not greater than 50% may be obtained.
In step S32, since the RGB values of the pixels are known, the luminance value of each pixel can be calculated from the RGB values of the pixel, and formula (1) can be referred to.
Specifically, after the brightness value of each pixel is obtained, the maximum brightness value and the minimum brightness value in the pixel set can be obtained, and then the brightness of the pixels in the pixel set can be divided into two intervals according to the formula (2), so that the pixels with brighter brightness values can be screened out conveniently.
It should be understood that if the opacity of a pixel meets a preset opacity range, the information of the pixel is not counted. Of course, the execution operation satisfying the condition may be set by itself in the specific implementation, and the present application is not limited thereto.
The embodiment highlights that the brightness value of the pixels of the area to be beautified is calculated by traversing the pixels, the whole implementation process only needs to traverse the area to be beautified on one side, the calculation is simple, and the method has the advantages of less occupied memory and quick execution in operation and execution.
Example 2
Based on the same inventive concept as embodiment 1, the present embodiment further provides a beautifying apparatus for a face image corresponding to the beautifying method for a face image.
Fig. 4 is a schematic structural diagram of an apparatus for beautifying a face image according to an embodiment of the present application.
Referring to fig. 4, the beautifying apparatus 4 for a face image includes: an image acquisition module 41 configured to acquire an image containing a face to be beautified; a beautified area identification module 42 configured to obtain an area to be beautified of the face in the face image; a brightness value calculating module 43, configured to count RGB information of pixels that satisfy a preset opacity range in an image of the area to be beautified, and calculate a brightness value of the pixels that satisfy the preset opacity range according to the RGB information; an RGB value calculating module 44 configured to divide the pixels satisfying the preset opacity range into a first pixel set and a second pixel set based on the luminance values, and calculate an average RGB value of the pixels in the first pixel set; a color mixing calculation module 45 configured to read the RGB values of the pixels in the area to be beautified, and perform normal mode color mixing based on the RGB values of the pixels and the average RGB value under a preset opacity to obtain a result color; and the beautified image generating module 46 is configured to set the RGB values of all the pixels in the area to be beautified as the result colors corresponding to the pixels, respectively, and generate a target image with a beautified face.
In some optional embodiments, the preset opacity includes a base color opacity and a mixed color opacity, and the normal mode color mixing is calculated by the following formula: the resulting color is base color opacity + mixed color opacity.
In some alternative embodiments, the base color opacity is greater than the mixed color opacity.
Fig. 5 is a schematic structural diagram of a beautifying area recognition module 42 in the beautifying apparatus for face images shown in fig. 4 according to an embodiment of the present application.
Referring to fig. 5, the beautified area identification module 42 includes: a face key point obtaining unit 51 configured to obtain a face key point in the face image; and a beautification area drawing unit 52 configured to draw an area to be beautified of the face in the face image according to the face key points.
In some optional embodiments, the area to be beautified comprises at least one of the following areas in a human face: the left eye pouch region, the right eye pouch region, the left stature line region, the right stature line region, the left fishtail line region, the right fishtail line region.
Fig. 6 is a schematic structural diagram of a luminance value calculating module 43 in the beautifying apparatus for face images shown in fig. 4 according to an embodiment of the present application.
Referring to fig. 6, the beautified area identification module 43 includes: the opacity traversing unit 61 is configured to traverse all pixels in the area to be beautified and judge whether the opacity of each pixel meets a preset opacity range; the calculating unit 62 obtains an RGB value of the pixel if the opacity of the pixel satisfies a preset opacity range, and calculates a luminance value of the pixel according to the RGB value.
Example 3
FIG. 7 is a schematic block diagram of an electronic device suitable for use in implementing some embodiments of the present application.
Referring to fig. 7, the present embodiment provides an electronic device 7, where the electronic device 7 includes: at least one processor 71, at least one memory 72, including computer programs 73; the processor 71 is configured to run the computer program 73 in the memory 72, and when the computer program 73 runs, the beautifying method for a human face image according to any one of the above embodiments 1 is executed.
In the embodiment of the present application, the processor 71 may be a Central Processing Unit (CPU), an application-specific integrated circuit (ASIC), a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic devices.
In one possible implementation, the memory 72 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data created according to the use of the computer.
Further, the memory 72 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device or other volatile solid state storage device.
The processor 71 may call a program stored in the memory, and in particular, the processor may execute the beautifying method of the face image as shown in any one of the embodiments of fig. 1 to 3.
Of course, the structure of the electronic device 7 shown in fig. 7 does not constitute a limitation of the electronic device in the embodiment of the present application, and in practical applications, the electronic device may include more or less components than those shown in fig. 7, or some components may be combined.
The embodiment of the application provides a computer readable medium, on which a computer program is stored, wherein the program is executed by a processor to implement the beautifying method for the face image described in the above method embodiments.
The embodiment of the application provides a processor, which is used for running a program, wherein the beautifying method of the face image described in the above method embodiments is realized when the program runs.
The above description is only for the purpose of illustrating the preferred embodiments of the present application and the technical principles applied, and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. The scope of the invention according to the present application is not limited to the specific combinations of the above-described features, and may also cover other embodiments in which the above-described features or their equivalents are arbitrarily combined without departing from the spirit of the invention. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.
Claims (10)
1. A method for beautifying a face image is characterized by comprising the following steps:
acquiring a face image to be beautified;
acquiring a region to be beautified of a face in the face image;
counting RGB information of pixels meeting a preset opacity range in an image of the area to be beautified, and calculating brightness values of the pixels meeting the preset opacity range according to the RGB information;
dividing the pixels meeting the preset opacity range into a first pixel set and a second pixel set based on the brightness values, and calculating the average RGB value of the pixels in the first pixel set;
reading the RGB value of the pixel in the area to be beautified, and performing normal mode color mixing under a preset opacity based on the RGB value of the pixel and the average RGB value to obtain a result color;
and setting the RGB values of all the pixels in the area to be beautified as result colors corresponding to the pixels respectively to generate a target image beautified by the face.
2. The method for beautifying a face image according to claim 1, wherein the acquiring a region to be beautified of a face in the face image comprises:
acquiring a face key point in the face image;
and drawing the area to be beautified of the face in the face image according to the face key points.
3. The method for beautifying a face image according to claim 1, wherein the counting RGB information of pixels satisfying a preset opacity range in the image of the area to be beautified, and calculating the brightness value of the pixels satisfying the preset opacity range according to the RGB information comprises:
traversing all pixels in the area to be beautified, and judging whether the opacity of each pixel meets a preset opacity range;
and if the opacity of the pixel meets the preset opacity range, acquiring the RGB value of the pixel, and calculating the brightness value of the pixel according to the RGB value.
4. The method for beautifying human face image according to claim 1, wherein the preset opacity comprises a primary opacity and a mixed opacity, and the calculation formula of normal mode color mixing is as follows:
the resulting color is base color opacity + mixed color opacity.
5. The method for beautifying a face image according to claim 4, wherein the primary color opacity is greater than the mixed color opacity.
6. The method for beautifying face image according to any one of claims 1-5, wherein the area to be beautified comprises at least one of the following areas in the face:
the left eye pouch region, the right eye pouch region, the left stature line region, the right stature line region, the left fishtail line region, the right fishtail line region.
7. An apparatus for beautifying a face image, comprising:
the image acquisition module is configured to acquire a face image to be beautified;
the beautification area identification module is configured to acquire an area to be beautified of the face in the face image;
the brightness value calculation module is configured to count RGB information of pixels meeting a preset opacity range in an image of the area to be beautified, and calculate the brightness value of the pixels meeting the preset opacity range according to the RGB information;
an RGB value calculation module configured to divide the pixels satisfying the preset opacity range into a first pixel set and a second pixel set based on the luminance values, and calculate an average RGB value of the pixels in the first pixel set;
the color mixing calculation module is configured to read the RGB value of the pixel in the area to be beautified, and perform normal mode color mixing under a preset opacity based on the RGB value of the pixel and the average RGB value to obtain a result color;
and the beautified image generation module is configured to set the RGB values of all the pixels in the area to be beautified as result colors corresponding to the pixels respectively, and generate a target image for beautifying the face.
8. A storage medium, characterized in that the storage medium stores a computer program, and the computer program executes the beautifying method for human face image according to any one of claims 1-7.
9. A processor for executing a computer program for performing a method for enhancing a face image according to any one of claims 1 to 7 when the computer program is executed.
10. An electronic device, comprising:
at least one processor for executing a program code for the at least one processor,
at least one memory including a computer program;
the processor is used for running the computer program in the memory, and the computer program is used for executing the beautifying method of the human face image according to any one of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911254845.2A CN111047533B (en) | 2019-12-10 | 2019-12-10 | Beautifying method and device for face image |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911254845.2A CN111047533B (en) | 2019-12-10 | 2019-12-10 | Beautifying method and device for face image |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111047533A true CN111047533A (en) | 2020-04-21 |
CN111047533B CN111047533B (en) | 2023-09-08 |
Family
ID=70235578
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911254845.2A Active CN111047533B (en) | 2019-12-10 | 2019-12-10 | Beautifying method and device for face image |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111047533B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113128374A (en) * | 2021-04-02 | 2021-07-16 | 西安融智芙科技有限责任公司 | Sensitive skin detection method and sensitive skin detection device based on image processing |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20050141002A1 (en) * | 2003-12-26 | 2005-06-30 | Konica Minolta Photo Imaging, Inc. | Image-processing method, image-processing apparatus and image-recording apparatus |
US20150086119A1 (en) * | 2013-09-20 | 2015-03-26 | Casio Computer Co., Ltd. | Image processing apparatus, image processing method and recording medium |
CN104574285A (en) * | 2013-10-23 | 2015-04-29 | 厦门美图网科技有限公司 | Method for automatically removing image black eyes |
CN104881853A (en) * | 2015-05-28 | 2015-09-02 | 厦门美图之家科技有限公司 | Skin color rectification method and system based on color conceptualization |
CN107231505A (en) * | 2017-07-18 | 2017-10-03 | 北京小米移动软件有限公司 | Image processing method and device |
CN107644396A (en) * | 2017-10-18 | 2018-01-30 | 维沃移动通信有限公司 | A kind of lip color adjustment method and apparatus |
CN107945107A (en) * | 2017-11-30 | 2018-04-20 | 广东欧珀移动通信有限公司 | Image processing method, device, computer-readable recording medium and electronic equipment |
CN108629819A (en) * | 2018-05-15 | 2018-10-09 | 北京字节跳动网络技术有限公司 | Image hair dyeing treating method and apparatus |
CN108961175A (en) * | 2018-06-06 | 2018-12-07 | 平安科技(深圳)有限公司 | Face luminance regulating method, device, computer equipment and storage medium |
-
2019
- 2019-12-10 CN CN201911254845.2A patent/CN111047533B/en active Active
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20050141002A1 (en) * | 2003-12-26 | 2005-06-30 | Konica Minolta Photo Imaging, Inc. | Image-processing method, image-processing apparatus and image-recording apparatus |
US20150086119A1 (en) * | 2013-09-20 | 2015-03-26 | Casio Computer Co., Ltd. | Image processing apparatus, image processing method and recording medium |
CN104574285A (en) * | 2013-10-23 | 2015-04-29 | 厦门美图网科技有限公司 | Method for automatically removing image black eyes |
CN104881853A (en) * | 2015-05-28 | 2015-09-02 | 厦门美图之家科技有限公司 | Skin color rectification method and system based on color conceptualization |
CN107231505A (en) * | 2017-07-18 | 2017-10-03 | 北京小米移动软件有限公司 | Image processing method and device |
CN107644396A (en) * | 2017-10-18 | 2018-01-30 | 维沃移动通信有限公司 | A kind of lip color adjustment method and apparatus |
CN107945107A (en) * | 2017-11-30 | 2018-04-20 | 广东欧珀移动通信有限公司 | Image processing method, device, computer-readable recording medium and electronic equipment |
CN108629819A (en) * | 2018-05-15 | 2018-10-09 | 北京字节跳动网络技术有限公司 | Image hair dyeing treating method and apparatus |
CN108961175A (en) * | 2018-06-06 | 2018-12-07 | 平安科技(深圳)有限公司 | Face luminance regulating method, device, computer equipment and storage medium |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113128374A (en) * | 2021-04-02 | 2021-07-16 | 西安融智芙科技有限责任公司 | Sensitive skin detection method and sensitive skin detection device based on image processing |
CN113128374B (en) * | 2021-04-02 | 2024-05-14 | 西安融智芙科技有限责任公司 | Sensitive skin detection method and sensitive skin detection device based on image processing |
Also Published As
Publication number | Publication date |
---|---|
CN111047533B (en) | 2023-09-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106971165B (en) | A kind of implementation method and device of filter | |
Du et al. | Saliency-guided color-to-gray conversion using region-based optimization | |
US8666156B2 (en) | Image-based backgrounds for images | |
CN109741280A (en) | Image processing method, device, storage medium and electronic equipment | |
WO2021115242A1 (en) | Super-resolution image processing method and related apparatus | |
CN104076928B (en) | A kind of method for adjusting text importing image | |
CN107507144B (en) | Skin color enhancement processing method and device and image processing device | |
US9098534B2 (en) | Image display system, image display method, social network service system, and computer-readable medium | |
US20140079319A1 (en) | Methods for enhancing images and apparatuses using the same | |
CN104282002A (en) | Quick digital image beautifying method | |
CN101529495A (en) | Image mask generation | |
US20080279467A1 (en) | Learning image enhancement | |
CN110069974B (en) | Highlight image processing method and device and electronic equipment | |
US20150278605A1 (en) | Apparatus and method for managing representative video images | |
CN112801062B (en) | Live video identification method, device, equipment and medium | |
WO2023046112A1 (en) | Document image enhancement method and apparatus, and electronic device | |
US20120081548A1 (en) | Method, device, and system for performing color enhancement on whiteboard color image | |
Jakhetiya et al. | Just noticeable difference for natural images using RMS contrast and feed-back mechanism | |
CN112686965A (en) | Skin color detection method, device, mobile terminal and storage medium | |
WO2022052862A1 (en) | Image edge enhancement processing method and application thereof | |
CN112686800B (en) | Image processing method, device, electronic equipment and storage medium | |
CN111047533A (en) | Beautifying method and device for face image | |
CN104093010B (en) | A kind of image processing method and device | |
WO2024067461A1 (en) | Image processing method and apparatus, and computer device and storage medium | |
CN112419470A (en) | Color rendering method, device, equipment and medium for target area |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |