[go: up one dir, main page]

CN107742274A - Image processing method, device, computer-readable storage medium, and electronic device - Google Patents

Image processing method, device, computer-readable storage medium, and electronic device Download PDF

Info

Publication number
CN107742274A
CN107742274A CN201711045720.XA CN201711045720A CN107742274A CN 107742274 A CN107742274 A CN 107742274A CN 201711045720 A CN201711045720 A CN 201711045720A CN 107742274 A CN107742274 A CN 107742274A
Authority
CN
China
Prior art keywords
beautification
area
image
processed
target area
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
CN201711045720.XA
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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201711045720.XA priority Critical patent/CN107742274A/en
Publication of CN107742274A publication Critical patent/CN107742274A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/04Context-preserving transformations, e.g. by using an importance map
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/80Camera processing pipelines; Components thereof
    • 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/30Subject of image; Context of image processing
    • G06T2207/30196Human being; Person
    • G06T2207/30201Face
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/168Feature extraction; Face representation

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Image Processing (AREA)
  • Image Analysis (AREA)

Abstract

本申请涉及一种图像处理方法、装置、计算机可读存储介质和电子设备。所述方法包括:获取待处理图像集合;获取所述待处理图像集合中每一张待处理图像中的目标区域,并将获取的目标区域进行分类;获取每一类目标区域对应的美颜参数,并根据所述美颜参数分别对每一类目标区域进行美颜处理。上述图像处理方法、装置、计算机可读存储介质和电子设备,提高了图像处理的效率。

The present application relates to an image processing method, device, computer-readable storage medium and electronic device. The method comprises: obtaining a set of images to be processed; obtaining a target area in each image to be processed in the set of images to be processed, and classifying the obtained target areas; obtaining beauty parameters corresponding to each type of target area, and performing beauty processing on each type of target area according to the beauty parameters. The above-mentioned image processing method, device, computer-readable storage medium and electronic device improve the efficiency of image processing.

Description

图像处理方法、装置、计算机可读存储介质和电子设备Image processing method, device, computer-readable storage medium, and electronic device

技术领域technical field

本申请涉及图像处理技术领域,特别是涉及图像处理方法、装置、计算机可读存储介质和电子设备。The present application relates to the technical field of image processing, in particular to an image processing method, device, computer-readable storage medium and electronic equipment.

背景技术Background technique

无论是在工作还是生活中,拍照都是一项必不可少的技能。为了拍出一张让人满意的照片,不仅需要在拍摄过程中对拍摄参数进行改善,还需要在拍摄完成之后对照片本身进行改善。美颜处理就是指对照片进行美化的一种方法,经过美颜处理之后,会让照片中的人物看起来更加符合人类的审美。Whether at work or in life, taking pictures is an essential skill. In order to take a satisfactory photo, it is not only necessary to improve the shooting parameters during the shooting process, but also to improve the photo itself after the shooting is completed. Beauty treatment refers to a method of beautifying photos. After beauty treatment, the characters in the photos will look more in line with human aesthetics.

发明内容Contents of the invention

本申请实施例提供一种图像处理方法、装置、计算机可读存储介质和电子设备,可以提高图像处理的效率。Embodiments of the present application provide an image processing method, device, computer-readable storage medium, and electronic device, which can improve image processing efficiency.

一种图像处理方法,所述方法包括:An image processing method, the method comprising:

获取待处理图像集合;Obtain a collection of images to be processed;

获取所述待处理图像集合中每一张待处理图像中的目标区域,并将获取的目标区域进行分类;Obtain a target area in each image to be processed in the set of images to be processed, and classify the acquired target area;

获取每一类目标区域对应的美颜参数,并根据所述美颜参数分别对每一类目标区域进行美颜处理。Acquiring beautification parameters corresponding to each type of target area, and performing beautification processing on each type of target area according to the beautification parameters.

一种图像处理装置,所述装置包括:An image processing device, the device comprising:

图像获取模块,用于获取待处理图像集合;An image acquisition module, configured to acquire a collection of images to be processed;

区域分类模块,用于获取所述待处理图像集合中每一张待处理图像中的目标区域,并将获取的目标区域进行分类;An area classification module, configured to acquire a target area in each image to be processed in the set of images to be processed, and classify the acquired target area;

美颜处理模块,用于获取每一类目标区域对应的美颜参数,并根据所述美颜参数分别对每一类目标区域进行美颜处理。The beautification processing module is configured to obtain the beautification parameters corresponding to each type of target area, and perform beautification processing on each type of target area according to the beautification parameters.

一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现如下步骤:A computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

获取待处理图像集合;Obtain a collection of images to be processed;

获取所述待处理图像集合中每一张待处理图像中的目标区域,并将获取的目标区域进行分类;Obtain a target area in each image to be processed in the set of images to be processed, and classify the acquired target area;

获取每一类目标区域对应的美颜参数,并根据所述美颜参数分别对每一类目标区域进行美颜处理。Acquiring beautification parameters corresponding to each type of target area, and performing beautification processing on each type of target area according to the beautification parameters.

一种电子设备,包括存储器及处理器,所述存储器中储存有计算机可读指令,所述指令被所述处理器执行时,使得所述处理器执行如下步骤:An electronic device, comprising a memory and a processor, wherein computer-readable instructions are stored in the memory, and when the instructions are executed by the processor, the processor is made to perform the following steps:

获取待处理图像集合;Obtain a collection of images to be processed;

获取所述待处理图像集合中每一张待处理图像中的目标区域,并将获取的目标区域进行分类;Obtain a target area in each image to be processed in the set of images to be processed, and classify the acquired target area;

获取每一类目标区域对应的美颜参数,并根据所述美颜参数分别对每一类目标区域进行美颜处理。Acquiring beautification parameters corresponding to each type of target area, and performing beautification processing on each type of target area according to the beautification parameters.

上述图像处理方法、装置、计算机可读存储介质和电子设备,根据获取的待处理图像集合获取目标区域,然后将目标区域进行分类,再根据分类后的目标区域进行批量地美颜处理,提高了图像处理的效率。The above image processing method, device, computer-readable storage medium, and electronic device obtain target areas according to the acquired image collection to be processed, then classify the target areas, and perform beauty treatment in batches according to the classified target areas, thereby improving the Image processing efficiency.

附图说明Description of drawings

为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present application. Those skilled in the art can also obtain other drawings based on these drawings without creative work.

图1为一个实施例中图像处理方法的应用环境图;Fig. 1 is an application environment diagram of an image processing method in an embodiment;

图2为一个实施例中图像处理方法的流程图;Fig. 2 is a flowchart of an image processing method in an embodiment;

图3为另一个实施例中图像处理方法的流程图;Fig. 3 is the flowchart of image processing method in another embodiment;

图4为另一个实施例中图像处理方法的流程图;Fig. 4 is the flowchart of image processing method in another embodiment;

图5为一个实施例中获取深度信息的原理图;Fig. 5 is a schematic diagram of obtaining depth information in an embodiment;

图6为又一个实施例中图像处理方法的流程图;Fig. 6 is the flow chart of image processing method in another embodiment;

图7为一个实施例中图像处理装置的结构示意图;Fig. 7 is a schematic structural diagram of an image processing device in an embodiment;

图8为一个实施例中图像处理电路的示意图。Fig. 8 is a schematic diagram of an image processing circuit in one embodiment.

具体实施方式Detailed ways

为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。In order to make the purpose, technical solution and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present application, and are not intended to limit the present application.

图1为一个实施例中图像处理方法的应用环境图。如图1所示,该应用环境中包括用户终端102和服务器104。用户终端102中可以用于采集待处理图像,生成待处理图像集合,然后将待处理图像集合发送到服务器104中。服务器104接收到待处理图像集合之后,获取待处理图像集合中每一张待处理图像中的目标区域,将目标区域进行分类,然后获取每一类目标区域对应的美颜参数,并根据美颜参数对目标区域进行美颜处理。最后服务器104将美颜处理后的待处理图像集合返回给用户终端102。其中,用户终端102是处于计算机网络最外围,主要用于输入用户信息以及输出处理结果的电子设备,例如可以是个人电脑、移动终端、个人数字助理、可穿戴电子设备等。服务器104是用于响应服务请求,同时提供计算服务的设备,例如可以是一台或者多台计算机。可以理解的是,在本申请提供的其他实施例中,该图像处理方法的应用环境中可以只包括用户终端102,即用户终端102用于采集待处理图像,并将待处理图像集合中的待处理图像进行美颜处理。Fig. 1 is an application environment diagram of an image processing method in an embodiment. As shown in FIG. 1 , the application environment includes a user terminal 102 and a server 104 . The user terminal 102 may be used to collect images to be processed, generate a set of images to be processed, and then send the set of images to be processed to the server 104 . After the server 104 receives the set of images to be processed, it acquires the target area in each image to be processed in the set of images to be processed, classifies the target areas, and then acquires the beauty parameters corresponding to each type of target area, and according to the beauty parameters to perform beautification on the target area. Finally, the server 104 returns the image set to be processed after the beautification process to the user terminal 102 . Among them, the user terminal 102 is an electronic device located at the outermost edge of the computer network, mainly used for inputting user information and outputting processing results, such as a personal computer, a mobile terminal, a personal digital assistant, a wearable electronic device, and the like. The server 104 is a device for responding to service requests and providing computing services, such as one or more computers. It can be understood that, in other embodiments provided by this application, the application environment of the image processing method may only include the user terminal 102, that is, the user terminal 102 is used to collect images to be processed, and to Process images for beautification.

图2为一个实施例中图像处理方法的流程图。如图2所示,该图像处理方法包括步骤202至步骤206。其中:Fig. 2 is a flowchart of an image processing method in an embodiment. As shown in FIG. 2 , the image processing method includes steps 202 to 206 . in:

步骤202,获取待处理图像集合。Step 202, acquiring a set of images to be processed.

在一个实施例中,待处理图像是指待处理图像集合中需要进行美颜处理的图像。待处理图像可以是由移动终端进行采集的。移动终端上安装有可以用于拍摄的摄像头,用户可以通过移动终端发起拍照指令,移动终端在检测到拍照指令之后,通过摄像头采集拍摄图像。移动终端会将采集的图像进行存储,形成一个图像集合。可以理解的是,待处理图像还可以是通过其他途径获取的,在此不做限定。例如,待处理图像还可以是从网页中下载的,或者是从外接存储设备中导入的等等。获取待处理图像集合具体可以包括:接收用户输入的美颜指令,并根据美颜指令获取待处理图像集合,其中美颜指令中包含图像标识。图像标识是指区分不同待处理图像的唯一标识,根据图像标识获取待处理图像。例如,图像标识可以是图像名称、图像编码、图像存储地址等中的一种或多种。具体地,移动终端在获取到待处理图像集合之后,可以在移动终端本地进行美颜处理,也可以将待处理图像集合发送至服务器进行美颜处理。In one embodiment, the image to be processed refers to an image in the image set to be processed that needs to be beautified. The image to be processed may be collected by the mobile terminal. A camera that can be used for shooting is installed on the mobile terminal, and the user can initiate a photographing instruction through the mobile terminal. After detecting the photographing instruction, the mobile terminal collects and shoots an image through the camera. The mobile terminal will store the collected images to form an image collection. It can be understood that the image to be processed may also be acquired through other means, which is not limited here. For example, the image to be processed may also be downloaded from a webpage, or imported from an external storage device, and so on. Acquiring a set of images to be processed may specifically include: receiving a beautification command input by a user, and obtaining a set of images to be processed according to the beautification command, wherein the beautification command includes an image identifier. The image identification refers to a unique identification for distinguishing different images to be processed, and the image to be processed is obtained according to the image identification. For example, the image identifier may be one or more of image name, image code, image storage address, and the like. Specifically, after the mobile terminal acquires the set of images to be processed, it may perform beautification processing locally on the mobile terminal, or may send the set of images to be processed to the server for beautification processing.

步骤204,获取待处理图像集合中每一张待处理图像中的目标区域,并将获取的目标区域进行分类。Step 204, acquire the target area in each image to be processed in the image set to be processed, and classify the acquired target area.

美颜处理就是指对照片进行美化的一种方法。例如,对图像中的人像进行美白、磨皮处理,也可以是指对人像进行美妆、瘦脸、瘦身等处理。而进行美颜处理一般只需要对图像中的某个区域进行处理,例如美白处理可以只是针对皮肤区域进行处理,瘦脸处理可以只是针对人脸区域进行的处理。目标区域就是指待处理图像中需要进行美颜处理的区域。例如,目标区域可以是指人脸区域、人像区域、皮肤区域、嘴唇区域等,在此不做限定。Beautification refers to a method of beautifying photos. For example, performing whitening and skin smoothing treatments on the portraits in the image may also refer to performing cosmetic, face-lifting, and body-slimming treatments on the portraits. The beauty treatment generally only needs to process a certain area in the image, for example, the whitening process can only be processed on the skin area, and the face thinning process can only be processed on the human face area. The target area refers to the area in the image to be processed that needs to be beautified. For example, the target area may refer to a face area, a portrait area, a skin area, a lip area, etc., which is not limited here.

遍历待处理图像集合中的每一张待处理图像,提取待处理图像中的目标区域。待处理图像中的目标区域可以为一个或多个,例如待处理图像中可以有一张人脸,也可以有多张人脸,将人脸所在的区域作为目标区域。可以理解的是,待处理图像中也可以不存在目标区域,不存在目标区域的待处理图像不需要进行美颜处理。待处理图像中的目标区域可以通过区域标记进行获取,也可以直接在待处理图像中进行检测得到。区域标记是指待处理图像中用于表示目标区域的范围的标记,例如在待处理图像中用红色矩形框将目标区域进行标记,该红色矩形框中的区域就认为是目标区域。将待处理图像中的目标区域单独提取出来,并与待处理图像的图像标识和位置坐标建立对应关系,如果一张待处理图像中存在多个目标区域,则将每个目标区域单独与图像标识和位置坐标建立对应关系。其中,位置坐标是指表示目标区域在待处理图像中的位置的坐标,例如可以是目标区域中心位置在待处理图像中的位置的坐标,也可以是左上角位置在待处理图像中的位置的坐标。对目标区域处理完之后,通过图像标识查找对应的待处理图像,然后通过位置坐标查找该目标区域在该待处理图像中的具体位置,将该目标区域进行还原。Each image to be processed in the image set to be processed is traversed, and a target area in the image to be processed is extracted. There may be one or more target areas in the image to be processed. For example, there may be one human face or multiple human faces in the image to be processed, and the area where the human face is located is used as the target area. It can be understood that the target area may not exist in the image to be processed, and the image to be processed without the target area does not need to be beautified. The target area in the image to be processed can be obtained by region marking, or directly detected in the image to be processed. The area mark refers to a mark used to indicate the range of the target area in the image to be processed. For example, the target area is marked with a red rectangular frame in the image to be processed, and the area in the red rectangular frame is considered as the target area. Separately extract the target area in the image to be processed, and establish a corresponding relationship with the image identification and position coordinates of the image to be processed. If there are multiple target areas in an image to be processed, each target area is individually associated with the image identification Establish a corresponding relationship with the position coordinates. Wherein, the position coordinate refers to the coordinate representing the position of the target area in the image to be processed, for example, it may be the coordinate of the position of the center of the target area in the image to be processed, or the position of the upper left corner position in the image to be processed coordinate. After the target area is processed, the corresponding image to be processed is found through the image identification, and then the specific position of the target area in the image to be processed is found through the position coordinates, and the target area is restored.

在一个实施例中,将待处理图像集合中的目标区域都提取出来之后,可以形成一个目标区域集合,然后可以对该目标区域集合中的目标区域进行聚类处理,对目标区域进行分类。具体地,首先提取目标区域的聚类特征,然后根据聚类特征进行聚类处理,从而对目标区域进行分类。例如,提取的目标区域为人脸区域,就可以根据不同人的人脸进行分组。假设提取的人脸区域包括张三的人脸和李四的人脸,那么分类之后就会将张三的人脸分到同一类,李四的人脸分到同一类。可以理解的是,在本实施例中并不会对分类的标准做限定,例如还可以将人脸根据性别进行分类,也可以根据年龄分类。In one embodiment, after all the target areas in the image set to be processed are extracted, a target area set can be formed, and then the target areas in the target area set can be clustered to classify the target areas. Specifically, firstly, the clustering features of the target area are extracted, and then clustering is performed according to the clustering features, so as to classify the target area. For example, if the extracted target area is a human face area, it can be grouped according to the faces of different people. Assuming that the extracted face area includes Zhang San's face and Li Si's face, then after classification, Zhang San's face will be classified into the same class, and Li Si's face will be classified into the same class. It can be understood that, in this embodiment, there is no limitation on classification criteria, for example, human faces may also be classified according to gender, or according to age.

步骤206,获取每一类目标区域对应的美颜参数,并根据美颜参数分别对每一类目标区域进行美颜处理。Step 206, acquiring the beautification parameters corresponding to each type of target area, and performing beautification processing on each type of target area according to the beautification parameters.

在本申请提供的实施例中,将目标区域的类型与美颜参数建立一一对应的关系,将目标区域进行分类之后,根据目标区域的类型获取对应的美颜参数,然后根据获取的美颜参数对目标区域进行处理。例如,将人脸区域根据性别进行分类,将男性对应的人脸进行磨皮处理,将女性对应的人脸进行磨皮、美白和美妆处理。一般地,图像采集装置采集的图像是由若干个像素点构成的,每个像素点可以由多个颜色通道构成,每个颜色通道表示一个颜色分量。例如,图像可以由RGB(Red Green Blue,红,绿,蓝)三通道构成,也可以是由HSV(Hue Saturation Value,色调,饱和度,明度)三通道构成,还可以是由CMY(CyanMagenta Yellow,洋红,青,黄)三通道构成。则在对图像进行美颜处理的时候,可以分别对图像的各个颜色通道进行美颜处理,每个颜色通道的处理可以不相同。具体地,可以获取每一类目标区域对应的各个颜色通道的美颜参数,并根据美颜参数对目标区域的各个颜色通道进行美颜处理。In the embodiment provided in this application, a one-to-one correspondence is established between the type of the target area and the beautification parameters, and after the target area is classified, the corresponding beautification parameters are obtained according to the type of the target area, and then parameter to process the target region. For example, the face area is classified according to gender, the faces corresponding to men are subjected to skin smoothing, and the faces corresponding to women are subjected to skin grinding, whitening and cosmetic treatment. Generally, an image captured by an image capture device is composed of several pixels, and each pixel may be composed of multiple color channels, and each color channel represents a color component. For example, an image can be composed of three channels of RGB (Red Green Blue, red, green, blue), or it can be composed of three channels of HSV (Hue Saturation Value, hue, saturation, lightness), or it can be composed of CMY (CyanMagenta Yellow , magenta, cyan, yellow) composed of three channels. Then, when the image is beautified, each color channel of the image may be beautified separately, and the processing of each color channel may be different. Specifically, the beautification parameters of each color channel corresponding to each type of target area may be obtained, and beautification processing is performed on each color channel of the target area according to the beautification parameters.

可以理解的是,在对目标区域进行处理的过程中,可以直接在待处理图像中将目标区域进行处理,也可以将目标区域单独提取出来,并将提取出来的目标区域进行美颜处理,处理完成之后将目标区域与待处理图像进行合成,得到中的美颜图像。It can be understood that, in the process of processing the target area, the target area can be directly processed in the image to be processed, or the target area can be extracted separately, and the extracted target area can be beautified. After completion, the target area is synthesized with the image to be processed to obtain the beautification image in the image.

上述实施例提供的图像处理方法,根据获取的待处理图像集合获取目标区域,然后将目标区域进行分类,再根据分类后的目标区域获取美颜参数,并根据美颜参数对目标区域进行美颜处理。这样可以将待处理图像集合中的目标区域进行批量地美颜处理,提高了图像处理的效率。In the image processing method provided by the above embodiment, the target area is obtained according to the acquired image set to be processed, and then the target area is classified, and then the beautification parameter is obtained according to the classified target area, and the target area is beautified according to the beautification parameter deal with. In this way, the target areas in the image set to be processed can be beautified in batches, which improves the efficiency of image processing.

图3为另一个实施例中图像处理方法的流程图。如图3所示,该图像处理方法包括步骤302至步骤308。其中:Fig. 3 is a flowchart of an image processing method in another embodiment. As shown in FIG. 3 , the image processing method includes step 302 to step 308 . in:

步骤302,获取待处理图像集合。Step 302, acquiring a set of images to be processed.

待处理图像集合是由多张待处理图像构成的集合,待处理图像集合中可以包含一张或多张待处理图像。若在服务器上进行美颜处理,则各个移动终端可以将待处理图像集合发送到服务器,服务器在接收到该待处理图像集合之后,对待处理图像集合中的待处理图像进行美颜处理。移动终端发送待处理图像集合时,同时发送对应的终端标识,服务器处理完成之后,根据终端标识查找对应的移动终端,把处理完成之后的待处理图像集合发送到移动终端。其中,终端标识是指用户终端的唯一标识。例如,终端标识可以是IP(InternetProtocol,网络之间互连的协议)地址、MAC(Media Access Control,媒体访问控制)地址等中的至少一种。The set of images to be processed is a set of multiple images to be processed, and the set of images to be processed may contain one or more images to be processed. If the beautification process is performed on the server, each mobile terminal can send the image set to be processed to the server, and the server performs beautification processing on the images to be processed in the image set to be processed after receiving the image set to be processed. When the mobile terminal sends the image set to be processed, it also sends the corresponding terminal ID. After the server completes the processing, it searches for the corresponding mobile terminal according to the terminal ID, and sends the processed image set to the mobile terminal. Wherein, the terminal identifier refers to a unique identifier of the user terminal. For example, the terminal identifier may be at least one of an IP (Internet Protocol, protocol for interconnection between networks) address, a MAC (Media Access Control, media access control) address, and the like.

步骤304,获取待处理图像集合中每一张待处理图像中的人脸区域。Step 304, acquiring the face area in each image to be processed in the image set to be processed.

在一个实施例中,人脸区域是指待处理图像中人物的人脸所在的区域。不难理解,待处理图像是由若干个像素点组成,人脸区域是由待处理图像中人脸对应的像素点所构成的区域。遍历待处理图像集合中的每一张待处理图像,然后检测待处理图像中的人脸区域。一般来说,待处理图像中可以包含一个或多个人脸区域,每一个人脸区域都是一个独立的连通区域,将这些独立的人脸区域提取出来,分别进行美颜处理。待处理图像中也可以不存在人脸区域,若不存在人脸区域,则待处理图像不做处理。具体可以通过人脸检测算法获取待处理图像的人脸区域,人脸检测算法可以包括基于几何特征的检测方法、特征脸检测方法、线性判别分析方法、基于隐马尔柯夫模型检测方法等,在此不做限定。In one embodiment, the face area refers to the area where the face of the person in the image to be processed is located. It is not difficult to understand that the image to be processed is composed of several pixels, and the face area is an area composed of pixels corresponding to the face in the image to be processed. Each image to be processed in the image set to be processed is traversed, and then the face area in the image to be processed is detected. Generally speaking, the image to be processed may contain one or more face regions, and each face region is an independent connected region, and these independent face regions are extracted for beauty treatment respectively. There may also be no face area in the image to be processed, and if there is no face area, the image to be processed will not be processed. Specifically, the face area of the image to be processed can be obtained through the face detection algorithm. The face detection algorithm can include detection methods based on geometric features, eigenface detection methods, linear discriminant analysis methods, and detection methods based on hidden Markov models. This is not limited.

步骤306,获取人脸区域对应的人物属性特征,并根据人物属性特征对人脸区域进行分类。Step 306, acquire the character attribute features corresponding to the face area, and classify the face area according to the character attribute features.

在本申请提供的实施例中,人物属性特征是指表示人脸区域对应的人物属性的特征,例如人物属性特征可以是指性别特征、年龄特征、人种特征等中的一种或多种。在获取到人脸区域之后,可以根据人脸识别算法识别人脸区域对应的人物属性特征,然后根据人物属性特征将人脸区域进行分类。人脸识别算法可以是PCA(principal componentanalysis,基于主成分分析)人脸识别算法和基于KL(Karhuner-Loeve,卡洛南-洛伊)变换的人脸识别算法,在此不做限定。可以理解的是,待处理图像中的人脸区域的面积大小不一样,一般需要突出的主人脸的面积比较大,路人的人脸面积都比较小。因此在本实施例中,可以获取人脸区域对应的区域面积,若区域面积小于面积阈值,则不进行美颜处理,只将区域面积大于面积阈值的人脸区域进行美颜处理。则在步骤306之前还可以包括:获取区域面积大于面积阈值的人脸区域。In the embodiments provided in this application, the character attribute feature refers to the feature representing the character attribute corresponding to the face area, for example, the character attribute feature may refer to one or more of gender characteristics, age characteristics, ethnic characteristics, and the like. After the face area is obtained, the character attribute features corresponding to the face area can be identified according to the face recognition algorithm, and then the face areas are classified according to the character attribute features. The face recognition algorithm may be a PCA (principal component analysis, based on principal component analysis) face recognition algorithm and a face recognition algorithm based on KL (Karhuner-Loeve, Karonen-Loeve) transformation, which is not limited here. It is understandable that the size of the face area in the image to be processed is different. Generally, the area of the main face that needs to be highlighted is relatively large, and the area of the face of passers-by is relatively small. Therefore, in this embodiment, the area area corresponding to the face area can be obtained. If the area area is smaller than the area threshold, the beautification process will not be performed, and only the face area whose area area is larger than the area threshold value will be beautified. Then, before step 306, the method may further include: acquiring a face area whose area area is greater than the area threshold.

步骤308,获取每一类人脸区域对应的美颜参数,并根据美颜参数分别对每一类人脸区域进行美颜处理。Step 308, acquiring the beautification parameters corresponding to each type of face area, and performing beautification processing on each type of face area according to the beautification parameters.

美颜参数是指对图像进行美颜处理的参数,根据美颜参数对图像进行美颜处理。将人脸区域进行分类之后,获取每一类人脸区域对应的美颜参数,然后根据美颜参数对人脸区域进行美颜处理。例如,人脸区域可以幼年、青年、中老年等三种类型,分别对不同类型的人脸区域进行不同的美颜处理。对幼年的人脸区域进行大眼处理,对青年的人脸区域进行美白处理,对中老年的人脸区域进行磨皮处理。The beautification parameter refers to a parameter for performing beautification processing on the image, and the beautification processing is performed on the image according to the beautification parameter. After the face area is classified, the beautification parameters corresponding to each type of face area are obtained, and then the beautification process is performed on the face area according to the beautification parameters. For example, the face area can be of three types: juvenile, young, middle-aged and old, and different beauty treatments are performed on different types of face areas. The eye-enlargement treatment is performed on the young face area, the whitening treatment is performed on the young face area, and the skin smoothing treatment is performed on the middle-aged and elderly face area.

上述实施例提供的图像处理方法,根据获取的待处理图像集合获取人脸区域,然后将人脸区域进行分类,再根据分类后的人脸区域获取美颜参数,并根据美颜参数对人脸区域进行美颜处理。这样可以将待处理图像集合中的人脸区域进行批量地美颜处理,提高了图像处理的效率。In the image processing method provided by the above-mentioned embodiment, the face area is obtained according to the acquired image set to be processed, and then the face area is classified, and the beautification parameters are obtained according to the classified face area, and the face is processed according to the beautification parameter. The area is beautified. In this way, face areas in the image set to be processed can be beautified in batches, which improves the efficiency of image processing.

图4为另一个实施例中图像处理方法的流程图。如图4所示,该图像处理方法包括步骤402至步骤406。其中:Fig. 4 is a flowchart of an image processing method in another embodiment. As shown in FIG. 4 , the image processing method includes step 402 to step 406 . in:

步骤402,获取待处理图像集合。Step 402, acquiring a set of images to be processed.

步骤404,获取待处理图像集合中每一张待处理图像中的人脸区域以及对应的人像区域,根据获取的人脸区域将人像区域进行分类。Step 404, acquire the face area and the corresponding portrait area in each image to be processed in the image set to be processed, and classify the portrait area according to the acquired face area.

在一个实施例中,人脸区域是指待处理图像中人像的人脸所在的区域,人像区域是指待处理图像中的整个人像所在的区域。可以理解的是,通过图像采集装置采集图像的时候,可以同时获取图像对应的深度图,深度图中的像素点与图像中的像素点对应。深度图中的像素点表示图像中对应像素的深度信息,深度信息即为像素点对应的物体到图像采集装置的深度信息。例如,深度信息可以通过双摄像头进行获取,得到的像素点对应的深度信息可以为1米、2米或3米等。则获取人脸区域及对应的人像区域具体可以包括:获取待处理图像及对应的深度信息;检测待处理图像中的人脸区域,并根据人脸区域和深度信息,获取待处理图像中的人像区域。一般认为人像与人脸在同一垂直平面上,人像到图像采集装置的深度信息与人脸到图像采集装置的深度信息的取值在同一范围内。因此,在获取人脸区域后,可以从深度图中获取人脸区域对应的深度信息,然后根据人脸区域对应的深度信息可以获取人像区域对应的深度信息,然后根据人像区域对应的深度信息即可获取到待处理图像中的人像区域。In one embodiment, the face area refers to the area where the face of the portrait in the image to be processed is located, and the portrait area refers to the area where the entire portrait in the image to be processed is located. It can be understood that when an image is captured by the image capture device, a depth map corresponding to the image can be acquired at the same time, and pixels in the depth map correspond to pixels in the image. The pixels in the depth map represent the depth information of the corresponding pixels in the image, and the depth information is the depth information from the object corresponding to the pixels to the image acquisition device. For example, the depth information can be acquired through dual cameras, and the obtained depth information corresponding to the pixels can be 1 meter, 2 meters or 3 meters. Then obtaining the face area and the corresponding portrait area may specifically include: obtaining the image to be processed and corresponding depth information; detecting the face area in the image to be processed, and obtaining the portrait in the image to be processed according to the face area and depth information area. It is generally believed that the portrait and the face are on the same vertical plane, and the depth information from the portrait to the image acquisition device is within the same range as the depth information from the face to the image acquisition device. Therefore, after obtaining the face area, the depth information corresponding to the face area can be obtained from the depth map, and then the depth information corresponding to the portrait area can be obtained according to the depth information corresponding to the face area, and then according to the depth information corresponding to the portrait area, that is The portrait area in the image to be processed can be obtained.

图5为一个实施例中获取深度信息的原理图。如图5所示,已知第一摄像头502到第二摄像头504之间的距离Tc,通过第一摄像头502和第二摄像头504分别拍摄物体506对应的图像,根据该图像可以获取第一夹角A1和第二夹角A2,第一摄像头502到第二摄像头504所在水平线与物体502之间的垂直交点为交点508。假设第一摄像头502到交点508的距离为Tx,那么交点508到第二摄像头504的距离就为Tc-Tx,物体506的深度信息即物体506到交点508的垂直距离为Ts。根据第一摄像头502、物体506和交点508组成的三角形,则可以得到以下公式:Fig. 5 is a schematic diagram of obtaining depth information in an embodiment. As shown in FIG. 5 , the distance Tc between the first camera 502 and the second camera 504 is known, and the first camera 502 and the second camera 504 respectively take images corresponding to the object 506, and the first clip can be obtained according to the images. The angle A1 and the second included angle A2, the vertical intersection point between the horizontal line where the first camera 502 to the second camera 504 are located and the object 502 is the intersection point 508 . Suppose the distance from the first camera 502 to the intersection point 508 is T x , then the distance from the intersection point 508 to the second camera 504 is T c −T x , and the depth information of the object 506 ie the vertical distance from the object 506 to the intersection point 508 is T s . According to the triangle formed by the first camera 502, the object 506 and the intersection point 508, the following formula can be obtained:

同理,根据第二摄像头504、物体506和交点508组成的三角形,则可以得到以下公式:Similarly, according to the triangle formed by the second camera 504, the object 506 and the intersection point 508, the following formula can be obtained:

由上述公式可以得到物体506的深度信息为:From the above formula, the depth information of the object 506 can be obtained as:

在一个实施例中,根据深度信息提取的是待处理图像中与人脸在同一深度信息范围内的物体所在的图像区域,假设人旁边有其他物体存在,那么提取出来的图像区域就可能存在除人像区域之外的其他物体。这时候可以根据图像区域的颜色信息进一步将人像区域提取出来。则获取人脸区域及对应的人像区域具体可以包括:获取待处理图像及对应的深度信息;检测待处理图像中的人脸区域,并根据人脸区域和深度信息获取待处理图像中的图像区域;根据图像区域的颜色信息提取人像区域。颜色信息是指用来表示图像的色彩的相关参数,例如颜色信息可以包括图像中色彩的色调、饱和度、明度等信息。其中,色彩的色调是指色彩的角度度量,其取值范围为0°~360°,从红色开始按逆时针方向计算,红色为0°,绿色为120°,蓝色为240°。饱和度是指色彩接近光谱的程度,一般饱和度越高,色彩越鲜艳;饱和度越低,色彩越暗淡。明度则表示色彩的明亮程度。不同的物体往往有不同的颜色特征,即在图像中呈现的颜色信息也是不一样的。例如树木的颜色为绿色、天空为蓝色、大地为黄色等等。根据图像区域中的颜色信息可以提取人像区域和人像区域外的区域。In one embodiment, according to the depth information, the image region where the object in the same depth information range as the human face is located in the image to be processed is extracted. Assuming that there are other objects beside the person, the extracted image region may have Other objects outside the portrait area. At this time, the portrait area can be further extracted according to the color information of the image area. Then obtaining the face area and the corresponding portrait area may specifically include: obtaining the image to be processed and corresponding depth information; detecting the face area in the image to be processed, and obtaining the image area in the image to be processed according to the face area and depth information ; Extract the portrait area according to the color information of the image area. The color information refers to related parameters used to represent the color of an image, for example, the color information may include information such as hue, saturation, lightness and the like of the color in the image. Among them, the hue of the color refers to the angular measure of the color, and its value ranges from 0° to 360°, calculated counterclockwise from red, 0° for red, 120° for green, and 240° for blue. Saturation refers to the degree to which the color is close to the spectrum. Generally, the higher the saturation, the brighter the color; the lower the saturation, the darker the color. Lightness indicates how bright a color is. Different objects often have different color characteristics, that is, the color information presented in the image is also different. For example, the color of trees is green, the sky is blue, the earth is yellow, and so on. The portrait area and areas outside the portrait area can be extracted according to the color information in the image area.

具体地,获取图像区域的颜色分量,提取图像区域中颜色分量在预设范围内的区域作为人像区域。颜色分量是指将待处理图像转化为某一从色彩维度的图像所产生的图像分量,例如颜色分量可以是指图像的RGB颜色分量、CMY颜色分量、HSV颜色分量等,可以理解的是RGB颜色分量、CMY颜色分量、HSV颜色分量之间可以相互转换。例如,获取图像区域的HSV颜色分量,提取图像区域中HSV颜色分量在预设范围内的区域作为人像区域。其中,HSV颜色分量分别是指图像的色调(H)、饱和度(S)、明度(V)分量,分别给这三个分量设定一个预设范围,并将图像区域中这三个分量在预设范围内的区域提取出来,作为人像区域。具体可以是获取图像区域的HSV颜色分量,并获取图像区域中满足条件“H值在20~25、S值在10~50、V值在50~85之间”的区域,作为人像区域。Specifically, the color components of the image area are acquired, and an area of the image area whose color components are within a preset range is extracted as a portrait area. The color component refers to the image component generated by converting the image to be processed into an image from the color dimension. For example, the color component can refer to the RGB color component, CMY color component, HSV color component, etc. of the image. It can be understood that the RGB color Components, CMY color components, and HSV color components can be converted to each other. For example, the HSV color components of the image area are acquired, and the area in the image area where the HSV color components are within a preset range is extracted as the portrait area. Among them, the HSV color components refer to the hue (H), saturation (S), and lightness (V) components of the image respectively. A preset range is set for these three components, and these three components in the image area are set in The area within the preset range is extracted as the portrait area. Specifically, the HSV color components of the image area can be obtained, and the area in the image area that satisfies the condition "H value is between 20-25, S value is between 10-50, and V value is between 50-85" can be obtained as the portrait area.

在一个实施例中,根据人脸区域将人像区域进行分类具体可以包括:获取人脸区域对应的人物属性特征,并根据人物属性特征对人像区域进行分类。例如,根据人物分类,人像区域可以分为张三对应的人像区域和李四对应的人像区域;根据性别分类,人像区域可以分为男性对应的人像区域和女性对应的人像区域。In one embodiment, classifying the portrait area according to the face area may specifically include: acquiring the character attribute features corresponding to the face area, and classifying the portrait area according to the character attribute features. For example, according to the classification of people, the portrait area can be divided into a portrait area corresponding to Zhang San and a portrait area corresponding to Li Si; according to gender classification, the portrait area can be divided into a portrait area corresponding to men and a portrait area corresponding to women.

步骤406,获取每一类人像区域对应的美颜参数,并根据该美颜参数分别对每一类人像区域进行美颜处理。Step 406, acquiring the beautification parameters corresponding to each type of portrait area, and performing beautification processing on each type of portrait area according to the beautification parameters.

上述实施例提供的图像处理方法,根据获取的待处理图像集合获取人像区域,然后将人像区域进行分类,再根据分类后的人像区域获取美颜参数,并根据美颜参数对人像区域进行美颜处理。这样可以将待处理图像集合中的人像区域进行批量地美颜处理,提高了图像处理的效率。In the image processing method provided by the above embodiment, the portrait area is obtained according to the acquired image set to be processed, and then the portrait area is classified, and the beautification parameters are obtained according to the classified portrait area, and the beautification is performed on the portrait area according to the beautification parameters deal with. In this way, the portrait areas in the image set to be processed can be beautified in batches, which improves the efficiency of image processing.

图6为又一个实施例中图像处理方法的流程图。如图6所示,该图像处理方法包括步骤602至步骤610。其中:Fig. 6 is a flowchart of an image processing method in yet another embodiment. As shown in FIG. 6 , the image processing method includes step 602 to step 610 . in:

步骤602,获取待处理图像集合。Step 602, acquiring a set of images to be processed.

步骤604,获取待处理图像集合中每一张待处理图像中的目标区域,并将获取的目标区域进行分类。Step 604, acquire the target area in each image to be processed in the image set to be processed, and classify the acquired target area.

在一个实施例中,移动终端获取到待处理图像集合之后,可以在终端本地进行美颜处理,也可以将待处理图像集合发送至服务器进行美颜处理,还可以是在移动终端识别目标区域,然后只将提取出来的目标区域的集合发送至服务器进行美颜处理。具体地,移动终端获取待处理图像集合,获取待处理图像集合中每一张待处理图像中的目标区域,形成目标区域集合。然后移动终端将目标区域集合发送至服务器,服务器对目标区域集合中的目标区域进行分类。In one embodiment, after the mobile terminal acquires the set of images to be processed, it can perform beauty treatment locally on the terminal, or send the set of images to be processed to the server for beauty treatment, or identify the target area on the mobile terminal, Then only the set of extracted target regions is sent to the server for beauty treatment. Specifically, the mobile terminal acquires a set of images to be processed, and acquires a target area in each image to be processed in the set of images to be processed to form a set of target areas. Then the mobile terminal sends the target area set to the server, and the server classifies the target areas in the target area set.

步骤606,获取每一类目标区域对应的美颜类别参数,美颜类别参数是表示美颜处理类别的参数。Step 606 , acquiring the beautification category parameter corresponding to each type of target area, where the beautification category parameter is a parameter indicating the beautification processing category.

在一个实施例中,美颜参数可以包括美颜类别参数和美颜程度参数。其中,美颜类别参数是表示美颜处理类别的参数,美颜程度参数是表示美颜处理程度的参数。例如,美颜类别参数可以为美白处理、磨皮处理、美妆处理、大眼处理等,美颜程度参数则可以分为1级、2级、3级、4级、5级等五个等级。从1级到5级的美颜处理,美颜处理的程度递增。目标区域的类型和美颜类别参数是对应的,根据分类后的目标区域获取对应的美颜类别参数。例如,若获取的目标区域为嘴唇,则将该目标区域加上唇彩效果;若获取的目标区域为眼睛,则将目标区域的眼睛进行放大处理。In an embodiment, the beautification parameter may include a beautification category parameter and a beautification degree parameter. Wherein, the beautification category parameter is a parameter indicating the beautification treatment category, and the beautification degree parameter is a parameter indicating the beautification treatment degree. For example, the beauty category parameters can be whitening treatment, skin smoothing treatment, makeup treatment, eye enlargement treatment, etc., and the beauty level parameters can be divided into five levels: 1st, 2nd, 3rd, 4th, and 5th. . From level 1 to level 5 beauty treatment, the degree of beauty treatment increases. The type of the target area corresponds to the beautification category parameter, and the corresponding beautification category parameter is obtained according to the classified target area. For example, if the acquired target area is lips, add a lip gloss effect to the target area; if the acquired target area is eyes, then enlarge the eyes of the target area.

步骤608,获取每个目标区域对应的物理属性特征,并根据物理属性特征获取对应的美颜程度参数,美颜程度参数是表示美颜处理程度的参数。In step 608, the corresponding physical attribute feature of each target area is obtained, and the corresponding beautification degree parameter is obtained according to the physical attribute feature. The beautification degree parameter is a parameter indicating the degree of beautification processing.

具体地,物理属性特征是指表示目标区域的物理属性的特征值。目标区域的物理属性特征可以是指目标区域的面积大小,也可以是指目标区域对应的深度信息。在美颜处理过程中,如果对于不同距离的人物进行同等程度的美颜处理的话,可能会导致图像严重失真,降低图像的美感。例如,将图像进行磨皮处理,会使图像中人的皮肤看起来比较光滑,而同时可能会丢失一些细节信息。如果图像中的人脸面积比较小,则人脸的五官看起来就不够清晰,如果再进行大程度的磨皮处理,就会导致这个人脸的五官完全看不清楚,使图像失去了美感。一般来说,目标区域的面积越大,深度信息越小,即目标区域中的物体到图像采集装置的物理距离越近。可以将目标区域的区域面积和/或深度信息与美颜程度参数建立对应关系,然后根据则根据区域面积和/或深度信息获取对应的美颜程度参数。则物理属性特征获取对应的美颜程度参数具体可以包括:获取每个目标区域对应的区域面积,并根据区域面积获取对应的美颜程度参数;和/或获取每个目标区域对应的深度信息,并根据深度信息获取对应的美颜程度参数。例如,深度信息为1米之内对应美颜程度参数为5级,深度信息为1米到2米之间对应美颜程度参数为4级,深度信息为2米到3米之间对应美颜程度参数为3级,深度信息为3米到4米之间对应美颜程度参数为2级,深度信息为4米以上对应美颜程度参数为1级。Specifically, the physical property feature refers to a feature value representing the physical property of the target area. The physical attribute feature of the target area may refer to the area size of the target area, or may refer to the depth information corresponding to the target area. During the beautification process, if the same degree of beautification is performed on people at different distances, the image may be severely distorted and the beauty of the image will be reduced. For example, performing skin smoothing on an image will make the skin of the person in the image appear smoother, while at the same time, some detail information may be lost. If the area of the face in the image is relatively small, the facial features of the face will not look clear enough. If a large degree of dermabrasion is performed, the facial features of the face will be completely unclear and the image will lose its beauty. Generally speaking, the larger the area of the target area, the smaller the depth information, that is, the closer the physical distance between the object in the target area and the image acquisition device. The area and/or depth information of the target area may be associated with the beautification degree parameter, and then the corresponding beautification degree parameter may be obtained according to the area area and/or depth information. The acquisition of the corresponding beautification degree parameter of the physical attribute feature may specifically include: obtaining the area area corresponding to each target area, and obtaining the corresponding beautification degree parameter according to the area area; and/or obtaining the depth information corresponding to each target area, And obtain the corresponding beautification degree parameter according to the depth information. For example, if the depth information is within 1 meter, the corresponding beauty level parameter is level 5; if the depth information is between 1 meter and 2 meters, the corresponding beauty level parameter is level 4; if the depth information is between 2 meters and 3 meters, the corresponding beauty level parameter is The degree parameter is 3 levels, the depth information is between 3 meters and 4 meters, corresponding to the beauty level parameter is 2 levels, and the depth information is above 4 meters, corresponding to the beauty level parameter is 1 level.

在一个实施例中,目标区域是由若干个像素点构成,则目标区域的面积则可以表示为目标区域内所包含的像素点的总数量,也可以表示为目标区域与对应的待处理图像的面积比例。根据区域面积获取对应的美颜程度参数,该美颜程度参数表示该目标区域内每一个像素点对应的美颜程度参数,也就是说该目标区域内所有像素点的美颜程度相同。根据深度信息获取对应的美颜程度参数时,可以根据目标区域中每一个像素点的深度信息对应的美颜程度参数,则获取的美颜程度参数表示一个像素点对应的美颜处理程度,即目标区域中不同的像素点对应的美颜处理程度不同。还可以是根据目标区域中某一个像素点的深度信息或所有像素点的深度信息的平均值来获取对应的美颜程度参数,则获取的美颜程度参数表示该目标区域对应的美颜处理的程度,即该目标区域中所有像素点进行同等程度的美颜处理。例如,可以随机选取目标区域中的某一点的深度信息来获取美颜程度参数,也可以选取目标区域的中心像素点的深度信息来获取对应的美颜程度参数。In one embodiment, the target area is composed of several pixels, then the area of the target area can be expressed as the total number of pixels contained in the target area, or can be expressed as the distance between the target area and the corresponding image to be processed area ratio. Obtain the corresponding beautification degree parameter according to the area area, and the beautification degree parameter indicates the beautification degree parameter corresponding to each pixel in the target area, that is to say, the beautification degree of all pixels in the target area is the same. When obtaining the corresponding beautification degree parameter according to the depth information, the beautification degree parameter corresponding to the depth information of each pixel in the target area can be used, and the obtained beautification degree parameter indicates the degree of beautification processing corresponding to a pixel point, that is, Different pixels in the target area correspond to different degrees of beauty treatment. It is also possible to obtain the corresponding beautification degree parameter according to the depth information of a certain pixel in the target area or the average value of the depth information of all pixels, and the obtained beautification degree parameter represents the corresponding beautification process of the target area. degree, that is, all pixels in the target area are treated with the same degree of beautification. For example, the depth information of a certain point in the target area can be randomly selected to obtain the beautification degree parameter, and the depth information of the central pixel point of the target area can also be selected to obtain the corresponding beautification degree parameter.

步骤610,根据美颜类别参数和美颜程度参数分别对每一类目标区域进行美颜处理。In step 610, perform beautification processing on each type of target area according to the beautification category parameter and the beautification degree parameter.

美颜类别参数决定了对人脸区域进行的美颜处理类型,美颜程度参数决定了对人脸区域进行的美颜处理程度。例如,美颜类别参数为磨皮处理,美颜程度参数为5级,则表示将人脸区域进行5级的磨皮处理。根据美颜类别参数和美颜程度参数对目标区域进行美颜处理后,将美颜处理之后的目标区域与待处理图像进行合成。可以理解的是,由于目标区域做了美颜处理,而待处理图像中除目标区域之外的剩余区域未做美颜处理,可能会导致两部分有明显的差异,则在合成的时候,需要将目标区域的边界进行过渡处理,使合成后的图像看起来更加自然。The beautification category parameter determines the type of beautification processing performed on the face area, and the beautification degree parameter determines the degree of beautification processing performed on the face area. For example, if the beautification category parameter is dermabrasion treatment, and the beautification degree parameter is 5 levels, it means that 5 levels of dermabrasion treatment will be performed on the face area. After the beautification process is performed on the target area according to the beautification category parameter and the beautification degree parameter, the target area after the beautification process is synthesized with the image to be processed. It is understandable that since the target area has been beautified, and the remaining areas in the image to be processed except the target area have not been beautified, there may be obvious differences between the two parts. When synthesizing, it is necessary to Transition processing is performed on the boundary of the target area to make the synthesized image look more natural.

上述实施例提供的图像处理方法,根据获取的待处理图像集合获取目标区域,然后将目标区域进行分类,再根据分类后的目标区域获取美颜参数,并根据美颜参数对目标区域进行美颜处理。这样可以将待处理图像集合中的目标区域进行批量地美颜处理,提高了图像处理的效率。In the image processing method provided by the above embodiment, the target area is obtained according to the acquired image set to be processed, and then the target area is classified, and then the beautification parameter is obtained according to the classified target area, and the target area is beautified according to the beautification parameter deal with. In this way, the target areas in the image set to be processed can be beautified in batches, which improves the efficiency of image processing.

在本申请提供的实施例中,图像处理方法还可以包括以下步骤:In the embodiment provided by this application, the image processing method may also include the following steps:

(1)获取待处理图像集合。(1) Obtain a collection of images to be processed.

(2)获取待处理图像集合中每一张待处理图像中的人脸区域以及对应的人像区域。(2) Obtain the face area and the corresponding portrait area in each image to be processed in the image set to be processed.

(3)获取人脸区域对应的人物属性特征,并根据人物属性特征对人像区域进行分类。(3) Obtain the character attribute features corresponding to the face area, and classify the portrait area according to the character attribute features.

(4)获取每一类人像区域对应的各个颜色通道的美颜类别参数,美颜类别参数是表示美颜处理类别的参数。(4) Acquiring the beautification category parameters of each color channel corresponding to each type of portrait area, where the beautification category parameter is a parameter representing a beautification processing category.

(5)获取每个人像区域对应的区域面积,并根据区域面积获取对应的美颜程度参数;和/或获取每个人像区域对应的深度信息,并根据深度信息获取对应的美颜程度参数,美颜程度参数是表示美颜处理程度的参数。(5) Acquiring the area area corresponding to each portrait area, and obtaining the corresponding beautification degree parameter according to the area area; and/or obtaining the depth information corresponding to each portrait area, and obtaining the corresponding beautification degree parameter according to the depth information, The degree of beautification parameter is a parameter indicating the degree of beautification processing.

(6)根据美颜类别参数和美颜程度参数对人像区域的各个颜色通道进行美颜处理。(6) Perform beautification processing on each color channel of the portrait area according to the beautification category parameter and the beautification degree parameter.

在本申请提供的其他实施例中,图像处理方法还可以包括以下步骤:In other embodiments provided by the present application, the image processing method may also include the following steps:

(1)获取待处理图像集合。(1) Obtain a collection of images to be processed.

(2)获取待处理图像集合中每一张待处理图像中的人脸区域。(2) Obtain the face area in each image to be processed in the image set to be processed.

(3)获取人脸区域对应的人物属性特征,并根据人物属性特征对人脸区域进行分类。(3) Obtain the character attribute features corresponding to the face area, and classify the face area according to the character attribute features.

(4)获取每一类人脸区域对应的各个颜色通道的美颜类别参数,美颜类别参数是表示美颜处理类别的参数。(4) Acquiring the beautification category parameters of each color channel corresponding to each type of face area, where the beautification category parameter is a parameter representing a beautification processing category.

(5)获取每个人脸区域对应的区域面积,并根据区域面积获取对应的美颜程度参数;和/或获取每个人脸区域对应的深度信息,并根据深度信息获取对应的美颜程度参数,美颜程度参数是表示美颜处理程度的参数。(5) Obtain the area area corresponding to each face area, and obtain the corresponding beautification degree parameter according to the area area; and/or obtain the depth information corresponding to each face area, and obtain the corresponding beautification degree parameter according to the depth information, The degree of beautification parameter is a parameter indicating the degree of beautification processing.

(6)根据美颜类别参数和美颜程度参数对人脸区域的各个颜色通道进行美颜处理。(6) Perform beautification processing on each color channel of the face area according to the beautification category parameter and the beautification degree parameter.

图7为一个实施例中图像处理装置的结构示意图。如图7所示,该图像处理装置700包括图像获取模块702、区域分类模块704和美颜处理模块706。其中:Fig. 7 is a schematic structural diagram of an image processing device in an embodiment. As shown in FIG. 7 , the image processing device 700 includes an image acquisition module 702 , an area classification module 704 and a beauty treatment module 706 . in:

图像获取模块702,用于获取待处理图像集合。An image acquisition module 702, configured to acquire a set of images to be processed.

区域分类模块704,用于获取所述待处理图像集合中每一张待处理图像中的目标区域,并将获取的目标区域进行分类。The area classification module 704 is configured to acquire a target area in each image to be processed in the image set to be processed, and classify the acquired target area.

美颜处理模块706,用于获取每一类目标区域对应的美颜参数,并根据所述美颜参数分别对每一类目标区域进行美颜处理。The beautification processing module 706 is configured to acquire the beautification parameters corresponding to each type of target area, and perform beautification processing on each type of target area according to the beautification parameters.

上述实施例提供的图像处理装置,根据获取的待处理图像集合获取目标区域,然后将目标区域进行分类,再根据分类后的目标区域获取美颜参数,并根据美颜参数对目标区域进行美颜处理。这样可以将待处理图像集合中的目标区域进行批量地美颜处理,提高了图像处理的效率。The image processing device provided in the above embodiment acquires the target area according to the acquired image set to be processed, and then classifies the target area, and then acquires the beautification parameters according to the classified target area, and performs beautification on the target area according to the beautification parameters. deal with. In this way, the target areas in the image set to be processed can be beautified in batches, which improves the efficiency of image processing.

在一个实施例中,区域分类模块704还用于获取所述待处理图像集合中每一张待处理图像中的人脸区域以及对应的人像区域;根据获取的人脸区域将所述人像区域进行分类。In one embodiment, the area classification module 704 is also used to obtain the face area and the corresponding portrait area in each image to be processed in the image set to be processed; Classification.

在一个实施例中,区域分类模块704还用于获取人脸区域对应的人物属性特征,并根据所述人物属性特征对所述人像区域进行分类。In one embodiment, the area classification module 704 is further configured to acquire the character attribute features corresponding to the face area, and classify the portrait area according to the character attribute features.

在一个实施例中,区域分类模块704还用于获取所述待处理图像集合中每一张待处理图像中的人脸区域;获取人脸区域对应的人物属性特征,并根据所述人物属性特征对所述人脸区域进行分类。In one embodiment, the area classification module 704 is also used to obtain the face area in each image to be processed in the image set to be processed; obtain the character attribute features corresponding to the face area, and according to the character attribute features Classify the face regions.

在一个实施例中,美颜处理模块706还用于获取每一类目标区域对应的各个颜色通道的美颜参数,并根据所述美颜参数分别对所述目标区域的各个颜色通道进行美颜处理。In one embodiment, the beautification processing module 706 is further configured to obtain the beautification parameters of each color channel corresponding to each type of target area, and perform beautification on each color channel of the target area according to the beautification parameters deal with.

在一个实施例中,美颜处理模块706还用于获取每一类目标区域对应的美颜类别参数,所述美颜类别参数是表示美颜处理类别的参数;获取每个目标区域对应的物理属性特征,并根据所述物理属性特征获取对应的美颜程度参数,所述美颜程度参数是表示美颜处理程度的参数;根据所述美颜类别参数和美颜程度参数分别对每一类目标区域进行美颜处理。In one embodiment, the beautification processing module 706 is also used to obtain the beautification category parameters corresponding to each type of target area, the beautification category parameters are parameters representing the beautification processing category; attribute characteristics, and obtain corresponding beautification degree parameters according to the physical attribute characteristics, and the beautification degree parameters are parameters indicating the degree of beautification treatment; The area is beautified.

在一个实施例中,美颜处理模块706还用于获取每个目标区域对应的区域面积,并根据所述区域面积获取对应的美颜程度参数;和/或获取每个目标区域对应的深度信息,并根据所述深度信息获取对应的美颜程度参数。In one embodiment, the beautification processing module 706 is further configured to acquire the area area corresponding to each target area, and acquire the corresponding beautification degree parameter according to the area area; and/or acquire the depth information corresponding to each target area , and obtain the corresponding beautification degree parameter according to the depth information.

上述图像处理装置中各个模块的划分仅用于举例说明,在其他实施例中,可将图像处理装置按照需要划分为不同的模块,以完成上述图像处理装置的全部或部分功能。The division of each module in the above image processing device is for illustration only. In other embodiments, the image processing device may be divided into different modules as required to complete all or part of the functions of the above image processing device.

本申请实施例还提供了一种计算机可读存储介质。一个或多个包含计算机程序的非易失性计算机可读存储介质,当所述计算机程序被一个或多个处理器执行时,使得所述处理器执行以下步骤:The embodiment of the present application also provides a computer-readable storage medium. One or more non-transitory computer-readable storage media containing a computer program that, when executed by one or more processors, causes the processors to:

获取待处理图像集合;Obtain a collection of images to be processed;

获取所述待处理图像集合中每一张待处理图像中的目标区域,并将获取的目标区域进行分类;Obtain a target area in each image to be processed in the set of images to be processed, and classify the acquired target area;

获取每一类目标区域对应的美颜参数,并根据所述美颜参数分别对每一类目标区域进行美颜处理。Acquiring beautification parameters corresponding to each type of target area, and performing beautification processing on each type of target area according to the beautification parameters.

在一个实施例中,所述处理器执行的所述获取所述待处理图像集合中每一张待处理图像中的目标区域,并将所述目标区域进行分类包括:In one embodiment, the acquiring the target area in each image to be processed in the set of images to be processed performed by the processor, and classifying the target area includes:

获取所述待处理图像集合中每一张待处理图像中的人脸区域以及对应的人像区域;Obtain the face area and the corresponding portrait area in each image to be processed in the image set to be processed;

根据所述人脸区域将所述人像区域进行分类。The portrait area is classified according to the face area.

在一个实施例中,所述处理器执行的所述获取所述待处理图像集合中每一张待处理图像中的目标区域,并将获取的目标区域进行分类包括:In one embodiment, the acquiring the target area in each image to be processed in the set of images to be processed performed by the processor, and classifying the acquired target area includes:

获取所述待处理图像集合中每一张待处理图像中的人脸区域以及对应的人像区域;Obtain the face area and the corresponding portrait area in each image to be processed in the image set to be processed;

根据获取的人脸区域将所述人像区域进行分类。The portrait area is classified according to the acquired face area.

在一个实施例中,所述处理器执行的所述根据获取的人脸区域将所述人像区域进行分类包括:In one embodiment, the classifying the portrait area according to the acquired face area performed by the processor includes:

获取人脸区域对应的人物属性特征,并根据所述人物属性特征对所述人像区域进行分类。Obtain the person attribute features corresponding to the face area, and classify the portrait area according to the person attribute features.

在一个实施例中,所述处理器执行的所述获取所述待处理图像集合中每一张待处理图像中的目标区域,并将获取的目标区域进行分类包括:In one embodiment, the acquiring the target area in each image to be processed in the set of images to be processed performed by the processor, and classifying the acquired target area includes:

获取所述待处理图像集合中每一张待处理图像中的人脸区域;Acquiring the face area in each image to be processed in the set of images to be processed;

获取人脸区域对应的人物属性特征,并根据所述人物属性特征对所述人脸区域进行分类。Obtain the human attribute features corresponding to the human face area, and classify the human face area according to the human attribute feature.

在一个实施例中,所述处理器执行的所述获取每一类目标区域对应的美颜参数,并根据所述美颜参数分别对每一类目标区域进行美颜处理包括:In one embodiment, the acquiring the beautification parameters corresponding to each type of target area performed by the processor, and performing beautification processing on each type of target area according to the beautification parameters includes:

获取每一类目标区域对应的各个颜色通道的美颜参数,并根据所述美颜参数分别对所述目标区域的各个颜色通道进行美颜处理。Acquiring beautification parameters of each color channel corresponding to each type of target area, and performing beautification processing on each color channel of the target area according to the beautification parameters.

在一个实施例中,所述处理器执行的所述获取每一类目标区域对应的美颜参数,并根据所述美颜参数分别对每一类目标区域进行美颜处理包括:In one embodiment, the acquiring the beautification parameters corresponding to each type of target area performed by the processor, and performing beautification processing on each type of target area according to the beautification parameters includes:

获取每一类目标区域对应的美颜类别参数,所述美颜类别参数是表示美颜处理类别的参数;Obtaining a beauty category parameter corresponding to each type of target area, where the beauty category parameter is a parameter representing a beauty treatment category;

获取每个目标区域对应的物理属性特征,并根据所述物理属性特征获取对应的美颜程度参数,所述美颜程度参数是表示美颜处理程度的参数;Obtaining the physical attribute feature corresponding to each target area, and obtaining the corresponding beautification degree parameter according to the physical attribute feature, the beautification degree parameter is a parameter indicating the degree of beautification treatment;

根据所述美颜类别参数和美颜程度参数分别对每一类目标区域进行美颜处理。Perform beautification processing on each type of target area according to the beautification category parameter and the beautification degree parameter.

在一个实施例中,所述处理器执行的所述获取每一个目标区域对应的物理属性特征,并根据所述物理属性特征获取对应的美颜程度参数包括以下步骤中至少一种:In one embodiment, the acquiring the physical attribute characteristics corresponding to each target area performed by the processor, and obtaining the corresponding beauty-beauty degree parameters according to the physical attribute characteristics includes at least one of the following steps:

获取每个目标区域对应的区域面积,并根据所述区域面积获取对应的美颜程度参数;Acquiring the area area corresponding to each target area, and obtaining the corresponding beautification degree parameter according to the area area;

获取每个目标区域对应的深度信息,并根据所述深度信息获取对应的美颜程度参数。Depth information corresponding to each target area is obtained, and a corresponding beautification degree parameter is obtained according to the depth information.

本申请实施例还提供一种电子设备。上述电子设备中包括图像处理电路,图像处理电路可以利用硬件和/或软件组件实现,可包括定义ISP(Image Signal Processing,图像信号处理)管线的各种处理单元。图8为一个实施例中图像处理电路的示意图。如图8所示,为便于说明,仅示出与本申请实施例相关的图像处理技术的各个方面。The embodiment of the present application also provides an electronic device. The above-mentioned electronic device includes an image processing circuit, and the image processing circuit may be implemented by hardware and/or software components, and may include various processing units defining an ISP (Image Signal Processing, image signal processing) pipeline. Fig. 8 is a schematic diagram of an image processing circuit in one embodiment. As shown in FIG. 8 , for ease of description, only various aspects of the image processing technology related to the embodiment of the present application are shown.

如图8所示,图像处理电路包括ISP处理器840和控制逻辑器850。成像设备810捕捉的图像数据首先由ISP处理器840处理,ISP处理器840对图像数据进行分析以捕捉可用于确定和/或成像设备810的一个或多个控制参数的图像统计信息。成像设备810可包括具有一个或多个透镜812和图像传感器814的照相机。图像传感器814可包括色彩滤镜阵列(如Bayer滤镜),图像传感器814可获取用图像传感器814的每个成像像素捕捉的光强度和波长信息,并提供可由ISP处理器840处理的一组原始图像数据。传感器820(如陀螺仪)可基于传感器820接口类型把采集的图像处理的参数(如防抖参数)提供给ISP处理器840。传感器820接口可以利用SMIA(Standard Mobile Imaging Architecture,标准移动成像架构)接口、其它串行或并行照相机接口或上述接口的组合。As shown in FIG. 8 , the image processing circuit includes an ISP processor 840 and a control logic 850 . Image data captured by imaging device 810 is first processed by ISP processor 840 , which analyzes the image data to capture image statistics that may be used to determine and/or control one or more parameters of imaging device 810 . Imaging device 810 may include a camera having one or more lenses 812 and an image sensor 814 . Image sensor 814 may include a color filter array (such as a Bayer filter), and image sensor 814 may obtain light intensity and wavelength information captured with each imaging pixel of image sensor 814 and provide a set of raw images that may be processed by ISP processor 840. image data. The sensor 820 (such as a gyroscope) may provide the collected image processing parameters (such as anti-shake parameters) to the ISP processor 840 based on the interface type of the sensor 820 . The interface of the sensor 820 may utilize a SMIA (Standard Mobile Imaging Architecture, Standard Mobile Imaging Architecture) interface, other serial or parallel camera interfaces, or a combination of the above interfaces.

此外,图像传感器814也可将原始图像数据发送给传感器820,传感器820可基于传感器820接口类型把原始图像数据提供给ISP处理器840,或者传感器820将原始图像数据存储到图像存储器830中。In addition, image sensor 814 may also send raw image data to sensor 820 , which may provide raw image data to ISP processor 840 based on the sensor 820 interface type, or sensor 820 may store raw image data in image memory 830 .

ISP处理器840按多种格式逐个像素地处理原始图像数据。例如,每个图像像素可具有8、10、12或14比特的位深度,ISP处理器840可对原始图像数据进行一个或多个图像处理操作、收集关于图像数据的统计信息。其中,图像处理操作可按相同或不同的位深度精度进行。The ISP processor 840 processes raw image data on a pixel-by-pixel basis in various formats. For example, each image pixel may have a bit depth of 8, 10, 12, or 14 bits, and ISP processor 840 may perform one or more image processing operations on raw image data, gather statistical information about the image data. Among other things, image processing operations can be performed with the same or different bit depth precision.

ISP处理器840还可从图像存储器830接收图像数据。例如,传感器820接口将原始图像数据发送给图像存储器830,图像存储器830中的原始图像数据再提供给ISP处理器840以供处理。图像存储器830可为存储器装置的一部分、存储设备、或电子设备内的独立的专用存储器,并可包括DMA(Direct Memory Access,直接直接存储器存取)特征。ISP processor 840 may also receive image data from image memory 830 . For example, the sensor 820 interface sends raw image data to the image memory 830, and the raw image data in the image memory 830 is provided to the ISP processor 840 for processing. The image memory 830 may be a part of a memory device, a storage device, or an independent dedicated memory in an electronic device, and may include a DMA (Direct Memory Access, direct memory access) feature.

当接收到来自图像传感器814接口或来自传感器820接口或来自图像存储器830的原始图像数据时,ISP处理器840可进行一个或多个图像处理操作,如时域滤波。处理后的图像数据可发送给图像存储器830,以便在被显示之前进行另外的处理。ISP处理器840还可从图像存储器830接收处理数据,对所述处理数据进行原始域中以及RGB和YCbCr颜色空间中的图像数据处理。处理后的图像数据可输出给显示器880,以供用户观看和/或由图形引擎或GPU(Graphics Processing Unit,图形处理器)进一步处理。此外,ISP处理器840的输出还可发送给图像存储器830,且显示器880可从图像存储器830读取图像数据。在一个实施例中,图像存储器830可被配置为实现一个或多个帧缓冲器。此外,ISP处理器840的输出可发送给编码器/解码器870,以便编码/解码图像数据。编码的图像数据可被保存,并在显示于显示器880设备上之前解压缩。Upon receiving raw image data from the image sensor 814 interface or from the sensor 820 interface or from the image memory 830, the ISP processor 840 may perform one or more image processing operations, such as temporal filtering. The processed image data may be sent to image memory 830 for additional processing before being displayed. The ISP processor 840 may also receive processed data from the image memory 830 for image data processing in the raw domain and in the RGB and YCbCr color spaces. The processed image data may be output to the display 880 for viewing by the user and/or further processed by a graphics engine or a GPU (Graphics Processing Unit, graphics processor). In addition, the output of the ISP processor 840 can also be sent to the image memory 830 , and the display 880 can read image data from the image memory 830 . In one embodiment, image memory 830 may be configured to implement one or more frame buffers. Also, the output of the ISP processor 840 may be sent to an encoder/decoder 870 for encoding/decoding image data. The encoded image data may be saved and decompressed prior to display on the display 880 device.

ISP处理器840处理图像数据的步骤包括:对图像数据进行VFE(Video Front End,视频前端)处理和CPP(Camera Post Processing,摄像头后处理)处理。对图像数据的VFE处理可包括修正图像数据的对比度或亮度、修改以数字方式记录的光照状态数据、对图像数据进行补偿处理(如白平衡,自动增益控制,γ校正等)、对图像数据进行滤波处理等。对图像数据的CPP处理可包括对图像进行缩放、向每个路径提供预览帧和记录帧。其中,CPP可使用不同的编解码器来处理预览帧和记录帧。ISP处理器840处理后的图像数据可发送给美颜模块860,以便在被显示之前对图像进行美颜处理。美颜模块860对图像数据美颜处理可包括:美白、祛斑、磨皮、瘦脸、祛痘、增大眼睛等。其中,美颜模块860可为移动终端中CPU(Central Processing Unit,中央处理器)、GPU或协处理器等。美颜模块860处理后的数据可发送给编码器/解码器870,以便编码/解码图像数据。编码的图像数据可被保存,并在显示于显示器880设备上之前解压缩。其中,美颜模块860还可位于编码器/解码器870与显示器880之间,即美颜模块对已成像的图像进行美颜处理。上述编码器/解码器870可为移动终端中CPU、GPU或协处理器等。The steps for the ISP processor 840 to process the image data include: performing VFE (Video Front End, video front end) processing and CPP (Camera Post Processing, camera post processing) processing on the image data. VFE processing of image data may include correction of contrast or brightness of image data, modification of digitally recorded light state data, compensation processing of image data (such as white balance, automatic gain control, gamma correction, etc.), filter processing, etc. CPP processing of image data may include scaling the image, providing preview frames and recording frames for each path. Among them, CPP can use different codecs to process preview frames and record frames. The image data processed by the ISP processor 840 can be sent to the beautifying module 860, so that the image can be beautified before being displayed. The beautification module 860 can perform beautification processing on image data, including: whitening, freckle removal, skin smoothing, face thinning, acne removal, eye enlargement, etc. Wherein, the beautifying module 860 may be a CPU (Central Processing Unit, central processing unit), a GPU, or a co-processor in the mobile terminal. The data processed by the beauty module 860 can be sent to the encoder/decoder 870 for encoding/decoding image data. The encoded image data may be saved and decompressed prior to display on the display 880 device. Wherein, the beautifying module 860 may also be located between the encoder/decoder 870 and the display 880, that is, the beautifying module performs beautifying processing on the imaged image. The aforementioned encoder/decoder 870 may be a CPU, a GPU, or a coprocessor in a mobile terminal.

ISP处理器840确定的统计数据可发送给控制逻辑器850单元。例如,统计数据可包括自动曝光、自动白平衡、自动聚焦、闪烁检测、黑电平补偿、透镜812阴影校正等图像传感器814统计信息。控制逻辑器850可包括执行一个或多个例程(如固件)的处理器和/或微控制器,一个或多个例程可根据接收的统计数据,确定成像设备810的控制参数以及ISP处理器840的控制参数。例如,成像设备810的控制参数可包括传感器820控制参数(例如增益、曝光控制的积分时间)、照相机闪光控制参数、透镜812控制参数(例如聚焦或变焦用焦距)、或这些参数的组合。ISP控制参数可包括用于自动白平衡和颜色调整(例如,在RGB处理期间)的增益水平和色彩校正矩阵,以及透镜812阴影校正参数。The statistics determined by the ISP processor 840 may be sent to the control logic 850 unit. For example, statistics may include image sensor 814 statistics such as auto exposure, auto white balance, auto focus, flicker detection, black level compensation, lens 812 shading correction, etc. Control logic 850 may include a processor and/or a microcontroller that executes one or more routines (e.g., firmware) that determine control parameters of imaging device 810 and ISP processing based on received statistical data. The control parameters of the device 840. For example, control parameters of imaging device 810 may include sensor 820 control parameters (eg, gain, integration time for exposure control), camera flash control parameters, lens 812 control parameters (eg, focal length for focus or zoom), or combinations of these parameters. ISP control parameters may include gain levels and color correction matrices for automatic white balance and color adjustment (eg, during RGB processing), as well as lens 812 shading correction parameters.

运用图8中图像处理技术可实现上述实施例提供的图像处理方法。The image processing method provided by the above embodiment can be realized by using the image processing technology in FIG. 8 .

一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述实施例提供的图像处理方法。A computer program product containing instructions, when running on a computer, causes the computer to execute the image processing method provided by the above embodiments.

本申请所使用的对存储器、存储、数据库或其它介质的任何引用可包括非易失性和/或易失性存储器。合适的非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM),它用作外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDR SDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)。Any reference to memory, storage, database, or other medium as used herein may include non-volatile and/or volatile memory. Suitable nonvolatile memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM), which acts as external cache memory. By way of illustration and not limitation, RAM is available in many forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced SDRAM (ESDRAM), Synchronous Synchlink DRAM (SLDRAM), Memory Bus (Rambus) Direct RAM (RDRAM), Direct Memory Bus Dynamic RAM (DRDRAM), and Memory Bus Dynamic RAM (RDRAM).

以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对本申请专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。The above-mentioned embodiments only express several implementation modes of the present application, and the description thereof is relatively specific and detailed, but should not be construed as limiting the patent scope of the present application. It should be noted that those skilled in the art can make several modifications and improvements without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the scope of protection of the patent application should be based on the appended claims.

Claims (10)

1.一种图像处理方法,其特征在于,所述方法包括:1. An image processing method, characterized in that the method comprises: 获取待处理图像集合;Obtain a collection of images to be processed; 获取所述待处理图像集合中每一张待处理图像中的目标区域,并将获取的目标区域进行分类;Obtain a target area in each image to be processed in the set of images to be processed, and classify the acquired target area; 获取每一类目标区域对应的美颜参数,并根据所述美颜参数分别对每一类目标区域进行美颜处理。Acquiring beautification parameters corresponding to each type of target area, and performing beautification processing on each type of target area according to the beautification parameters. 2.根据所述权利要求1所述的图像处理方法,其特征在于,所述获取所述待处理图像集合中每一张待处理图像中的目标区域,并将获取的目标区域进行分类包括:2. The image processing method according to claim 1, wherein the acquiring the target area in each image to be processed in the set of images to be processed, and classifying the acquired target area comprises: 获取所述待处理图像集合中每一张待处理图像中的人脸区域以及对应的人像区域;Obtain the face area and the corresponding portrait area in each image to be processed in the image set to be processed; 根据获取的人脸区域将所述人像区域进行分类。The portrait area is classified according to the acquired face area. 3.根据所述权利要求2所述的图像处理方法,其特征在于,所述根据获取的人脸区域将所述人像区域进行分类包括:3. The image processing method according to claim 2, wherein the classification of the portrait area according to the acquired face area comprises: 获取人脸区域对应的人物属性特征,并根据所述人物属性特征对所述人像区域进行分类。Obtain the person attribute features corresponding to the face area, and classify the portrait area according to the person attribute features. 4.根据所述权利要求1所述的图像处理方法,其特征在于,所述获取所述待处理图像集合中每一张待处理图像中的目标区域,并将获取的目标区域进行分类包括:4. The image processing method according to claim 1, wherein the acquiring the target area in each image to be processed in the set of images to be processed, and classifying the acquired target area comprises: 获取所述待处理图像集合中每一张待处理图像中的人脸区域;Acquiring the face area in each image to be processed in the set of images to be processed; 获取人脸区域对应的人物属性特征,并根据所述人物属性特征对所述人脸区域进行分类。Obtain the human attribute features corresponding to the human face area, and classify the human face area according to the human attribute feature. 5.根据所述权利要求1至4任一项所述的图像处理方法,其特征在于,所述获取每一类目标区域对应的美颜参数,并根据所述美颜参数分别对每一类目标区域进行美颜处理包括:5. The image processing method according to any one of claims 1 to 4, characterized in that, the acquisition of the beautification parameters corresponding to each type of target area, and each type of beautification parameters respectively according to the beautification parameters Targeted areas for beautification include: 获取每一类目标区域对应的各个颜色通道的美颜参数,并根据所述美颜参数分别对所述目标区域的各个颜色通道进行美颜处理。Acquiring beautification parameters of each color channel corresponding to each type of target area, and performing beautification processing on each color channel of the target area according to the beautification parameters. 6.根据所述权利要求1至4任一项所述的图像处理方法,其特征在于,所述获取每一类目标区域对应的美颜参数,并根据所述美颜参数分别对每一类目标区域进行美颜处理包括:6. The image processing method according to any one of claims 1 to 4, characterized in that, the acquisition of the beautification parameters corresponding to each type of target area, and each type of beautification parameters are performed according to the beautification parameters Targeted areas for beautification include: 获取每一类目标区域对应的美颜类别参数,所述美颜类别参数是表示美颜处理类别的参数;Obtaining a beauty category parameter corresponding to each type of target area, where the beauty category parameter is a parameter representing a beauty treatment category; 获取每个目标区域对应的物理属性特征,并根据所述物理属性特征获取对应的美颜程度参数,所述美颜程度参数是表示美颜处理程度的参数;Obtaining the physical attribute feature corresponding to each target area, and obtaining the corresponding beautification degree parameter according to the physical attribute feature, the beautification degree parameter is a parameter indicating the degree of beautification treatment; 根据所述美颜类别参数和美颜程度参数分别对每一类目标区域进行美颜处理。Perform beautification processing on each type of target area according to the beautification category parameter and the beautification degree parameter. 7.根据所述权利要求6所述的图像处理方法,其特征在于,所述获取每一个目标区域对应的物理属性特征,并根据所述物理属性特征获取对应的美颜程度参数包括以下步骤中至少一种:7. The image processing method according to claim 6, wherein said obtaining the corresponding physical attribute feature of each target area, and obtaining the corresponding beautification degree parameter according to the physical attribute feature includes the following steps at least one of: 获取每个目标区域对应的区域面积,并根据所述区域面积获取对应的美颜程度参数;Acquiring the area area corresponding to each target area, and obtaining the corresponding beautification degree parameter according to the area area; 获取每个目标区域对应的深度信息,并根据所述深度信息获取对应的美颜程度参数。Depth information corresponding to each target area is obtained, and a corresponding beautification degree parameter is obtained according to the depth information. 8.一种图像处理装置,其特征在于,所述装置包括:8. An image processing device, characterized in that the device comprises: 图像获取模块,用于获取待处理图像集合;An image acquisition module, configured to acquire a collection of images to be processed; 区域分类模块,用于获取所述待处理图像集合中每一张待处理图像中的目标区域,并将获取的目标区域进行分类;An area classification module, configured to acquire a target area in each image to be processed in the set of images to be processed, and classify the acquired target area; 美颜处理模块,用于获取每一类目标区域对应的美颜参数,并根据所述美颜参数分别对每一类目标区域进行美颜处理。The beautification processing module is configured to obtain the beautification parameters corresponding to each type of target area, and perform beautification processing on each type of target area according to the beautification parameters. 9.一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至7中任一项所述的图像处理方法。9. A computer-readable storage medium, on which a computer program is stored, wherein when the computer program is executed by a processor, the image processing method according to any one of claims 1 to 7 is implemented. 10.一种电子设备,包括存储器及处理器,所述存储器中储存有计算机可读指令,所述指令被所述处理器执行时,使得所述处理器执行如权利要求1至7中任一项所述的图像处理方法。10. An electronic device, comprising a memory and a processor, wherein computer-readable instructions are stored in the memory, and when the instructions are executed by the processor, the processor executes any one of claims 1 to 7. The image processing method described in the item.
CN201711045720.XA 2017-10-31 2017-10-31 Image processing method, device, computer-readable storage medium, and electronic device Pending CN107742274A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711045720.XA CN107742274A (en) 2017-10-31 2017-10-31 Image processing method, device, computer-readable storage medium, and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711045720.XA CN107742274A (en) 2017-10-31 2017-10-31 Image processing method, device, computer-readable storage medium, and electronic device

Publications (1)

Publication Number Publication Date
CN107742274A true CN107742274A (en) 2018-02-27

Family

ID=61233695

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711045720.XA Pending CN107742274A (en) 2017-10-31 2017-10-31 Image processing method, device, computer-readable storage medium, and electronic device

Country Status (1)

Country Link
CN (1) CN107742274A (en)

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108419028A (en) * 2018-03-20 2018-08-17 广东欧珀移动通信有限公司 Image processing method, device, computer-readable storage medium, and electronic device
CN108717530A (en) * 2018-05-21 2018-10-30 Oppo广东移动通信有限公司 Image processing method, device, computer readable storage medium and electronic equipment
CN108810406A (en) * 2018-05-23 2018-11-13 Oppo广东移动通信有限公司 Portrait light efficiency processing method, device, terminal and computer readable storage medium
CN108805103A (en) * 2018-06-29 2018-11-13 Oppo广东移动通信有限公司 Image processing method and device, electronic equipment and computer readable storage medium
CN108810407A (en) * 2018-05-30 2018-11-13 Oppo广东移动通信有限公司 An image processing method, mobile terminal and computer-readable storage medium
CN108881740A (en) * 2018-06-28 2018-11-23 Oppo广东移动通信有限公司 Image method and device, electronic equipment and computer readable storage medium
CN109242802A (en) * 2018-09-28 2019-01-18 Oppo广东移动通信有限公司 Image processing method, device, electronic equipment and computer-readable medium
CN109284694A (en) * 2018-08-31 2019-01-29 Oppo广东移动通信有限公司 Image processing method and apparatus, electronic device, computer-readable storage medium
CN109325926A (en) * 2018-09-30 2019-02-12 武汉斗鱼网络科技有限公司 Automatic filter implementation method, storage medium, equipment and system
CN109325905A (en) * 2018-08-29 2019-02-12 Oppo广东移动通信有限公司 Image processing method, apparatus, computer-readable storage medium and electronic device
CN109360254A (en) * 2018-10-15 2019-02-19 Oppo广东移动通信有限公司 Image processing method and apparatus, electronic device, computer-readable storage medium
CN109754375A (en) * 2018-12-25 2019-05-14 广州华多网络科技有限公司 Image processing method, system, computer equipment, storage medium and terminal
CN110611762A (en) * 2018-06-15 2019-12-24 卡西欧计算机株式会社 Image processing device, image processing method, and non-transitory computer-readable storage medium
CN110971827A (en) * 2019-12-09 2020-04-07 Oppo广东移动通信有限公司 Portrait mode shooting method and device, terminal equipment and storage medium
CN112686907A (en) * 2020-12-25 2021-04-20 联想(北京)有限公司 Image processing method, device and apparatus
WO2023045941A1 (en) * 2021-09-27 2023-03-30 上海商汤智能科技有限公司 Image processing method and apparatus, electronic device and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103605975A (en) * 2013-11-28 2014-02-26 小米科技有限责任公司 Image processing method and device and terminal device
US20150049924A1 (en) * 2013-08-15 2015-02-19 Xiaomi Inc. Method, terminal device and storage medium for processing image
CN104537630A (en) * 2015-01-22 2015-04-22 厦门美图之家科技有限公司 Method and device for image beautifying based on age estimation
CN105357449A (en) * 2015-11-26 2016-02-24 小米科技有限责任公司 Shooting method and device, and image processing method and apparatus
CN105513007A (en) * 2015-12-11 2016-04-20 惠州Tcl移动通信有限公司 Mobile terminal based photographing beautifying method and system, and mobile terminal
CN105824875A (en) * 2016-02-26 2016-08-03 维沃移动通信有限公司 Photo sharing method and mobile terminal

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150049924A1 (en) * 2013-08-15 2015-02-19 Xiaomi Inc. Method, terminal device and storage medium for processing image
CN103605975A (en) * 2013-11-28 2014-02-26 小米科技有限责任公司 Image processing method and device and terminal device
CN104537630A (en) * 2015-01-22 2015-04-22 厦门美图之家科技有限公司 Method and device for image beautifying based on age estimation
CN105357449A (en) * 2015-11-26 2016-02-24 小米科技有限责任公司 Shooting method and device, and image processing method and apparatus
CN105513007A (en) * 2015-12-11 2016-04-20 惠州Tcl移动通信有限公司 Mobile terminal based photographing beautifying method and system, and mobile terminal
CN105824875A (en) * 2016-02-26 2016-08-03 维沃移动通信有限公司 Photo sharing method and mobile terminal

Cited By (25)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108419028B (en) * 2018-03-20 2020-07-17 Oppo广东移动通信有限公司 Image processing method, image processing device, computer-readable storage medium and electronic equipment
CN108419028A (en) * 2018-03-20 2018-08-17 广东欧珀移动通信有限公司 Image processing method, device, computer-readable storage medium, and electronic device
CN108717530B (en) * 2018-05-21 2021-06-25 Oppo广东移动通信有限公司 Image processing method, image processing device, computer-readable storage medium and electronic equipment
CN108717530A (en) * 2018-05-21 2018-10-30 Oppo广东移动通信有限公司 Image processing method, device, computer readable storage medium and electronic equipment
CN108810406A (en) * 2018-05-23 2018-11-13 Oppo广东移动通信有限公司 Portrait light efficiency processing method, device, terminal and computer readable storage medium
CN108810406B (en) * 2018-05-23 2021-03-02 Oppo广东移动通信有限公司 Portrait light effect processing method, device, terminal and computer readable storage medium
CN108810407A (en) * 2018-05-30 2018-11-13 Oppo广东移动通信有限公司 An image processing method, mobile terminal and computer-readable storage medium
CN110611762A (en) * 2018-06-15 2019-12-24 卡西欧计算机株式会社 Image processing device, image processing method, and non-transitory computer-readable storage medium
US11100615B2 (en) 2018-06-15 2021-08-24 Casio Computer Co., Ltd. Image processing device, image processing method, and image processing program
CN108881740B (en) * 2018-06-28 2021-03-02 Oppo广东移动通信有限公司 Image method and apparatus, electronic device, computer-readable storage medium
CN108881740A (en) * 2018-06-28 2018-11-23 Oppo广东移动通信有限公司 Image method and device, electronic equipment and computer readable storage medium
WO2020001197A1 (en) * 2018-06-29 2020-01-02 Oppo广东移动通信有限公司 Image processing method, electronic device and computer readable storage medium
CN108805103A (en) * 2018-06-29 2018-11-13 Oppo广东移动通信有限公司 Image processing method and device, electronic equipment and computer readable storage medium
CN109325905B (en) * 2018-08-29 2023-10-13 Oppo广东移动通信有限公司 Image processing method, image processing device, computer readable storage medium and electronic apparatus
CN109325905A (en) * 2018-08-29 2019-02-12 Oppo广东移动通信有限公司 Image processing method, apparatus, computer-readable storage medium and electronic device
CN109284694A (en) * 2018-08-31 2019-01-29 Oppo广东移动通信有限公司 Image processing method and apparatus, electronic device, computer-readable storage medium
CN109242802A (en) * 2018-09-28 2019-01-18 Oppo广东移动通信有限公司 Image processing method, device, electronic equipment and computer-readable medium
CN109325926B (en) * 2018-09-30 2021-07-23 武汉斗鱼网络科技有限公司 Automatic filter implementation method, storage medium, device and system
CN109325926A (en) * 2018-09-30 2019-02-12 武汉斗鱼网络科技有限公司 Automatic filter implementation method, storage medium, equipment and system
CN109360254A (en) * 2018-10-15 2019-02-19 Oppo广东移动通信有限公司 Image processing method and apparatus, electronic device, computer-readable storage medium
CN109360254B (en) * 2018-10-15 2023-04-18 Oppo广东移动通信有限公司 Image processing method and device, electronic equipment and computer readable storage medium
CN109754375A (en) * 2018-12-25 2019-05-14 广州华多网络科技有限公司 Image processing method, system, computer equipment, storage medium and terminal
CN110971827A (en) * 2019-12-09 2020-04-07 Oppo广东移动通信有限公司 Portrait mode shooting method and device, terminal equipment and storage medium
CN112686907A (en) * 2020-12-25 2021-04-20 联想(北京)有限公司 Image processing method, device and apparatus
WO2023045941A1 (en) * 2021-09-27 2023-03-30 上海商汤智能科技有限公司 Image processing method and apparatus, electronic device and storage medium

Similar Documents

Publication Publication Date Title
CN107742274A (en) Image processing method, device, computer-readable storage medium, and electronic device
CN107808136B (en) Image processing method, image processing device, readable storage medium and computer equipment
EP3477931B1 (en) Image processing method and device, readable storage medium and electronic device
CN107730444B (en) Image processing method, image processing device, readable storage medium and computer equipment
CN107680128B (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
CN107993209B (en) Image processing method, image processing device, computer-readable storage medium and electronic equipment
CN107862663A (en) Image processing method, device, readable storage medium and computer equipment
CN107862658B (en) Image processing method, apparatus, computer-readable storage medium and electronic device
CN107945135B (en) Image processing method, image processing apparatus, storage medium, and electronic device
CN107730445A (en) Image processing method, device, storage medium and electronic equipment
CN107800965B (en) Image processing method, image processing device, computer-readable storage medium and computer equipment
CN107886484A (en) Beautifying method, device, computer readable storage medium and electronic device
CN107705248A (en) Image processing method, device, electronic device, and computer-readable storage medium
CN107945107A (en) Image processing method, device, computer-readable storage medium, and electronic device
CN107862274A (en) Beautifying method, device, electronic device and computer-readable storage medium
CN107766831A (en) Image processing method, device, mobile terminal and computer-readable recording medium
CN108022207A (en) Image processing method, device, storage medium and electronic equipment
CN107911625A (en) Light measuring method, light measuring device, readable storage medium and computer equipment
CN108537749A (en) Image processing method, device, mobile terminal and computer readable storage medium
CN108717530A (en) Image processing method, device, computer readable storage medium and electronic equipment
CN107862653A (en) Method for displaying image, device, storage medium and electronic equipment
CN107578372B (en) Image processing method, image processing device, computer-readable storage medium and electronic equipment
CN107743200A (en) Method, device, computer-readable storage medium and electronic device for taking pictures
CN107909058A (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
CN107820017A (en) Image capturing method, device, computer-readable recording medium and electronic equipment

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20180227

RJ01 Rejection of invention patent application after publication