CN114463212A - Image processing method and device, electronic device and storage medium - Google Patents
Image processing method and device, electronic device and storage medium Download PDFInfo
- Publication number
- CN114463212A CN114463212A CN202210106872.0A CN202210106872A CN114463212A CN 114463212 A CN114463212 A CN 114463212A CN 202210106872 A CN202210106872 A CN 202210106872A CN 114463212 A CN114463212 A CN 114463212A
- Authority
- CN
- China
- Prior art keywords
- image
- mask image
- area
- region
- information
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/77—Retouching; Inpainting; Scratch removal
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformations in the plane of the image
- G06T3/04—Context-preserving transformations, e.g. by using an importance map
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/20—Image enhancement or restoration using local operators
- G06T5/30—Erosion or dilatation, e.g. thinning
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/13—Edge detection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/136—Segmentation; Edge detection involving thresholding
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20212—Image combination
- G06T2207/20221—Image fusion; Image merging
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30196—Human being; Person
- G06T2207/30201—Face
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Image Processing (AREA)
Abstract
Description
技术领域technical field
本公开涉及计算机技术领域,尤其涉及一种图像处理方法及装置、电子设备和存储介质。The present disclosure relates to the field of computer technologies, and in particular, to an image processing method and apparatus, an electronic device, and a storage medium.
背景技术Background technique
目前对于人脸的美化,主要多集中在全脸的美白、瑕疵修复、局部器官的形状调整以及妆容效果叠加等处理,对局部器官的一些细节化的妆容处理,还很难达到理想的效果。At present, the beautification of the human face mainly focuses on the whitening of the whole face, the repair of blemishes, the shape adjustment of local organs, and the superposition of makeup effects.
发明内容SUMMARY OF THE INVENTION
根据本公开的第一方面,提供了一种图像处理方法,包括:According to a first aspect of the present disclosure, an image processing method is provided, comprising:
确定人脸图像的第一掩码图像和第二掩码图像,所述第一掩码图像用于表征所述人脸图像的第一部位区域,所述第二掩码图像用于表征所述人脸图像的第二部位区域,所述第二部位区域与所述第一部位区域至少部分不同;Determine a first mask image and a second mask image of the face image, the first mask image is used to characterize the first part region of the face image, and the second mask image is used to characterize the a second part area of the face image, the second part area is at least partially different from the first part area;
获取唇部处理信息,所述唇部处理信息中包括区域信息和美化参数信息,所述区域信息用于指示所述第二部位区域的范围,所述美化参数信息用于指示所述第二部位区域的美化参数;Acquire lip processing information, where the lip processing information includes area information and beautification parameter information, the area information is used to indicate the range of the second part area, and the beautification parameter information is used to indicate the second part The beautification parameters of the area;
根据所述区域信息和所述第一掩码图像调整所述第二掩码图像中第二部位区域的范围;Adjust the range of the second part region in the second mask image according to the region information and the first mask image;
根据所述美化参数信息和调整后的所述第二掩码图像对所述人脸图像进行美化处理,得到所述第二部位区域颜色被调整的目标图像。The face image is beautified according to the beautification parameter information and the adjusted second mask image, to obtain a target image in which the color of the second part region is adjusted.
在一种可能的实现方式中,所述根据所述区域信息和所述第一掩码图像调整所述第二掩码图像中第二部位区域的范围包括:In a possible implementation manner, the adjusting the range of the second part region in the second mask image according to the region information and the first mask image includes:
根据所述区域信息和所述第一掩码图像,对所述第二掩码图像进行图像腐蚀操作,调整所述第二部位区域的范围;在所述图像腐蚀过程中,所述第二部位区域与所述第一部位区域的至少部分区域重合。According to the area information and the first mask image, an image erosion operation is performed on the second mask image to adjust the range of the second part area; during the image erosion process, the second part The area coincides with at least a part of the first part area.
在一种可能的实现方式中,所述根据所述区域信息和所述第一掩码图像,对所述第二掩码图像进行图像腐蚀操作,调整所述第二部位区域的范围包括:In a possible implementation manner, performing an image erosion operation on the second mask image according to the region information and the first mask image, and adjusting the range of the second part region includes:
根据所述第一掩码图像,由所述第二掩码图像中第二部位区域的第一边缘向第二边缘进行图像腐蚀,直到满足所述区域信息对应的调整条件。According to the first mask image, image erosion is performed from the first edge of the second part region in the second mask image to the second edge until the adjustment condition corresponding to the region information is satisfied.
在一种可能的实现方式中,所述区域信息对应的调整条件为当前第二部位区域与原始第二部位区域的比值为所述区域信息的值。In a possible implementation manner, the adjustment condition corresponding to the area information is that the ratio of the current second part area to the original second part area is the value of the area information.
在一种可能的实现方式中,所述根据所述第一掩码图像,由所述第二掩码图像中第二部位区域的第一边缘向第二边缘进行图像腐蚀包括:In a possible implementation manner, the performing image erosion from the first edge to the second edge of the second part region in the second mask image according to the first mask image includes:
由所述第二部位区域的第一边缘开始向第二边缘依次确定目标像素;Determining target pixels sequentially from the first edge of the second part region to the second edge;
根据所述目标像素在所述第二掩码图像中的位置确定目标区域;Determine the target area according to the position of the target pixel in the second mask image;
根据所述第一掩码图像在所述目标区域中每个像素的像素值确定所述第二掩码图像中的参考像素;Determine the reference pixel in the second mask image according to the pixel value of each pixel in the target area of the first mask image;
根据所述第二掩码图像中所述参考像素中的像素值更新所述目标像素的像素值。The pixel value of the target pixel is updated according to the pixel value in the reference pixel in the second mask image.
在一种可能的实现方式中,所述根据所述第一掩码图像在所述目标区域中每个像素的像素值确定所述第二掩码图像中的参考像素包括:In a possible implementation manner, the determining the reference pixel in the second mask image according to the pixel value of each pixel of the first mask image in the target area includes:
获取所述第一掩码图像在所述目标区域中每个像素的像素值;obtaining the pixel value of each pixel of the first mask image in the target area;
根据所述像素值大于像素阈值的像素在所述第一掩码图像中的位置在所述第二掩码图像中确定参考像素。A reference pixel is determined in the second mask image according to the position of the pixel whose pixel value is greater than a pixel threshold in the first mask image.
在一种可能的实现方式中,所述确定人脸图像的第一掩码图像包括:In a possible implementation manner, the determining the first mask image of the face image includes:
确定第一参考掩码图像,所述第一参考掩码图像用于表征所述第一部位区域预测形状;determining a first reference mask image, the first reference mask image being used to characterize the predicted shape of the first part region;
识别所述人脸图像中的第一部位区域;Identify the first part region in the face image;
根据所述第一部位区域与所述第一参考掩码图像生成第一掩码图像。A first mask image is generated according to the first part region and the first reference mask image.
在一种可能的实现方式中,所述确定人脸图像的第二掩码图像包括:In a possible implementation manner, the determining the second mask image of the face image includes:
确定第二参考掩码图像,所述第二参考掩码图像用于表征所述第一部位区域的边缘预测形状;determining a second reference mask image, the second reference mask image being used to characterize the edge prediction shape of the first part region;
识别所述人脸图像中的第一部位区域;Identify the first part region in the face image;
根据所述第一部位区域与所述第二参考掩码图像生成第二掩码图像。A second mask image is generated according to the first part region and the second reference mask image.
在一种可能的实现方式中,所述获取唇部处理信息包括:In a possible implementation manner, the acquiring lip processing information includes:
显示包括区域调整控件和颜色调整控件的唇部编辑页面;Displays a lip editing page including area adjustment controls and color adjustment controls;
响应于用户触发所述区域调整控件和颜色调整控件,分别生成对应的区域信息和美化参数信息;In response to the user triggering the area adjustment control and the color adjustment control, corresponding area information and beautification parameter information are generated respectively;
根据所述区域信息和美化参数信息确定唇部处理信息。Lip treatment information is determined according to the area information and the beautification parameter information.
在一种可能的实现方式中,所述根据所述美化参数信息和调整后的所述第二掩码图像对所述人脸图像进行颜色编辑,得到所述第二部位区域颜色被调整的目标图像包括:In a possible implementation manner, the color editing is performed on the face image according to the beautification parameter information and the adjusted second mask image, so as to obtain a target whose color of the second part region is adjusted Images include:
根据所述美化参数信息和调整后的所述第二掩码图像生成美化图像,所述美化图像为在所述第二部位区域中填充所述美化参数信息表征颜色的图像;Generate a beautification image according to the beautification parameter information and the adjusted second mask image, where the beautification image is an image filled with the beautification parameter information to represent a color in the second part area;
对所述美化图像与所述人脸图像进行图像融合,得到所述第二部位区域颜色被调整的目标图像。Perform image fusion on the beautified image and the face image to obtain a target image in which the color of the second part region is adjusted.
在一种可能的实现方式中,所述图像处理方法用于为所述人脸图像添加唇线美化效果,所述第一部位区域为唇部区域,所述第二部位区域为唇线区域。In a possible implementation manner, the image processing method is used to add a lip line beautification effect to the face image, the first part region is a lip region, and the second part region is a lip line region.
根据本公开的第二方面,提供了一种图像处理装置,包括:According to a second aspect of the present disclosure, there is provided an image processing apparatus, comprising:
图像确定模块,用于确定人脸图像的第一掩码图像和第二掩码图像,所述第一掩码图像用于表征所述人脸图像的第一部位区域,所述第二掩码图像用于表征所述人脸图像的第二部位区域,所述第二部位区域与所述第一部位区域至少部分不同;an image determination module, configured to determine a first mask image and a second mask image of the face image, the first mask image is used to represent the first part region of the face image, the second mask image the image is used to represent a second part region of the face image, and the second part region is at least partially different from the first part region;
信息获取模块,用于获取唇部处理信息,所述唇部处理信息中包括区域信息和美化参数信息;an information acquisition module for acquiring lip processing information, where the lip processing information includes area information and beautification parameter information;
范围调整模块,用于根据所述区域信息和所述第一掩码图像调整所述第二掩码图像中第二部位区域的范围;a range adjustment module, configured to adjust the range of the second part region in the second mask image according to the region information and the first mask image;
颜色调整模块,用于根据所述美化参数信息和调整后的所述第二掩码图像对所述人脸图像进行颜色编辑,得到所述第二部位区域颜色被调整的目标图像。The color adjustment module is configured to perform color editing on the face image according to the beautification parameter information and the adjusted second mask image, so as to obtain a target image in which the color of the second part region is adjusted.
在一种可能的实现方式中,所述范围调整模块包括:In a possible implementation, the range adjustment module includes:
图像腐蚀子模块,用于根据所述区域信息和所述第一掩码图像,对所述第二掩码图像进行图像腐蚀操作,调整所述第二部位区域的范围;在所述图像腐蚀过程中,所述第二部位区域与所述第一部位区域的至少部分区域重合。an image erosion sub-module, configured to perform an image erosion operation on the second mask image according to the region information and the first mask image, and adjust the range of the second part region; during the image erosion process wherein, the second part region overlaps with at least part of the first part region.
在一种可能的实现方式中,所述图像腐蚀子模块包括:In a possible implementation manner, the image erosion sub-module includes:
图像腐蚀单元,用于根据所述第一掩码图像,由所述第二掩码图像中第二部位区域的第一边缘向第二边缘进行图像腐蚀,直到满足所述区域信息对应的调整条件。an image erosion unit, configured to perform image erosion from the first edge of the second part region in the second mask image to the second edge according to the first mask image, until the adjustment conditions corresponding to the region information are satisfied .
在一种可能的实现方式中,所述区域信息对应的调整条件为当前第二部位区域与原始第二部位区域的比值为所述区域信息的值。In a possible implementation manner, the adjustment condition corresponding to the area information is that the ratio of the current second part area to the original second part area is the value of the area information.
在一种可能的实现方式中,所述图像腐蚀单元包括:In a possible implementation manner, the image erosion unit includes:
目标像素确定子单元,用于由所述第二部位区域的第一边缘开始向第二边缘依次确定目标像素;a target pixel determination subunit, configured to sequentially determine target pixels from the first edge of the second part region to the second edge;
区域确定子单元,用于根据所述目标像素在所述第二掩码图像中的位置确定目标区域;an area determination subunit, configured to determine a target area according to the position of the target pixel in the second mask image;
参考像素确定子单元,用于根据所述第一掩码图像在所述目标区域中每个像素的像素值确定所述第二掩码图像中的参考像素;a reference pixel determination subunit, configured to determine a reference pixel in the second mask image according to the pixel value of each pixel of the first mask image in the target area;
像素值更新子单元,用于根据所述第二掩码图像中所述参考像素中的像素值更新所述目标像素的像素值。A pixel value updating subunit, configured to update the pixel value of the target pixel according to the pixel value in the reference pixel in the second mask image.
在一种可能的实现方式中,所述参考像素确定子单元包括:In a possible implementation manner, the reference pixel determination subunit includes:
像素值获取子单元,用于获取所述第一掩码图像在所述目标区域中每个像素的像素值;a pixel value acquisition subunit, used for acquiring the pixel value of each pixel of the first mask image in the target area;
参考像素筛选子单元,用于根据所述像素值大于像素阈值的像素在所述第一掩码图像中的位置在所述第二掩码图像中确定参考像素。A reference pixel screening subunit, configured to determine a reference pixel in the second mask image according to the position of the pixel whose pixel value is greater than a pixel threshold in the first mask image.
在一种可能的实现方式中,所述图像确定模块包括:In a possible implementation, the image determination module includes:
第一参考图像确定子模块,用于确定第一参考掩码图像,所述第一参考掩码图像用于表征所述第一部位区域预测形状;a first reference image determination submodule, configured to determine a first reference mask image, where the first reference mask image is used to characterize the predicted shape of the first part region;
第一区域识别子模块,用于识别所述人脸图像中的第一部位区域;a first region identification submodule, used for identifying the first part region in the face image;
第一图像生成子模块,用于根据所述第一部位区域与所述第一参考掩码图像生成第一掩码图像。The first image generation sub-module is configured to generate a first mask image according to the first part region and the first reference mask image.
在一种可能的实现方式中,所述图像确定模块包括:In a possible implementation, the image determination module includes:
第二参考图像确定子模块,用于确定第二参考掩码图像,所述第二参考掩码图像用于表征所述第一部位区域的边缘预测形状;A second reference image determination submodule, configured to determine a second reference mask image, where the second reference mask image is used to characterize the edge prediction shape of the first part region;
第二区域识别子模块,用于识别所述人脸图像中的第一部位区域;The second area identification submodule is used to identify the first part area in the face image;
第二图像生成子模块,用于根据所述第一部位区域与所述第二参考掩码图像生成第二掩码图像。A second image generation sub-module, configured to generate a second mask image according to the first part region and the second reference mask image.
在一种可能的实现方式中,所述信息获取模块包括:In a possible implementation, the information acquisition module includes:
页面显示子模块,用于显示包括区域调整控件和颜色调整控件的唇部编辑页面;The page display submodule is used to display the lip editing page including the area adjustment control and the color adjustment control;
信息确定子模块,用于响应于用户触发所述区域调整控件和颜色调整控件,分别生成对应的区域信息和美化参数信息;an information determination submodule for generating corresponding area information and beautification parameter information respectively in response to the user triggering the area adjustment control and the color adjustment control;
信息生成子模块,用于根据所述区域信息和美化参数信息确定唇部处理信息。An information generation sub-module, configured to determine lip processing information according to the area information and the beautification parameter information.
在一种可能的实现方式中,所述颜色调整模块包括:In a possible implementation, the color adjustment module includes:
美化图像生成子模块,用于根据所述美化参数信息和调整后的所述第二掩码图像生成美化图像,所述美化图像为在所述第二部位区域中填充所述美化参数信息表征颜色的图像;A beautification image generation sub-module, configured to generate a beautification image according to the beautification parameter information and the adjusted second mask image, and the beautification image is to fill the beautification parameter information in the second part area to represent a color Image;
图像融合子模块,用于对所述美化图像与所述人脸图像进行图像融合,得到所述第二部位区域颜色被调整的目标图像。The image fusion sub-module is used for image fusion of the beautified image and the face image to obtain the target image with the color of the second part region adjusted.
在一种可能的实现方式中,所述图像处理方法用于为所述人脸图像添加唇线美化效果,所述第一部位区域为唇部区域,所述第二部位区域为唇线区域。In a possible implementation manner, the image processing method is used to add a lip line beautification effect to the face image, the first part region is a lip region, and the second part region is a lip line region.
根据本公开的第三方面,提供了一种电子设备,包括:处理器;用于存储处理器可执行指令的存储器;其中,所述处理器被配置为调用所述存储器存储的指令,以执行上述方法。According to a third aspect of the present disclosure, there is provided an electronic device, comprising: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to invoke the instructions stored in the memory to execute the above method.
根据本公开的第四方面,提供了一种计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令被处理器执行时实现上述方法。According to a fourth aspect of the present disclosure, there is provided a computer-readable storage medium having computer program instructions stored thereon, the computer program instructions implementing the above method when executed by a processor.
在本公开实施例中,可以通过识别人脸图像的第一部位区域和第二部位区域,并基于用户指定的区域信息和第一部位区域调节第二部位区域,得到需要进行美化编辑的区域进行美化处理。进一步地,该美化处理过程可以用于为人脸图像添加唇线美化效果,实现了对人脸图像唇部特定区域进行精确美化的效果。In the embodiment of the present disclosure, the first part region and the second part region of the face image can be identified, and the second part region can be adjusted based on the region information specified by the user and the first part region to obtain the region that needs to be beautified and edited. Beautify. Further, the beautification processing process can be used to add a lip line beautification effect to the face image, so as to achieve the effect of accurately beautifying the specific area of the lips of the face image.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,而非限制本公开。根据下面参考附图对示例性实施例的详细说明,本公开的其它特征及方面将变得清楚。It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. Other features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments with reference to the accompanying drawings.
附图说明Description of drawings
此处的附图被并入说明书中并构成本说明书的一部分,这些附图示出了符合本公开的实施例,并与说明书一起用于说明本公开的技术方案。The accompanying drawings, which are incorporated into and constitute a part of this specification, illustrate embodiments consistent with the present disclosure, and together with the description, serve to explain the technical solutions of the present disclosure.
图1示出根据本公开实施例的一种图像处理方法的流程图;FIG. 1 shows a flowchart of an image processing method according to an embodiment of the present disclosure;
图2示出根据本公开实施例的一种第一掩码图像的示意图;FIG. 2 shows a schematic diagram of a first mask image according to an embodiment of the present disclosure;
图3示出根据本公开实施例的一种第二掩码图像的示意图;3 shows a schematic diagram of a second mask image according to an embodiment of the present disclosure;
图4示出根据本公开实施例的一种唇部编辑页面的示意图;FIG. 4 shows a schematic diagram of a lip editing page according to an embodiment of the present disclosure;
图5示出根据本公开实施例的一种调整第二部位区域的示意图;FIG. 5 shows a schematic diagram of adjusting the second part area according to an embodiment of the present disclosure;
图6示出根据本公开实施例的一种图像处理装置的示意图;FIG. 6 shows a schematic diagram of an image processing apparatus according to an embodiment of the present disclosure;
图7示出根据本公开实施例的一种电子设备的示意图;FIG. 7 shows a schematic diagram of an electronic device according to an embodiment of the present disclosure;
图8示出根据本公开实施例的一种电子设备的示意图。FIG. 8 shows a schematic diagram of an electronic device according to an embodiment of the present disclosure.
具体实施方式Detailed ways
以下将参考附图详细说明本公开的各种示例性实施例、特征和方面。附图中相同的附图标记表示功能相同或相似的元件。尽管在附图中示出了实施例的各种方面,但是除非特别指出,不必按比例绘制附图。Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numbers in the figures denote elements that have the same or similar functions. While various aspects of the embodiments are shown in the drawings, the drawings are not necessarily drawn to scale unless otherwise indicated.
在这里专用的词“示例性”意为“用作例子、实施例或说明性”。这里作为“示例性”所说明的任何实施例不必解释为优于或好于其它实施例。The word "exemplary" is used exclusively herein to mean "serving as an example, embodiment, or illustration." Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments.
本文中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中术语“至少一种”表示多种中的任意一种或多种中的至少两种的任意组合,例如,包括A、B、C中的至少一种,可以表示包括从A、B和C构成的集合中选择的任意一个或多个元素。The term "and/or" in this article is only an association relationship to describe the associated objects, indicating that there can be three kinds of relationships, for example, A and/or B, it can mean that A exists alone, A and B exist at the same time, and A and B exist independently B these three cases. In addition, the term "at least one" herein refers to any combination of any one of the plurality or at least two of the plurality, for example, including at least one of A, B, and C, and may mean including from A, B, and C. Any one or more elements selected from the set of B and C.
另外,为了更好地说明本公开,在下文的具体实施方式中给出了众多的具体细节。本领域技术人员应当理解,没有某些具体细节,本公开同样可以实施。在一些实例中,对于本领域技术人员熟知的方法、手段、元件和电路未作详细描述,以便于凸显本公开的主旨。In addition, in order to better illustrate the present disclosure, numerous specific details are set forth in the following detailed description. It will be understood by those skilled in the art that the present disclosure may be practiced without certain specific details. In some instances, methods, means, components and circuits well known to those skilled in the art have not been described in detail so as not to obscure the subject matter of the present disclosure.
在一种可能的实现方式中,本公开实施例的图像处理方法可以由终端设备或服务器等电子设备执行。其中,终端设备可以为用户设备(User Equipment,UE)、移动设备、用户终端、终端、蜂窝电话、无绳电话、个人数字助理(Personal Digital Assistant,PDA)、手持设备、计算设备、车载设备、可穿戴设备等任意固定或移动终端。服务器可以为单独的服务器或多个服务器组成的服务器集群。任意电子设备均可以通过处理器调用存储器中存储的计算机可读指令的方式来实现本公开实施例的图像处理方法。In a possible implementation manner, the image processing method in the embodiment of the present disclosure may be executed by an electronic device such as a terminal device or a server. Wherein, the terminal device may be User Equipment (UE), mobile device, user terminal, terminal, cellular phone, cordless phone, Personal Digital Assistant (PDA), handheld device, computing device, in-vehicle device, mobile phone, etc. Any fixed or mobile terminal such as wearable devices. The server can be a single server or a server cluster composed of multiple servers. Any electronic device can implement the image processing method of the embodiments of the present disclosure by invoking the computer-readable instructions stored in the memory by the processor.
图1示出根据本公开实施例的一种图像处理方法的流程图,如图1所示,本公开实施例的图像处理方法可以包括以下步骤S10-S40。FIG. 1 shows a flowchart of an image processing method according to an embodiment of the present disclosure. As shown in FIG. 1 , the image processing method in the embodiment of the present disclosure may include the following steps S10-S40.
步骤S10、确定人脸图像的第一掩码图像和第二掩码图像。Step S10: Determine the first mask image and the second mask image of the face image.
在一种可能的实现方式中,人脸图像为待美化处理的图像,其中包括待处理人脸。电子设备可以通过内置或连接的图像采集装置采集得到人脸图像,或者通过其他电子设备采集后传输至当前执行图像处理方法的电子设备进行图像处理。电子设备在获取人脸图像后确定人脸图像的第一掩码图像和第二掩码图像。其中,第一掩码图像用于表征人脸图像第一部位区域,第二掩码图像用于表征人脸图像的第二部位区域。可选地,第二部位区域与第一部位区域至少部分不同,例如可以在第一部位区域内。第二部位区域的外边缘还可以跟第一部位区域的外边缘重合。例如,第一部位区域可以为人脸图像中待处理人脸的全部嘴唇所在的区域,第二部位区域可以为人脸图像中待处理人脸全部嘴唇所在区域的边缘区域。In a possible implementation manner, the face image is an image to be beautified, including the face to be processed. The electronic device can acquire a face image through a built-in or connected image acquisition device, or acquire it through other electronic devices and transmit it to the electronic device currently executing the image processing method for image processing. The electronic device determines the first mask image and the second mask image of the face image after acquiring the face image. The first mask image is used to represent the first part region of the face image, and the second mask image is used to represent the second part region of the face image. Optionally, the second site region is at least partially different from the first site region, eg may be within the first site region. The outer edge of the second part region may also coincide with the outer edge of the first part region. For example, the first part area may be the area where all the lips of the face to be processed are located in the face image, and the second part area may be the edge area of the area where all the lips of the to-be-processed face are located in the face image.
可选地,第一掩码图像和第二掩码图像可以为二值图像,第一部位区域和第二部位区域中的像素值为1,其他区域的像素值为0。为了进一步通过不同的处理强度对第一部位区域和第二部位区域中每个像素值进行图像处理,提高图像处理效果。第一掩码图像和第二掩码图像中的每个像素值还可以为0-1中间的值,用于区分第一部位区域或第二部位区域和其他区域,以及表征后续图像处理过程中的处理强度。在本公开实施例中,处理强度表征对应的美化力度。例如,在用于进行图像处理的美化参数为N时,可以通过每个像素值与美化参数N的乘积对像素值进行美化,例如通过美化参数N处理像素值为1的像素值,通过美化参数N的0.5倍处理像素值为0.5的像素值。电子设备可以通过每个像素的像素值和预设的像素阈值判断第一部位区域和第二部位区域。以预设像素阈值为0.5为例进行说明。第一掩码图像中像素值不小于0.5的像素所在的位置在第一部位区域中,像素值小于0.5的像素所在的位置在第一部位区域以外的其他区域中。第二掩码图像中不小于0.5的像素值所在的位置在第二部位区域中,小于0.5的像素值所在的位置在第二部位区域以外的其他区域中。Optionally, the first mask image and the second mask image may be binary images, the pixel value in the first part region and the second part region is 1, and the pixel value in other regions is 0. In order to further perform image processing on each pixel value in the first part region and the second part region through different processing intensities, the image processing effect is improved. Each pixel value in the first mask image and the second mask image can also be a value between 0 and 1, which is used to distinguish the first part region or the second part region and other regions, and to characterize the subsequent image processing process. processing intensity. In the embodiment of the present disclosure, the processing intensity represents the corresponding beautification intensity. For example, when the beautification parameter used for image processing is N, the pixel value can be beautified by the product of each pixel value and the beautification parameter N, for example, the pixel value with the pixel value of 1 is processed by the beautification parameter 0.5 times N handles pixel values with a pixel value of 0.5. The electronic device may determine the first part region and the second part region by the pixel value of each pixel and the preset pixel threshold. The description is given by taking the preset pixel threshold value of 0.5 as an example. In the first mask image, the positions of the pixels whose pixel values are not less than 0.5 are located in the first part region, and the positions of the pixels whose pixel values are less than 0.5 are located in other regions than the first part region. In the second mask image, the positions of pixel values not less than 0.5 are located in the second part region, and the positions of pixel values less than 0.5 are located in other regions than the second part region.
图2示出根据本公开实施例的一种第一掩码图像的示意图。如图2所示,第一掩码图像20与获取的人脸图像尺寸相同,其中包括的像素值不小于像素阈值的像素组成的第一区域21,以及包括的像素值小于像素阈值的像素组成的第二区域22。其中,第一区域21对应于人脸图像中的唇部位置,即表征人脸图像中人脸的嘴唇所在的位置。第二区域22对应于人脸图像中的唇部位置以外的其他位置,表征人脸图像中除了人脸的嘴唇所在位置的其他位置。也就是说,第一区域21即为第一掩码图像表征的第一部位区域。FIG. 2 shows a schematic diagram of a first mask image according to an embodiment of the present disclosure. As shown in FIG. 2 , the
图3示出根据本公开实施例的一种第二掩码图像的示意图。如图3所示,第二掩码图像30与获取的人脸图像尺寸相同,其中包括的像素值不小于像素阈值的像素组成的第三区域31,以及包括的像素值小于像素阈值的像素组成的第四区域32。其中,第三区域31对应于人脸图像中的唇部边缘位置,即表征人脸图像中人脸的嘴唇需要绘制唇线的位置。第四区域32对应于人脸图像中的唇部边缘位置以外的其他位置,表征人脸图像中不需要绘制唇线的位置。也就是说,第三区域31即为第二掩码图像表征的第二部位区域。可选地,第二部位区域具有内边缘33和外边缘34。FIG. 3 shows a schematic diagram of a second mask image according to an embodiment of the present disclosure. As shown in FIG. 3 , the
在一种可能的实现方式中,第一掩码图像和第二掩码图像可以根据预先确定的标准素材确定。例如,第一掩码图像的确定过程可以为先确定第一参考掩码图像,第一参考掩码图像用于表征第一部位区域预测形状,再识别人脸图像中的第一部位区域,根据第一部位区域与第一参考掩码图像生成第一掩码图像。第二掩码图像的确定过程可以为先确定第二参考掩码图像,第二参考掩码图像用于表征第一部位区域的边缘预测形状,再识别人脸图像中的第一部位区域,根据第一部位区域与第二参考掩码图像生成第二掩码图像。其中,第一参考掩码图像和/或第二参考掩码图像可以为根据模拟人脸预先设定的掩码图像素材,或者由用户根据自身需要自行上传的掩码图像素材。在本公开实施例的图像处理方法用于为人脸图像添加唇线美化效果,第一部位区域为唇部区域,第二部位区域为唇线区域的情况下,第一参考掩码图像可以为用户上传的或电子设备生成的表征唇部形状的图像,第二参考掩码图像可以为用户上传的或电子设备生成的表征唇线形状的图像。In a possible implementation manner, the first mask image and the second mask image may be determined according to predetermined standard materials. For example, the process of determining the first mask image may be to determine the first reference mask image first, the first reference mask image is used to represent the predicted shape of the first part region, and then identify the first part region in the face image, according to The first part region and the first reference mask image generate a first mask image. The process of determining the second mask image can be as follows: first determine the second reference mask image, the second reference mask image is used to represent the edge prediction shape of the first part region, and then identify the first part region in the face image, according to The first part region and the second reference mask image generate a second mask image. The first reference mask image and/or the second reference mask image may be mask image materials preset according to the simulated human face, or mask image materials uploaded by the user according to their own needs. In the case where the image processing method of the embodiment of the present disclosure is used to add a lip line beautification effect to a face image, the first part area is the lip area, and the second part area is the lip line area, the first reference mask image may be the user The image uploaded or generated by the electronic device represents the shape of the lip, and the second reference mask image may be the image uploaded by the user or generated by the electronic device to represent the shape of the lip line.
可选地,对人脸图像进行识别得到第一部位区域的方式为关键点识别,得到的第一部位区域中包括多个关键位置点,例如嘴角位置、上边缘位置、下边缘位置以及唇珠位置等。确定的第一参考掩码图像中和第二参考掩码图像中也包括多个关键位置点,可以通过第一参考掩码图像与第一部位区域进行关键位置点映射的方式确定第一掩码图像,通过第二参考掩码图像与第一部位区域进行关键位置点映射的方式确定第二掩码图像。基于关键点映射,上述方式确定的第一掩码图像和第二掩码图像能够准确的定位人脸图像中第一部位区域和第二部位区域的位置。Optionally, the method of recognizing the face image to obtain the first part area is key point recognition, and the obtained first part area includes a plurality of key position points, such as the position of the corner of the mouth, the position of the upper edge, the position of the lower edge and the lip beads. location etc. The determined first reference mask image and the second reference mask image also include multiple key position points, and the first mask can be determined by performing key position point mapping between the first reference mask image and the first part region The second mask image is determined by performing key point mapping between the second reference mask image and the first part region. Based on the key point mapping, the first mask image and the second mask image determined in the above manner can accurately locate the positions of the first part region and the second part region in the face image.
步骤S20、获取唇部处理信息。Step S20, acquiring lip processing information.
在一种可能的实现方式中,唇部处理信息中可以包括区域信息和美化参数信息,区域信息用于指示人脸图像中待美化的第二部位区域范围,美化参数信息用于指示人脸图像中待美化的第二部位区域的美化参数。美化参数可以包括任意对唇部进行美化的参数,例如颜色、亮度、对比度以及透明度等。可选地,唇部处理信息可以通过任意方式获取,例如直接接收其他电子设备发送的唇部处理信息,或者与用户通过人机交互方式确定。In a possible implementation, the lip processing information may include area information and beautification parameter information, the area information is used to indicate the range of the second part area to be beautified in the face image, and the beautification parameter information is used to indicate the face image The beautification parameters of the second part area to be beautified. The beautification parameters may include any parameters for beautifying the lips, such as color, brightness, contrast, and transparency. Optionally, the lip treatment information may be acquired in any manner, for example, directly receiving lip treatment information sent by other electronic devices, or determining it through human-computer interaction with the user.
示例性的,唇部处理信息通过与用户人机交互的方式确定的应用场景下,电子设备可以显示包括区域调整控件和颜色调整控件的唇部编辑页面。并在响应于用户触发区域调整控件和颜色调整控件,分别生成对应的区域信息和美化参数信息。根据区域信息和美化参数信息确定唇部处理信息。Exemplarily, in an application scenario where the lip processing information is determined by man-machine interaction with the user, the electronic device may display a lip editing page including a region adjustment control and a color adjustment control. And in response to the user triggering the area adjustment control and the color adjustment control, corresponding area information and beautification parameter information are respectively generated. The lip processing information is determined according to the area information and the beautification parameter information.
图4示出根据本公开实施例的一种唇部编辑页面40的示意图。在电子设备为终端设备时,唇部编辑页面40可以通过电子设备内置或连接的显示装置显示。在电子设备为服务器时,唇部编辑页面40可以通过服务器发送至终端设备,并通过终端设备的显示装置显示。如图4所示,唇部编辑页面40中包括颜色调整控件41和区域调整控件42。FIG. 4 shows a schematic diagram of a
可选地,颜色调整控件41中可以包括能够由用户通过人机交互的方式直接选中预设颜色的预设颜色控件,以及可以由用户通过人机交互的方式拖动或输入颜色值的方式确定颜色的自选颜色控件(R、G、B)。在人机交互过程中,电子设备可以接收用户过点击的方式直接选中的预设颜色控件颜色1-颜色6中的一个预设颜色。或者,还可以接收用户通过输入或拖动的方式确定在0-255之内的RGB值,得到需要的颜色。进一步地,颜色调整控件41中还包括强度调整控件(L),用于表征需要调整的颜色的强度,选值可以在0-1之间。可以根据用户通过人机交互的方式自行确定或选中的颜色和颜色强度确定美化参数信息。Optionally, the
进一步地,区域调整控件42可以包括用户能够通过人机交互的方式拖动确定调整宽度比例的拖动条,以及能够输入预期调整宽度比例的输入框。可选地,用户确定的调整宽度比例可以为一个数值,用于表征需要的第二部位区域的宽度占当前第二部位区域的比例。电子设备可以根据用户通过人机交互确定的调整宽度比例生成区域信息。可选地,电子设备可以在用户通过触发颜色调整控件41生成美化参数信息,以及触发区域调整控件42生成区域信息后,生成包括区域信息和美化参数信息的唇部处理信息。Further, the
在一种可能的实现方式中,唇部编辑页面40中还可以用于显示人脸图像43(对部分区域做遮挡处理),以及人脸图像43中的第二部位区域44,在电子设备确定唇部处理信息后根据唇部处理信息美化图像并实时显示给用户。用户可以在不满意的情况下通过人机交互的方式重新确定新的唇部处理信息。In a possible implementation manner, the
步骤S30、根据所述区域信息和所述第一掩码图像调整所述第二掩码图像中第二部位区域的范围。Step S30: Adjust the range of the second part region in the second mask image according to the region information and the first mask image.
在一种可能的实现方式中,可以基于第一掩码图像和用户确定的区域信息调整第二掩码图像,以修改第二掩码图像中表征的第二部位区域的范围。可选地,在调整前后,第二掩码图像表征的第二部位区域位置均处于第一掩码图像表征的第一部位区域中。第二掩码图像的调整过程可以通过图像腐蚀实现,图像腐蚀用于收缩或细化图像中的对象。例如可以根据区域信息和第一掩码图像,对第二掩码图像进行图像腐蚀操作,调整第二部位区域的范围。在图像腐蚀过程中,第二部位区域可以与第一部位区域的至少部分区域重合。In a possible implementation manner, the second mask image may be adjusted based on the first mask image and the region information determined by the user, so as to modify the range of the second part region represented in the second mask image. Optionally, before and after the adjustment, the position of the second part region represented by the second mask image is in the first part region represented by the first mask image. The adjustment process of the second mask image can be achieved by image erosion, which is used to shrink or refine objects in the image. For example, an image erosion operation may be performed on the second mask image according to the region information and the first mask image, so as to adjust the range of the second part region. During the image erosion process, the second site region may coincide with at least a partial region of the first site region.
在图像腐蚀过程中,区域信息和第一掩码图像均用于限定图像腐蚀范围。其中,区域信息可以用于限定调整后的第二部位区域宽度。可选地,第二部位区域为一个连续的区域,包括第一边缘和第二边缘,图像腐蚀的方向可以为从第一边缘向第二边缘方向腐蚀。即可以根据第一掩码图像,由第二掩码图像中第二部位区域的第一边缘向第二边缘进行图像腐蚀,直到满足区域信息对应的调整条件。如图3所示,第二部位区域31的第一边缘为位于内侧的内边缘33,第二部位区域32的第二边缘为位于外侧的外边缘34。可选地,在区域信息为一个数值的情况下,区域信息对应的调整条件可以为当前第二部位区域与原始第二部位区域的比值为区域信息的值。也就是说,可以通过调整区域信息缩小预设的嘴唇边缘区域。例如,当预设的第二部位区域宽度为5mm,区域信息为0.3时,图像腐蚀后得到的第二部位区域宽度为1.5mm。During the image erosion process, both the region information and the first mask image are used to define the image erosion range. The area information may be used to define the adjusted width of the second part area. Optionally, the second part region is a continuous region including the first edge and the second edge, and the direction of image erosion may be erosion from the first edge to the second edge. That is, according to the first mask image, image erosion can be performed from the first edge of the second part region in the second mask image to the second edge until the adjustment conditions corresponding to the region information are satisfied. As shown in FIG. 3 , the first edge of the
进一步地,在图像腐蚀过程中,第一掩码图像用于筛选出第二掩码图像中用于进行图像腐蚀的参考像素,再根据筛选得到的参考像素实现图像腐蚀过程。因此,根据第一掩码图像,由第二掩码图像中第二部位区域的第一边缘向第二边缘进行图像腐蚀的过程可以包括:由第二部位区域的第一边缘开始向第二边缘依次确定目标像素。根据目标像素在第二掩码图像中的位置确定目标区域。根据第一掩码图像在目标区域中每个像素的像素值确定第二掩码图像中的参考像素。根据第二掩码图像中参考像素中的像素值更新所述目标像素的像素值。例如,可以对比每个参考像素中的最小像素值,以通过第二掩码图像中每个参考像素中的最小像素值,替换目标像素的像素值。Further, in the image erosion process, the first mask image is used to filter out reference pixels used for image erosion in the second mask image, and then the image erosion process is implemented according to the filtered reference pixels. Therefore, according to the first mask image, the process of performing image erosion from the first edge to the second edge of the second part region in the second mask image may include: starting from the first edge of the second part region to the second edge The target pixels are determined in turn. The target area is determined according to the position of the target pixel in the second mask image. The reference pixel in the second mask image is determined according to the pixel value of each pixel in the target area of the first mask image. The pixel value of the target pixel is updated according to the pixel value in the reference pixel in the second mask image. For example, the minimum pixel value in each reference pixel may be compared to replace the pixel value of the target pixel by the minimum pixel value in each reference pixel in the second mask image.
在一种可能的实现方式中,目标像素的选择可以由第二部位区域位置的第一边缘开始向外顺序确定。在每次替换目标像素后,可以在第二部位区域内重新确定一个新的目标像素,再次进行图像腐蚀,直到完成图像腐蚀过程。目标区域的尺寸可以为预先确定的预设尺寸,在每一次确定目标像素后,确定该目标像素为中心、且尺寸为预设尺寸的区域为对应的目标区域。例如,当预设尺寸为3×3,且目标像素的坐标为(2,4)时,目标区域由像素(1,3)、(1,4)、(1,5)、(2,3)、(2,4)、(2,5)、(3,3)、(3,4)和(3,5)组成。In a possible implementation manner, the selection of the target pixel may be determined sequentially from the first edge of the second part region position to outward. After each replacement of the target pixel, a new target pixel can be re-determined in the second part area, and image erosion is performed again until the image erosion process is completed. The size of the target area may be a predetermined preset size. After each target pixel is determined, an area with the target pixel as the center and the size of the preset size is determined as the corresponding target area. For example, when the preset size is 3×3 and the coordinates of the target pixel are (2,4), the target area consists of pixels (1,3), (1,4), (1,5), (2,3 ), (2,4), (2,5), (3,3), (3,4) and (3,5).
进一步地,在确定目标区域后,根据第一掩码图像在目标区域中每个像素的像素值筛选得到参考像素。可选地,筛选方式可以基于预设的像素阈值实现。例如获取第一掩码图像在目标区域中每个像素的像素值,根据像素值大于像素阈值的像素在第一掩码图像中的位置在第二掩码图像中确定。以目标区域为3×3,且包括的像素坐标分别为(1,3)、(1,4)、(1,5)、(2,3)、(2,4)、(2,5)、(3,3)、(3,4)和(3,5)为例进行说明。当第一掩码图像中坐标为(1,3)、(1,4)、(1,5)、(2,3)、(2,4)、(2,5)、(3,3)、(3,4)和(3,5)的像素中的像素值分别为1、1、0.7、1、0.8、0.1、0.9、0.2和0,且预设的像素阈值为0.5时,筛选得到参考像素的坐标分别为(1,3)、(1,4)、(1,5)、(2,3)、(2,4)和(3,3)。当第二掩码图像中在上述参考像素(1,3)、(1,4)、(1,5)、(2,3)、(2,4)和(3,3)中的像素值分别为0.1、0.2、1、0.7、0.8、0和0.9时,获取其中最小值0替换目标像素(2,4)中的像素值0.8。Further, after the target area is determined, the reference pixels are obtained by screening according to the pixel value of each pixel in the target area of the first mask image. Optionally, the screening method can be implemented based on a preset pixel threshold. For example, the pixel value of each pixel in the target area of the first mask image is obtained, and the pixel value is determined in the second mask image according to the position of the pixel whose pixel value is greater than the pixel threshold in the first mask image. The target area is 3×3, and the pixel coordinates included are (1,3), (1,4), (1,5), (2,3), (2,4), (2,5) , (3,3), (3,4) and (3,5) as examples. When the coordinates in the first mask image are (1,3), (1,4), (1,5), (2,3), (2,4), (2,5), (3,3) , (3,4) and (3,5) have pixel values of 1, 1, 0.7, 1, 0.8, 0.1, 0.9, 0.2, and 0, respectively, and the preset pixel threshold is 0.5. The coordinates of the reference pixels are (1,3), (1,4), (1,5), (2,3), (2,4) and (3,3), respectively. When the pixel values in the above reference pixels (1,3), (1,4), (1,5), (2,3), (2,4) and (3,3) in the second mask image When they are 0.1, 0.2, 1, 0.7, 0.8, 0, and 0.9, respectively, obtain the minimum value of 0 to replace the pixel value 0.8 in the target pixel (2, 4).
图5示出根据本公开实施例的一种调整第二部位区域的示意图。如图2所示,在确定第二掩码图像中当前目标像素为中心的目标区域50后,还获取第一掩码图像中在目标区域位置的目标区域51。通过第一掩码图像中目标区域51中每个像素的像素值筛选得到参考像素,得到第二掩码图像中目标区域50中多个参考像素组成的图像腐蚀区域52。进一步地,通过图像腐蚀区域52中的最小值0替换目标像素中的像素值。FIG. 5 shows a schematic diagram of adjusting the second part region according to an embodiment of the present disclosure. As shown in FIG. 2 , after determining the
在根据区域信息和第一掩码图像完成图像腐蚀后,得到调整其中表征的第二部位区域后的第二掩码图像。After completing the image erosion according to the region information and the first mask image, a second mask image after adjusting the second part region represented therein is obtained.
步骤S40、根据所述美化参数信息和调整后的所述第二掩码图像对所述人脸图像进行颜色编辑,得到所述第二部位区域颜色被调整的目标图像。Step S40 , performing color editing on the face image according to the beautification parameter information and the adjusted second mask image, to obtain a target image in which the color of the second part region is adjusted.
在一种可能的实现方式中,根据区域信息和第一掩码图像调整第二掩码图像后,根据颜色编辑信息中的美化参数信息、以及调整后的第二掩码图像对人脸图像中的第二部位区域进行颜色编辑,得到目标图像。In a possible implementation manner, after adjusting the second mask image according to the region information and the first mask image, according to the beautification parameter information in the color editing information and the adjusted second mask image to the face image The second part area of is color-edited to obtain the target image.
可选地,人脸图像的调整过程可以为先根据美化参数信息和调整后的第二掩码图像生成美化图像,美化图像为在第二部位区域中填充美化参数信息表征颜色的图像。进一步地,美化图像可以为与人脸图像尺寸相同的图像,其中仅第二部位区域根据第二掩码图像中表征第二部位区域各像素的强度填充美化参数信息表征的颜色,并将其他区域设置为透明,即像素值设置为0。在得到美化图像后,对美化图像与人脸图像进行图像融合,得到第二部位区域颜色被调整的目标图像。可选地,图像融合方式可以为任意融合方式,例如正片叠底以及透明度融合等任意方式。其中,正片叠底的过程为将美化图像中的第二部位区域位置以幻灯片的形式叠放在人脸图像中的第二部位区域位置。Optionally, the adjustment process of the face image may firstly generate a beautification image according to the beautification parameter information and the adjusted second mask image, and the beautification image is an image in which the beautification parameter information is filled to represent the color in the second part region. Further, the beautification image may be an image of the same size as the face image, wherein only the second part area is filled with the color represented by the beautification parameter information according to the intensity of each pixel representing the second part area in the second mask image, and other areas are filled with the color represented by the beautification parameter information. Set to transparent, that is, the pixel value is set to 0. After the beautified image is obtained, image fusion is performed on the beautified image and the face image to obtain a target image in which the color of the second part region is adjusted. Optionally, the image fusion method can be any fusion method, such as multiplication and transparency fusion. Wherein, the process of multiplication is to superimpose the position of the second part region in the beautified image on the position of the second part region in the face image in the form of a slideshow.
本公开实施例的图像处理方法可以用于对人脸图像中人脸的唇部进行美化。例如,可以通过电子设备获取人脸图像,并对人脸图像中人脸进行特征点识别得到人脸的唇部区域。根据预设的或用户上传的第一参考掩码图像与唇部区域得到表征人脸唇部区域在人脸图像中位置的第一掩码图像,并根据预设的或用户上传的第二参考掩码图像与唇部区域得到表征人脸唇部边缘在人脸图像中位置的第二掩码图像。进一步地,电子设备通过与用户进行人机交互的方式确定指示用户希望增加唇线效果区域的区域信息,以及用于指示用户希望增加的唇线颜色、强度以及亮度等效果的美化参数信息。根据区域信息和第一掩码图像调整第二掩码图像确定最终需要增加唇线效果的区域,并根据美化参数信息和调整后的第二掩码图像得到用于美化该需要增加唇线效果的区域的美化图像,将美化图像与人脸图像进行正片叠底处理得到具有美化后唇线效果的人脸图像。The image processing method in the embodiment of the present disclosure can be used to beautify the lips of a human face in a human face image. For example, a face image can be obtained through an electronic device, and the lip region of the face can be obtained by performing feature point recognition on the face in the face image. According to the preset or user-uploaded first reference mask image and the lip region, a first mask image representing the position of the face lip region in the face image is obtained, and according to the preset or user-uploaded second reference mask image The mask image and the lip region obtain a second mask image representing the position of the lip edge of the face in the face image. Further, the electronic device determines the area information indicating that the user wishes to increase the lip line effect area, and the beautification parameter information for indicating the lip line color, intensity and brightness that the user wishes to increase by means of human-computer interaction with the user. Adjust the second mask image according to the area information and the first mask image to determine the area where the lip line effect needs to be added finally, and obtain the beautification parameter information and the adjusted second mask image for beautifying the lip line effect that needs to be added. The beautified image of the area, and the beautified image and the face image are multiplied to obtain the face image with the beautified lip line effect.
本公开实施例可以通过识别人脸图像的第一部位区域和第二部位区域,并基于用户指定的区域信息和第一部位区域调节第二部位区域,得到需要进行颜色编辑的区域进行颜色编辑。实现了对人脸图像唇部特定区域进行精确美化的效果。The embodiments of the present disclosure can identify the first part region and the second part region of the face image, and adjust the second part region based on the region information specified by the user and the first part region, so as to obtain the region that needs to be color edited for color editing. It achieves the effect of precise beautification of the specific area of the lips of the face image.
可以理解,本公开提及的上述各个方法实施例,在不违背原理逻辑的情况下,均可以彼此相互结合形成结合后的实施例,限于篇幅,本公开不再赘述。本领域技术人员可以理解,在具体实施方式的上述方法中,各步骤的具体执行顺序应当以其功能和可能的内在逻辑确定。It can be understood that the above-mentioned method embodiments mentioned in the present disclosure can be combined with each other to form a combined embodiment without violating the principle and logic. Those skilled in the art can understand that, in the above method of the specific embodiment, the specific execution order of each step should be determined by its function and possible internal logic.
此外,本公开还提供了一种图像处理装置、电子设备、计算机可读存储介质、程序,上述均可用来实现本公开提供的任一种图像处理方法,相应技术方案和描述和参见方法部分的相应记载,不再赘述。In addition, the present disclosure also provides an image processing apparatus, an electronic device, a computer-readable storage medium, and a program, all of which can be used to implement any image processing method provided by the present disclosure. Corresponding records will not be repeated.
图6示出根据本公开实施例的一种图像处理装置的示意图。如图6所示,本公开实施例的图像处理装置包括图像确定模块60、信息获取模块61、范围调整模块62和颜色调整模块63。FIG. 6 shows a schematic diagram of an image processing apparatus according to an embodiment of the present disclosure. As shown in FIG. 6 , the image processing apparatus according to the embodiment of the present disclosure includes an
图像确定模块60,用于确定人脸图像的第一掩码图像和第二掩码图像,所述第一掩码图像用于表征所述人脸图像的第一部位区域,所述第二掩码图像用于表征所述人脸图像的第二部位区域,所述第二部位区域与所述第一部位区域至少部分不同;The
信息获取模块61,用于获取唇部处理信息,所述唇部处理信息中包括区域信息和美化参数信息;The
范围调整模块62,用于根据所述区域信息和所述第一掩码图像调整所述第二掩码图像中第二部位区域的范围;a
颜色调整模块63,用于根据所述美化参数信息和调整后的所述第二掩码图像对所述人脸图像进行颜色编辑,得到所述第二部位区域颜色被调整的目标图像。The
在一种可能的实现方式中,所述范围调整模块62包括:In a possible implementation manner, the
图像腐蚀子模块,用于根据所述区域信息和所述第一掩码图像,对所述第二掩码图像进行图像腐蚀操作,调整所述第二部位区域的范围;在所述图像腐蚀过程中,所述第二部位区域与所述第一部位区域的至少部分区域重合。an image erosion sub-module, configured to perform an image erosion operation on the second mask image according to the region information and the first mask image, and adjust the range of the second part region; during the image erosion process wherein, the second part region overlaps with at least part of the first part region.
在一种可能的实现方式中,所述图像腐蚀子模块包括:In a possible implementation manner, the image erosion sub-module includes:
图像腐蚀单元,用于根据所述第一掩码图像,由所述第二掩码图像中第二部位区域的第一边缘向第二边缘进行图像腐蚀,直到满足所述区域信息对应的调整条件。an image erosion unit, configured to perform image erosion from the first edge of the second part region in the second mask image to the second edge according to the first mask image, until the adjustment conditions corresponding to the region information are satisfied .
在一种可能的实现方式中,所述区域信息对应的调整条件为当前第二部位区域与原始第二部位区域的比值为所述区域信息的值。In a possible implementation manner, the adjustment condition corresponding to the area information is that the ratio of the current second part area to the original second part area is the value of the area information.
在一种可能的实现方式中,所述图像腐蚀单元包括:In a possible implementation manner, the image erosion unit includes:
目标像素确定子单元,用于由所述第二部位区域的第一边缘开始向第二边缘依次确定目标像素;a target pixel determination subunit, configured to sequentially determine target pixels from the first edge of the second part region to the second edge;
区域确定子单元,用于根据所述目标像素在所述第二掩码图像中的位置确定目标区域;an area determination subunit, configured to determine a target area according to the position of the target pixel in the second mask image;
参考像素确定子单元,用于根据所述第一掩码图像在所述目标区域中每个像素的像素值确定所述第二掩码图像中的参考像素;a reference pixel determination subunit, configured to determine a reference pixel in the second mask image according to the pixel value of each pixel of the first mask image in the target area;
像素值更新子单元,用于根据所述第二掩码图像中所述参考像素中的像素值更新所述目标像素的像素值。A pixel value updating subunit, configured to update the pixel value of the target pixel according to the pixel value in the reference pixel in the second mask image.
在一种可能的实现方式中,所述参考像素确定子单元包括:In a possible implementation manner, the reference pixel determination subunit includes:
像素值获取子单元,用于获取所述第一掩码图像在所述目标区域中每个像素的像素值;a pixel value acquisition subunit, used for acquiring the pixel value of each pixel of the first mask image in the target area;
参考像素筛选子单元,用于根据所述像素值大于像素阈值的像素在所述第一掩码图像中的位置在所述第二掩码图像中确定参考像素。A reference pixel screening subunit, configured to determine a reference pixel in the second mask image according to the position of the pixel whose pixel value is greater than a pixel threshold in the first mask image.
在一种可能的实现方式中,所述图像确定模块60包括:In a possible implementation manner, the
第一参考图像确定子模块,用于确定第一参考掩码图像,所述第一参考掩码图像用于表征所述第一部位区域预测形状;a first reference image determination submodule, configured to determine a first reference mask image, where the first reference mask image is used to characterize the predicted shape of the first part region;
第一区域识别子模块,用于识别所述人脸图像中的第一部位区域;a first region identification submodule, used for identifying the first part region in the face image;
第一图像生成子模块,用于根据所述第一部位区域与所述第一参考掩码图像生成第一掩码图像。The first image generation sub-module is configured to generate a first mask image according to the first part region and the first reference mask image.
在一种可能的实现方式中,所述图像确定模块60包括:In a possible implementation manner, the
第二参考图像确定子模块,用于确定第二参考掩码图像,所述第二参考掩码图像用于表征所述第一部位区域的边缘预测形状;A second reference image determination submodule, configured to determine a second reference mask image, where the second reference mask image is used to characterize the edge prediction shape of the first part region;
第二区域识别子模块,用于识别所述人脸图像中的第一部位区域;The second area identification submodule is used to identify the first part area in the face image;
第二图像生成子模块,用于根据所述第一部位区域与所述第二参考掩码图像生成第二掩码图像。A second image generation sub-module, configured to generate a second mask image according to the first part region and the second reference mask image.
在一种可能的实现方式中,所述信息获取模块61包括:In a possible implementation manner, the
页面显示子模块,用于显示包括区域调整控件和颜色调整控件的唇部编辑页面;The page display submodule is used to display the lip editing page including the area adjustment control and the color adjustment control;
信息确定子模块,用于响应于用户触发所述区域调整控件和颜色调整控件,分别生成对应的区域信息和美化参数信息;an information determination submodule for generating corresponding area information and beautification parameter information respectively in response to the user triggering the area adjustment control and the color adjustment control;
信息生成子模块,用于根据所述区域信息和美化参数信息确定唇部处理信息。An information generation sub-module, configured to determine lip processing information according to the area information and the beautification parameter information.
在一种可能的实现方式中,所述颜色调整模块63包括:In a possible implementation manner, the
美化图像生成子模块,用于根据所述美化参数信息和调整后的所述第二掩码图像生成美化图像,所述美化图像为在所述第二部位区域中填充所述美化参数信息表征颜色的图像;A beautification image generation sub-module, configured to generate a beautification image according to the beautification parameter information and the adjusted second mask image, the beautification image is to fill the beautification parameter information in the second part area to represent a color Image;
图像融合子模块,用于对所述美化图像与所述人脸图像进行图像融合,得到所述第二部位区域颜色被调整的目标图像。The image fusion sub-module is used for image fusion of the beautified image and the face image to obtain the target image with the color of the second part region adjusted.
在一种可能的实现方式中,所述图像处理方法用于为所述人脸图像添加唇线美化效果,所述第一部位区域为唇部区域,所述第二部位区域为唇线区域。In a possible implementation manner, the image processing method is used to add a lip line beautification effect to the face image, the first part region is a lip region, and the second part region is a lip line region.
在一些实施例中,本公开实施例提供的装置具有的功能或包含的模块可以用于执行上文方法实施例描述的方法,其具体实现可以参照上文方法实施例的描述,为了简洁,这里不再赘述。In some embodiments, the functions or modules included in the apparatuses provided in the embodiments of the present disclosure may be used to execute the methods described in the above method embodiments. For specific implementation, reference may be made to the descriptions of the above method embodiments. For brevity, here No longer.
本公开实施例还提出一种计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令被处理器执行时实现上述方法。计算机可读存储介质可以是易失性或非易失性计算机可读存储介质。Embodiments of the present disclosure further provide a computer-readable storage medium, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the foregoing method is implemented. Computer-readable storage media can be volatile or non-volatile computer-readable storage media.
本公开实施例还提出一种电子设备,包括:处理器;用于存储处理器可执行指令的存储器;其中,所述处理器被配置为调用所述存储器存储的指令,以执行上述方法。An embodiment of the present disclosure further provides an electronic device, including: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to invoke the instructions stored in the memory to execute the above method.
本公开实施例还提供了一种计算机程序产品,包括计算机可读代码,或者承载有计算机可读代码的非易失性计算机可读存储介质,当所述计算机可读代码在电子设备的处理器中运行时,所述电子设备中的处理器执行上述方法。Embodiments of the present disclosure also provide a computer program product, including computer-readable codes, or a non-volatile computer-readable storage medium carrying computer-readable codes, when the computer-readable codes are stored in a processor of an electronic device When running in the electronic device, the processor in the electronic device executes the above method.
电子设备可以被提供为终端、服务器或其它形态的设备。The electronic device may be provided as a terminal, server or other form of device.
图7示出根据本公开实施例的一种电子设备800的示意图。例如,电子设备800可以是移动电话,计算机,数字广播终端,消息收发设备,游戏控制台,平板设备,医疗设备,健身设备,个人数字助理等终端。FIG. 7 shows a schematic diagram of an
参照图7,电子设备800可以包括以下一个或多个组件:处理组件802,存储器804,电源组件806,多媒体组件808,音频组件810,输入/输出(I/O)接口812,传感器组件814,以及通信组件816。7, an
处理组件802通常控制电子设备800的整体操作,诸如与显示,电话呼叫,数据通信,相机操作和记录操作相关联的操作。处理组件802可以包括一个或多个处理器820来执行指令,以完成上述的方法的全部或部分步骤。此外,处理组件802可以包括一个或多个模块,便于处理组件802和其他组件之间的交互。例如,处理组件802可以包括多媒体模块,以方便多媒体组件808和处理组件802之间的交互。The
存储器804被配置为存储各种类型的数据以支持在电子设备800的操作。这些数据的示例包括用于在电子设备800上操作的任何应用程序或方法的指令,联系人数据,电话簿数据,消息,图片,视频等。存储器804可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),可编程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。
电源组件806为电子设备800的各种组件提供电力。电源组件806可以包括电源管理系统,一个或多个电源,及其他与为电子设备800生成、管理和分配电力相关联的组件。
多媒体组件808包括在所述电子设备800和用户之间的提供一个输出接口的屏幕。在一些实施例中,屏幕可以包括液晶显示器(LCD)和触摸面板(TP)。如果屏幕包括触摸面板,屏幕可以被实现为触摸屏,以接收来自用户的输入信号。触摸面板包括一个或多个触摸传感器以感测触摸、滑动和触摸面板上的手势。所述触摸传感器可以不仅感测触摸或滑动动作的边界,而且还检测与所述触摸或滑动操作相关的持续时间和压力。在一些实施例中,多媒体组件808包括一个前置摄像头和/或后置摄像头。当电子设备800处于操作模式,如拍摄模式或视频模式时,前置摄像头和/或后置摄像头可以接收外部的多媒体数据。每个前置摄像头和后置摄像头可以是一个固定的光学透镜系统或具有焦距和光学变焦能力。
音频组件810被配置为输出和/或输入音频信号。例如,音频组件810包括一个麦克风(MIC),当电子设备800处于操作模式,如呼叫模式、记录模式和语音识别模式时,麦克风被配置为接收外部音频信号。所接收的音频信号可以被进一步存储在存储器804或经由通信组件816发送。在一些实施例中,音频组件810还包括一个扬声器,用于输出音频信号。
I/O接口812为处理组件802和外围接口模块之间提供接口,上述外围接口模块可以是键盘,点击轮,按钮等。这些按钮可包括但不限于:主页按钮、音量按钮、启动按钮和锁定按钮。The I/
传感器组件814包括一个或多个传感器,用于为电子设备800提供各个方面的状态评估。例如,传感器组件814可以检测到电子设备800的打开/关闭状态,组件的相对定位,例如所述组件为电子设备800的显示器和小键盘,传感器组件814还可以检测电子设备800或电子设备800一个组件的位置改变,用户与电子设备800接触的存在或不存在,电子设备800方位或加速/减速和电子设备800的温度变化。传感器组件814可以包括接近传感器,被配置用来在没有任何的物理接触时检测附近物体的存在。传感器组件814还可以包括光传感器,如互补金属氧化物半导体(CMOS)或电荷耦合装置(CCD)图像传感器,用于在成像应用中使用。在一些实施例中,该传感器组件814还可以包括加速度传感器,陀螺仪传感器,磁传感器,压力传感器或温度传感器。
通信组件816被配置为便于电子设备800和其他设备之间有线或无线方式的通信。电子设备800可以接入基于通信标准的无线网络,如无线网络(WiFi),第二代移动通信技术(2G)或第三代移动通信技术(3G),或它们的组合。在一个示例性实施例中,通信组件816经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,所述通信组件816还包括近场通信(NFC)模块,以促进短程通信。例如,在NFC模块可基于射频识别(RFID)技术,红外数据协会(IrDA)技术,超宽带(UWB)技术,蓝牙(BT)技术和其他技术来实现。
在示例性实施例中,电子设备800可以被一个或多个应用专用集成电路(ASIC)、数字信号处理器(DSP)、数字信号处理设备(DSPD)、可编程逻辑器件(PLD)、现场可编程门阵列(FPGA)、控制器、微控制器、微处理器或其他电子元件实现,用于执行上述方法。In an exemplary embodiment,
在示例性实施例中,还提供了一种非易失性计算机可读存储介质,例如包括计算机程序指令的存储器804,上述计算机程序指令可由电子设备800的处理器820执行以完成上述方法。In an exemplary embodiment, a non-volatile computer-readable storage medium, such as a
本公开涉及增强现实领域,通过获取现实环境中的目标对象的图像信息,进而借助各类视觉相关算法实现对目标对象的相关特征、状态及属性进行检测或识别处理,从而得到与具体应用匹配的虚拟与现实相结合的AR效果。示例性的,目标对象可涉及与人体相关的脸部、肢体、手势、动作等,或者与物体相关的标识物、标志物,或者与场馆或场所相关的沙盘、展示区域或展示物品等。视觉相关算法可涉及视觉定位、SLAM、三维重建、图像注册、背景分割、对象的关键点提取及跟踪、对象的位姿或深度检测等。具体应用不仅可以涉及跟真实场景或物品相关的导览、导航、讲解、重建、虚拟效果叠加展示等交互场景,还可以涉及与人相关的特效处理,比如妆容美化、肢体美化、特效展示、虚拟模型展示等交互场景。可通过卷积神经网络,实现对目标对象的相关特征、状态及属性进行检测或识别处理。上述卷积神经网络是基于深度学习框架进行模型训练而得到的网络模型。The present disclosure relates to the field of augmented reality. By acquiring image information of a target object in a real environment, various visual correlation algorithms are used to detect or identify the relevant features, states, and attributes of the target object, so as to obtain an image matching the specific application. AR effect that combines virtual and reality. Exemplarily, the target object may involve faces, limbs, gestures, movements, etc. related to the human body, or objects, markers, or sandboxes, display areas, or display items related to venues or venues. Vision-related algorithms may involve visual localization, SLAM, 3D reconstruction, image registration, background segmentation, object keypoint extraction and tracking, object pose or depth detection, etc. The specific application can not only involve interactive scenes such as navigation, navigation, explanation, reconstruction, and virtual effect overlay display related to real scenes or items, but also special effects processing related to people, such as makeup beautification, body beautification, special effects display, virtual Model display and other interactive scenarios. The relevant features, states and attributes of the target object can be detected or recognized through the convolutional neural network. The above convolutional neural network is a network model obtained by model training based on a deep learning framework.
图8示出根据本公开实施例的一种电子设备1900的示意图。例如,电子设备1900可以被提供为一服务器。参照图8,电子设备1900包括处理组件1922,其进一步包括一个或多个处理器,以及由存储器1932所代表的存储器资源,用于存储可由处理组件1922的执行的指令,例如应用程序。存储器1932中存储的应用程序可以包括一个或一个以上的每一个对应于一组指令的模块。此外,处理组件1922被配置为执行指令,以执行上述方法。FIG. 8 shows a schematic diagram of an
电子设备1900还可以包括一个电源组件1926被配置为执行电子设备1900的电源管理,一个有线或无线网络接口1950被配置为将电子设备1900连接到网络,和一个输入输出(I/O)接口1958。电子设备1900可以操作基于存储在存储器1932的操作系统,例如微软服务器操作系统(Windows ServerTM),苹果公司推出的基于图形用户界面操作系统(Mac OSXTM),多用户多进程的计算机操作系统(UnixTM),自由和开放原代码的类Unix操作系统(LinuxTM),开放原代码的类Unix操作系统(FreeBSDTM)或类似。The
在示例性实施例中,还提供了一种非易失性计算机可读存储介质,例如包括计算机程序指令的存储器1932,上述计算机程序指令可由电子设备1900的处理组件1922执行以完成上述方法。In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as
本公开可以是系统、方法和/或计算机程序产品。计算机程序产品可以包括计算机可读存储介质,其上载有用于使处理器实现本公开的各个方面的计算机可读程序指令。The present disclosure may be a system, method and/or computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for causing a processor to implement various aspects of the present disclosure.
计算机可读存储介质可以是可以保持和存储由指令执行设备使用的指令的有形设备。计算机可读存储介质例如可以是(但不限于)电存储设备、磁存储设备、光存储设备、电磁存储设备、半导体存储设备或者上述的任意合适的组合。计算机可读存储介质的更具体的例子(非穷举的列表)包括:便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、静态随机存取存储器(SRAM)、便携式压缩盘只读存储器(CD-ROM)、数字多功能盘(DVD)、记忆棒、软盘、机械编码设备、例如其上存储有指令的打孔卡或凹槽内凸起结构、以及上述的任意合适的组合。这里所使用的计算机可读存储介质不被解释为瞬时信号本身,诸如无线电波或者其他自由传播的电磁波、通过波导或其他传输媒介传播的电磁波(例如,通过光纤电缆的光脉冲)、或者通过电线传输的电信号。A computer-readable storage medium may be a tangible device that can hold and store instructions for use by the instruction execution device. The computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples (non-exhaustive list) of computer readable storage media include: portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM) or flash memory), static random access memory (SRAM), portable compact disk read only memory (CD-ROM), digital versatile disk (DVD), memory sticks, floppy disks, mechanically coded devices, such as printers with instructions stored thereon Hole cards or raised structures in grooves, and any suitable combination of the above. Computer-readable storage media, as used herein, are not to be construed as transient signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (eg, light pulses through fiber optic cables), or through electrical wires transmitted electrical signals.
这里所描述的计算机可读程序指令可以从计算机可读存储介质下载到各个计算/处理设备,或者通过网络、例如因特网、局域网、广域网和/或无线网下载到外部计算机或外部存储设备。网络可以包括铜传输电缆、光纤传输、无线传输、路由器、防火墙、交换机、网关计算机和/或边缘服务器。每个计算/处理设备中的网络适配卡或者网络接口从网络接收计算机可读程序指令,并转发该计算机可读程序指令,以供存储在各个计算/处理设备中的计算机可读存储介质中。The computer readable program instructions described herein may be downloaded to various computing/processing devices from a computer readable storage medium, or to an external computer or external storage device over a network such as the Internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and/or edge servers. A network adapter card or network interface in each computing/processing device receives computer-readable program instructions from a network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in each computing/processing device .
用于执行本公开操作的计算机程序指令可以是汇编指令、指令集架构(ISA)指令、机器指令、机器相关指令、微代码、固件指令、状态设置数据、或者以一种或多种编程语言的任意组合编写的源代码或目标代码,所述编程语言包括面向对象的编程语言—诸如Smalltalk、C++等,以及常规的过程式编程语言—诸如“C”语言或类似的编程语言。计算机可读程序指令可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络—包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。在一些实施例中,通过利用计算机可读程序指令的状态信息来个性化定制电子电路,例如可编程逻辑电路、现场可编程门阵列(FPGA)或可编程逻辑阵列(PLA),该电子电路可以执行计算机可读程序指令,从而实现本公开的各个方面。The computer program instructions for carrying out the operations of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or instructions in one or more programming languages. Source or object code written in any combination, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as the "C" language or similar programming languages. The computer readable program instructions 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 implement. 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 the Internet connect). In some embodiments, custom electronic circuits, such as programmable logic circuits, field programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), can be personalized by utilizing state information of computer readable program instructions. Computer readable program instructions are executed to implement various aspects of the present disclosure.
这里参照根据本公开实施例的方法、装置(系统)和计算机程序产品的流程图和/或框图描述了本公开的各个方面。应当理解,流程图和/或框图的每个方框以及流程图和/或框图中各方框的组合,都可以由计算机可读程序指令实现。Aspects of the present disclosure are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer readable program instructions.
这些计算机可读程序指令可以提供给通用计算机、专用计算机或其它可编程数据处理装置的处理器,从而生产出一种机器,使得这些指令在通过计算机或其它可编程数据处理装置的处理器执行时,产生了实现流程图和/或框图中的一个或多个方框中规定的功能/动作的装置。也可以把这些计算机可读程序指令存储在计算机可读存储介质中,这些指令使得计算机、可编程数据处理装置和/或其他设备以特定方式工作,从而,存储有指令的计算机可读介质则包括一个制造品,其包括实现流程图和/或框图中的一个或多个方框中规定的功能/动作的各个方面的指令。These computer readable program instructions may be provided to a processor of a general purpose computer, special purpose computer or other programmable data processing apparatus to produce a machine that causes the instructions when executed by the processor of the computer or other programmable data processing apparatus , resulting in means for implementing the functions/acts specified in one or more blocks of the flowchart and/or block diagrams. These computer readable program instructions can also be stored in a computer readable storage medium, these instructions cause a computer, programmable data processing apparatus and/or other equipment to operate in a specific manner, so that the computer readable medium storing the instructions includes An article of manufacture comprising instructions for implementing various aspects of the functions/acts specified in one or more blocks of the flowchart and/or block diagrams.
也可以把计算机可读程序指令加载到计算机、其它可编程数据处理装置、或其它设备上,使得在计算机、其它可编程数据处理装置或其它设备上执行一系列操作步骤,以产生计算机实现的过程,从而使得在计算机、其它可编程数据处理装置、或其它设备上执行的指令实现流程图和/或框图中的一个或多个方框中规定的功能/动作。Computer readable program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other equipment to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other equipment to produce a computer-implemented process , thereby causing instructions executing on a computer, other programmable data processing apparatus, or other device to implement the functions/acts specified in one or more blocks of the flowcharts and/or block diagrams.
附图中的流程图和框图显示了根据本公开的多个实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或指令的一部分,所述模块、程序段或指令的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或动作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。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 instructions, which comprises one or more functions for implementing the specified logical function(s) executable instructions. In some alternative implementations, the functions noted in the blocks may occur out of the order noted in the figures. For example, two blocks 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 actions , or can be implemented in a combination of dedicated hardware and computer instructions.
该计算机程序产品可以具体通过硬件、软件或其结合的方式实现。在一个可选实施例中,所述计算机程序产品具体体现为计算机存储介质,在另一个可选实施例中,计算机程序产品具体体现为软件产品,例如软件开发包(Software Development Kit,SDK)等等。The computer program product can be specifically implemented by hardware, software or a combination thereof. In an optional embodiment, the computer program product is embodied as a computer storage medium, and in another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (Software Development Kit, SDK), etc. Wait.
上文对各个实施例的描述倾向于强调各个实施例之间的不同之处,其相同或相似之处可以互相参考,为了简洁,本文不再赘述。The above descriptions of the various embodiments tend to emphasize the differences between the various embodiments, and the similarities or similarities can be referred to each other. For the sake of brevity, details are not repeated herein.
本领域技术人员可以理解,在具体实施方式的上述方法中,各步骤的撰写顺序并不意味着严格的执行顺序而对实施过程构成任何限定,各步骤的具体执行顺序应当以其功能和可能的内在逻辑确定。Those skilled in the art can understand that in the above method of the specific implementation, the writing order of each step does not mean a strict execution order but constitutes any limitation on the implementation process, and the specific execution order of each step should be based on its function and possible Internal logic is determined.
若本申请技术方案涉及个人信息,应用本申请技术方案的产品在处理个人信息前,已明确告知个人信息处理规则,并取得个人自主同意。若本申请技术方案涉及敏感个人信息,应用本申请技术方案的产品在处理敏感个人信息前,已取得个人单独同意,并且同时满足“明示同意”的要求。例如,在摄像头等个人信息采集装置处,设置明确显著的标识告知已进入个人信息采集范围,将会对个人信息进行采集,若个人自愿进入采集范围即视为同意对其个人信息进行采集;或者在个人信息处理的装置上,利用明显的标识/信息告知个人信息处理规则的情况下,通过弹窗信息或请个人自行上传其个人信息等方式获得个人授权;其中,个人信息处理规则可包括个人信息处理者、个人信息处理目的、处理方式以及处理的个人信息种类等信息。If the technical solution of this application involves personal information, the product applying the technical solution of this application has clearly informed the personal information processing rules and obtained the individual's voluntary consent before processing personal information. If the technical solution of the present application involves sensitive personal information, the product applying the technical solution of the present application has obtained the individual's individual consent before processing sensitive personal information, and at the same time satisfies the requirement of "express consent". For example, at the personal information collection device such as a camera, a clear and conspicuous sign is set to inform that the personal information has entered the collection range, and the personal information will be collected. If the individual voluntarily enters the collection range, it is deemed to agree to the collection of their personal information; or On the personal information processing device, if the personal information processing rules are informed by obvious signs/information, the personal authorization can be obtained by means of pop-up information or asking individuals to upload their personal information; among them, the personal information processing rules may include personal information Information processor, purpose of processing personal information, method of processing, and types of personal information processed.
以上已经描述了本公开的各实施例,上述说明是示例性的,并非穷尽性的,并且也不限于所披露的各实施例。在不偏离所说明的各实施例的范围和精神的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。本文中所用术语的选择,旨在最好地解释各实施例的原理、实际应用或对市场中的技术的改进,或者使本技术领域的其它普通技术人员能理解本文披露的各实施例。Various embodiments of the present disclosure have been described above, and the foregoing descriptions are exemplary, not exhaustive, and not limiting of the disclosed embodiments. Numerous modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein was chosen to best explain the principles of the various embodiments, the practical application or improvement over the technology in the marketplace, or to enable others of ordinary skill in the art to understand the various embodiments disclosed herein.
Claims (14)
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210106872.0A CN114463212A (en) | 2022-01-28 | 2022-01-28 | Image processing method and device, electronic device and storage medium |
PCT/CN2022/134617 WO2023142645A1 (en) | 2022-01-28 | 2022-11-28 | Image processing method and apparatus, and electronic device, storage medium and computer program product |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210106872.0A CN114463212A (en) | 2022-01-28 | 2022-01-28 | Image processing method and device, electronic device and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114463212A true CN114463212A (en) | 2022-05-10 |
Family
ID=81411321
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210106872.0A Pending CN114463212A (en) | 2022-01-28 | 2022-01-28 | Image processing method and device, electronic device and storage medium |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN114463212A (en) |
WO (1) | WO2023142645A1 (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2023142645A1 (en) * | 2022-01-28 | 2023-08-03 | 上海商汤智能科技有限公司 | Image processing method and apparatus, and electronic device, storage medium and computer program product |
WO2024174909A1 (en) * | 2023-02-24 | 2024-08-29 | 北京字跳网络技术有限公司 | Image processing method and apparatus |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117952820B (en) * | 2024-03-26 | 2024-06-21 | 杭州食方科技有限公司 | Image augmentation method, apparatus, electronic device, and computer-readable medium |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102708575A (en) * | 2012-05-17 | 2012-10-03 | 彭强 | Daily makeup design method and system based on face feature region recognition |
CN107862673A (en) * | 2017-10-31 | 2018-03-30 | 北京小米移动软件有限公司 | Image processing method and device |
CN108898546A (en) * | 2018-06-15 | 2018-11-27 | 北京小米移动软件有限公司 | Face image processing process, device and equipment, readable storage medium storing program for executing |
CN109584180A (en) * | 2018-11-30 | 2019-04-05 | 深圳市脸萌科技有限公司 | Face image processing process, device, electronic equipment and computer storage medium |
CN112308944A (en) * | 2019-07-29 | 2021-02-02 | 丽宝大数据股份有限公司 | Augmented reality display method for simulated lip makeup |
WO2021047433A1 (en) * | 2019-09-10 | 2021-03-18 | 广州华多网络科技有限公司 | Image processing method and system in live streaming |
WO2021249053A1 (en) * | 2020-06-12 | 2021-12-16 | Oppo广东移动通信有限公司 | Image processing method and related apparatus |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4519681B2 (en) * | 2004-02-26 | 2010-08-04 | 大日本印刷株式会社 | Method and apparatus for creating human lip area mask data |
CN113763286A (en) * | 2021-09-27 | 2021-12-07 | 北京市商汤科技开发有限公司 | Image processing method and device, electronic equipment and storage medium |
CN114463212A (en) * | 2022-01-28 | 2022-05-10 | 北京大甜绵白糖科技有限公司 | Image processing method and device, electronic device and storage medium |
-
2022
- 2022-01-28 CN CN202210106872.0A patent/CN114463212A/en active Pending
- 2022-11-28 WO PCT/CN2022/134617 patent/WO2023142645A1/en active Application Filing
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102708575A (en) * | 2012-05-17 | 2012-10-03 | 彭强 | Daily makeup design method and system based on face feature region recognition |
CN107862673A (en) * | 2017-10-31 | 2018-03-30 | 北京小米移动软件有限公司 | Image processing method and device |
CN108898546A (en) * | 2018-06-15 | 2018-11-27 | 北京小米移动软件有限公司 | Face image processing process, device and equipment, readable storage medium storing program for executing |
CN109584180A (en) * | 2018-11-30 | 2019-04-05 | 深圳市脸萌科技有限公司 | Face image processing process, device, electronic equipment and computer storage medium |
CN112308944A (en) * | 2019-07-29 | 2021-02-02 | 丽宝大数据股份有限公司 | Augmented reality display method for simulated lip makeup |
WO2021047433A1 (en) * | 2019-09-10 | 2021-03-18 | 广州华多网络科技有限公司 | Image processing method and system in live streaming |
WO2021249053A1 (en) * | 2020-06-12 | 2021-12-16 | Oppo广东移动通信有限公司 | Image processing method and related apparatus |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2023142645A1 (en) * | 2022-01-28 | 2023-08-03 | 上海商汤智能科技有限公司 | Image processing method and apparatus, and electronic device, storage medium and computer program product |
WO2024174909A1 (en) * | 2023-02-24 | 2024-08-29 | 北京字跳网络技术有限公司 | Image processing method and apparatus |
Also Published As
Publication number | Publication date |
---|---|
WO2023142645A1 (en) | 2023-08-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2022179026A1 (en) | Image processing method and apparatus, electronic device, and storage medium | |
US11114130B2 (en) | Method and device for processing video | |
CN110929651B (en) | Image processing method, image processing device, electronic equipment and storage medium | |
CN111783986B (en) | Network training method and device, and gesture prediction method and device | |
WO2022179025A1 (en) | Image processing method and apparatus, electronic device, and storage medium | |
CN109816764B (en) | Image generation method and device, electronic equipment and storage medium | |
CN111553864B (en) | Image restoration method and device, electronic equipment and storage medium | |
US11030733B2 (en) | Method, electronic device and storage medium for processing image | |
CN114463212A (en) | Image processing method and device, electronic device and storage medium | |
CN109840917B (en) | Image processing method and device and network training method and device | |
WO2022134390A1 (en) | Labeling method and apparatus, electronic device, and storage medium | |
CN109472738B (en) | Image illumination correction method and device, electronic equipment and storage medium | |
CN110619325B (en) | Text recognition method and device | |
KR20210064114A (en) | Image processing method and apparatus, electronic device and storage medium | |
CN110837766A (en) | Gesture recognition method, gesture processing method and device | |
WO2023051356A1 (en) | Virtual object display method and apparatus, and electronic device and storage medium | |
CN114581525A (en) | Attitude determination method and device, electronic device and storage medium | |
WO2023045941A1 (en) | Image processing method and apparatus, electronic device and storage medium | |
CN113870400A (en) | Virtual object generation method and device, electronic equipment and storage medium | |
CN110929616B (en) | Human hand identification method and device, electronic equipment and storage medium | |
CN113822798B (en) | Method and device for training generation countermeasure network, electronic equipment and storage medium | |
CN113781359B (en) | Image processing method and device, electronic equipment and storage medium | |
CN114638949A (en) | Virtual object display method and device, electronic equipment and storage medium | |
CN115205942A (en) | Expression recognition method and device, electronic equipment and storage medium | |
CN113763287A (en) | Image processing method and device, electronic equipment 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 | ||
REG | Reference to a national code |
Ref country code: HK Ref legal event code: DE Ref document number: 40067430 Country of ref document: HK |