CN108765264B - Image beautifying method, device, equipment and storage medium - Google Patents

Image beautifying method, device, equipment and storage medium Download PDF

Info

Publication number
CN108765264B
CN108765264B CN201810487608.XA CN201810487608A CN108765264B CN 108765264 B CN108765264 B CN 108765264B CN 201810487608 A CN201810487608 A CN 201810487608A CN 108765264 B CN108765264 B CN 108765264B
Authority
CN
China
Prior art keywords
face
parameter
image
current face
lip
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.)
Active
Application number
CN201810487608.XA
Other languages
Chinese (zh)
Other versions
CN108765264A (en
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.)
Shenzhen Montnets Technology Co ltd
Original Assignee
Shenzhen Montnets 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 Shenzhen Montnets Technology Co ltd filed Critical Shenzhen Montnets Technology Co ltd
Priority to CN201810487608.XA priority Critical patent/CN108765264B/en
Publication of CN108765264A publication Critical patent/CN108765264A/en
Application granted granted Critical
Publication of CN108765264B publication Critical patent/CN108765264B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • G06T3/04
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/161Detection; Localisation; Normalisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/168Feature extraction; Face representation
    • G06V40/171Local features and components; Facial parts ; Occluding parts, e.g. glasses; Geometrical relationships

Abstract

The invention discloses an image beautifying method, which comprises the following steps: carrying out face detection on the image to be beautified, and determining a face area in the image to be beautified; performing facial feature positioning on the face region to obtain a lip block of the current face in the image to be beautified; calculating a lip longitudinal depth parameter set of the current face based on the lip block; determining the expression line intensity of the current face according to the lip longitudinal depth parameter set; determining a target beauty parameter of the current face based on the expression line strength; and performing face beautifying processing on the current face according to the target face beautifying parameters. According to the method, a lip longitudinal depth parameter set is obtained through analysis of a lip block of a current face, a beauty parameter of the current face is adjusted according to the expression line strength of the current face determined by the lip longitudinal depth parameter set, and a reasonable target beauty parameter is set to perform beauty treatment on the current face, so that the beauty effect is prevented from being damaged by facial expressions, and the visual comfort of beauty is optimized. The invention also provides an image beautifying device, equipment and a storage medium.

Description

Image beautifying method, device, equipment and storage medium
Technical Field
The invention relates to the technical field of image processing, in particular to an image beautifying method, device, equipment and storage medium based on expression lines.
Background
With the rapid development of artificial intelligence AI technology, autodyne, live broadcast etc. have obtained extensive application in people's daily life, and more people like share the photo or the video of shooing through autodyne or live broadcast in order to show oneself, for improving self image and showing the effect, carry out the face beautification to the image and become indispensable operation, have produced various face beautification systems thereupon.
The existing beautifying system often ignores the influence brought by facial expression of a human face when the existing beautifying system sets the beautifying parameters of an image, the human face can generate expression lines with different degrees when the facial expression is generated, the generation of the expression lines can influence the beautifying effect, and the visual comfort level of the beautifying is reduced.
In summary, how to avoid the influence of the facial expression lines generated by the facial expressions on the image beautifying effect becomes a problem to be solved urgently by those skilled in the art.
Disclosure of Invention
The embodiment of the invention provides an image beautifying method, device, equipment and storage medium, which can avoid the effect that facial expression stripes generated by facial expressions influence the image beautifying effect and optimize the visual comfort of beautifying.
In a first aspect of the embodiments of the present invention, there is provided an image beautifying method, including:
carrying out face detection on an image to be beautified, and determining a face area in the image to be beautified;
performing facial feature positioning on the face region to obtain a lip block of the current face in the image to be beautified;
calculating a lip longitudinal depth parameter set of the current face based on the lip block;
determining the expression line intensity of the current face according to the lip longitudinal depth parameter set;
determining a target beauty parameter of the current face based on the expression line strength;
and performing face beautifying processing on the current face according to the target face beautifying parameter.
Further, the lip longitudinal depth parameter set comprises a lip longitudinal depth first parameter and a lip longitudinal depth second parameter;
correspondingly, the formula for calculating the lip longitudinal depth first parameter and the lip longitudinal depth second parameter of the current face based on the lip block is as follows:
Figure BDA0001667156690000021
hm is a first parameter of the longitudinal depth of the lip, bimax is the maximum value of a row number in the lip block, bimin is the minimum value of the row number in the lip block, Wm is a second parameter of the longitudinal depth of the lip, bjmax is the maximum value of a column number in the lip block, and bjmin is the minimum value of the column number in the lip block.
Preferably, the formula for determining the expression print intensity of the current face according to the lip longitudinal depth parameter set is as follows;
Figure BDA0001667156690000022
wherein Fw is the expression line intensity of the current face, k1、k2Is a proportional parameter, and k is more than or equal to 12<k1
Optionally, before determining the target beauty parameter of the current face based on the expression print intensity, the method includes: acquiring a first initial beauty parameter of the current face;
correspondingly, the determining the target beauty parameter of the current face based on the expression line strength comprises:
when the expression pattern intensity Fw is 1, adjusting the first initial beauty parameter by a first preset adjustment amplitude, and determining the first initial beauty parameter after the first initial beauty parameter is adjusted by the first preset adjustment amplitude as a target beauty parameter of the current face;
when the expression pattern strength Fw is equal to-1, reducing the first initial beauty parameter by a second preset adjustment amplitude, and determining the first initial beauty parameter after the second preset adjustment amplitude is reduced as a target beauty parameter of the current face;
when the expression pattern strength Fw is equal to 0, determining the first initial beauty parameter as a target beauty parameter of the current face.
Further, the expression line intensity of the current face further comprises eye expression line intensity, and the lip longitudinal depth parameter set further comprises a lip longitudinal depth third parameter;
correspondingly, the positioning of the five sense organs on the face area further comprises:
performing facial feature positioning on the face region to obtain eye blocks of the left eye or the right eye of the current face;
the calculating a lip longitudinal depth parameter set of the current face based on the lip block further comprises: calculating a third lip longitudinal depth parameter of the current face according to the following formula:
ASize=sum(max(j|bk(i,j)∈i)-min(j|bk(i,j)∈i)+1);
ASize is a third parameter of lip longitudinal depth, bk (i, j) is a lip block in the ith row and the jth column, max (j | bk (i, j) ∈ i) is the maximum value of the column number in the ith row of lip block, and min (j | bk (i, j) ∈ i) is the minimum value of the column number in the ith row of lip block;
the determining the expression line strength of the current face according to the lip longitudinal depth parameter set further includes: determining the eye expression line intensity of the current face by the following formula:
Figure BDA0001667156690000031
wherein sig is the eye expression line intensity of the current face, ESize is the block number of eye blocks of the left eye or the right eye of the current face, k3Is a proportional parameter, and k3≥1.5。
Preferably, before determining the target beauty parameter of the current face based on the expression print strength, the method further comprises: acquiring a second initial beauty parameter of the current face, wherein the second initial beauty parameter comprises an eye beauty parameter;
correspondingly, the determining the target beauty parameter of the current face based on the expression line strength comprises:
when the expression pattern strength Fw is equal to 1, judging whether the eye expression pattern strength sig is equal to 1; if the eye expression pattern intensity sig is 1, adjusting the second initial beauty parameter of the current face by a third preset adjustment amplitude, and determining the second initial beauty parameter after the third preset adjustment amplitude is adjusted to be the target beauty parameter of the current face; if the eye expression pattern intensity sig is not equal to 1, adjusting the eye beautifying parameter of the current face by a fourth preset adjustment amplitude, and determining a second initial beautifying parameter after the fourth preset adjustment amplitude is adjusted to be a target beautifying parameter of the current face;
when the expression pattern intensity Fw is-1, adjusting the second initial beauty parameter of the current face down by a fifth preset adjustment amplitude, and determining the second initial beauty parameter after the fifth preset adjustment amplitude is adjusted down as the target beauty parameter of the current face;
when the expression pattern strength Fw is equal to 0, determining the second initial beauty parameter as a target beauty parameter of the current face.
Optionally, the image to be beautified comprises each frame image in the dynamic image;
correspondingly, the image beautifying method further comprises the following steps:
after performing beauty treatment on the current frame image in the dynamic image, judging whether a next frame image exists in the dynamic image;
if the next frame of image exists in the dynamic image, judging whether the next frame of image is a scene switching frame;
when the next frame image is a scene switching frame, determining the next frame image as a new image to be beautified, returning to execute the steps of performing face detection on the image to be beautified and determining a face area in the image to be beautified and the subsequent steps;
and when the next frame image is not a scene switching frame, performing face beautifying processing on a corresponding face in the next frame image according to the target face beautifying parameter of the current frame image, simultaneously acquiring a newly added face in the next frame image, determining the newly added face as a new current face, and performing the step of calculating the lip longitudinal depth parameter set of the current face based on the lip block and the subsequent steps on the new current face.
In a second aspect of the embodiments of the present invention, there is provided an image beauty apparatus, including:
the face detection module is used for detecting the face of an image to be beautified and determining a face area in the image to be beautified;
the facial feature positioning module is used for positioning facial features of the human face area to obtain a lip block of the current human face in the image to be beautified;
a parameter set calculation module, configured to calculate a lip longitudinal depth parameter set of the current face based on the lip block;
the expression pattern determining module is used for determining the expression pattern intensity of the current face according to the lip longitudinal depth parameter set;
the facial beautification parameter determination module is used for determining a target facial beautification parameter of the current face based on the expression line intensity;
and the face beautifying processing module is used for carrying out face beautifying processing on the current face according to the target face beautifying parameter.
In a third aspect of the embodiments of the present invention, there is provided an image beautifying apparatus, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the image beautifying method according to the first aspect when executing the computer program.
In a fourth aspect of the embodiments of the present invention, a computer-readable storage medium is provided, which stores a computer program, and the computer program, when executed by a processor, implements the steps of the image beautifying method according to the first aspect.
According to the technical scheme, the embodiment of the invention has the following advantages:
in the embodiment of the invention, firstly, a face detection is carried out on an image to be beautified, a face area in the image to be beautified is determined, and the facial area is positioned by five sense organs to obtain a lip block of the current face in the image to be beautified; secondly, calculating a lip longitudinal depth parameter set of the current face based on the lip block, and determining the expression print intensity of the current face according to the lip longitudinal depth parameter set; and then, determining a target beauty parameter of the current face based on the expression line strength, and performing beauty treatment on the current face according to the target beauty parameter. In the embodiment of the invention, the lip longitudinal depth parameter set is obtained by analyzing the lip block of the current face, the expression line strength of the current face is determined according to the lip longitudinal depth parameter set, the facial beautification parameter of the current face is adjusted according to the expression line strength, and the reasonable target facial beautification parameter is set to carry out facial beautification treatment on the current face, so that the facial beautification effect of the image is prevented from being influenced by the expression line generated by facial expression, and the visual comfort of facial beautification is optimized.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a flowchart of a method for beautifying an image according to an embodiment of the present invention;
fig. 2 is a schematic flow chart of an image beautifying method in an application scenario according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of an image beautifying device according to a second embodiment of the present invention;
fig. 4 is a schematic diagram of an image beautifying apparatus according to a third embodiment of the present invention.
Detailed Description
The embodiment of the invention provides an image beautifying method, device, equipment and storage medium, which are used for setting a reasonable target beautifying parameter to carry out beautifying processing on a current face, so that the influence of expression lines generated by facial expressions on the image beautifying effect is avoided, and the visual comfort level of beautifying is optimized.
In order to make the objects, features and advantages of the present invention more obvious and understandable, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the embodiments described below are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, an embodiment of the present invention provides an image beautifying method, where the image beautifying method includes:
step S101, carrying out face detection on the image to be beautified, and determining a face area in the image to be beautified.
In this embodiment, after an image to be beautified is obtained, face detection is performed on the image to be beautified to detect whether a skin color region exists in the image to be beautified, if the skin color region exists in the image to be beautified, it is determined that a face exists in the image to be beautified, and a face region where the face exists in the image to be beautified is determined, so that the face in the face region is beautified. It can be understood that if there is no skin color region in the image to be beautified, the process of beautifying is terminated directly if there is no face in the image to be beautified, and the image to be beautified is not subjected to beautifying processing.
And S102, carrying out facial feature positioning on the face region to obtain a lip block of the current face in the image to be beautified.
In this embodiment, after the face region in the image to be beautified is determined, the face region is positioned by five sense organs, and when the positioning of the five sense organs is successful, lip blocks corresponding to each current face in the face region are obtained, wherein when the lip blocks are obtained by the positioning of the five sense organs, each lip block is provided with a corresponding row number and a corresponding column number; when the five sense organs are unsuccessfully positioned, if the human face does not exist in the human face area, the beautifying processing flow is directly ended, and the beautifying processing is not performed on the image to be beautified.
And step S103, calculating a lip longitudinal depth parameter set of the current face based on the lip block.
The lip longitudinal depth parameter set includes a lip longitudinal depth first parameter and a lip longitudinal depth second parameter, where the lip longitudinal depth first parameter is a number of rows of a lip block corresponding to each current face, and the lip longitudinal depth second parameter is a number of columns of the lip block corresponding to each current face. In this embodiment, after the lip blocks corresponding to each current face are obtained, the lip blocks that are isolated and labeled as lips in each current face are deleted to obtain the communicated lip blocks in each current face, and the lip block with the minimum column number, the lip block with the maximum column number, the lip block with the minimum row number, and the lip block with the maximum row number are found in the communicated lip blocks. After finding the lip block with the minimum column number, the lip block with the maximum column number, the lip block with the minimum row number and the lip block with the maximum row number of each current face, respectively calculating a first lip longitudinal depth parameter and a second lip longitudinal depth parameter of each current face according to the following formula I, namely the row number and the column number of each current face lip block:
Figure BDA0001667156690000071
hm is a first parameter of the longitudinal depth of the lip, bimax is the maximum value of a row number in the lip block, bimin is the minimum value of the row number in the lip block, Wm is a second parameter of the longitudinal depth of the lip, bjmax is the maximum value of a column number in the lip block, and bjmin is the minimum value of the column number in the lip block.
And S104, determining the expression print intensity of the current face according to the lip longitudinal depth parameter set.
In this embodiment, after the lip longitudinal depth parameter sets corresponding to the current faces are obtained through calculation, the expression print intensities corresponding to the current faces can be respectively determined according to the lip longitudinal depth parameter sets corresponding to the current faces. That is to say, the expression line strength of the first current face may be determined according to the lip longitudinal depth parameter set corresponding to the first current face, the expression line strength of the second current face may be determined according to the lip longitudinal depth parameter set corresponding to the second current face, and so on, so that the expression line strengths corresponding to all current faces in the image to be beautified may be obtained.
Specifically, in this embodiment, the expression line intensity of the current face is determined according to the following formula two:
Figure BDA0001667156690000081
wherein Fw is the expression line intensity of the current face, k1、k2Is a proportional parameter, and k is more than or equal to 12<k1
It can be understood that the expression print strength of the current face refers to three states of the lip of the current face determined according to the number of lines and the number of columns of the lip block of the current face, so that the expression type of the current face can be predicted, such as smile expression type with difference between the number of columns and the number of lines larger than a first threshold, or O-type mouth or beep mouth expression type with difference between the number of lines and the number of columns larger than or equal to a second threshold, wherein the first threshold is Wm-k2Hm, second threshold value Hm-k1*Wm。
And step S105, determining the target beauty parameter of the current face based on the expression line strength.
It is understood that the image beauty method in this embodiment may be used with any one of the beauty systems, and therefore, before determining the target beauty parameter of the current face based on the expression line strength to perform beauty processing on the current face, the image beauty method in this embodiment may first obtain a first initial beauty parameter determined by the beauty system for the current face in the image to be beautified, and then adjust the first initial beauty parameter based on the expression line strength to obtain the target beauty parameter of the current face.
Specifically, when the expression pattern intensity Fw is 1, the first initial beauty parameter is adjusted up by a first preset adjustment amplitude, and the first initial beauty parameter after the first initial beauty parameter is adjusted up by the first preset adjustment amplitude is determined as the target beauty parameter of the current face;
when the expression pattern strength Fw is-1, reducing the first initial beauty parameter by a second preset adjustment amplitude, and determining the first initial beauty parameter after the second preset adjustment amplitude is reduced as a target beauty parameter of the current face;
when the expression pattern strength Fw is 0, determining the first initial beauty parameter as a target beauty parameter of the current face.
When the expression line intensity Fw of a certain current face is 1, it may be considered that the number of lines of the lip block of the current face is significantly greater than the number of columns, that is, there may be expressions such as O-shaped mouth or mouth beeping, etc. in the current face, and the existence of the expressions such as O-shaped mouth or mouth beeping may stretch wrinkles originally possessed by the current face, so that the wrinkles of the current face are less than actual wrinkles thereof, which causes the beauty system to consider the current face to be younger, and thus the first initial beauty parameter determined by the beauty system for the current face is smaller and cannot achieve the beauty effect, and therefore, at this time, the first initial beauty parameter corresponding to the current face should be adjusted by the first preset adjustment amplitude, so as to obtain the target beauty parameter corresponding to the current face; when the expression line strength Fw of a certain current face is-1, the number of columns of a lip block of the current face is considered to be significantly more than the number of lines, that is, the current face may have expressions such as smile, and the existence of the expressions such as smile can enable the current face to generate expression lines similar to wrinkles, and the expression lines are easily mistaken for wrinkles by a beautifying system, so that the beautifying system considers that the current face is older, and therefore a first initial beautifying parameter determined by the beautifying system for the current face is larger, and beautifying discomfort and unrealistic are caused, and therefore, at this time, a first initial beautifying parameter corresponding to the current face should be adjusted by a second preset adjustment amplitude, and a target beautifying parameter corresponding to the current face is obtained; when the expression pattern intensity Fw of a certain current face is equal to 0, it is determined that there is no facial expression in the current face, and therefore, the target beauty parameter of the current face is determined to be the first initial beauty parameter determined by the beauty system for the current face without causing misjudgment of the beauty system for the beauty parameter of the current face.
Here, the first initial beauty parameter and the target beauty parameter may be a filtering strength of beauty, that is, a filtering strength of a current face is determined and adjusted to perform face beauty processing on the current face.
It is understood that the first preset adjustment range and the second preset adjustment range may be adjusted by a user according to a desired fixed value, and of course, the adaptive adjustment range may also be determined according to Hm and Wm in the lip depth parameter set.
And S106, performing face beautifying processing on the current face according to the target face beautifying parameters.
In this embodiment, after determining the target beauty parameter of the current face, such as the target filtering strength, the current face in the image to be beautified may be beautified according to the target filtering strength, and the rest of the image to be beautified may still be beautified according to the beauty parameter determined by the beauty system.
It can be understood that, in this embodiment, the current face refers to a face whose positioning label of the image to be beautified is being positioned, for example, a certain image to be beautified has a face a, a face B and a face C, and the face whose positioning label is being positioned is a face a, the face a is the current face at this time, so as to determine the target beautification parameter a corresponding to the face a according to the above steps S101 to S105, and perform the beautification processing on the face a according to the target beautification parameter a. After the processing is finished, the positioning label can be automatically transferred to the face B, the face B is the current face at the moment, the target beauty parameter B corresponding to the face B can be determined according to the steps, the face B is beautified according to the target beauty parameter B, and after the processing is finished, the positioning label can be automatically transferred to the face C to finish the same processing process.
Here, it is needless to say that, according to the above steps, the target beauty parameter a corresponding to the face a, the target beauty parameter B corresponding to the face B, and the target beauty parameter C corresponding to the face C are respectively determined, and then the face a, the face B, and the face C are subjected to beauty treatment at the same time, that is, the three of the face a according to the target beauty parameter a, the face B according to the target beauty parameter B, and the face C according to the target beauty parameter C are simultaneously performed.
Further, in order to improve the accuracy of determining the target beauty parameter, the image beauty method provided by this embodiment adds the intensity of the eye expression pattern to assist in determining the target beauty parameter of the current face in one application scenario.
Specifically, in the application scenario, the expression line strength of the current face further includes an eye expression line strength, and the lip longitudinal depth parameter set further includes a lip longitudinal depth third parameter; correspondingly, the positioning of the five sense organs on the face area further comprises: performing facial feature positioning on the face region to obtain eye blocks of the left eye or the right eye of the current face; meanwhile, the calculating the lip longitudinal depth parameter set of the current face based on the lip block further includes: calculating a lip longitudinal depth third parameter of the current face according to the following formula three:
ASize is sum (max (j | bk (i, j) ∈ i) -min (j | bk (i, j) ∈ i) +1) (formula three);
here, max (variable | condition) is the maximum value of the variable satisfying the condition, and max (variable | condition) is the minimum value of the variable satisfying the condition. Thus, in the third formula, ASize is a third parameter of lip longitudinal depth, bk (i, j) is the lip block in the ith row and jth column, max (j | bk (i, j) ∈ i) is the maximum value of the column number in the lip block in the ith row, and min (j | bk (i, j) ∈ i) is the minimum value of the column number in the lip block in the ith row;
the determining the expression line strength of the current face according to the lip longitudinal depth parameter set further includes: determining the eye expression line intensity of the current face according to the following formula four:
Figure BDA0001667156690000111
wherein sig is the eye expression line intensity of the current face, ESize is the block number of eye blocks of the left eye or the right eye of the current face, k3Is a proportional parameter, and k3≥1.5。
It can be understood that the third parameter of the longitudinal lip depth refers to the lip area of the current face, and may be embodied by the number of blocks of the lip block of the current face. The eye expression line intensity of the current face refers to the eye state determined according to the relationship between the number of eye blocks and the number of lip blocks of the current face.
In the scene, after the expression line strength and the eye expression line strength of the current face lip are obtained, the target beauty parameter of the current face can be determined according to the expression line strength and the eye expression line strength of the current face lip.
Specifically, before determining the target beauty parameter of the current face based on the expression print strength, the method further includes: acquiring a second initial beauty parameter of the current face, wherein the second initial beauty parameter comprises an eye beauty parameter;
correspondingly, the determining the target beauty parameter of the current face based on the expression line strength comprises:
when the expression pattern strength Fw is equal to 1, judging whether the eye expression pattern strength sig is equal to 1; if the eye expression pattern intensity sig is 1, adjusting the second initial beauty parameter of the current face by a third preset adjustment amplitude, and determining the second initial beauty parameter after the third preset adjustment amplitude is adjusted to be the target beauty parameter of the current face; if the eye expression pattern intensity sig is not equal to 1, adjusting the eye beautifying parameter of the current face by a fourth preset adjustment amplitude, and determining a second initial beautifying parameter after the fourth preset adjustment amplitude is adjusted to be a target beautifying parameter of the current face;
when the expression pattern intensity Fw is-1, adjusting the second initial beauty parameter of the current face down by a fifth preset adjustment amplitude, and determining the second initial beauty parameter after the fifth preset adjustment amplitude is adjusted down as the target beauty parameter of the current face;
when the expression pattern strength Fw is 0, determining the second initial beauty parameter as a target beauty parameter of the current face.
When facial expressions such as O-shaped mouth or Du' ao exist in the face and facial wrinkles are stretched, the number of blocks of the lips of the face is increased and/or the number of blocks of the monocular eye is decreased, so that the difference between the number of blocks of the lips and the number of blocks of the monocular eye exceeds a preset threshold; when the facial expression of the human face, such as an O-shaped mouth or a Du' ao, only stretches eye wrinkles, the number of blocks of the monocular eye blocks is increased, so that the difference between the number of the blocks of the lip and the number of the blocks of the monocular eye blocks is smaller than the preset threshold.
Here, when it is determined that the expression line strength Fw of the lip of a certain current face is equal to 1, it may be considered that an expression such as an O-shaped mouth or a beep mouth exists in the current face, but if the expression such as the O-shaped mouth or the beep mouth exists in the current face and a facial wrinkle is stretched, it is further determined that the eye expression line strength of the current face is present, and when it is continuously determined that the eye expression line strength sig of the current face is equal to 1, that is, the difference between the number of the lip blocks of the current face and the number of the single-eye blocks exceeds the preset threshold, it is determined that the expression such as the O-shaped mouth or the beep mouth exists in the current face and a facial wrinkle of the current face is stretched, and therefore, at this time, the second initial beauty parameter corresponding to the current face should be adjusted by the third preset adjustment range, so as to obtain the target beauty parameter corresponding to the current face. And when it is further determined that the eye expression line strength sig of the current face is not equal to 1, that is, the difference between the number of the lip blocks of the current face and the number of the monocular blocks is smaller than the preset threshold, it is determined that the expressions such as O-shaped mouth or Du-mouth and the like of the current face only stretch the eye wrinkles of the current face, so that the wrinkles of the eyes of the current face are less than the actual wrinkles of the eyes of the current face, and the eye beautifying parameter determined by the beautifying system for the eyes of the current face is smaller and cannot achieve the beautifying effect.
It can be understood that the third preset adjustment amplitude, the fourth preset adjustment amplitude and the fifth preset adjustment amplitude may be set by a user as required, where the adjustment amplitude of the fixed value may be the same as or different from the adjustment amplitude of the fixed value in the first preset adjustment amplitude and the second preset adjustment amplitude, and of course, the adaptive adjustment amplitude may also be determined according to Hm and Wm in the lip longitudinal depth parameter set.
As shown in fig. 2, an image beautifying method provided in an embodiment of the present invention can be used for performing a beautifying process on a face in a dynamic image in an application scenario. In this scenario, the image to be beautified includes each frame image in the dynamic image. The image beautifying method comprises the steps of S201, S202, S203, S204, S205, S206, S207, S208, S209 and S210.
Step S201, performing face detection on an image to be beautified, and determining that a face area in the image to be beautified is similar to the step S101; s202, performing facial feature positioning on the face region, and acquiring a lip block of the current face in the image to be beautified, wherein the lip block is similar to the lip block in the step S102; step S203, calculating a lip longitudinal depth parameter set of the current face based on the lip block, wherein the lip longitudinal depth parameter set is similar to the step S103; step S204, determining that the expression pattern intensity of the current face is similar to that in the step S104 according to the lip longitudinal depth parameter set; step S205, determining the target beauty parameter of the current face based on the expression line intensity, wherein the target beauty parameter is similar to the target beauty parameter of the current face in the step S105; step S206, performing the face beautifying processing on the current face according to the target face beautifying parameter is similar to step S106, and for brevity, the details are not repeated herein.
Step S207, after performing a color-beautifying process on the current frame image in the dynamic image, determining whether a next frame image exists in the dynamic image.
In this scenario, when the image beautifying method is used to perform a beautifying process on a face in a dynamic image, a current frame image in the dynamic image may be obtained first, and the current frame image is used as an image to be beautified, so as to perform the beautifying process on the current frame image through the above steps S201 to S206. And after finishing the color-beautifying processing of the current frame image, further judging whether a next frame image still exists in the dynamic image, if the next frame image does not exist in the dynamic image, considering that the color-beautifying processing of all the frame images in the dynamic image is finished, and directly finishing the color-beautifying flow. And if the next frame of image exists in the dynamic image, the next frame of image is obtained if the image to be beautified still exists in the dynamic image.
It is understood that in this scenario, the moving image may be a video image or a gif moving image.
Step S208, if a next frame image exists in the dynamic image, determining whether the next frame image is a scene change frame.
In the change of the dynamic image, the next frame image may be the same as or similar to the current frame image, the next frame image may only have background transformation, and the face appearing in the next frame image is the same as the face appearing in the current frame image, or only a part of face is newly added in the next frame image; of course, the next frame image may be completely different from the current frame image, and the next frame image has a foreground change, which constitutes a scene change. Therefore, in the scene, after the next frame image is acquired, it is immediately determined whether the next frame image is a scene change frame, that is, whether the next frame image has a foreground change or only has a background change, so as to perform different processing procedures on the next frame image according to different conversion results.
Step S209, when the next frame image is not the scene switching frame, performing face beautification processing on the corresponding face in the next frame image according to the target face beautification parameter of the current frame image, simultaneously acquiring a newly added face in the next frame image, determining the newly added face as a new current face, and performing a step of calculating a lip longitudinal depth parameter set of the current face based on the lip block and subsequent steps on the new current face.
Here, when it is determined that the next frame image is not the scene change frame, if it is determined that the next frame image only has a background change, it is determined that a face appearing in the current frame image exists in the next frame image, and a newly added face may also exist in the next frame image. Therefore, at this time, it is necessary to determine whether a new face exists in the next frame of image, and if so, obtain the new face of the next frame of image and determine the target beauty parameters of the new face.
Specifically, all intra-frame prediction blocks in the next frame image are found out, the intra-frame prediction blocks are used as new sub-images, five sense organs are positioned on the new sub-images, whether a new face exists or not is determined according to the positioning result of the five sense organs, if the new face exists, the new face is determined as a new current face, and the step of calculating the lip longitudinal depth parameter set of the current face based on the lip block and the subsequent steps are carried out on the new current face, so that the target beauty parameters of the new face are determined. When the new face is judged to exist according to the facial feature positioning result, the lip block, the eye block and the like of the new face can be obtained in the facial feature positioning process.
When the target beauty parameter of the newly added face is determined, performing beauty treatment on the newly added face in the next frame of image according to the target beauty parameter; and for the non-new face in the next frame image, namely the face already appearing in the current frame image, directly adopting the corresponding target beauty parameter determined in the current frame image to carry out beauty treatment on the non-new face.
In the scene, when the same face as that in the current frame image exists in the next frame image, the same face is subjected to face beautifying processing directly according to the determined target face beautifying parameter in the current frame image, so that in the face beautifying processing process of the next frame image, the target face beautifying parameter of the same face does not need to be recalculated, and only the target face beautifying parameter of a newly added face needs to be calculated, so that the face beautifying processing process of the dynamic image can be quickly completed, and the face beautifying processing efficiency of the dynamic image is improved.
It can be understood that, in video compression, a block adopting an intra-frame prediction mode generally indicates that the current block has a small correlation with a previous frame and is a high-probability region where a new face appears. Therefore, in this scenario, the intra-prediction block in the rest of frames can be found by using the compression information carried in the video, and if the prediction mode of a certain block is intra-prediction or it includes an intra-prediction sub-block, the block can be determined as an intra-prediction block.
Step S210, when the next frame image is a scene switching frame, determining the next frame image as a new image to be beautified, and returning to execute the steps of performing face detection on the image to be beautified, determining a face region in the image to be beautified and the subsequent steps.
Here, when it is determined that the next frame image is a scene change frame, it is determined that the next frame image has a foreground change, and whether a face to be beautified exists in the next frame image having the foreground change is determined, further determination is required. Therefore, in this scene, when the next frame of image is a scene switching frame, the next frame of image is determined as an image to be beautified, and the step of performing face detection on the image to be beautified and determining a face region in the image to be beautified and subsequent steps are returned to determine whether a face needing to be beautified exists in the next frame of image, and a subsequent processing flow is executed according to a determination result.
In the scene, the expression line strength is determined only by adopting the lip longitudinal depth parameter set of the current face, the target beauty parameter is determined according to the determined expression line strength, the face beautifying processing is carried out on the current face according to the target beauty parameter, the calculation amount is small, and the requirement of video application on the real-time beauty can be met.
In the embodiment of the invention, firstly, a face detection is carried out on an image to be beautified, a face area in the image to be beautified is determined, and the facial area is positioned by five sense organs to obtain a lip block of the current face in the image to be beautified; secondly, calculating a lip longitudinal depth parameter set of the current face based on the lip block, and determining the expression print intensity of the current face according to the lip longitudinal depth parameter set; and then, determining a target beauty parameter of the current face based on the expression line strength, and performing beauty treatment on the current face according to the target beauty parameter. In the embodiment of the invention, the lip longitudinal depth parameter set is obtained by analyzing the lip block of the current face, the expression line strength of the current face is determined according to the lip longitudinal depth parameter set, the facial beautification parameter of the current face is adjusted according to the expression line strength, and the reasonable target facial beautification parameter is set to carry out facial beautification treatment on the current face, so that the facial beautification effect of the image is prevented from being influenced by the expression line generated by facial expression, and the visual comfort of facial beautification is optimized.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
The above mainly describes an image beauty method, and an image beauty apparatus will be described in detail below.
As shown in fig. 3, a second embodiment of the present invention provides an image beauty device, including:
a face detection module 301, configured to perform face detection on an image to be beautified, and determine a face area in the image to be beautified;
a facial feature positioning module 302, configured to perform facial feature positioning on the face region, and obtain a lip block of a current face in the image to be beautified;
a parameter set calculating module 303, configured to calculate a lip longitudinal depth parameter set of the current face based on the lip block;
an expression pattern determining module 304, configured to determine an expression pattern intensity of the current face according to the lip longitudinal depth parameter set;
a beauty parameter determination module 305, configured to determine a target beauty parameter of the current face based on the expression print strength;
and the beauty processing module 306 is configured to perform beauty processing on the current face according to the target beauty parameter.
Further, the lip longitudinal depth parameter set comprises a lip longitudinal depth first parameter and a lip longitudinal depth second parameter;
correspondingly, the formula for calculating the first parameter of the lip longitudinal depth and the second parameter of the lip longitudinal depth of the current face based on the lip block is as follows:
Figure BDA0001667156690000171
hm is a first parameter of the longitudinal depth of the lip, bimax is the maximum value of a row number in the lip block, bimin is the minimum value of the row number in the lip block, Wm is a second parameter of the longitudinal depth of the lip, bjmax is the maximum value of a column number in the lip block, and bjmin is the minimum value of the column number in the lip block.
Preferably, the formula for determining the expression print intensity of the current face according to the lip longitudinal depth parameter set is as follows;
Figure BDA0001667156690000172
wherein Fw is the expression line intensity of the current face, k1、k2Is a proportional parameter, and k is more than or equal to 12<k1
Optionally, the image beautifying apparatus further includes:
the first initial beauty parameter acquisition module is used for acquiring a first initial beauty parameter of the current face;
accordingly, the beauty parameter determination module 305 includes:
a first determining unit, configured to, when the expression pattern intensity Fw is equal to 1, adjust the first initial beauty parameter by a first preset adjustment range, and determine the first initial beauty parameter after the first preset adjustment range is adjusted by the first initial beauty parameter as the target beauty parameter of the current face;
a second determining unit, configured to, when the expression pattern intensity Fw is-1, down-adjust the first initial beauty parameter by a second preset adjustment amplitude, and determine the first initial beauty parameter after the second preset adjustment amplitude is down-adjusted as the target beauty parameter of the current face;
a third determining unit, configured to determine the first initial beauty parameter as a target beauty parameter of the current face when the expression pattern strength Fw is 0.
Further, the expression line intensity of the current face further comprises eye expression line intensity, and the lip longitudinal depth parameter set further comprises a lip longitudinal depth third parameter;
accordingly, the facial features positioning module 302 further comprises:
the eye block acquisition unit is used for positioning the five sense organs of the face region and acquiring the eye block of the left eye or the right eye of the current face;
the parameter set calculating module 303 is configured to calculate a third parameter of the lip longitudinal depth of the current face according to the following formula:
ASize=sum(max(j|bk(i,j)∈i)-min(j|bk(i,j)∈i)+1);
ASize is a third parameter of lip longitudinal depth, bk (i, j) is a lip block in the ith row and the jth column, max (j | bk (i, j) ∈ i) is the maximum value of the column number in the ith row of lip block, and min (j | bk (i, j) ∈ i) is the minimum value of the column number in the ith row of lip block;
the expression pattern determining module 304 is configured to determine the eye expression pattern intensity of the current face according to the following formula:
Figure BDA0001667156690000181
wherein sig is the eye expression line intensity of the current face, ESize is the block number of eye blocks of the left eye or the right eye of the current face, k3Is a proportional parameter, and k3≥1.5。
Preferably, the image beautifying apparatus further includes:
a second initial beauty parameter obtaining module, configured to obtain a second initial beauty parameter of the current face, where the second initial beauty parameter includes an eye beauty parameter;
accordingly, the beauty parameter determination module 305 includes:
a fourth determination unit, configured to determine whether the eye expression pattern intensity sig is equal to 1 when the expression pattern intensity Fw is equal to 1; if the eye expression pattern intensity sig is 1, adjusting the second initial beauty parameter of the current face by a third preset adjustment amplitude, and determining the second initial beauty parameter after the third preset adjustment amplitude is adjusted to be the target beauty parameter of the current face; if the eye expression pattern intensity sig is not equal to 1, adjusting the eye beautifying parameter of the current face by a fourth preset adjustment amplitude, and determining a second initial beautifying parameter after the fourth preset adjustment amplitude is adjusted to be a target beautifying parameter of the current face;
a fifth determining unit, configured to, when the expression pattern intensity Fw is-1, down-adjust a second initial beauty parameter of the current face by a fifth preset adjustment amplitude, and determine the second initial beauty parameter down-adjusted by the fifth preset adjustment amplitude as a target beauty parameter of the current face;
a sixth determining unit, configured to determine the second initial beauty parameter as the target beauty parameter of the current face when the expression pattern strength Fw is equal to 0.
Optionally, the image to be beautified comprises each frame of image in the dynamic image;
correspondingly, the image beautifying device further comprises:
the first image judging module is used for judging whether a next frame image exists in the dynamic image after the current frame image in the dynamic image is subjected to the beautifying processing;
a second image determining module, configured to determine whether a next frame of image exists in the dynamic image, where the next frame of image is a scene change frame;
an image determining module, configured to determine the next frame of image as a new image to be beautified when the next frame of image is a scene switching frame, and return to perform face detection on the image to be beautified, and determine a face region in the image to be beautified and subsequent steps;
and the newly added face acquisition module is used for performing face beautifying processing on a corresponding face in the next frame image according to the target face beautifying parameter of the current frame image when the next frame image is not the scene switching frame, acquiring the newly added face in the next frame image, determining the newly added face as a new current face, and performing the step of calculating the lip longitudinal depth parameter set of the current face based on the lip block and the subsequent steps on the new current face.
Fig. 4 is a schematic diagram of an image beautifying apparatus according to a third embodiment of the present invention. As shown in fig. 4, the image beauty apparatus 400 of this embodiment includes: a processor 401, a memory 402 and a computer program 403, such as an image beautification program, stored in said memory 402 and executable on said processor 401. The processor 401 implements the steps in the above-described embodiments of the image beautifying method, such as the steps S101 to S106 shown in fig. 1, when executing the computer program 403. Alternatively, the processor 401, when executing the computer program 403, implements the functions of each module/unit in the above-mentioned device embodiments, for example, the functions of the modules 301 to 306 shown in fig. 3.
Illustratively, the computer program 403 may be partitioned into one or more modules/units that are stored in the memory 402 and executed by the processor 401 to implement the present invention. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution process of the computer program 403 in the image beautifying apparatus. For example, the computer program 403 may be divided into a face detection module, a facial feature positioning module, a parameter set calculation module, an expression pattern determination module, a beauty parameter determination module, and a beauty processing module, and each module has the following specific functions:
the face detection module is used for carrying out face detection on the image to be beautified and determining a face area in the image to be beautified;
the facial feature positioning module is used for positioning the facial features of the face area to acquire a lip block of the current face in the image to be beautified;
a parameter set calculation module, configured to calculate a lip longitudinal depth parameter set of the current face based on the lip block;
the expression pattern determining module is used for determining the expression pattern intensity of the current face according to the lip longitudinal depth parameter set;
the facial beautification parameter determination module is used for determining a target facial beautification parameter of the current face based on the expression line intensity;
and the face beautifying processing module is used for carrying out face beautifying processing on the current face according to the target face beautifying parameter.
The image beautifying device 400 may be a desktop computer, a notebook, a palm computer, a cloud server, or other computing devices. The image beautifying device 400 may include, but is not limited to, a processor 401, a memory 402. Those skilled in the art will appreciate that fig. 4 is merely an example of the image beautification apparatus 400 and does not constitute a limitation of the image beautification apparatus 400, and may include more or less components than those shown, or combine certain components, or different components, for example, the image beautification apparatus 400 may also include input and output devices, network access devices, buses, and the like.
The Processor 401 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 402 may be an internal storage unit of the image beautifying device 400, such as a hard disk or a memory of the image beautifying device 400. The memory 402 may also be an external storage device of the image beauty apparatus 400, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), or the like, provided on the image beauty apparatus 400. Further, the memory 402 may also include both an internal storage unit and an external storage device of the image beauty apparatus 400. The memory 402 is used to store the computer programs and other programs and data required by the image beautification apparatus 400. The memory 402 may also be used to temporarily store data that has been output or is to be output.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art would appreciate that the modules, elements, and/or method steps of the various embodiments described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (9)

1. An image beautifying method, comprising:
carrying out face detection on an image to be beautified, and determining a face area in the image to be beautified;
performing facial feature positioning on the face region to obtain a lip block of the current face in the image to be beautified;
calculating a lip longitudinal depth parameter set of the current face based on the lip block;
determining the expression line intensity of the current face according to the lip longitudinal depth parameter set;
acquiring a second initial beauty parameter of the current face, wherein the second initial beauty parameter comprises an eye beauty parameter;
when the expression pattern intensity Fw is equal to 1, judging whether the eye expression pattern intensity sig is equal to 1; if the eye expression pattern intensity sig is 1, adjusting the second initial beauty parameter of the current face by a third preset adjustment amplitude, and determining the second initial beauty parameter after the third preset adjustment amplitude is adjusted to be the target beauty parameter of the current face; if the eye expression pattern intensity sig is not equal to 1, adjusting the eye beautifying parameter of the current face by a fourth preset adjustment amplitude, and determining a second initial beautifying parameter after the fourth preset adjustment amplitude is adjusted to be a target beautifying parameter of the current face;
when the expression pattern strength Fw is equal to-1, reducing a second initial beauty parameter of the current face by a fifth preset adjustment amplitude, and determining the second initial beauty parameter after the fifth preset adjustment amplitude is reduced as a target beauty parameter of the current face;
when the expression pattern strength Fw is equal to 0, determining the second initial beauty parameter as a target beauty parameter of the current face;
and performing face beautifying processing on the current face according to the target face beautifying parameter.
2. An image beautifying method according to claim 1, wherein the lip longitudinal depth parameter set includes a lip longitudinal depth first parameter and a lip longitudinal depth second parameter;
correspondingly, the formula for calculating the lip longitudinal depth first parameter and the lip longitudinal depth second parameter of the current face based on the lip block is as follows:
Figure FDA0003541613800000011
hm is a first parameter of the longitudinal depth of the lip, bimax is the maximum value of a row number in the lip block, bimin is the minimum value of the row number in the lip block, Wm is a second parameter of the longitudinal depth of the lip, bjmax is the maximum value of a column number in the lip block, and bjmin is the minimum value of the column number in the lip block.
3. The image beautifying method according to claim 2, wherein the formula for determining the expression line strength of the current face according to the lip longitudinal depth parameter set is as follows;
Figure FDA0003541613800000021
wherein Fw is the expression line intensity of the current face, k1、k2Is a proportional parameter, and k is more than or equal to 12<k1
4. The image beauty method according to claim 3, before determining the target beauty parameter of the current face based on the expression print strength, comprising: acquiring a first initial beauty parameter of the current face;
correspondingly, the determining the target beauty parameter of the current face based on the expression line strength comprises:
when the expression pattern intensity Fw is 1, adjusting the first initial beauty parameter by a first preset adjustment amplitude, and determining the first initial beauty parameter after the first initial beauty parameter is adjusted by the first preset adjustment amplitude as a target beauty parameter of the current face;
when the expression pattern strength Fw is-1, reducing the first initial beauty parameter by a second preset adjustment amplitude, and determining the first initial beauty parameter after the second preset adjustment amplitude is reduced as a target beauty parameter of the current face;
when the expression pattern strength Fw is 0, determining the first initial beauty parameter as a target beauty parameter of the current face.
5. The image beautifying method according to claim 3, wherein the expression line intensity of the current face further comprises an eye expression line intensity, and the lip longitudinal depth parameter set further comprises a lip longitudinal depth third parameter;
correspondingly, the positioning of the five sense organs on the face area further comprises:
performing facial feature positioning on the face region to obtain eye blocks of the left eye or the right eye of the current face;
the calculating the lip longitudinal depth parameter set of the current face based on the lip block further comprises
Calculating a third lip longitudinal depth parameter of the current face according to the following formula:
ASize=sum(max(j|bk(i,j)∈i)-min(j|bk(i,j)∈i)+1);
ASize is a third parameter of lip longitudinal depth, bk (i, j) is a lip block in the ith row and the jth column, max (j | bk (i, j) ∈ i) is the maximum value of the column number in the ith row of lip block, and min (j | bk (i, j) ∈ i) is the minimum value of the column number in the ith row of lip block;
the determining the expression line strength of the current face according to the lip longitudinal depth parameter set further includes:
determining the eye expression line intensity of the current face by the following formula:
Figure FDA0003541613800000031
wherein sig is the eye expression line intensity of the current face, ESize is the block number of eye blocks of the left eye or the right eye of the current face, k3Is a proportional parameter, and k3≥1.5。
6. The image beautifying method according to any one of claims 1 to 5, wherein the image to be beautified comprises each frame image in a dynamic image;
correspondingly, the image beautifying method further comprises the following steps:
after performing beauty treatment on the current frame image in the dynamic image, judging whether a next frame image exists in the dynamic image;
if the next frame of image exists in the dynamic image, judging whether the next frame of image is a scene switching frame;
when the next frame image is a scene switching frame, determining the next frame image as a new image to be beautified, returning to execute the steps of performing face detection on the image to be beautified and determining a face area in the image to be beautified and the subsequent steps;
and when the next frame image is not a scene switching frame, performing face beautifying processing on a corresponding face in the next frame image according to the target face beautifying parameter of the current frame image, simultaneously acquiring a newly added face in the next frame image, determining the newly added face as a new current face, and performing the step of calculating the lip longitudinal depth parameter set of the current face based on the lip block and the subsequent steps on the new current face.
7. An image beautifying apparatus, comprising:
the face detection module is used for carrying out face detection on the image to be beautified and determining a face area in the image to be beautified;
the facial feature positioning module is used for positioning facial features of the human face area to obtain a lip block of the current human face in the image to be beautified;
a parameter set calculation module, configured to calculate a lip longitudinal depth parameter set of the current face based on the lip block;
the expression pattern determining module is used for determining the expression pattern intensity of the current face according to the lip longitudinal depth parameter set;
the face beautifying parameter determining module is used for acquiring a second initial face beautifying parameter of the current face, wherein the second initial face beautifying parameter comprises an eye face beautifying parameter; when the expression pattern strength Fw is equal to 1, judging whether the eye expression pattern strength sig is equal to 1; if the eye expression pattern intensity sig is 1, adjusting the second initial beauty parameter of the current face by a third preset adjustment amplitude, and determining the second initial beauty parameter after the third preset adjustment amplitude is adjusted to be the target beauty parameter of the current face; if the eye expression pattern intensity sig is not equal to 1, adjusting the eye beautifying parameter of the current face by a fourth preset adjustment amplitude, and determining a second initial beautifying parameter after the fourth preset adjustment amplitude is adjusted to be a target beautifying parameter of the current face; when the expression pattern intensity Fw is-1, adjusting the second initial beauty parameter of the current face down by a fifth preset adjustment amplitude, and determining the second initial beauty parameter after the fifth preset adjustment amplitude is adjusted down as the target beauty parameter of the current face; when the expression pattern strength Fw is equal to 0, determining the second initial beauty parameter as a target beauty parameter of the current face;
and the face beautifying processing module is used for carrying out face beautifying processing on the current face according to the target face beautifying parameter.
8. An image beautifying apparatus comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the image beautifying method according to any one of claims 1 to 6 when executing the computer program.
9. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the image beautification method according to any one of claims 1 to 6.
CN201810487608.XA 2018-05-21 2018-05-21 Image beautifying method, device, equipment and storage medium Active CN108765264B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810487608.XA CN108765264B (en) 2018-05-21 2018-05-21 Image beautifying method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810487608.XA CN108765264B (en) 2018-05-21 2018-05-21 Image beautifying method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN108765264A CN108765264A (en) 2018-11-06
CN108765264B true CN108765264B (en) 2022-05-20

Family

ID=64008633

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810487608.XA Active CN108765264B (en) 2018-05-21 2018-05-21 Image beautifying method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN108765264B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109274983A (en) * 2018-12-06 2019-01-25 广州酷狗计算机科技有限公司 The method and apparatus being broadcast live
CN109685741B (en) * 2018-12-28 2020-12-11 北京旷视科技有限公司 Image processing method and device and computer storage medium
CN111445417B (en) * 2020-03-31 2023-12-19 维沃移动通信有限公司 Image processing method, device, electronic equipment and medium
CN112669233A (en) * 2020-12-25 2021-04-16 北京达佳互联信息技术有限公司 Image processing method, image processing apparatus, electronic device, storage medium, and program product
WO2022187997A1 (en) * 2021-03-08 2022-09-15 深圳市大疆创新科技有限公司 Video processing method, electronic device, and storage medium
CN115908597A (en) * 2021-09-30 2023-04-04 北京字跳网络技术有限公司 Image processing method and device

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105825486A (en) * 2016-04-05 2016-08-03 北京小米移动软件有限公司 Beautifying processing method and apparatus
CN106056533A (en) * 2016-05-26 2016-10-26 维沃移动通信有限公司 Photographing method and terminal
WO2017088432A1 (en) * 2015-11-26 2017-06-01 腾讯科技(深圳)有限公司 Image recognition method and device
CN107249100A (en) * 2017-06-30 2017-10-13 北京金山安全软件有限公司 Photographing method and device, electronic equipment and storage medium
WO2017177259A1 (en) * 2016-04-12 2017-10-19 Phi Technologies Pty Ltd System and method for processing photographic images
CN107730445A (en) * 2017-10-31 2018-02-23 广东欧珀移动通信有限公司 Image processing method, device, storage medium and electronic equipment
CN107995415A (en) * 2017-11-09 2018-05-04 深圳市金立通信设备有限公司 A kind of image processing method, terminal and computer-readable medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017088432A1 (en) * 2015-11-26 2017-06-01 腾讯科技(深圳)有限公司 Image recognition method and device
CN105825486A (en) * 2016-04-05 2016-08-03 北京小米移动软件有限公司 Beautifying processing method and apparatus
WO2017177259A1 (en) * 2016-04-12 2017-10-19 Phi Technologies Pty Ltd System and method for processing photographic images
CN106056533A (en) * 2016-05-26 2016-10-26 维沃移动通信有限公司 Photographing method and terminal
CN107249100A (en) * 2017-06-30 2017-10-13 北京金山安全软件有限公司 Photographing method and device, electronic equipment and storage medium
CN107730445A (en) * 2017-10-31 2018-02-23 广东欧珀移动通信有限公司 Image processing method, device, storage medium and electronic equipment
CN107995415A (en) * 2017-11-09 2018-05-04 深圳市金立通信设备有限公司 A kind of image processing method, terminal and computer-readable medium

Also Published As

Publication number Publication date
CN108765264A (en) 2018-11-06

Similar Documents

Publication Publication Date Title
CN108765264B (en) Image beautifying method, device, equipment and storage medium
CN109829930B (en) Face image processing method and device, computer equipment and readable storage medium
CN107730444B (en) Image processing method, image processing device, readable storage medium and computer equipment
CN107730465B (en) Face beautifying method and device in image
CN108734126B (en) Beautifying method, beautifying device and terminal equipment
WO2022078041A1 (en) Occlusion detection model training method and facial image beautification method
CN111383232B (en) Matting method, matting device, terminal equipment and computer readable storage medium
CN108734127B (en) Age identification value adjusting method, age identification value adjusting device, age identification value adjusting equipment and storage medium
CN110288614B (en) Image processing method, device, equipment and storage medium
CN111062891A (en) Image processing method, device, terminal and computer readable storage medium
CN108463823A (en) A kind of method for reconstructing, device and the terminal of user&#39;s Hair model
CN111145086A (en) Image processing method and device and electronic equipment
CN111080670A (en) Image extraction method, device, equipment and storage medium
CN109859217A (en) The dividing method in pore region and calculating equipment in facial image
Lin et al. Low-light enhancement using a plug-and-play Retinex model with shrinkage mapping for illumination estimation
CN103440633A (en) Digital image automatic speckle-removing method
CN111080654A (en) Image lesion region segmentation method and device and server
CN111862033A (en) Medical image processing method, device, image processing equipment and storage medium
CN108629730B (en) Video beautifying method and device and terminal equipment
CN111932442B (en) Video beautifying method, device and equipment based on face recognition technology and computer readable storage medium
CN116342504A (en) Image processing method and device, electronic equipment and readable storage medium
CN110766631A (en) Face image modification method and device, electronic equipment and computer readable medium
CN113379623B (en) Image processing method, device, electronic equipment and storage medium
CN112561822B (en) Beautifying method and device, electronic equipment and storage medium
CN113610723B (en) Image processing method and related device

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