CN113689325A - Method for digitizing beautiful eyebrows, electronic device and storage medium - Google Patents

Method for digitizing beautiful eyebrows, electronic device and storage medium Download PDF

Info

Publication number
CN113689325A
CN113689325A CN202110786745.5A CN202110786745A CN113689325A CN 113689325 A CN113689325 A CN 113689325A CN 202110786745 A CN202110786745 A CN 202110786745A CN 113689325 A CN113689325 A CN 113689325A
Authority
CN
China
Prior art keywords
face image
eyebrows
eyebrow
image
deformation
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110786745.5A
Other languages
Chinese (zh)
Inventor
张文
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Shuliantianxia Intelligent Technology Co Ltd
Original Assignee
Shenzhen Shuliantianxia Intelligent 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 Shuliantianxia Intelligent Technology Co Ltd filed Critical Shenzhen Shuliantianxia Intelligent Technology Co Ltd
Priority to CN202110786745.5A priority Critical patent/CN113689325A/en
Publication of CN113689325A publication Critical patent/CN113689325A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • G06T3/04
    • G06T3/18
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/66Analysis of geometric attributes of image moments or centre of gravity

Abstract

The embodiment of the invention relates to the technical field of image processing, and discloses a method, electronic equipment and a storage medium for digitally beautifying eyebrows. The eyebrow model is obtained by adjusting the position of a pixel point based on the position of the original eyebrow in the first target face image, and is more natural compared with the traditional method that the eyebrow model with the target eyebrow model is directly attached to the original face image.

Description

Method for digitizing beautiful eyebrows, electronic device and storage medium
Technical Field
The embodiment of the invention relates to the technical field of image processing, in particular to a method for digitizing beautiful eyebrows, electronic equipment and a storage medium.
Background
Along with the popularization of the intelligent mobile terminal capable of shooting and the development of the image processing technology, and the attention to appearance, people are increasingly interested in beautifying or making up the face image by using the application on the intelligent mobile terminal, namely, the face image is digitally beautified, so that the optimized face image is shown.
The beautification of the eyebrows mainly comprises the steps of filling or covering the eyebrows with colors, for example, the original eyebrows are filled with the colors and are not changed in shape, or the original eyebrows are directly covered and replaced by eyebrow templates with other shapes, so that the beautified eyebrows are unnatural and lack of reality.
Disclosure of Invention
The embodiment of the invention mainly solves the technical problem of providing a method for digitally beautifying eyebrows, electronic equipment and a storage medium, which can naturally beautify the eyebrows and ensure that the eyebrows after beautifying the eyebrows have reality.
In order to solve the above technical problem, in a first aspect, an embodiment of the present invention provides a method for digitizing eyebrows, including:
acquiring a face image, and acquiring key points of eyebrows in the face image;
determining a geometric region including eyebrows in the face image according to the key points of the eyebrows;
inputting the shape characteristics of the face image, the geometric area and the target eyebrow shape into a preset image deformation model to perform deformation adjustment on the positions of all pixel points in the geometric area in the face image, and obtaining a deformed first target face image, wherein the shape of the eyebrow in the first target face image is the target eyebrow shape.
In some embodiments, the image deformation model is set based on the OpenGLES framework.
In some embodiments, the image deformation model is an image deformation algorithm that calculates deformation parameters using a moving least squares method.
In some embodiments, the image deformation algorithm comprises an affine transformation, a similarity transformation, or a rigid transformation.
In some embodiments, the step of determining a geometric region including eyebrows in the face image according to the key points of the eyebrows includes:
and determining the geometric area as the minimum circumscribed rectangle of the eyebrow.
In some embodiments, the method further comprises:
and attenuating the position of each pixel point in the geometric area including eyebrows in the first target face image relative to the deformation of each pixel point in the geometric area including eyebrows in the face image according to a preset attenuation rule to obtain an attenuated second target face image, wherein the deformation degree of the pixel points of non-eyebrows in the geometric area of the second target face image relative to the face image is smaller than the deformation degree of the pixel points of non-eyebrows in the geometric area of the first target face image relative to the face image.
In some embodiments, the preset attenuation rule includes that, from the center to the boundary of the geometric region, the attenuation degree of the deformation of the position of each pixel point in the geometric region including the eyebrow in the first target face image is gradually increased relative to the position of each pixel point in the geometric region including the eyebrow in the face image.
In some embodiments, the method further comprises:
and inputting the second target face image and a preset eyebrow material image into a preset image fusion model for fusion to obtain a fused third target face image, wherein the image fusion model is set based on an OpenGLES frame.
In order to solve the above technical problem, in a second aspect, an embodiment of the present invention provides an electronic device, including a memory and at least one processor, where the at least one processor is configured to execute at least one computer program stored in the memory, and when the at least one processor executes the at least one computer program, the electronic device is enabled to implement the method according to the first aspect.
In order to solve the technical problem described above, in a third aspect, an embodiment of the present invention provides a readable storage medium storing a computer program, the computer program comprising program instructions that, when executed by a processor, cause the processor to perform the method described above in the first aspect.
The embodiment of the invention has the following beneficial effects: different from the situation in the prior art, the method for digitally beautifying eyebrows, the electronic device, and the storage medium according to the embodiments of the present invention obtain a face image, obtain key points of eyebrows in the face image, determine a geometric region including eyebrows in the face image according to the key points of eyebrows, and input a preset image deformation model with shape characteristics of the face image, the geometric region, and a target eyebrow, so that the image deformation model deforms positions of pixel points in the geometric region in the face image according to the shape characteristics of the target eyebrow to obtain a deformed first target face image, so that the shape of eyebrows in the first target face image is the target eyebrow, thereby changing the eyebrow shape. On one hand, the eyebrows in the first target face image are obtained by adjusting the pixel point positions on the basis of the original eyebrows, and compared with the traditional method that eyebrows with target eyebrows are directly attached to the original face image, the eyebrow attaching method is more natural; on the other hand, the geometric region not only can include the eyebrows but also can include the skin around the eyebrows, and the positions of all pixel points in the geometric region including the eyebrows are all subjected to deformation adjustment, so that the eyebrow region and a non-eyebrow region (skin region) can be in natural transition, the boundary between eyebrow pixel points and skin pixel points is weakened, and the deformed eyebrows are more real.
Drawings
One or more embodiments are illustrated by way of example in the accompanying drawings, which correspond to the figures in which like reference numerals refer to similar elements and which are not to scale unless otherwise specified.
Fig. 1 is a schematic operating environment of a method for digitizing eyebrows, according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of an electronic device according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating a method for digitizing eyebrows according to an embodiment of the present invention;
fig. 4 is a schematic diagram of face key points according to an embodiment of the present invention;
FIG. 5 is a schematic view of a geometric region provided in accordance with an embodiment of the present invention;
FIG. 6 is a schematic diagram illustrating the effect of beautifying the eyebrows before and after the eyebrows according to an embodiment of the present invention;
FIG. 7 is a schematic diagram illustrating the degree of attenuation provided by one embodiment of the present invention;
FIG. 8 is a diagram of eyebrow material according to an embodiment of the present invention;
fig. 9 is a schematic diagram of a third target face image after image fusion according to an embodiment of the present invention.
Detailed Description
The present invention will be described in detail with reference to specific examples. The following examples will assist those skilled in the art in further understanding the invention, but are not intended to limit the invention in any way. It should be noted that variations and modifications can be made by persons skilled in the art without departing from the spirit of the invention. All falling within the scope of the present invention.
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
It should be noted that, if not conflicted, the various features of the embodiments of the invention may be combined with each other within the scope of protection of the present application. Additionally, while functional block divisions are performed in apparatus schematics, with logical sequences shown in flowcharts, in some cases, steps shown or described may be performed in sequences other than block divisions in apparatus or flowcharts. Further, the terms "first," "second," "third," and the like, as used herein, do not limit the data and the execution order, but merely distinguish the same items or similar items having substantially the same functions and actions.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used herein, the term "and/or" includes any and all combinations of one or more of the associated listed items.
In addition, the technical features involved in the embodiments of the present invention described below may be combined with each other as long as they do not conflict with each other.
Fig. 1 is a schematic operating environment of a method for digitizing eyebrows, according to an embodiment of the present invention, and referring to fig. 1, the operating environment includes an electronic device 10 and an image capturing apparatus 20, where the electronic device 10 is in communication with the image capturing apparatus 20.
The communication connection may be a wired connection, for example: fiber optic cables, and also wireless communication connections, such as: WIFI connection, bluetooth connection, 4G wireless communication connection, 5G wireless communication connection and so on.
The image acquiring device 20 is used for acquiring a face image, and the image acquiring device 20 may be a terminal capable of capturing images, such as: a mobile phone, a tablet computer, a video recorder or a camera with shooting function.
The electronic device 10 is a device capable of automatically processing mass data at high speed according to a program, and is generally composed of a hardware system and a software system, for example: computers, smart phones, and the like. The electronic device 10 may be a local device, which is directly connected to the image capturing apparatus 20; it may also be a cloud device, for example: a cloud server, a cloud host, a cloud service platform, a cloud computing platform, etc., the cloud device is connected to the image acquisition apparatus 20 through a network, and the two are connected through a predetermined communication protocol, which may be TCP/IP, NETBEUI, IPX/SPX, etc. in some embodiments.
It can be understood that: the image capturing device 20 and the electronic apparatus 10 may also be integrated together as an integrated apparatus, such as a computer with a camera or a smart phone.
The electronic device 10 receives the face image sent by the image obtaining device 20, and the electronic device 10 beautifies eyebrows in the face image, for example, changes the eyebrow shape, to obtain an eyebrow-beautified face image.
On the basis of fig. 1, another embodiment of the present invention provides an electronic device 10, please refer to fig. 2, which is a hardware structure diagram of the electronic device 10 according to the embodiment of the present invention, specifically, as shown in fig. 2, the electronic device 10 includes at least one processor 11 and a memory 12 (in fig. 2, a bus connection, a processor is taken as an example) that are communicatively connected.
The processor 11 is configured to provide computing and control capabilities to control the electronic device 10 to perform corresponding tasks, for example, to control the electronic device 10 to perform any one of the methods for digitizing eyebrows provided in the following embodiments of the present invention.
It is understood that the Processor 11 may be a general-purpose Processor including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
The memory 12, which is a non-transitory computer readable storage medium, can be used to store non-transitory software programs, non-transitory computer executable programs, and modules, such as program instructions/modules corresponding to the method for digitizing eyebrows for beauty in the embodiment of the present invention. The processor 11 may implement the method for digitizing eyebrows in any of the method embodiments described below by executing non-transitory software programs, instructions, and modules stored in the memory 12. In particular, the memory 12 may include high speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, memory 12 may also include memory located remotely from the processor, which may be connected to the processor via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
In some embodiments, the electronic device further includes at least one Graphics Processing Unit (GPU), which is a set of highly parallelizable chipset of processing tasks, having custom chips dedicated to processing depth buffers, fast access to textures and other buffers, and having a processor capable of providing programmable shaders that support parallel execution.
It will be appreciated that the at least one processor 11 may comprise a separate processor in the electronic device, and may also comprise a processor in the image processing unit. The at least one processor 11 may be implemented by a separate processor in the electronic device in cooperation with a processor in the image processing unit when implementing the method for digitizing eyebrows in any of the method embodiments described below by running a non-transitory software program, instructions, and modules stored in the memory 12.
In the following, a detailed description is given of the method for digitizing eyebrows, which is provided in the embodiments of the present application, and referring to fig. 3, the method S20 includes, but is not limited to, the following steps:
s21: the method comprises the steps of obtaining a face image and obtaining key points of eyebrows in the face image.
S22: and determining a geometric region including eyebrows in the face image according to the key points of the eyebrows.
S23: inputting the shape characteristics of the face image, the geometric area and the target eyebrow shape into a preset image deformation model to perform deformation adjustment on the positions of all pixel points in the geometric area in the face image, and obtaining a deformed first target face image, wherein the shape of the eyebrow in the first target face image is the target eyebrow shape.
The face image may be an image including a face, and may be acquired by the image acquisition device, for example, the face image may be a self-photograph acquired by the image acquisition device.
In order to beautify the eyebrows in the face image, firstly, key points of the eyebrows in the face image are obtained to position the eyebrows. Specifically, as shown in fig. 4, a number of key points of the face, including points in the area of the eyebrows, eyes, nose, mouth, face contour, etc., are located by using the existing face key point algorithm. Then, keypoints belonging to the eyebrows, such as keypoints numbered 33-42 and 64-71 in FIG. 4, are obtained from a number of keypoints. It is understood that the key points of the eyebrows can reflect the positions of the eyebrows in the face image.
It should be noted that the existing face keypoint algorithm may be Active Appearance Models (AAMs), Constrained Local Models (CLMs), Explicit Shape Regression (ESR), or explicit device method (SDM). The specific process of obtaining the face key points by the face key point algorithm is not repeated one by one.
After the key points of the eyebrows are obtained, the positions of the eyebrows in the face image are reflected on the basis of the key points of the eyebrows, and the geometric regions including the eyebrows in the face image can be determined according to the key points of the eyebrows. It can be understood that the position region of the geometric region reflected in the face image is a region capable of framing eyebrows. In some embodiments, the geometric region may be irregular, for example, may be a region surrounded by the outer edge of the eyebrow, and in this embodiment, the pixels in the geometric region include eyebrow pixels. In some embodiments, the geometric region may also be regular, e.g., rectangular, square, etc., and in this implementation, the pixels in the geometric region include eyebrow pixels and non-eyebrow pixels (e.g., skin pixels).
In some embodiments, as shown in fig. 5, the geometric region is determined to be the minimum circumscribed rectangle of the eyebrow, which not only can ensure that the geometric region can frame the eyebrow and includes skin pixels, but also can avoid that too many skin pixels in the geometric region affect pixels in the non-eyebrow region. The illustration in fig. 5 is merely exemplary and does not set any limit to the geometric area.
Then, inputting the shape characteristics of the face image, the geometric area and the target eyebrow shape into a preset image deformation model, and carrying out deformation adjustment on the positions of all pixel points in the geometric area in the face image by the image deformation model according to the shape characteristics of the target eyebrow shape to obtain a deformed first target face image, so that the shape of the eyebrow in the first target face image is the target eyebrow shape.
The target eyebrow shape can be flat eyebrow, willow leaf eyebrow, European eyebrow or sword eyebrow, etc. and the target eyebrow shape is the eyebrow shape to be formed after deformation of original eyebrow. Each eyebrow shape has its own shape feature, which is shown in the key points of the eyebrows, which is exemplified by the key points of the eyebrows in fig. 4: for flat eyebrows, the eyebrow peak and the eyebrow tail are flush, as represented by the key points 34, 35, 36, 39, 40 and 41 being approximately on the same horizontal line; for the willow eyebrow, the willow eyebrow is bent in a willow leaf shape, the bending radians of key points 34, 35 and 36 on the key points are larger than a preset radian threshold, and the bending radians of key points 39, 40 and 41 on the key points are larger than a preset radian threshold; for the European eyebrow, the eyebrow peak is higher, and the eyebrow tail is lower, which is represented by that the distance between the key points 33 and 34 is larger than the preset distance threshold value, and the distance between the key points 41 and 42 is larger than the preset distance threshold value; for the sword eyebrow, the inverted eight characters are shown on the key points, wherein the coordinates of the key point 33 are higher than those of the key point 34, and the coordinates of the key point 42 are higher than those of the key point 41.
After key points of the original eyebrows in the face image and the shape characteristics of the target eyebrow form are obtained, the key points of the original eyebrows are deformed through the image deformation model, and the key points of the new eyebrows after deformation are generated to be in accordance with the shape characteristics of the target eyebrow form, so that the shape of the eyebrows in the first target face image obtained after deformation is the target eyebrow form.
The image deformation model calculates deformation parameters required by the eyebrow to deform from the original key points to the target key points according to the key points of the original eyebrow in the face image and the target key points reflected by the shape characteristics of the target eyebrow, and then deforms each pixel point in the geometric area in the face image according to the deformation parameters to obtain a first target face image. As shown in fig. 6, the eyebrows in the face image a are flat eyebrows, and after the image deformation model processing, the eyebrows in the first target face image B are eustachian eyebrows with higher eyebrow peaks.
The image deformation model is a preset image deformation algorithm and is used for carrying out deformation processing on the image. In some embodiments, the image deformation algorithm comprises rotation, translation, affine transformation, rigid or similar transformation, or the like. The deformation parameter is related to the image deformation algorithm, for example, when the image deformation algorithm is a radial transformation, the deformation parameter includes a linear transformation matrix M and a translation vector T, and for a position x of any pixel in the geometric region, after the radial transformation, a position y of the pixel is obtained as xM + T.
The eyebrow in the first target face image is obtained by adjusting the position of a pixel point on the basis of the original eyebrow, and is more natural compared with the traditional method that the eyebrow with the target eyebrow shape is directly attached to the original face image; on the other hand, the geometric area not only can include the eyebrows but also can include the skin around the eyebrows, and the positions of all pixel points in the geometric area including the eyebrows are subjected to deformation adjustment, so that the eyebrow area and a non-eyebrow area (skin area) can be in natural transition, the boundary between eyebrow pixel points and skin pixel points is weakened, and the deformed eyebrows are more real.
In some embodiments, the image deformation model is set up based on the OpenGLES framework, i.e. the image deformation algorithm is written to form the image deformation model in the OpenGLES framework. The OpenGLES framework defines a cross-programming language and cross-platform programming professional graphic program interface, and can be used for processing and rendering two-dimensional or three-dimensional images. Glsl (opengl Shading language) is a shader language of OpenGLES, and a program written in the language is run on a Graphics Processing Unit (GPU) of a computing device in an OpenGLES framework to process and render images. The OpenGLES framework-based program directly calls a Graphics Processing Unit (GPU) of the electronic equipment to perform operation, and the operation speed is high.
In this embodiment, a face image is acquired, key points of eyebrows in the face image are acquired, a geometric region including the eyebrows in the face image is determined according to the key points of the eyebrows, shape characteristics of the face image, the geometric region and a target eyebrow shape are input into a preset image deformation model, and therefore the image deformation model deforms positions of pixel points in the geometric region in the face image according to the shape characteristics of the target eyebrow shape to obtain a deformed first target face image, so that the shape of the eyebrows in the first target face image is the target eyebrow shape, and the change of the eyebrow shape is achieved. On one hand, the eyebrows in the first target face image are obtained by adjusting the pixel point positions on the basis of the original eyebrows, and compared with the traditional method that eyebrows with target eyebrows are directly attached to the original face image, the eyebrow attaching method is more natural; on the other hand, the geometric area not only can include the eyebrows but also can include the skin around the eyebrows, and the positions of all pixel points in the geometric area including the eyebrows are subjected to deformation adjustment, so that the eyebrow area and a non-eyebrow area (skin area) can be in natural transition, the boundary between eyebrow pixel points and skin pixel points is weakened, and the deformed eyebrows are more real.
In some embodiments, the image deformation model is an image deformation algorithm that calculates deformation parameters using a moving least squares method. The deformation parameters obtained by calculation by adopting the mobile least square method are accurate, and the deformed eyebrow form is further made to be the target eyebrow form. The calculation process of the moving least square method is exemplarily explained by taking an image deformation algorithm as affine deformation.
And calculating the deformation parameters of all pixel points in the geometric region in the face image through the following optimization functions, and obtaining the optimal deformation parameters when the optimization functions are minimized.
Figure BDA0003159245140000101
Wherein the content of the first and second substances,
Figure BDA0003159245140000102
wherein v is the position of any pixel point in the geometric region in the face image, piFor the position of any original key point of eyebrow in human face imageQ is putiIs the original key point piLocation of deformed target keypoints, lv (p)i) Is the original key point piPosition after affine transformation, wiIn order to be a weight for the deformation,
Figure BDA0003159245140000109
is set to 1.
For different pixel points v, different deformation parameters can be obtained, the deformation parameters comprise a linear transformation matrix M and a translational vector T, and then a radial transformation function lv(x) X m + T, for the optimization function
Figure BDA0003159245140000103
By calculating the partial derivative and making it 0, the expression T ═ q of T can be obtained*-p*M, wherein p is the weighted centroid of the original keypoint, q is the weighted centroid of the target keypoint, specifically:
Figure BDA0003159245140000104
thus, lv(x)=(x-p*)M+q*Then the original optimization function is
Figure BDA0003159245140000105
Wherein the content of the first and second substances,
Figure BDA0003159245140000106
in order to find a radial transformation to minimize the optimization function, the optimization problem is directly solved by a classical method to obtain:
Figure BDA0003159245140000107
thus, the expression for affine change is:
Figure BDA0003159245140000108
separating the key point pi of the original eyebrow from the deformed target key point qi because pi is fixed to obtain:
Figure BDA0003159245140000111
wherein the content of the first and second substances,
Figure BDA0003159245140000112
and establishing the optimization function to solve an affine transformation function for each pixel point at the position to be subjected to deformation. Therefore, the positions of all pixel points in the geometric region in the human face image are subjected to the corresponding affine transformation function fa(v) And obtaining a first target face image after transformation.
In this embodiment, the image deformation model is an image deformation algorithm for calculating deformation parameters by using a moving least square method, and the deformation parameters calculated by using the moving least square method are accurate, so that the deformed eyebrow form is further a target eyebrow form, and the eyebrow form can be accurately changed according to the user requirements.
In some embodiments, the deformation of the positions of the pixels in the geometric region including the eyebrows in the first target face image relative to the positions of the pixels in the geometric region including the eyebrows in the face image is attenuated according to a preset attenuation rule to obtain an attenuated second target face image, wherein the degree of deformation of the pixels other than the eyebrows in the geometric region of the second target face image relative to the face image is smaller than the degree of deformation of the pixels other than the eyebrows in the geometric region of the first target face image relative to the face image.
In this embodiment, according to a preset attenuation rule, the deformation of the positions of the pixels in the geometric region including the eyebrows in the first target face image relative to the positions of the pixels in the geometric region including the eyebrows in the face image is reduced to obtain a second target face image, so that the deformation degree of the pixels of the non-eyebrows in the geometric region of the second target face image relative to the face image is smaller than the deformation degree of the pixels of the non-eyebrows in the geometric region of the first target face image relative to the face image, that is, the deformation degree of the pixels of the non-eyebrows in the geometric region of the first target face image is adjusted back, so that the non-eyebrow pixels in the geometric region are prevented from being deformed seriously, the overall effect of the image is influenced, and the pixels of the eyebrows are deformed unnaturally.
In some embodiments, the preset attenuation rule includes that from the center to the boundary of the geometric region, the attenuation degree of the deformation of the position of each pixel in the geometric region including the eyebrow in the first target face image relative to the position of each pixel in the geometric region including the eyebrow in the face image is gradually increased.
As shown in fig. 7, from the center o of the geometric region to any boundary S, the attenuation degree of the deformation of the position of each pixel point in the geometric region including the eyebrow in the first target face image relative to the deformation of the position of each pixel point in the geometric region including the eyebrow in the face image gradually increases, that is, from the point o to any one point a on the boundary S, the attenuation degree of the deformation of the position of each pixel point gradually increases, for example, the attenuation degree of a point c on a connecting line from the point o to the point a is greater than that of a point b, that is, the deformation degree of a point c in the second target face image relative to the original face image is smaller, and the deformation degree of a point b relative to the original face image is greater.
For example, an attenuation coefficient citia is set, the smaller the distance from the midpoint of the geometric area to the center point o, the larger the attenuation coefficient, the larger the distance, the attenuation system is continuously attenuated to 0, and the attenuation coefficient citia is:
Figure BDA0003159245140000121
where x is the distance to the center point o and thre is a constant, which is an empirical value. More preferably, thre may be 2.
The positions of pixel points in the geometric region in the second target face image obtained after attenuation are as follows:
fv2=(fv1-img_coordinate)*cita+img_coordinate;
wherein, fv2 is the position of any pixel point in the geometric region in the second target face image; fv1 is the position of a corresponding pixel point in the geometric region in the first target face image, and img _ coordinate is the position of a corresponding pixel point in the original face image, for example, img _ coordinate (1,5) is the position of a pixel point in the first row and the fifth column in the original face image.
From the above formula, the closer to the central point o of the geometric area, the larger the citia, the smaller the attenuation degree, and the larger the pixel point deformation degree; the farther away from the central point o of the geometric area, the smaller the zeta, the larger the attenuation degree, and the smaller the deformation degree of the pixel point. Therefore, the non-eyebrow pixel points in the geometric area cannot influence the overall effect of the image due to serious deformation, and the eyebrow pixel points are deformed naturally.
In some embodiments, the method S20 further includes:
s24: and inputting the second target face image and a preset eyebrow material image into a preset image fusion model for fusion to obtain a fused third target face image, wherein the image fusion model is preset based on an OpenGLES frame.
As shown in fig. 8, the eyebrow material map is an image including an eyebrow template, which can be various eyebrow shapes. It can be understood that after the user changes the eyebrow shape, there may be defects, such as sparse eyebrow, which is not in accordance with the adjusted euro-eyebrow, so that the user can further beautify the eyebrow according to the need. Specifically, the second target face image and a preset eyebrow material map, for example, an european eyebrow material map, are input into a preset image fusion model for fusion, and a fused third target face image is obtained. As shown in fig. 9, it is a third target face image after image fusion in an embodiment.
The image fusion model is used for superposing eyebrow pixel points in the second target face image and pixel points of the eyebrow material image, the superposition area is natural, the obtained third target face image has characteristics of eyebrows in the second target face image and characteristics of eyebrows in the eyebrow material image, and therefore the eyebrows in the deformed second target face image are modified. The image fusion model may use an existing image fusion algorithm, such as a weighted average method, a feathering algorithm, laplacian pyramid fusion, and the like.
It is understood that the image fusion model is also set up based on the OpenGLES framework, i.e. the image fusion algorithm is written to form the image fusion model in the OpenGLES framework. The OpenGLES framework-based program directly calls a Graphics Processing Unit (GPU) of the electronic equipment to perform operation, so that the OpenGLES framework-based program has the characteristic of high operation speed.
In some embodiments, the depth of the eyebrow material map can be adjusted through the related control, so that the user can customize and optimize the visual effect.
In this embodiment, the second target face image and the preset eyebrow material image are fused, so that the third target face image obtained through fusion has characteristics of the eyebrows in the second target face image and characteristics of the eyebrows in the eyebrow material image, and therefore the effect of modifying the eyebrows in the deformed second target face image is achieved.
In another embodiment of the present application, a readable storage medium is provided, which stores a computer program comprising program instructions, which when executed by a processor, cause the processor to perform a method of digitizing a cosmetic eyebrow as in any one of the above method embodiments.
It should be noted that the above-described device embodiments are merely illustrative, where the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a general hardware platform, and certainly can also be implemented by hardware. It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware related to instructions of a computer program, which can be stored in a computer readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; within the idea of the invention, also technical features in the above embodiments or in different embodiments may be combined, steps may be implemented in any order, and there are many other variations of the different aspects of the invention as described above, which are not provided in detail for the sake of brevity; 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 the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (10)

1. A method of digitizing a cosmetic eyebrow, comprising:
acquiring a face image, and acquiring key points of eyebrows in the face image;
determining a geometric region including eyebrows in the face image according to the key points of the eyebrows;
inputting the shape characteristics of the face image, the geometric area and the target eyebrow shape into a preset image deformation model to perform deformation adjustment on the positions of all pixel points in the geometric area in the face image, and obtaining a deformed first target face image, wherein the shape of the eyebrow in the first target face image is the target eyebrow shape.
2. The method of claim 1, wherein the image deformation model is set based on an OpenGLES framework.
3. The method of claim 1, wherein the image deformation model is an image deformation algorithm that calculates deformation parameters using a moving least squares method.
4. The method of claim 3, wherein the image deformation algorithm comprises an affine transformation, a similarity transformation, or a rigid transformation.
5. The method according to claim 1, wherein the step of determining a geometric region including eyebrows in the face image according to the key points of the eyebrows comprises:
and determining the geometric area as the minimum circumscribed rectangle of the eyebrow.
6. The method of claim 5, further comprising:
and attenuating the position of each pixel point in the geometric area including eyebrows in the first target face image relative to the deformation of each pixel point in the geometric area including eyebrows in the face image according to a preset attenuation rule to obtain an attenuated second target face image, wherein the deformation degree of the pixel points of non-eyebrows in the geometric area of the second target face image relative to the face image is smaller than the deformation degree of the pixel points of non-eyebrows in the geometric area of the first target face image relative to the face image.
7. The method according to claim 6, wherein the preset attenuation rule includes that from the center to the boundary of the geometric region, the attenuation degree of the deformation of the position of each pixel point in the geometric region including the eyebrow in the first target face image relative to the position of each pixel point in the geometric region including the eyebrow in the face image is gradually increased.
8. The method of claim 7, further comprising:
and inputting the second target face image and a preset eyebrow material image into a preset image fusion model for fusion to obtain a fused third target face image, wherein the image fusion model is set based on an OpenGLES frame.
9. An electronic device comprising a memory and at least one processor for executing at least one computer program stored in the memory, the at least one processor, when executing the at least one computer program, causing the electronic device to implement the method of any one of claims 1-8.
10. A readable storage medium, characterized in that the readable storage medium stores a computer program comprising program instructions which, when executed by a processor, cause the processor to carry out the method according to any one of claims 1-8.
CN202110786745.5A 2021-07-12 2021-07-12 Method for digitizing beautiful eyebrows, electronic device and storage medium Pending CN113689325A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110786745.5A CN113689325A (en) 2021-07-12 2021-07-12 Method for digitizing beautiful eyebrows, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110786745.5A CN113689325A (en) 2021-07-12 2021-07-12 Method for digitizing beautiful eyebrows, electronic device and storage medium

Publications (1)

Publication Number Publication Date
CN113689325A true CN113689325A (en) 2021-11-23

Family

ID=78576925

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110786745.5A Pending CN113689325A (en) 2021-07-12 2021-07-12 Method for digitizing beautiful eyebrows, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN113689325A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114119607A (en) * 2022-01-20 2022-03-01 广州易道智慧信息科技有限公司 Wine bottle defect sample generation method and system based on deep neural network

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH1125253A (en) * 1997-07-07 1999-01-29 Onishi Netsugaku:Kk Method for drawing eyebrow
CN106203329A (en) * 2016-07-08 2016-12-07 安徽工业大学 A kind of set up identity template and the method carrying out identification based on eyebrow
CN107066095A (en) * 2017-03-31 2017-08-18 联想(北京)有限公司 A kind of information processing method and electronic equipment
CN107464253A (en) * 2017-07-10 2017-12-12 北京小米移动软件有限公司 eyebrow location method and device
CN108062742A (en) * 2017-12-31 2018-05-22 广州二元科技有限公司 A kind of eyebrow replacing options using Digital Image Processing and deformation
CN108717530A (en) * 2018-05-21 2018-10-30 Oppo广东移动通信有限公司 Image processing method, device, computer readable storage medium and electronic equipment
CN110222566A (en) * 2019-04-30 2019-09-10 北京迈格威科技有限公司 A kind of acquisition methods of face characteristic, device, terminal and storage medium
CN110555796A (en) * 2019-07-24 2019-12-10 广州视源电子科技股份有限公司 image adjusting method, device, storage medium and equipment
CN111753685A (en) * 2020-06-12 2020-10-09 北京字节跳动网络技术有限公司 Method and device for adjusting human face hairline in image and electronic equipment
CN111833461A (en) * 2020-07-10 2020-10-27 北京字节跳动网络技术有限公司 Method and device for realizing special effect of image, electronic equipment and storage medium
CN112200716A (en) * 2020-10-15 2021-01-08 广州博冠信息科技有限公司 Image processing method, device, electronic equipment and nonvolatile storage medium

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH1125253A (en) * 1997-07-07 1999-01-29 Onishi Netsugaku:Kk Method for drawing eyebrow
CN106203329A (en) * 2016-07-08 2016-12-07 安徽工业大学 A kind of set up identity template and the method carrying out identification based on eyebrow
CN107066095A (en) * 2017-03-31 2017-08-18 联想(北京)有限公司 A kind of information processing method and electronic equipment
CN107464253A (en) * 2017-07-10 2017-12-12 北京小米移动软件有限公司 eyebrow location method and device
CN108062742A (en) * 2017-12-31 2018-05-22 广州二元科技有限公司 A kind of eyebrow replacing options using Digital Image Processing and deformation
CN108717530A (en) * 2018-05-21 2018-10-30 Oppo广东移动通信有限公司 Image processing method, device, computer readable storage medium and electronic equipment
CN110222566A (en) * 2019-04-30 2019-09-10 北京迈格威科技有限公司 A kind of acquisition methods of face characteristic, device, terminal and storage medium
CN110555796A (en) * 2019-07-24 2019-12-10 广州视源电子科技股份有限公司 image adjusting method, device, storage medium and equipment
CN111753685A (en) * 2020-06-12 2020-10-09 北京字节跳动网络技术有限公司 Method and device for adjusting human face hairline in image and electronic equipment
CN111833461A (en) * 2020-07-10 2020-10-27 北京字节跳动网络技术有限公司 Method and device for realizing special effect of image, electronic equipment and storage medium
CN112200716A (en) * 2020-10-15 2021-01-08 广州博冠信息科技有限公司 Image processing method, device, electronic equipment and nonvolatile storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
DAVID ZHANG;FANGMEI CHEN;YONG XU: "A Facial Beauty Analysis Simulation System", COMPUTER MODELS FOR FACIAL BEAUTY ANALYSIS, pages 237 - 258 *
马飞;程荣花: "基于上边缘的人眼精确定位", 平顶山学院学报, no. 05, pages 106 - 109 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114119607A (en) * 2022-01-20 2022-03-01 广州易道智慧信息科技有限公司 Wine bottle defect sample generation method and system based on deep neural network

Similar Documents

Publication Publication Date Title
CN110136243B (en) Three-dimensional face reconstruction method, system, device and storage medium thereof
CN109035373B (en) Method and device for generating three-dimensional special effect program file package and method and device for generating three-dimensional special effect
CN108335345B (en) Control method and device of facial animation model and computing equipment
CN107452049B (en) Three-dimensional head modeling method and device
WO2022057526A1 (en) Three-dimensional model reconstruction method and apparatus, and three-dimensional reconstruction model training method and apparatus
EP3992919B1 (en) Three-dimensional facial model generation method and apparatus, device, and medium
CN109711304A (en) A kind of man face characteristic point positioning method and device
CN109151540A (en) The interaction processing method and device of video image
US20240037839A1 (en) Image rendering
CN113838176A (en) Model training method, three-dimensional face image generation method and equipment
CN114037802A (en) Three-dimensional face model reconstruction method and device, storage medium and computer equipment
CN116012507A (en) Rendering data processing method and device, electronic equipment and storage medium
CN110458924B (en) Three-dimensional face model establishing method and device and electronic equipment
CN114723888A (en) Three-dimensional hair model generation method, device, equipment, storage medium and product
CN113689325A (en) Method for digitizing beautiful eyebrows, electronic device and storage medium
CN109697748B (en) Model compression processing method, model mapping processing method, model compression processing device, and storage medium
CN109145688A (en) The processing method and processing device of video image
CN113870420A (en) Three-dimensional face model reconstruction method and device, storage medium and computer equipment
CN113822965A (en) Image rendering processing method, device and equipment and computer storage medium
CN109285160B (en) Image matting method and system
CN110751026A (en) Video processing method and related device
CN111784805B (en) Virtual character interaction feedback method and device
US20220277586A1 (en) Modeling method, device, and system for three-dimensional head model, and storage medium
CN113223128B (en) Method and apparatus for generating image
CN110838167B (en) Model rendering method, device and storage medium

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