CN114663290A - Face image processing method and device, electronic equipment and storage medium - Google Patents

Face image processing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114663290A
CN114663290A CN202011401695.6A CN202011401695A CN114663290A CN 114663290 A CN114663290 A CN 114663290A CN 202011401695 A CN202011401695 A CN 202011401695A CN 114663290 A CN114663290 A CN 114663290A
Authority
CN
China
Prior art keywords
face image
target face
template material
weight value
processed
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
CN202011401695.6A
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.)
Soyoung Technology Beijing Co Ltd
Original Assignee
Soyoung Technology Beijing 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 Soyoung Technology Beijing Co Ltd filed Critical Soyoung Technology Beijing Co Ltd
Priority to CN202011401695.6A priority Critical patent/CN114663290A/en
Publication of CN114663290A publication Critical patent/CN114663290A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/77Retouching; Inpainting; Scratch removal
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10024Color image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20212Image combination
    • G06T2207/20221Image fusion; Image merging
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30196Human being; Person
    • G06T2207/30201Face

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Processing Or Creating Images (AREA)
  • Image Processing (AREA)

Abstract

The invention discloses a method and a device for processing a face image, electronic equipment and a storage medium, wherein the method comprises the following steps: acquiring a target face image, and extracting key point data of the target face image from the target face image; acquiring a template material, and drawing the template material into blank textures in a preset mode to enable the template material to correspond to a region to be processed of a target face image; and weighting at least two color channels of the region to be processed of the target face image based on the template material. According to the face image processing method provided by the embodiment of the disclosure, the region to be processed of the target face image can be accurately determined, and the weighting processing is performed on at least two color channels of the region to be processed of the target face image based on the template material, so that the finally obtained weighted target face image has a good beautifying effect, and the user experience is improved.

Description

一种人脸图像的处理方法、装置、电子设备和存储介质A face image processing method, device, electronic device and storage medium

技术领域technical field

本发明涉及图像处理领域,特别涉及一种人脸图像的处理方法、装置、电子设备和存储介质。The present invention relates to the field of image processing, in particular to a method, device, electronic device and storage medium for processing a face image.

背景技术Background technique

随着图像处理技术的发展,越来越多的用户通过美颜软件对人脸图像进行处理。With the development of image processing technology, more and more users process face images through beauty software.

在上述通过美颜软件的美颜技术中,一些用户使用美颜技术以使得用户的目标区域的妆容更加好看。In the above-mentioned beauty technology through beauty software, some users use the beauty technology to make the makeup of the user's target area more beautiful.

现有的美颜技术存在如下缺陷:The existing beauty technology has the following defects:

基于现有的美颜技术在用户的人脸图像上确定出的任意一个所选目标区域的位置时可能存在的误差,因此,造成在用户的人脸图像上确定的所选目标区域的位置不精准,因此,最终,得到的对用户的人脸图像进行美颜处理的美颜效果较差,从而降低了用户体验度。There may be errors in the position of any selected target area determined on the user's face image based on the existing beauty technology. Therefore, the position of the selected target area determined on the user's face image may not be the same. Therefore, in the end, the beautification effect obtained by performing the beautification processing on the user's face image is poor, thereby reducing the user experience.

发明内容SUMMARY OF THE INVENTION

基于此,有必要针对基于现有的卧蚕美颜技术所存在的因确定的所选目标区域的位置不精准而造成的美颜效果较差的问题,提供一种人脸图像的处理方法、装置、电子设备和存储介质。Based on this, it is necessary to provide a method for processing a face image, aiming at the problem of poor beauty effect caused by the inaccurate position of the selected target area based on the existing lying silkworm beauty technology. Devices, electronic equipment and storage media.

第一方面,本申请实施例提供了一种人脸图像的处理方法,所述方法包括:In a first aspect, an embodiment of the present application provides a method for processing a face image, the method comprising:

获取目标人脸图像,并从所述目标人脸图像中提取所述目标人脸图像的关键点数据;Acquiring a target face image, and extracting key point data of the target face image from the target face image;

获取模板素材,通过预设方式将所述模板素材绘制至空白纹理中,使得所述模板素材与目标人脸图像待处理的区域相对应;Obtaining template material, and drawing the template material into the blank texture by a preset method, so that the template material corresponds to the area to be processed of the target face image;

基于所述模板素材对所述目标人脸图像待处理的区域的至少两个颜色通道进行加权处理。Weighting processing is performed on at least two color channels of the to-be-processed region of the target face image based on the template material.

在一种实施方式中,所述通过预设方式将所述模板素材绘制至空白纹理中包括:In an implementation manner, the drawing the template material into the blank texture in a preset manner includes:

基于所述目标人脸图像的关键点数据,确定所述目标人脸图像在所述空白纹理内的融合区域;determining the fusion region of the target face image in the blank texture based on the key point data of the target face image;

获取所述模板素材的纹理数据;obtain the texture data of the template material;

根据索引的方式与所述模板素材的纹理数据,将所述模板素材绘制到所述空白纹理内的融合区域。Drawing the template material into the fusion area in the blank texture according to the index method and the texture data of the template material.

在一种实施方式中,所述基于所述模板素材对所述目标人脸图像待处理的区域的至少两个颜色通道进行加权处理包括:In one embodiment, the weighting process on at least two color channels of the region to be processed in the target face image based on the template material includes:

在第一通道,基于所述模板素材对所述目标人脸图像待处理的区域的至少两个颜色通道进行加权处理,以及In the first channel, weighting processing is performed on at least two color channels of the to-be-processed area of the target face image based on the template material, and

在第二通道,基于所述模板素材对所述目标人脸图像待处理的区域的至少两个颜色通道进行加权处理。In the second channel, weighting processing is performed on at least two color channels of the to-be-processed area of the target face image based on the template material.

在一种实施方式中,所述第一通道为蓝色通道,所述基于所述模板素材对所述目标人脸图像待处理的区域的至少两个颜色通道进行加权处理包括:In an embodiment, the first channel is a blue channel, and the weighting process on at least two color channels of the to-be-processed area of the target face image based on the template material includes:

确定用于在所述蓝色通道内对所述目标区域进行提亮处理的第一提亮权重值;determining a first lightening weight value for lightening the target area in the blue channel;

根据所述第一提亮权重值和所述目标人脸图像的每一个关键点对应的像素值,在所述第一通道,基于所述模板素材对所述目标人脸图像待处理的区域进行加权处理,以使得通过所述第一提亮权重值在所述蓝色通道内对所述目标人脸图像待处理的区域进行提亮处理。According to the first highlighting weight value and the pixel value corresponding to each key point of the target face image, in the first channel, the region to be processed in the target face image is processed based on the template material. Weighting processing is performed, so that the region to be processed in the target face image is brightened in the blue channel by the first highlighting weight value.

在一种实施方式中,所述确定所述第一提亮权重值包括:In one embodiment, the determining the first highlighting weight value includes:

获取第一预设输入权重值、第二预设输入权重值、从所述模板素材提取出的蓝色和在所述蓝色通道内进行加权处理的第一加权系数,所述第一预设输入权重值和所述第二预设输入权重值的加合为1;Obtain a first preset input weight value, a second preset input weight value, the blue color extracted from the template material, and a first weighting coefficient for performing weighting processing in the blue color channel, the first preset The sum of the input weight value and the second preset input weight value is 1;

根据所述第一预设输入权重值、所述第二预设输入权重值、从所述模板素材提取出的所述蓝色和在所述蓝色通道内进行加权处理的所述第一加权系数进行加权处理,确定出所述第一提亮权重值。According to the first preset input weight value, the second preset input weight value, the blue color extracted from the template material, and the first weighting process performed in the blue color channel The coefficients are weighted to determine the first highlighting weight value.

在一种实施方式中,所述第二通道为蓝色通道,所述在第二通道,基于所述模板素材对所述目标人脸图像待处理的区域的至少两个颜色通道进行加权处理包括:In an implementation manner, the second channel is a blue channel, and in the second channel, performing weighting processing on at least two color channels of the region to be processed in the target face image based on the template material includes: :

确定用于在所述绿色通道内对所述目标区域进行提亮处理的第二提亮权重值;determining a second lightening weight value for lightening the target area in the green channel;

根据所述第二提亮权重值和所述目标人脸图像的每一个关键点对应的像素值,在所述第二通道,基于所述模板素材对所述目标人脸图像待处理的区域进行加权处理,以使得通过所述第二提亮权重值在所述绿色通道内对所述目标人脸图像待处理的区域进行提亮处理。According to the second highlighting weight value and the pixel value corresponding to each key point of the target face image, in the second channel, the region to be processed in the target face image is processed based on the template material. Weighting processing is performed, so that the region to be processed in the target face image is brightened in the green channel by the second highlighting weight value.

在一种实施方式中,所述确定所述第二提亮权重值包括:In one embodiment, the determining the second highlighting weight value includes:

获取所述第一预设输入权重值、所述第二预设输入权重值、从所述模板素材提取出的绿色和在所述绿色通道内进行加权处理的第二加权系数,所述第一预设输入权重值和所述第二预设输入权重值的加合为1;Obtain the first preset input weight value, the second preset input weight value, the green color extracted from the template material, and the second weighting coefficient for weighting processing in the green channel, the first The sum of the preset input weight value and the second preset input weight value is 1;

根据所述第一预设输入权重值、所述第二预设输入权重值、从所述模板素材提取出的所述绿色和在所述绿色通道内进行加权处理的所述第二加权系数进行加权处理,确定出所述第二提亮权重值。According to the first preset input weight value, the second preset input weight value, the green color extracted from the template material, and the second weighting coefficient for weighting processing in the green channel The weighting process is performed to determine the second highlighting weight value.

在一种实施方式中,所述目标区域为卧蚕所在的区域。In one embodiment, the target area is the area where the lying silkworm is located.

第二方面,本申请实施例提供了一种人脸图像的处理装置,所述装置包括:获取单元、提取单元、绘制单元和加权处理单元;In a second aspect, an embodiment of the present application provides an apparatus for processing a face image, the apparatus comprising: an acquisition unit, an extraction unit, a drawing unit, and a weighting processing unit;

所述获取目标人脸图像,以及获取模板素材;The obtaining the target face image, and obtaining the template material;

所述提取单元,用于从所述获取单元获取到的所述目标人脸图像中提取所述目标人脸图像的关键点数据;The extraction unit is configured to extract the key point data of the target face image from the target face image obtained by the acquisition unit;

所述绘制单元,用于通过预设方式将所述获取单元获取到的所述模板素材绘制至空白纹理中,使得所述模板素材与目标人脸图像待处理的区域相对应;the drawing unit, configured to draw the template material acquired by the acquisition unit into a blank texture in a preset manner, so that the template material corresponds to the area to be processed in the target face image;

所述加权处理单元,用于基于所述获取单元获取的所述模板素材对所述目标人脸图像待处理的区域的至少两个颜色通道进行加权处理。The weighting processing unit is configured to perform weighting processing on at least two color channels of the to-be-processed area of the target face image based on the template material obtained by the obtaining unit.

第三方面,本申请实施例提供一种电子设备,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述处理器运行所述计算机程序以实现如上所述的方法步骤。In a third aspect, embodiments of the present application provide an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor runs the computer program to achieve Method steps as described above.

第四方面,本申请实施例提供一种计算机可读存储介质,其上存储有计算机程序,所述程序被处理器执行实现如上所述的方法步骤。In a fourth aspect, embodiments of the present application provide a computer-readable storage medium on which a computer program is stored, and the program is executed by a processor to implement the above method steps.

本申请实施例提供的技术方案可以包括以下有益效果:The technical solutions provided by the embodiments of the present application may include the following beneficial effects:

在本申请实施例中,获取目标人脸图像,并从目标人脸图像中提取目标人脸图像的关键点数据;获取模板素材,通过预设方式将模板素材绘制至空白纹理中,使得模板素材与目标人脸图像待处理的区域相对应;基于模板素材对目标人脸图像待处理的区域的至少两个颜色通道进行加权处理。本公开实施例提供的人脸图像的处理方法,由于能够精准地确定出目标人脸图像待处理的区域,以及基于模板素材对目标人脸图像待处理的区域的至少两个颜色通道进行加权处理,因此,最终得到的加权处理后的目标人脸图像具有较佳的美颜效果,提高了用户体验度,应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本发明。In the embodiment of the present application, a target face image is obtained, and key point data of the target face image is extracted from the target face image; template material is obtained, and the template material is drawn into a blank texture by a preset method, so that the template material Corresponding to the to-be-processed area of the target face image; weighting processing is performed on at least two color channels of the to-be-processed area of the target face image based on the template material. The method for processing a face image provided by the embodiment of the present disclosure can accurately determine the area to be processed of the target face image, and perform weighting processing on at least two color channels of the area to be processed in the target face image based on the template material. , therefore, the final weighted target face image has a better beautifying effect and improves the user experience. It should be understood that the above general description and the following detailed description are only exemplary and explanatory. does not limit the present invention.

附图说明Description of drawings

此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本发明的实施例,并与说明书一起用于解释本发明的原理。The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description serve to explain the principles of the invention.

图1是本公开实施例提供的一种人脸图像的处理方法的应用场景图;1 is an application scenario diagram of a method for processing a face image provided by an embodiment of the present disclosure;

图2是本公开实施例提供的一种人脸图像的处理方法的流程示意图;2 is a schematic flowchart of a method for processing a face image provided by an embodiment of the present disclosure;

图3是本公开实施例提供的一种应用场景下的由106个关键点标识的目标人脸图像的示意图;3 is a schematic diagram of a target face image identified by 106 key points in an application scenario provided by an embodiment of the present disclosure;

图4是本公开实施例提供的一种应用场景下的对目标人脸图像进行美颜处理的卧蚕图像的示意图;4 is a schematic diagram of a lying silkworm image that performs beautification processing on a target face image under an application scenario provided by an embodiment of the present disclosure;

图5是本公开实施例提供的一种应用场景下的标准人脸图像的示意图;5 is a schematic diagram of a standard face image in an application scenario provided by an embodiment of the present disclosure;

图6是本公开实施例提供的一种应用场景下的经过标准网格分割处理后得到的处理后标准人脸图像的示意图;6 is a schematic diagram of a processed standard face image obtained after standard grid segmentation processing in an application scenario provided by an embodiment of the present disclosure;

图7是本公开实施例提供的一种人脸图像的处理装置的结构示意图;7 is a schematic structural diagram of an apparatus for processing a face image provided by an embodiment of the present disclosure;

图8示出了根据本公开的实施例的电子设备连接结构示意图。FIG. 8 shows a schematic diagram of a connection structure of an electronic device according to an embodiment of the present disclosure.

具体实施方式Detailed ways

以下描述和附图充分地示出本发明的具体实施方案,以使本领域的技术人员能够实践它们。The following description and drawings sufficiently illustrate specific embodiments of the invention to enable those skilled in the art to practice them.

应当明确,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其它实施例,都属于本发明保护的范围。It should be understood that the described embodiments are only some, but not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

下面结合附图详细说明本公开的可选实施例。The optional embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.

如图1所示,为本公开实施例的一种应用场景图,该应用场景为多个用户通过手机等终端设备操作安装于该终端设备上的客户端,客户端通过网络与后台服务器进行数据通信。特别的一种应用场景为:对人脸图像进行处理,即:对人脸图像进行卧蚕美颜处理,但并不限于该唯一应用场景,可以理解的任何能够应用于本实施方案的场景均包括在内,为了说明方便,本实施例对至少一个客户端的人脸图像的处理过程以实现与人脸图像的处理方法的应用场景为例进行描述。As shown in FIG. 1, it is an application scenario diagram of an embodiment of the present disclosure. The application scenario is that multiple users operate a client installed on the terminal device through a terminal device such as a mobile phone, and the client performs data processing with a background server through a network. communication. A special application scenario is: processing a face image, that is, performing a lying silkworm beautifying process on a face image, but it is not limited to this only application scenario, and any comprehensible scenario that can be applied to this embodiment is Including, for the convenience of description, in this embodiment, the process of processing a face image of at least one client is described by taking an application scenario of implementing the method for processing a face image as an example.

如图2所示,本公开实施例提供一种人脸图像的处理方法,应用于客户端,具体包括如下方法步骤:As shown in FIG. 2 , an embodiment of the present disclosure provides a method for processing a face image, which is applied to a client and specifically includes the following method steps:

S202:获取目标人脸图像,并从目标人脸图像中提取目标人脸图像的关键点数据。S202: Acquire a target face image, and extract key point data of the target face image from the target face image.

如图3所示,是本公开实施例提供的一种应用场景下的由106个目标人脸关键点标识的目标人脸图像的示意图;如图3所示,示出了目标人脸图像中的106个关键点,各个关键点均具有对应的数字标识。例如,数字标识52、57、73、56和55分别代表目标人脸图像中的一侧下眼角周围的目标人脸关键点,对应地,数字标识58、63、76、62和61分别代表目标人脸图像中的另一侧下眼角周围的目标人脸关键点。As shown in FIG. 3, it is a schematic diagram of a target face image identified by 106 target face key points in an application scenario provided by an embodiment of the present disclosure; as shown in FIG. 3, it shows the target face image in the There are 106 key points, each of which has a corresponding digital identification. For example, numerals 52, 57, 73, 56 and 55 respectively represent the key points of the target face around the lower corner of the eye in the target face image, and correspondingly, numerals 58, 63, 76, 62 and 61 respectively represent the target The target face key points around the lower corner of the eye on the other side in the face image.

由于具有同一标识的标准人脸关键点和目标人脸关键点之间具有一一对应的索引关系,因此,能够根据上述索引关系,以及各个与下眼角相关联的标准人脸关键点,索引出对应的各个与下眼角相关联的目标人脸关键点。Since there is a one-to-one index relationship between the standard face key points with the same identifier and the target face key points, according to the above index relationship and each standard face key point associated with the lower corner of the eye, the index can be obtained. The corresponding key points of the target face associated with the lower corner of the eye.

S204:获取模板素材,通过预设方式将模板素材绘制至空白纹理中,使得模板素材与目标人脸图像待处理的区域相对应。S204: Obtain template material, and draw the template material into the blank texture by a preset method, so that the template material corresponds to the area to be processed of the target face image.

在本申请实施例中,通过预设方式将模板素材绘制至空白纹理中包括以下步骤:In the embodiment of the present application, drawing the template material into the blank texture by a preset method includes the following steps:

基于目标人脸图像的关键点数据,确定目标人脸图像在空白纹理内的融合区域;Determine the fusion area of the target face image in the blank texture based on the key point data of the target face image;

获取模板素材的纹理数据;Get the texture data of the template material;

根据索引的方式与模板素材的纹理数据,将模板素材绘制到空白纹理内的融合区域。According to the index method and the texture data of the template material, the template material is drawn to the fusion area in the blank texture.

在本申请实施例中,索引的方式具体为:根据模板素材的各个数据点和空白纹理的各个数据点之间的一一对应的索引关系(通过具有同样的标号进行一一对应的索引),根据上述索引的方式与模板素材的纹理数据,将模板素材绘制到空白纹理内的融合区域,使得在上述融合区域具有模板素材的纹理数据,以实现颜色融合的效果。In the embodiment of the present application, the indexing method is specifically: according to the one-to-one index relationship between each data point of the template material and each data point of the blank texture (by having the same label to perform a one-to-one corresponding index), According to the above index method and the texture data of the template material, the template material is drawn to the fusion area in the blank texture, so that the above fusion area has the texture data of the template material, so as to realize the effect of color fusion.

在本申请实施例中,模板素材可以为卧蚕图像。In this embodiment of the present application, the template material may be an image of a lying silkworm.

如图4所示,是本公开实施例提供的一种应用场景下的对目标人脸图像进行美颜处理的卧蚕图像的示意图。As shown in FIG. 4 , it is a schematic diagram of a lying silkworm image for performing beautification processing on a target face image in an application scenario provided by an embodiment of the present disclosure.

如图4所示的卧蚕图像具有明暗凸起的美颜效果,这样,使得对该卧蚕图像和目标人脸图像进行图像融合处理得到的处理后的目标人脸图像更加自然,具有较佳的美颜效果,提高了用户体验度。The image of the lying silkworm as shown in FIG. 4 has a bright and dark beautifying effect, so that the processed target face image obtained by performing image fusion processing on the image of the lying silkworm and the target face image is more natural and has better The beauty effect improves the user experience.

在本申请实施例中,可以根据不同用户的偏好度,从包括各种卧蚕图像的图像库中选取与用户的偏好度匹配的卧蚕图像,如图3所示的卧蚕图像仅仅是一个实例。In the embodiment of the present application, according to the preferences of different users, an image of a lying silkworm that matches the user's preference may be selected from an image library including various images of lying silkworms. The image of a lying silkworm shown in FIG. 3 is only one instance.

在本申请实施例中,目标人脸图像的格式优选rgba格式的图像。In the embodiment of the present application, the format of the target face image is preferably an image in rgba format.

如图5所示,是本公开实施例提供的一种应用场景下的标准人脸图像的示意图;在本申请实施例中,可以将标准人脸图像的标准人脸关键点的预设数量设置为106个。在不同的应用场景中,可以配置不同的预设数量的标准人脸关键点。在图5中,对图像进行了简化,并没有标识出预设数量的标准人脸关键点,在此仅仅是示例。标准人脸图像的格式优选rgba格式的图像。As shown in FIG. 5, it is a schematic diagram of a standard face image in an application scenario provided by an embodiment of the present disclosure; in the embodiment of the present application, the preset number of standard face key points of the standard face image can be set is 106. In different application scenarios, different preset numbers of standard face key points can be configured. In Fig. 5, the image is simplified, and a preset number of standard face key points are not identified, which is only an example here. The format of the standard face image is preferably an image in rgba format.

如图6所示,是本公开实施例提供的一种应用场景下的经过标准网格分割处理后得到的处理后标准人脸图像的示意图;通过如图6所示的各个标准网格,可以实现对标准人脸图像中的各个五官进行精准定位。As shown in FIG. 6 , it is a schematic diagram of a processed standard face image obtained by dividing a standard grid in an application scenario provided by an embodiment of the present disclosure; through the standard grids shown in FIG. Accurate positioning of each facial feature in a standard face image is achieved.

获取预设数量的标准人脸关键点的第一数据集合,第一数据集合包括各个标准人脸关键点的标识数据、各个标准人脸关键点的横坐标数据、各个目标标准关键点的纵坐标数据;以及获取预设数量的目标人脸关键点的第二数据集合,第二数据集合包括各个目标人脸关键点的标识数据、各个目标人脸关键点的横坐标数据、各个目标人脸关键点的纵坐标数据,其中,具有同一标识的标准人脸关键点和目标人脸关键点之间具有一一对应的索引关系;Obtain a first data set of a preset number of standard face key points, where the first data set includes the identification data of each standard face key point, the abscissa data of each standard face key point, and the ordinate of each target standard key point data; and a second data set for obtaining a preset number of target face key points, the second data set includes identification data of each target face key point, abscissa data of each target face key point, and each target face key point The ordinate data of the point, wherein there is a one-to-one index relationship between the standard face key points with the same identification and the target face key points;

根据第一数据集合中的数据对标准对象的标准人脸图像做网格分割处理,得到分割出的各个网格,并将分割出的各个网格贴在空白图片上;Perform grid segmentation processing on the standard face image of the standard object according to the data in the first data set to obtain the divided grids, and paste the divided grids on the blank picture;

将卧蚕图像贴在具有分割出的各个网格的空白图片上,得到具有标准化网格的处理后的卧蚕图像,处理后的卧蚕图像为经由标准网格分割处理后的卧蚕图像。The image of the lying silkworm is pasted on the blank picture with the divided grids to obtain the image of the lying silkworm after processing with standardized grids.

S206:基于模板素材对目标人脸图像待处理的区域的至少两个颜色通道进行加权处理。S206: Perform weighting processing on at least two color channels of the to-be-processed area of the target face image based on the template material.

在本申请实施例中,输出的融合后的目标人脸图像给定了一个权重值,用户可以根据自己的偏好度,对该权重值进行手动调整,并替换掉之前的权重值。In the embodiment of the present application, the output fused target face image is given a weight value, and the user can manually adjust the weight value according to his own preference, and replace the previous weight value.

在本申请实施例中,目标区域可以为卧蚕所在的区域。针对卧蚕的描述烦请参见前述相同部分的描述,在此不再赘述。In the embodiment of the present application, the target area may be the area where the lying silkworm is located. For the description of the lying silkworm, please refer to the description of the same part above, and will not be repeated here.

在一种可能的实现方式中,基于模板素材对目标人脸图像待处理的区域的至少两个颜色通道进行加权处理包括以下步骤:In a possible implementation manner, performing weighting processing on at least two color channels of the region to be processed in the target face image based on the template material includes the following steps:

在第一通道,基于模板素材对目标人脸图像待处理的区域的至少两个颜色通道进行加权处理,以及在第二通道,基于模板素材对目标人脸图像待处理的区域的至少两个颜色通道进行加权处理。In the first channel, at least two color channels of the target face image area to be processed are weighted based on the template material, and in the second channel, at least two color channels of the target face image area to be processed are weighted based on the template material Channels are weighted.

在本申请实施例中,第一通道为蓝色通道,基于模板素材对目标人脸图像待处理的区域的至少两个颜色通道进行加权处理包括以下步骤:In the embodiment of the present application, the first channel is the blue channel, and weighting processing on at least two color channels of the region to be processed in the target face image based on the template material includes the following steps:

确定用于在蓝色通道内对目标区域进行提亮处理的第一提亮权重值;determining a first lightening weight value for lightening the target area in the blue channel;

根据第一提亮权重值和目标人脸图像的每一个关键点对应的像素值,在第一通道,基于模板素材对目标人脸图像待处理的区域进行加权处理,以使得通过第一提亮权重值在蓝色通道内对目标人脸图像待处理的区域进行提亮处理。According to the first highlighting weight value and the pixel value corresponding to each key point of the target face image, in the first channel, weighting processing is performed on the to-be-processed area of the target face image based on the template material, so that through the first highlighting The weight value in the blue channel brightens the to-be-processed area of the target face image.

在一种可能的实现方式中,确定第一提亮权重值包括:In a possible implementation manner, determining the first highlighting weight value includes:

获取第一预设输入权重值、第二预设输入权重值、从模板素材提取出的蓝色和在蓝色通道内进行加权处理的第一加权系数,第一预设输入权重值和第二预设输入权重值的加合为1;Obtain the first preset input weight value, the second preset input weight value, the blue color extracted from the template material, and the first weighting coefficient for weighting processing in the blue channel, the first preset input weight value and the second preset weight value. The sum of the preset input weight values is 1;

根据第一预设输入权重值、第二预设输入权重值、从模板素材提取出的蓝色和在蓝色通道内进行加权处理的第一加权系数进行加权处理,确定出第一提亮权重值。Perform weighting processing according to the first preset input weight value, the second preset input weight value, the blue color extracted from the template material, and the first weighting coefficient for weighting processing in the blue color channel to determine the first highlighting weight value.

在本申请实施例中,在第一通道为蓝色通道时,基于模板素材对目标人脸图像待处理的区域进行加权处理所采用的加权公式可以为:In this embodiment of the present application, when the first channel is the blue channel, the weighting formula used to perform weighting processing on the to-be-processed area of the target face image based on the template material may be:

color2=color1 *n+color1 *m*B*Alp1color 2 = color 1 * n+color 1 * m * B * Alp1

m=1-n:m=1-n:

Alp1=1.6;Alp1=1.6;

其中,color1为从目标人脸图像中选取的任意一个关键点所对应的像素值,color2为对color1所对应的关键点在蓝色通道内进行提亮处理时所对应的像素值,n为第一预设输入权重值,m为第二预设输入权重值,B为从模板素材中提取出的蓝色,从Alp1为蓝色通道内进行加权处理的第一加权系数。上述仅仅是示例,可以在待处理的区域内选取一定数量的关键点采用上述公式遍历并依次进行处理,在此不再赘述。Among them, color 1 is the pixel value corresponding to any key point selected from the target face image, and color 2 is the pixel value corresponding to the key point corresponding to color 1 when the key point is highlighted in the blue channel, n is the first preset input weight value, m is the second preset input weight value, B is the blue color extracted from the template material, and from Alp1 is the first weighting coefficient for weighting processing in the blue channel. The above is just an example, and a certain number of key points can be selected in the area to be processed and traversed by the above formula and processed in sequence, which will not be repeated here.

在本申请实施例中,第二通道为蓝色通道,在第二通道,基于模板素材对目标人脸图像待处理的区域的至少两个颜色通道进行加权处理包括以下步骤:In the embodiment of the present application, the second channel is the blue channel, and in the second channel, performing weighting processing on at least two color channels of the region to be processed in the target face image based on the template material includes the following steps:

确定用于在绿色通道内对目标区域进行提亮处理的第二提亮权重值;determining a second lightening weight value for lightening the target area in the green channel;

根据第二提亮权重值和目标人脸图像的每一个关键点对应的像素值,在第二通道,基于模板素材对目标人脸图像待处理的区域进行加权处理,以使得通过第二提亮权重值在绿色通道内对目标人脸图像待处理的区域进行提亮处理。According to the second highlighting weight value and the pixel value corresponding to each key point of the target face image, in the second channel, based on the template material, weight processing is performed on the to-be-processed area of the target face image, so that through the second highlighting The weight value in the green channel brightens the to-be-processed area of the target face image.

在一种可能的实现方式中,确定第二提亮权重值包括:In a possible implementation manner, determining the second highlighting weight value includes:

获取第一预设输入权重值、第二预设输入权重值、从模板素材提取出的绿色和在绿色通道内进行加权处理的第二加权系数,第一预设输入权重值和第二预设输入权重值的加合为1;Obtain the first preset input weight value, the second preset input weight value, the green color extracted from the template material, and the second weighting coefficient for weighting processing in the green channel, the first preset input weight value and the second preset weight value The sum of the input weight values is 1;

根据第一预设输入权重值、第二预设输入权重值、从模板素材提取出的绿色和在绿色通道内进行加权处理的第二加权系数进行加权处理,确定出第二提亮权重值。Weighting is performed according to the first preset input weight value, the second preset input weight value, the green color extracted from the template material, and the second weighting coefficient for weighting processing in the green channel to determine the second highlighting weight value.

在本申请实施例中,在第二通道为绿色通道时,将模板素材与目标人脸图像的背景纹理对应的目标区域进行融合处理所采用的融合公式可以为:In the embodiment of the present application, when the second channel is the green channel, the fusion formula used to fuse the template material with the target area corresponding to the background texture of the target face image may be:

color3=color1 *n+color1 *m*G*Alp2;color 3 =color 1 * n+color 1 * m * G * Alp2;

m=1-n;m=1-n;

Alp2=1.3;Alp2=1.3;

其中,color1为从目标人脸图像中选取的任意一个关键点所对应的像素值,color3为对color1所对应的关键点在绿色通道内进行提亮处理时所对应的像素值,n为第一预设输入权重值,m为第二预设输入权重值,G为从模板素材中提取出的绿色,Alp2为绿色通道内进行加权处理的第二加权系数。上述仅仅是示例,可以在待处理的区域内选取一定数量的关键点采用上述公式遍历并依次进行处理,在此不再赘述。Among them, color 1 is the pixel value corresponding to any key point selected from the target face image, color 3 is the corresponding pixel value when the key point corresponding to color 1 is highlighted in the green channel, n is the first preset input weight value, m is the second preset input weight value, G is the green color extracted from the template material, and Alp2 is the second weighting coefficient for weighting processing in the green channel. The above is just an example, and a certain number of key points can be selected in the area to be processed and traversed by the above formula and processed in sequence, which will not be repeated here.

需要说明的是,除了上述所罗列的两个通道之外,还可以设置第三通道,例如,红色通道,公式与前述公式类似,差别在于选取的在红色通道内进行加权处理的加权系数不同,例如,可以将在红色通道内进行加权处理的加权系数设置为1.2,在此不再赘述。It should be noted that in addition to the two channels listed above, a third channel can also be set, such as the red channel. For example, the weighting coefficient for weighting processing in the red channel may be set to 1.2, which will not be repeated here.

在本公开实施例中,获取目标人脸图像,并从目标人脸图像中提取目标人脸图像的关键点数据;获取模板素材,通过预设方式将模板素材绘制至空白纹理中,使得模板素材与目标人脸图像待处理的区域相对应;基于模板素材对目标人脸图像待处理的区域的至少两个颜色通道进行加权处理。本公开实施例提供的人脸图像的处理方法,由于能够精准地确定出目标人脸图像待处理的区域,以及基于模板素材对目标人脸图像待处理的区域的至少两个颜色通道进行加权处理,因此,最终得到的加权处理后的目标人脸图像具有较佳的美颜效果,提高了用户体验度;此外,由于本公开实施例提供的人脸图像的处理方法,无需实时对目标人脸图像的每一帧进行处理,只需对目标人脸图像待处理的区域的各个关键点的像素值进行像素修正处理,因此,提高了人脸图像的处理效率。In the embodiment of the present disclosure, a target face image is obtained, and key point data of the target face image is extracted from the target face image; a template material is obtained, and the template material is drawn into a blank texture by a preset method, so that the template material Corresponding to the to-be-processed area of the target face image; weighting processing is performed on at least two color channels of the to-be-processed area of the target face image based on the template material. The face image processing method provided by the embodiments of the present disclosure can accurately determine the area to be processed of the target face image, and perform weighting processing on at least two color channels of the target face image area to be processed based on the template material , therefore, the final weighted-processed target face image has a better beautifying effect and improves user experience; in addition, due to the face image processing method provided by the embodiment of the present disclosure, it is not necessary to perform real-time analysis on the target face To process each frame of the image, it is only necessary to perform pixel correction processing on the pixel values of each key point in the area of the target face image to be processed, thus improving the processing efficiency of the face image.

下述为本公开实施例人脸图像的处理装置实施例,可以用于执行本公开实施例人脸图像的处理方法实施例。对于本公开实施例人脸图像的处理装置实施例中未披露的细节,请参照本公开实施例人脸图像的处理方法实施例。The following is an embodiment of an apparatus for processing a face image according to an embodiment of the present disclosure, which can be used to execute the embodiment of the method for processing a face image according to the embodiment of the present disclosure. For details that are not disclosed in the embodiments of the apparatus for processing a face image in the embodiment of the present disclosure, please refer to the embodiment of the method for processing a face image in the embodiment of the present disclosure.

请参见图7,其示出了本发明一个示例性实施例提供人脸图像的处理装置的结构示意图。该人脸图像的处理装置可以通过软件、硬件或者两者的结合实现成为终端的全部或一部分。该人脸图像的处理装置包括获取单元702、提取单元704、绘制单元706和加权处理单元708;Please refer to FIG. 7 , which shows a schematic structural diagram of a device for processing a face image according to an exemplary embodiment of the present invention. The device for processing the face image can be implemented as all or a part of the terminal through software, hardware or a combination of the two. The apparatus for processing a face image includes an acquiring unit 702, an extracting unit 704, a drawing unit 706 and a weighting processing unit 708;

具体而言,获取单元702用于获取目标人脸图像,以及获取模板素材;Specifically, the obtaining unit 702 is configured to obtain the target face image and obtain the template material;

提取单元704,用于从获取单元702获取到的目标人脸图像中提取目标人脸图像的关键点数据;Extraction unit 704, for extracting the key point data of the target face image from the target face image obtained by the acquisition unit 702;

绘制单元706,用于通过预设方式将获取单元702获取到的模板素材绘制至空白纹理中,使得模板素材与目标人脸图像待处理的区域相对应;The drawing unit 706 is configured to draw the template material obtained by the obtaining unit 702 into the blank texture by a preset method, so that the template material corresponds to the area to be processed of the target face image;

加权处理单元708,用于基于获取单元702获取的模板素材对目标人脸图像待处理的区域的至少两个颜色通道进行加权处理。The weighting processing unit 708 is configured to perform weighting processing on at least two color channels of the to-be-processed area of the target face image based on the template material obtained by the obtaining unit 702 .

可选的,所述装置还包括:Optionally, the device further includes:

确定单元(在图7中未示出),用于基于提取单元提取出的目标人脸图像的关键点数据,确定目标人脸图像在空白纹理内的融合区域;A determination unit (not shown in FIG. 7 ), for determining the fusion region of the target face image in the blank texture based on the key point data of the target face image extracted by the extraction unit;

获取单元702还用于获取模板素材的纹理数据;The obtaining unit 702 is further configured to obtain the texture data of the template material;

绘制单元706具体用于:根据索引的方式与模板素材的纹理数据,将模板素材绘制到空白纹理内的融合区域。The drawing unit 706 is specifically configured to: draw the template material to the fusion area in the blank texture according to the index method and the texture data of the template material.

可选的,获取单元702还用于:Optionally, the obtaining unit 702 is further configured to:

获取模板素材的纹理数据;Get the texture data of the template material;

绘制单元706用于:通过索引的方式将获取单元702获取的模板素材绘制到空白纹理中,其中,模板素材的纹理数据用于索引目标人脸图像的关键点数据。The drawing unit 706 is configured to: draw the template material obtained by the obtaining unit 702 into a blank texture by means of an index, wherein the texture data of the template material is used to index the key point data of the target face image.

可选的,加权处理单元708用于:Optionally, the weighting processing unit 708 is configured to:

在第一通道,基于模板素材对目标人脸图像待处理的区域的至少两个颜色通道进行加权处理,以及In the first channel, weighting processing is performed on at least two color channels of the to-be-processed area of the target face image based on the template material, and

在第二通道,基于模板素材对目标人脸图像待处理的区域的至少两个颜色通道进行加权处理。In the second channel, weighting processing is performed on at least two color channels of the region to be processed in the target face image based on the template material.

可选的,第一通道为蓝色通道,所述装置还包括:Optionally, the first channel is a blue channel, and the device further includes:

确定单元,还用于确定用于在蓝色通道内对目标区域进行提亮处理的第一提亮权重值;a determining unit, further configured to determine a first highlighting weight value used for highlighting the target area in the blue channel;

加权处理单元708还用于:根据确定单元确定的第一提亮权重值和目标人脸图像的每一个关键点对应的像素值,在第一通道,基于模板素材对目标人脸图像待处理的区域进行加权处理,以使得通过第一提亮权重值在蓝色通道内对目标人脸图像待处理的区域进行提亮处理。The weighting processing unit 708 is further configured to: according to the first highlighting weight value determined by the determining unit and the pixel value corresponding to each key point of the target face image, in the first channel, the target face image to be processed based on the template material. The region is subjected to weighting processing, so that the region to be processed in the target face image is brightened in the blue channel by the first highlighting weight value.

可选的,获取单元702还用于:Optionally, the obtaining unit 702 is further configured to:

获取第一预设输入权重值、第二预设输入权重值、从模板素材提取出的蓝色和在蓝色通道内进行加权处理的第一加权系数,第一预设输入权重值和第二预设输入权重值的加合为1;Obtain the first preset input weight value, the second preset input weight value, the blue color extracted from the template material, and the first weighting coefficient for weighting processing in the blue channel, the first preset input weight value and the second preset weight value. The sum of the preset input weight values is 1;

确定单元具体用于:根据获取单元702获取的第一预设输入权重值、第二预设输入权重值、从模板素材提取出的蓝色和在蓝色通道内进行加权处理的第一加权系数进行加权处理,确定出第一提亮权重值。The determining unit is specifically configured to: according to the first preset input weight value obtained by the obtaining unit 702, the second preset input weight value, the blue color extracted from the template material, and the first weighting coefficient for performing weighting processing in the blue color channel A weighting process is performed to determine the first highlighting weight value.

可选的,第二通道为蓝色通道,确定单元还用于:确定用于在绿色通道内对目标区域进行提亮处理的第二提亮权重值;Optionally, the second channel is a blue channel, and the determining unit is further configured to: determine a second highlighting weight value used for highlighting the target area in the green channel;

加权处理单元708还用于:根据获取单元702获取的第二提亮权重值和目标人脸图像的每一个关键点对应的像素值,在第二通道,基于模板素材对目标人脸图像待处理的区域进行加权处理,以使得通过第二提亮权重值在绿色通道内对目标人脸图像待处理的区域进行提亮处理。The weighting processing unit 708 is further configured to: according to the second highlighting weight value obtained by the obtaining unit 702 and the pixel value corresponding to each key point of the target face image, in the second channel, the target face image is to be processed based on the template material. The region of the target face image is subjected to weighting processing, so that the region to be processed in the target face image is brightened in the green channel by the second highlighting weight value.

可选的,获取单元702还用于:获取第一预设输入权重值、第二预设输入权重值、从模板素材提取出的绿色和在绿色通道内进行加权处理的第二加权系数,第一预设输入权重值和第二预设输入权重值的加合为1;Optionally, the obtaining unit 702 is further configured to: obtain the first preset input weight value, the second preset input weight value, the green color extracted from the template material, and the second weighting coefficient for weighting processing in the green channel, The sum of a preset input weight value and a second preset input weight value is 1;

确定单元还用于:根据获取单元702获取的第一预设输入权重值、第二预设输入权重值、从模板素材提取出的绿色和在绿色通道内进行加权处理的第二加权系数进行加权处理,确定出第二提亮权重值。The determining unit is further configured to: perform weighting according to the first preset input weight value obtained by the obtaining unit 702, the second preset input weight value, the green color extracted from the template material, and the second weighting coefficient for weighting processing in the green channel processing to determine the second highlighting weight value.

可选的,目标区域为卧蚕所在的区域。Optionally, the target area is the area where the lying silkworm is located.

需要说明的是,上述实施例提供的人脸图像的处理装置在执行人脸图像的处理方法时,仅以上述各功能单元的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元完成,即将设备的内部结构划分成不同的功能单元,以完成以上描述的全部或者部分功能。另外,上述实施例提供的人脸图像的处理装置与人脸图像的处理方法实施例属于同一构思,其体现实现过程详见人脸图像的处理方法实施例,这里不再赘述。It should be noted that, when the apparatus for processing a face image provided by the above embodiment executes the method for processing a face image, only the division of the above functional units is used as an example for illustration. In practical applications, the above functions may be allocated as required. It is completed by different functional units, that is, the internal structure of the device is divided into different functional units to complete all or part of the functions described above. In addition, the apparatus for processing a face image provided by the above embodiments and the embodiment of the method for processing a face image belong to the same concept, and the embodiment and implementation process are detailed in the embodiment of the method for processing a face image, which will not be repeated here.

在本公开实施例中,获取单元用于获取目标人脸图像,以及获取模板素材;提取单元用于从获取单元获取到的目标人脸图像中提取目标人脸图像的关键点数据;绘制单元用于通过预设方式将获取单元获取到的模板素材绘制至空白纹理中,使得模板素材与目标人脸图像待处理的区域相对应;以及加权处理单元用于基于获取单元获取的模板素材对目标人脸图像待处理的区域的至少两个颜色通道进行加权处理。本公开实施例提供的人脸图像的处理装置,由于能够精准地确定出目标人脸图像待处理的区域,以及基于模板素材对目标人脸图像待处理的区域的至少两个颜色通道进行加权处理,因此,最终得到的加权处理后的目标人脸图像具有较佳的美颜效果,提高了用户体验度,此外,由于本公开实施例提供的人脸图像的处理方法,无需实时对目标人脸图像的每一帧进行处理,只需对目标人脸图像待处理的区域的各个关键点的像素值进行像素修正处理,因此,提高了人脸图像的处理效率。In the embodiment of the present disclosure, the acquisition unit is used to acquire the target face image and the template material; the extraction unit is used to extract the key point data of the target face image from the target face image acquired by the acquisition unit; the drawing unit uses The template material acquired by the acquisition unit is drawn into the blank texture by a preset method, so that the template material corresponds to the area to be processed of the target face image; and the weighting processing unit is used for the target person based on the template material acquired by the acquisition unit. At least two color channels of the area to be processed in the face image are weighted. The device for processing a face image provided by the embodiment of the present disclosure can accurately determine the region to be processed in the target face image, and perform weighting processing on at least two color channels of the region to be processed in the target face image based on the template material. , therefore, the weighted target face image finally obtained has a better beautifying effect, which improves the user experience. In addition, due to the face image processing method provided by the embodiment of the present disclosure, it is not necessary to perform real-time analysis on the target face. To process each frame of the image, it is only necessary to perform pixel correction processing on the pixel values of each key point in the area of the target face image to be processed, thus improving the processing efficiency of the face image.

如图8所示,本实施例提供一种电子设备,该电子设备包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,处理器运行计算机程序以实现如上所述的方法步骤。As shown in FIG. 8 , this embodiment provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and running on the processor, where the processor runs the computer program to implement the above-mentioned method steps.

本公开实施例提供了一种存储有计算机可读指令的存储介质,其上存储有计算机程序,程序被处理器执行实现如上所述的方法步骤。Embodiments of the present disclosure provide a storage medium storing computer-readable instructions, and a computer program is stored thereon, and the program is executed by a processor to implement the above method steps.

下面参考图8,其示出了适于用来实现本公开实施例的电子设备的结构示意图。本公开实施例中的终端设备可以包括但不限于诸如移动电话、笔记本电脑、数字广播接收器、PDA(个人数字助理)、PAD(平板电脑)、PMP(便携式多媒体播放器)、车载终端(例如车载导航终端)等等的移动终端以及诸如数字TV、台式计算机等等的固定终端。图8示出的电子设备仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。Referring next to FIG. 8 , it shows a schematic structural diagram of an electronic device suitable for implementing an embodiment of the present disclosure. Terminal devices in the embodiments of the present disclosure may include, but are not limited to, such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablets), PMPs (portable multimedia players), vehicle-mounted terminals (eg, mobile terminals such as in-vehicle navigation terminals), etc., and stationary terminals such as digital TVs, desktop computers, and the like. The electronic device shown in FIG. 8 is only an example, and should not impose any limitation on the function and scope of use of the embodiments of the present disclosure.

如图8所示,电子设备可以包括处理装置(例如中央处理器、图形处理器等)801,其可以根据存储在只读存储器(ROM)802中的程序或者从存储装置808加载到随机访问存储器(RAM)803中的程序而执行各种适当的动作和处理。在RAM 803中,还存储有电子设备操作所需的各种程序和数据。处理装置801、ROM802以及RAM803通过总线804彼此相连。输入/输出(I/O)接口805也连接至总线804。As shown in FIG. 8, the electronic device may include a processing device (eg, a central processing unit, a graphics processor, etc.) 801, which may be loaded into a random access memory according to a program stored in a read only memory (ROM) 802 or from a storage device 808 The program in the (RAM) 803 executes various appropriate operations and processes. In the RAM 803, various programs and data necessary for the operation of the electronic device are also stored. The processing device 801 , the ROM 802 , and the RAM 803 are connected to each other through a bus 804 . An input/output (I/O) interface 805 is also connected to bus 804 .

通常,以下装置可以连接至I/O接口805:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置806;包括例如液晶显示器(LCD)、扬声器、振动器等的输出装置807;包括例如磁带、硬盘等的存储装置808;以及通信装置809。通信装置809可以允许电子设备与其他设备进行无线或有线通信以交换数据。虽然图8示出了具有各种装置的电子设备,但是应理解的是,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。Typically, the following devices may be connected to the I/O interface 805: input devices 806 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; including, for example, a liquid crystal display (LCD), speakers, vibration An output device 807 of a computer, etc.; a storage device 808 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 809. Communication means 809 may allow the electronic device to communicate wirelessly or by wire with other devices to exchange data. While FIG. 8 illustrates an electronic device having various means, it should be understood that not all of the illustrated means are required to be implemented or available. More or fewer devices may alternatively be implemented or provided.

特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信装置809从网络上被下载和安装,或者从存储装置808被安装,或者从ROM802被安装。在该计算机程序被处理装置801执行时,执行本公开实施例的方法中限定的上述功能。In particular, according to embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the method illustrated in the flowchart. In such an embodiment, the computer program may be downloaded and installed from the network via the communication device 809 , or from the storage device 808 , or from the ROM 802 . When the computer program is executed by the processing device 801, the above-mentioned functions defined in the methods of the embodiments of the present disclosure are executed.

需要说明的是,本公开上述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the above two. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or a combination of any of the above. More specific examples of computer readable storage media may include, but are not limited to, electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), erasable Programmable read only memory (EPROM or flash memory), fiber optics, portable compact disk read only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing. In this disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present disclosure, however, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave with computer-readable program code embodied thereon. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device . Program code embodied on a computer readable medium may be transmitted using any suitable medium including, but not limited to, electrical wire, optical fiber cable, RF (radio frequency), etc., or any suitable combination of the foregoing.

上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。The above-mentioned computer-readable medium may be included in the above-mentioned electronic device; or may exist alone without being assembled into the electronic device.

可以以一种或多种程序设计语言或其组合来编写用于执行本公开的操作的计算机程序代码,上述程序设计语言包括面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, including object-oriented programming languages—such as Java, Smalltalk, C++, but also conventional Procedural programming language - such as the "C" language or similar programming language. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (eg, using an Internet service provider through Internet connection).

附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code that contains one or more logical functions for implementing the specified functions executable instructions. It should also be noted that, in some alternative implementations, the functions noted in the blocks may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It is also noted that each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented in dedicated hardware-based systems that perform the specified functions or operations , or can be implemented in a combination of dedicated hardware and computer instructions.

描述于本公开实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。其中,单元的名称在某种情况下并不构成对该单元本身的限定。The units involved in the embodiments of the present disclosure may be implemented in a software manner, and may also be implemented in a hardware manner. Among them, the name of the unit does not constitute a limitation of the unit itself under certain circumstances.

Claims (11)

1.一种人脸图像的处理方法,其特征在于,所述方法包括:获取目标人脸图像,并从所述目标人脸图像中提取所述目标人脸图像的关键点数据;1. A method for processing a face image, wherein the method comprises: acquiring a target face image, and extracting key point data of the target face image from the target face image; 获取模板素材,通过预设方式将所述模板素材绘制至空白纹理中,使得所述模板素材与目标人脸图像待处理的区域相对应;Obtaining template material, and drawing the template material into the blank texture by a preset method, so that the template material corresponds to the area to be processed of the target face image; 基于所述模板素材对所述目标人脸图像待处理的区域的至少两个颜色通道进行加权处理。Weighting processing is performed on at least two color channels of the to-be-processed region of the target face image based on the template material. 2.根据权利要求1所述的方法,其特征在于,所述通过预设方式将所述模板素材绘制至空白纹理中包括:2 . The method according to claim 1 , wherein the drawing the template material into a blank texture by a preset method comprises: 2 . 基于所述目标人脸图像的关键点数据,确定所述目标人脸图像在所述空白纹理内的融合区域;determining the fusion region of the target face image in the blank texture based on the key point data of the target face image; 获取所述模板素材的纹理数据;obtain the texture data of the template material; 根据索引的方式与所述模板素材的纹理数据,将所述模板素材绘制到所述空白纹理内的融合区域。Drawing the template material into the fusion area in the blank texture according to the index method and the texture data of the template material. 3.根据权利要求1所述的方法,其特征在于,所述基于所述模板素材对所述目标人脸图像待处理的区域的至少两个颜色通道进行加权处理包括:3 . The method according to claim 1 , wherein the performing weighting processing on at least two color channels of the to-be-processed area of the target face image based on the template material comprises: 3 . 在第一通道,基于所述模板素材对所述目标人脸图像待处理的区域的至少两个颜色通道进行加权处理,以及In the first channel, weighting processing is performed on at least two color channels of the to-be-processed area of the target face image based on the template material, and 在第二通道,基于所述模板素材对所述目标人脸图像待处理的区域的至少两个颜色通道进行加权处理。In the second channel, weighting processing is performed on at least two color channels of the to-be-processed area of the target face image based on the template material. 4.根据权利要求3所述的方法,其特征在于,所述第一通道为蓝色通道,所述基于所述模板素材对所述目标人脸图像待处理的区域的至少两个颜色通道进行加权处理包括:4 . The method according to claim 3 , wherein the first channel is a blue channel, and the at least two color channels of the region to be processed in the target face image are performed based on the template material. 5 . Weighted processing includes: 确定用于在所述蓝色通道内对所述目标区域进行提亮处理的第一提亮权重值;determining a first lightening weight value for lightening the target area in the blue channel; 根据所述第一提亮权重值和所述目标人脸图像的每一个关键点对应的像素值,在所述第一通道,基于所述模板素材对所述目标人脸图像待处理的区域进行加权处理,以使得通过所述第一提亮权重值在所述蓝色通道内对所述目标人脸图像待处理的区域进行提亮处理。According to the first highlighting weight value and the pixel value corresponding to each key point of the target face image, in the first channel, the region to be processed in the target face image is processed based on the template material. Weighting processing is performed, so that the region to be processed in the target face image is brightened in the blue channel by the first highlighting weight value. 5.根据权利要求4所述的方法,其特征在于,所述确定所述第一提亮权重值包括:5. The method according to claim 4, wherein the determining the first highlighting weight value comprises: 获取第一预设输入权重值、第二预设输入权重值、从所述模板素材提取出的蓝色和在所述蓝色通道内进行加权处理的第一加权系数,所述第一预设输入权重值和所述第二预设输入权重值的加合为1;Obtain a first preset input weight value, a second preset input weight value, the blue color extracted from the template material, and a first weighting coefficient for performing weighting processing in the blue color channel, the first preset The sum of the input weight value and the second preset input weight value is 1; 根据所述第一预设输入权重值、所述第二预设输入权重值、从所述模板素材提取出的所述蓝色和在所述蓝色通道内进行加权处理的所述第一加权系数进行加权处理,确定出所述第一提亮权重值。According to the first preset input weight value, the second preset input weight value, the blue color extracted from the template material, and the first weighting process performed in the blue color channel The coefficients are weighted to determine the first highlighting weight value. 6.根据权利要求4所述的方法,其特征在于,所述第二通道为蓝色通道,所述在第二通道,基于所述模板素材对所述目标人脸图像待处理的区域的至少两个颜色通道进行加权处理包括:6. The method according to claim 4, wherein the second channel is a blue channel, and in the second channel, based on the template material, at least an area of the target face image to be processed is performed. Weighting of the two color channels includes: 确定用于在所述绿色通道内对所述目标区域进行提亮处理的第二提亮权重值;determining a second lightening weight value for lightening the target area in the green channel; 根据所述第二提亮权重值和所述目标人脸图像的每一个关键点对应的像素值,在所述第二通道,基于所述模板素材对所述目标人脸图像待处理的区域进行加权处理,以使得通过所述第二提亮权重值在所述绿色通道内对所述目标人脸图像待处理的区域进行提亮处理。According to the second highlighting weight value and the pixel value corresponding to each key point of the target face image, in the second channel, the region to be processed in the target face image is processed based on the template material. Weighting processing is performed, so that the region to be processed in the target face image is brightened in the green channel by the second highlighting weight value. 7.根据权利要求6所述的方法,其特征在于,所述确定所述第二提亮权重值包括:7. The method according to claim 6, wherein the determining the second highlighting weight value comprises: 获取所述第一预设输入权重值、所述第二预设输入权重值、从所述模板素材提取出的绿色和在所述绿色通道内进行加权处理的第二加权系数,所述第一预设输入权重值和所述第二预设输入权重值的加合为1;Obtain the first preset input weight value, the second preset input weight value, the green color extracted from the template material, and the second weighting coefficient for weighting processing in the green channel, the first The sum of the preset input weight value and the second preset input weight value is 1; 根据所述第一预设输入权重值、所述第二预设输入权重值、从所述模板素材提取出的所述绿色和在所述绿色通道内进行加权处理的所述第二加权系数进行加权处理,确定出所述第二提亮权重值。According to the first preset input weight value, the second preset input weight value, the green color extracted from the template material, and the second weighting coefficient for weighting processing in the green channel The weighting process is performed to determine the second highlighting weight value. 8.根据权利要求1所述的方法,其特征在于,8. The method of claim 1, wherein: 所述目标区域为卧蚕所在的区域。The target area is the area where the lying silkworm is located. 9.一种人脸图像的处理装置,其特征在于,所述装置包括:获取单元、提取单元、绘制单元和加权处理单元;9. A device for processing a face image, wherein the device comprises: an acquisition unit, an extraction unit, a drawing unit, and a weighting processing unit; 所述获取目标人脸图像,以及获取模板素材;The obtaining the target face image, and obtaining the template material; 所述提取单元,用于从所述获取单元获取到的所述目标人脸图像中提取所述目标人脸图像的关键点数据;The extraction unit is configured to extract the key point data of the target face image from the target face image obtained by the acquisition unit; 所述绘制单元,用于通过预设方式将所述获取单元获取到的所述模板素材绘制至空白纹理中,使得所述模板素材与目标人脸图像待处理的区域相对应;the drawing unit, configured to draw the template material acquired by the acquisition unit into a blank texture in a preset manner, so that the template material corresponds to the area to be processed in the target face image; 所述加权处理单元,用于基于所述获取单元获取的所述模板素材对所述目标人脸图像待处理的区域的至少两个颜色通道进行加权处理。The weighting processing unit is configured to perform weighting processing on at least two color channels of the to-be-processed area of the target face image based on the template material obtained by the obtaining unit. 10.一种电子设备,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,其特征在于,所述处理器运行所述计算机程序以实现如权利要求1-8任一项所述的方法。10. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor runs the computer program to implement the method as claimed in the claims The method of any one of 1-8. 11.一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述程序被处理器执行实现如权利要求1-8中任一项所述的方法。11. A computer-readable storage medium on which a computer program is stored, wherein the program is executed by a processor to implement the method according to any one of claims 1-8.
CN202011401695.6A 2020-12-03 2020-12-03 Face image processing method and device, electronic equipment and storage medium Pending CN114663290A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011401695.6A CN114663290A (en) 2020-12-03 2020-12-03 Face image processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011401695.6A CN114663290A (en) 2020-12-03 2020-12-03 Face image processing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114663290A true CN114663290A (en) 2022-06-24

Family

ID=82025464

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011401695.6A Pending CN114663290A (en) 2020-12-03 2020-12-03 Face image processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114663290A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103345624A (en) * 2013-07-15 2013-10-09 武汉大学 Weighing characteristic face recognition method for multichannel pulse coupling neural network
US20140334668A1 (en) * 2013-05-10 2014-11-13 Palo Alto Research Center Incorporated System and method for visual motion based object segmentation and tracking
CN108665408A (en) * 2018-05-21 2018-10-16 北京微播视界科技有限公司 Method for regulating skin color, device and electronic equipment
CN108765272A (en) * 2018-05-31 2018-11-06 Oppo广东移动通信有限公司 Image processing method and device, electronic equipment and readable storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140334668A1 (en) * 2013-05-10 2014-11-13 Palo Alto Research Center Incorporated System and method for visual motion based object segmentation and tracking
CN103345624A (en) * 2013-07-15 2013-10-09 武汉大学 Weighing characteristic face recognition method for multichannel pulse coupling neural network
CN108665408A (en) * 2018-05-21 2018-10-16 北京微播视界科技有限公司 Method for regulating skin color, device and electronic equipment
CN108765272A (en) * 2018-05-31 2018-11-06 Oppo广东移动通信有限公司 Image processing method and device, electronic equipment and readable storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
XIAOWEI HAN: "An approach of color image mosaicking based on color vision characteristics", 《IEEE ACCESS》, 17 October 2009 (2009-10-17), pages 343 - 346, XP031622125 *
计长安: "基于灰度权重NMI的快速图像匹配", 《计算机工程》, 20 December 2007 (2007-12-20), pages 25 - 28 *

Similar Documents

Publication Publication Date Title
EP4210320A1 (en) Video processing method, terminal device and storage medium
US20210350545A1 (en) Image processing method and apparatus, and hardware apparatus
CN111784712B (en) Image processing method, device, equipment and computer readable medium
US12019669B2 (en) Method, apparatus, device, readable storage medium and product for media content processing
WO2021197024A1 (en) Video effect configuration file generation method, and video rendering method and device
US11893770B2 (en) Method for converting a picture into a video, device, and storage medium
CN114332324B (en) Image processing method, device, equipment and medium
EP4134904A1 (en) Image special effect configuration method, image recognition method, apparatuses, and electronic device
CN110427584A (en) Page generation method, device, electronic equipment and computer readable storage medium
CN112669816B (en) Model training method, voice recognition method, device, medium and equipment
WO2025011491A1 (en) Video processing method and apparatus, device, storage medium and program product
US20230043150A1 (en) Animation generation method and apparatus, electronic device, and computer-readable storage medium
CN113656128A (en) Page generation method and device and electronic equipment
CN111292245B (en) Image processing method and device
CN114663290A (en) Face image processing method and device, electronic equipment and storage medium
CN117234650A (en) Image display method and device, storage medium and electronic equipment
WO2023035973A1 (en) Video processing method and apparatus, device, and medium
CN112418233B (en) Image processing method and device, readable medium and electronic equipment
CN111583139B (en) Blush adjustment method, blush adjustment device, electronic equipment and computer readable medium
WO2021004171A1 (en) Method and apparatus for achieving water ripple image
CN111199519B (en) Method and device for generating special effect package
CN113225586A (en) Video processing method and device, electronic equipment and storage medium
CN111797932B (en) Image classification method, apparatus, device and computer readable medium
US20240311984A1 (en) Image processing method and apparatus, electronic device and storage medium
US20250217404A1 (en) Method, apparatus, device, readable storage medium and product for media content processing

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