CN110072034B - Image processing method and image processing device - Google Patents
Image processing method and image processing device Download PDFInfo
- Publication number
- CN110072034B CN110072034B CN201810062839.6A CN201810062839A CN110072034B CN 110072034 B CN110072034 B CN 110072034B CN 201810062839 A CN201810062839 A CN 201810062839A CN 110072034 B CN110072034 B CN 110072034B
- Authority
- CN
- China
- Prior art keywords
- pixel
- weight
- reference pixels
- target pixel
- 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.)
- Active
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 22
- 238000001914 filtration Methods 0.000 claims abstract description 40
- 230000004044 response Effects 0.000 claims abstract description 16
- 238000010586 diagram Methods 0.000 description 14
- 238000000034 method Methods 0.000 description 12
- 230000001965 increasing effect Effects 0.000 description 2
- 230000003044 adaptive effect Effects 0.000 description 1
- 230000007423 decrease Effects 0.000 description 1
- 230000007812 deficiency Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000002708 enhancing effect Effects 0.000 description 1
- 230000001629 suppression Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N5/00—Details of television systems
- H04N5/14—Picture signal circuitry for video frequency region
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N5/00—Details of television systems
- H04N5/14—Picture signal circuitry for video frequency region
- H04N5/21—Circuitry for suppressing or minimising disturbance, e.g. moiré or halo
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Image Processing (AREA)
Abstract
本发明揭露了一种影像处理方法及影像处理装置,用来对影像进行滤波。该影像处理方法包含以下步骤:(A)针对每一参考像素产生一权重,其中,该影像包含复数个参考像素,且该权重的大小与一目标像素及该权重所对应的该参考像素之间的相似度有关;以及(B)根据该些权重、该目标像素的像素值及该些参考像素的像素值进行一无线脉冲响应滤波操作,以得到该目标像素的一无线脉冲响应滤波值。
The invention discloses an image processing method and an image processing device, which are used for filtering images. The image processing method includes the following steps: (A) generating a weight for each reference pixel, wherein the image includes a plurality of reference pixels, and the size of the weight is between a target pixel and the reference pixel corresponding to the weight and (B) performing a wireless impulse response filtering operation according to the weights, the pixel values of the target pixel and the pixel values of the reference pixels to obtain a wireless impulse response filtering value of the target pixel.
Description
技术领域technical field
本发明是关于影像处理,尤其是关于基于无限脉冲响应(infinite impulseresponse,IIR)的影像处理方法及影像处理装置。The present invention relates to image processing, in particular to an image processing method and an image processing device based on infinite impulse response (IIR).
背景技术Background technique
图1是用于影像处理的一视窗的示意图。图中的5×5视窗(包含25个像素)用以对中心的目标像素P(i,j)进行影像处理,视窗中的其他像素为参考像素。假设进行空间域无限脉冲响应(infinite impulse response,以下简称IIR)滤波操作时,是以左上到右下的扫描顺序(Raster scan)对影像进行处理,因此视窗中的白色的部分的像素为未经IIR滤波处理的原始像素,其像素值为原始像素值PVORI,灰色的部分的像素为先前已经过IIR滤波处理的像素(简称为IIR像素),其像素值为IIR滤波值PVIIR。详言之,参考像素P(i-2,j-2)为IIR像素(像素值为PVIIR(i-2,j-2))、参考像素P(i-2,j-1)为IIR像素(像素值为PVIIR(i-2,j-1))、…;目标像素P(i,j)为原始像素(像素值为PVORI(i,j))、参考像素P(i,j+1)为原始像素(像素值为PVORI(i,j+1))、像素P(i,j+2)为原始像素(像素值为PVORI(i,j+2))、…。FIG. 1 is a schematic diagram of a window for image processing. The 5×5 window (including 25 pixels) in the figure is used to perform image processing on the target pixel P(i,j) in the center, and other pixels in the window are reference pixels. Assuming that the infinite impulse response (IIR) filtering operation in the spatial domain is performed, the image is processed in the scan order (Raster scan) from the upper left to the lower right, so the pixels in the white part of the window are untouched. The original pixel processed by IIR filtering has the original pixel value PV ORI , and the gray part of the pixel is the pixel that has been previously processed by IIR filtering (referred to as IIR pixel), and its pixel value is the IIR filtering value PV IIR . In detail, the reference pixel P(i-2,j-2) is an IIR pixel (the pixel value is PV IIR (i-2,j-2)), and the reference pixel P(i-2,j-1) is an IIR Pixels (the pixel value is PV IIR (i-2,j-1)), ...; the target pixel P(i,j) is the original pixel (the pixel value is PV ORI (i,j)), the reference pixel P(i, j+1) is the original pixel (the pixel value is PV ORI (i,j+1)), the pixel P(i,j+2) is the original pixel (the pixel value is PV ORI (i,j+2)),… .
IIR滤波是将视窗中的IIR像素与目标像素做平均以对目标像素进行滤波,以图1的例子来说,IIR滤波是根据算式(1)得到目标像素P(i,j)的IIR滤波值PVIIR(i,j),亦即计算12个IIR像素的像素值PVIIR与目标像素P(i,j)的像素值PVORI(i,j)的算数平均:IIR filtering is to average the IIR pixels in the window and the target pixels to filter the target pixels. Taking the example of Figure 1, the IIR filtering is to obtain the IIR filtering value of the target pixel P(i, j) according to the formula (1). PV IIR (i,j), that is, calculate the arithmetic mean of the pixel value PV IIR of the 12 IIR pixels and the pixel value PV ORI (i,j) of the target pixel P(i,j):
PVIIR(i,j)=(PVIIR(i-2,j-2)+PVIIR(i-2,j-1)+PVIIR(i-2,j)+PVIIR(i-2,j+1)+PVIIR(i-2,j+2)+PVIIR(i-1,j-2)+PVIIR(i-1,j-1)+PVIIR(i-1,j)+PVIIR(i-1,j+1)+PVIIR(i-1,j+2)+PVIIR(i,j-2)+PVIIR(i,j-1)+PVORI(i,j))/13 (1)PV IIR (i,j)=(PV IIR (i-2,j-2)+PV IIR (i-2,j-1)+PV IIR (i-2,j)+PV IIR (i-2, j+1)+PV IIR (i-2,j+2)+PV IIR (i-1,j-2)+PV IIR (i-1,j-1)+PV IIR (i-1,j) +PV IIR (i-1,j+1)+PV IIR (i-1,j+2)+PV IIR (i,j-2)+PV IIR (i,j-1)+PV ORI (i,j-1) j))/13 (1)
算式(1)计算完成后目标像素P(i,j)成为一IIR像素,且成为下一回合的IIR滤波(以图1的像素P(i,j+1)为目标像素)中的参考像素。因为IIR滤波所参考的像素为IIR像素而非原始像素,且IIR像素对比于原始像素IIR像素较不受杂讯干扰,所以IIR滤波可以使用较少的参考像素(意谓可节省硬体资源)做有效的低通滤波处理,以去除影像中的高频杂讯。然而,以左上到右下的扫描顺序为例,IIR滤波仅取目标像素的左方、左上方、上方、及/或右上方的像素做为参考,而未考虑其他方向的像素,所以容易造成左方、左上方、上方、及/或右上方的像素特征往其他方向扩散的影像拖曳(image dragging)现象。此影像拖曳现象易造成色彩失真,若发生在影像的边缘处则会造成影像边缘模糊。因此如何有效去除高频杂讯并避免影像拖曳现象及色彩失真,为本领域的重要课题。After the calculation of formula (1) is completed, the target pixel P(i,j) becomes an IIR pixel, and becomes the reference pixel in the next round of IIR filtering (taking the pixel P(i,j+1) in Figure 1 as the target pixel) . Because the pixels referenced by IIR filtering are IIR pixels rather than original pixels, and IIR pixels are less susceptible to noise interference than original pixels, IIR pixels, so IIR filtering can use fewer reference pixels (meaning that hardware resources can be saved) Do effective low-pass filtering to remove high-frequency noise in the image. However, taking the scanning sequence from upper left to lower right as an example, IIR filtering only takes pixels to the left, upper left, upper and/or upper right of the target pixel as a reference, and does not consider pixels in other directions, so it is easy to cause The image dragging phenomenon in which the pixel features on the left, upper left, upper, and/or upper right spread to other directions. This image dragging phenomenon is easy to cause color distortion, and if it occurs at the edge of the image, the image edge will be blurred. Therefore, how to effectively remove high-frequency noise and avoid image dragging and color distortion is an important issue in the field.
发明内容SUMMARY OF THE INVENTION
鉴于先前技术的不足,本发明的一目的在于提供一种影像处理方法及影像处理装置。In view of the deficiencies of the prior art, an object of the present invention is to provide an image processing method and an image processing apparatus.
本发明揭露一种影像处理方法,用来对一影像进行滤波,包含以下步骤:(A)针对每一第一参考像素产生一第一权重,其中,该影像包含复数个第一参考像素,且该第一权重的大小与一目标像素及该第一权重所对应的该第一参考像素之间的相似度有关;(B)根据该些第一权重、该目标像素的像素值及该些第一参考像素的像素值计算该目标像素的一第一滤波值;(C)针对每一第二参考像素产生一第二权重,其中,该影像包含复数个第二参考像素,且该第二权重的大小与该目标像素及该第二权重所对应的该第二参考像素之间的相似度有关;以及(D)根据该些第二权重、该目标像素的该第一滤波值及该些第二参考像素的像素值计算该目标像素的一第二滤波值。The present invention discloses an image processing method for filtering an image, including the following steps: (A) generating a first weight for each first reference pixel, wherein the image includes a plurality of first reference pixels, and The size of the first weight is related to the similarity between a target pixel and the first reference pixel corresponding to the first weight; (B) according to the first weights, the pixel value of the target pixel and the first Calculate a first filter value of the target pixel from the pixel value of a reference pixel; (C) generate a second weight for each second reference pixel, wherein the image includes a plurality of second reference pixels, and the second weight The size is related to the similarity between the target pixel and the second reference pixel corresponding to the second weight; and (D) according to the second weight, the first filter value of the target pixel and the first filter value A second filter value of the target pixel is calculated from the pixel values of the two reference pixels.
本发明另揭露一种影像处理装置,用来对一影像进行滤波,包含一第一权重计算电路、一第一滤波值计算电路、一第二权重计算电路以及一第二滤波值计算电路。该第一权重计算电路针对每一第一参考像素产生一第一权重,其中,该影像包含复数个第一参考像素,且该第一权重的大小与一目标像素及该第一权重所对应的该第一参考像素之间的相似度有关。该第一滤波值计算电路根据该些第一权重、该目标像素的像素值及该些第一参考像素的像素值计算该目标像素的一第一滤波值。该第二权重计算电路针对每一第二参考像素产生一第二权重,其中,该影像包含复数个第二参考像素,且该第二权重的大小与该目标像素及该第二权重所对应的该第二参考像素之间的相似度有关。该第二滤波值计算电路,根据该些第二权重、该目标像素的该第一滤波值及该些第二参考像素的像素值计算该目标像素的一第二滤波值。The present invention further discloses an image processing apparatus for filtering an image, comprising a first weight calculation circuit, a first filter value calculation circuit, a second weight calculation circuit and a second filter value calculation circuit. The first weight calculation circuit generates a first weight for each first reference pixel, wherein the image includes a plurality of first reference pixels, and the size of the first weight corresponds to a target pixel and the first weight The similarity between the first reference pixels is related. The first filter value calculation circuit calculates a first filter value of the target pixel according to the first weights, the pixel values of the target pixel and the pixel values of the first reference pixels. The second weight calculation circuit generates a second weight for each second reference pixel, wherein the image includes a plurality of second reference pixels, and the size of the second weight corresponds to the target pixel and the second weight. The similarity between the second reference pixels is related. The second filter value calculation circuit calculates a second filter value of the target pixel according to the second weights, the first filter value of the target pixel and the pixel values of the second reference pixels.
本发明另揭露一种影像处理方法,用来对一影像进行滤波,包含以下步骤:(A)针对每一参考像素产生一权重,其中,该影像包含复数个参考像素,且该权重的大小与一目标像素及该权重所对应的该参考像素之间的相似度有关;以及(B)根据该些权重、该目标像素的像素值及该些参考像素的像素值进行一无限脉冲响应滤波操作,以得到该目标像素的一无限脉冲响应滤波值。The present invention further discloses an image processing method for filtering an image, including the following steps: (A) generating a weight for each reference pixel, wherein the image includes a plurality of reference pixels, and the size of the weight is the same as that of the reference pixel. The similarity between a target pixel and the reference pixel corresponding to the weight is related; and (B) performing an infinite impulse response filtering operation according to the weight, the pixel value of the target pixel and the pixel value of the reference pixel, to obtain an infinite impulse response filter value of the target pixel.
本发明的影像处理方法及影像处理装置实作边缘保护机制以抑制IIR滤波的影像拖曳现象。相较于传统技术,本发明进行滤波的同时能保护影像的边缘结构。The image processing method and the image processing apparatus of the present invention implement an edge protection mechanism to suppress the image dragging phenomenon of IIR filtering. Compared with the conventional technology, the present invention can protect the edge structure of the image while filtering.
有关本发明的特征、实作与功效,兹配合图式作实施例详细说明如下。With regard to the features, implementations and effects of the present invention, embodiments are described in detail as follows in conjunction with the drawings.
附图说明Description of drawings
[图1]为用于影像处理的一视窗的示意图;[FIG. 1] is a schematic diagram of a window for image processing;
[图2]为本发明的影像处理装置的一实施例的功能方块图;2 is a functional block diagram of an embodiment of the image processing apparatus of the present invention;
[图3A~3B]为本发明的影像处理方法的一实施例的流程图;3A-3B is a flowchart of an embodiment of an image processing method of the present invention;
[图4]为用于影像处理的另一视窗的示意图;[FIG. 4] is a schematic diagram of another window for image processing;
[图5]为权重计算电路的一实施例的功能方块图;[ Fig. 5 ] is a functional block diagram of an embodiment of a weight calculation circuit;
[图6A~6B]为权重及像素差值的关系图的其中一种范例;[FIG. 6A-6B] is one example of the relationship diagram of weight and pixel difference;
[图7]为本发明的影像处理装置的另一实施例的功能方块图;FIG. 7 is a functional block diagram of another embodiment of the image processing apparatus of the present invention;
[图8]为本发明的影像处理方法的另一实施例的流程图;以及[ FIG. 8 ] is a flowchart of another embodiment of the image processing method of the present invention; and
[图9]为用于影像处理的另一视窗的示意图。[ FIG. 9 ] is a schematic diagram of another window for image processing.
【符号说明】【Symbol Description】
200 影像处理装置200 Image processing device
210、710 记忆体210, 710 memory
220、720、740 权重计算电路220, 720, 740 weight calculation circuit
230、730、750 滤波电路230, 730, 750 filter circuit
510 像素相似度计算电路510 pixel similarity calculation circuit
520 权重决定电路520 Weight Decision Circuit
S310~S340、S810~S860 步骤S310~S340, S810~S860 Steps
具体实施方式Detailed ways
以下说明内容的技术用语是参照本技术领域的习惯用语,如本说明书对部分用语有加以说明或定义,该部分用语的解释是以本说明书的说明或定义为准。The technical terms used in the following description refer to the common terms in the technical field. If some terms are described or defined in this specification, the interpretation of this part of terms shall be subject to the descriptions or definitions in this specification.
本发明的揭露内容包含一种影像处理方法及影像处理装置。由于本发明的影像处理装置所包含的部分元件单独而言可能为已知元件,因此在不影响该装置发明的充分揭露及可实施性的前提下,以下说明对于已知元件的细节将予以节略。The disclosure of the present invention includes an image processing method and an image processing apparatus. Since some elements included in the image processing apparatus of the present invention may be known elements individually, the details of the known elements will be omitted in the following description without affecting the full disclosure and practicability of the invention of the apparatus. .
图2是本发明的影像处理装置的一实施例的功能方块图,图3为对应图2的影像处理方法的流程图。影像处理装置200包含记忆体210、权重计算电路220以及滤波电路230。影像处理装置200进行影像处理时先取得一目标像素P(i,j),并以邻近该目标像素P(i,j)的若干像素作为参考像素(步骤S310),其中参考像素为IIR像素。以图1为例,参考像素可以包含该12个IIR像素,此时记忆体210至少需储存该12个IIR像素。图4显示影像处理装置200所使用的视窗的另一实施例。此例中参考像素只包含二个IIR像素,此时记忆体210至少需储存该二个IIR像素。相较于图1,图4的实施方式至少可以少储存10个参考像素的像素值。FIG. 2 is a functional block diagram of an embodiment of an image processing apparatus of the present invention, and FIG. 3 is a flowchart corresponding to the image processing method of FIG. 2 . The
接下来,权重计算电路220针对每一参考像素产生一权重(步骤S320),详言之,权重计算电路220从记忆体210取得参考像素,并依据参考像素及目标像素之间的相似度为每个参考像素决定一权重W,亦即权重W与两像素之间的相似度有关。图5为权重计算电路220的一实施例的功能方块图。首先,像素相似度计算电路510依据目标像素的像素值PVtar及参考像素的像素值PVref来计算每个参考像素与目标像素之间的相似度,而得到一个差值d(步骤S322)。举例来说,像素相似度计算电路510计算两者的绝对差值d=|PVtar-PVref|,绝对差值d愈大,代表目标像素与参考像素的相似度愈低。在此实施例中,像素值PVtar为目标像素P(i,j)的原始像素值PVORI(i,j),像素值PVref为参考像素的IIR滤波值PVIIR。Next, the
接着权重决定电路520依据差值d(等效依据像素的相似度),以及最大权重Wmax、第一门槛值th1及第一门槛值th2为每个参考像素决定一权重W(步骤S324)。图6A及6B为权重W及差值d的关系图的其中一种范例。当差值d小于第一门槛值th1时,代表目标像素与参考像素之间的相似度高,此时权重决定电路520给予该参考像素最高权重Wmax;当差值d介于第一门槛值th1及第二门槛值th2之间时,权重W随著差值d增加而减少;当差值d大于第二门槛值th2时,代表目标像素与参考像素之间的相似度低,此时权重决定电路520给予该参考像素的权重W为零。为了硬体实作上的方便,权重决定电路520可自动地将第一门槛值th1及第一门槛值th2之间平均划分为q等分(q为大于1的整数,图6B的例子中q=3),使权重W呈现步进式(stepwise)变化。相较于图6A的实作方式,图6B可省下用于计算图6A的门槛值th1及th2之间的斜率的除法器。Then, the
得到每个参考像素的权重后,滤波电路230依据算式(2)计算目标像素与参考像素的加权平均,以得到目标像素的IIR滤波值(步骤S330)。After obtaining the weight of each reference pixel, the
PVIIR(i,j)=((WSUM-WNBR)×PVORI(i,j)+∑(W×PVIIR))/WSUM (2)PV IIR (i, j)=((W SUM -W NBR )×PV ORI (i, j)+∑(W×PV IIR ))/W SUM (2)
如图3B所示,步骤S330可以细分为计算复数个第一乘积(W×PVIIR)(步骤S332)、计算一第二乘积((WSUM-WNBR)×PVORI(i,j))(步骤S334),以及依据该些第一乘积及该第二乘积得到该目标像素的滤波值(步骤S336)。详言之,步骤S336是将该些第一乘积与该第二乘积的总和除以使用者定义的权重总和WSUM以得到该目标像素的滤波值。其中,WNBR为所有参考像素的权重的总和,第一乘积(W×PVIIR)为某一参考像素的权重W与该参考像素的IIR滤波值的乘积,∑(W×PVIIR)为所有的参考像素的该些第一乘积的总和。举例来说,以图4为例,则算式(2)成为:As shown in FIG. 3B , step S330 can be subdivided into calculating a plurality of first products (W×PV IIR ) (step S332 ), calculating a second product ((W SUM −W NBR )×PV ORI (i,j) ) (step S334 ), and obtain the filter value of the target pixel according to the first products and the second products (step S336 ). Specifically, step S336 is to divide the sum of the first products and the second products by the user-defined weight sum W SUM to obtain the filter value of the target pixel. Among them, W NBR is the sum of the weights of all reference pixels, the first product (W×PV IIR ) is the product of the weight W of a reference pixel and the IIR filter value of the reference pixel, ∑(W×PV IIR ) is all The sum of the first products of the reference pixels of . For example, taking Fig. 4 as an example, the formula (2) becomes:
PVIIR(i,j)=((WSUM-WNBR)×PVORI(i,j)+W(i-1,j)×PVIIR(i-1,j)+W(i,j-1)×PVIIR(i,j-1))/WSUM (3)PV IIR (i,j)=((W SUM -W NBR )×PV ORI (i,j)+W(i-1,j)×PV IIR (i-1,j)+W(i,j- 1)×PV IIR (i,j-1))/W SUM (3)
其中,in,
WNBR=W(i-1,j)+W(i,j-1) (4)W NBR =W(i-1,j)+W(i,j-1) (4)
权重总和可以设计为WSUM-(n-1)×wmax≈Wmax,n为视窗所包含的像素个数。也就是说,当视窗中所有参考像素与目标像素的相似度皆极高时(例如该视窗位于影像中像素值变化不大的平坦区域),目标像素的权重(WSUM-WNBR=WSUM-(n-1)×Wmax≈Wmax)与任一参考相数的权重相当。在一个实施例中,WSUM可以设计为2的幂次方,如此一来实现算式2的除法时便只需对二进位的数值移位,而不需要使用除法器。The sum of weights can be designed as W SUM -(n-1)×wmax≈Wmax, where n is the number of pixels contained in the window. That is to say, when the similarity between all reference pixels in the window and the target pixel is very high (for example, the window is located in a flat area where the pixel value does not change much in the image), the weight of the target pixel (W SUM -W NBR =W SUM -(n-1)×Wmax≈Wmax) is equivalent to the weight of any reference phase number. In one embodiment, W SUM can be designed to be a power of 2, so that when implementing the division of
当目标像素位于影像的边缘上时,该视窗中同样位于边缘上的参考像素(亦即与目标像素相似度高的参考像素)具有较高的权重W,而其他不位于边缘上的参考像素(亦即与目标像素相似度低的参考像素)的权重W则较低,因此滤波后影像的边缘特征得以被保留,且可视该权重为边缘保护(edge preserve)权重。详言之,权重计算电路220产生权重W的机制与影像的边缘相关,此机制使影像处理装置200的滤波处理具有边缘感知的能力,因此可以有效地抑制IIR滤波的影像拖曳现象,以防止色彩失真及边缘模糊。When the target pixel is located on the edge of the image, the reference pixels also located on the edge in the window (that is, the reference pixels with high similarity to the target pixel) have a higher weight W, while other reference pixels not located on the edge ( That is, the weight W of the reference pixel with low similarity to the target pixel is lower, so the edge features of the filtered image are preserved, and the weight can be regarded as an edge preserve weight. In detail, the mechanism for generating the weight W by the
得到目标像素的IIR滤波值PVIIR后,影像处理装置200一方面将其输出至后级的电路(图未示)(步骤S340),一方面将其储存至记忆体210以供之后的IIR滤波程序使用。After obtaining the IIR filter value PV IIR of the target pixel, the
图7是本发明的影像处理装置的另一实施例的功能方块图,图8为对应图7的影像处理方法的流程图。影像处理装置700包含记忆体710、权重计算电路720与740、以及滤波电路730与750。记忆体710储存参考像素。影像处理装置700进行影像处理时先取得一目标像素P(i,j),并以邻近该目标像素P(i,j)的若干像素作为参考像素(步骤S810)。接着,权重计算电路720以目标像素及参考像素的原始像素值PVORI来针对每一参考像素产生一第一权重W1(步骤S820),亦即第一权重W1与两像素之间的相似度有关。类似地,权重计算电路720的一施实例的功能方块图如图5所示,以及步骤S820包含S322及S324两个子步骤。在步骤S820中,输入像素相似度计算电路510的像素值PVtar及像素值PVref是分别为目标像素P(i,j)的原始像素值PVORI以及参考像素的原始像素值PVORI。FIG. 7 is a functional block diagram of another embodiment of the image processing apparatus of the present invention, and FIG. 8 is a flowchart corresponding to the image processing method of FIG. 7 . The
接下来滤波电路730根据算式(3)计算目标像素与参考像素的加权平均,以得到目标像素的边缘保护低通滤波值PVEPF(i,j)(步骤S830)。Next, the
PVEPP(i,j)=((WSUM-WNBR)×PVORI(i,j)+∑(w1×PVORI))/WSUM (5)PV EPP (i,j)=((W SUM -W NBR )×PV ORI (i,j)+∑(w1×PV ORI ))/W SUM (5)
算式(5)为复数个第一乘积(W1×PVORI)与第二乘积((WSUM-WNBR)×PVORI(i,j))的总和除以使用者定义的权重总和WSUM的结果。其中,W1NBR为所有参考像素的第一权重W1的总和,第一乘积(W1×PVORI)为某一参考像素的第一权重W1与该参考像素的原始像素值的乘积,∑(W1×PVORI)为所有的参考像素的该些第一乘积的总和。举例来说,以图9的视窗为例,算式(5)成为:Equation (5) is the sum of a plurality of first products (W1×PV ORI ) and second products ((W SUM -W NBR )×PV ORI (i,j)) divided by the user-defined weight sum W SUM . result. Wherein, W1 NBR is the sum of the first weights W1 of all reference pixels, and the first product (W1×PV ORI ) is the product of the first weight W1 of a reference pixel and the original pixel value of the reference pixel, ∑(W1× PV ORI ) is the sum of the first products of all reference pixels. For example, taking the window of FIG. 9 as an example, the formula (5) becomes:
PVEPF(i,j)=((WSUM-W1NBR)×PVORI(i,j)+W1(i-1,j-1)×PVORI(i-1,j-1)+W1(i-1,j)×PvORI(i-1,j)+W1(i-1,j+1)×PVORI(i-1,j+1)+W1(i,j-1)×PVORI(i,j-1)+W1(i,j+1)×PVORI(i,j+1)+W1(i+1,j-1)×PVORI(i+1,j-1)+W1(i+1,j)×PVORI(i+1,j)+W1(i+1,j+1)×PVORI(i+1,j+1))/WSUM (6)PV EPF (i,j)=((W SUM -W1 NBR )×PV ORI (i,j)+W1(i-1,j-1)×PV ORI (i-1,j-1)+W1( i-1,j)×Pv ORI (i-1,j)+W1(i-1,j+1)×PV ORI (i-1,j+1)+W1(i,j-1)×PV ORI (i,j-1)+W1(i,j+1)×PV ORI (i,j+1)+W1(i+1,j-1)×PV ORI (i+1,j-1) +W1(i+1,j)×PV ORI (i+1,j)+W1(i+1,j+1)×PV ORI (i+1,j+1))/W SUM (6)
其中,in,
W1NBR=W1(i-1,j-1)+W1(i-1,j)+W1(i-1,j+1)+W1(i,j-1)+W1(i,j+1)+W1(i+1,j-1)+W1(i+1,j)+W1(i+1,j+1) (7)W1 NBR =W1(i-1,j-1)+W1(i-1,j)+W1(i-1,j+1)+W1(i,j-1)+W1(i,j+1 )+W1(i+1, j-1)+W1(i+1, j)+W1(i+1, j+1) (7)
事实上,步骤S820~S830是一种具有边缘保护机制的有限脉冲响应(finiteimpulse response,FIR)滤波处理。目标像素的边缘保护低通滤波值PVEPF(i,j)储存至记忆体710中以供之后的滤波程序使用。In fact, steps S820-S830 are a finite impulse response (finiteimpulse response, FIR) filtering process with an edge protection mechanism. The edge protection low-pass filter value PV EPF (i, j) of the target pixel is stored in the
接下来,在步骤S840及S850中,权重计算电路740及滤波电路750对边缘保护低通滤波值PVEPF(i,j)进一步进行IIR滤波处理,以得到目标像素的IIR滤波值PVIIR(i,j)。也就是说,步骤S840及S850实质上与步骤S320及S330相同,差别在于权重计算电路740及滤波电路750是使用目标像素的边缘保护低通滤波值PVEPF(i,j),而非原始像素值PVORI(I(i,j)。类似地,权重计算电路740的一实施例的功能方块图如图5所示,在步骤S840中,输入像素相似度计算电路510的像素值PVtar及像素值PVref是分别为目标像素P(i,j)的边缘保护低通滤波值PVEPF(i,j)以及参考像素的IIR滤波值PVIIR。得到每一参考像素的一第二权重W2后(类似地,权重W2与两像素之间的相似度有关),滤波电路750依据算式(8)计算目标像素的IIR滤波值。Next, in steps S840 and S850, the
PVIIR(i,j)=((WSUM-W2XBR)×PVEPF(i,j)+∑(W2×PVIIR)/WSUM (8)PV IIR (i, j)=((W SUM -W2 XBR )×PV EPF (i, j)+∑(W2×PV IIR )/W SUM (8)
算式(8)与算式(2)相似,不再赘述。其中,W2NBR为所有参考像素的第二权重W2的总和,以图4为例,The formula (8) is similar to the formula (2) and will not be repeated here. Among them, W2 NBR is the sum of the second weights W2 of all reference pixels. Taking FIG. 4 as an example,
W2NBR=W2(i-1,j)+W2(i,j-1) (9)W2 NBR =W2(i-1,j)+W2(i,j-1) (9)
图7及图8的实施例对影像进行两次滤波处理,第一次由权重计算电路720及滤波电路730执行(对应步骤S820~S830),第二次由权重计算电路740及滤波电路750执行(对应步骤S840~S850)。第二次滤波处理的机制与前一实施例(对应图2及图3)的滤波处理的机制相似,而第一次滤波处理的目的在于进一步去除影像的高频杂讯,使影像更为清晰。图7及图8的实施例的两次滤波处理皆实作边缘保护的机制,亦即第一权重及第二权重皆为边缘保护权重,因此所得到的滤波结果可有效抑制影像拖曳现象,以防止色彩失真及边缘模糊。图7及图8的实施例的第一次滤波处理的参考像素包含第二次滤波处理的参考像素;举例来说,如图9及图4所示,图4的两个参考像素(P(i-1,j)及P(i,j-1))为图9的八个参考像素的一部分。The embodiments of FIGS. 7 and 8 perform two filtering processes on the image, the first time is performed by the
本发明以两个门槛值决定像素相似度的容许范围,因此能简易且有效地在影像拖曳现象的抑制程度及杂讯的去除程度之间取得较佳权衡(trade-off)。详言之,当第一及第二门槛值被同时调低时,参考像素必须更近似目标像素才能被给予最高权重Wmax,因此有助于抑制影像拖曳现象(亦即加强影像的边缘保护);而当第一及第二门槛值被同时调高时,参考像素有更大的机率被给予最高权重Wmax,因此有助于杂讯的去除(亦即使影像更为清晰)。提高第一及第二门槛值的差值使滤波处理在抑制影像拖曳现象及去除杂讯两者之间有更佳及更适应性的操作弹性。The present invention uses two threshold values to determine the allowable range of pixel similarity, so that a better trade-off can be achieved easily and effectively between the degree of image dragging phenomenon suppression and the degree of noise removal. Specifically, when the first and second thresholds are simultaneously lowered, the reference pixel must be closer to the target pixel in order to be given the highest weight Wmax, thus helping to suppress the image dragging phenomenon (that is, enhancing the edge protection of the image); When the first and second thresholds are simultaneously increased, the reference pixel has a higher probability of being given the highest weight Wmax, thus helping to remove noise (ie, make the image clearer). Increasing the difference between the first and second thresholds enables the filtering process to have better and more adaptive operational flexibility between suppressing the image dragging phenomenon and removing noise.
本发明的权重计算电路及滤波电路可以由加法器、减法器、乘法器、除法器、比较器、多工器、逻辑电路等元件组合而成。图7的权重计算电路720及权重计算电路740可以是同一套硬体电路或是独立的硬体电路,滤波电路730及滤波电路750可以是同一套硬体电路或是独立的硬体电路。本发明影像处理装置及影像处理方法适用于各种色彩格式(例如RGB通道、YUV通道、灰阶影像等)的影像,色彩格式的各通道是独立处理,因此边缘保护的机制(即实作边缘保护权重)有助于避免色彩失真现象的发生。The weight calculation circuit and filter circuit of the present invention can be composed of adders, subtractors, multipliers, dividers, comparators, multiplexers, logic circuits and other elements. The
由于本技术领域具有通常知识者可藉由本案的装置发明的揭露内容来了解本案的方法发明的实施细节与变化,因此,为避免赘文,在不影响该方法发明的揭露要求及可实施性的前提下,重复的说明在此予以节略。请注意,前揭图示中,元件的形状、尺寸、比例以及步骤的顺序等仅为示意,是供本技术领域具有通常知识者了解本发明之用,非用以限制本发明。Since a person with ordinary knowledge in the technical field can understand the implementation details and changes of the method invention in this application through the disclosure content of the device invention in this application, in order to avoid redundant repetition, the disclosure requirements and practicability of the method invention are not affected. On the premise, repeated descriptions are omitted here. Please note that the shapes, sizes, ratios, and steps of the components in the preceding figures are only schematic representations, which are for those skilled in the art to understand the present invention, and are not intended to limit the present invention.
虽然本发明的实施例如上所述,然而该些实施例并非用来限定本发明,本技术领域具有通常知识者可依据本发明的明示或隐含的内容对本发明的技术特征施以变化,凡此种种变化均可能属于本发明所寻求的专利保护范畴,换言之,本发明的专利保护范围须视本说明书的申请专利范围所界定者为准。Although the embodiments of the present invention are described above, these embodiments are not intended to limit the present invention. Those skilled in the art can change the technical features of the present invention according to the explicit or implicit contents of the present invention. All such changes may belong to the scope of patent protection sought by the present invention, in other words, the scope of patent protection of the present invention shall be determined by the scope of the patent application in this specification.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810062839.6A CN110072034B (en) | 2018-01-23 | 2018-01-23 | Image processing method and image processing device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810062839.6A CN110072034B (en) | 2018-01-23 | 2018-01-23 | Image processing method and image processing device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110072034A CN110072034A (en) | 2019-07-30 |
CN110072034B true CN110072034B (en) | 2021-10-08 |
Family
ID=67364818
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810062839.6A Active CN110072034B (en) | 2018-01-23 | 2018-01-23 | Image processing method and image processing device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110072034B (en) |
Family Cites Families (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4086479B2 (en) * | 2001-03-23 | 2008-05-14 | Necディスプレイソリューションズ株式会社 | Image quality improving apparatus and image quality improving method |
US7822285B2 (en) * | 2004-05-20 | 2010-10-26 | Omnivision Technologies, Inc. | Methods and systems for locally adaptive image processing filters |
US7769089B1 (en) * | 2004-12-02 | 2010-08-03 | Kolorific, Inc. | Method and system for reducing noise level in a video signal |
CN100559836C (en) * | 2007-09-20 | 2009-11-11 | 宝利微电子系统控股公司 | A Noise Reduction Method for Digital Image |
KR101517233B1 (en) * | 2008-08-12 | 2015-05-15 | 엘지전자 주식회사 | Apparatus for removing noise using moving estimation |
JP2013059016A (en) * | 2011-08-12 | 2013-03-28 | Sony Corp | Image processing device, method, and program |
CN104067611B (en) * | 2012-01-24 | 2016-08-24 | 索尼公司 | Image processing equipment, image processing method and image processing apparatus |
CN103581507A (en) * | 2013-08-21 | 2014-02-12 | 成都云鹰科技有限公司 | Method dynamically adjusting threshold value through mean square error in de-noising algorithm |
KR102105102B1 (en) * | 2013-10-10 | 2020-04-27 | 삼성전자주식회사 | Display device and method thereof |
CN103871031A (en) * | 2014-03-07 | 2014-06-18 | 西安电子科技大学 | Kernel regression-based SAR image coherent speckle restraining method |
CN107317959B (en) * | 2016-04-26 | 2020-01-14 | 瑞昱半导体股份有限公司 | Image filtering device and image filtering method thereof |
-
2018
- 2018-01-23 CN CN201810062839.6A patent/CN110072034B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN110072034A (en) | 2019-07-30 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN100566379C (en) | Motion detection device and utilize the sound attenuation of this device | |
Vijaykumar et al. | Fast switching based median–mean filter for high density salt and pepper noise removal | |
KR101327789B1 (en) | Method and apparatus for reducing various noises of image simultaneously | |
CN109389560B (en) | Adaptive weighted filtering image noise reduction method and device and image processing equipment | |
CN111127359B (en) | Underwater image enhancement method based on selective compensation of colors and three-interval equalization | |
KR100532121B1 (en) | Method and apparatus for image detail enhancement | |
TW200535717A (en) | Directional video filters for locally adaptive spatial noise reduction | |
JP5095860B2 (en) | Isolated edge enhancement architecture | |
JP5767064B2 (en) | Image edge enhancement method | |
CN108961170A (en) | Image processing method, device and system | |
JP2015062270A (en) | Image processing apparatus | |
JP5105286B2 (en) | Image restoration apparatus, image restoration method, and image restoration program | |
US9715720B1 (en) | System and method for reducing image noise | |
CN102761683B (en) | Multi-picture image noise reduction method | |
TWI712989B (en) | Image processing method and image processing device | |
CN101354783B (en) | Method and apparatus for detecting edge | |
JPH1117954A (en) | Video signal processing device | |
CN114298936A (en) | Noise reduction and sharpening combined processing method and device | |
CN110072034B (en) | Image processing method and image processing device | |
KR101101434B1 (en) | Image Clarity Enhancer | |
WO2013161838A1 (en) | Image processing method and image processing device | |
JP2004236185A (en) | Signal processor and method, recording medium, and program | |
JPWO2017183273A1 (en) | Image processing device | |
JP2003087605A (en) | Noise reduction device, noise reduction method, medium, and program | |
JP4650372B2 (en) | Video processing circuit |
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 |