Movatterモバイル変換


[0]ホーム

URL:


CN115883986A - Image processing method and device - Google Patents

Image processing method and device
Download PDF

Info

Publication number
CN115883986A
CN115883986ACN202211519802.4ACN202211519802ACN115883986ACN 115883986 ACN115883986 ACN 115883986ACN 202211519802 ACN202211519802 ACN 202211519802ACN 115883986 ACN115883986 ACN 115883986A
Authority
CN
China
Prior art keywords
image
area
color purity
subject
region
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
CN202211519802.4A
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.)
Vivo Mobile Communication Co Ltd
Original Assignee
Vivo Mobile Communication 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 Vivo Mobile Communication Co LtdfiledCriticalVivo Mobile Communication Co Ltd
Priority to CN202211519802.4ApriorityCriticalpatent/CN115883986A/en
Publication of CN115883986ApublicationCriticalpatent/CN115883986A/en
Pendinglegal-statusCriticalCurrent

Links

Images

Landscapes

Abstract

The application discloses an image processing method and an image processing device, and belongs to the technical field of image processing. The image processing method comprises the following steps: determining a first region and a second region in a first image; the first region comprises a main image region in the first image, and the second region is an image region in the first image except the first region; adjusting the color purity of the first image to obtain a second image; wherein, in the second image, the image color purity of the first region is greater than the image color purity of the second region.

Description

Translated fromChinese
图像处理方法及其装置Image processing method and device thereof

技术领域technical field

本申请属于图像处理技术领域,具体涉及一种图像处理方法及其装置。The present application belongs to the technical field of image processing, and in particular relates to an image processing method and device thereof.

背景技术Background technique

随着用户对影像审美的不断提高,用户对终端设备的拍摄需求也已不仅仅停留在简单的影像记录层面,而是希望可以拍摄出效果更好的作品。With the continuous improvement of users' image aesthetics, users' demand for terminal equipment shooting has not only stopped at the simple image recording level, but also hopes to shoot works with better effects.

为提升拍摄效果,一种方法则是提升画面空间感,而提升画面空间感常用的方式为:背景虚化,即先将主体图像与背景图像分割,之后对背景图像进行虚化处理,从而突出主体图像。In order to improve the shooting effect, one method is to enhance the sense of space in the picture, and the commonly used method to improve the sense of space in the picture is: background blurring, that is, to first divide the subject image from the background image, and then perform blurring on the background image, so as to highlight the Subject image.

但背景虚化方式仅能突出主体,难以体现画面完整空间感,图像空间效果单薄。However, the background blur method can only highlight the subject, and it is difficult to reflect the complete sense of space in the picture, and the image space effect is weak.

发明内容Contents of the invention

本申请实施例的目的是提供一种图像处理方法及其装置,能够解决现有技术中以背景虚化方式提升画面空间感的方案,存在难以体现画面完整空间感的问题。The purpose of the embodiments of the present application is to provide an image processing method and device thereof, which can solve the problem that it is difficult to reflect the complete sense of space in the existing scheme of enhancing the sense of space in the picture by blurring the background.

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

确定第一图像中的第一区域和第二区域;其中,所述第一区域包括所述第一图像中的主体图像区域,所述第二区域为所述第一图像中除所述第一区域外的图像区域;Determining a first area and a second area in the first image; wherein, the first area includes the subject image area in the first image, and the second area is the first area in the first image except the first area. the image area outside the area;

对所述第一图像进行色纯度调整,获得第二图像;其中,在所述第二图像中,所述第一区域的图像色纯度大于所述第二区域的图像色纯度。Performing color purity adjustment on the first image to obtain a second image; wherein, in the second image, the image color purity of the first region is greater than the image color purity of the second region.

第二方面,本申请实施例提供了一种图像处理装置,所述装置包括:In a second aspect, an embodiment of the present application provides an image processing device, the device comprising:

确定模块,用于确定第一图像中的第一区域和第二区域;其中,所述第一区域包括所述第一图像中的主体图像区域,所述第二区域为所述第一图像中除所述第一区域外的图像区域;A determination module, configured to determine a first area and a second area in the first image; wherein, the first area includes the subject image area in the first image, and the second area is the area in the first image an image area other than said first area;

处理模块,用于对所述第一图像进行色纯度调整,获得第二图像;其中,在所述第二图像中,所述第一区域的图像色纯度大于所述第二区域的图像色纯度。A processing module, configured to adjust the color purity of the first image to obtain a second image; wherein, in the second image, the image color purity of the first region is greater than the image color purity of the second region .

第三方面,本申请实施例提供了一种电子设备,该电子设备包括处理器和存储器,所述存储器存储可在所述处理器上运行的程序或指令,所述程序或指令被所述处理器执行时实现如第一方面所述的图像处理方法中的步骤。In the third aspect, the embodiment of the present application provides an electronic device, the electronic device includes a processor and a memory, the memory stores programs or instructions that can run on the processor, and the programs or instructions are processed by the The steps in the image processing method as described in the first aspect are realized when executed by the controller.

第四方面,本申请实施例提供了一种可读存储介质,所述可读存储介质上存储程序或指令,所述程序或指令被处理器执行时实现如第一方面所述的图像处理方法中的步骤。In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the image processing method as described in the first aspect is implemented in the steps.

第五方面,本申请实施例提供了一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现如第一方面所述的图像处理方法。In the fifth aspect, the embodiment of the present application provides a chip, the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is used to run programs or instructions, so as to implement the first aspect The image processing method described.

第六方面,本申请实施例提供一种计算机程序产品,该程序产品被存储在存储介质中,该程序产品被至少一帧处理器执行以实现如第一方面所述的图像处理方法。In a sixth aspect, an embodiment of the present application provides a computer program product, the program product is stored in a storage medium, and the program product is executed by at least one frame processor to implement the image processing method as described in the first aspect.

本申请实施例中,根据人眼对视觉注意力锁定区域(等同于相机对焦位置)的色彩更加敏感,而对其他区域的色彩不敏感的特性,通过调整图像的色纯度,使得主体图像的色纯度高于背景图像的色纯度,基于二者之间的色彩鲜艳程度差异性,从而达到突出主体图像和提升画面空间感的目的。由于无需进行背景虚化处理,因此背景图像也可以清晰显示,使得画面的空间感更加完整,画面空间效果更加丰富。In the embodiment of the present application, according to the characteristic that the human eye is more sensitive to the color of the visual attention locking area (equivalent to the focus position of the camera), but not to the color of other areas, by adjusting the color purity of the image, the color of the subject image is adjusted. The purity is higher than the color purity of the background image, based on the difference in color brightness between the two, so as to achieve the purpose of highlighting the main image and enhancing the sense of space in the picture. Since there is no need to perform background blurring, the background image can also be clearly displayed, making the picture more complete and the picture space effect richer.

附图说明Description of drawings

图1是本申请实施例提供的图像处理方法的流程示意图;FIG. 1 is a schematic flow diagram of an image processing method provided in an embodiment of the present application;

图2是本申请实施例提供的对焦位置和主体图像区域的示意图之一;Fig. 2 is one of the schematic diagrams of the focus position and subject image area provided by the embodiment of the present application;

图3是本申请实施例提供的对焦位置和主体图像区域的示意图之二;Fig. 3 is the second schematic diagram of the focus position and subject image area provided by the embodiment of the present application;

图4是本申请实施例提供的色纯度调整的示意图之一;Fig. 4 is one of the schematic diagrams of the color purity adjustment provided by the embodiment of the present application;

图5是本申请实施例提供的色纯度调整的示意图之二;Fig. 5 is the second schematic diagram of the color purity adjustment provided by the embodiment of the present application;

图6是本申请实施例提供的图像处理装置的示意框图;Fig. 6 is a schematic block diagram of an image processing device provided by an embodiment of the present application;

图7是本申请实施例提供的电子设备的示意框图;FIG. 7 is a schematic block diagram of an electronic device provided by an embodiment of the present application;

图8是本申请实施例提供的电子设备的硬件结构示意图。FIG. 8 is a schematic diagram of a hardware structure of an electronic device provided by an embodiment of the present application.

具体实施方式Detailed ways

下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员获得的所有其他实施例,都属于本申请保护的范围。The following will clearly describe the technical solutions in the embodiments of the present application with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, but not all of them. All other embodiments obtained by persons of ordinary skill in the art based on the embodiments in this application belong to the protection scope of this application.

本申请的说明书和权利要求书中的术语“第一”、“第二”等是用于区别类似的对象,而不用于描述特定的顺序或先后次序。应该理解这样使用的术语在适当情况下可以互换,以便本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施,且“第一”、“第二”等所区分的对象通常为一类,并不限定对象的个数,例如第一对象可以是一个,也可以是多个。此外,说明书以及权利要求中“和/或”表示所连接对象的至少其中之一,字符“/”,一般表示前后关联对象是一种“或”的关系。The terms "first", "second" and the like in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific sequence or sequence. It is to be understood that the terms so used are interchangeable under appropriate circumstances such that the embodiments of the application are capable of operation in sequences other than those illustrated or described herein and that references to "first", "second", etc. to distinguish Objects are generally of one type, and the number of objects is not limited. For example, there may be one or more first objects. In addition, "and/or" in the specification and claims means at least one of the connected objects, and the character "/" generally means that the related objects are an "or" relationship.

下面结合附图,通过具体的实施例及其应用场景对本申请实施例提供的图像处理方法进行详细地说明。The image processing method provided by the embodiment of the present application will be described in detail below through specific embodiments and application scenarios with reference to the accompanying drawings.

图1是本申请实施例提供的一种图像处理方法的流程示意图,该图像处理方法应用于电子设备,即该图像处理方法中的步骤由该电子设备执行。FIG. 1 is a schematic flowchart of an image processing method provided by an embodiment of the present application. The image processing method is applied to an electronic device, that is, the steps in the image processing method are executed by the electronic device.

其中,该图像处理方法可以包括:Wherein, the image processing method may include:

步骤101:确定第一图像中的第一区域和第二区域。Step 101: Determine a first area and a second area in a first image.

其中,第一区域包括第一图像中的主体图像区域,第二区域为第一图像中除第一区域外的图像区域,可以包括背景图像区域。Wherein, the first area includes a subject image area in the first image, and the second area is an image area in the first image other than the first area, which may include a background image area.

这里所述第一图像可以是拍摄过程中的预览图像,也可以是预先拍摄好的图像。这里所述的拍摄可以是拍摄照片,也可以是拍摄视频。Here, the first image may be a preview image during shooting, or a pre-shot image. The shooting mentioned here may be taking a photo or taking a video.

步骤102:对第一图像进行色纯度调整,获得第二图像。Step 102: Perform color purity adjustment on the first image to obtain a second image.

这里所述的色纯度即饱和度,在HSV模型中,色相(hue)、饱和度(saturation)和明度(value)是色彩的三个属性,饱和度是脱离明度维度和色相维度单独存在的。The color purity mentioned here is saturation. In the HSV model, hue, saturation, and value are the three attributes of color. Saturation exists independently of the lightness and hue dimensions.

其中,在第二图像中,第一区域的图像色纯度大于第二区域的图像色纯度,即第一区域的图像色彩更加鲜艳,而第二区域的图像色彩相对寡淡。Wherein, in the second image, the image color purity of the first area is greater than that of the second area, that is, the image color of the first area is more vivid, while the image color of the second area is relatively dull.

本申请实施例中,根据人眼对视觉注意力锁定区域(等同于相机对焦位置)的色彩更加敏感,而对其他区域的色彩不敏感的特性,通过调整图像的色纯度,使得主体图像的色纯度高于背景图像的色纯度,基于二者之间的色彩鲜艳程度差异性,从而达到突出主体图像和提升画面空间感的目的。由于无需进行背景虚化处理,因此背景图像也可以清晰显示,使得画面的空间感更加完整,画面空间效果更加丰富。In the embodiment of the present application, according to the characteristic that the human eye is more sensitive to the color of the visual attention locking area (equivalent to the focus position of the camera), but not to the color of other areas, by adjusting the color purity of the image, the color of the subject image is adjusted. The purity is higher than the color purity of the background image, based on the difference in color brightness between the two, so as to achieve the purpose of highlighting the main image and enhancing the sense of space in the picture. Since there is no need to perform background blurring, the background image can also be clearly displayed, making the picture more complete and the picture space effect richer.

发明人在实现本申请实施例的过程还发现:现有技术中,也有通过色彩的冷暖对比方式(即增加主体图像的暖色调、增加背景图像的冷色调)或明暗对比方式(即将主体图像提亮、对背景图像压暗),来突出主体,从而体现主体和背景两层空间感。但以冷暖对比方式突出主体时,易出现图像与环境真实色彩不符合情况,影响色彩的准确性,造成白平衡错误。而以明暗对比方式突出主体时,易影响现场环境原来的影调关系,容易出现影调逆转,与自然光线不符合,造成不自然的场景。本申请实施例中,由于色纯度是独立于色彩明度和色相的,因此调整色纯度,不会影响色彩的准确性以及画面明暗,从而避免出现影调逆转、光线不自然以及白平衡错误等的问题,减少负优化问题的出现。In the process of realizing the embodiment of the present application, the inventor also found that: in the prior art, there are also methods of contrasting colors through warm and cold colors (that is, increasing the warm tone of the main image and increasing the cool tone of the background image) or light and dark contrast methods (that is, increasing the color of the main image). Bright, darken the background image) to highlight the subject, thus reflecting the sense of space between the subject and the background. However, when the main subject is highlighted in the way of contrast between cold and warm, it is easy to appear that the image does not match the real color of the environment, which affects the accuracy of the color and causes white balance errors. However, when the subject is highlighted in the way of chiaroscuro, it is easy to affect the original tone relationship of the scene environment, and it is easy to reverse the tone, which does not match the natural light, resulting in an unnatural scene. In the embodiment of this application, since the color purity is independent of the color lightness and hue, adjusting the color purity will not affect the accuracy of the color and the brightness of the picture, thereby avoiding the occurrence of tone reversal, unnatural light, and white balance errors. problems, reducing the occurrence of negative optimization problems.

作为一种可选实施例,第一图像中的主体图像区域可以根据第一图像的对焦位置进行确定。As an optional embodiment, the subject image area in the first image may be determined according to the focus position of the first image.

通过相机拍摄时,一般有对焦位置,而对焦位置处的图像多数情况下是用户更为关注的主体图像,因此,可以根据对焦位置确定主体图像区域。When shooting with a camera, there is generally a focus position, and the image at the focus position is mostly the subject image that the user pays more attention to. Therefore, the subject image area can be determined according to the focus position.

该对焦位置可以是相机自动确定的,如图2所示,示意了一拍摄预览图像,在相机检测到拍摄预览图像中的人脸图像时,可以自动将拍摄焦点对焦至人脸位置,从而形成对焦位置,如图2中的圆框201所圈出的图像位置。此时,可以根据对焦位置,将整个人物所在的图像区域确定为主体图像区域,如图2中的矩形框202所圈出的图像区域。The focus position can be automatically determined by the camera. As shown in Figure 2, a shot preview image is shown. When the camera detects the face image in the shot preview image, it can automatically focus on the face position, thereby forming The focus position is the image position circled by thecircle frame 201 in FIG. 2 . At this time, according to the focus position, the image area where the entire person is located may be determined as the subject image area, such as the image area circled by therectangular frame 202 in FIG. 2 .

该对焦位置也可以是用户手动选择的,如图3所示,示意了另一拍摄预览图像,预览图像中的鲜花下面具有一堆玩偶,用户点击一个预览图像中的一个玩偶后,则相机将拍摄焦点对焦至该玩偶位置处,从而形成对焦位置,如图3中的圆框301所圈出的图像位置。此时,可以将对焦位置处的玩偶图像区域确定为主体图像区域;在难以从整堆玩偶中识别出具体某一个玩偶的情况下,也可以将整堆玩偶图像区域确定为主体图像区域,如图3中的矩形框302所圈出的图像区域;还可以将焦平面对应的图像区域确定为主体图像区域,此时图3中的主体图像区域除了包括玩偶堆,还包括玩偶堆旁边的鲜花等处于同一焦平面的事物。The focus position can also be manually selected by the user. As shown in Figure 3, another shot preview image is shown. There are a bunch of dolls under the flowers in the preview image. After the user clicks on a doll in a preview image, the camera will The shooting focus is focused on the position of the doll, thereby forming a focus position, such as the image position circled by thecircle frame 301 in FIG. 3 . At this time, the image area of the doll at the focus position can be determined as the main image area; in the case that it is difficult to identify a specific doll from the whole pile of dolls, the image area of the whole pile of dolls can also be determined as the main image area, such as The image area circled by therectangular frame 302 in FIG. 3; the image area corresponding to the focal plane can also be determined as the main image area. At this time, the main image area in FIG. 3 includes not only the pile of dolls, but also the flowers next to the pile of dolls things that are in the same focal plane.

作为一种可选实施例,步骤102:对第一图像进行色纯度调整,获得第二图像,可以包括:As an optional embodiment, step 102: performing color purity adjustment on the first image to obtain the second image may include:

调高所述第一区域的图像色纯度至第一目标值;或者,按照到第一区域边缘的最小直线距离由小到大的顺序,将第二区域的图像色纯度逐渐调低至第二目标值。Increase the image color purity of the first area to the first target value; or, gradually lower the image color purity of the second area to the second target value.

本申请实施例中,为了使主体图像与背景图像之间的色纯度产生差异,可以仅对第一区域的图像色纯度进行调整,或仅对第二区域的图像色纯度进行调整,通过提高第一区域的图像色纯度,或降低第二区域的图像色纯度,从而达到突显第一区域图像、弱化第二区域图像的效果,以提升画面空间感。In the embodiment of the present application, in order to make the color purity difference between the subject image and the background image, only the image color purity of the first region can be adjusted, or only the image color purity of the second region can be adjusted, by increasing the color purity of the second region The image color purity of one area, or reduce the image color purity of the second area, so as to achieve the effect of highlighting the image of the first area and weakening the image of the second area, so as to enhance the sense of space in the picture.

其中,第一区域的图像色纯度可以统一调高至第一目标值,该第一目标值可以根据第一区域的原始图像色纯度以及预设的色纯度增加值进行确定,例如,第一区域的原始图像色纯度为80%,预设的色纯度增加值为10%,则第一目标值=80%+10%=90%。提高主体图像的色纯度,可以使主体图像更加突出,增强画面空间感。Wherein, the image color purity of the first area can be uniformly adjusted to a first target value, and the first target value can be determined according to the original image color purity of the first area and a preset color purity increase value, for example, the first area The color purity of the original image is 80%, and the preset color purity increase value is 10%, then the first target value=80%+10%=90%. Improving the color purity of the main image can make the main image more prominent and enhance the sense of space in the picture.

其中,为了使第二区域的图像色纯度的变化更加自然,可以按照到第一区域边缘的最小直线距离由小到大的顺序,也就是按照距离第一区域由近到远的顺序,逐渐调低图像的色纯度,这样还可以使图像具有空间延伸感的效果。Among them, in order to make the change of the image color purity in the second area more natural, you can gradually adjust the color purity according to the order of the minimum linear distance to the edge of the first area from small to large, that is, according to the order from near to far from the first area. Lower the color purity of the image, which can also make the image have the effect of spatial extension.

例如,在图4中,对于图(a)所示的图像,其第一区域为图(b)中401所示的近景中两侧房屋对应的图像区域,第二区域则为图(b)中402所示的图像区域。可以按照图(b)中箭头所示方向,逐渐调低第二区域402的图像色纯度,以使第一区域401的图像色纯度高于第二区域402,调整效果如图(c)所示,图(c)中远离近景两侧房屋的图像色纯度呈现逐渐减弱的效果。当然,也可以将第一区域401的图像色纯度调高。For example, in Figure 4, for the image shown in Figure (a), its first area is the image area corresponding to the houses on both sides in the close-up shown in 401 in Figure (b), and the second area is the image area in Figure (b) The image area shown in 402. The image color purity of thesecond area 402 can be gradually reduced according to the direction indicated by the arrow in figure (b), so that the image color purity of thefirst area 401 is higher than that of thesecond area 402, and the adjustment effect is shown in figure (c) , the image color purity of the houses on both sides away from the foreground in Figure (c) shows a gradually weakening effect. Of course, the image color purity of thefirst region 401 may also be adjusted higher.

可选地,可以预先设置距离范围与色纯度降低值之间的对应关系,这里所述的距离是指与第一区域边缘之间的最小直线距离。例如,距离处于0-1范围内时,对应的色纯度降低值为10%,距离处于1-2范围内时,对应的色纯度降低值为20%等,具体可根据实际需求设置。前述第二目标值为第二区域的边缘图像对应的色纯度。Optionally, the corresponding relationship between the distance range and the color purity reduction value may be preset, and the distance mentioned here refers to the minimum straight-line distance from the edge of the first region. For example, when the distance is in the range of 0-1, the corresponding color purity reduction value is 10%, and when the distance is in the range of 1-2, the corresponding color purity reduction value is 20%, etc., which can be set according to actual needs. The aforementioned second target value is the color purity corresponding to the edge image of the second area.

作为一种可选实施例,步骤102:对第一图像进行色纯度调整,获得第二图像,可以包括:As an optional embodiment, step 102: performing color purity adjustment on the first image to obtain the second image may include:

调高第一图像的色纯度至第三目标值;在调高色纯度后的第一图像中,按照到第一区域边缘的最小直线距离由小到大的顺序,将第二区域的图像色纯度逐渐调低至第四目标值。Increase the color purity of the first image to the third target value; in the first image after the color purity is increased, in the order of the minimum linear distance to the edge of the first area from small to large, the image color of the second area The purity is gradually adjusted down to the fourth target value.

本申请实施例中,为了使主体图像与背景图像之间的色纯度产生差异,可以先将整个图像的色纯度调高,然后再降低第二区域的图像色纯度,从而达到突显第一区域图像、弱化第二区域图像的效果。主体图像的色纯度提高,可以使主体图像更加突出,增强画面空间感。In this embodiment of the application, in order to make the color purity difference between the subject image and the background image, the color purity of the entire image can be increased first, and then the color purity of the image in the second area can be reduced, so as to highlight the image in the first area , Weaken the effect of the image in the second area. The color purity of the main image is improved, which can make the main image more prominent and enhance the sense of space in the picture.

例如,在图5中,对于图(a)所示的图像,其第一区域为图(b)中501所示的玩偶堆对应的图像区域,第二区域则为图(b)中502所示的图像区域。可以先将图(a)所示的整个图像的色纯度调高,然后按照图(b)中箭头所示方向,逐渐调低第二区域502的图像色纯度,以使第一区域501的图像色纯度高于第二区域502,调整效果如图(c)所示。显然,图(c)中的玩偶堆图像相比于图(a)中的玩偶堆图像的色彩更加突显,即色纯度更高,而图(c)中玩偶堆周围的图像色纯度呈现逐渐减弱的效果。For example, in Figure 5, for the image shown in Figure (a), its first area is the image area corresponding to the doll pile shown in 501 in Figure (b), and the second area is the image area shown in 502 in Figure (b). the displayed image area. The color purity of the entire image shown in figure (a) can be increased first, and then gradually lower the color purity of the image in thesecond area 502 in the direction indicated by the arrow in figure (b), so that the image in thefirst area 501 The color purity is higher than thesecond region 502, and the adjustment effect is shown in figure (c). Obviously, the color of the image of the pile of dolls in Figure (c) is more prominent than that of the image of the pile of dolls in Figure (a), that is, the color purity is higher, while the color purity of the image around the pile of dolls in Figure (c) gradually weakens Effect.

其中,对于第二区域的图像色纯度调整,具体可参考前一实施例对此进行的解释说明,这里便不再赘述。Wherein, for the image color purity adjustment in the second area, reference may be made to the explanation in the previous embodiment for details, and details will not be repeated here.

作为一种可选实施例中,第一区域可以是主体图像区域,也可以是包括主体图像区域的焦平面区域。As an optional embodiment, the first area may be a subject image area, or may be a focal plane area including the subject image area.

本申请实施例中,在调整图像色纯度时,可以仅突显主体图像,也可以突显与主体处于同一平面的图像,也就是突显焦平面对应的图像。对此,具体可见下述实施例的描述。In the embodiment of the present application, when adjusting the color purity of an image, only the subject image may be highlighted, or the image on the same plane as the subject may be highlighted, that is, the image corresponding to the focal plane may be highlighted. In this regard, details can be found in the description of the following embodiments.

可选地,在步骤101:确定第一图像中的第一区域和第二区域,可以包括:Optionally, in step 101: determining the first area and the second area in the first image may include:

步骤A1:获取第一图像的景深信息。Step A1: Obtain the depth information of the first image.

步骤A2:根据景深信息,确定第一图像中的主体与背景之间的距离。Step A2: Determine the distance between the subject and the background in the first image according to the depth of field information.

步骤A3:在第一图像中主体与背景之间的距离小于预设值的情况下,将主体图像区域确定为第一区域,将第一图像中的其他图像区域确定为第二区域。Step A3: When the distance between the subject and the background in the first image is smaller than a preset value, determine the subject image area as the first area, and determine other image areas in the first image as the second area.

步骤A4:第一图像中主体与背景之间的在距离大于预设值的情况下,将第一图像中与焦平面对应的图像区域确定为第一区域,将第一图像中的其他图像区域确定为第二区域。Step A4: When the distance between the subject and the background in the first image is greater than a preset value, determine the image area corresponding to the focal plane in the first image as the first area, and determine the other image areas in the first image identified as the second area.

这里所述的预设值为取值较小的数值,如小于1m的数值,具体可根据实际需求设置。The preset value mentioned here is a smaller value, such as a value smaller than 1m, which can be set according to actual needs.

其中,焦平面对应的图像区域包括主体图像区域。Wherein, the image area corresponding to the focal plane includes the subject image area.

本申请实施例中,在图像拍摄过程中,可以获取第一图像的景深信息,通过景深信息确定第一图像的主体与背景之间的距离,然后依据主体与背景之间的距离,确定需要突显的图像。In the embodiment of the present application, during the image shooting process, the depth of field information of the first image can be obtained, and the distance between the main body and the background of the first image can be determined through the depth of field information, and then the distance between the main body and the background can be determined according to the distance between the main body and the background. Image.

在主体与背景之间的距离大于预设值时,说明主体与背景之间的距离较远,空间差距大,焦平面对应的图像区域小于整个图像区域,又由于焦平面中的其他物体与主体处于同一平面,空间效果应与主体一致,因此,此时可以突出显示焦平面中的图像,以与实际环境相符合。例如,人物A坐在一个桌子旁边进行拍照,身后为作为拍照背景的山,在人物A与山之间的距离较远的情况下,由于人物A与桌子均处于焦平面中,则此时可以突显人物A图像和桌子图像。When the distance between the subject and the background is greater than the preset value, it means that the distance between the subject and the background is far, the space gap is large, the image area corresponding to the focal plane is smaller than the entire image area, and because other objects in the focal plane and the subject Being on the same plane, the spatial effect should be consistent with the subject, so at this point the image in the focal plane can be highlighted to match the actual environment. For example, person A is sitting next to a table to take a photo, and behind him is a mountain as the background of the photo. If the distance between person A and the mountain is relatively long, since both person A and the table are in the focal plane, you can Highlight the Person A image and the table image.

在主体与背景之间的距离小于预设值时,说明主体与背景之间的距离较低,空间差距小,背景易被认为与主体处于同一平面,导致焦平面对应的图像区域与整个图像区域大小相似,因此,此时可以仅突出显示主体图像。例如,人物A站在墙下进行拍照,人物A为主体,墙为背景,人物A与背景墙之间的距离较小,此时,可以仅突显人物A图像。When the distance between the subject and the background is less than the preset value, it means that the distance between the subject and the background is low, the space gap is small, and the background is easily considered to be in the same plane as the subject, resulting in the image area corresponding to the focal plane being different from the entire image area The sizes are similar, so you can just highlight the subject image at this point. For example, person A stands under a wall to take a picture, person A is the subject, the wall is the background, and the distance between person A and the background wall is small, at this time, only the image of person A may be highlighted.

对于主体与背景之间的距离等于预设值的情况,可以执行步骤A3,也可以执行步骤A4,具体可根据实际需求设置。For the case where the distance between the subject and the background is equal to the preset value, step A3 or step A4 can be performed, which can be set according to actual needs.

在该实施例中,第一图像可以是拍摄预览图像,也可以是记录有景深信息的已拍摄图像。In this embodiment, the first image may be a shooting preview image, or a captured image recorded with depth of field information.

作为一种可选实施例,在第一区域为主体图像区域的情况下,步骤102:对第一图像进行色纯度调整,获得第二图像,可以包括:As an optional embodiment, in the case that the first area is the subject image area, step 102: performing color purity adjustment on the first image to obtain the second image may include:

根据主体图像区域,识别第一图像中的主体图像轮廓;根据主体图像轮廓,对第一图像中的主体图像与背景图像进行图像分割处理,以及对分割处理后的主体图像进行边缘羽化处理;对分割处理后的背景图像和边缘羽化处理后的主体图像中的至少一个进行色纯度调整,获得第二图像。According to the subject image area, identify the subject image outline in the first image; perform image segmentation processing on the subject image and the background image in the first image according to the subject image outline, and perform edge feathering processing on the subject image after the segmentation process; At least one of the background image after segmentation processing and the subject image after edge feathering processing is adjusted for color purity to obtain a second image.

本申请实施例中,在仅需突显主体图像时,也就是第一区域为主体图像区域的情况下,可以识别主体图像轮廓,依据主体图像轮廓,对第一图像中的主体图像和背景图像进行图像分割处理,以便对主体图像和背景图像中的至少一个进行色纯度调整。为了使得主体图像与背景图像之间过渡的更加自然,可以对主体图像进行边缘羽化处理,模糊主体图像边缘,也因此,本申请实施例对图像分割算法的精度要求不高,这样有利于提高成片率,减少由于分割错误,导致用户丢弃图像的情况。又由于不需要精确分割,因此,本申请实施例的实现,也不需要依靠复杂的图像识别算法,数据处理更加简单。In the embodiment of the present application, when only the subject image needs to be highlighted, that is, when the first area is the subject image area, the outline of the subject image can be identified, and the subject image and the background image in the first image can be processed according to the outline of the subject image. Image segmentation processing to perform color purity adjustment on at least one of the subject image and the background image. In order to make the transition between the main image and the background image more natural, edge feathering processing can be performed on the main image to blur the edge of the main image. Therefore, the embodiment of the present application does not require high precision of the image segmentation algorithm, which is conducive to improving the cost of the image. Fragmentation rate, reducing the situation of users discarding images due to segmentation errors. Moreover, since precise segmentation is not required, the implementation of the embodiment of the present application does not need to rely on complex image recognition algorithms, and the data processing is simpler.

以上即为对本申请实施例提供的图像处理方法的描述。The above is the description of the image processing method provided by the embodiment of the present application.

综上所述,本申请实施例中,通过调整图像的色纯度,使得主体图像的色纯度高于非主体图像(如背景图像)的色纯度,基于主体图像与非主体图像的色纯度之间的差异性,从而提升画面空间感。由于无需进行背景虚化处理,因此背景图像也可以清晰显示,使得图像的空间感更加完整,图像空间效果更加丰富。To sum up, in the embodiment of this application, by adjusting the color purity of the image, the color purity of the main image is higher than that of the non-subject image (such as the background image), based on the difference between the color purity of the main image and the non-subject image. difference, thereby enhancing the sense of space in the picture. Since there is no need for background blurring, the background image can also be displayed clearly, making the image more complete in its sense of space and richer in its spatial effect.

本申请实施例提供的图像处理方法,执行主体可以为图像处理装置。本申请实施例中以图像处理装置执行图像处理方法为例,说明本申请实施例提供的图像处理装置。The image processing method provided in the embodiment of the present application may be executed by an image processing device. In the embodiment of the present application, the image processing device executed by the image processing device is taken as an example to describe the image processing device provided in the embodiment of the present application.

图6是本申请实施例提供的一种图像处理装置的示意框图,该图像处理装置应用于电子设备。Fig. 6 is a schematic block diagram of an image processing apparatus provided by an embodiment of the present application, and the image processing apparatus is applied to electronic equipment.

如图6所示,所述图像处理装置可以包括:As shown in Figure 6, the image processing device may include:

确定模块601,用于确定第一图像中的第一区域和第二区域。A determiningmodule 601, configured to determine a first area and a second area in the first image.

其中,所述第一区域包括所述第一图像中的主体图像区域,所述第二区域为所述第一图像中除所述第一区域外的图像区域。Wherein, the first area includes a subject image area in the first image, and the second area is an image area in the first image other than the first area.

处理模块602,用于对所述第一图像进行色纯度调整,获得第二图像。Theprocessing module 602 is configured to perform color purity adjustment on the first image to obtain a second image.

其中,在所述第二图像中,所述第一区域的图像色纯度大于所述第二区域的图像色纯度。Wherein, in the second image, the image color purity of the first region is greater than the image color purity of the second region.

可选地,所述确定模块601可以包括:Optionally, the determiningmodule 601 may include:

获取单元,用于获取所述第一图像的景深信息。An acquiring unit, configured to acquire depth information of the first image.

第一确定单元,用于根据所述景深信息,确定所述第一图像中的主体与背景之间的距离。The first determination unit is configured to determine the distance between the subject and the background in the first image according to the depth of field information.

第二确定单元,用于在所述距离小于预设值的情况下,将所述主体图像区域确定为所述第一区域,将所述第一图像中的其他图像区域确定为所述第二区域。A second determining unit, configured to determine the subject image area as the first area, and determine other image areas in the first image as the second when the distance is smaller than a preset value. area.

第三确定单元,用于在所述距离大于预设值的情况下,将所述第一图像中与焦平面对应的图像区域确定为所述第一区域,将所述第一图像中的其他图像区域确定为所述第二区域。A third determination unit, configured to determine the image area corresponding to the focal plane in the first image as the first area when the distance is greater than a preset value, and determine other areas in the first image An image area is determined as the second area.

其中,所述焦平面对应的图像区域包括所述主体图像区域,所述其他图像区域是指所述第一图像中除所述第一区域外的图像区域。Wherein, the image area corresponding to the focal plane includes the subject image area, and the other image areas refer to image areas in the first image other than the first area.

可选地,所述处理模块602可以包括:Optionally, theprocessing module 602 may include:

第一处理单元,用于调高所述第一区域的图像色纯度至第一目标值;或者,按照到所述第一区域边缘的最小直线距离由小到大的顺序,将所述第二区域的图像色纯度逐渐调低至第二目标值。The first processing unit is configured to increase the image color purity of the first area to the first target value; or, according to the order of the minimum linear distance to the edge of the first area from small to large, the second The image color purity of the area is gradually reduced to the second target value.

可选地,所述处理模块602可以包括:Optionally, theprocessing module 602 may include:

第二处理单元,用于调高所述第一图像的色纯度至第三目标值。The second processing unit is configured to increase the color purity of the first image to a third target value.

第三处理单元,用于在调高色纯度后的所述第一图像中,按照到所述第一区域边缘的最小直线距离由小到大的顺序,将所述第二区域的图像色纯度逐渐调低至第四目标值。The third processing unit is configured to, in the first image after the color purity is adjusted, increase the color purity of the image in the second region in the order of the smallest linear distance to the edge of the first region from small to large Gradually decrease to the fourth target value.

可选地,在所述第一区域为所述主体图像区域的情况下,所述处理模块602可以包括:Optionally, when the first area is the subject image area, theprocessing module 602 may include:

识别单元,用于根据所述主体图像区域,识别所述第一图像中的主体图像轮廓。The recognition unit is configured to recognize the outline of the subject image in the first image according to the region of the subject image.

图像分割处理单元,用于根据所述主体图像轮廓,对所述第一图像中的主体图像和背景图像进行图像分割处理,以及对分割处理后的所述主体图像进行边缘羽化处理;An image segmentation processing unit, configured to perform image segmentation processing on the subject image and the background image in the first image according to the outline of the subject image, and perform edge feathering processing on the subject image after the segmentation process;

第四处理单元,用于对分割处理后的所述背景图像和边缘羽化处理后的所述主体图像中的至少一个,进行色纯度调整,获得所述第二图像。The fourth processing unit is configured to perform color purity adjustment on at least one of the segmented background image and the subject image after edge feathering to obtain the second image.

综上所述,本申请实施例中,通过调整图像的色纯度,使得主体图像的色纯度高于非主体图像(如背景图像)的色纯度,基于主体图像与非主体图像的色纯度之间的差异性,从而提升画面空间感。由于无需进行背景虚化处理,因此背景图像也可以清晰显示,使得图像的空间感更加完整,图像空间效果更加丰富。To sum up, in the embodiment of this application, by adjusting the color purity of the image, the color purity of the main image is higher than that of the non-subject image (such as the background image), based on the difference between the color purity of the main image and the non-subject image. difference, thereby enhancing the sense of space in the picture. Since there is no need for background blurring, the background image can also be displayed clearly, making the image more complete in its sense of space and richer in its spatial effect.

本申请实施例中的图像处理装置可以是电子设备,也可以是电子设备中的部件,例如集成电路或芯片。该电子设备可以是终端,也可以为除终端之外的其他设备。示例性的,电子设备可以为手机、平板电脑、笔记本电脑、掌上电脑、车载电子设备、移动上网装置(Mobile Internet Device,MID)、增强现实(Augmented Reality,AR)/虚拟现实(VirtualReality,VR)设备、机器人、可穿戴设备、超级移动个人计算机(Ultra-Mobile PersonalComputer,UMPC)、上网本或者个人数字助理(Personal Digital Assistant,PDA)等,还可以为服务器、网络附属存储器(Network Attached Storage,NAS)、个人计算机(PersonalComputer,PC)、电视机(Television,TV)、柜员机或者自助机等,本申请实施例不作具体限定。The image processing apparatus in the embodiment of the present application may be an electronic device, or may be a component in the electronic device, such as an integrated circuit or a chip. The electronic device may be a terminal, or other devices other than the terminal. Exemplarily, the electronic device may be a mobile phone, a tablet computer, a notebook computer, a handheld computer, a vehicle electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (Augmented Reality, AR)/virtual reality (VirtualReality, VR) Devices, robots, wearable devices, ultra-mobile personal computers (Ultra-Mobile PersonalComputer, UMPC), netbooks or personal digital assistants (Personal Digital Assistant, PDA), etc., can also be servers, network attached storage (Network Attached Storage, NAS) , a personal computer (Personal Computer, PC), a television (Television, TV), a teller machine or a self-service machine, etc., which are not specifically limited in this embodiment of the present application.

本申请实施例中的图像处理装置可以为具有操作系统的装置。该操作系统可以为安卓(Android)操作系统,可以为iOS操作系统,还可以为其他可能的操作系统,本申请实施例不作具体限定。The image processing device in the embodiment of the present application may be a device with an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in this embodiment of the present application.

本申请实施例提供的图像处理装置能够实现图1所示的图像处理方法实施例实现的各个过程,为避免重复,这里不再赘述。The image processing apparatus provided in the embodiment of the present application can realize various processes realized in the embodiment of the image processing method shown in FIG. 1 , and details are not repeated here to avoid repetition.

可选地,如图7所示,本申请实施例还提供一种电子设备700,包括:处理器701和存储器702,存储器702上存储有可所述处理器701上运行的程序或指令,该程序或指令被处理器701执行时实现上述图像处理方法实施例的各个步骤,且能达到相同的技术效果,为避免重复,这里不再赘述。Optionally, as shown in FIG. 7 , the embodiment of the present application also provides anelectronic device 700, including: aprocessor 701 and amemory 702, thememory 702 stores programs or instructions that can be run on theprocessor 701, the When the programs or instructions are executed by theprocessor 701, the steps of the above-mentioned image processing method embodiments can be realized, and the same technical effect can be achieved, so details are not repeated here to avoid repetition.

需要说明的是,本申请实施例中的电子设备700包括上述移动电子设备和非移动电子设备。It should be noted that theelectronic device 700 in the embodiment of the present application includes the above-mentioned mobile electronic device and non-mobile electronic device.

图8为实现本申请实施例的一种电子设备的硬件结构示意图。FIG. 8 is a schematic diagram of a hardware structure of an electronic device implementing an embodiment of the present application.

该电子设备800包括但不限于:射频单元801、网络模块802、音频输出单元803、输入单元804、传感器805、显示单元806、用户输入单元807、接口单元808、存储器809以及处理器810等部件。Theelectronic device 800 includes, but is not limited to: aradio frequency unit 801, anetwork module 802, anaudio output unit 803, aninput unit 804, asensor 805, adisplay unit 806, auser input unit 807, aninterface unit 808, amemory 809, and aprocessor 810, etc. .

本领域技术人员可以理解,电子设备800还可以包括给各个部件供电的电源(比如电池),电源可以通过电源管理系统与处理器810逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。图8中示出的电子设备结构并不构成对电子设备的限定,电子设备可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置,在此不再赘述。Those skilled in the art can understand that theelectronic device 800 can also include a power supply (such as a battery) for supplying power to various components, and the power supply can be logically connected to theprocessor 810 through the power management system, so that the management of charging, discharging, and function can be realized through the power management system. Consumption management and other functions. The structure of the electronic device shown in FIG. 8 does not constitute a limitation to the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine some components, or arrange different components, and details will not be repeated here. .

其中,处理器810可以用于:确定第一图像中的第一区域和第二区域;其中,所述第一区域包括所述第一图像中的主体图像区域,所述第二区域为所述第一图像中除所述第一区域外的图像区域;对所述第一图像进行色纯度调整,获得第二图像;其中,在所述第二图像中,所述第一区域的图像色纯度大于所述第二区域的图像色纯度。Wherein, theprocessor 810 may be configured to: determine a first area and a second area in the first image; wherein, the first area includes the subject image area in the first image, and the second area is the The image area in the first image except the first area; adjusting the color purity of the first image to obtain a second image; wherein, in the second image, the image color purity of the first area is greater than the image color purity of the second region.

可选地,处理器810还可以用于:获取所述第一图像的景深信息;根据所述景深信息,确定所述第一图像中的主体与背景之间的距离;在所述距离小于预设值的情况下,将所述主体图像区域确定为所述第一区域,将所述第一图像中的其他图像区域确定为所述第二区域;在所述距离大于预设值的情况下,将所述第一图像中与焦平面对应的图像区域确定为所述第一区域,将所述第一图像中的其他图像区域确定为所述第二区域;其中,所述焦平面对应的图像区域包括所述主体图像区域,所述其他图像区域是指所述第一图像中除所述第一区域外的图像区域。Optionally, theprocessor 810 may be further configured to: acquire depth information of the first image; determine the distance between the subject and the background in the first image according to the depth information; In the case of setting a value, the subject image area is determined as the first area, and other image areas in the first image are determined as the second area; when the distance is greater than a preset value , determining the image area corresponding to the focal plane in the first image as the first area, and determining other image areas in the first image as the second area; wherein, the focal plane corresponds to The image area includes the subject image area, and the other image areas refer to image areas in the first image other than the first area.

可选地,处理器810还可以用于:调高所述第一区域的图像色纯度至第一目标值;或者,按照到所述第一区域边缘的最小直线距离由小到大的顺序,将所述第二区域的图像色纯度逐渐调低至第二目标值。Optionally, theprocessor 810 may also be configured to: increase the image color purity of the first region to a first target value; or, in ascending order of the minimum linear distance to the edge of the first region, The image color purity of the second region is gradually reduced to a second target value.

可选地,处理器810还可以用于:调高所述第一图像的色纯度至第三目标值;在调高色纯度后的所述第一图像中,按照到所述第一区域边缘的最小直线距离由小到大的顺序,将所述第二区域的图像色纯度逐渐调低至第四目标值。Optionally, theprocessor 810 may also be configured to: increase the color purity of the first image to a third target value; The image color purity of the second region is gradually reduced to the fourth target value in ascending order of the minimum straight-line distance of .

可选地,在所述第一区域为所述主体图像区域的情况下,处理器810还可以用于:根据所述主体图像区域,识别所述第一图像中的主体图像轮廓;根据所述主体图像轮廓,对所述第一图像中的主体图像和背景图像进行图像分割处理,以及对分割处理后的所述主体图像进行边缘羽化处理;对分割处理后的所述背景图像和边缘羽化处理后的所述主体图像中的至少一个,进行色纯度调整,获得所述第二图像。Optionally, in the case that the first area is the subject image area, theprocessor 810 may be further configured to: identify the outline of the subject image in the first image according to the subject image area; Subject image outline, performing image segmentation processing on the subject image and background image in the first image, and performing edge feathering processing on the subject image after segmentation processing; performing edge feathering processing on the background image and edge feathering process after segmentation processing performing color purity adjustment on at least one of the subsequent subject images to obtain the second image.

本发明实施例中,通过调整图像的色纯度,使得主体图像的色纯度高于非主体图像(如背景图像)的色纯度,基于主体图像与非主体图像的色纯度之间的差异性,从而提升画面空间感。由于无需进行背景虚化处理,因此背景图像也可以清晰显示,使得图像的空间感更加完整,图像空间效果更加丰富。In the embodiment of the present invention, by adjusting the color purity of the image, the color purity of the subject image is higher than that of the non-subject image (such as the background image), based on the difference between the color purity of the subject image and the non-subject image, thereby Improve the sense of space in the screen. Since there is no need for background blurring, the background image can also be displayed clearly, making the image more complete in its sense of space and richer in its spatial effects.

应理解的是,本申请实施例中,输入单元804可以包括图形处理器(GraphicsProcessing Unit,GPU)8041和麦克风8042,图形处理器8041对在视频捕获模式或图像捕获模式中由图像捕获装置(如摄像头)得到的静态图片或视频的图像数据进行处理。显示单元806可包括显示面板8061,可以采用液晶显示器、有机发光二极管等形式来配置显示面板8061。用户输入单元807包括触控面板8071以及其他输入设备8072中的至少一种。触控面板8071,也称为触摸屏。触控面板8071可包括触摸检测装置和触摸控制器两个部分。其他输入设备8072可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆,在此不再赘述。It should be understood that, in the embodiment of the present application, theinput unit 804 may include a graphics processor (Graphics Processing Unit, GPU) 8041 and amicrophone 8042, and thegraphics processor 8041 is compatible with the image capture device (such as Camera) to process the image data of still pictures or videos. Thedisplay unit 806 may include adisplay panel 8061, and thedisplay panel 8061 may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like. Theuser input unit 807 includes at least one of atouch panel 8071 andother input devices 8072 . Thetouch panel 8071 is also called a touch screen. Thetouch panel 8071 may include two parts, a touch detection device and a touch controller.Other input devices 8072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, switch buttons, etc.), trackballs, mice, and joysticks, which will not be repeated here.

存储器809可用于存储软件程序以及各种数据。存储器809可主要包括存储程序或指令的第一存储区和存储数据的第二存储区,其中,第一存储区可存储操作系统、至少一个功能所需的应用程序或指令(比如声音播放功能、图像播放功能等)等。此外,存储器809可以包括易失性存储器或非易失性存储器,或者,存储器809可以包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(Read-Only Memory,ROM)、可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(Random Access Memory,RAM),静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(Dynamic RAM,DRAM)、同步动态随机存取存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(Double Data Rate SDRAM,DDRSDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(Synch link DRAM,SLDRAM)和直接内存总线随机存取存储器(Direct Rambus RAM,DRRAM)。本申请实施例中的存储器809包括但不限于这些和任意其它适合类型的存储器。Thememory 809 can be used to store software programs as well as various data. Thememory 809 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required by at least one function (such as a sound playing function, image playback function, etc.), etc. Furthermore,memory 809 may include volatile memory or nonvolatile memory, or,memory 809 may include both volatile and nonvolatile memory. Wherein, the non-volatile memory may be a read-only memory (Read-Only Memory, ROM), a programmable read-only memory (Programmable ROM, PROM), an erasable programmable read-only memory (Erasable PROM, EPROM), an electronically programmable Erase Programmable Read-Only Memory (Electrically EPROM, EEPROM) or Flash. Volatile memory can be random access memory (Random Access Memory, RAM), static random access memory (Static RAM, SRAM), dynamic random access memory (Dynamic RAM, DRAM), synchronous dynamic random access memory (Synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (Double Data Rate SDRAM, DDRSDRAM), enhanced synchronous dynamic random access memory (Enhanced SDRAM, ESDRAM), synchronous connection dynamic random access memory (Synch link DRAM , SLDRAM) and Direct Memory Bus Random Access Memory (Direct Rambus RAM, DRRAM). Thememory 809 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.

处理器810可包括一个或多个处理单元;可选的,处理器810集成应用处理器和调制解调处理器,其中,应用处理器主要处理涉及操作系统、用户界面和应用程序等的操作,调制解调处理器主要处理无线通信信号,如基带处理器。可以理解的是,上述调制解调处理器也可以不集成到处理器810中。Theprocessor 810 may include one or more processing units; optionally, theprocessor 810 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to the operating system, user interface, and application programs, etc., Modem processors mainly process wireless communication signals, such as baseband processors. It can be understood that the foregoing modem processor may not be integrated into theprocessor 810 .

本申请实施例还提供一种可读存储介质,所述可读存储介质上存储有程序或指令,该程序或指令被处理器执行时实现上述图像处理方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。The embodiment of the present application also provides a readable storage medium, the readable storage medium stores a program or an instruction, and when the program or instruction is executed by a processor, each process of the above-mentioned image processing method embodiment is realized, and can achieve the same To avoid repetition, the technical effects will not be repeated here.

其中,所述处理器为上述实施例中所述的电子设备中的处理器。所述可读存储介质,包括计算机可读存储介质,如计算机只读存储器ROM、随机存取存储器RAM、磁碟或者光盘等。Wherein, the processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes a computer-readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk, and the like.

本申请实施例另提供了一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现上述图像处理方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。The embodiment of the present application further provides a chip, the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the above image processing method embodiment Each process can achieve the same technical effect, so in order to avoid repetition, it will not be repeated here.

本申请实施例提供一种计算机程序产品,该程序产品被存储在存储介质中,该程序产品被至少一个处理器执行以实现如上述图像处理方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。The embodiment of the present application provides a computer program product, the program product is stored in a storage medium, and the program product is executed by at least one processor to implement the various processes in the above image processing method embodiment, and can achieve the same technical effect , to avoid repetition, it will not be repeated here.

应理解,本申请实施例提到的芯片还可以称为系统级芯片、系统芯片、芯片系统或片上系统芯片等。It should be understood that the chips mentioned in the embodiments of the present application may also be called system-on-chip, system-on-chip, system-on-a-chip, or system-on-a-chip.

需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。此外,需要指出的是,本申请实施方式中的方法和装置的范围不限按示出或讨论的顺序来执行功能,还可包括根据所涉及的功能按基本同时的方式或按相反的顺序来执行功能,例如,可以按不同于所描述的次序来执行所描述的方法,并且还可以添加、省去或组合各种步骤。另外,参照某些示例所描述的特征可在其他示例中被组合。It should be noted that, in this document, the term "comprising", "comprising" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article or apparatus comprising a set of elements includes not only those elements, It also includes other elements not expressly listed, or elements inherent in the process, method, article, or device. Without further limitations, an element defined by the phrase "comprising a ..." does not preclude the presence of additional identical elements in the process, method, article, or apparatus comprising that element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved. Functions are performed, for example, the described methods may be performed in an order different from that described, and various steps may also be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.

通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以计算机软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM、RAM、磁碟、光盘)中,包括若干指令用以使得一台终端(可以是手机,计算机,服务器或者网络设备等)执行本申请各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus a necessary general-purpose hardware platform, and of course also by hardware, but in many cases the former is better implementation. Based on such an understanding, the technical solution of the present application can be embodied in the form of computer software products in essence or the part that contributes to the prior art, and the computer software products are stored in a storage medium (such as ROM, RAM, disk , optical disc), including several instructions to enable a terminal (which may be a mobile phone, computer, server or network device, etc.) to execute the methods described in the various embodiments of the present application.

上面结合附图对本申请的实施例进行了描述,但是本申请并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本申请的启示下,在不脱离本申请宗旨和权利要求所保护的范围情况下,还可做出很多形式,均属于本申请的保护之内。The embodiments of the present application have been described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementations. The above-mentioned specific implementations are only illustrative and not restrictive. Those of ordinary skill in the art will Under the inspiration of this application, without departing from the purpose of this application and the scope of protection of the claims, many forms can also be made, all of which belong to the protection of this application.

Claims (10)

Translated fromChinese
1.一种图像处理方法,其特征在于,所述方法包括:1. An image processing method, characterized in that the method comprises:确定第一图像中的第一区域和第二区域;其中,所述第一区域包括所述第一图像中的主体图像区域,所述第二区域为所述第一图像中除所述第一区域外的图像区域;Determining a first area and a second area in the first image; wherein, the first area includes the subject image area in the first image, and the second area is the first area in the first image except the first area. the image area outside the area;对所述第一图像进行色纯度调整,获得第二图像;其中,在所述第二图像中,所述第一区域的图像色纯度大于所述第二区域的图像色纯度。Performing color purity adjustment on the first image to obtain a second image; wherein, in the second image, the image color purity of the first region is greater than the image color purity of the second region.2.根据权利要求1所述的图像处理方法,其特征在于,所述确定第一图像中的第一区域和第二区域,包括:2. The image processing method according to claim 1, wherein said determining the first region and the second region in the first image comprises:获取所述第一图像的景深信息;Acquiring the depth of field information of the first image;根据所述景深信息,确定所述第一图像中的主体与背景之间的距离;determining the distance between the subject and the background in the first image according to the depth of field information;在所述距离小于预设值的情况下,将所述主体图像区域确定为所述第一区域,将所述第一图像中的其他图像区域确定为所述第二区域;When the distance is smaller than a preset value, determining the subject image area as the first area, and determining other image areas in the first image as the second area;在所述距离大于预设值的情况下,将所述第一图像中与焦平面对应的图像区域确定为所述第一区域,将所述第一图像中的其他图像区域确定为所述第二区域;其中,所述焦平面对应的图像区域包括所述主体图像区域,所述其他图像区域是指所述第一图像中除所述第一区域外的图像区域。If the distance is greater than a preset value, determining an image area corresponding to the focal plane in the first image as the first area, and determining other image areas in the first image as the second image area Two regions; wherein, the image region corresponding to the focal plane includes the subject image region, and the other image regions refer to image regions in the first image other than the first region.3.根据权利要求1所述的图像处理方法,其特征在于,所述对所述第一图像进行色纯度调整,获得第二图像,包括:3. The image processing method according to claim 1, wherein said adjusting the color purity of said first image to obtain a second image comprises:调高所述第一区域的图像色纯度至第一目标值;或者,按照到所述第一区域边缘的最小直线距离由小到大的顺序,将所述第二区域的图像色纯度逐渐调低至第二目标值。Increase the image color purity of the first area to the first target value; or, gradually adjust the image color purity of the second area in the order of the smallest linear distance to the edge of the first area from small to large down to the second target value.4.根据权利要求1所述的图像处理方法,其特征在于,所述对所述第一图像进行色纯度调整,获得第二图像,包括:4. The image processing method according to claim 1, wherein said adjusting the color purity of said first image to obtain a second image comprises:调高所述第一图像的色纯度至第三目标值;increasing the color purity of the first image to a third target value;在调高色纯度后的所述第一图像中,按照到所述第一区域边缘的最小直线距离由小到大的顺序,将所述第二区域的图像色纯度逐渐调低至第四目标值。In the first image after the color purity has been adjusted, the color purity of the image in the second region is gradually reduced to the fourth target in the order of the smallest straight-line distance to the edge of the first region from small to large value.5.根据权利要求1或2所述的图像处理方法,其特征在于,在所述第一区域为所述主体图像区域的情况下,所述对所述第一图像进行色纯度调整,获得第二图像,包括:5. The image processing method according to claim 1 or 2, wherein when the first region is the subject image region, performing color purity adjustment on the first image to obtain the second Two images, including:根据所述主体图像区域,识别所述第一图像中的主体图像轮廓;identifying an outline of a subject image in the first image according to the subject image area;根据所述主体图像轮廓,对所述第一图像中的主体图像和背景图像进行图像分割处理,以及对分割处理后的所述主体图像进行边缘羽化处理;performing image segmentation processing on the subject image and the background image in the first image according to the outline of the subject image, and performing edge feathering processing on the subject image after the segmentation process;对分割处理后的所述背景图像和边缘羽化处理后的所述主体图像中的至少一个,进行色纯度调整,获得所述第二图像。Perform color purity adjustment on at least one of the segmented background image and the subject image after edge feathering to obtain the second image.6.一种图像处理装置,其特征在于,所述装置包括:6. An image processing device, characterized in that the device comprises:确定模块,用于确定第一图像中的第一区域和第二区域;其中,所述第一区域包括所述第一图像中的主体图像区域,所述第二区域为所述第一图像中除所述第一区域外的图像区域;A determination module, configured to determine a first area and a second area in the first image; wherein, the first area includes the subject image area in the first image, and the second area is the area in the first image an image area other than said first area;处理模块,用于对所述第一图像进行色纯度调整,获得第二图像;其中,在所述第二图像中,所述第一区域的图像色纯度大于所述第二区域的图像色纯度。A processing module, configured to adjust the color purity of the first image to obtain a second image; wherein, in the second image, the image color purity of the first region is greater than the image color purity of the second region .7.根据权利要求6所述的图像处理装置,其特征在于,所述确定模块包括:7. The image processing device according to claim 6, wherein the determining module comprises:获取单元,用于获取所述第一图像的景深信息;an acquiring unit, configured to acquire depth information of the first image;第一确定单元,用于根据所述景深信息,确定所述第一图像中的主体与背景之间的距离;A first determining unit, configured to determine the distance between the subject and the background in the first image according to the depth of field information;第二确定单元,用于在所述距离小于预设值的情况下,将所述主体图像区域确定为所述第一区域,将所述第一图像中的其他图像区域确定为所述第二区域;A second determining unit, configured to determine the subject image area as the first area, and determine other image areas in the first image as the second when the distance is smaller than a preset value. area;第三确定单元,用于在所述距离大于预设值的情况下,将所述第一图像中与焦平面对应的图像区域确定为所述第一区域,将所述第一图像中的其他图像区域确定为所述第二区域;其中,所述焦平面对应的图像区域包括所述主体图像区域,所述其他图像区域是指所述第一图像中除所述第一区域外的图像区域。A third determination unit, configured to determine the image area corresponding to the focal plane in the first image as the first area when the distance is greater than a preset value, and determine other areas in the first image The image area is determined as the second area; wherein, the image area corresponding to the focal plane includes the subject image area, and the other image areas refer to image areas in the first image other than the first area .8.根据权利要求6所述的图像处理装置,其特征在于,所述处理模块包括:8. The image processing device according to claim 6, wherein the processing module comprises:第一处理单元,用于调高所述第一区域的图像色纯度至第一目标值;或者,按照到所述第一区域边缘的最小直线距离由小到大的顺序,将所述第二区域的图像色纯度逐渐调低至第二目标值。The first processing unit is configured to increase the image color purity of the first area to the first target value; or, according to the order of the minimum linear distance to the edge of the first area from small to large, the second The image color purity of the area is gradually reduced to the second target value.9.根据权利要求6所述的图像处理装置,其特征在于,所述处理模块包括:9. The image processing device according to claim 6, wherein the processing module comprises:第二处理单元,用于调高所述第一图像的色纯度至第三目标值;a second processing unit, configured to increase the color purity of the first image to a third target value;第三处理单元,用于在调高色纯度后的所述第一图像中,按照与所述第一区域轮廓之间的最小直线距离由小到大的顺序,将所述第二区域的图像色纯度逐渐调低至第四目标值。The third processing unit is configured to, in the first image after the color purity is adjusted, convert the image of the second area in the order of the smallest linear distance to the outline of the first area from small to large The color purity is gradually reduced to the fourth target value.10.根据权利要求6或7所述的图像处理装置,其特征在于,在所述第一区域为所述主体图像区域的情况下,所述处理模块包括:10. The image processing device according to claim 6 or 7, wherein when the first area is the subject image area, the processing module includes:识别单元,用于根据所述主体图像区域,识别所述第一图像中的主体图像轮廓;An identification unit, configured to identify the outline of the subject image in the first image according to the area of the subject image;图像分割处理单元,用于根据所述主体图像轮廓,对所述第一图像中的主体图像和背景图像进行图像分割处理,以及对分割处理后的所述主体图像进行边缘羽化处理;An image segmentation processing unit, configured to perform image segmentation processing on the subject image and the background image in the first image according to the outline of the subject image, and perform edge feathering processing on the subject image after the segmentation process;第四处理单元,用于对分割处理后的所述背景图像和边缘羽化处理后的所述主体图像中的至少一个,进行色纯度调整,获得所述第二图像。The fourth processing unit is configured to perform color purity adjustment on at least one of the segmented background image and the subject image after edge feathering to obtain the second image.
CN202211519802.4A2022-11-302022-11-30Image processing method and devicePendingCN115883986A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202211519802.4ACN115883986A (en)2022-11-302022-11-30Image processing method and device

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202211519802.4ACN115883986A (en)2022-11-302022-11-30Image processing method and device

Publications (1)

Publication NumberPublication Date
CN115883986Atrue CN115883986A (en)2023-03-31

Family

ID=85764894

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202211519802.4APendingCN115883986A (en)2022-11-302022-11-30Image processing method and device

Country Status (1)

CountryLink
CN (1)CN115883986A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN106997595A (en)*2017-03-092017-08-01广东欧珀移动通信有限公司 Image color processing method, processing device and electronic device based on depth of field
WO2017173578A1 (en)*2016-04-052017-10-12华为技术有限公司Image enhancement method and device
CN107977940A (en)*2017-11-302018-05-01广东欧珀移动通信有限公司background blurring processing method, device and equipment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
WO2017173578A1 (en)*2016-04-052017-10-12华为技术有限公司Image enhancement method and device
CN106997595A (en)*2017-03-092017-08-01广东欧珀移动通信有限公司 Image color processing method, processing device and electronic device based on depth of field
CN107977940A (en)*2017-11-302018-05-01广东欧珀移动通信有限公司background blurring processing method, device and equipment

Similar Documents

PublicationPublication DateTitle
CN110100251B (en) Apparatus, method, and computer-readable storage medium for processing documents
US20230353864A1 (en)Photographing method and apparatus for intelligent framing recommendation
US20240273909A1 (en)Camera shooting parameter adjustment method and apparatus, and electronic device
CN111901519B (en)Screen light supplement method and device and electronic equipment
CN104853091A (en)Picture taking method and mobile terminal
US20250150705A1 (en)Image processing method and apparatus, electronic device, and storage medium
US11770603B2 (en)Image display method having visual effect of increasing size of target image, mobile terminal, and computer-readable storage medium
CN105430269B (en)A kind of photographic method and device applied to mobile terminal
CN108513069A (en)Image processing method, image processing device, storage medium and electronic equipment
WO2023125160A1 (en)Image processing method and apparatus, electronic device, and readable storage medium
CN116320769A (en) Exposure adjustment method, device, electronic device and readable storage medium
CN108259767A (en)Image processing method, image processing device, storage medium and electronic equipment
CN108763491B (en)Picture processing method and device and terminal equipment
CN112561787B (en)Image processing method, device, electronic equipment and storage medium
CN114785969A (en)Shooting method and device
CN114554098A (en) Display method, display device, electronic device, and readable storage medium
CN114546576A (en)Display method, display device, electronic apparatus, and readable storage medium
CN108495038A (en)Image processing method, image processing device, storage medium and electronic equipment
CN115797160A (en) Image generation method and device
CN115883986A (en)Image processing method and device
CN116261043A (en) Focus distance determination method, device, electronic device and readable storage medium
CN112399091B (en)Image processing method and device and electronic equipment
CN114785957A (en)Shooting method and device thereof
CN115209056A (en)Shooting method, shooting device, electronic equipment and storage medium
CN115514860A (en) Dynamic frame rate compensation method, image processing circuit and electronic equipment

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination

[8]ページ先頭

©2009-2025 Movatter.jp