[go: up one dir, main page]

CN114418865A - Image processing method, device, equipment and storage medium - Google Patents

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

Info

Publication number
CN114418865A
CN114418865A CN202011173511.5A CN202011173511A CN114418865A CN 114418865 A CN114418865 A CN 114418865A CN 202011173511 A CN202011173511 A CN 202011173511A CN 114418865 A CN114418865 A CN 114418865A
Authority
CN
China
Prior art keywords
image
target
processed
target object
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
CN202011173511.5A
Other languages
Chinese (zh)
Inventor
俞盼
吴岳霖
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN202011173511.5A priority Critical patent/CN114418865A/en
Publication of CN114418865A publication Critical patent/CN114418865A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/77Retouching; Inpainting; Scratch removal
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/58Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/583Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/40Filling a planar surface by adding surface attributes, e.g. colour or texture
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/30Determination of transform parameters for the alignment of images, i.e. image registration
    • G06T7/33Determination of transform parameters for the alignment of images, i.e. image registration using feature-based methods
    • G06T7/337Determination of transform parameters for the alignment of images, i.e. image registration using feature-based methods involving reference images or patches

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Library & Information Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Analysis (AREA)

Abstract

本公开是关于一种图像处理方法、装置、设备及存储介质,所述方法包括:获取待处理的目标图像;确定所述目标图像中的脸部区域以及目标区域,所述目标区域包括脸部区域及周边预设区域;响应于检测到所述目标区域中的目标物体满足处理条件,对所述目标物体进行处理;基于处理后的脸部区域和处理后的目标物体确定处理后的目标图像。本公开可以避免由于对脸部区域进行处理而导致目标区域发生扭曲变形的问题,可以避免图像失真,进而可以提高图像的处理质量。

Figure 202011173511

The present disclosure relates to an image processing method, apparatus, device, and storage medium. The method includes: acquiring a target image to be processed; determining a face area and a target area in the target image, where the target area includes a face area and the surrounding preset area; in response to detecting that the target object in the target area meets the processing conditions, the target object is processed; the processed target image is determined based on the processed face area and the processed target object . The present disclosure can avoid the problem of distortion and deformation of the target area due to the processing of the face area, avoid image distortion, and further improve the processing quality of the image.

Figure 202011173511

Description

图像处理方法、装置、设备及存储介质Image processing method, device, device and storage medium

技术领域technical field

本公开涉及终端技术领域,尤其涉及一种图像处理方法、装置、设备及存储介质。The present disclosure relates to the field of terminal technologies, and in particular, to an image processing method, apparatus, device, and storage medium.

背景技术Background technique

随着智能手机等终端设备的普及,越来越多的用户使用手机来拍摄图像。出于图像美观的需求,很多用户会对拍摄的图像进行处理。针对这一需求,许多美颜应用程序应运而生。现如今,大部分终端设备自带的相机也加入了美颜功能,以在用户拍照过程中对拍摄的用户图像进行处理。With the popularization of terminal devices such as smartphones, more and more users use mobile phones to capture images. For the needs of beautiful images, many users will process the captured images. In response to this demand, many beauty apps have emerged. Nowadays, most of the cameras that come with terminal devices also add a beauty function to process the captured user images during the user's photographing process.

然而,相关技术中的图像处理算法通常仅针对用户的面部进行处理,导致发生图像失真,影响图像处理的质量。However, the image processing algorithms in the related art usually only process the user's face, resulting in image distortion and affecting the quality of image processing.

发明内容SUMMARY OF THE INVENTION

为克服相关技术中存在的问题,本公开实施例提供一种图像处理方法、装置、设备及存储介质,用以解决相关技术中的缺陷。In order to overcome the problems existing in the related art, the embodiments of the present disclosure provide an image processing method, apparatus, device, and storage medium, so as to solve the defects in the related art.

根据本公开实施例的第一方面,提供一种图像处理方法,所述方法包括:According to a first aspect of the embodiments of the present disclosure, there is provided an image processing method, the method comprising:

获取待处理的目标图像;Get the target image to be processed;

在所述目标图像中确定目标区域,所述目标区域包括脸部区域及周边预设区域;determining a target area in the target image, the target area includes a face area and a surrounding preset area;

响应于检测到所述目标区域中的目标物体满足处理条件,对所述目标物体进行处理;processing the target object in response to detecting that the target object in the target area satisfies the processing condition;

基于处理后的脸部区域和处理后的处理后的目标物体确定处理后的目标图像。The processed target image is determined based on the processed face region and the processed processed target object.

在一实施例中,所述目标物体满足处理条件,包括以下至少一项:In one embodiment, the target object satisfies processing conditions, including at least one of the following:

所述目标物体处于所述目标图像中的位置满足设定位置条件;The position of the target object in the target image satisfies the set position condition;

所述目标物体在所述目标图像中的比例满足设定比例条件。The scale of the target object in the target image satisfies the set scale condition.

在一实施例中,所述目标物体包括手部;In one embodiment, the target object includes a hand;

所述对所述目标物体进行处理,包括:The processing of the target object includes:

确定所述手部的特征信息;determining the characteristic information of the hand;

基于所述特征信息在预设手部图像库中查找与所述手部匹配的样本图像;Searching for a sample image matching the hand in a preset hand image library based on the feature information;

基于所述样本图像对所述手部进行处理处理后的目标物体。The target object after processing the hand based on the sample image.

在一实施例中,所述特征信息包括手掌和手指的目标比例;In one embodiment, the feature information includes target ratios of palms and fingers;

所述基于所述特征信息在预设手部图像库中查找与所述手部匹配的样本图像,包括:The searching for a sample image matching the hand in the preset hand image library based on the feature information includes:

在所述预设手部图像库中查找手掌和手指的比例与所述目标比例最相近的样本图像。In the preset hand image library, a sample image whose proportions of the palm and fingers are most similar to the target proportion is searched.

在一实施例中,所述基于所述样本图像对所述手部进行处理,包括:In one embodiment, the processing of the hand based on the sample image includes:

基于所述样本图像中手掌和手指的比例调整所述手部中手掌和手指的目标比例。The target scale of the palm and the fingers in the hand is adjusted based on the scale of the palm and the fingers in the sample image.

在一实施例中,所述基于所述样本图像对所述手部进行处理,包括:In one embodiment, the processing of the hand based on the sample image includes:

获取所述脸部区域的第一图像参数以及所述样本图像的第二图像参数,所述第一图像参数和第二图像参数包括颜色和质感中的至少一项;acquiring the first image parameter of the face region and the second image parameter of the sample image, the first image parameter and the second image parameter including at least one of color and texture;

基于所述第一图像参数和所述第二图像参数对所述手部的图像参数进行处理。The image parameters of the hand are processed based on the first image parameters and the second image parameters.

在一实施例中,所述基于处理后的脸部区域和处理后的目标物体确定处理后的目标图像,包括:In one embodiment, determining the processed target image based on the processed face region and the processed target object includes:

基于所述目标图像中脸部区域与所述目标物体的第一关系,确定所述处理后的脸部区域以及所述处理后的目标物体之间的第二位置关系;determining a second positional relationship between the processed face region and the processed target object based on the first relationship between the face region in the target image and the target object;

基于所述第二位置关系调整所述处理后的脸部区域对应的第一图层以及所述处理后的目标物体对应的第二图层之间的位置关系,得到处理后的目标图像。Based on the second positional relationship, the positional relationship between the first layer corresponding to the processed face region and the second layer corresponding to the processed target object is adjusted to obtain a processed target image.

在一实施例中,所述方法还包括:In one embodiment, the method further includes:

响应于检测到调整后的所述第一图层以及所述第二图层之间存在空白区域,采用预设的图像填充方式对所述空白区域进行填充。In response to detecting that there is a blank area between the adjusted first layer and the second layer, the blank area is filled with a preset image filling method.

根据本公开实施例的第二方面,提供一种图像处理装置,所述装置包括:According to a second aspect of the embodiments of the present disclosure, there is provided an image processing apparatus, the apparatus comprising:

目标图像获取模块,用于获取待处理的目标图像;a target image acquisition module, used to acquire the target image to be processed;

目标区域确定模块,用于在所述目标图像中确定目标区域,所述目标区域包括脸部区域以及周边预设区域;a target area determination module, configured to determine a target area in the target image, the target area including a face area and a peripheral preset area;

目标物体处理模块,用于响应于检测到所述目标区域中的目标物体满足处理条件,对所述目标物体进行处理;a target object processing module, configured to process the target object in response to detecting that the target object in the target area meets the processing conditions;

处理图像确定模块,用于基于处理后的脸部区域和处理后的目标物体确定处理后的目标图像。The processed image determination module is configured to determine the processed target image based on the processed face region and the processed target object.

在一实施例中,所述目标物体满足处理条件,包括以下至少一项:In one embodiment, the target object satisfies processing conditions, including at least one of the following:

所述目标物体处于所述目标图像中的位置满足设定位置条件;The position of the target object in the target image satisfies the set position condition;

所述目标物体在所述目标图像中的比例满足设定比例条件。The scale of the target object in the target image satisfies the set scale condition.

在一实施例中,所述目标区域包括手部;In one embodiment, the target area includes a hand;

所述目标物体处理模块,包括:The target object processing module includes:

特征信息确定单元,用于确定所述手部的特征信息;a feature information determination unit, configured to determine the feature information of the hand;

样本图像查找单元,用于基于所述特征信息在预设手部图像库中查找与所述手部匹配的样本图像;a sample image search unit, configured to search for a sample image matching the hand in a preset hand image library based on the feature information;

目标物体处理单元,用于基于所述样本图像对所述手部进行处理。A target object processing unit, configured to process the hand based on the sample image.

在一实施例中,所述特征信息包括手掌和手指的目标比例;In one embodiment, the feature information includes target ratios of palms and fingers;

所述样本图像查找单元还用于在所述预设手部图像库中查找手掌和手指的比例与所述目标比例最相近的样本图像。The sample image search unit is further configured to search the preset hand image library for a sample image whose proportions of the palm and fingers are the closest to the target proportion.

在一实施例中,所述目标物体处理单元还用于基于所述样本图像中手掌和手指的比例调整所述手部中手掌和手指的目标比例。In one embodiment, the target object processing unit is further configured to adjust the target ratio of the palm and the fingers in the hand based on the ratio of the palm and the fingers in the sample image.

在一实施例中,所述目标物体处理单元还用于:In one embodiment, the target object processing unit is further used for:

获取所述脸部区域的第一图像参数以及所述样本图像的第二图像参数,所述第一图像参数和第二图像参数包括颜色和质感中的至少一项;acquiring the first image parameter of the face region and the second image parameter of the sample image, the first image parameter and the second image parameter including at least one of color and texture;

基于所述第一图像参数和所述第二图像参数对所述手部的图像参数进行处理。The image parameters of the hand are processed based on the first image parameters and the second image parameters.

在一实施例中,所述处理图像确定模块,包括:In one embodiment, the processing image determination module includes:

位置关系确定单元,用于基于所述目标图像中脸部区域与所述目标物体的第一关系,确定所述处理后的脸部区域以及所述处理后的目标物体之间的第二位置关系;a positional relationship determining unit, configured to determine a second positional relationship between the processed face region and the processed target object based on the first relationship between the face region in the target image and the target object ;

处理图像确定单元,用于基于所述第二位置关系调整所述处理后的脸部区域对应的第一图层以及所述处理后的目标物体对应的第二图层之间的位置关系,得到处理后的目标图像。A processed image determination unit, configured to adjust the positional relationship between the first layer corresponding to the processed face region and the second layer corresponding to the processed target object based on the second positional relationship, to obtain The processed target image.

在一实施例中,所述处理图像确定模块,还包括:In one embodiment, the processing image determination module further includes:

空白区域填充单元,用于响应于检测到调整后的所述第一图层以及所述第二图层之间存在空白区域,采用预设的图像填充方式对所述空白区域进行填充。The blank area filling unit is configured to fill the blank area with a preset image filling method in response to detecting that there is a blank area between the adjusted first layer and the second layer.

根据本公开实施例的第三方面,提供一种电子设备,所述设备包括:According to a third aspect of the embodiments of the present disclosure, there is provided an electronic device, the device comprising:

处理器以及用于存储处理器可执行指令的存储器;a processor and a memory for storing instructions executable by the processor;

其中,所述处理器被配置为:wherein the processor is configured to:

获取待处理的目标图像;Get the target image to be processed;

确定所述目标图像中的脸部区域以及目标区域,所述目标区域包括脸部区域及周边预设区域;Determine the face area and the target area in the target image, and the target area includes the face area and the surrounding preset area;

响应于检测到所述目标区域中的目标物体满足处理条件,对所述目标物体进行处理;processing the target object in response to detecting that the target object in the target area satisfies the processing condition;

基于处理后的脸部区域和处理后的目标物体确定处理后的目标图像。The processed target image is determined based on the processed face region and the processed target object.

根据本公开实施例的第四方面,提供一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现:According to a fourth aspect of the embodiments of the present disclosure, there is provided a computer-readable storage medium on which a computer program is stored, and the program is executed by a processor to realize:

获取待处理的目标图像;Get the target image to be processed;

确定所述目标图像中的脸部区域以及目标区域,所述目标区域包括脸部区域及周边预设区域;Determine the face area and the target area in the target image, and the target area includes the face area and the surrounding preset area;

响应于检测到所述目标区域中的目标物体满足处理条件,对所述目标物体进行处理;processing the target object in response to detecting that the target object in the target area satisfies the processing condition;

基于处理后的脸部区域和处理后的目标物体确定处理后的目标图像。The processed target image is determined based on the processed face region and the processed target object.

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

本公开通过获取待处理的目标图像,并确定所述目标图像中的脸部区域以及目标区域,然后响应于检测到所述目标区域中的目标物体满足处理条件,对所述目标物体进行处理,进而基于处理后的脸部区域和处理后的目标物体确定处理后的目标图像,可以避免由于对脸部区域进行处理而导致目标区域发生扭曲变形的问题,可以避免图像失真,进而可以提高图像的处理质量。The present disclosure obtains the target image to be processed, determines the face area and the target area in the target image, and then processes the target object in response to detecting that the target object in the target area meets the processing conditions, Then, the processed target image is determined based on the processed face area and the processed target object, which can avoid the problem of distortion of the target area due to the processing of the face area, avoid image distortion, and improve the image quality. Handling quality.

应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本公开。It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure.

附图说明Description of drawings

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

图1是根据一示例性实施例示出的一种图像处理方法的流程图;1 is a flowchart of an image processing method according to an exemplary embodiment;

图2是根据一示例性实施例示出的如何对所述目标物体进行处理的流程图;FIG. 2 is a flowchart showing how to process the target object according to an exemplary embodiment;

图3是根据一示例性实施例示出的如何基于所述样本图像对所述目标物体进行处理的流程图;3 is a flowchart showing how to process the target object based on the sample image according to an exemplary embodiment;

图4是根据一示例性实施例示出的如何基于处理后的脸部区域和处理后的目标物体确定处理后的目标图像的流程图;4 is a flowchart illustrating how to determine a processed target image based on a processed face region and a processed target object, according to an exemplary embodiment;

图5是根据一示例性实施例示出的一种图像处理装置的框图;5 is a block diagram of an image processing apparatus according to an exemplary embodiment;

图6是根据又一示例性实施例示出的一种图像处理装置的框图;6 is a block diagram of an image processing apparatus according to another exemplary embodiment;

图7是根据一示例性实施例示出的一种电子设备的框图。Fig. 7 is a block diagram of an electronic device according to an exemplary embodiment.

具体实施方式Detailed ways

这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施例并不代表与本公开相一致的所有实施例。相反,它们仅是与如所附权利要求书中所详述的、本公开的一些方面相一致的装置和方法的例子。Exemplary embodiments will be described in detail herein, examples of which are illustrated in the accompanying drawings. Where the following description refers to the drawings, the same numerals in different drawings refer to the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present disclosure as recited in the appended claims.

图1是根据一示例性实施例示出的一种图像处理方法的流程图;本实施例的方法可以应用于具有图像处理功能的终端设备(如,智能手机、平板电脑、笔记本电脑或可穿戴设备等)。FIG. 1 is a flowchart of an image processing method according to an exemplary embodiment; the method in this embodiment can be applied to a terminal device with image processing function (eg, a smart phone, a tablet computer, a notebook computer, or a wearable device) Wait).

如图1所示,该方法包括以下步骤S101-S104:As shown in Figure 1, the method includes the following steps S101-S104:

在步骤S101中,获取待处理的目标图像。In step S101, a target image to be processed is acquired.

本实施例中,当用户通过终端设备的图像采集装置(如,摄像头等)采集目标图像后,终端设备可以通过自身的图像处理装置获取该目标图像。In this embodiment, after the user collects the target image through the image acquisition device (eg, camera, etc.) of the terminal device, the terminal device can acquire the target image through its own image processing device.

其中,上述目标图像可以为终端设备在采集用户图像过程中获取的预览图像,或者,可以为用户从保存在终端设备的电子相册中选取的待处理图像,本实施例对此不进行限定。The above target image may be a preview image acquired by the terminal device in the process of collecting the user's image, or may be an image to be processed selected by the user from an electronic album stored in the terminal device, which is not limited in this embodiment.

在步骤S102中,确定所述目标图像中的脸部区域以及目标区域。In step S102, the face area and the target area in the target image are determined.

本实施例中,当获取待处理的目标图像后,终端设备可以确定所述目标图像中的脸部区域以及目标区域,其中,所述目标区域包括脸部区域以及周边预设区域,其中,脸部区域可以为用户的人脸对应于目标图像中的区域。In this embodiment, after acquiring the target image to be processed, the terminal device can determine the face area and the target area in the target image, where the target area includes a face area and a surrounding preset area, wherein the face area The partial region may be the region of the user's face corresponding to the target image.

举例来说,当获取上述目标图像后,可以针对该目标图像进行人脸识别,以将识别出当人脸所在的区域确定为人脸区域;进而可以将该人脸区域当周边预设区域(如,人脸区域周围的预设大小的区域)确定为目标区域。For example, after obtaining the above-mentioned target image, face recognition can be performed on the target image to determine the area where the recognized face is located as the face area; and then the face area can be regarded as the surrounding preset area (such as , the preset size area around the face area) is determined as the target area.

在步骤S103中,响应于检测到所述目标区域中的目标物体满足处理条件,对所述目标物体进行处理。In step S103, in response to detecting that the target object in the target area satisfies the processing condition, the target object is processed.

本实施例中,当确定所述目标图像中的脸部区域以及目标区域后,可以检测到目标区域中是否存在目标物体(如,用户的手部,或筷子、刀、叉等餐具),进而可以当存在目标物体时,进一步检测该目标物体是否满足处理条件;在此基础上,当确定该目标物体满足处理条件时,对该目标物体进行处理,得到处理后的目标物体。In this embodiment, after determining the face area and the target area in the target image, it can be detected whether there is a target object (eg, the user's hand, or cutlery such as chopsticks, knives, and forks) in the target area, and then When there is a target object, it can be further detected whether the target object satisfies the processing conditions; on this basis, when it is determined that the target object satisfies the processing conditions, the target object is processed to obtain the processed target object.

在一实施例中,上述目标物体满足处理条件,可以包括以下至少一项:In one embodiment, the above-mentioned target object satisfies the processing conditions, which may include at least one of the following:

(1)所述目标物体处于所述目标图像中的位置满足设定位置条件,如处于图像的中央区域,或者处于脸部前方或下巴两侧等预设区域;(1) The position of the target object in the target image satisfies the set position conditions, such as being in the central area of the image, or in a preset area such as in front of the face or on both sides of the chin;

(2)所述目标物体在所述目标图像中的比例满足设定比例条件,如目标物体占目标图像的比例大于或等于设定比例阈值等。(2) The ratio of the target object in the target image satisfies the set ratio condition, for example, the ratio of the target object to the target image is greater than or equal to the set ratio threshold.

举例来说,当确定所述目标图像中的脸部区域后,可以基于预设的美颜方法对目标图像中的脸部区域进行美化处理。其中,预设的美颜方法可以基于实际需要进行设置,如设置为进行瘦脸、美白、祛痘、大眼、磨皮等处理,本实施例对此不进行限定。另一方面,当确定所述目标图像中的脸部区域,并基于该脸部区域确定上述目标区域后,可以检测该目标区域中的目标物体是否满足处理条件,进而在确定满足条件时,对目标图像中的目标物体进行处理。以目标物体为筷子等长条状物体为例,当检测到该目标物体满足处理条件,例如,该筷子处于目标图像中的脸部前方或下巴两侧等预设区域,且该筷子在目标图像中的比例大于设定比例阈值(如,10%),则可以依据该物体的常规形象(如,细长条状)对当前目标图像中发生弯折的筷子进行处理,以使处理后的筷子的形状恢复原状,即恢复成在对人脸进行美化处理之前所呈现的细长条状。For example, after determining the face area in the target image, beautification processing may be performed on the face area in the target image based on a preset beauty method. The preset beautifying method may be set based on actual needs, for example, it is set to perform treatments such as face-lifting, whitening, acne removal, eye enlargement, skin resurfacing, etc., which is not limited in this embodiment. On the other hand, when the face area in the target image is determined, and the above-mentioned target area is determined based on the face area, it can be detected whether the target object in the target area satisfies the processing condition, and then when it is determined that the condition is satisfied, the The target object in the target image is processed. Taking the target object as an elongated object such as chopsticks as an example, when it is detected that the target object meets the processing conditions, for example, the chopsticks are located in a preset area such as the front of the face or the sides of the chin in the target image, and the chopsticks are in the target image. If the ratio in the target image is greater than the set ratio threshold (for example, 10%), the chopsticks that are bent in the current target image can be processed according to the normal image of the object (for example, a slender strip), so that the processed chopsticks The shape of the face is restored to its original shape, that is, to the slender strip that it appeared before the beautification process was performed on the face.

在另一实施例中,上述对所述目标物体进行处理的方式可以参见下述图2所示实施例,在此先不进行详述。In another embodiment, for the above-mentioned manner of processing the target object, reference may be made to the embodiment shown in FIG. 2 below, which will not be described in detail here.

在步骤S104中,基于处理后的脸部区域和处理后的目标物体确定处理后的目标图像。In step S104, a processed target image is determined based on the processed face region and the processed target object.

本实施例中,当响应于检测到所述目标区域中的目标物体满足处理条件,对所述目标物体进行处理后,可以基于处理后的脸部区域和处理后的目标物体确定处理后的目标图像。In this embodiment, after processing the target object in response to detecting that the target object in the target area meets the processing conditions, the processed target may be determined based on the processed face area and the processed target object image.

举例来说,当对目标区域中的目标物体进行处理后,可以在原来目标图像的基础上替换掉处理后的脸部区域和处理后的目标物体,得到处理后的目标图像。For example, after the target object in the target area is processed, the processed face area and the processed target object can be replaced on the basis of the original target image to obtain the processed target image.

在另一实施例中,上述对所述目标物体进行处理的方式可以参见下述图2所示实施例,在此先不进行详述。In another embodiment, for the above-mentioned manner of processing the target object, reference may be made to the embodiment shown in FIG. 2 below, which will not be described in detail here.

由上述描述可知,本实施例的方法通过获取待处理的目标图像,并确定所述目标图像中的脸部区域以及目标区域,然后响应于检测到所述目标区域中的目标物体满足处理条件,对所述目标物体进行处理,进而基于处理后的脸部区域和处理后的目标物体确定处理后的目标图像,可以避免由于对脸部区域进行处理而导致目标区域发生扭曲变形的问题,可以避免图像失真,进而可以提高图像的处理质量。As can be seen from the above description, the method of this embodiment obtains the target image to be processed, determines the face area and the target area in the target image, and then responds to detecting that the target object in the target area satisfies the processing conditions, Processing the target object, and then determining the processed target image based on the processed face region and the processed target object, so as to avoid the problem that the target region is distorted due to the processing of the face region. The image is distorted, which in turn can improve the processing quality of the image.

图2是根据一示例性实施例示出的如何对所述目标物体进行处理的流程图;本实施例在上述实施例的基础上以如何对所述目标物体进行处理为例进行示例性说明。上述目标物体可以包括手部。在此基础上,如图2所示,上述步骤S103中所述对所述目标物体进行处理,可以包括以下步骤S201-S203:FIG. 2 is a flow chart showing how to process the target object according to an exemplary embodiment; this embodiment, on the basis of the above-mentioned embodiment, takes how to process the target object as an example to illustrate. The aforementioned target object may include a hand. On this basis, as shown in FIG. 2 , the processing of the target object in the above step S103 may include the following steps S201-S203:

在步骤S201中,确定所述手部的特征信息。In step S201, the characteristic information of the hand is determined.

在一实施例中,上述特征信息可以包括手掌和手指的目标比例。In one embodiment, the above-mentioned feature information may include target ratios of palms and fingers.

在步骤S202中,基于所述特征信息在预设手部图像库中查找与所述手部匹配的样本图像。In step S202, a sample image matching the hand is searched in a preset hand image library based on the feature information.

举例来说,若上述特征信息包括手掌和手指的目标比例,如25%,则可以确定预设手部图像库中各个样本图像中的手掌和手指的比例,进而可以从中挑选出与目标比例最相近的一幅样本图像。其中,上述手部图像库中可以预先设置多幅符合审美需求的样本图像,本实施例对此不进行限定。For example, if the above-mentioned feature information includes the target ratio of palm and fingers, such as 25%, the ratio of palm and fingers in each sample image in the preset hand image library can be determined, and then the ratio with the target ratio that is the most suitable can be selected. A similar sample image. Wherein, a plurality of sample images that meet aesthetic requirements may be preset in the above-mentioned hand image library, which is not limited in this embodiment.

在步骤S203中,基于所述样本图像对所述手部进行处理。In step S203, the hand is processed based on the sample image.

本实施例中,当基于所述特征信息在预设手部图像库中查找与所述手部匹配的样本图像后,可以基于所述样本图像对所述手部进行处理。In this embodiment, after searching for a sample image matching the hand in a preset hand image library based on the feature information, the hand may be processed based on the sample image.

举例来说,在特征信息包括手掌和手指的目标比例的情况下,可以基于所述样本图像中手掌和手指的比例调整所述手部中手掌和手指的目标比例,比如可以使目标图像中的手掌和手指的目标比例与样本图像中手掌和手指的比例相同,并可以对手部的形状进行正畸、调整美化,使得手部更加美观,符合设定的审美需求。For example, in the case where the feature information includes the target ratio of the palm and the fingers, the target ratio of the palm and the fingers in the hand can be adjusted based on the ratio of the palm and the fingers in the sample image, for example, the target ratio in the target image can be adjusted. The target ratio of the palm and fingers is the same as the ratio of the palm and fingers in the sample image, and the shape of the hand can be orthodontic, adjusted and beautified, making the hand more beautiful and meeting the set aesthetic needs.

再举例来说,图3是根据一示例性实施例示出的如何基于所述样本图像对所述目标物体进行处理的流程图。如图3所示,上述步骤303可以包括以下步骤S301-S302:For another example, FIG. 3 is a flowchart showing how to process the target object based on the sample image according to an exemplary embodiment. As shown in FIG. 3, the above step 303 may include the following steps S301-S302:

在步骤S301中,获取所述脸部区域的第一图像参数以及所述样本图像的第二图像参数。In step S301, a first image parameter of the face region and a second image parameter of the sample image are acquired.

其中,所述第一图像参数和第二图像参数包括颜色和质感中的至少一项。举例来说,上述图像参数中的颜色可以对应于人体的肤色(如,白、黑、黄,或亮白、暗沉等),而图像参数中的质感可以对应于人体的肤质(如,粗糙或细腻等)。Wherein, the first image parameter and the second image parameter include at least one of color and texture. For example, the colors in the above image parameters may correspond to the skin tone of the human body (eg, white, black, yellow, or bright white, dull, etc.), and the textures in the image parameters may correspond to the skin texture of the human body (eg, rough or fine, etc.).

在步骤S302中,基于所述第一图像参数和所述第二图像参数对所述手部的图像参数进行处理。In step S302, the image parameters of the hand are processed based on the first image parameters and the second image parameters.

本实施例中,当获取所述脸部区域的第一图像参数以及所述样本图像的第二图像参数后,可以基于目标图像中的脸部区域的颜色和/或质感,以及样本图像中手部的颜色和/或质感对当前待处理图像中的手部进行处理,以使当前待处理图像中的手部更加美观。In this embodiment, after acquiring the first image parameter of the face area and the second image parameter of the sample image, the color and/or texture of the face area in the target image and the hand in the sample image may be The hand in the current image to be processed is processed according to the color and/or texture of the part, so as to make the hand in the current image to be processed more beautiful.

由上述描述可知,本实施例通过确定所述手部的特征信息,并基于所述特征信息在预设手部图像库中查找与所述手部匹配的样本图像,以及基于所述样本图像对所述手部进行处理,可以实现基于目标区域中手部的特征信息获取预设手部图像库中相匹配的样本图像,进而可以基于样本图像对目标区域中的手部进行美化处理,可以提高对目标图像中脸部区域之外的目标区域中的目标物体进行处理的质量,进而可以提高图像的处理质量。It can be seen from the above description that in this embodiment, the characteristic information of the hand is determined, a sample image matching the hand is searched in a preset hand image library based on the characteristic information, and a pair of sample images matching the hand is based on the sample image. The hand processing can achieve the acquisition of a matching sample image in the preset hand image library based on the feature information of the hand in the target area, and then the hand in the target area can be beautified based on the sample image, which can improve the performance of the hand. The processing quality of the target object in the target area other than the face area in the target image can improve the processing quality of the image.

图4是根据一示例性实施例示出的如何基于处理后的脸部区域和处理后的目标物体确定处理后的目标图像的流程图;本实施例在上述实施例的基础上以如何基于处理后的脸部区域和处理后的目标物体确定处理后的目标图像为例进行示例性说明。如图4所示,上述步骤S104中所述基于处理后的脸部区域和处理后的目标物体确定处理后的目标图像,可以包括以下步骤S401-S402:FIG. 4 is a flowchart showing how to determine a processed target image based on a processed face region and a processed target object according to an exemplary embodiment; this embodiment is based on the above The facial region and the processed target object are determined as an example to illustrate the processed target image. As shown in FIG. 4 , the determination of the processed target image based on the processed face region and the processed target object in the above step S104 may include the following steps S401-S402:

在步骤S401中,基于所述目标图像中脸部区域与所述目标物体的第一关系,确定所述处理后的脸部区域以及所述处理后的目标物体之间的第二位置关系。In step S401, a second positional relationship between the processed face region and the processed target object is determined based on the first relationship between the face region in the target image and the target object.

本实施例中,当响应于检测到所述目标区域中的目标物体满足处理条件,对所述目标物体进行处理后,可以确定所述目标图像中脸部区域与所述目标物体的第一关系,进而可以基于该第一关系确定所述处理后的脸部区域以及所述处理后的目标物体之间的第二位置关系。In this embodiment, after processing the target object in response to detecting that the target object in the target area meets the processing conditions, the first relationship between the face area in the target image and the target object can be determined , and then a second positional relationship between the processed face region and the processed target object may be determined based on the first relationship.

在步骤S402中,基于所述第二位置关系调整所述处理后的脸部区域对应的第一图层以及所述处理后的目标物体对应的第二图层之间的位置关系。In step S402, the positional relationship between the first layer corresponding to the processed face region and the second layer corresponding to the processed target object is adjusted based on the second positional relationship.

本实施例中,当基于所述目标图像中脸部区域与所述目标物体的第一关系后,可以基于该第一关系确定所述处理后的脸部区域以及所述处理后的目标物体之间的第二位置关系,进而可以基于所述第二位置关系调整所述处理后的脸部区域对应的第一图层以及所述处理后的目标物体对应的第二图层之间的位置关系,以使处理后的目标物体与脸部区域的位置关系保持不变。In this embodiment, based on the first relationship between the face region in the target image and the target object, the relationship between the processed face region and the processed target object may be determined based on the first relationship. The second positional relationship between the two, and then the positional relationship between the first layer corresponding to the processed face region and the second layer corresponding to the processed target object can be adjusted based on the second positional relationship. , so that the positional relationship between the processed target object and the face area remains unchanged.

在步骤S403中,响应于检测到调整后的所述第一图层以及所述第二图层之间存在空白区域,采用预设的图像填充方式对所述空白区域进行填充,得到处理后的目标图像。In step S403, in response to detecting that there is a blank area between the adjusted first layer and the second layer, use a preset image filling method to fill the blank area to obtain a processed image target image.

本实施例中,当基于所述第二位置关系调整所述处理后的脸部区域对应的第一图层以及所述处理后的目标物体对应的第二图层之间的位置关系后,还可以检测到调整后的所述第一图层以及所述第二图层之间是否存在空白区域,进而当检测到第一图层以及第二图层之间存在空白区域时,采用预设的图像填充方式对所述空白区域进行填充,得到处理后的目标图像。In this embodiment, after adjusting the positional relationship between the first layer corresponding to the processed face region and the second layer corresponding to the processed target object based on the second positional relationship, the It can be detected whether there is a blank area between the adjusted first layer and the second layer, and then when it is detected that there is a blank area between the first layer and the second layer, the preset The blank area is filled in the image filling method to obtain the processed target image.

其中,上述预设的图像填充方式可以基于实际业务需要进行设置,如设置为相关技术中基于内容识别进行填充的方式,本实施例对此不进行限定。Wherein, the above-mentioned preset image filling method may be set based on actual business needs. For example, it is set as the filling method based on content recognition in the related art, which is not limited in this embodiment.

由上述描述可知,本实施例通过基于所述目标图像中脸部区域与所述目标物体的第一关系,确定所述处理后的脸部区域以及所述处理后的目标物体之间的第二位置关系,并基于所述第二位置关系调整所述处理后的脸部区域对应的第一图层以及所述处理后的目标物体对应的第二图层之间的位置关系,可以实现基于目标图像中脸部区域与目标区域的关系准确的确定处理后的脸部区域对应的第一图层以及所述处理后的目标物体对应的第二图层之间的位置关系,确保图像中人脸与目标区域之间的位置关系不变,并且通过响应于检测到调整后的所述第一图层以及所述第二图层之间存在空白区域,采用预设的图像填充方式对所述空白区域进行填充,可以避免由于图像处理产生空白区域,提高图像的处理质量。It can be seen from the above description that in this embodiment, the second relationship between the processed face region and the processed target object is determined based on the first relationship between the face region in the target image and the target object. positional relationship, and adjust the positional relationship between the first layer corresponding to the processed face region and the second layer corresponding to the processed target object based on the second positional relationship, so that target-based The relationship between the face area and the target area in the image accurately determines the positional relationship between the first layer corresponding to the processed face area and the second layer corresponding to the processed target object, so as to ensure the face in the image. The positional relationship with the target area remains unchanged, and in response to detecting that there is a blank area between the adjusted first layer and the second layer, a preset image filling method is used to fill the blank area. Filling the area can avoid blank areas due to image processing and improve the processing quality of the image.

图5是根据一示例性实施例示出的一种图像处理装置的框图;本实施例的装置可以应用于具有图像处理功能的终端设备(如,智能手机、平板电脑、笔记本电脑或可穿戴设备等)。如图5所示,该装置包括:目标图像获取模块110、目标区域确定模块120、目标物体处理模块130以及处理图像确定模块140,其中:FIG. 5 is a block diagram of an image processing apparatus according to an exemplary embodiment; the apparatus in this embodiment can be applied to a terminal device with an image processing function (such as a smart phone, a tablet computer, a notebook computer, or a wearable device, etc.) ). As shown in FIG. 5 , the device includes: a target image acquisition module 110, a target area determination module 120, a target object processing module 130, and a processed image determination module 140, wherein:

目标图像获取模块110,用于获取待处理的目标图像;a target image acquisition module 110, configured to acquire a target image to be processed;

目标区域确定模块120,用于在所述目标图像中确定目标区域,所述目标区域包括脸部区域以及周边预设区域;a target area determination module 120, configured to determine a target area in the target image, where the target area includes a face area and a peripheral preset area;

目标物体处理模块130,用于响应于检测到所述目标区域中的目标物体满足处理条件,对所述目标物体进行处理;a target object processing module 130, configured to process the target object in response to detecting that the target object in the target area meets the processing condition;

处理图像确定模块140,用于基于处理后的脸部区域和处理后的目标物体确定处理后的目标图像。The processed image determination module 140 is configured to determine the processed target image based on the processed face region and the processed target object.

由上述描述可知,本实施例的装置通过获取待处理的目标图像,并确定所述目标图像中的脸部区域以及目标区域,然后响应于检测到所述目标区域中的目标物体满足处理条件,对所述目标物体进行处理,进而基于处理后的脸部区域和处理后的目标物体确定处理后的目标图像,可以避免由于对脸部区域进行处理而导致目标区域发生扭曲变形的问题,可以避免图像失真,进而可以提高图像的处理质量。It can be seen from the above description that the device of this embodiment obtains the target image to be processed, determines the face area and the target area in the target image, and then responds to detecting that the target object in the target area satisfies the processing conditions, Processing the target object, and then determining the processed target image based on the processed face area and the processed target object, so as to avoid the problem that the target area is distorted due to the processing of the face area. The image is distorted, which in turn can improve the processing quality of the image.

图6是根据又一示例性实施例示出的一种图像处理装置的框图;本实施例的装置可以应用于具有图像处理功能的终端设备(如,智能手机、平板电脑、笔记本电脑或可穿戴设备等)。其中:目标图像获取模块210、目标区域确定模块220、目标物体处理模块230以及处理图像确定模块240与前述图5所示实施例中的目标图像获取模块110、目标区域确定模块120、目标物体处理模块130以及处理图像确定模块140的功能相同,在此不进行赘述。FIG. 6 is a block diagram of an image processing apparatus according to another exemplary embodiment; the apparatus in this embodiment can be applied to a terminal device with an image processing function (eg, a smart phone, a tablet computer, a notebook computer, or a wearable device) Wait). Among them: the target image acquisition module 210, the target area determination module 220, the target object processing module 230 and the processed image determination module 240 are the same as the target image acquisition module 110, the target area determination module 120, the target object processing module in the embodiment shown in FIG. The functions of the module 130 and the processing image determination module 140 are the same, and will not be repeated here.

本实施例中,上述目标物体满足处理条件,可以包括以下至少一项:In this embodiment, the above-mentioned target object meets the processing conditions, and may include at least one of the following:

所述目标物体处于所述目标图像中的位置满足设定位置条件;The position of the target object in the target image satisfies the set position condition;

在对所述脸部区域进行处理后所述目标区域发生扭曲变形;The target area is distorted after processing the face area;

所述目标物体在所述目标图像中的比例满足设定比例条件。The scale of the target object in the target image satisfies the set scale condition.

如图6所示,上述目标物体可以包括手部;在此基础上,目标物体处理模块230,可以包括:As shown in FIG. 6 , the above-mentioned target object may include a hand; on this basis, the target object processing module 230 may include:

特征信息确定单元231,用于确定所述手部的特征信息;a feature information determination unit 231, configured to determine the feature information of the hand;

样本图像查找单元232,用于基于所述特征信息在预设手部图像库中查找与所述手部匹配的样本图像;a sample image search unit 232, configured to search for a sample image matching the hand in a preset hand image library based on the feature information;

目标物体处理单元233,用于基于所述样本图像对所述手部进行处理。The target object processing unit 233 is configured to process the hand based on the sample image.

在一实施例中,上述特征信息可以包括手掌和手指的目标比例;In one embodiment, the above-mentioned characteristic information may include the target ratio of palm and fingers;

在此基础上,样本图像查找单元232还可以用于在所述预设手部图像库中查找手掌和手指的比例与所述目标比例最相近的样本图像。On this basis, the sample image search unit 232 may also be configured to search the preset hand image library for a sample image whose proportions of the palm and fingers are the closest to the target proportion.

在一实施例中,目标物体处理单元233还可以用于基于所述样本图像中手掌和手指的比例调整所述手部中手掌和手指的目标比例。In an embodiment, the target object processing unit 233 may be further configured to adjust the target ratio of the palm and the fingers in the hand based on the ratio of the palm and the fingers in the sample image.

在一实施例中,目标物体处理单元233还可以用于:In one embodiment, the target object processing unit 233 may also be used for:

获取所述脸部区域的第一图像参数以及所述样本图像的第二图像参数,所述第一图像参数和第二图像参数包括颜色和质感中的至少一项;acquiring the first image parameter of the face region and the second image parameter of the sample image, the first image parameter and the second image parameter including at least one of color and texture;

基于所述第一图像参数和所述第二图像参数对所述手部的图像参数进行处理。The image parameters of the hand are processed based on the first image parameters and the second image parameters.

在一实施例中,上述处理图像确定模块240,可以包括:In one embodiment, the above-mentioned processing image determination module 240 may include:

位置关系确定单元241,用于基于所述目标图像中脸部区域与所述目标物体的第一关系,确定所述处理后的脸部区域以及所述处理后的目标物体之间的第二位置关系;A position relationship determining unit 241, configured to determine a second position between the processed face region and the processed target object based on the first relationship between the face region in the target image and the target object relation;

处理图像确定单元242,用于基于所述第二位置关系调整所述处理后的脸部区域对应的第一图层以及所述处理后的目标物体对应的第二图层之间的位置关系,得到处理后的目标图像。The processed image determination unit 242 is configured to adjust the positional relationship between the first layer corresponding to the processed face region and the second layer corresponding to the processed target object based on the second positional relationship, Get the processed target image.

在一实施例中,处理图像确定模块240,还可以包括:In one embodiment, the processing image determination module 240 may further include:

空白区域填充单元243,用于响应于检测到调整后的所述第一图层以及所述第二图层之间存在空白区域,采用预设的图像填充方式对所述空白区域进行填充。The blank area filling unit 243 is configured to, in response to detecting that there is a blank area between the adjusted first layer and the second layer, fill the blank area with a preset image filling method.

关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。Regarding the apparatus in the above-mentioned embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be described in detail here.

图7是根据一示例性实施例示出的一种电子设备的框图。例如,装置900可以是移动电话,计算机,数字广播终端,消息收发设备,游戏控制台,平板设备,医疗设备,健身设备,个人数字助理等。本实施例中,电子设备可以包括常开式图像采集装置,用于采集图像信息。Fig. 7 is a block diagram of an electronic device according to an exemplary embodiment. For example, apparatus 900 may be a mobile phone, computer, digital broadcast terminal, messaging device, game console, tablet device, medical device, fitness device, personal digital assistant, and the like. In this embodiment, the electronic device may include a normally-on image acquisition device for acquiring image information.

参照图7,装置900可以包括以下一个或多个组件:处理组件902,存储器904,电源组件906,多媒体组件908,音频组件910,输入/输出(I/O)的接口912,传感器组件914,以及通信组件916。7, the apparatus 900 may include one or more of the following components: a processing component 902, a memory 904, a power supply component 906, a multimedia component 908, an audio component 910, an input/output (I/O) interface 912, a sensor component 914, And the communication component 916 .

处理组件902通常控制装置900的整体操作,诸如与显示,电话呼叫,数据通信,相机操作和记录操作相关联的操作。处理元件902可以包括一个或多个处理器920来执行指令,以完成上述的方法的全部或部分步骤。此外,处理组件902可以包括一个或多个模块,便于处理组件902和其他组件之间的交互。例如,处理部件902可以包括多媒体模块,以方便多媒体组件908和处理组件902之间的交互。The processing component 902 generally controls the overall operation of the apparatus 900, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing element 902 may include one or more processors 920 to execute instructions to perform all or part of the steps of the methods described above. Additionally, processing component 902 may include one or more modules to facilitate interaction between processing component 902 and other components. For example, processing component 902 may include a multimedia module to facilitate interaction between multimedia component 908 and processing component 902.

存储器904被配置为存储各种类型的数据以支持在设备900的操作。这些数据的示例包括用于在装置900上操作的任何应用程序或方法的指令,联系人数据,电话簿数据,消息,图片,视频等。存储器904可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),可编程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。Memory 904 is configured to store various types of data to support operation at device 900 . Examples of such data include instructions for any application or method operating on device 900, contact data, phonebook data, messages, pictures, videos, and the like. Memory 904 may be implemented by any type of volatile or non-volatile storage device or combination thereof, such as static random access memory (SRAM), electrically erasable programmable read only memory (EEPROM), erasable Programmable Read Only Memory (EPROM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), Magnetic Memory, Flash Memory, Magnetic or Optical Disk.

电力组件906为装置900的各种组件提供电力。电力组件906可以包括电源管理系统,一个或多个电源,及其他与为装置900生成、管理和分配电力相关联的组件。Power component 906 provides power to various components of device 900 . Power components 906 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power to device 900 .

多媒体组件908包括在所述装置900和用户之间的提供一个输出接口的屏幕。在一些实施例中,屏幕可以包括液晶显示器(LCD)和触摸面板(TP)。如果屏幕包括触摸面板,屏幕可以被实现为触摸屏,以接收来自用户的输入信号。触摸面板包括一个或多个触摸传感器以感测触摸、滑动和触摸面板上的手势。所述触摸传感器可以不仅感测触摸或滑动动作的边界,而且还检测与所述触摸或滑动操作相关的持续时间和压力。在一些实施例中,多媒体组件908包括一个前置摄像头和/或后置摄像头。当装置900处于操作模式,如拍摄模式或视频模式时,前置摄像头和/或后置摄像头可以接收外部的多媒体数据。每个前置摄像头和后置摄像头可以是一个固定的光学透镜系统或具有焦距和光学变焦能力。Multimedia component 908 includes a screen that provides an output interface between the device 900 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touch, swipe, and gestures on the touch panel. The touch sensor may not only sense the boundaries of a touch or swipe action, but also detect the duration and pressure associated with the touch or swipe action. In some embodiments, the multimedia component 908 includes a front-facing camera and/or a rear-facing camera. When the apparatus 900 is in an operation mode, such as a shooting mode or a video mode, the front camera and/or the rear camera may receive external multimedia data. Each of the front and rear cameras can be a fixed optical lens system or have focal length and optical zoom capability.

音频组件910被配置为输出和/或输入音频信号。例如,音频组件910包括一个麦克风(MIC),当装置900处于操作模式,如呼叫模式、记录模式和语音识别模式时,麦克风被配置为接收外部音频信号。所接收的音频信号可以被进一步存储在存储器904或经由通信组件916发送。在一些实施例中,音频组件910还包括一个扬声器,用于输出音频信号。Audio component 910 is configured to output and/or input audio signals. For example, audio component 910 includes a microphone (MIC) that is configured to receive external audio signals when device 900 is in operating modes, such as call mode, recording mode, and voice recognition mode. The received audio signal may be further stored in memory 904 or transmitted via communication component 916 . In some embodiments, audio component 910 also includes a speaker for outputting audio signals.

I/O接口912为处理组件902和外围接口模块之间提供接口,上述外围接口模块可以是键盘,点击轮,按钮等。这些按钮可包括但不限于:主页按钮、音量按钮、启动按钮和锁定按钮。The I/O interface 912 provides an interface between the processing component 902 and a peripheral interface module, which may be a keyboard, a click wheel, a button, or the like. These buttons may include, but are not limited to: home button, volume buttons, start button, and lock button.

传感器组件914包括一个或多个传感器,用于为装置900提供各个方面的状态评估。例如,传感器组件914可以检测到装置900的打开/关闭状态,组件的相对定位,例如所述组件为装置900的显示器和小键盘,传感器组件914还可以检测装置900或装置900一个组件的位置改变,用户与装置900接触的存在或不存在,装置900方位或加速/减速和装置900的温度变化。传感器组件914还可以包括接近传感器,被配置用来在没有任何的物理接触时检测附近物体的存在。传感器组件914还可以包括光传感器,如CMOS或CCD图像传感器,用于在成像应用中使用。在一些实施例中,该传感器组件914还可以包括加速度传感器,陀螺仪传感器,磁传感器,压力传感器或温度传感器。Sensor assembly 914 includes one or more sensors for providing status assessment of various aspects of device 900 . For example, the sensor assembly 914 can detect the open/closed state of the device 900, the relative positioning of components, such as the display and keypad of the device 900, and the sensor assembly 914 can also detect a change in the position of the device 900 or a component of the device 900 , the presence or absence of user contact with the device 900 , the orientation or acceleration/deceleration of the device 900 and the temperature change of the device 900 . Sensor assembly 914 may also include a proximity sensor configured to detect the presence of nearby objects in the absence of any physical contact. Sensor assembly 914 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 914 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

通信组件916被配置为便于装置900和其他设备之间有线或无线方式的通信。装置900可以接入基于通信标准的无线网络,如WiFi,2G或3G,4G或5G或它们的组合。在一个示例性实施例中,通信部件916经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,所述通信部件916还包括近场通信(NFC)模块,以促进短程通信。例如,在NFC模块可基于射频识别(RFID)技术,红外数据协会(IrDA)技术,超宽带(UWB)技术,蓝牙(BT)技术和其他技术来实现。Communication component 916 is configured to facilitate wired or wireless communication between apparatus 900 and other devices. Device 900 may access wireless networks based on communication standards, such as WiFi, 2G or 3G, 4G or 5G, or a combination thereof. In one exemplary embodiment, the communication component 916 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 916 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

在示例性实施例中,装置900可以被一个或多个应用专用集成电路(ASIC)、数字信号处理器(DSP)、数字信号处理设备(DSPD)、可编程逻辑器件(PLD)、现场可编程门阵列(FPGA)、控制器、微控制器、微处理器或其他电子元件实现,用于执行上述方法。In an exemplary embodiment, apparatus 900 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable A gate array (FPGA), controller, microcontroller, microprocessor or other electronic component implementation is used to perform the above method.

在示例性实施例中,还提供了一种包括指令的非临时性计算机可读存储介质,例如包括指令的存储器904,上述指令可由装置900的处理器920执行以完成上述方法。例如,所述非临时性计算机可读存储介质可以是ROM、随机存取存储器(RAM)、CD-ROM、磁带、软盘和光数据存储设备等。In an exemplary embodiment, there is also provided a non-transitory computer-readable storage medium including instructions, such as a memory 904 including instructions, executable by the processor 920 of the apparatus 900 to perform the method described above. For example, the non-transitory computer-readable storage medium may be ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, and the like.

本领域技术人员在考虑说明书及实践这里公开的公开后,将容易想到本公开的其它实施方案。本公开旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由下面的权利要求指出。Other embodiments of the present disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common general knowledge or techniques in the technical field not disclosed by this disclosure . The specification and examples are to be regarded as exemplary only, with the true scope and spirit of the disclosure being indicated by the following claims.

应当理解的是,本公开并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本公开的范围仅由所附的权利要求来限制。It is to be understood that the present disclosure is not limited to the precise structures described above and illustrated in the accompanying drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (18)

1. An image processing method, characterized in that the method comprises:
acquiring a target image to be processed;
determining a target area in the target image, wherein the target area comprises a face area and a peripheral preset area;
in response to detecting that a target object in the target area satisfies a processing condition, processing the target object;
and determining a processed target image based on the processed face area and the processed target object.
2. The method of claim 1, wherein the target object satisfies a processing condition comprising at least one of:
the position of the target object in the target image meets a set position condition;
the proportion of the target object in the target image meets a set proportion condition.
3. The method of claim 1, wherein the target object comprises a hand;
the processing the target object comprises:
determining characteristic information of the hand;
searching a sample image matched with the hand in a preset hand image library based on the characteristic information;
and processing the hand part based on the sample image to obtain a target object.
4. The method of claim 3, wherein the characteristic information includes a target ratio of palm and fingers;
the searching for the sample image matched with the hand in a preset hand image library based on the characteristic information comprises:
and searching a sample image with the palm and finger ratio closest to the target ratio in the preset hand image library.
5. The method of claim 4, wherein the processing the hand based on the sample image comprises:
adjusting a target ratio of the palm and fingers in the hand based on the ratio of the palm and fingers in the sample image.
6. The method of claim 3, wherein the processing the hand based on the sample image comprises:
acquiring a first image parameter of the face region and a second image parameter of the sample image, wherein the first image parameter and the second image parameter comprise at least one of color and texture;
processing image parameters of the hand based on the first image parameters and the second image parameters.
7. The method of claim 1, wherein determining a processed target image based on the processed face region and the processed target object comprises:
determining a second positional relationship between the processed face region and the processed target object based on a first relationship between the face region and the target object in the target image;
and adjusting the position relation between the first image layer corresponding to the processed face area and the second image layer corresponding to the processed target object based on the second position relation to obtain a processed target image.
8. The method of claim 7, further comprising:
and in response to the fact that a blank area exists between the adjusted first image layer and the adjusted second image layer, filling the blank area by adopting a preset image filling mode.
9. An image processing apparatus, characterized in that the apparatus comprises:
the target image acquisition module is used for acquiring a target image to be processed;
a target area determination module, configured to determine a target area in the target image, where the target area includes a face area and a peripheral preset area;
the target object processing module is used for processing the target object in response to the fact that the target object in the target area meets the processing condition;
and the processed image determining module is used for determining a processed target image based on the processed face area and the processed target object.
10. The apparatus of claim 9, wherein the target object satisfies a processing condition comprising at least one of:
the position of the target object in the target image meets a set position condition;
the proportion of the target object in the target image meets a set proportion condition.
11. The device of claim 10, wherein the target area comprises a hand;
the target object processing module comprising:
a feature information determination unit configured to determine feature information of the hand;
the sample image searching unit is used for searching a sample image matched with the hand in a preset hand image library based on the characteristic information;
a target object processing unit for processing the hand based on the sample image.
12. The apparatus of claim 11, wherein the characteristic information comprises a target ratio of palm and fingers;
the sample image searching unit is further used for searching a sample image with the palm and finger ratio closest to the target ratio in the preset hand image library.
13. The apparatus of claim 12, wherein the target object processing unit is further configured to adjust the target palm and finger ratio in the hand based on the palm and finger ratio in the sample image.
14. The apparatus of claim 11, wherein the target object processing unit is further configured to:
acquiring a first image parameter of the face region and a second image parameter of the sample image, wherein the first image parameter and the second image parameter comprise at least one of color and texture;
processing image parameters of the hand based on the first image parameters and the second image parameters.
15. The apparatus of claim 9, wherein the process image determination module comprises:
a position relation determining unit configured to determine a second position relation between the processed face region and the processed target object based on a first relation between the face region and the target object in the target image;
and the processed image determining unit is used for adjusting the position relationship between the first image layer corresponding to the processed face area and the second image layer corresponding to the processed target object based on the second position relationship to obtain a processed target image.
16. The apparatus of claim 15, wherein the process image determination module further comprises:
and the blank area filling unit is used for responding to the fact that a blank area exists between the first image layer and the second image layer after the adjustment, and filling the blank area by adopting a preset image filling mode.
17. An electronic device, characterized in that the device comprises:
a processor and a memory for storing processor-executable instructions;
wherein the processor is configured to:
acquiring a target image to be processed;
determining a face region and a target region in the target image, wherein the target region comprises the face region and a peripheral preset region;
in response to detecting that a target object in the target area satisfies a processing condition, processing the target object;
and determining a processed target image based on the processed face area and the processed target object.
18. A computer-readable storage medium on which a computer program is stored, the program, when executed by a processor, implementing:
acquiring a target image to be processed;
determining a face region and a target region in the target image, wherein the target region comprises the face region and a peripheral preset region;
in response to detecting that a target object in the target area satisfies a processing condition, processing the target object;
and determining a processed target image based on the processed face area and the processed target object.
CN202011173511.5A 2020-10-28 2020-10-28 Image processing method, device, equipment and storage medium Pending CN114418865A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011173511.5A CN114418865A (en) 2020-10-28 2020-10-28 Image processing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011173511.5A CN114418865A (en) 2020-10-28 2020-10-28 Image processing method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114418865A true CN114418865A (en) 2022-04-29

Family

ID=81260361

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011173511.5A Pending CN114418865A (en) 2020-10-28 2020-10-28 Image processing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114418865A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023236052A1 (en) * 2022-06-07 2023-12-14 北京小米移动软件有限公司 Input information determination method and apparatus, and device and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170154206A1 (en) * 2015-11-26 2017-06-01 Xiaomi Inc. Image processing method and apparatus
CN107358573A (en) * 2017-06-16 2017-11-17 广东欧珀移动通信有限公司 Image beautification processing method and device
CN108513668A (en) * 2016-12-29 2018-09-07 华为技术有限公司 Image processing method and device
CN108509890A (en) * 2018-03-27 2018-09-07 百度在线网络技术(北京)有限公司 Method and apparatus for extracting information
CN111291813A (en) * 2020-02-13 2020-06-16 腾讯科技(深圳)有限公司 Image annotation method and device, computer equipment and storage medium
CN111553864A (en) * 2020-04-30 2020-08-18 深圳市商汤科技有限公司 Image restoration method and device, electronic equipment and storage medium
CN111582258A (en) * 2020-03-31 2020-08-25 北京达佳互联信息技术有限公司 Image processing method and device, electronic equipment and readable storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170154206A1 (en) * 2015-11-26 2017-06-01 Xiaomi Inc. Image processing method and apparatus
CN108513668A (en) * 2016-12-29 2018-09-07 华为技术有限公司 Image processing method and device
CN107358573A (en) * 2017-06-16 2017-11-17 广东欧珀移动通信有限公司 Image beautification processing method and device
CN108509890A (en) * 2018-03-27 2018-09-07 百度在线网络技术(北京)有限公司 Method and apparatus for extracting information
CN111291813A (en) * 2020-02-13 2020-06-16 腾讯科技(深圳)有限公司 Image annotation method and device, computer equipment and storage medium
CN111582258A (en) * 2020-03-31 2020-08-25 北京达佳互联信息技术有限公司 Image processing method and device, electronic equipment and readable storage medium
CN111553864A (en) * 2020-04-30 2020-08-18 深圳市商汤科技有限公司 Image restoration method and device, electronic equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023236052A1 (en) * 2022-06-07 2023-12-14 北京小米移动软件有限公司 Input information determination method and apparatus, and device and storage medium

Similar Documents

Publication Publication Date Title
US10565763B2 (en) Method and camera device for processing image
EP3179711B1 (en) Method and apparatus for preventing photograph from being shielded
WO2016011747A1 (en) Skin color adjustment method and device
EP3200125B1 (en) Fingerprint template input method and device
CN106454336B (en) The method and device and terminal that detection terminal camera is blocked
CN105260732A (en) Image processing method and device
CN107122679A (en) Image processing method and device
CN107566742B (en) Shooting method, shooting device, storage medium and electronic equipment
WO2022110837A1 (en) Image processing method and device
CN107091704B (en) Pressure detection method and device
WO2022077970A1 (en) Method and apparatus for adding special effects
CN104867112B (en) Photo processing method and device
US11252341B2 (en) Method and device for shooting image, and storage medium
US20180238748A1 (en) Pressure detection method and apparatus, and storage medium
CN112004020B (en) Image processing method, image processing device, electronic equipment and storage medium
CN107507128B (en) Image processing method and apparatus
CN106469446B (en) Depth image segmentation method and segmentation device
CN112331158B (en) Terminal display adjusting method, device, equipment and storage medium
CN107730443B (en) Image processing method and device and user equipment
JP2024521007A (en) Unlocking method and electronic device
CN107239758B (en) Method and device for positioning key points of human face
CN111340690B (en) Image processing method, device, electronic equipment and storage medium
US20210335390A1 (en) Method and device for generating dynamic image
CN114418865A (en) Image processing method, device, equipment and storage medium
CN108769513B (en) Camera photographing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination