CN114723613A - Image processing method and device, electronic device, storage medium - Google Patents

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

Info

Publication number
CN114723613A
CN114723613A CN202110007717.9A CN202110007717A CN114723613A CN 114723613 A CN114723613 A CN 114723613A CN 202110007717 A CN202110007717 A CN 202110007717A CN 114723613 A CN114723613 A CN 114723613A
Authority
CN
China
Prior art keywords
pixel
image
pixels
processed
value
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.)
Granted
Application number
CN202110007717.9A
Other languages
Chinese (zh)
Other versions
CN114723613B (en
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 CN202110007717.9A priority Critical patent/CN114723613B/en
Publication of CN114723613A publication Critical patent/CN114723613A/en
Application granted granted Critical
Publication of CN114723613B publication Critical patent/CN114723613B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/70Denoising; Smoothing
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection

Landscapes

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

Abstract

The disclosure relates to an image processing method and device, an electronic device and a storage medium. Wherein, the method comprises the following steps: acquiring a to-be-processed image of a brightness-chrominance space domain, and performing down-sampling operation on the to-be-processed image to obtain a low-frequency image of the to-be-processed image; respectively determining the chromaticity weight of each first pixel according to the brightness difference degree of each first pixel and each first neighborhood pixel in the image to be processed, wherein the chromaticity weight of each first pixel in each first pixel is positively correlated with the corresponding brightness difference degree; and performing upsampling operation on the low-frequency image based on the chromaticity weight corresponding to each first pixel, and synthesizing the image obtained through the upsampling operation with the image to be processed to obtain a processed image. By the method, the chromatic value of the image can be adjusted in the image processing process, and the condition that color edge color overflows in the processed image is avoided.

Description

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

技术领域technical field

本公开涉及图像处理领域,特别涉及一种图像处理方法及装置、电子设备、存储介质。The present disclosure relates to the field of image processing, and in particular, to an image processing method and device, an electronic device, and a storage medium.

背景技术Background technique

电子设备在采集、传输、处理图像的过程中,难免受到各种因素的干扰,导致获得的图像中伴随着噪声信号。图像中伴随的噪声信号主要包含两种噪声信号,即亮度噪声和彩色噪声(又被称为:色度噪声)。In the process of collecting, transmitting, and processing images, electronic devices are inevitably disturbed by various factors, resulting in the acquired images accompanied by noise signals. The noise signal accompanying the image mainly includes two kinds of noise signal, namely luminance noise and color noise (also known as: chrominance noise).

在相关技术中,对于亮度噪声的处理已经有了较为成熟的降噪技术。但是,对于图像中的彩色噪声,仍难以进行有效的降噪处理,尤其在色彩跨度较大的颜色边缘处,经常出现色彩溢出或模糊的状况。In the related art, a relatively mature noise reduction technology has been developed for the processing of luminance noise. However, for the color noise in the image, it is still difficult to perform effective noise reduction processing, especially at the color edge with a large color span, color overflow or blurring often occurs.

发明内容SUMMARY OF THE INVENTION

有鉴于此,本公开提供一种图像处理方法及装置、电子设备、存储介质,在对低频图像进行上采样的过程中,能够根据高频图像的亮度分布情况,对低频图像的色度值进行调整,以避免通过上采样得到的图像出现颜色边缘色彩溢出的情况。In view of this, the present disclosure provides an image processing method and device, an electronic device, and a storage medium. In the process of upsampling a low-frequency image, the chromaticity value of the low-frequency image can be processed according to the brightness distribution of the high-frequency image. Adjustment to avoid color bleed at the edges of the upsampled image.

为实现上述目的,本公开提供技术方案如下:To achieve the above object, the present disclosure provides the following technical solutions:

根据本公开的第一方面,提出了一种图像处理方法,包括:According to a first aspect of the present disclosure, an image processing method is proposed, including:

获取亮度-色度空间域的待处理图像,并对所述待处理图像进行下采样操作,得到所述待处理图像的低频图像;Acquiring a to-be-processed image in the luminance-chrominance space domain, and performing a downsampling operation on the to-be-processed image to obtain a low-frequency image of the to-be-processed image;

根据所述待处理图像中的各个第一像素与各自的第一邻域像素的亮度差异程度,分别确定所述各个第一像素的色度权重,其中,所述各个第一像素中,每个第一像素的色度权重与相应的亮度差异程度呈正相关;The chromaticity weight of each first pixel is determined according to the degree of difference in luminance between each first pixel in the image to be processed and the respective first neighborhood pixels, wherein each of the first pixels, each The chrominance weight of the first pixel is positively correlated with the corresponding luminance difference;

基于所述各个第一像素对应的色度权重对所述低频图像进行上采样操作,并将经由所述上采样操作得到的图像与所述待处理图像合成,得到处理后图像。An up-sampling operation is performed on the low-frequency image based on the chrominance weight corresponding to each first pixel, and the image obtained through the up-sampling operation is synthesized with the to-be-processed image to obtain a processed image.

根据本公开的第二方面,提出了一种图像处理装置,包括:According to a second aspect of the present disclosure, an image processing apparatus is proposed, comprising:

获取单元,获取亮度-色度空间域的待处理图像,并对所述待处理图像进行下采样操作,得到所述待处理图像的低频图像;an acquisition unit that acquires an image to be processed in the luminance-chrominance space domain, and performs a downsampling operation on the image to be processed to obtain a low-frequency image of the image to be processed;

确定单元,根据所述待处理图像中的各个第一像素与各自的第一邻域像素的亮度差异程度,分别确定所述各个第一像素的色度权重,其中,所述各个第一像素中,每个第一像素的色度权重与相应的亮度差异程度呈正相关;The determining unit determines the chrominance weight of each first pixel according to the brightness difference between each first pixel in the to-be-processed image and the respective first neighborhood pixels, wherein, in each first pixel , the chrominance weight of each first pixel is positively correlated with the corresponding luminance difference;

合成单元,基于所述各个第一像素对应的色度权重对所述低频图像进行上采样操作,并将经由所述上采样操作得到的图像与所述待处理图像合成,得到处理后图像。The synthesis unit performs an up-sampling operation on the low-frequency image based on the chrominance weight corresponding to each first pixel, and synthesizes the image obtained through the up-sampling operation with the to-be-processed image to obtain a processed image.

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

处理器;processor;

用于存储处理器可执行指令的存储器;memory for storing processor-executable instructions;

其中,所述处理器通过运行所述可执行指令以实现如第一方面所述的方法。Wherein, the processor implements the method according to the first aspect by executing the executable instructions.

根据本公开的第四方面,提供一种计算机可读存储介质,其上存储有计算机指令,该指令被处理器执行时实现如第一方面所述方法的步骤。According to a fourth aspect of the present disclosure, there is provided a computer-readable storage medium having computer instructions stored thereon, the instructions, when executed by a processor, implement the steps of the method according to the first aspect.

在本公开的技术方案中,提供了一种图像处理方法。该方法一方面针对获取到的亮度-色度空间域的待处理图像进行下采样操作,以得到相应的低频图像;另一方面,根据待处理图像中的各个第一像素与各自第一邻域像素的亮度差异程度,为所包含的各个第一像素分配了色度权重,且每个第一像素的色度权重与相应的亮度差异程度呈正相关。在此基础上,即可基于待处理图像中各个第一像素对应的色度权重对低频图像进行上采样操作,以得到尺寸与待处理图像一致的图像,并将该图像与待处理图像进行合并,得到处理后图像。In the technical solution of the present disclosure, an image processing method is provided. On the one hand, the method performs a downsampling operation on the obtained image to be processed in the luminance-chrominance space domain to obtain a corresponding low-frequency image; The luminance difference degree of the pixels is assigned a chrominance weight to each of the included first pixels, and the chrominance weight of each first pixel is positively correlated with the corresponding luminance difference degree. On this basis, an up-sampling operation can be performed on the low-frequency image based on the chrominance weight corresponding to each first pixel in the image to be processed to obtain an image with the same size as the image to be processed, and the image and the image to be processed are merged , to get the processed image.

可以理解的是,在图像领域中,图像中颜色的变化会对亮度变化产生影响,且颜色变化较大,亮度变化通常也较大。换言之,图像中的亮度变化能够反映颜色的变化。对于任一像素而言,若与邻域像素的亮度差异程度越大,意味着该任一像素与其邻域像素的色度差值通常也较大。而本公开中任一像素的色度权重与相应的亮度差异程度呈正相关,相当于为亮度变化大的区域(颜色边缘处)的像素分配更高的色度权重。在此基础上,通过确定的色度权重对低频图像进行上采样操作,相当于将低频图像中的颜色边缘处的像素的色度值提高,使得颜色边缘处的颜色变化更加突出,进而避免了相关技术中颜色边缘处色彩溢出的问题。It can be understood that in the image field, the change of the color in the image will affect the change of the brightness, and the change of the color is larger, and the change of the brightness is usually larger. In other words, changes in brightness in an image can reflect changes in color. For any pixel, if the degree of difference in luminance with neighboring pixels is greater, it means that the difference in chrominance between any pixel and its neighboring pixels is generally greater. In the present disclosure, the chrominance weight of any pixel is positively correlated with the corresponding degree of luminance difference, which is equivalent to assigning a higher chrominance weight to a pixel in an area with large luminance variation (at the color edge). On this basis, up-sampling the low-frequency image by the determined chrominance weight is equivalent to increasing the chroma value of the pixel at the color edge in the low-frequency image, making the color change at the color edge more prominent, thereby avoiding The problem of color overflow at the color edge in the related art.

简言之,本公开通过对图像中的亮度变化情况进行分析,识别出了图像中的颜色边缘处,进而通过给颜色边缘处的像素分配更高的色度权重的方式,使得颜色边缘处像素的色度值与颜色平坦处像素的色度值的差值增大,凸显了颜色边缘处与颜色平坦处的差异,解决了相关技术中颜色边缘处色彩溢出的问题。In short, the present disclosure identifies the color edge in the image by analyzing the brightness change in the image, and then assigns a higher chrominance weight to the pixel at the color edge, so that the pixel at the color edge The difference between the chromaticity value of the pixel and the chromaticity value of the pixel where the color is flat increases, which highlights the difference between the color edge and the color flat, and solves the problem of color overflow at the color edge in the related art.

附图说明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 of the present disclosure;

图2是本公开一示例性实施例示出的一种待处理图像的示意图;FIG. 2 is a schematic diagram of an image to be processed according to an exemplary embodiment of the present disclosure;

图3是本公开一示例性实施例示出的一种低频图像的示意图;FIG. 3 is a schematic diagram of a low-frequency image according to an exemplary embodiment of the present disclosure;

图4A是本公开一示例性实施例示出的一种通过上采样操作得到的图像的示意图;4A is a schematic diagram of an image obtained by an upsampling operation according to an exemplary embodiment of the present disclosure;

图4B是本公开一示例性实施例示出的一种通过双线性插值方式进行上采样操作与联合引导上采样操作的对比示意图;4B is a schematic diagram illustrating a comparison between an upsampling operation performed by bilinear interpolation and a joint guided upsampling operation according to an exemplary embodiment of the present disclosure;

图5是本公开一示例性实施例示出的一种图像处理装置的框图;FIG. 5 is a block diagram of an image processing apparatus according to an exemplary embodiment of the present disclosure;

图6是本公开一示例性实施例示出的另一种图像处理装置的框图;FIG. 6 is a block diagram of another image processing apparatus shown in an exemplary embodiment of the present disclosure;

图7是本公开一示例性实施例中一种电子设备的结构示意图。FIG. 7 is a schematic structural diagram of an electronic device in an exemplary embodiment of the present disclosure.

具体实施方式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 implementations described in the illustrative examples below are not intended to represent all implementations 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.

在本公开使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本公开。在本公开和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。还应当理解,本文中使用的术语“和/或”是指并包含一个或多个相关联的列出项目的任何或所有可能组合。The terminology used in the present disclosure is for the purpose of describing particular embodiments only and is not intended to limit the present disclosure. As used in this disclosure and the appended claims, the singular forms "a," "the," and "the" are intended to include the plural forms as well, unless the context clearly dictates otherwise. It will also be understood that the term "and/or" as used herein refers to and includes any and all possible combinations of one or more of the associated listed items.

应当理解,尽管在本公开可能采用术语第一、第二、第三等来描述各种信息,但这些信息不应限于这些术语。这些术语仅用来将同一类型的信息彼此区分开。例如,在不脱离本公开范围的情况下,第一信息也可以被称为第二信息,类似地,第二信息也可以被称为第一信息。取决于语境,如在此所使用的词语“如果”可以被解释成为“在……时”或“当……时”或“响应于确定”。It should be understood that although the terms first, second, third, etc. may be used in this disclosure to describe various pieces of information, such information should not be limited by these terms. These terms are only used to distinguish the same type of information from each other. For example, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information, without departing from the scope of the present disclosure. Depending on the context, the word "if" as used herein can be interpreted as "at the time of" or "when" or "in response to determining."

电子设备在采集、传输、处理图像的过程中,难免受到各种因素的干扰,导致获得的图像中伴随着噪声信号。图像中伴随的噪声信号主要包含两种噪声信号,即亮度噪声和彩色噪声(又被称为:色度噪声)。In the process of collecting, transmitting, and processing images, electronic devices are inevitably disturbed by various factors, resulting in the acquired images accompanied by noise signals. The noise signal accompanying the image mainly includes two kinds of noise signal, namely luminance noise and color noise (also known as: chrominance noise).

在相关技术中,对于亮度噪声的处理已经有了较为成熟的降噪技术。但是,对于图像中的彩色噪声,仍难以进行有效的降噪处理,尤其在色彩跨度较大的颜色边缘处,经常出现色彩溢出或模糊的状况。In the related art, a relatively mature noise reduction technology has been developed for the processing of luminance noise. However, for the color noise in the image, it is still difficult to perform effective noise reduction processing, especially at the color edge with a large color span, color overflow or blurring often occurs.

具体的,由于彩色噪声在低频图像中较为明显,因此相关技术通常采用多尺度降噪框架对图像进行降噪处理。在通过该框架处理的过程中,需要对待处理图像进行至少一次下采样操作,以得到对应于该待处理图像的至少一个低频图像。然后,可以分别对得到的至少一个低频图像和待处理图像进行降噪,再对降噪完成的低频图像进行上采样操作,以得到最终处理完毕的图像。Specifically, since color noise is more obvious in low-frequency images, related technologies usually use a multi-scale noise reduction framework to perform noise reduction processing on images. In the process of processing through the framework, at least one down-sampling operation needs to be performed on the to-be-processed image to obtain at least one low-frequency image corresponding to the to-be-processed image. Then, noise reduction can be performed on the obtained at least one low-frequency image and the image to be processed, respectively, and then an up-sampling operation is performed on the low-frequency image whose noise reduction has been completed to obtain a final processed image.

以进行两次下采样操作为例说明,在该举例中,将待处理图像称作高频图像,将第一次下采样得到的图像称作中频图像,将第二次下采样得到的图像称作低频图像。具体的:Taking two downsampling operations as an example, in this example, the image to be processed is called a high-frequency image, the image obtained by the first downsampling is called an intermediate frequency image, and the image obtained by the second downsampling is called a high-frequency image. for low frequency images. specific:

首先,可以对高频图像进行一次下采样操作,以得到尺寸较小的中频图像;再对得到的中频图像进行下采样操作,以得到尺寸更小的低频图像。然后,可以分别对高频图像、中频图像和低频图像进行降噪处理,以进行相对细致的降噪处理。在完成降噪处理后,即可对低频图像进行上采样操作,得到尺寸与中频图像一致的图像,该图像用于与降噪处理后的中频图像进行合成;进一步的,可以对合成得到的图像进行上采样操作,得到尺寸与高频图像一致的图像,该图像被用于与降噪处理后的高频图像进行合成,得到完成处理的图像。First, a down-sampling operation can be performed on the high-frequency image to obtain an intermediate-frequency image with a smaller size; and then a down-sampling operation can be performed on the obtained intermediate-frequency image to obtain a low-frequency image with a smaller size. Then, noise reduction processing can be performed on the high frequency image, the intermediate frequency image and the low frequency image respectively, so as to perform relatively detailed noise reduction processing. After the noise reduction process is completed, the low-frequency image can be up-sampled to obtain an image with the same size as the intermediate-frequency image, and the image is used for synthesizing the intermediate-frequency image after the noise reduction process; further, the synthesized image can be An up-sampling operation is performed to obtain an image whose size is consistent with the high-frequency image, and the image is used to synthesize the high-frequency image after noise reduction processing to obtain a processed image.

在上述通过多尺度降噪框架进行降噪处理的过程中,低频图像(包括上述针对中频图像的上采样操作)在上采样的过程中,仅基于自身的色度信息进行上采样,无法解决颜色边缘处出现色彩溢出或模糊的问题。In the above-mentioned process of noise reduction through the multi-scale noise reduction framework, during the upsampling process of low-frequency images (including the above-mentioned upsampling operation for intermediate frequency images), only upsampling is performed based on its own chromaticity information, and the color cannot be resolved. Color bleeding or blurring at the edges.

更为严重的是,由于上述“下采样操作→降噪处理→上采样操作”这一系列操作中,涉及多次图像尺度的变化,会导致图像解析度下降,甚至可能在原本不存在该问题的图像中造成该问题(例如,在上采样的过程中,确定的插值仅通过自身色度值确定,可能导致相邻像素之间的色度差值缩小,进而造成颜色边缘处色彩模糊的现象)。More seriously, since the above series of operations of "downsampling operation → noise reduction processing → upsampling operation" involve multiple changes in image scale, the image resolution will be reduced, and this problem may not exist originally. (For example, in the process of upsampling, the determined interpolation is only determined by its own chromaticity value, which may cause the chromaticity difference between adjacent pixels to shrink, resulting in the phenomenon of color blurring at the color edge. ).

为此,本公开提出了一种能够识别出图像的颜色边缘处,并对该颜色边缘处的像素的色度值进行调整的方式,去除该颜色边缘处的彩色噪声,进而避免相关技术中颜色边缘处出现色彩溢出或模糊的情况。To this end, the present disclosure proposes a method that can identify the color edge of an image, and adjust the chromaticity value of the pixel at the color edge to remove the color noise at the color edge, thereby avoiding the color in the related art. Color bleeding or blurring occurs at the edges.

图1为本公开一示例性实施例示出的一种图像处理方法。如图1所示,该方法可以包括以下步骤:FIG. 1 shows an image processing method according to an exemplary embodiment of the present disclosure. As shown in Figure 1, the method may include the following steps:

步骤102,获取亮度-色度空间域的待处理图像,并对所述待处理图像进行下采样操作,以得到所述待处理图像的低频图像。Step 102: Acquire an image to be processed in the luminance-chrominance space domain, and perform a downsampling operation on the to-be-processed image to obtain a low-frequency image of the to-be-processed image.

本公开的技术方案可以应用于任一类型的电子设备,例如,该电子设备可以为智能手机、平板电脑等移动终端,也可以为智能电视、PC(个人计算机,Personal Computer)等固定终端。应当理解的是,只需能够进行图像处理的电子设备均可作为本公开中的电子设备,具体将本公开的技术方案应用于哪一类型的电子设备可以由本领域技术人员根据实际需求确定,本公开对此不作限制。The technical solutions of the present disclosure can be applied to any type of electronic device, for example, the electronic device can be a mobile terminal such as a smart phone and a tablet computer, or a fixed terminal such as a smart TV and a PC (Personal Computer). It should be understood that any electronic device that can perform image processing can be used as the electronic device in the present disclosure. The specific type of electronic device to which the technical solution of the present disclosure is applied can be determined by those skilled in the art according to actual needs. There is no restriction on this disclosure.

可以理解的是,图像中之所以在颜色边缘处出现色彩溢出或模糊的现象,是由于颜色边缘处与颜色平坦处的色度值差异不够大导致的。举例而言,假设颜色平坦区域A与颜色平坦区域B的接壤处为颜色边缘处C,若颜色边缘处的像素X的色度值为5,而颜色平坦区域A中与颜色边缘处C较为接近的像素Y的色度值为4,显然两像素的色度值差异不大,使得颜色边缘处C并不是很明显,即从视觉效果上看,容易出现色彩模糊,或者说颜色边缘处C的颜色向颜色平坦区域A漫延的情况。可见,导致图像中的颜色边缘处出现色彩溢出现象的原因为:颜色边缘处与颜色平坦区域之间像素色度值差异较小。It is understandable that the phenomenon of color overflow or blur at the color edge in the image is caused by the insufficient difference of the chromaticity values between the color edge and the color flat place. For example, assuming that the border between the color flat area A and the color flat area B is the color edge C, if the chromaticity value of the pixel X at the color edge is 5, and the color flat area A is closer to the color edge C The chromaticity value of the pixel Y is 4. Obviously, the chromaticity value of the two pixels is not very different, so that C at the color edge is not very obvious, that is, from the visual effect, it is easy to appear color blurred, or the color edge of C is easy to appear. The case where the color spreads to the color flat area A. It can be seen that the reason for the color overflow phenomenon at the color edge in the image is that the difference in pixel chromaticity value between the color edge and the color flat area is small.

有鉴于此,本公开考虑到“图像中颜色变化较大的区域,亮度变化通常也较大”的规律,通过图像中各个像素的亮度值确定图像中的颜色边缘处和颜色平坦区域,进而为不同区域的像素分配用于调整色度值的色度权重。其中,颜色边缘处的像素分配更高的色度权重,而颜色平坦区域的像素分配的色度权重相对较低,以使得调整后的图像的颜色边缘处的像素的色度值,与颜色平坦区域的像素的色度差值增大,进而避免颜色边缘处色彩溢出的问题。In view of this, the present disclosure takes into account the rule of “areas with large color changes in the image, the brightness changes are usually large”, and determines the color edge and the color flat area in the image by the brightness value of each pixel in the image, and then is Pixels in different regions are assigned chroma weights used to adjust chroma values. Among them, the pixels at the color edge are assigned higher chroma weights, and the pixels in the color flat area are assigned relatively lower chroma weights, so that the chroma value of the pixels at the color edge of the adjusted image is the same as the color flat area. The chrominance difference of the pixels in the area is increased, thereby avoiding the problem of color overflow at the color edge.

由于本公开需要基于像素的亮度值对像素的色度值进行调整,显然需要待处理图像为亮度-色度空间域的图像。因此,在获取到的初始待处理图像为其他空间域的图像时,需要优先将该其他空间域的图像转换为亮度-色度空间域的图像。例如,在该初始待处理图像为RGB空间域的图像时,应当优先将该RGB空间域的图像转换为亮度-色度空间域的图像。Since the present disclosure needs to adjust the chrominance value of the pixel based on the luminance value of the pixel, it is obviously required that the image to be processed is an image in the luminance-chrominance space domain. Therefore, when the acquired initial to-be-processed image is an image in another spatial domain, it is necessary to preferentially convert the image in the other spatial domain into an image in the luminance-chrominance spatial domain. For example, when the initial to-be-processed image is an image in the RGB space domain, the image in the RGB space domain should be preferentially converted into an image in the luminance-chrominance space domain.

本公开中获取到的待处理图像可以为任一类型的亮度-色度空间域的图像。例如,该待处理图像可以为YUV空间域的图像;或者,可以为HIS空间域的图像。待处理图像具体为何种类型的亮度-色度空间域的图像,可以由本领域技术人员根据实际情况确定,本公开对此不作限制。The to-be-processed image acquired in the present disclosure can be any type of image in the luminance-chrominance space domain. For example, the image to be processed may be an image in the YUV space domain; or, may be an image in the HIS space domain. The specific type of image in the luminance-chrominance space domain of the image to be processed can be determined by those skilled in the art according to the actual situation, which is not limited in the present disclosure.

由于本公开所要去除的为待处理图像中的彩色噪声,而彩色噪声通常以低频的形式出现。因此,在获取到亮度-色度空间域的待处理图像后,可以优先对待处理图像进行下采样操作,以得到待处理图像的低频图像,进而在低频图像上进行上述色度值调整的操作。Since what the present disclosure needs to remove is the color noise in the image to be processed, the color noise usually appears in the form of low frequency. Therefore, after obtaining the to-be-processed image in the luminance-chrominance space domain, the to-be-processed image may be preferentially down-sampled to obtain a low-frequency image of the to-be-processed image, and then the above-mentioned chrominance value adjustment operation is performed on the low-frequency image.

在对本公开的技术方案进行详细介绍之前,需要声明的是,由于本方案涉及的概念较多,为了方便区分,待处理图像中的像素称为“第一像素”,待处理图像中所有像素的邻域像素称为“第一邻域像素”,将从待处理图像中获得的窗口区域称为“第一窗口区域”,将低频图像中的像素称为“第二像素”,待低频图像中所有像素的邻域像素称为“第二邻域像素”,将从低频图像中获得的窗口区域称为“第二窗口区域”。Before introducing the technical solution of the present disclosure in detail, it should be stated that, since this solution involves many concepts, for the convenience of distinction, the pixel in the image to be processed is called "the first pixel", and the pixels in the image to be processed are called "first pixels". Neighborhood pixels are called "first neighborhood pixels", the window area obtained from the image to be processed is called "first window area", and the pixels in the low-frequency image are called "second pixels". The neighborhood pixels of all pixels are called "second neighborhood pixels", and the window area obtained from the low-frequency image is called "second window area".

实际上,在相关技术中,除了图像的颜色边缘处存在色彩溢出或模糊现象以外,在颜色平坦区域也存在彩色噪点。因此,在本公开中还可以包括对待处理图像和/或低频图像进行降噪处理的步骤。其中,在对待处理图像进行降噪处理时,可以通过滑动窗口的方式遍历整个待处理图像,并对通过滑动窗口获取到的任一第一窗口区域中的所有第一像素的色度值进行加权计算,并将计算得到的该任一第一窗口区域对应的第一目标值作为该任一第一窗口区域的中心像素的色度值。Actually, in the related art, in addition to the color overflow or blur phenomenon at the color edge of the image, color noise also exists in the color flat area. Therefore, the present disclosure may also include a step of performing noise reduction processing on the image to be processed and/or the low-frequency image. Wherein, when noise reduction processing is performed on the image to be processed, the entire image to be processed can be traversed by means of a sliding window, and the chromaticity values of all the first pixels in any first window area obtained through the sliding window are weighted Calculate, and use the calculated first target value corresponding to any first window area as the chromaticity value of the center pixel of any first window area.

而在对低频图像进行降噪处理时,也是类似。可以通过滑动窗口的方式遍历整个低频图像,并对通过滑动窗口获取到的任一第二窗口区域中的所有第二像素的色度值进行加权计算,并将计算得到的该任一第二窗口区域对应的第二目标值作为该任一第二窗口区域的中心像素的色度值。The same is true when noise reduction is performed on low-frequency images. The entire low-frequency image can be traversed by means of a sliding window, and the chromaticity values of all the second pixels in any second window area obtained through the sliding window are weighted and calculated, and the calculated value of any second window is calculated. The second target value corresponding to the region is used as the chromaticity value of the center pixel of any second window region.

在实际操作中,大多会对待处理图像和低频图像均进行降噪处理,但也可以仅对两者之一进行降噪处理,本领域技术人员可以根据实际需求确定是否对待处理图像和/或低频图像进行降噪处理,本公开对此不作限制。In practical operation, most of the image to be processed and the low-frequency image are subjected to noise reduction processing, but it is also possible to perform noise reduction processing on only one of the two. Those skilled in the art can determine whether the image to be processed and/or the low-frequency image is to be processed according to actual needs. The image is subjected to noise reduction processing, which is not limited in the present disclosure.

需要声明的是,滑动窗口是图像领域较为常规的取值方式,通常以特定的步长滑动尺寸固定的窗口,以将图像中落入该窗口内的像素的数值作为用于运算的值(包括色度值、亮度值等各个通道的值)。在本公开中,可以以步长为1个像素遍历整个图像,进而达到使图像中的每个像素均被作为中心像素进行色度值调整。What needs to be declared is that the sliding window is a more conventional way of taking values in the image field, usually sliding a window with a fixed size at a specific step, so as to use the value of the pixels in the image that falls within the window as the value for operation (including chrominance value, luminance value and other channel values). In the present disclosure, the entire image can be traversed with a step size of 1 pixel, so that each pixel in the image can be used as a central pixel to perform chromaticity value adjustment.

在实际计算中,可以通过多种方式计算上述任一第一窗口区域的中心像素的色度值。In actual calculation, the chromaticity value of the central pixel of any one of the above-mentioned first window regions can be calculated in various ways.

在一实施例中,在通过滑动窗口的方式从待处理图像中获得任一第一窗口区域后,可以计算该任一第一窗口区域内所有第一像素与该任一第一窗口区域中的中心像素的差值,以根据该差值为该任一第一窗口区域内的所有第一像素分配降噪权重,且该任一第一窗口区域内的任一第一像素的降噪权重,与该任一第一像素所对应的差值呈负相关。在此基础上,即可基于该任一第一窗口区域内各个第一像素的降噪权重,对该任一第一窗口区域内的所有第一像素的色度值进行加权平均,以将计算得到的值作为该任一第一窗口区域的中心像素的色度值。In one embodiment, after any first window area is obtained from the image to be processed by sliding the window, the difference between all the first pixels in the any first window area and any one of the first window areas can be calculated. The difference value of the center pixel, so that the noise reduction weight is assigned to all the first pixels in the first window area according to the difference value, and the noise reduction weight of any first pixel in the first window area, The difference value corresponding to any one of the first pixels is negatively correlated. On this basis, the chromaticity values of all the first pixels in any first window region can be weighted and averaged based on the noise reduction weight of each first pixel in the first window region, so as to calculate the The obtained value is used as the chromaticity value of the center pixel of any one of the first window regions.

而在通过滑动窗口的方式从低频图像中获得任一第二窗口区域后,可以通过类似的方式调整该任一第二窗口区域的中心像素的色度值。示例地,可以计算该任一第二窗口区域内所有第二像素与该任一第二窗口区域中的中心像素的差值,以根据该差值为该任一第二窗口区域内的所有第二像素分配降噪权重,且该任一第二窗口区域内的任一第二像素的降噪权重,与该任一第二像素所对应的差值呈负相关。在此基础上,即可基于该任一第二窗口区域内各个第二像素的降噪权重,对该任一第二窗口区域内的所有第二像素的色度值进行加权平均,以将计算得到的值作为该任一第二窗口区域的中心像素的色度值。After obtaining any second window area from the low-frequency image by sliding the window, the chromaticity value of the center pixel of the any second window area may be adjusted in a similar manner. Exemplarily, the difference between all the second pixels in the any second window area and the center pixel in the any second window area can be calculated, so that all the first pixels in the any second window area are calculated according to the difference. Two pixels are assigned a noise reduction weight, and the noise reduction weight of any second pixel in the any second window area is negatively correlated with the difference corresponding to the any second pixel. On this basis, the chrominance values of all the second pixels in any second window region can be weighted and averaged based on the noise reduction weight of each second pixel in the second window region, so as to calculate the The obtained value is used as the chromaticity value of the center pixel of any second window area.

举例而言,假设待处理图像中各个第一像素的色度值如图2所示,即可通过滑动窗口的方式遍历整个图像,以得到若干第一窗口区域,并通过任一第一窗口区域中各个第一像素的色度值对该任一第一窗口区域中的中心像素的色度值进行调整。For example, assuming that the chromaticity value of each first pixel in the image to be processed is shown in Figure 2, the entire image can be traversed by sliding a window to obtain several first window areas, and the The chromaticity value of each first pixel in the chromaticity value of the central pixel in any first window area is adjusted.

以图2中所示的第一窗口区域A为例,介绍该实施例中如何对任一第一窗口区域的中心像素的色度值进行调整:Taking the first window area A shown in FIG. 2 as an example, how to adjust the chromaticity value of the center pixel of any first window area in this embodiment is described:

由图2可知,第一窗口区域A中包含9个第一像素,中心像素X的色度值为102。那么,就以色度值102为依据确定第一窗口区域A中的9个第一像素的降噪权重。其中,第一窗口区域A中的任一第一像素的降噪权重,与该任一第一像素与102的差值呈负相关。例如,第一窗口区域A中左上角的第一像素M的色度值为95,与102的差值为7;左下角的第一像素N的色度值为85,与102的差值为17。由于7小于17,因此,第一像素M的降噪权重大于第一像素N的降噪权重,例如第一像素M的降噪权重可以为1.10,那么第一像素N的降噪权重可以为0.60。假设,通过该方式确定第一窗口区域A中所有第一像素的降噪权重如下表1所示:It can be seen from FIG. 2 that the first window area A includes 9 first pixels, and the chromaticity value of the central pixel X is 102. Then, the noise reduction weights of the nine first pixels in the first window area A are determined based on the chrominance value of 102. Wherein, the noise reduction weight of any first pixel in the first window area A is negatively correlated with the difference between the any first pixel and 102 . For example, the chromaticity value of the first pixel M in the upper left corner of the first window area A is 95, and the difference from 102 is 7; the chromaticity value of the first pixel N in the lower left corner is 85, and the difference from 102 is 85. 17. Since 7 is less than 17, the noise reduction weight of the first pixel M is greater than the noise reduction weight of the first pixel N. For example, the noise reduction weight of the first pixel M may be 1.10, then the noise reduction weight of the first pixel N may be 0.60 . It is assumed that the noise reduction weights of all the first pixels in the first window area A are determined in this way as shown in Table 1 below:

Figure BDA0002884169600000091
Figure BDA0002884169600000091

表1Table 1

那么,在表1的基础上,即可根据第一窗口区域A中所有第一像素的降噪权重计算中心像素在降噪处理后的色度值。示例地,可以通过加权平均算法进行计算,其计算过程可以为:Then, on the basis of Table 1, the chrominance value of the center pixel after noise reduction processing can be calculated according to the noise reduction weights of all the first pixels in the first window area A. For example, the calculation can be performed by a weighted average algorithm, and the calculation process can be as follows:

(95*1.1+94*1.0+85*0.60+83*0.55+91*0.80+93*0.95+99*1.4+108*1.2+102*1.45)/(1.1+1.0+0.60+0.55+0.80+0.95+1.4+1.2+1.45)=96.40。(95*1.1+94*1.0+85*0.60+83*0.55+91*0.80+93*0.95+99*1.4+108*1.2+102*1.45)/(1.1+1.0+0.60+0.55+0.80+0.95 +1.4+1.2+1.45)=96.40.

此时,便可将96.40作为第一窗口区域A的中心像素的色度值,即将第一窗口区域A的中心像素原先的色度值102调整为96.40。应当理解的是,由于滑动窗口会遍历整个图像,因此,图像中的所有第一像素均会被作为中心像素,进而经历上述调整色度值的过程。当所有第一像素的色度值均被调整之后,即可视为完成了对待处理图形的降噪处理。At this time, 96.40 can be used as the chromaticity value of the central pixel of the first window area A, that is, the original chromaticity value 102 of the central pixel of the first window area A is adjusted to 96.40. It should be understood that, since the sliding window will traverse the entire image, all the first pixels in the image will be used as center pixels, and then go through the above process of adjusting the chrominance value. When the chrominance values of all the first pixels are adjusted, it can be considered that the noise reduction processing of the graphics to be processed is completed.

对低频图像中的任一第二像素进行色度调整的过程可参照上述举例,其中对于“低频图像”“第二像素”和“第二窗口区域”的处理方式可以适应参考“待处理图像”“第一像素”和“第一窗口区域”的处理方式,在此不再重复举例。For the process of performing chromaticity adjustment on any second pixel in the low-frequency image, refer to the above example, and the processing methods for the “low-frequency image”, “second pixel” and “second window area” can be adapted to refer to the “image to be processed” The processing methods of the "first pixel" and the "first window area" will not be repeated here.

由上述调整过程可知,滑动窗口中与中心像素的色度值差值越大的像素的降噪权重越小,进而使得调整后的中心像素的色度值,与邻域像素的色度值差值缩小。从视觉效果上看,会使图像中的彩色噪点被筛除,实现了针对彩色噪声的降噪效果。It can be seen from the above adjustment process that the larger the chroma value difference between the sliding window and the center pixel, the smaller the noise reduction weight, so that the adjusted chroma value of the center pixel is different from the chroma value of the neighboring pixels. value shrinks. From the perspective of visual effect, the color noise in the image will be filtered out, and the noise reduction effect for the color noise will be realized.

然而,由上表1可知,由于上述实施例以中心像素的色度值为依据确定第一窗口区域A中各个第一像素的降噪权重,使得中心像素自身的降噪权重始终最大,进而导致在针对颜色平坦区域中孤立的彩色噪声进行降噪时,难以实现有效的降噪。以图2中的第一窗口区域B为例:不难看出,在第一窗口区域B中,中心像素的色度值为125,色度值远大于第一窗口区域B中其他第一像素的色度值、且该中心像素周围的若干第一邻域像素之间的色度值均较为接近。显然,从视觉效果上看,该中心像素属于颜色平坦区域中孤立的彩色噪声。由于在上述实施例中,中心像素的降噪权重始终最大,导致在对该色度值为125的第一像素进行降噪处理后,该中心像素的色度值仍旧远大于该中心像素的第一邻域像素的色度值,即无法对颜色平坦区域中的孤立噪声进行有效去除。However, as can be seen from Table 1 above, since the above embodiment determines the noise reduction weight of each first pixel in the first window area A based on the chromaticity value of the central pixel, the noise reduction weight of the central pixel itself is always the largest, which leads to Effective noise reduction is difficult to achieve when denoising isolated colored noise in color flat areas. Take the first window area B in FIG. 2 as an example: it is not difficult to see that in the first window area B, the chromaticity value of the central pixel is 125, and the chromaticity value is much larger than that of other first pixels in the first window area B. The chromaticity value, and the chromaticity values between several first neighborhood pixels around the central pixel are relatively close. Obviously, visually, the center pixel belongs to the isolated color noise in the color flat area. In the above embodiment, the noise reduction weight of the central pixel is always the largest, so that after the noise reduction processing is performed on the first pixel with a chromaticity value of 125, the chromaticity value of the central pixel is still much larger than that of the first pixel of the central pixel. The chrominance value of a neighborhood pixel, that is, the isolated noise in the color flat area cannot be effectively removed.

有鉴于此,本公开提出了另一种降噪处理方法。In view of this, the present disclosure proposes another noise reduction processing method.

在另一实施例中,不再以中心像素为依据,确定任一窗口区域中的所有像素的降噪权重,而是以任一窗口区域中所有像素的色度值的均值为依据,为该任一窗口区域中的像素分配降噪权重。In another embodiment, the noise reduction weight of all pixels in any window area is no longer determined based on the central pixel, but is based on the mean value of the chromaticity values of all pixels in any window area, as the Pixels in either window region are assigned denoising weights.

示例地,在对待处理图像进行降噪处理的过程中,可以对任一第一窗口区域执行下述操作:首先,计算该任一第一窗口区域内所有第一像素的色度均值,并根据该任一第一窗口区域内各个第一像素的色度值与该色度均值之间的第一差值,确定该任一第一窗口区域内各个第一像素的第一降噪权重,其中,该任一第一窗口区域内任一第一像素的第一降噪权重,与该任一第一像素所对应的第一差值呈负相关;然后,即可基于该任一第一窗口区域内各个第一像素的第一降噪权重,对该任一第一窗口区域内所有第一像素的色度值进行加权平均计算,得到该任一第一窗口区域对应的第一目标值,并将该第一目标值作为该任一第一窗口区域的中心像素的色度值。For example, in the process of performing noise reduction processing on the image to be processed, the following operations may be performed on any first window area: The first difference between the chromaticity value of each first pixel in the any first window area and the chromaticity mean value determines the first noise reduction weight of each first pixel in the any first window area, wherein , the first noise reduction weight of any first pixel in the any first window area is negatively correlated with the first difference value corresponding to the any first pixel; then, based on the any first window The first noise reduction weight of each first pixel in the area, and the weighted average calculation of the chromaticity values of all the first pixels in the first window area is performed to obtain the first target value corresponding to the any first window area, and use the first target value as the chromaticity value of the center pixel of any one of the first window regions.

而在对低频图像进行降噪处理的过程中,也是类似:可以对任一第二窗口区域执行下述操作:首先,计算该任一第二窗口区域内所有第二像素的色度均值,并根据该任一第二窗口区域内各个第二像素的色度值与该色度均值之间的第二差值,确定该任一第二窗口区域内各个第二像素的第二降噪权重,其中,该任一第二窗口区域内任一第二像素的第二降噪权重,与该任一第二像素所对应的第二差值呈负相关;然后,即可基于该任一第二窗口区域内各个第二像素的第二降噪权重,对该任一第二窗口区域内所有第二像素的色度值进行加权平均计算,得到该任一第二窗口区域对应的第二目标值,并将该第二目标值作为该任一第二窗口区域的中心像素的色度值。In the process of noise reduction processing for low-frequency images, the following operations can be performed on any second window area: first, calculate the chromaticity mean of all the second pixels in the According to the second difference between the chromaticity value of each second pixel in the any second window area and the chromaticity mean value, the second noise reduction weight of each second pixel in the any second window area is determined, Wherein, the second noise reduction weight of any second pixel in the any second window area is negatively correlated with the second difference value corresponding to the any second pixel; The second noise reduction weight of each second pixel in the window area, the weighted average calculation of the chromaticity values of all the second pixels in the second window area is performed, and the second target value corresponding to the second window area is obtained. , and the second target value is taken as the chromaticity value of the center pixel of any second window area.

以图2所示的待处理图像中的第一窗口区域B为例,介绍本实施例中如何对任一第一窗口区域的中心像素的色度值进行调整:Taking the first window area B in the image to be processed shown in FIG. 2 as an example, how to adjust the chromaticity value of the center pixel of any first window area in this embodiment is described:

首先计算第一窗口区域B中所有第一像素的色度均值:(98+86+99+89+85+91+66+84+125)/9=91.44(为方便计算,在后文中以91为例)。然后再计算第一窗口区域B中各个第一像素的色度值与该色度均值的第一差值,以根据各个像第一素所对应的第一差值为相应的第一像素分配降噪权重。例如,分配的降噪权重可以如下表2所示:First calculate the mean chromaticity of all the first pixels in the first window area B: (98+86+99+89+85+91+66+84+125)/9=91.44 (for the convenience of calculation, 91 is used in the following text example). Then, calculate the first difference between the chromaticity value of each first pixel in the first window area B and the average chromaticity value, so as to assign the drop value to the corresponding first pixel according to the first difference value corresponding to the first pixel of each pixel. noise weight. For example, the assigned noise reduction weights can be as shown in Table 2 below:

Figure BDA0002884169600000111
Figure BDA0002884169600000111

Figure BDA0002884169600000121
Figure BDA0002884169600000121

表2Table 2

那么,在表2的基础上,即可根据第一窗口区域B中所有第一像素的降噪权重计算中心像素在降噪处理后的色度值。示例地,可以通过加权平均算法进行计算,其计算过程可以为:Then, on the basis of Table 2, the chrominance value of the center pixel after noise reduction processing can be calculated according to the noise reduction weights of all the first pixels in the first window area B. For example, the calculation can be performed by a weighted average algorithm, and the calculation process can be as follows:

(98*1.1+86*1.3+99*1.0+89*1.35+85*1.20+91*1.45+66*0.40+84*1.10+125*0.30)/(1.1+1.3+1.0+1.35+1.20+1.45+0.40+1.10+0.30)=90.11。(98*1.1+86*1.3+99*1.0+89*1.35+85*1.20+91*1.45+66*0.40+84*1.10+125*0.30)/(1.1+1.3+1.0+1.35+1.20+1.45 +0.40+1.10+0.30)=90.11.

此时,便可将90.11作为中心像素的色度值,即将第一窗口区域B的中心像素原先的色度值125调整为90.11。同上一实施例,由于滑动窗口会遍历整个待处理图像,因此,图像中的所有第一像素均会被作为中心像素,进而经历上述调整色度值的过程。当所有第一像素的色度值均被调整之后,即可视为完成了对待处理图像的降噪处理。At this time, 90.11 can be used as the chromaticity value of the central pixel, that is, the original chromaticity value 125 of the central pixel of the first window area B is adjusted to 90.11. As in the previous embodiment, since the sliding window will traverse the entire image to be processed, all the first pixels in the image will be used as center pixels, and then go through the above process of adjusting the chrominance value. When the chrominance values of all the first pixels are adjusted, it can be considered that the noise reduction processing of the image to be processed is completed.

本实施例对低频图像中的任一第二像素进行色度调整的过程也可参照上述举例,其中对于“低频图像”“第二像素”和“第二窗口区域”的处理方式可以适应参考“待处理图像”“第一像素”和“第一窗口区域”的处理方式,在此不再重复举例。For the process of performing chromaticity adjustment on any second pixel in the low-frequency image in this embodiment, reference may also be made to the above example, and the processing methods for the "low-frequency image", "second pixel" and "second window area" can be adapted to the reference " The processing methods of "image to be processed", "first pixel" and "first window area" will not be repeated here.

由上表2可知,在本实施例中,不再以中心像素的色度值125为依据,为第一窗口区域B中的各个第一像素分配权重,使得权重最大的第一像素通常不为中心像素,例如,在上表2中,由于求得的色度均值为91,显然在窗口区域B中,是像素值为91的第一像素的降噪权重最大,进而避免了上一实施例中,由于中心像素的权重值始终最大,导致颜色平坦区域中孤立的彩色噪声无法被去除的技术问题。It can be seen from the above Table 2 that in this embodiment, the chromaticity value of the central pixel of 125 is no longer used as the basis for assigning weights to each first pixel in the first window area B, so that the first pixel with the largest weight is usually not For example, in the above table 2, since the obtained chromaticity mean value is 91, it is obvious that in the window area B, the first pixel with a pixel value of 91 has the largest noise reduction weight, thereby avoiding the previous embodiment. , because the weight value of the central pixel is always the largest, resulting in a technical problem that the isolated color noise in the color flat area cannot be removed.

不难理解的是,在上一实施例中,由于以中心像素为依据为各个像素分配降噪权重,导致中心像素的降噪权重始终最大。显然,若该中心像素为颜色平坦区域中孤立的彩色噪声(即色度值与周围像素的色度值相差较大),在此基础上对中心像素的色度值进行调整后,中心像素的色度值仍然与周围像素的色度值相差较大,致使彩色噪声无法被去除。It is not difficult to understand that, in the previous embodiment, since the noise reduction weight is assigned to each pixel based on the center pixel, the noise reduction weight of the center pixel is always the largest. Obviously, if the central pixel is an isolated color noise in a flat color area (that is, the chromaticity value is quite different from the chromaticity value of the surrounding pixels), after adjusting the chromaticity value of the central pixel on this basis, the The chrominance value is still quite different from the chrominance value of the surrounding pixels, so that the color noise cannot be removed.

而在本实施例中,由于以窗口区域内所有像素的色度均值为依据分配权重,使得中心像素的降噪权重通常不为最大。相反的,若该中心像素为颜色平坦区域内孤立的彩色噪声,由于该中心像素的多个邻域像素之间的色度值相差不大,会导致求得的色度均值与该中心像素的色度差值较大、而与该中心像素的邻域像素的色度差值较小,致使该中心像素的降噪权重反而较小,例如,在上述举例的第一窗口区域B中,中心像素降噪权重最小。显然,通过本实施例对图像进行降噪处理后,可以有效消除颜色平坦区域中孤立的彩色噪声。如在对窗口区域B的中心像素的色度值进行调整后,调整后的色度值90.11显然与窗口区域B中的大多第一像素的色度值较为接近,从视觉效果上看,即为颜色平坦区域中不存在孤立的彩色噪声。However, in this embodiment, since the weight is assigned based on the chromaticity mean value of all pixels in the window area, the noise reduction weight of the central pixel is usually not the maximum. On the contrary, if the central pixel is an isolated color noise in a flat color area, since the chromaticity values of multiple neighboring pixels of the central pixel are not much different, the obtained chromaticity mean value will be the same as the central pixel's chromaticity value. The chrominance difference value is large, but the chrominance difference value from the neighboring pixels of the central pixel is small, so that the noise reduction weight of the central pixel is relatively small. For example, in the first window area B of the above example, the central Pixel denoising weights the least. Obviously, after noise reduction processing is performed on the image in this embodiment, the isolated color noise in the color flat area can be effectively eliminated. For example, after adjusting the chromaticity value of the central pixel of the window area B, the adjusted chromaticity value of 90.11 is obviously close to the chromaticity value of most of the first pixels in the window area B. From the visual effect, it is There is no isolated color noise in the color flat areas.

需要声明的是,上述表1和表2中各个第一像素的降噪权重的数值仅是示意性的,仅用于表示:任一第一像素的降噪权重,与该任一第一像素与中心像素(或上述色度均值)的差值呈负相关。具体如何确定各个第一像素的降噪权重,可以由本领域技术人员根据实际情况确定,本公开对此不作限制。例如,可以设置上述差值与降噪权重的对应关系,以作为确定任一第一像素降噪权重的依据;例如,可以按照各个第一像素所对应的差值大小对各个第一像素进行排序,以根据排列的顺序进行降噪权重的分配。在对低频图像进行降噪处理时也是类似,在此不再赘述。It should be stated that the numerical values of the noise reduction weights of the first pixels in the above Tables 1 and 2 are only schematic, and are only used to represent: the noise reduction weight of any first pixel is the same as that of any first pixel. The difference with the center pixel (or the chrominance mean above) is negatively correlated. How to specifically determine the noise reduction weight of each first pixel can be determined by those skilled in the art according to the actual situation, which is not limited in the present disclosure. For example, the corresponding relationship between the difference value and the noise reduction weight can be set as the basis for determining the noise reduction weight of any first pixel; for example, each first pixel can be sorted according to the difference value corresponding to each first pixel , to assign noise reduction weights according to the order of arrangement. The same is true when noise reduction processing is performed on low-frequency images, and details are not repeated here.

步骤104,根据所述待处理图像中的各个第一像素与各自的第一邻域像素的亮度差异程度,分别确定所述各个第一像素的色度权重,其中,所述各个第一像素中,每个第一像素的色度权重与相应的亮度差异程度呈正相关。Step 104: Determine the chrominance weight of each first pixel according to the brightness difference between each first pixel in the to-be-processed image and the respective first neighborhood pixels, wherein the chrominance weight of each first pixel is , the chrominance weight of each first pixel is positively correlated with the corresponding luminance difference degree.

由上述内容可知,图像中的颜色边缘处之所以出现色彩溢出或模糊的现象,是由于颜色边缘处像素的色度值与颜色平坦区域像素的色度值差异过小导致的。因此,在本公开中,会基于图像中各个像素的亮度值确定出图像中的颜色边缘处和颜色平坦区域,并为颜色边缘处的像素分配更高的色度权重、为颜色平坦区域的像素分配相对更低的色度权重,以使颜色边缘处像素的色度值、与颜色平坦区域像素的色度值差异增大,进而解决颜色边缘处色彩溢出或模糊的问题。It can be seen from the above content that the phenomenon of color overflow or blur at the color edge in the image is caused by the too small difference between the chromaticity value of the pixel at the color edge and the chromaticity value of the pixel in the color flat area. Therefore, in the present disclosure, color edges and color flat areas in the image are determined based on the luminance values of each pixel in the image, and a higher chrominance weight is assigned to the pixels at the color edge, and pixels in the color flat area are assigned higher chrominance weights. Assign relatively lower chroma weights to increase the difference between the chroma values of the pixels at the edges of the color and the chroma values of the pixels in the flat areas of the color, thereby solving the problem of color bleeding or blurring at the edges of the color.

需要声明的是,本公开在对待处理图像进行下采样操作得到低频图像后,是根据待处理图像中各个第一像素的亮度值为待处理图像中的各个第一像素分配色度权重。再借助待处理图像中各个第一像素与低频图像中各个第二像素的对应关系,在对低频图像进行上采样操作的过程中,对低频图像中的各个第二像素的色度值进行调整。换言之,是基于待处理图像中的亮度分布情况,对低频图像中各个第二像素的色度值进行调整。It should be stated that, after the low-frequency image is obtained by downsampling the image to be processed, the present disclosure assigns chrominance weights to each first pixel in the image to be processed according to the luminance value of each first pixel in the image to be processed. Then, the chromaticity value of each second pixel in the low-frequency image is adjusted in the process of upsampling the low-frequency image with the help of the correspondence between each first pixel in the to-be-processed image and each second pixel in the low-frequency image. In other words, the chromaticity value of each second pixel in the low-frequency image is adjusted based on the luminance distribution in the image to be processed.

之所以如此,是由于低频图像基于待处理图像得到,两者的亮度分布情况几乎一致,且待处理图像可以视为:相对于低频图像的高频图像,尺寸更大,包含更多的亮度细节,通过待处理图像确定各个第一像素的色度权重,更为精确。The reason for this is that the low-frequency image is obtained based on the image to be processed, and the brightness distribution of the two is almost the same, and the image to be processed can be regarded as: compared with the high-frequency image of the low-frequency image, the size is larger and contains more brightness details. , the chrominance weight of each first pixel is determined by the image to be processed, which is more accurate.

步骤106,基于所述各个像素对应的色度权重对所述低频图像进行上采样操作,并将经由所述上采样操作得到的图像与所述待处理图像合成,得到处理后图像。Step 106: Perform an up-sampling operation on the low-frequency image based on the chrominance weight corresponding to each pixel, and synthesize the image obtained through the up-sampling operation with the to-be-processed image to obtain a processed image.

在实际操作中,可以通过滑动窗口的方式确定获取各个第一像素的第一邻域像素,以根据各个第一像素与各自第一邻域像素的亮度差异程度,确定各个第一像素的色度权重。以图2所示的第一窗口区域A为例,除了中心像素以外的其他第一像素均可视为中心像素的第一邻域像素(当然,在计算过程中,中心像素也可以视为是自身的第一邻域像素)。当然,第一窗口区域A仅以滑动窗口包含9个第一像素为例,若滑动窗口包含25个第一像素,那么第一邻域像素的个数也相对增加。具体确定第一邻域像素的方式可由本领域技术人员根据实际需求确定,本公开对此不作限制。In actual operation, the first neighborhood pixels of each first pixel can be determined by sliding the window, so as to determine the chromaticity of each first pixel according to the brightness difference between each first pixel and the respective first neighborhood pixels Weights. Taking the first window area A shown in FIG. 2 as an example, other first pixels except the center pixel can be regarded as the first neighborhood pixels of the center pixel (of course, in the calculation process, the center pixel can also be regarded as a its own first neighborhood pixels). Of course, the first window area A only takes the sliding window including 9 first pixels as an example. If the sliding window includes 25 first pixels, the number of first neighborhood pixels also increases relatively. The specific manner of determining the pixels in the first neighborhood can be determined by those skilled in the art according to actual needs, which is not limited in the present disclosure.

在一实施例中,在为任一第一像素分配色度权重时,可以结合该任一第一像素的所有第一邻域像素进行分配。示例地,可以优先计算该任一第一像素与任一第一邻域像素的亮度差值,并基于该亮度差值计算对应于该任一第一邻域像素的权重参数。在通过该方法计算得到该任一第一像素的所有第一邻域像素对应的权重参数后,即可基于计算得到的所有权重参数,为该任一第一像素分配色度权重。In one embodiment, when assigning a chrominance weight to any one of the first pixels, the assignment may be performed in combination with all the first neighborhood pixels of the any one of the first pixels. For example, the luminance difference value between any first pixel and any first neighborhood pixel may be preferentially calculated, and a weight parameter corresponding to any first neighborhood pixel may be calculated based on the luminance difference value. After the weight parameters corresponding to all the first neighborhood pixels of the any first pixel are calculated by this method, the chrominance weight can be assigned to the any first pixel based on all the calculated weight parameters.

仍以图2所示的第一窗口区域A为例,假设图2中展示的各个第一像素的数值为相应第一像素的亮度值,那么,可以针对第一窗口区域A中的任一第一像素进行以下计算:以亮度值为99的右上角的第一像素L为例(为第一窗口区域A内中心像素X的一个第一邻域像素,可视为上述任一第一邻域像素),计算第一像素L与中心像素X的亮度差值为3,并基于该亮度差值3为第一像素L分配权重参数。并在对第一窗口区域A内中心像素X的所有第一邻域像素完成上述操作,得到对应于中心像素X的每一第一邻域像素的权重参数后,即可基于得到的所有权重参数,确定第一窗口区域A内中心像素X的色度权重。Still taking the first window area A shown in FIG. 2 as an example, assuming that the value of each first pixel shown in FIG. 2 is the luminance value of the corresponding first pixel, then, for any The following calculation is performed for one pixel: take the first pixel L in the upper right corner with a luminance value of 99 as an example (it is a first neighborhood pixel of the center pixel X in the first window area A, which can be regarded as any of the above-mentioned first neighborhoods pixel), calculate the luminance difference value between the first pixel L and the central pixel X to be 3, and assign a weight parameter to the first pixel L based on the luminance difference value of 3. And after completing the above operations on all the first neighborhood pixels of the center pixel X in the first window area A, after obtaining the weight parameters of each first neighborhood pixel corresponding to the center pixel X, all the obtained weight parameters can be obtained. , determine the chrominance weight of the central pixel X in the first window area A.

需要声明的是,在本实施例中,尽管是基于任一第一像素与其第一邻域像素的亮度差值,为各个第一邻域像素分配权重参数。但在实际操作中,任一像素可视为自身的邻域像素,即对任一第一像素自身也会分配一权重参数。换言之,在对上述中心像素X的第一邻域像素进行权重参数分配时,最终会分配9个权重参数。It should be noted that, in this embodiment, although the luminance difference between any first pixel and its first neighboring pixels is used, each first neighboring pixel is assigned a weight parameter. However, in actual operation, any pixel can be regarded as its own neighborhood pixel, that is, a weight parameter is also assigned to any first pixel itself. In other words, when the weight parameters are allocated to the first neighboring pixels of the central pixel X, 9 weight parameters are finally allocated.

在通过上述方式,获得待处理图像中的所有第一像素的色度权重后,即可在对低频图像进行上采样操作的过程中,对低频图像中各个第二像素的色度值进行调整。After obtaining the chrominance weights of all the first pixels in the to-be-processed image in the above manner, the chrominance value of each second pixel in the low-frequency image can be adjusted during the upsampling operation on the low-frequency image.

示例地,在计算通过上采样操作得到的图像中的任一像素的色度值时,可以将待处理图像中与该任一像素对应的第一像素的亮度值,以及低频图像中与该任一像素对应的第二像素的色度值作为依据进行计算。由于上采样操作得到的图像与待处理图像的尺寸一致,也可以表述为:根据待处理图像中任一第一像素的亮度值,与低频图像中与该任一像素对应的第二像素的色度值,计算通过上采样操作得到的图像中与该任一第一像素对应的目标像素的色度值。For example, when calculating the chromaticity value of any pixel in the image obtained by the upsampling operation, the luminance value of the first pixel corresponding to the any pixel in the image to be processed, and the low-frequency image corresponding to the any pixel can be calculated. The chromaticity value of the second pixel corresponding to one pixel is used as a basis for calculation. Since the size of the image obtained by the upsampling operation is the same as the size of the image to be processed, it can also be expressed as: according to the brightness value of any first pixel in the image to be processed, the color of the second pixel corresponding to any pixel in the low-frequency image The chromaticity value of the target pixel corresponding to any one of the first pixels in the image obtained through the upsampling operation is calculated.

在实际操作中,在通过上述方式获得待处理图像中任一第一像素的任一第一邻域像素的权重参数后,可以在低频图像中确定出与该任一第一像素对应的第二像素,并进一步从该第二像素的第二邻域像素中确定出与上述任一第一邻域像素对应的第二邻域像素。在此基础上,可以计算该第二邻域像素与第二像素之间的距离,并基于该距离与该任一第一邻域像素的权重参数,确定出与该任一第一邻域像素对应的色度参考值;在确定出对应于该任一第一像素的所有第一邻域像素的多个色度参考值后,即可对这多个色度参考值进行加权平均计算,以得到经由上采样操作得到的图像中与该任一第一像素对应的目标像素的色度值。In actual operation, after obtaining the weight parameter of any first neighborhood pixel of any first pixel in the to-be-processed image by the above method, the second pixel corresponding to the any first pixel can be determined in the low-frequency image. pixel, and further determine a second neighborhood pixel corresponding to any one of the first neighborhood pixels from the second neighborhood pixels of the second pixel. On this basis, the distance between the second neighborhood pixel and the second pixel can be calculated, and based on the distance and the weight parameter of any first neighborhood pixel, determine the distance between the second neighborhood pixel and any first neighborhood pixel. Corresponding chromaticity reference value; after determining a plurality of chromaticity reference values corresponding to all the first neighborhood pixels of the first pixel, the weighted average calculation can be performed on the plurality of chromaticity reference values to obtain Obtain the chrominance value of the target pixel corresponding to any one of the first pixels in the image obtained through the upsampling operation.

示例地,计算通过上采样操作得到的图像中的任一像素的色度值可以参考以下公式:For example, to calculate the chrominance value of any pixel in the image obtained by the upsampling operation, the following formula can be referred to:

Figure BDA0002884169600000161
Figure BDA0002884169600000161

其中,

Figure BDA0002884169600000162
为通过上采样操作得到的图像中的任一像素的色度值;p为待处理图像中与上述任一像素对应的第一像素,q为该第一像素的任一第一邻域像素;Ip为第一像素p的亮度值,Iq为第一邻域像素q的亮度值;p为第一像素p在低频图像中对应的第二像素(实际为该第二像素的坐标,为方便后续描述,用第二像素p表示该第二像素),q为第一邻域像素q在低频图像中对应的第二邻域像素(实际为该第二像素的坐标,为方便后续描述,用第二像素q表示该第二像素);‖p-q‖为第二邻域像素q与第二像素p的距离;
Figure BDA0002884169600000163
为第一像素p在低频图像中对应的第二像素的色度值;Ω为以第二像素p为中心像素的第二窗口区域;kp为归一化常量;f()为根据距离计算色度参考值的系数函数;g(‖Ip-Iq‖)为根据亮度差值计算权重参数的权重函数,用于计算上述权重参数,
Figure BDA0002884169600000164
为上述色度参考值。in,
Figure BDA0002884169600000162
is the chromaticity value of any pixel in the image obtained by the upsampling operation; p is the first pixel corresponding to any of the above-mentioned pixels in the image to be processed, and q is any first neighborhood pixel of the first pixel; I p is the brightness value of the first pixel p, I q is the brightness value of the first neighborhood pixel q; p is the second pixel corresponding to the first pixel p in the low-frequency image (actually the coordinates of the second pixel, For the convenience of subsequent description, the second pixel p is used to represent the second pixel), and q is the second neighborhood pixel corresponding to the first neighborhood pixel q in the low-frequency image (actually the coordinates of the second pixel, for convenience In the following description, the second pixel q is used to represent the second pixel); ‖p -q ‖ is the distance between the second neighborhood pixel q and the second pixel p ;
Figure BDA0002884169600000163
is the chromaticity value of the second pixel corresponding to the first pixel p in the low-frequency image; Ω is the second window area with the second pixel p as the center pixel; k p is a normalized constant; The coefficient function for calculating the chrominance reference value; g(‖I p -I q ‖) is the weight function for calculating the weight parameter according to the luminance difference value, which is used to calculate the above weight parameter,
Figure BDA0002884169600000164
is the above-mentioned chromaticity reference value.

为了方便理解,仍以图2所示的待处理图像为例,假设图2中的各个数值为各个第一像素所对应的亮度值。假设经由图2所对应的色度图进行下采样操作得到的低频图像如图3所示。显然,在图2中的第一像素与图3中的第二像素存在一定的对应关系。例如,图2所示的待处理图像的尺寸为8*8,而图3所示的低频图像的尺寸为4*4,意味着低频图像中的任一第二像素对应于待处理图像中的4个第一像素,且对应关系与像素在图像中的位置相关。例如,低频图像中左上角色度值为56的第二像素,应当对应于待处理图像中左上角亮度值分别为:65、56、77、58的4个第一像素。For ease of understanding, the image to be processed shown in FIG. 2 is still taken as an example, and it is assumed that each numerical value in FIG. 2 is a brightness value corresponding to each first pixel. It is assumed that a low-frequency image obtained by down-sampling operation through the chromaticity diagram corresponding to FIG. 2 is shown in FIG. 3 . Obviously, there is a certain correspondence between the first pixel in FIG. 2 and the second pixel in FIG. 3 . For example, the size of the image to be processed shown in FIG. 2 is 8*8, while the size of the low-frequency image shown in FIG. 3 is 4*4, which means that any second pixel in the low-frequency image corresponds to a pixel in the image to be processed. 4 first pixels, and the corresponding relationship is related to the position of the pixel in the image. For example, the second pixel with the upper left corner chromaticity value of 56 in the low-frequency image should correspond to the four first pixels with the upper left corner luminance values of 65, 56, 77, and 58 in the image to be processed.

当前已经知晓的是:对图3所示的低频图像进行上采样操作得到的图像的尺寸必然如图4A所示。所以在上采样过程中,所要做的就是如何知晓图4A所示的图像中各个像素的色度值。以求图4A中的像素X”的色度值为例进行介绍,显然该像素X”与图2中的第一窗口区域A的中心像素(即图2中的第一像素X)对应,而第一像素X属于图2中最右上角的4个像素之一,那么图3中对应于该第一像素X的第二像素即为图3中右上角色度值为91的第二像素X’。与第一窗口区域A相似的,在低频图像中可以通过滑动窗口的方式,确定以第二像素X’为中心像素的第二窗口区域。假设当前需要为第一像素X的第一邻域像素Y分配权重参数,那么可以基于第一像素X与第一邻域像素Y的亮度差值,确定第一邻域像素Y的权重参数。确定像素X的其他邻域像素的权重参数也是类似;在确定第一邻域像素Y的权重参数后,可以从第二像素X’的若干第二邻域像素中确定出与第一邻域像素Y对应的第二邻域像素Y’,进而基于第二邻域像素Y’与第二像素X’的距离以及第一邻域像素Y的权重参数确定出该第一邻域像素Y的色度参考值(当然,也可视为是第二邻域像素Y’的色度参考值)。具体用于计算色度参考值的公式可以由本领域技术人员根据实际需求确定,本公开对此不作限制。What is currently known is that the size of the image obtained by performing the upsampling operation on the low-frequency image shown in FIG. 3 must be as shown in FIG. 4A . So in the upsampling process, all that needs to be done is how to know the chrominance value of each pixel in the image shown in Figure 4A. Taking the chromaticity value of the pixel X" in Fig. 4A as an example for introduction, it is obvious that the pixel X" corresponds to the central pixel of the first window area A in Fig. 2 (ie, the first pixel X in Fig. 2), and The first pixel X belongs to one of the four pixels in the upper right corner in FIG. 2 , then the second pixel corresponding to the first pixel X in FIG. 3 is the second pixel X′ with a chromaticity value of 91 in the upper right corner in FIG. 3 . . Similar to the first window area A, in the low-frequency image, the second window area with the second pixel X' as the center pixel can be determined by sliding the window. Assuming that a weight parameter needs to be assigned to the first neighborhood pixel Y of the first pixel X, the weight parameter of the first neighborhood pixel Y can be determined based on the luminance difference between the first pixel X and the first neighborhood pixel Y. Determining the weight parameters of other neighborhood pixels of the pixel X is also similar; after determining the weight parameters of the first neighborhood pixel Y, it can be determined from several second neighborhood pixels of the second pixel X' that are related to the first neighborhood pixel. The second neighborhood pixel Y' corresponding to Y, and then the chromaticity of the first neighborhood pixel Y is determined based on the distance between the second neighborhood pixel Y' and the second pixel X' and the weight parameter of the first neighborhood pixel Y The reference value (of course, it can also be regarded as the chrominance reference value of the second neighborhood pixel Y'). The formula specifically used to calculate the chromaticity reference value can be determined by those skilled in the art according to actual needs, which is not limited in the present disclosure.

需要声明的是,在图3所示的对应于第二像素X’的第二窗口区域内,包含超出低频图像的区域。在该部分区域中,可以通过补值的方式,将原图中不存在的第二像素(可以称其为空白像素)的色度值补上。在本领域中,该补值技术已较为成熟,可以采用任一种方式对该第二窗口区域内的空白像素进行补值,本公开对此不作限制。例如,针对任一空白像素,可以将最接近的该空白像素的第二像素的色度值作为其色度值。It should be stated that, in the second window area corresponding to the second pixel X' shown in FIG. 3 , the area beyond the low-frequency image is included. In this partial area, the chromaticity value of the second pixel (which may be called a blank pixel) that does not exist in the original image can be supplemented by means of complement value. In the art, the complementary value technology is relatively mature, and any method can be used to add complementary value to the blank pixels in the second window area, which is not limited in the present disclosure. For example, for any blank pixel, the chromaticity value of the second pixel of the closest blank pixel may be used as its chromaticity value.

通过该方式获得第一像素X的所有第一邻域像素的色度参考值之后,即可对多个色度参考值进行加权平均计算,以得到与第一像素X对应的像素X”的色度值。After the chromaticity reference values of all the first neighborhood pixels of the first pixel X are obtained in this way, the weighted average calculation of the plurality of chromaticity reference values can be performed to obtain the color of the pixel X” corresponding to the first pixel X. degree value.

为体现本公开与相关技术的差别,可参考图4B。图4B中的图(a)可视为待处理图像的色度图,图(b)为待处理图像的亮度图,图(c)为对图(a)进行下采样得到的低频图像,图(d)为通过相关技术中的双线性插值方式进行上采样得到的处理后图像,而图(e)则为通过本公开的方式进行上采样得到的处理后图像。由于本公开利用的是待处理图像的亮度图对低频图像进行上采样,因此该上采样操作也可以称为联合引导上采样。To reflect the difference between the present disclosure and the related art, reference may be made to FIG. 4B . Figure (a) in Figure 4B can be regarded as a chromaticity diagram of the image to be processed, Figure (b) is a luminance diagram of the image to be processed, Figure (c) is a low-frequency image obtained by downsampling Figure (a), (d) is a processed image obtained by up-sampling by bilinear interpolation in the related art, and Figure (e) is a processed image obtained by up-sampling by the method of the present disclosure. Since the present disclosure utilizes the luminance map of the image to be processed to upsample the low-frequency image, this upsampling operation may also be referred to as joint guided upsampling.

比较图(d)和图(e):联合引导上采样得到的图(e)中,色度值为136(图(d)中深色的136)的像素,其左侧的邻域像素的色度值为132,两者的色度差值为4;通过双线性插值方式上采样得到的图(d)中,对应于上述“色度值为136的像素”的像素的色度值为135,其左侧的领域像素的色度值为133,两者差值为2。显然,通过联合引导上采样得到的处理后图像,其颜色边缘处的像素之间的色度差值更大,相较于相关技术,能够提高处于颜色边缘处的像素之间的色度值差值,进而避免颜色边缘处出现色彩溢出和模糊的问题。Comparing Figure (d) and Figure (e): In Figure (e) obtained by joint guided upsampling, the pixel with a chroma value of 136 (the dark 136 in Figure (d)) has a pixel in its left neighborhood. The chromaticity value is 132, and the chromaticity difference between the two is 4; in the figure (d) obtained by upsampling through bilinear interpolation, the chromaticity value of the pixel corresponding to the above-mentioned "pixel with a chromaticity value of 136" is 135, the chromaticity value of the domain pixel on the left is 133, and the difference between the two is 2. Obviously, the processed image obtained by joint guided upsampling has a larger chromaticity difference between the pixels at the color edge, which can improve the chromaticity difference between the pixels at the color edge compared with the related art. value to avoid color bleeding and blurring at the edges of the color.

由上述介绍可知,在本实施例中,确定色度权重,以及通过色度权重的调整色度值在进行上采样操作的过程中完成。从电子设备的计算角度来看,是通过一个公式完成上述多个步骤。当然,除了在对低频图像进行上采样操作的过程中完成上述步骤,还可以通过逐步进行的方式完成上述步骤。It can be seen from the above description that, in this embodiment, the determination of the chrominance weight and the adjustment of the chrominance value through the chrominance weight are completed in the process of performing the upsampling operation. From the computing point of view of the electronic device, the above-mentioned multiple steps are completed by one formula. Of course, in addition to completing the above steps in the process of performing the upsampling operation on the low-frequency image, the above steps can also be completed in a step-by-step manner.

在另一实施例中,可以优先计算待处理图像中,任一第一像素与其所有第一邻域像素的亮度均值,以及该任一第一像素的亮度值与该亮度均值的第二差值;再基于该第二差值确定对应于该任一第一像素的色度权重,例如,可以将该第二差值与预定义系数的乘积作为该任一第一像素的色度权重。基于同样的方式可以获得待处理图像中所有第一像素的色度权重。In another embodiment, in the to-be-processed image, the average luminance of any first pixel and all its first neighboring pixels, and the second difference between the luminance value of any first pixel and the average luminance may be calculated preferentially ; and then determine the chrominance weight corresponding to any one of the first pixels based on the second difference value, for example, the product of the second difference value and a predefined coefficient can be used as the chrominance weight of any one of the first pixels. Based on the same method, the chrominance weights of all the first pixels in the image to be processed can be obtained.

相应的,还可以对低频图像进行常规的上采样操作。示例地,可以通过上采样插值算法对低频图像进行计算,以得到与待处理图像尺寸一致的待加权图像。其中,该上采样插值算法可以为任一类型的插值算法,如二维插值算法、线性插值算法均可作为本实施例所采用的插值算法。在得到待加权图像后,即可基于待处理图像中各个第一像素的色度权重,对该待加权图像中相应的像素进行加权计算,并将加权计算得到的图像作为经由上采样操作得到的图像。Correspondingly, a conventional up-sampling operation can also be performed on the low-frequency image. For example, the low-frequency image may be calculated by an up-sampling interpolation algorithm to obtain an image to be weighted that is consistent with the size of the image to be processed. The up-sampling interpolation algorithm may be any type of interpolation algorithm, for example, a two-dimensional interpolation algorithm and a linear interpolation algorithm may be used as the interpolation algorithm used in this embodiment. After the image to be weighted is obtained, the corresponding pixels in the image to be weighted can be weighted based on the chrominance weight of each first pixel in the image to be processed, and the image obtained by the weighted calculation is used as the image obtained through the upsampling operation. image.

仍以图2所示的待处理图像为例,假设当前需要确定第一像素X的色度权重,那么可以计算第一窗口区域A中所有第一像素的亮度均值,可以得到该亮度值为:(95+94+85+83+91+93+99+108+102)/9=94.4,那么计算得到的对应于第一像素X的第二差值即为7.6,此时,即可基于该第二差值7.6确定第一像素X的色度权重。通过同样的方式可以得到待处理图像中其他第一像素的色度权重。Still taking the to-be-processed image shown in FIG. 2 as an example, assuming that the chromaticity weight of the first pixel X needs to be determined at present, the average brightness of all the first pixels in the first window area A can be calculated, and the brightness value can be obtained: (95+94+85+83+91+93+99+108+102)/9=94.4, then the calculated second difference corresponding to the first pixel X is 7.6. The second difference value 7.6 determines the chrominance weight of the first pixel X. In the same way, the chrominance weights of other first pixels in the image to be processed can be obtained.

在另一方面,仍假设图3所示的图像为:对图2所示的待处理图像的色度图进行下采样操作得到的低频图像,其中,图3中所展示的数值表征低频图像中各个第二像素的色度值。在本实施例中,可以对该低频图像进行常规的上采样操作,以得到尺寸与待处理图像一致的待加权图像,例如,该待加权图像可以如图4A所示,需要声明的是,尽管图4A中未示出各个像素的色度值,但本实施例得到的待加权图像的各个像素的色度值是确定的。在此基础上,即可基于待处理图像中各个第一像素的色度权重对待加权图像中相应的像素进行色度值的调整,例如,可以基于第一像素X的色度权重,对像素X”的色度值进行调整。On the other hand, it is still assumed that the image shown in FIG. 3 is a low-frequency image obtained by down-sampling the chromaticity diagram of the image to be processed shown in FIG. 2 , wherein the numerical values shown in FIG. The chrominance value of each second pixel. In this embodiment, a conventional up-sampling operation can be performed on the low-frequency image to obtain an image to be weighted with the same size as the image to be processed. For example, the image to be weighted can be as shown in FIG. 4A . The chromaticity value of each pixel is not shown in FIG. 4A , but the chromaticity value of each pixel of the image to be weighted obtained in this embodiment is determined. On this basis, the chrominance value of the corresponding pixels in the to-be-weighted image can be adjusted based on the chrominance weight of each first pixel in the image to be processed. For example, based on the chrominance weight of the first pixel X, the ” to adjust the chroma value.

由上述技术方案可知,本公开一方面针对获取到的亮度-色度空间域的待处理图像进行下采样操作,以得到相应的低频图像;另一方面,根据待处理图像中的各个第一像素与各自的第一邻域像素的亮度差异程度,为所包含的各个第一像素分配了色度权重,其中,每个第一像素的色度权重与相应的亮度差异程度呈正相关。在此基础上,即可基于待处理图像中各个第一像素对应的色度权重对低频图像进行上采样操作,以得到尺寸与待处理图像一致的图像,并将该图像与待处理图像进行合并,得到处理后图像。It can be seen from the above technical solutions that, on the one hand, the present disclosure performs a downsampling operation on the obtained image to be processed in the luminance-chrominance space domain to obtain a corresponding low-frequency image; on the other hand, according to each first pixel in the image to be processed A chrominance weight is assigned to each of the included first pixels with respect to the luminance difference degree of the respective first neighborhood pixels, wherein the chrominance weight of each first pixel is positively correlated with the corresponding luminance difference degree. On this basis, an up-sampling operation can be performed on the low-frequency image based on the chrominance weight corresponding to each first pixel in the image to be processed to obtain an image with the same size as the image to be processed, and the image and the image to be processed are merged , to get the processed image.

应当理解的是,在图像领域中,图像中颜色的变化会对亮度变化产生影响,且颜色变化较大的区域,亮度变化通常也较大。因此,对于任一像素而言,若与邻域像素的亮度差异程度越大,意味着该任一像素处于颜色变化较大的区域,即颜色边缘处。而本公开中任一像素的色度权重与相应的色度权重呈正相关,相当于为亮度变化大的区域(颜色边缘处)的像素分配更高的色度权重。在此基础上,通过确定的色度权重对低频图像进行上采样操作,相当于将低频图像中的颜色边缘处的像素的色度值提高,使得颜色边缘处的颜色变化更加突出,进而避免了相关技术中颜色边缘处色彩溢出的问题。It should be understood that, in the field of images, the change of color in the image will have an impact on the change of brightness, and the area where the color change is larger usually has a larger change in the brightness. Therefore, for any pixel, if the degree of brightness difference with neighboring pixels is greater, it means that any pixel is in an area with a large color change, that is, at the color edge. In the present disclosure, the chrominance weight of any pixel is positively correlated with the corresponding chrominance weight, which is equivalent to assigning a higher chrominance weight to a pixel in an area with a large luminance change (at the color edge). On this basis, up-sampling the low-frequency image by the determined chrominance weight is equivalent to increasing the chroma value of the pixel at the color edge in the low-frequency image, making the color change at the color edge more prominent, thereby avoiding The problem of color overflow at the color edge in the related art.

简言之,本公开通过对图像中的亮度变化情况进行分析,识别出了图像中的颜色边缘处,进而通过给颜色边缘处的像素分配更高的色度权重的方式,使得颜色边缘处像素的色度值与颜色平坦处像素的色度值的差值增大,凸显了颜色边缘处与颜色平坦处的差异,解决了相关技术中颜色边缘处色彩溢出的问题。In short, the present disclosure identifies the color edge in the image by analyzing the brightness change in the image, and then assigns a higher chrominance weight to the pixel at the color edge, so that the pixel at the color edge The difference between the chromaticity value of the pixel and the chromaticity value of the pixel where the color is flat increases, which highlights the difference between the color edge and the color flat, and solves the problem of color overflow at the color edge in the related art.

可选地,本公开还可以对待处理图像和/或低频图像进行降噪处理。示例地,可以通过滑动窗口的方式遍历待处理图像和/或低频图像,并对通过滑动窗口获取到的任一窗口区域中的所有像素的色度值进行加权计算,以将得到的值作为该任一窗口区域的中心像素的色度值。其中,在进行加权计算的过程中,可以根据任一窗口区域中所有像素的均值为各个像素分配降噪权重,任一像素的降噪权重与该像素与上述均值的差值呈负相关。Optionally, the present disclosure may also perform noise reduction processing on the image to be processed and/or the low-frequency image. For example, the image to be processed and/or the low-frequency image can be traversed by means of a sliding window, and the chromaticity values of all pixels in any window area obtained through the sliding window are weighted and calculated, so as to use the obtained value as the The chrominance value of the center pixel of any window area. Wherein, in the process of weighting calculation, a noise reduction weight can be assigned to each pixel according to the mean of all pixels in any window area, and the noise reduction weight of any pixel is negatively correlated with the difference between the pixel and the above mean.

由于以任一窗口区域中所有像素的均值作为标准为各个像素分配降噪权重,使得中心像素的降噪权重未必最大。其中,在对颜色平坦区域中孤立的彩色噪声进行除噪时,由于彩色噪声所对应的中心像素与邻域像素的色度差值相差较大,导致求得的色度均值与邻域像素的色度值相差较小、而与该中心像素的色度值相差较大,反而会使该中心像素的降噪权重最小。可见,通过上述方式,能够有效减小该彩色噪声所对应像素的色度值与其邻域像素的色度值的差值,进而对颜色平坦区域中孤立的彩色噪声进行有效去除。Since the mean value of all pixels in any window area is used as a standard to assign a noise reduction weight to each pixel, the noise reduction weight of the central pixel is not necessarily the largest. Among them, when the isolated color noise in the color flat area is denoised, the chromaticity difference between the central pixel corresponding to the color noise and the neighboring pixels is quite different, resulting in the obtained chromaticity mean and the neighboring pixels. The difference between the chrominance value is small, and the difference from the chrominance value of the central pixel is relatively large, which will make the noise reduction weight of the central pixel minimum. It can be seen that the above method can effectively reduce the difference between the chromaticity value of the pixel corresponding to the color noise and the chromaticity value of the adjacent pixels, thereby effectively removing the isolated color noise in the color flat area.

与前述的图像处理方法的实施例相对应,本公开还提供了图像处理装置的实施例。Corresponding to the foregoing embodiments of the image processing method, the present disclosure also provides embodiments of an image processing apparatus.

图5是本公开一示例性实施例示出的一种图像处理装置的框图。参照图5,该装置包括获取单元501、确定单元502和合成单元503。FIG. 5 is a block diagram of an image processing apparatus according to an exemplary embodiment of the present disclosure. Referring to FIG. 5 , the apparatus includes an acquisition unit 501 , a determination unit 502 and a synthesis unit 503 .

获取单元501,获取亮度-色度空间域的待处理图像,并对所述待处理图像进行下采样操作,得到所述待处理图像的低频图像;The acquiring unit 501 acquires an image to be processed in the luminance-chrominance space domain, and performs a downsampling operation on the image to be processed to obtain a low-frequency image of the image to be processed;

确定单元502,根据所述待处理图像中的各个第一像素与各自的第一邻域像素的亮度差异程度,分别确定所述各个第一像素的色度权重,其中,所述各个第一像素中,每个第一像素的色度权重与相应的亮度差异程度呈正相关;The determining unit 502 determines the chrominance weight of each first pixel according to the brightness difference between each first pixel in the to-be-processed image and the respective first neighborhood pixels, wherein each first pixel is , the chrominance weight of each first pixel is positively correlated with the corresponding degree of luminance difference;

合成单元503,基于所述各个第一像素对应的色度权重对所述低频图像进行上采样操作,并将经由所述上采样操作得到的图像与所述待处理图像合成,得到处理后图像。The synthesis unit 503 performs an up-sampling operation on the low-frequency image based on the chrominance weight corresponding to each first pixel, and synthesizes the image obtained through the up-sampling operation with the to-be-processed image to obtain a processed image.

可选的,确定单元502被进一步装配为:Optionally, the determining unit 502 is further assembled as:

计算任一第一像素与其任一第一邻域像素的亮度差值,并基于该亮度差值计算对应于该任一第一邻域像素的权重参数;Calculate the luminance difference between any first pixel and any first neighborhood pixel, and calculate a weight parameter corresponding to the any first neighborhood pixel based on the luminance difference;

基于计算得到的所述任一第一像素的所有第一邻域像素的权重参数,确定所述任一第一像素的色度权重。The chrominance weight of any one of the first pixels is determined based on the calculated weight parameters of all the first neighborhood pixels of the any one of the first pixels.

可选的,合成单元503被进一步装配为:Optionally, the synthesis unit 503 is further assembled as:

对所述待处理图像中的所有第一像素执行以下操作:获取所述低频图像中与任一第一像素对应的第二像素,并确定所述第二像素的所有第二邻域像素中,与所述任一第一邻域像素对应的第二邻域像素;Perform the following operations on all the first pixels in the to-be-processed image: acquire a second pixel corresponding to any first pixel in the low-frequency image, and determine among all the second neighborhood pixels of the second pixel, a second neighborhood pixel corresponding to any of the first neighborhood pixels;

计算所述第二邻域像素与所述第二像素之间的距离,并基于该距离与所述任一第一邻域像素的权重参数,确定出与所述任一第一邻域像素对应的色度参考值;Calculate the distance between the second neighborhood pixel and the second pixel, and determine the pixel corresponding to any of the first neighborhood pixels based on the distance and the weight parameter of any of the first neighborhood pixels The chromaticity reference value of ;

对确定出的对应于所述任一第一像素的所有第一邻域像素的多个色度参考值进行加权平均计算,得到对应于所述任一第一像素的目标像素的色度值;Perform a weighted average calculation on the determined multiple chromaticity reference values of all the first neighborhood pixels corresponding to the any first pixel, to obtain the chromaticity value of the target pixel corresponding to the any first pixel;

在得到所述待处理图像中所有第一像素对应的所有目标像素的色度值之后,基于所述所有目标像素的色度值生成经由所述上采样操作得到的图像。After obtaining the chromaticity values of all target pixels corresponding to all the first pixels in the image to be processed, an image obtained through the upsampling operation is generated based on the chromaticity values of all the target pixels.

可选的,确定单元502被进一步装配为:Optionally, the determining unit 502 is further assembled as:

计算任一第一像素与其所有第一邻域像素的亮度均值,以及所述任一第一像素的亮度值与所述亮度均值的第二差值;calculating the luminance mean value of any first pixel and all its first neighboring pixels, and the second difference between the luminance value of any first pixel and the luminance mean value;

将所述第二差值与预定义系数的乘积作为所述任一第一像素的色度权重。The product of the second difference and a predefined coefficient is used as the chrominance weight of any one of the first pixels.

可选的,合成单元503被进一步装配为:Optionally, the synthesis unit 503 is further assembled as:

通过上采样插值算法对所述低频图像进行计算,得到与所述待处理图像尺寸一致的待加权图像;Calculate the low-frequency image through an upsampling interpolation algorithm to obtain an image to be weighted that is consistent with the size of the image to be processed;

基于所述待处理图像中各个第一像素的色度权重,对所述待加权图像中相应像素的色度值进行加权计算;Based on the chromaticity weight of each first pixel in the to-be-processed image, weighted calculation is performed on the chromaticity value of the corresponding pixel in the to-be-weighted image;

将加权计算得到的图像作为经由所述上采样操作得到的图像。The image obtained by the weighting calculation is regarded as the image obtained through the upsampling operation.

如图6所示,图6是本公开一示例性实施例示出的另一种图像处理装置的框图,该实施例在前述图5所示实施例的基础上,还包括:降噪单元504。As shown in FIG. 6 , FIG. 6 is a block diagram of another image processing apparatus shown in an exemplary embodiment of the present disclosure. On the basis of the foregoing embodiment shown in FIG. 5 , this embodiment further includes: a noise reduction unit 504 .

可选的,还包括:Optionally, also include:

降噪单元504,被装配为通过滑动窗口的方式遍历所述待处理图像,并对通过滑动窗口获取到的任一第一窗口区域中所有第一像素的色度值进行加权计算,得到所述任一第一窗口区域对应的第一目标值;将所述第一目标值作为所述任一第一窗口区域的中心像素的色度值;和/或,通过滑动窗口的方式遍历所述低频图像,并对通过滑动窗口获取到的任一第二窗口区域中所有第二像素的色度值进行加权计算,得到所述任一第二窗口区域对应的第二目标值;将所述第二目标值作为所述任一第二窗口区域的中心像素的色度值。The noise reduction unit 504 is configured to traverse the to-be-processed image through a sliding window, and perform weighted calculation on the chromaticity values of all the first pixels in any first window area obtained through the sliding window, to obtain the the first target value corresponding to any first window area; taking the first target value as the chromaticity value of the center pixel of the any first window area; and/or, traversing the low frequency by means of a sliding window image, and perform weighted calculation on the chromaticity values of all the second pixels in any second window area obtained through the sliding window to obtain the second target value corresponding to the any second window area; The target value is used as the chromaticity value of the center pixel of any second window area.

可选的,降噪单元504被进一步装配为:Optionally, the noise reduction unit 504 is further assembled as:

计算所述任一第一窗口区域内所有第一像素的色度均值,并根据所述任一窗口区域内各个第一像素的色度值与所述色度均值之间的第一差值,确定所述各个第一像素的第一降噪权重;所述任一第一窗口区域内的任一第一像素的降噪权重,与该任一第一像素所对应的第一差值呈负相关;基于所述任一第一窗口区域内各个第一像素的降噪权重,对所述任一第一窗口区域内所有第一像素的色度值进行加权平均计算,得到所述任一第一窗口区域对应的第一目标值;和/或,Calculate the chromaticity mean value of all the first pixels in the any first window area, and according to the first difference between the chromaticity value of each first pixel in the any one window area and the chromaticity mean value, Determine the first noise reduction weight of each first pixel; the noise reduction weight of any first pixel in any of the first window regions is negative with the first difference corresponding to the any first pixel correlation; based on the noise reduction weight of each first pixel in the any first window area, perform a weighted average calculation on the chromaticity values of all the first pixels in the any first window area, and obtain the any first window area. a first target value corresponding to a window area; and/or,

计算所述任一第二窗口区域内所有第二像素的色度均值,并根据所述任一第二窗口区域内各个第二像素的色度值与所述色度均值之间的第二差值,确定所述各个第二像素的第二降噪权重;所述任一第二窗口区域内的任一第二像素的降噪权重,与该任一第二像素所对应的第二差值呈负相关;基于所述任一第二窗口区域内各个第二像素的降噪权重,对所述任一第二窗口区域内所有第二像素的色度值进行加权平均计算,得到所述任一第二窗口区域对应的第二目标值。Calculate the chromaticity mean value of all the second pixels in the any second window area, and according to the second difference between the chromaticity value of each second pixel in the any second window area and the chromaticity mean value value, determine the second noise reduction weight of each second pixel; the noise reduction weight of any second pixel in any second window area, and the second difference value corresponding to the any second pixel is negatively correlated; based on the noise reduction weight of each second pixel in the any second window area, the weighted average calculation is performed on the chromaticity values of all the second pixels in the any second window area, and the arbitrary second window area is obtained. A second target value corresponding to a second window area.

关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。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.

对于装置实施例而言,由于其基本对应于方法实施例,所以相关之处参见方法实施例的部分说明即可。以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本公开方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。For the apparatus embodiments, since they basically correspond to the method embodiments, reference may be made to the partial descriptions of the method embodiments for related parts. The device embodiments described above are only illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in One place, or it can be distributed over multiple network elements. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of the present disclosure. Those of ordinary skill in the art can understand and implement it without creative effort.

相应的,本公开还提供一种图像处理装置,包括:处理器;用于存储处理器可执行指令的存储器;其中,所述处理器被配置为实现如上述实施例中任一所述的图像处理方法,比如该方法可以包括:获取亮度-色度空间域的待处理图像,并对所述待处理图像进行下采样操作,得到所述待处理图像的低频图像;根据所述待处理图像中的各个第一像素与各自的第一邻域像素的亮度差异程度,分别确定所述各个第一像素的色度权重,其中,所述各个第一像素中,每个第一像素的色度权重与相应的亮度差异程度呈正相关;基于所述各个第一像素对应的色度权重对所述低频图像进行上采样操作,并将经由所述上采样操作得到的图像与所述待处理图像合成,得到处理后图像。Correspondingly, the present disclosure also provides an image processing apparatus, comprising: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to implement the image according to any one of the foregoing embodiments A processing method, for example, the method may include: acquiring an image to be processed in the luminance-chrominance space domain, and performing a downsampling operation on the image to be processed to obtain a low-frequency image of the image to be processed; The degree of brightness difference between each first pixel and the respective first neighborhood pixels, respectively determine the chrominance weight of each first pixel, wherein, in each first pixel, the chrominance weight of each first pixel It is positively correlated with the corresponding brightness difference; based on the chrominance weight corresponding to each first pixel, an upsampling operation is performed on the low-frequency image, and the image obtained through the upsampling operation is synthesized with the to-be-processed image, Get the processed image.

相应的,本公开还提供一种电子设备,所述电子设备包括有存储器,以及一个或者一个以上的程序,其中一个或者一个以上程序存储于存储器中,且经配置以由一个或者一个以上处理器执行所述一个或者一个以上程序包含用于实现如上述实施例中任一所述的图像处理方法的指令,比如该方法可以包括:获取亮度-色度空间域的待处理图像,并对所述待处理图像进行下采样操作,得到所述待处理图像的低频图像;根据所述待处理图像中的各个第一像素与各自的第一邻域像素的亮度差异程度,分别确定所述各个第一像素的色度权重,其中,所述各个第一像素中,每个第一像素的色度权重与相应的亮度差异程度呈正相关;基于所述各个第一像素对应的色度权重对所述低频图像进行上采样操作,并将经由所述上采样操作得到的图像与所述待处理图像合成,得到处理后图像。图7是根据一示例性实施例示出的一种用于实现进程调度方法的装置700的框图。例如,装置700可以是移动电话,计算机,数字广播终端,消息收发设备,游戏控制台,平板设备,医疗设备,健身设备,个人数字助理等。Correspondingly, the present disclosure also provides an electronic device comprising a memory and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by one or more processors Executing the one or more programs includes instructions for implementing the image processing method described in any of the foregoing embodiments. For example, the method may include: acquiring a to-be-processed image in the luminance-chrominance space domain, and applying the Perform a downsampling operation on the image to be processed to obtain a low-frequency image of the image to be processed; according to the degree of difference in brightness between each first pixel in the to-be-processed image and the respective first neighborhood pixels, determine the respective first pixels The chrominance weight of the pixel, wherein, among the first pixels, the chrominance weight of each first pixel is positively correlated with the corresponding brightness difference degree; An up-sampling operation is performed on the image, and the image obtained through the up-sampling operation is synthesized with the to-be-processed image to obtain a processed image. FIG. 7 is a block diagram of an apparatus 700 for implementing a process scheduling method according to an exemplary embodiment. For example, apparatus 700 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.

参照图7,装置700可以包括以下一个或多个组件:处理组件702,存储器704,电源组件706,多媒体组件708,音频组件710,输入/输出(I/O)的接口712,传感器组件714,以及通信组件716。7, the apparatus 700 may include one or more of the following components: a processing component 702, a memory 704, a power supply component 706, a multimedia component 708, an audio component 710, an input/output (I/O) interface 712, a sensor component 714, and communication component 716 .

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

存储器704被配置为存储各种类型的数据以支持在装置700的操作。这些数据的示例包括用于在装置700上操作的任何应用程序或方法的指令,联系人数据,电话簿数据,消息,图片,视频等。存储器704可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),可编程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。Memory 704 is configured to store various types of data to support operations at device 700 . Examples of such data include instructions for any application or method operating on device 700, contact data, phonebook data, messages, pictures, videos, and the like. Memory 704 may be implemented by any type of volatile or nonvolatile 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.

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

多媒体组件708包括在所述装置700和用户之间的提供一个输出接口的屏幕。在一些实施例中,屏幕可以包括液晶显示器(LCD)和触摸面板(TP)。如果屏幕包括触摸面板,屏幕可以被实现为触摸屏,以接收来自用户的输入信号。触摸面板包括一个或多个触摸传感器以感测触摸、滑动和触摸面板上的手势。所述触摸传感器可以不仅感测触摸或滑动动作的边界,而且还检测与所述触摸或滑动操作相关的持续时间和压力。在一些实施例中,多媒体组件708包括一个前置摄像头和/或后置摄像头。当装置700处于操作模式,如拍摄模式或视频模式时,前置摄像头和/或后置摄像头可以接收外部的多媒体数据。每个前置摄像头和后置摄像头可以是一个固定的光学透镜系统或具有焦距和光学变焦能力。Multimedia component 708 includes screens that provide an output interface between the device 700 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, multimedia component 708 includes a front-facing camera and/or a rear-facing camera. When the apparatus 700 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.

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

I/O接口712为处理组件702和外围接口模块之间提供接口,上述外围接口模块可以是键盘,点击轮,按钮等。这些按钮可包括但不限于:主页按钮、音量按钮、启动按钮和锁定按钮。The I/O interface 712 provides an interface between the processing component 702 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.

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

通信组件716被配置为便于装置700和其他设备之间有线或无线方式的通信。装置700可以接入基于通信标准的无线网络,如WiFi,2G或3G,4G LTE、5G NR(New Radio)或它们的组合。在一个示例性实施例中,通信组件716经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,所述通信组件716还包括近场通信(NFC)模块,以促进短程通信。例如,在NFC模块可基于射频识别(RFID)技术,红外数据协会(IrDA)技术,超宽带(UWB)技术,蓝牙(BT)技术和其他技术来实现。Communication component 716 is configured to facilitate wired or wireless communication between apparatus 700 and other devices. The apparatus 700 may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, 4G LTE, 5G NR (New Radio), or a combination thereof. In one exemplary embodiment, the communication component 716 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 716 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.

在示例性实施例中,装置700可以被一个或多个应用专用集成电路(ASIC)、数字信号处理器(DSP)、数字信号处理设备(DSPD)、可编程逻辑器件(PLD)、现场可编程门阵列(FPGA)、控制器、微控制器、微处理器或其他电子元件实现,用于执行上述方法。In an exemplary embodiment, apparatus 700 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.

在示例性实施例中,还提供了一种包括指令的非临时性计算机可读存储介质,例如包括指令的存储器704,上述指令可由装置700的处理器720执行以完成上述方法。例如,所述非临时性计算机可读存储介质可以是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 704 including instructions, executable by the processor 720 of the apparatus 700 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.

以上所述仅为本公开的较佳实施例而已,并不用以限制本公开,凡在本公开的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本公开保护的范围之内。The above descriptions are only preferred embodiments of the present disclosure, and are not intended to limit the present disclosure. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present disclosure shall be included in the present disclosure. within the scope of protection.

Claims (10)

1. An image processing method, characterized by comprising:
acquiring a to-be-processed image of a brightness-chrominance space domain, and performing down-sampling operation on the to-be-processed image to obtain a low-frequency image of the to-be-processed image;
respectively determining the chromaticity weight of each first pixel according to the brightness difference degree of each first pixel and each first neighborhood pixel in the image to be processed, wherein the chromaticity weight of each first pixel in each first pixel is positively correlated with the corresponding brightness difference degree;
and performing upsampling operation on the low-frequency image based on the chromaticity weight corresponding to each first pixel, and synthesizing the image obtained through the upsampling operation with the image to be processed to obtain a processed image.
2. The method of claim 1, further comprising, prior to the upsampling operation on the low frequency image:
traversing the image to be processed in a sliding window mode, and performing weighted calculation on chrominance values of all first pixels in any first window area acquired through the sliding window to obtain a first target value corresponding to any first window area; taking the first target value as a chrominance value of a center pixel of any one of the first window regions; and/or the presence of a gas in the gas,
traversing the low-frequency image in a sliding window mode, and performing weighted calculation on chrominance values of all second pixels in any second window area acquired through the sliding window to obtain a second target value corresponding to any second window area; the second target value is taken as the chrominance value of the center pixel of said any second window area.
3. The method of claim 2,
the obtaining a first target value corresponding to any window region by performing weighted calculation on chrominance values of all first pixels in any first window region acquired through a sliding window includes:
calculating the chrominance mean value of all the first pixels in any one of the first window regions, and determining a first noise reduction weight of each first pixel according to a first difference value between the chrominance value of each first pixel in any one of the first window regions and the chrominance mean value; the noise reduction weight of any first pixel in any first window region is in negative correlation with a first difference value corresponding to any first pixel; based on the noise reduction weight of each first pixel in any first window region, performing weighted average calculation on chrominance values of all first pixels in any first window region to obtain a first target value corresponding to any first window region;
the performing weighted calculation on the chrominance values of all second pixels in any second window region acquired through the sliding window to obtain a second target value corresponding to any second window region includes:
calculating the chrominance mean value of all second pixels in any second window region, and determining a second noise reduction weight of each second pixel according to a second difference value between the chrominance mean value and each second pixel in any second window region; the noise reduction weight of any second pixel in any second window region is in negative correlation with a second difference value corresponding to any second pixel; and performing weighted average calculation on the chrominance values of all the second pixels in any second window region based on the noise reduction weight of each second pixel in any second window region to obtain a second target value corresponding to any second window region.
4. The method of claim 1, wherein determining the chroma weight of each first pixel according to the brightness difference degree between the first pixel and the first neighboring pixel in the image to be processed comprises:
calculating the brightness difference value of any first pixel and any first neighborhood pixel thereof, and calculating a weight parameter corresponding to any first neighborhood pixel based on the brightness difference value;
and determining the chrominance weight of any first pixel based on the calculated weight parameters of all first neighborhood pixels of the any first pixel.
5. The method of claim 4, wherein the upsampling the low-frequency image based on the chrominance weights corresponding to the first pixels comprises:
performing the following operations on all first pixels in the image to be processed: acquiring a second pixel corresponding to any first pixel in the low-frequency image, and determining a second neighborhood pixel corresponding to any first neighborhood pixel in all second neighborhood pixels of the second pixel;
calculating the distance between the second neighborhood pixels and the second pixels, and determining a chromaticity reference value corresponding to any one first neighborhood pixel based on the distance and the weight parameter of any one first neighborhood pixel;
performing weighted average calculation on a plurality of determined chromaticity reference values of all first neighborhood pixels corresponding to any one first pixel to obtain a chromaticity value of a target pixel corresponding to any one first pixel;
after obtaining the chrominance values of all target pixels corresponding to all first pixels in the image to be processed, generating an image obtained through the upsampling operation based on the chrominance values of all the target pixels.
6. The method of claim 1, wherein determining the chrominance weight of each first pixel according to the degree of the luminance difference between the first pixel and the respective first neighboring pixel in the image to be processed comprises:
calculating the brightness mean value of any first pixel and all first neighborhood pixels thereof and a second difference value of the brightness value of any first pixel and the brightness mean value;
and taking the product of the second difference value and a predefined coefficient as the chroma weight of any first pixel.
7. The method of claim 1, wherein the upsampling the low-frequency image based on the chrominance weights corresponding to the first pixels comprises:
calculating the low-frequency image through an up-sampling interpolation algorithm to obtain an image to be weighted with the size consistent with that of the image to be processed;
based on the chroma weight of each first pixel in the image to be processed, carrying out weighted calculation on the chroma value of the corresponding pixel in the image to be weighted;
and taking the image obtained by the weighting calculation as the image obtained by the up-sampling operation.
8. An image processing apparatus characterized by comprising:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring an image to be processed in a brightness-chromaticity space domain and performing down-sampling operation on the image to be processed to obtain a low-frequency image of the image to be processed;
the determining unit is used for respectively determining the chromaticity weight of each first pixel according to the brightness difference degree of each first pixel and each first neighborhood pixel in the image to be processed, wherein the chromaticity weight of each first pixel in each first pixel is positively correlated with the corresponding brightness difference degree;
and the synthesizing unit is used for performing up-sampling operation on the low-frequency image based on the chrominance weight corresponding to each first pixel, and synthesizing the image obtained through the up-sampling operation with the image to be processed to obtain a processed image.
9. An electronic device, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor implements the method of any one of claims 1-7 by executing the executable instructions.
10. A computer-readable storage medium having stored thereon computer instructions, which when executed by a processor, perform the steps of the method according to any one of claims 1-7.
CN202110007717.9A 2021-01-05 2021-01-05 Image processing method and device, electronic device, and storage medium Active CN114723613B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110007717.9A CN114723613B (en) 2021-01-05 2021-01-05 Image processing method and device, electronic device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110007717.9A CN114723613B (en) 2021-01-05 2021-01-05 Image processing method and device, electronic device, and storage medium

Publications (2)

Publication Number Publication Date
CN114723613A true CN114723613A (en) 2022-07-08
CN114723613B CN114723613B (en) 2025-03-18

Family

ID=82234628

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110007717.9A Active CN114723613B (en) 2021-01-05 2021-01-05 Image processing method and device, electronic device, and storage medium

Country Status (1)

Country Link
CN (1) CN114723613B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2025060610A1 (en) * 2023-09-18 2025-03-27 杭州微影软件有限公司 Image fusion method and apparatus, electronic device, and storage medium
CN119863726A (en) * 2025-03-21 2025-04-22 浙江水利水电学院 Bare soil automatic identification method and system based on unmanned aerial vehicle real-time image

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080012968A1 (en) * 2006-07-03 2008-01-17 Samsung Electronics Co., Ltd. Apparatus and method for correcting image edge
US20130064448A1 (en) * 2011-09-09 2013-03-14 Stmicroelectronics (Grenoble 2) Sas Image chroma noise reduction
US20140321744A1 (en) * 2013-04-26 2014-10-30 Fujitsu Limited Method and apparatus for reducing image noise
US20170099489A1 (en) * 2015-10-02 2017-04-06 Canon Kabushiki Kaisha Encoder optimizations for palette encoding of content with subsampled colour component
CN109191406A (en) * 2018-09-19 2019-01-11 浙江宇视科技有限公司 Image processing method, device and equipment
CN111784603A (en) * 2020-06-29 2020-10-16 珠海全志科技股份有限公司 RAW domain image denoising method, computer device and computer readable storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080012968A1 (en) * 2006-07-03 2008-01-17 Samsung Electronics Co., Ltd. Apparatus and method for correcting image edge
US20130064448A1 (en) * 2011-09-09 2013-03-14 Stmicroelectronics (Grenoble 2) Sas Image chroma noise reduction
US20140321744A1 (en) * 2013-04-26 2014-10-30 Fujitsu Limited Method and apparatus for reducing image noise
US20170099489A1 (en) * 2015-10-02 2017-04-06 Canon Kabushiki Kaisha Encoder optimizations for palette encoding of content with subsampled colour component
CN109191406A (en) * 2018-09-19 2019-01-11 浙江宇视科技有限公司 Image processing method, device and equipment
CN111784603A (en) * 2020-06-29 2020-10-16 珠海全志科技股份有限公司 RAW domain image denoising method, computer device and computer readable storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2025060610A1 (en) * 2023-09-18 2025-03-27 杭州微影软件有限公司 Image fusion method and apparatus, electronic device, and storage medium
CN119863726A (en) * 2025-03-21 2025-04-22 浙江水利水电学院 Bare soil automatic identification method and system based on unmanned aerial vehicle real-time image

Also Published As

Publication number Publication date
CN114723613B (en) 2025-03-18

Similar Documents

Publication Publication Date Title
EP3410390B1 (en) Image processing method and device, computer readable storage medium and electronic device
JP6469678B2 (en) System and method for correcting image artifacts
CN109345485B (en) Image enhancement method and device, electronic equipment and storage medium
WO2019153920A1 (en) Method for image processing and related device
US11756167B2 (en) Method for processing image, electronic device and storage medium
JP7136956B2 (en) Image processing method and device, terminal and storage medium
CN106530252B (en) Image processing method and device
KR102819311B1 (en) Content based image processing
CN110958401A (en) A method, device and electronic device for color correction of super night scene images
CN116668773B (en) Methods and electronic devices for enhancing video quality
CN109697738A (en) Image processing method, device, terminal device and storage medium
CN107231505B (en) Image processing method and device
KR102807669B1 (en) Electronic device and operating method for generating high dynamic range image
CN108765271A (en) Image processing method and equipment
CN115239570A (en) Image processing method, image processing apparatus, and storage medium
CN105574834B (en) Image processing method and device
CN114511450A (en) Image noise reduction method, image noise reduction device, terminal and storage medium
CN115330610A (en) Image processing method, image processing apparatus, electronic device, and storage medium
CN108259771A (en) Image processing method, image processing apparatus, storage medium, and electronic device
CN114723613A (en) Image processing method and device, electronic device, storage medium
CN111625213A (en) Picture display method, device and storage medium
CN106982327A (en) Image processing method and device
CN113284063A (en) Image processing method, image processing apparatus, electronic device, and readable storage medium
CN107563957A (en) Eyes image processing method and processing device
CN111915529A (en) A video dark light enhancement method, device, mobile terminal and storage medium

Legal Events

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