[go: up one dir, main page]

CN1700775A - A Method and Apparatus for Determining the Edge Trend of a Pixel of Interest - Google Patents

A Method and Apparatus for Determining the Edge Trend of a Pixel of Interest Download PDF

Info

Publication number
CN1700775A
CN1700775A CN200410042308.9A CN200410042308A CN1700775A CN 1700775 A CN1700775 A CN 1700775A CN 200410042308 A CN200410042308 A CN 200410042308A CN 1700775 A CN1700775 A CN 1700775A
Authority
CN
China
Prior art keywords
pixel
interest
edge
trend
surrounding
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
CN200410042308.9A
Other languages
Chinese (zh)
Other versions
CN100399834C (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.)
Altek Corp
Original Assignee
Altek Corp
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 Altek Corp filed Critical Altek Corp
Priority to CNB2004100423089A priority Critical patent/CN100399834C/en
Publication of CN1700775A publication Critical patent/CN1700775A/en
Application granted granted Critical
Publication of CN100399834C publication Critical patent/CN100399834C/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Image Processing (AREA)

Abstract

一种决定一感兴趣像素的边缘趋势的方法与装置,应用于彩色滤光片影像阵列内插系统中,其先判断在该感兴趣像素的周围像素为水平趋势或垂直趋势,跟着统计该周围像素中具有水平趋势者的数目及具有垂直趋势者的数目,再由其中数目较多者的趋势决定该感兴趣像素的边缘趋势。

Figure 200410042308

A method and device for determining the edge trend of a pixel of interest are applied to a color filter image array interpolation system. The method first determines whether the surrounding pixels of the pixel of interest have a horizontal trend or a vertical trend, then counts the number of pixels with horizontal trends and the number of pixels with vertical trends among the surrounding pixels, and then determines the edge trend of the pixel of interest based on the trend of the pixel with the larger number.

Figure 200410042308

Description

一种决定一感兴趣像素的边缘趋势的方法与装置A Method and Apparatus for Determining the Edge Trend of a Pixel of Interest

技术领域technical field

本发明是有关一种影像阵列内插法,特别是关于一种在彩色滤光片影像阵列内插系统(Color Filter Array Interpolation;CFAI)中决定一感兴趣像素的边缘趋势(edge trend)的方法与装置。The present invention relates to an image array interpolation method, in particular to a method for determining an edge trend (edge trend) of a pixel of interest in a color filter array interpolation system (Color Filter Array Interpolation; CFAI) with the device.

技术背景technical background

彩色影像可以利用单一的感测器阵列来取得。这种感测器在其阵列中的每一像素位置仅感测单一色彩而产生一色彩值,但是每一像素位置遗失的其它色彩的色彩值利用其邻近像素位置的色彩值内插而产生,因而获得全彩的重建影像。具有特定对应各色彩值的像素位置排列图样(Pattern)的感测器使此种额外色彩值的内插变得容易且有效率。例如在颁给Bayer的美国专利第3,971,065号中的彩色影像阵列,其主导整个影像的色彩是由交错排列的像素位置来感测,其它的像素位置则分别感测另外的两种色彩。此类技巧应用在目前的单一感测器照相机中,其感测器上重叠一特定图样的彩色滤光片阵列,使得该感测器的每一像素位置仅产生对应红色、彩色或蓝色的单一色彩值的讯号。换言之,该感测器所产生的原始影像平面虽然包含红色、绿色及蓝色三种色彩,但是每一像素位置却只有单一色彩的色彩值。为重建全彩的影像,习知的CFAI演算法转换该原始影像平面,使每一像素位置包含红色、绿色及蓝色三个色彩信息的影像平面。因参考邻近像素位置的色彩值计算感兴趣像素位置所遗失的色彩值,因此,所使用的CFAI法将决定最终重建所得的全彩影像的品质。Color images can be obtained using a single sensor array. This sensor senses only a single color at each pixel location in its array to produce a color value, but the color values of the other colors that are missing at each pixel location are generated by interpolation of the color values at its neighboring pixel locations, A full-color reconstructed image is thus obtained. A sensor with a specific pattern of pixel positions corresponding to each color value facilitates and efficiently interpolates such additional color values. For example, in the color image array of US Pat. No. 3,971,065 issued to Bayer, the color that dominates the entire image is sensed by staggered pixel positions, and the other pixel positions sense the other two colors respectively. Such techniques are used in today's single-sensor cameras, where the sensor is overlaid with an array of color filters in a specific pattern so that each pixel position on the sensor produces only the corresponding red, colored or blue color. A signal of a single color value. In other words, although the original image plane generated by the sensor contains three colors of red, green and blue, each pixel position has only a single color value. To reconstruct a full-color image, the conventional CFAI algorithm transforms the original image plane so that each pixel position contains an image plane with three color information of red, green and blue. Since the lost color value of the pixel position of interest is calculated with reference to the color values of adjacent pixel positions, the CFAI method used will determine the quality of the final reconstructed full-color image.

最简单且直接的内插法为双线性(bilinear)内插法,其是将感兴趣像素位置的邻近像素位置的色彩值平均后作为该感兴趣像素位置的色彩值。然而,此种植基于非边缘(non-edged based)的CFAI法会在彩色影像的边缘产生假影,因而损失解析度。另一种植基于边缘的CFA1法可以降低彩色影像边缘的假影效应,因而改善影像的精锐度(Sharpness)。植基于边缘的CFAI法是先判断影像在感兴趣像素位置处的边缘趋势为水平趋势或垂直趋势,再决定采用水平或垂直方向上的邻近像素位置的色彩值进行内插运算,因此,正确地判断影像在感兴趣像素位置处为水平趋势或垂直趋势将决定内插的色彩值是否产生较佳的影像品质。感兴趣像素位置的边缘趋势可由该位置处的色彩值梯度来决定。例如,在图1中显示一6×6的像素阵列10,其中R、G及B分别表示红色、绿色及蓝色三种色彩的色彩值,其下标表示该像素位置的坐标,在括号中的色彩值表示是由内插法产生的,例如在像素(4,3)位置上原本仅存在蓝色色彩值B43,其绿色色彩值G43是从邻近像素位置的色彩值内插而产生。在一习知的CFAI法中,要内插G43时,先计算像素(4,3)位置上的水平及垂直梯度The simplest and direct interpolation method is a bilinear interpolation method, which averages the color values of adjacent pixel positions of the pixel position of interest to obtain the color value of the pixel position of interest. However, this non-edge based CFAI method produces artifacts at the edges of the color image, thus losing resolution. Another edge-based CFA1 method can reduce the artifact effect of the edge of the color image, thereby improving the sharpness of the image (Sharpness). The edge-based CFAI method first judges whether the edge trend of the image at the pixel position of interest is a horizontal trend or a vertical trend, and then decides to use the color values of adjacent pixel positions in the horizontal or vertical direction for interpolation operations. Therefore, correctly Determining whether the image is trending horizontally or vertically at the pixel of interest will determine whether the interpolated color values produce better image quality. The edge tendency at a pixel location of interest can be determined by the color value gradient at that location. For example, a 6×6 pixel array 10 is shown in FIG. 1, wherein R, G and B respectively represent the color values of three colors of red, green and blue, and the subscripts represent the coordinates of the pixel position. The color value representation of is generated by interpolation. For example, there is only blue color value B 43 at the pixel (4, 3) position, and its green color value G 43 is generated by interpolation from the color values of adjacent pixel positions. . In a conventional CFAI method, when G 43 is to be interpolated, the horizontal and vertical gradients at the position of pixel (4, 3) are first calculated

ΔH=|G42-G44|+|B43-B41+B43-B45|+|G33-G32+G33-G34|,    公式1及ΔH=|G 42 -G 44 |+|B 43 -B 41 +B 43 -B 45 |+|G 33 -G 32 +G 33 -G 34 |, Formula 1 and

ΔV=|G33-G53|+|B43-B23+B43-B63|+|G32-G42-G34-G44|,    公式2ΔV=|G 33 -G 53 |+|B 43 -B 23 +B 43 -B 63 |+|G 32 -G 42 -G 34 -G 44 |, formula 2

假如ΔH<ΔV,则认为像素(4,3)位置上的边缘趋势为沿着水平方向,因此以水平方向上的邻近像素位置的色彩值内插G43,例如:If ΔH<ΔV, it is considered that the edge at the position of pixel (4,3) tends to be along the horizontal direction, so G 43 is interpolated with the color values of adjacent pixel positions in the horizontal direction, for example:

G43=(G42+G44)÷2                                              公式3G 43 =(G 42 +G 44 )÷2 Formula 3

假如ΔH>ΔV,则认为像素(4,3)位置上的边缘趋势为沿着垂直方向,因此以垂直方向上的邻近像素位置的色彩值内插G43,例如:If ΔH>ΔV, it is considered that the edge trend at the pixel (4,3) position is along the vertical direction, so G 43 is interpolated with the color values of adjacent pixel positions in the vertical direction, for example:

G43=(G33+G53)÷2                                              公式4G 43 =(G 33 +G 53 )÷2 Formula 4

此法在边缘趋势极明显时简单且有效,然而,当水平梯度ΔH及垂直梯度ΔV的值相近时,便容易发生判断错误的结果,特别是在杂讯较大时会导致趋势方向的误判。这种方法的另一个缺点是经常在影像上产生十字星号,例如在人体脸部的鼻头影像上产生十字星号。This method is simple and effective when the edge trend is very obvious. However, when the values of the horizontal gradient ΔH and vertical gradient ΔV are similar, it is easy to make wrong judgments, especially when the noise is large, it will lead to misjudgment of the direction of the trend . Another disadvantage of this method is that crosses are often generated on images, for example, crosses are generated on nose images of human faces.

因此,一种在CFAI系统中决定一感兴趣像素的边缘趋势的改良的方法与装置,乃为所冀。Accordingly, an improved method and apparatus for determining the edge trend of a pixel of interest in a CFAI system is desired.

发明内容Contents of the invention

本发明的目的之一,在于提供一种在CFAI系统中决定一感兴趣像素的边缘趋势的方法与装置,其是藉由该感兴趣像素的周围像素的水平及垂直趋势来决定该感兴趣像素的边缘趋势。One of the objectives of the present invention is to provide a method and device for determining the edge trend of a pixel of interest in the CFAI system, which determines the pixel of interest by the horizontal and vertical trends of the surrounding pixels of the pixel of interest marginal trend.

本发明的另一目的,在于提供一种在CFAI系统中决定一感兴趣像素的边缘趋势的方法与装置,在该感兴趣像素处的水平梯度及垂直梯度的值接近时,仍可正确地判断该感兴趣像素的边缘趋势。Another object of the present invention is to provide a method and device for determining the edge trend of a pixel of interest in the CFAI system, which can still correctly determine when the values of the horizontal gradient and the vertical gradient at the pixel of interest are close The edge trend of the pixel of interest.

根据本发明,一种在CFAI系统中决定一感兴趣像素的边缘趋势的方法是先判断在该感兴趣像素位置的各个周围像素为水平或垂直趋势,其包括计算每一该周围像素在二对角方向上的色彩值的差值,再由该二差值的乘积为正值或负值来判断该周围像素为水平或垂直趋势,以及统计具有水平趋势的周围像素的数目与具有垂直趋势的周围像素的数目,当具有水平趋势的周围像素的数目大于具有垂直趋势的周围像素的数目时,则决定该感兴趣像素的边缘趋势为沿着水平方向,反之,则决定该感兴趣像素的边缘趋势为沿着垂直方向。According to the present invention, a method for determining the edge trend of a pixel of interest in the CFAI system is to first determine whether each surrounding pixel at the pixel of interest is a horizontal or vertical trend, which includes calculating each of the surrounding pixels in two pairs The difference between the color values in the angular direction, and then the product of the two differences is positive or negative to determine whether the surrounding pixels are horizontal or vertical, and count the number of surrounding pixels with a horizontal trend and the number of pixels with a vertical trend The number of surrounding pixels, when the number of surrounding pixels with a horizontal trend is greater than the number of surrounding pixels with a vertical trend, the edge trend of the pixel of interest is determined to be along the horizontal direction, otherwise, the edge of the pixel of interest is determined The trend is along the vertical direction.

执行上述方法的装置包括处理器及缓冲器,以该感兴趣像素为中心的一个像素阵列的原始色彩值储存在该缓冲器中,该处理器从该缓冲器中分别读取该各个周围像素在二对角方向上的色彩值并计算出该等差值的乘积储存至该缓冲器中,再统计该等乘积中的正值乘积及负值乘积的数目,比较此二数目的大小判断该感兴趣像素的边缘趋势为沿着水平或垂直方向。The device for performing the above method includes a processor and a buffer, the original color value of a pixel array centered on the pixel of interest is stored in the buffer, and the processor reads the values of the surrounding pixels from the buffer respectively. The color values in the two diagonal directions are calculated and the product of the difference is stored in the buffer, and then the number of positive value products and negative value products in these products is counted, and the size of the two numbers is compared to judge the sense. The edge trend of the pixel of interest is along the horizontal or vertical direction.

经由本发明所提供的方法及装置,即使在一个像素处的水平梯度及垂直梯度相等或接近,本发明也能够正确地判断在该像素处的边缘趋势。Through the method and device provided by the present invention, even if the horizontal gradient and the vertical gradient at a pixel are equal or close, the present invention can correctly judge the edge trend at the pixel.

附图说明Description of drawings

图1显示一6×6的像素阵列;Figure 1 shows a 6×6 pixel array;

图2显示以想要内插产生绿色色彩值G33的像素(3,3)为中心的5×5像素阵列的绿色色彩值;Fig. 2 shows the green color value of a 5x5 pixel array centered on the pixel (3,3) which is desired to be interpolated to produce the green color value G 33 ;

图3A显示以图2中像素(2,3)为中心的3×3阵列的绿色色彩值;Figure 3A shows the green color values of a 3x3 array centered on pixel (2,3) in Figure 2;

图3B显示以图2中像素(3,2)为中心的3×3阵列的绿色色彩值;Figure 3B shows the green color values of a 3x3 array centered on pixel (3,2) in Figure 2;

图3C显示以图2中像素(3,4)为中心的3×3阵列的绿色色彩值;FIG. 3C shows the green color value of a 3×3 array centered on pixel (3,4) in FIG. 2;

图3D显示以图2中像素(4,3)为中心的3×3阵列的绿色色彩值;Figure 3D shows the green color values of a 3x3 array centered on pixel (4,3) in Figure 2;

图4是一个执行内插G33的装置;Fig. 4 is a device for performing interpolation G 33 ;

图5是一个执行内插G33的流程图。Fig. 5 is a flowchart for performing the interpolation G33 .

图号说明Description of figure number

10   6×6的像素阵列10 6×6 pixel array

20   5×5的像素阵列20 5×5 pixel array

22   以像素(2,3)为中心的3×3阵列22 A 3×3 array centered on pixel (2, 3)

24   以像素(3,2)为中心的3×3阵列24 A 3×3 array centered at pixel (3, 2)

26   以像素(3,4)为中心的3×3阵列26 3×3 array centered on pixel (3,4)

28   以像素(4,3)为中心的3×3阵列28 3×3 array centered on pixel (4, 3)

30   执行内插G33的装置30 Means for performing interpolation G 33

32   处理器32 processors

34   缓冲器34 buffer

34a  缓冲器34的区段34a section of buffer 34

34b  缓冲器34的区段34b section of buffer 34

34c  缓冲器34的区段34c Section of buffer 34

34d  缓冲器34的区段34d Section of buffer 34

34e  缓冲器34的区段34e Section of buffer 34

34f  缓冲器34的区段34f Section of buffer 34

40   计算感兴趣像素(3,3)的水平梯度ΔH及垂直梯度ΔV40 Calculate the horizontal gradient ΔH and vertical gradient ΔV of the pixel of interest (3, 3)

42   判断水平梯度ΔH与垂直梯度ΔV的差值的绝对值是否小于临界值TH42 Judging whether the absolute value of the difference between the horizontal gradient ΔH and the vertical gradient ΔV is less than the critical value TH

44   判断水平梯度ΔH是否大于垂直梯度ΔV44 Determine whether the horizontal gradient ΔH is greater than the vertical gradient ΔV

46   判断感兴趣像素(3,3)的周围像素G23、G32、G34及G43的趋势46 Determine the trend of the surrounding pixels G 23 , G 32 , G 34 and G 43 of the pixel of interest (3, 3)

48   统计周围像素G23、G32、G34及G43的水平及垂直趋势的数目48 Count the number of horizontal and vertical trends of surrounding pixels G 23 , G 32 , G 34 and G 43

50  判断具有水平趋势的数目是否大于具有垂直趋势的数目50 Determine whether the number with a horizontal trend is greater than the number with a vertical trend

52  感兴趣像素(3,3)为水平趋势52 Pixels of interest (3, 3) are horizontal trends

54  判断具有水平趋势的数目是否小于具有垂直趋势的数目54 Determine whether the number with a horizontal trend is smaller than the number with a vertical trend

56  感兴趣像素(3,3)为垂直趋势56 pixels of interest (3, 3) are vertical trends

58  以双线性内插法求得想要内插给感兴趣像素(3,3)的绿色色彩值G33 58 Use bilinear interpolation to find the green color value G that you want to interpolate to the pixel of interest (3, 3) 33

具体实施方式Detailed ways

本发明的方法是先判断在一感兴趣像素位置的周围像素为水平趋势或垂直趋势,统计该等周围像素中具有水平趋势者的数目及具有垂直趋势者的数目,比较两者数目的多寡而决定该感兴趣像素的边缘趋势为沿着水平方向或垂直方向。为清楚说明本方法,图2提供一5×5像素阵列20,其中心像素(3,3)位置的绿色色彩值G33是想要藉由内插运算产生,阵列20中的其它绿色色彩值Gxy是由影像感测器直接产生的原始色彩值,用来判断感兴趣像素(3,3)的边缘趋势。首先判断感兴趣像素(3,3)的周围像素(2,3)、(3,2)、(3,4)及(4,3)为水平或垂直趋势,在判断这4个像素的趋势时,为方便了解,各以其为中心将相关的色彩值从阵列20中简化为图3A、图3B、图3C及图3D,图3A显示以像素(2,3)为中心的3×3阵列的绿色色彩值,图3B显示以像素(3,2)为中心的3×3阵列的绿色色彩值,图3C显示以像素(3,4)为中心的3×3阵列的绿色色彩值,图3D显示以像素(4,3)为中心的3×3阵列的绿色色彩值。The method of the present invention is to first judge that the surrounding pixels at a pixel of interest are of horizontal trend or vertical trend, count the number of those with horizontal trend and the number of those with vertical trend in these surrounding pixels, compare the number of the two and obtain Determine whether the edge trend of the pixel of interest is along the horizontal direction or the vertical direction. To clearly illustrate this method, FIG. 2 provides a 5×5 pixel array 20, the green color value G 33 at the center pixel (3, 3) position is intended to be generated by interpolation, and other green color values in the array 20 G xy is the original color value directly generated by the image sensor, and is used to judge the edge tendency of the pixel of interest (3, 3). First, it is judged that the surrounding pixels (2, 3), (3, 2), (3, 4) and (4, 3) of the pixel of interest (3, 3) are in a horizontal or vertical trend. 3A, 3B, 3C, and 3D, each of which is centered on the relevant color values from the array 20 for easy understanding, and Fig. 3A shows a 3×3 The green color value of the array, Figure 3B shows the green color value of the 3×3 array centered on the pixel (3,2), and Figure 3C shows the green color value of the 3×3 array centered on the pixel (3,4), Figure 3D shows a 3x3 array of green color values centered at pixel (4,3).

在图3A中,要判断像素(2,3)的趋势时,先计算在对角线方向上的像素(1,2)及(3,4)的绿色色彩值G12及G34的差值In Fig. 3A, when judging the trend of pixel (2, 3), first calculate the difference between the green color values G 12 and G 34 of pixels (1, 2) and (3, 4) in the diagonal direction

Δ1=G12-G34,                                         公式5Δ1=G 12 -G 34 , Formula 5

以及在另一对角线方向上的像素(1,4)及(3,2)的绿色色彩值G14及G32的差值and the difference between the green color values G 14 and G 32 of pixels (1, 4) and (3, 2) in the other diagonal direction

Δ2=G14-G32,                                         公式6Δ2=G 14 -G 32 , formula 6

再将此二插值Δ1,Δ2相乘得到Then multiply the two interpolation values Δ 1 and Δ 2 to get

Buffer1=(G12-G34)×(G14-G32),                     公式7Buffer 1 = (G 12 -G 34 )×(G 14 -G 32 ), Formula 7

当Buffer1>0时,像素(2,3)具有水平趋势;When Buffer 1 > 0, the pixel (2, 3) has a horizontal trend;

当Buffer1<0时,象素(2,3)具有垂直趋势。When Buffer 1 <0, pixel (2, 3) has a vertical trend.

换言之,在像素(2,3)的二对角线方向上的色彩值梯度值的乘积的正负号被用来判断像素(2,3)的趋势。In other words, the sign of the product of the color value gradient values in the two diagonal directions of the pixel (2, 3) is used to judge the trend of the pixel (2, 3).

在图3B中,如同前述,要判断像素(3,2)的趋势时,先计算在二对角线方向上的绿色色彩值G21及G43的差值与G23及G41的差值,再求其乘积In Fig. 3B, as mentioned above, when judging the trend of pixel (3, 2), first calculate the difference between the green color values G 21 and G 43 and the difference between G 23 and G 41 in the two diagonal directions , and then find its product

Buffer2=(G21-G43)×(G23-G41),                         公式8Buffer 2 = (G 21 -G 43 )×(G 23 -G 41 ), formula 8

当Buffer2>0时,像素(3,2)具有水平趋势;When Buffer 2 > 0, the pixel (3, 2) has a horizontal trend;

当Buffer2<0时,像素(3,2)具有垂直趋势。When Buffer 2 <0, pixel (3, 2) has a vertical trend.

同样的,从图3C及图3D分别得到Similarly, from Figure 3C and Figure 3D respectively

Buffer3=(G23-G45)×(G25-G43),                         公式9Buffer 3 = (G 23 -G 45 )×(G 25 -G 43 ), Formula 9

当Buffer3>0时,像素(3,4)具有水平趋势;When Buffer 3 > 0, the pixel (3, 4) has a horizontal trend;

当Buffer3<0时,像素(3,4)具有垂直趋势。When Buffer 3 <0, pixel (3, 4) has a vertical trend.

以及as well as

Buffer4=(G32-G54)×(G34-G52),                         公式10Buffer 4 = (G 32 -G 54 )×(G 34 -G 52 ), Formula 10

当Buffer4>0时,像素(4,3)具有水平趋势;When Buffer 4 > 0, the pixel (4, 3) has a horizontal trend;

当Buffer4<0时,像素(4,3)具有垂直趋势。When Buffer 4 <0, pixel (4, 3) has a vertical trend.

在得到感兴趣像素(3,3)的周围像素(2,3)、(3,2)、(3,4)及(4,3)为水平或垂直趋势后,跟着统计这4个周围像素中具有水平趋势者的数目及具有垂直趋势者的数目,若具有水平趋势的周围像素的数目SI大于具有垂直趋势的周围像素的数目SV,则认为感兴趣像素(3,3)的边缘趋势为沿着水平方向,反之,若具有水平趋势的周围像素的数目SI小于具有垂直趋势的周围像素的数目SV,则认为感兴趣像素(3,3)的边缘趋势为沿着垂直方向。若SI与SV相等,则采用双线性内插法,平均像素G23、G32、G34及G43的色彩值做为像素(3,3)的绿色色彩值。After obtaining the horizontal or vertical trend of the surrounding pixels (2, 3), (3, 2), (3, 4) and (4, 3) of the pixel of interest (3, 3), follow the statistics of these 4 surrounding pixels The number of those with a horizontal trend and the number of those with a vertical trend, if the number of surrounding pixels S I with a horizontal trend is greater than the number S V of surrounding pixels with a vertical trend, then the edge of the pixel of interest (3, 3) is considered The trend is along the horizontal direction, on the contrary, if the number S I of the surrounding pixels with the horizontal trend is less than the number S V of the surrounding pixels with the vertical trend, it is considered that the edge trend of the pixel of interest (3, 3) is along the vertical direction . If S I and S V are equal, bilinear interpolation is used, and the average color value of pixels G 23 , G 32 , G 34 and G 43 is used as the green color value of pixel (3, 3).

图4是用来执行内插G33的装置30,其包括处理器32及缓冲器34。以像素(3,3)为中心的阵列20的原始色彩值先被储存至缓冲器34中,如区段34a所示,再进行上述的判断方法,由处理器32读取区段34a中的阵列20的原始色彩值进行差值与乘积等运算以及计数。为减少装置30的运算,在一实施例中,缓冲器34更包含一临界值TH,由输入SET预先决定,储存在缓冲器34的区段34b中,处理器32从缓冲器34的区段34a读取阵列20的原始色彩值,为像素(3,3)计算其色彩值的水平梯度ΔH及垂直梯度ΔV储存在缓冲器34的区段34c中,以及计算二者的差值|ΔH-ΔV|与临界值TH比较,如果|ΔH-ΔV|≥TH,则依照习知的方法判断感兴趣像素(3,3)的边缘趋势,由ΔH及ΔV的相对大小决定像素(3,3)的边缘趋势,只有在|ΔH-ΔV|<TH时,始进行公式7至10的运算。当|ΔH-ΔV|<TH时,处理器32从区段34a读取色彩值并依照公式7至10运算产生Buffer1至Buffer4,储存在缓冲器34的区段34d中,接着统计Buffer1至Buffer4中具有水平趋势的像素数目SI与具有垂直趋势的像素数目SV,储存在缓冲器34的区段34e中,比较SI与SV的大小后决定感兴趣像素(3,3)的边缘趋势,再根据区段34f中的内插公式计算G33,例如:FIG. 4 is an apparatus 30 for performing interpolation G 33 , which includes a processor 32 and a buffer 34 . The original color value of the array 20 centered on the pixel (3, 3) is first stored in the buffer 34, as shown in section 34a, and then the above-mentioned judgment method is performed, and the processor 32 reads the color value in the section 34a The original color values of the array 20 are subjected to operations such as difference and product and counting. In order to reduce the operation of the device 30, in one embodiment, the buffer 34 further includes a threshold value TH, which is predetermined by the input SET and stored in the section 34b of the buffer 34, and the processor 32 from the section of the buffer 34 34a reads the original color value of the array 20, calculates the horizontal gradient ΔH and the vertical gradient ΔV of the color value of the pixel (3, 3) and stores them in the section 34c of the buffer 34, and calculates the difference |ΔH- ΔV| is compared with the critical value TH, if |ΔH-ΔV|≥TH, then judge the edge trend of the pixel of interest (3, 3) according to the known method, and determine the pixel (3, 3) by the relative size of ΔH and ΔV The edge trend of , only when |ΔH-ΔV|<TH, the operation of formulas 7 to 10 will be performed. When |ΔH-ΔV|<TH, the processor 32 reads the color value from section 34a and generates Buffer 1 to Buffer 4 according to formulas 7 to 10, and stores them in section 34d of buffer 34, and then counts Buffer 1 The number S I of pixels with a horizontal trend and the number S V of pixels with a vertical trend in Buffer 4 are stored in the section 34e of the buffer 34, and the pixel of interest is determined after comparing the sizes of S I and S V (3, 3 ), then calculate G 33 according to the interpolation formula in section 34f, for example:

当SI>SV,G33=(G32+G34)÷2;                           公式11When S I >S V , G 33 =(G 32 +G 34 )÷2; Formula 11

当SI<SV,G33=(G23+G43)÷2;                           公式12When S I <S V , G 33 =(G 23 +G 43 )÷2; Formula 12

当SI=SV,G33=(G23+G32+G34+G43)÷4。                 公式13When S I =S V , G 33 =(G 23 +G 32 +G 34 +G 43 )÷4. Formula 13

区段34f中的内插公式可以藉输入F决定,这些内插公式可以采用习知的技术或其改良。在不同的实施例中,处理器32不计算ΔH及ΔV以及比较其差值与临界值TH,而是直接使用公式7至10计算Buffer1至Buffer4,完全由像素(3,3)的周围像素(2,3)、(3,2)、(3,4)及(4,3)的水平及垂直趋势决定像素(3,3)的边缘趋势。The interpolation formulas in section 34f can be determined by input F, and these interpolation formulas can use known techniques or modifications thereof. In a different embodiment, the processor 32 does not calculate ΔH and ΔV and compare the difference with the threshold value TH, but directly uses the formulas 7 to 10 to calculate Buffer 1 to Buffer 4 , completely from the surrounding of the pixel (3, 3) The horizontal and vertical trends of pixels (2,3), (3,2), (3,4) and (4,3) determine the edge trend of pixel (3,3).

一个执行上述作业的流程如图5所示,在为图2的像素(3,3)决定其边缘趋势时,首先处理器32在步骤40计算在像素(3,3)位置处的色彩值的水平梯度ΔH及垂直梯度ΔV,例如使用公式1及2,或者使用较简单的公式,例如,参照图2:A flow process for performing the above operations is shown in FIG. 5. When determining the edge tendency of the pixel (3, 3) in FIG. Horizontal gradient ΔH and vertical gradient ΔV, for example, use formulas 1 and 2, or use simpler formulas, for example, refer to Figure 2:

ΔH=|G34-G32|,                                         公式14ΔH=|G 34 −G 32 |, Formula 14

and

ΔV=|G43-G23|,                                         公式15ΔV=|G 43 −G 23 |, Formula 15

接着在步骤42判断二者的差值|ΔH-ΔV|是否小于临界值TH,若为否,则进行步骤44,进一步判断水平梯度ΔH与垂直梯度ΔV的相对大小,如果ΔH<ΔV,则认为在像素(3,3)处为水平趋势,在步骤52中采用对应的公式进行内插G33,例如公式11,如果ΔH>ΔV,则认为在像素(3,3)处为垂直趋势,在步骤56中采用对应的公式进行内插G33,例如公式12,假如在步骤42所得的结果为|ΔH-ΔV|<TH,则进行步骤46,依照公式7至10判断像素(3,3)的周围像素G23、G32、G34及G43的趋势,跟着在步骤48统计周围像素G23、G32、G34及G43中具有水平及垂直趋势者的数目SI及SV,接下来,步骤50及54是比较SI及SV的大小,当具有水平趋势的数目大于具有垂直趋势的数目,则表示在像素(3,3)处为水平趋势,至步骤52采用对应的公式进行内插G33,例如公式11,反之,当具有水平趋势的数目小于具有垂直趋势的数目,则表示在像素(3,3)处为垂直趋势,至步骤56采用对应的公式进行内插G33,例如公式12,若周围像素G23、G32、G34及G43中具有水平及垂直趋势者的数目SI及SV相等,则进行步骤58,如公式13,以双线性内插法计算给像素(3,3)的绿色色彩值G33。在不同的实施例中,不执行步骤40至44,而是直接从步骤46开始,完全由像素(3,3)的周围像素G23、G32、G34及G43中具有水平及垂直趋势者的数目SI及SV决定在像素(3,3)处为水平或垂直趋势。Then in step 42 it is judged whether the difference |ΔH-ΔV| of the two is less than the critical value TH, if not, proceed to step 44, further judge the relative size of the horizontal gradient ΔH and the vertical gradient ΔV, if ΔH<ΔV, then consider It is a horizontal trend at the pixel (3, 3), and in step 52, the corresponding formula is used to interpolate G 33 , such as formula 11. If ΔH>ΔV, then it is considered to be a vertical trend at the pixel (3, 3). In step 56, use the corresponding formula to interpolate G 33 , such as formula 12. If the result obtained in step 42 is |ΔH-ΔV| The trend of the surrounding pixels G 23 , G 32 , G 34 and G 43 , followed by counting the numbers S I and S V of those with horizontal and vertical trends in the surrounding pixels G 23 , G 32 , G 34 and G 43 in step 48, Next, steps 50 and 54 are to compare the size of S I and S V , when the number with horizontal trend is greater than the number with vertical trend, it means that it is a horizontal trend at the pixel (3,3) place, to step 52 to adopt the corresponding The formula interpolates G 33 , such as formula 11. On the contrary, when the number with the horizontal trend is less than the number with the vertical trend, it means that the pixel (3, 3) is a vertical trend, and the corresponding formula is used in step 56 for interpolation G 33 , such as formula 12, if the number S I and S V of those with horizontal and vertical trends in the surrounding pixels G 23 , G 32 , G 34 and G 43 are equal, then proceed to step 58, such as formula 13, with bilinear Interpolation calculates the green color value G33 for pixel (3,3). In a different embodiment, steps 40 to 44 are not performed, but directly from step 46, completely by the horizontal and vertical trends in the surrounding pixels G 23 , G 32 , G 34 and G 43 of pixel (3,3) The number of them S I and S V determines whether the trend is horizontal or vertical at pixel (3,3).

经由以上所例示的方法及装置,即使在一个像素处的水平梯度及垂直梯度相等或接近,本发明也能够正确地判断在该像素处的边缘趋势。Through the methods and devices exemplified above, even if the horizontal gradient and the vertical gradient at a pixel are equal or close, the present invention can correctly determine the edge tendency at the pixel.

以上对于本发明的较佳实施例所作的叙述是为阐明的目的,而无意限定本发明精确地所揭露的形式,基于以上的教导或从本发明的实施例学习而作修改或变化是可能的,实施例是为解说本发明的原理以及让熟悉该项技术者以各种实施例利用本发明在实际应用上而选择及叙述,本发明的技术思想企图由本案的申请专利范围及其均等来决定。The above descriptions of the preferred embodiments of the present invention are for the purpose of illustration, and are not intended to limit the precise disclosed form of the present invention. It is possible to modify or change based on the above teachings or learning from the embodiments of the present invention. The embodiment is to explain the principle of the present invention and to allow those familiar with the art to use various embodiments to select and describe the present invention in practical applications. Decide.

Claims (11)

1.一种在彩色滤光片影像阵列内插系统中决定一感兴趣像素的边缘趋势的方法,其特征在于包括下列步骤:1. A method for determining the edge tendency of a pixel of interest in a color filter image array interpolation system, characterized in that it comprises the following steps: 判断该感兴趣像素位置的周围像素的边缘趋势;Determine the edge trend of the surrounding pixels of the pixel of interest; 统计该周围像素中具有不同边缘趋势者的数目;以及Count the number of those with different edge tendencies among the surrounding pixels; and 比较该不同边缘趋势数目的多寡,由数目较多者的趋势决定该感兴趣像素的边缘趋势。The number of different edge trends is compared, and the trend of the one with the larger number determines the edge trend of the pixel of interest. 2.如权利要求1所述的在彩色滤光片影像阵列内插系统中决定一感兴趣像素的边缘趋势的方法,其特征在于:判断该感兴趣像素位置的周围像素的边缘趋势是包括水平趋势及垂直趋势。2. The method for determining an edge tendency of a pixel of interest in a color filter image array interpolation system as claimed in claim 1, wherein the edge tendency of the pixels surrounding the pixel of interest is determined to include horizontal Trends and Vertical Trends. 3.如权利要求1所述的在彩色滤光片影像阵列内插系统中决定一感兴趣像素的边缘趋势的方法,其特征在于该判断周围像素边缘趋势的步骤包括下列步骤:3. The method for determining the edge trend of a pixel of interest in a color filter image array interpolation system as claimed in claim 1, wherein the step of determining the edge trend of surrounding pixels comprises the following steps: 计算每一该周围像素位置在第一方向上色彩值的差值;calculating the difference of the color value of each surrounding pixel position in the first direction; 计算每一该周围像素位置在第二方向上色彩值的差值;以及calculating the difference in color value in the second direction for each of the surrounding pixel positions; and 根据该二差值的乘积为正值或为负值决定每一该周围像素的边缘趋势。The edge trend of each surrounding pixel is determined according to whether the product of the two difference values is positive or negative. 4.如权利要求3所述的在彩色滤光片影像阵列内插系统中决定一感兴趣像素的边缘趋势的方法,其特征在于:该第一方向与第二方向是彼此正交。4. The method for determining an edge tendency of a pixel of interest in a color filter image array interpolation system as claimed in claim 3, wherein the first direction and the second direction are orthogonal to each other. 5.如权利要求4所述的在彩色滤光片影像阵列内插系统中决定一感兴趣像素的边缘趋势的方法,其特征在于:该第一方向与第二方向是在对角线方向上。5. The method for determining an edge tendency of a pixel of interest in a color filter image array interpolation system as claimed in claim 4, wherein the first direction and the second direction are in a diagonal direction . 6.一种在彩色滤光片影像阵列内插系统中决定一感兴趣像素的边缘趋势的装置,其特征在于包括:6. A device for determining the edge trend of a pixel of interest in a color filter image array interpolation system, characterized in that it comprises: 一缓冲器,用以储存包含该感兴趣像素在内的像素阵列的色彩值;以及a buffer for storing the color values of the pixel array including the pixel of interest; and 一处理器,利用该像素阵列的色彩值计算而判断该感兴趣像素位置的周围像素边缘趋势,并统计该周围像素中具有不同边缘趋势者的数目,以决定该感兴趣像素的边缘趋势;A processor, using the color value calculation of the pixel array to determine the edge trend of the surrounding pixels of the pixel of interest, and counting the number of pixels with different edge trends in the surrounding pixels to determine the edge trend of the pixel of interest; 其中,该处理器是计算每一该周围像素位置在第一方向上及第二方向上色彩值的差值,再根据该二差值的乘积为正值或负值决定每一该周围像素边缘趋势。Wherein, the processor calculates the difference between the color values of each surrounding pixel position in the first direction and the second direction, and then determines the edge of each surrounding pixel according to whether the product of the two differences is positive or negative. trend. 7.一种在彩色滤光片影像阵列内插系统中决定一感兴趣像素的边缘趋势的方法,包括下列步骤:7. A method for determining the edge tendency of a pixel of interest in a color filter image array interpolation system comprising the steps of: 储存包含该感兴趣像素在内的像素阵列的色彩值;storing the color value of the pixel array including the pixel of interest; 利用该像素阵列的色彩值计算在该感兴趣像素处不同方向梯度值;calculating gradient values in different directions at the pixel of interest by using the color values of the pixel array; 计算在该不同方向色彩梯度值的差值;Calculate the difference between the color gradient values in the different directions; 比较该差值与一临界值,当该差值小于该临界值时,执行后续步骤;Comparing the difference with a critical value, when the difference is smaller than the critical value, performing subsequent steps; 判断该感兴趣像素位置的周围像素边缘趋势;Determine the edge trend of the surrounding pixels of the pixel of interest; 统计该周围像素中具有不同边缘趋势者的数目;以及Count the number of those with different edge tendencies among the surrounding pixels; and 比较该数目的多寡,由数目较多者的趋势决定该感兴趣像素的边缘趋势。Comparing the number, the trend of the one with the larger number determines the edge trend of the pixel of interest. 8.如权利要求7所述的在彩色滤光片影像阵列内插系统中决定一感兴趣像素的边缘趋势的方法,其中该判断周围像素边缘趋势的步骤包括下列步骤:8. The method for determining the edge trend of a pixel of interest in a color filter image array interpolation system as claimed in claim 7, wherein the step of determining the edge trend of surrounding pixels comprises the following steps: 计算每一该周围像素位置在第一方向上色彩值的差值;calculating the difference of the color value of each surrounding pixel position in the first direction; 计算每一该周围像素位置在第二方向上色彩值的差值;以及calculating the difference in color value in the second direction for each of the surrounding pixel positions; and 根据该二差值的乘积为正值或为负值决定每一该周围像素的边缘趋势。The edge trend of each surrounding pixel is determined according to whether the product of the two difference values is positive or negative. 9.如权利要求7所述的在彩色滤光片影像阵列内插系统中决定一感兴趣像素的边缘趋势的方法,其特征在于:判断该感兴趣像素位置的周围像素的不同方向梯度值是包括至少水平方向梯度值及垂直方向梯度值。9. The method for determining the edge tendency of a pixel of interest in the color filter image array interpolation system as claimed in claim 7, wherein the gradient values in different directions of the surrounding pixels of the pixel of interest are judged to be Including at least a gradient value in the horizontal direction and a gradient value in the vertical direction. 10.如权利要求8所述的在彩色滤光片影像阵列内插系统中决定一感兴趣像素的边缘趋势的方法,其特征在于:该第一方向与第二方向是在对角线方向上。10. The method for determining the edge trend of a pixel of interest in a color filter image array interpolation system as claimed in claim 8, wherein the first direction and the second direction are in a diagonal direction . 11.一种在彩色滤光片影像阵列内插系统中决定一感兴趣像素的边缘趋势的装置,其特征在于包括:11. A device for determining the edge trend of a pixel of interest in a color filter image array interpolation system, characterized in that it comprises: 一缓冲器,用以储存包含该感兴趣像素在内的像素阵列的色彩值;以及a buffer for storing the color values of the pixel array including the pixel of interest; and 一处理器,利用该像素阵列的色彩值计算在该感兴趣像素处不同方向梯度值的差值与一临界值比较,当该差值小于该临界值时,判断该感兴趣像素位置的周围像素边缘趋势,并统计该周围像素中具有不同边缘趋势者的数目,以决定该感兴趣像素的边缘趋势;A processor, using the color value of the pixel array to calculate the difference between the gradient values in different directions at the pixel of interest and compare it with a critical value, and when the difference is smaller than the critical value, determine the surrounding pixels of the pixel of interest edge trend, and count the number of people with different edge trends in the surrounding pixels to determine the edge trend of the pixel of interest; 其中,该处理器是计算每一该周围像素位置在第一方向上及第二方向上色彩值的差值,再根据该二差值的乘积为正值或负值决定每一该周围像素边缘趋势。Wherein, the processor calculates the difference between the color values of each surrounding pixel position in the first direction and the second direction, and then determines the edge of each surrounding pixel according to whether the product of the two differences is positive or negative. trend.
CNB2004100423089A 2004-05-17 2004-05-17 Method and device for determining edge trend of interested pixel Expired - Fee Related CN100399834C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2004100423089A CN100399834C (en) 2004-05-17 2004-05-17 Method and device for determining edge trend of interested pixel

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2004100423089A CN100399834C (en) 2004-05-17 2004-05-17 Method and device for determining edge trend of interested pixel

Publications (2)

Publication Number Publication Date
CN1700775A true CN1700775A (en) 2005-11-23
CN100399834C CN100399834C (en) 2008-07-02

Family

ID=35476603

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2004100423089A Expired - Fee Related CN100399834C (en) 2004-05-17 2004-05-17 Method and device for determining edge trend of interested pixel

Country Status (1)

Country Link
CN (1) CN100399834C (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100588263C (en) * 2005-12-28 2010-02-03 华晶科技股份有限公司 Pixel Color Information Reconstruction Method
CN101001387B (en) * 2006-01-11 2010-05-12 华晶科技股份有限公司 Method for judging minimum direction of image local information change by utilizing majority decision
CN101827273B (en) * 2009-03-02 2013-03-20 华晶科技股份有限公司 A color rendition method of image

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11122626A (en) * 1997-10-17 1999-04-30 Nikon Corp Image processing method, system and record medium recording image processing program
ID28202A (en) * 1998-05-08 2001-05-10 Matsushita Electric Ind Co Ltd EQUIPMENT TAKING A PICTURE OF SOLID STATE
JP2000069492A (en) * 1998-08-26 2000-03-03 Nikon Corp Interpolation processor and storage medium in which interpolation processing program is recorded
US7088392B2 (en) * 2001-08-27 2006-08-08 Ramakrishna Kakarala Digital image system and method for implementing an adaptive demosaicing method

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100588263C (en) * 2005-12-28 2010-02-03 华晶科技股份有限公司 Pixel Color Information Reconstruction Method
CN101001387B (en) * 2006-01-11 2010-05-12 华晶科技股份有限公司 Method for judging minimum direction of image local information change by utilizing majority decision
CN101827273B (en) * 2009-03-02 2013-03-20 华晶科技股份有限公司 A color rendition method of image

Also Published As

Publication number Publication date
CN100399834C (en) 2008-07-02

Similar Documents

Publication Publication Date Title
CN1812592A (en) Method and apparatus for processing image data of a color filter array
JP5395053B2 (en) Edge mapping using panchromatic pixels
JP5260635B2 (en) Noise-reduced color image using panchromatic image
TWI516132B (en) An image processing apparatus, an image processing method, and a program
JP5291084B2 (en) Edge mapping incorporating panchromatic pixels
CN1968422A (en) Color interpolation device and method for reconstructing missing color by using image edge indicator value
CN101079956A (en) Image processing apparatus and image processing method
JP6349614B2 (en) Image processing method and image processing system
CN1806257A (en) Image processor, image processing method, program for image processing method and recording medium with its program recorded thereon
CN1581227A (en) Apparatus and method for intensifying edge in picture processing
TWI588757B (en) Edge detection system and methods
JP2008527861A (en) Noise removal from scattered color digital images
CN1622637A (en) Image dead point and noise eliminating method
CN1977383A (en) CMOS image sensor
US8045826B2 (en) Detecting edges in a digital images
CN101079957A (en) Image processing system
CN1633159A (en) A Method for Removing Image Noise
CN1622134A (en) Image conversion method capable of realizing zooming
CN1175673C (en) color camera
JPWO2006043414A1 (en) Image processing method and image processing apparatus
JP4868249B2 (en) Video signal processing device
CN1700775A (en) A Method and Apparatus for Determining the Edge Trend of a Pixel of Interest
CN1790378A (en) Binary method and system for image
JP2011155365A (en) Image processing apparatus and image processing method
CN1160669C (en) Post filtering method for eliminating image sawtooth effect

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
C17 Cessation of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20080702

Termination date: 20130517