TWI282519B - Color interpolation method with directed weights - Google Patents

Color interpolation method with directed weights Download PDF

Info

Publication number
TWI282519B
TWI282519B TW94118444A TW94118444A TWI282519B TW I282519 B TWI282519 B TW I282519B TW 94118444 A TW94118444 A TW 94118444A TW 94118444 A TW94118444 A TW 94118444A TW I282519 B TWI282519 B TW I282519B
Authority
TW
Taiwan
Prior art keywords
pixel
original
pixels
color
weight
Prior art date
Application number
TW94118444A
Other languages
Chinese (zh)
Other versions
TW200643820A (en
Inventor
Tzung-Nan Lin
Chih-Long Hsu
Original Assignee
Ultramedia Inc
Tzung-Nan Lin
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 Ultramedia Inc, Tzung-Nan Lin filed Critical Ultramedia Inc
Priority to TW94118444A priority Critical patent/TWI282519B/en
Publication of TW200643820A publication Critical patent/TW200643820A/en
Application granted granted Critical
Publication of TWI282519B publication Critical patent/TWI282519B/en

Links

Abstract

A color interpolation method with directed weights is disclosed, which provides an algorithm for interpolating pixels into raw data, the method comprising: extracting raw data; generating a digital image of a color filter array; then calculating a weight of a neighbor pixel of a raw pixel, calculating its bilinear interpolation value, and calculating a first set of pixel differential values between a plurality of neighbor pixels and the bilinear interpolation value; and then obtaining a first interpolation pixel and a second interpolation pixel interpolated into the raw pixel, wherein the pixels are interpolated according to each directed weight of the raw pixel, or interpolated according to the weights after determining each directed weights of a color differential value domain applied in the raw pixel; thereby inferring the interpolation pixels of each raw pixel, so as to reduce an edge blur effect generated during a color image recovery.

Description

1282519 九、發明說明: 【發明所屬之技術領域】 -種具方向,權值之色彩内插方法,特別為提供一於 祕齡之影像資料巾喃像素之演算方法改善f知内插 法造成邊緣模糊的問題。 V* 【先前技術】 • 數位相機原理係利用鏡頭將影像投射到電荷耦合元件 (Charge Coupled Device,CCD)上,此 CCD 元件為數位 相機的感應器,藉由此一電荷耦合元件把相機鏡頭所採取 到的影像轉換成數位影像訊號,透過電子線路的處理,把 ‘數位影像訊號儲存在儲存媒體中,不過,由於CCD元件口、 能感受到光線的強弱,並不能感受到顏色的變化,因此告 進行數位取樣時,必須在感光元件的前面加上一分色漁^ 片’此分色滤光片是採用RGB三原色分色法,然後將二個 電荷輕合元件所操取到的三色彩值混合成全彩影像。 ® 由於數位相機在成本與體積設計大小的考量下,一般 並不考慮使用三個電荷搞合元件,而是使用單_電荷I馬人 元件,使得每一個像素只有R,G,B其中一種色彩元素的灰 度值(gray level),因此,習知技術需將感光元件所得到 的結果進行内插法的數學處理,以重建每一個像素所遺失 的色彩元素。 習知之影像内插法包括有兩類: 第一類為固定式影像内插法,此類内插法遺落的色彩 元素所取的鄰近點是固定的,内插法本身並沒有侦測邊緣 12825.19 的能力,因此會造成邊緣模糊的現象,此類内插法有最鄰 近點(nearest)内插法、雙線性(bilinear)内插法與視覺 平緩轉換(smooth hue transition)内插法等,所内插出來 的影像邊緣部份會產生影像模糊的現象。 第二類為非固定式影像内插法,此類内插法在内插遺 落的色彩元素所取的鄰近點是不固定的,内插法本身並具 有偵測邊緣的能力,因此可以降低邊緣模糊的現象,此類 内插法有第一邊緣偵測(edge sensing)内插法、第二邊緣 债測内插法、Laplacian二階色彩相關性(linear interpolation with Laplacian second-order correction)線性内插法,可變 式斜率數(variable number of gradients)内插法、可辨識 斜率(pattern recognition)内插法,其所内插出來的影像 在水平與垂直兩方向邊緣部份能有效降低邊緣模糊的現 象,但其於45度角與135度角兩個方向通過的邊緣仍會有 影像邊緣模糊的現象。 單一耦合元件所擷取的影像是以彩色濾光片陣列 (Color Filter Array,CFA)表示,在彩色濾光片陣列中每 個陣列位置僅取單一像素(pixel ),其他兩個所遺落的像 素必須靠内插法(interpolation)填補還原影像。 習知技術中,CCD或CMOS等感光元件中彩色濾、光片陣 列的每一點個別接收紅、綠、藍色之一,每種顏色按深淺 可分爲256級’通過璺加以表達各種顏色’如第一圖所示 為彩色滤光片陣列的部份示意圖,其中包括有複數個像 素,B開頭之像素為藍色像素,r開頭之像素為紅色像素, G開頭之代號則為綠色像素,其中遺失的像素須靠内插法 1282519 重建。 而中華民國專利TW548956則揭露一種十字權重 (cross weighting)判斷法之權重判斷方式。如第二a 圖所示之圖式,其為一個影像的部份晝面,黑白(以不同 條紋表示)交界處為影像邊緣,其以垂直方向通過晝面: 晝面區分為第一區域21與第二區域22。 而其彩色濾光片陣列可以第二β圖所示,其中 =第二Α圖分為第—區域21為紅、綠、藍色值皆為〇的二 列,第二區域22紅、綠、藍色值皆為的陣列 色像素B7之鄰近像素有綠色像素G3、G6、G8與G11等了 =用權重的方式判斷此鄰近四個像素與仙 _色像素G8的權值為W3、綠色像素GU的權值 异式如下: W2= 1 = 0.003f W4 ^l+(200-〇f+ (0^0)2 〇β〇05 ^1+(0-200^+(0-200^ ο)2·。)2-1 欲内插之像素鄰近各像素作為權重比例判 且"十I$程中’採用之像素皆通過該欲内插之像素(此 f:、、、B7)’故稱作十字權重判斷法。其經權值計算後,得 知W1等於W4,# u + y 並皆遠大於W2與W3,故可判斷此時内 插,取G3與G11作内插,但實際上,其複數個欲插入的 ,就類別而言是與G3、G6與G11屬同-類(同於第-區 域21)’❿G8屬另-類,此十字權重判斷法將G6 (權值 1282519 · 為W2)作了錯誤的分類。 而第二A圖顯示為一影像邊緣以斜角方式通過晝面, 包括有紅、綠、藍色值為2〇〇的第三區域31與紅、綠、鼪 色值皆為0的第四區域32。而第三B圖則為第三B圖之= 色濾光片陣列示意圖,圖中藍色像素B7之鄰近像素有綠^ 像素G3、G6、G8與G11等,需内插得出G7,亦利用權重 的方式判斷此鄰近四個像素與欲内插位置的相關性,如綠 色像素G3的權值為W卜綠色像素G6的權值為W2、綠色像 素G8的權值為W3、綠色像素G11的權值為W4,算式如下·1282519 IX. Description of the invention: [Technical field of invention] - Color interpolation method with direction and weight, especially to provide an algorithm for calculating the image data of the secret age, to improve the edge blur caused by interpolation The problem. V* [Prior Art] • The digital camera principle uses a lens to project an image onto a Charge Coupled Device (CCD), which is a sensor of a digital camera, by which a camera lens is attached by a charge coupled device. The image taken is converted into a digital image signal, and the digital image signal is stored in the storage medium through the processing of the electronic circuit. However, since the CCD component port can sense the intensity of the light, the color change cannot be felt. When performing digital sampling, a color separation lens must be added in front of the photosensitive element. This color separation filter is a three-color color separation method using RGB three primary color separation method. The values are mixed into a full color image. ® Due to the cost and size of the digital camera, it is generally not considered to use three charge-matching components, but to use a single-charged horse-human component, so that each pixel has only one color of R, G, and B. The gray level of the element, therefore, the conventional technique requires mathematical processing of the result obtained by the photosensitive element to reconstruct the color element lost by each pixel. The conventional image interpolation method includes two types: The first type is fixed image interpolation, and the adjacent points of the color elements left by such interpolation are fixed, and the interpolation method itself does not detect edges. The ability of 12825.19, thus causing edge blurring, such interpolation methods include nearest interpolation, bilinear interpolation, and smooth hue transition interpolation. The image is partially blurred and the image is blurred. The second type is non-stationary image interpolation. The interpolation method is not fixed by the interpolation of the color elements. The interpolation method itself has the ability to detect edges, so it can be reduced. Edge blurring, such interpolation has a first edge detection interpolation method, a second edge debt interpolation method, and a linear interpolation with Laplacian second-order correction linear interpolation Interpolation, variable number of gradients interpolation, pattern recognition interpolation, the interpolated image can effectively reduce the edge blur in the horizontal and vertical edges. Phenomenon, but the edge passing through both the 45-degree angle and the 135-degree angle will still have blurred image edges. The image captured by a single coupling element is represented by a Color Filter Array (CFA). In the color filter array, only one pixel (pixel) is used for each array position, and the other two are left. Pixels must be filled by interpolation to restore the image. In the prior art, in the photosensitive element such as CCD or CMOS, each point of the color filter and the light film array individually receives one of red, green and blue, and each color can be divided into 256 levels according to the depth and depth. As shown in the first figure, a partial view of a color filter array includes a plurality of pixels, a pixel at the beginning of B is a blue pixel, a pixel at the beginning of r is a red pixel, and a code beginning with a G is a green pixel. The missing pixels must be reconstructed by interpolation 1272519. The Republic of China patent TW548956 exposes a method for judging the weight of the cross weighting judgment method. As shown in the second figure, it is a partial facet of an image, and the boundary between black and white (indicated by different stripes) is the edge of the image, which passes through the facet in the vertical direction: the face is divided into the first area 21 With the second area 22. The color filter array can be shown in the second β diagram, wherein the second map is divided into two regions: the first region 21 is red, green, and blue, and the second region 22 is red, green, and The neighboring pixels of the array color pixel B7 having the blue value are green pixels G3, G6, G8, and G11, etc. = the weight of the adjacent four pixels and the fairy-color pixel G8 is determined by the weight value W3, the green pixel The weight of GU is as follows: W2= 1 = 0.003f W4 ^l+(200-〇f+ (0^0)2 〇β〇05 ^1+(0-200^+(0-200^ ο)2· .) 2-1 The pixel to be interpolated is adjacent to each pixel as a weight ratio and "the pixels used in the '10I$' pass through the pixel to be interpolated (this f:, ,, B7)' The cross weight judgment method. After the weight value is calculated, it is found that W1 is equal to W4, #u + y and both are much larger than W2 and W3, so it can be judged that interpolation is performed at this time, and G3 and G11 are interpolated, but in fact, For the plurality of categories to be inserted, in terms of categories, it is the same as G3, G6 and G11 (the same as the first-region 21) '❿G8 belongs to the other-class, and the cross weight judgment method will be G6 (weight 1272519 · W2) made a wrong classification. The second A picture shows An image edge passes through the facet in an oblique manner, and includes a third region 31 having red, green, and blue values of 2 turns and a fourth region 32 having red, green, and black values of 0. The third B The plan is a schematic diagram of the color filter array of the third B diagram. In the figure, the adjacent pixels of the blue pixel B7 have green pixels G3, G6, G8, and G11, etc., and the G7 is interpolated to obtain the weight, and the weight is also used. Determining the correlation between the neighboring four pixels and the position to be interpolated, such as the weight of the green pixel G3, the weight of the green pixel G6, the weight of the green pixel G8, and the weight of the green pixel G11. W4, the formula is as follows

Wl=_-_- _1 ♦ ㈣—况G11一印 — W3— ^HGSr-Gef +(B7-B5y ^+(0-200^ +(200^200^ — 〇服 ^4^+(G6-GSfίl·(BΊ--B9f ^1+(200-0)2 +βΟΟ^〇γ 〇.〇〇3wWl=_-_- _1 ♦ (4)—When G11 is printed—W3— ^HGSr-Gef +(B7-B5y ^+(0-200^ +(200^200^ — 〇服^4^+(G6-GSfίl ·(BΊ--B9f ^1+(200-0)2 +βΟΟ^〇γ〇.〇〇3w

Vr+(G3-Gll| +(B7-B12j ^1+(200-0)2+(2^T〇f 一0.〇〇35 經上述權值計异後,權值W1等於W2為〇· 005、W3等 於W4為0· 0035,權值相近,故經十字權重判斷法判斷會 造成如此的影像邊緣模糊效應,故影像邊緣以45度角左二 通過晝面時’此權重判斷法並無法正確判斷。 !知技術所提,内插法無法有效解決内插出的影像有 邊緣核糊的現象,疋因為内插法本身無法靈敏地躺到邊 緣通過的位置’因此無法卿像魏部份作有效的内插, 有鑑於此,本發明乃提出-具方向性權值之色㈣插方法。 【發明内容】 -種具方向性權值之色彩内插方法,係為解決習知之 影像内插法仍造成邊緣顯之㈣,提供—㈣始擷取之 1282519 個原始像素,並產生方法包括先掘取複數 像素之第一 ϊϋί:鄰近像素方向之權值、計算原始 像素盥第—^_插值、計算原始像素之複數個鄰近 出内插於該原始像素 =、、且像素差值,之後付 近像素方向之權值、計算朴舒之第-組=值以及計算内插於原始像素之第二: 值之牛驟^ =且$算原始像素之第—組雙線性内插 显異值域實施影像内插,該色彩差 -值域係以一雙線性内插法來評估。 上述第-内插像素係由第一組鄰近像素方向 苐一組像素差值代入下列方程式得出: '、 Y,i=Xi,i+(Wi-l,iX Ki-,,J + Wi,MX L.mH-Whmx Ki+1,j + Wi j + l 個原始像素於-彩色濾、光片陣列(cta)巾的 為該原始像該縣像素之該第—内插像素 —而第二内插像素係由第二組鄰近像素方向之權值 一組像素差值代入下列方程式得出:Vr+(G3-Gll| +(B7-B12j ^1+(200-0)2+(2^T〇f_0.〇〇35 After the above weights are calculated, the weight W1 is equal to W2 is 〇·005 W3 is equal to W0 is 0·0035, and the weights are similar. Therefore, the cross-weight judgment method will cause such image edge blurring effect. Therefore, when the image edge passes the 45-degree angle to the left, the weight judgment method cannot be correct. Judging by the technique, the interpolation method can not effectively solve the phenomenon that the interpolated image has edge nucleus paste, because the interpolation method itself cannot lie sensitively to the position where the edge passes, so it is impossible to In view of the above, the present invention proposes a color (four) interpolation method with directional weights. [Invention] A color interpolation method with directional weights is used to solve the conventional image interpolation. The method still causes the edge to appear (4), providing - (4) the original 1222519 original pixels, and the method of generating the first pixel of the complex pixel: the weight of the adjacent pixel direction, the calculation of the original pixel 盥 - ^_ interpolation Calculating a plurality of adjacent pixels of the original pixel and interpolating the original pixel =, and Prime difference, then pay near the pixel direction weight, calculate Park Shu's first-group = value and calculate the second interpolation of the original pixel: the value of the cattle ^ ^ and $ calculate the original pixel's first-group bilinear The interpolated eigenvalue field performs image interpolation, and the color difference-value domain is evaluated by a bilinear interpolation method. The above-mentioned first interpolated pixel is substituted by a first group of adjacent pixel directions 苐 a group of pixel difference values. The following equations are given: ', Y, i=Xi, i+(Wi-l, iX Ki-,, J + Wi, MX L.mH-Whmx Ki+1, j + Wi j + l original pixels in - color The filter, the light film array (cta) towel is the first interpolated pixel of the original image of the county pixel, and the second interpolated pixel is substituted by the second set of adjacent pixel direction weights, a set of pixel difference values into the following equation inferred:

Z^KW^wx + Ki+1„1 + w1+1,,lX K_+u+1 + Wm,J+1X Km, ,ι)/(Ψι_1; m + Wi+1 H + Wi+1 j+i + Wi ^J+1} ? =1與j為該複數個原始像素於一彩色濾光片陣列 FA)中的位置,Xi j為該原始像素,為内插該原始 1282519 * 像素之該第二内插像素。 然本發明之實施例藉下列步驟得出原始平面 像素之内插像素: μ ° 先擷取原始像素,並產生一彩色遽光片陣列之數 像’再藉計算第-原始像素之第—組鄰近像素方向之權 ,、第-原始像素各鄰近像素之第一組像素差值,得出内 =第I雜像素之—第像素,再藉計算第一原始 =之ft組鄰近像素方向之權值、第—原始像素各鄰近 〜、之—組像素差值以得出内插於該第-原始像素之一 第二内插像素。 算第—原始像素之第—組鄰近像素方向之權值、 鄰近像素之第一組像素差值,以得出第二 ίΐϊίΓ弟一内插像素;並計算第二原始像素之第二 组像辛##方,權值、第二原始像素各鄰近像素之第二 、、象素值’传出_於第二原始像素之-第二内插像素。 值ί著1十算第三原始像素之第一組鄰近像素方向之權 内插始近像素之第一組像素差值,以得出 妒傻去ri 之—第__像素;並計算第三原 二备?一組鄰近像素方向之權值、第三原始像素各鄰 t 第—組像素差值,最後得出_於該第三原始像 素之一第二内插像素。 【實施方式】 數位相機中使用單—電荷耦合元件(CCD)作為感光 兀^ ’其#s取的影像是以彩色濾、光片陣列(CFA)表示, 1282519 · 在彩色濾光片陣列中每個陣列位置僅取單一像素,其他兩 個遺落的像素必須靠内插法填補還原影像,然而,習知技 術中利用十字權重(cross weighting)判斷法仍造成的影 像像素錯誤分類或是影像邊緣模糊效應,故本發明即為了 降低彩色影像還原所產生的邊緣模糊提出一非十字權重判 斷法的具方向性權值之色彩内插方法。 本發明係包括兩個主要特徵··第一為原方向性權值用 於權重判斷,其次為色彩差異值域用於權重判斷。 以原方向性權值用於權重判斷之實施例,請參閱第四 A圖各鄰近像素示意圖,其中所示為影像邊緣以垂直方向 通過晝面’邊緣左方區域41為紅色(r)、綠色(g)與藍 色(B)值皆為〇之區域,邊緣右方區域42為紅色(R)、 綠色(G)與藍色(B)值皆為2〇〇之區域。而藍色像素B7 為本實施例需内插之像素,其鄰近像素為綠色像素G3、 G6、G8與G11,此例欲在藍色像素B7附近内插所遺失的顏 色,如紅色與綠色,先需計算各鄰近像素之權重比例,再 以此判斷鄰近像素與内插位置的相關性,如綠色像素G3 的權值為W卜綠色像素G6的權值為W2、綠色像素G8的權 值為W3、綠色像素G11的權值為W4。其中實施例屏棄習知 技,中採用橫跨該需内插像素(此例為B7)之鄰近像素來 計算權值,而如第四B圖、第四C圖、第四D圖盥第四E 圖所示像素B7與鄰近像素之_,以箭頭方向所經過的複 數個像素位置作權重判斷,算式如下。 如第四B -,其中綠色像素G3之權值W1為·· wi - 7 1 _ 1 —】 a/i+(G3-gi)2+(B7-B2)2 12825.19 色像素Gg之權值W2為:Z^KW^wx + Ki+1„1 + w1+1,,lX K_+u+1 + Wm,J+1X Km, ,ι)/(Ψι_1; m + Wi+1 H + Wi+1 j+ i + Wi ^J+1} ? =1 and j are the positions of the plurality of original pixels in a color filter array FA), and Xi j is the original pixel, which is the interpolation of the original 1282519 * pixels The second embodiment of the present invention uses the following steps to obtain the interpolated pixels of the original planar pixels: μ ° first captures the original pixels, and generates a digital image of the array of color pupils. The first group of pixels is the weight of the neighboring pixel direction, and the first group of pixel difference values of the adjacent pixels of the first-original pixel is obtained as the inner pixel = the first pixel of the first impurity pixel, and then the first original = ft group is calculated. The weight of the adjacent pixel direction, the first pixel of the first pixel are adjacent to the group pixel difference value to obtain a second interpolation pixel interpolated to one of the first-origin pixels. The weight of the pixel direction, the first set of pixel difference values of the adjacent pixels, to obtain the second interpolation pixel; and calculate the second group of the second original pixel like the symplectic ##方, weight, the first a second pixel of each of the adjacent pixels of the original pixel, and a pixel value of the second pixel is transmitted to the second pixel. The value of the first pixel is within the weight of the first group of adjacent pixels. Inserting the first set of pixel difference values of the near pixel to obtain the __ pixel of ri silly ri; and calculating the third original two standbys, the weight of a set of adjacent pixel directions, and the third original pixel adjacent to each other The first group of pixel difference values, and finally the second interpolation pixel of the third original pixel is obtained. [Embodiment] A single-charge coupled device (CCD) is used as a photosensitive device in the digital camera. The image is represented by color filter, light film array (CFA), 1282519. In the color filter array, only one pixel is taken at each array position. The other two missing pixels must be interpolated to fill the restored image. In the prior art, the image pixel misclassification or the image edge blurring effect caused by the cross weighting judgment method is used, so the present invention proposes a non-cross weight judgment method for reducing edge blur caused by color image restoration. With The color interpolation method of the directional weight. The invention includes two main features: the first is the original directional weight for the weight judgment, and the second is the color difference value field for the weight judgment. For an embodiment for weight determination, please refer to the schematic diagram of each adjacent pixel in FIG. 4A, in which the image edge passes through the facet in the vertical direction. The left edge region 41 is red (r), green (g) and blue. (B) The value is the area of 〇, and the edge right area 42 is the area where the red (R), green (G), and blue (B) values are 2 。. The blue pixel B7 is required for this embodiment. The interpolated pixel has adjacent pixels as green pixels G3, G6, G8 and G11. In this example, if the missing color, such as red and green, is to be interpolated near the blue pixel B7, the weight ratio of each adjacent pixel needs to be calculated first. Then, the correlation between the neighboring pixels and the interpolation position is determined. For example, the weight of the green pixel G3 is W2, the weight of the green pixel G6 is W2, the weight of the green pixel G8 is W3, and the weight of the green pixel G11 is W4. . Wherein the embodiment discards the conventional technique, the neighboring pixels across the interpolated pixel (in this case, B7) are used to calculate the weight, and the fourth B, the fourth C, and the fourth D are the fourth. The pixel B7 shown in the figure E and the adjacent pixel _ are weighted by a plurality of pixel positions passing in the direction of the arrow, and the calculation formula is as follows. For example, the fourth B-, wherein the weight W1 of the green pixel G3 is ·· wi - 7 1 _ 1 —] a/i+(G3-gi)2+(B7-B2)2 12825.19 The weight W2 of the color pixel Gg is :

Vr+(〇-〇)2+(〇^〇F=1 為·· W3 ^ 十异後,權值W1、W2與W4為卜而權值 =_,得到像素G3、G6與G11有相同的權值,^ 方向素亦處於相同的區域内,故本發騎提出的^ 誤錢St色彩_方法得到正確的分類,改善習知錯 而於影像邊緣以斜角(如45度角)方向進人畫面之實 施例中,如第五圖所示之彩色濾、光片陣列,其中畫面分為 上方區域51與下方區域52,邊緣上方區域51為紅色(r)、 綠色(G)與藍色(B)值皆為2〇〇之區域,邊緣下方區域 52為紅色(R)、綠色(G)與藍色(B)值皆為◦之區域。 藍色像素B7為本實施例需内插之像素,其鄰近像素為綠色 像素G3、G6、G8與G11,欲内插藍色像素B7附近遺失的 顏色,需計算各鄰近像素之權重比例,再以此結果判斷鄰 近像素與内插位置的相關性,如綠色像素G3的權值為埘卜 綠色像素G6的權值為W2、綠色像素G8的權值為W3、綠色 像素G11的權值為W4。其中實施例屏棄習知技術中採用十 字權重判斷法,而以如同上述第四B圖至第四E圖所示像 素B7與鄰近像素之關係計算各鄰近像素權值,以箭頭方向 所經過的複數個像素位置作權重判斷,算式如下。 12 =11282519Vr+(〇-〇)2+(〇^〇F=1 is ··· W3 ^ Tens, the weights W1, W2 and W4 are the weights = _, and the pixels G3, G6 and G11 have the same weight The value, ^ direction element is also in the same area, so the hair error proposed by the hair ride, St color _ method to get the correct classification, improve the knowledge of the wrong and enter the corner at the edge of the image at an oblique angle (such as 45 degrees) In the embodiment of the screen, as shown in FIG. 5, the color filter and the light film array, wherein the screen is divided into an upper area 51 and a lower area 52, and the upper area 51 is red (r), green (G) and blue ( B) The value is 2 〇〇, and the area 52 below the edge is the area where the red (R), green (G) and blue (B) values are ◦. The blue pixel B7 needs to be interpolated in this embodiment. Pixels whose neighboring pixels are green pixels G3, G6, G8 and G11. To interpolate the missing color near the blue pixel B7, the weight ratio of each adjacent pixel needs to be calculated, and then the correlation between the adjacent pixels and the interpolation position is determined by the result. For example, the weight of the green pixel G3 is the weight of the green pixel G6, the weight of the green pixel G8 is W3, and the weight of the green pixel G11. W4. The embodiment discards the prior art by using the cross weight judging method, and calculates the weight of each neighboring pixel by the relationship between the pixel B7 and the neighboring pixels as shown in the fourth to fourth Eth diagrams above, and passes through the direction of the arrow. The multiple pixel positions are weighted and the calculation is as follows. 12 =11282519

Wl= W2: W3= 其中綠色像素G3之權值W1為:— 1 ___1_ ^l+(Gl-G3f +(B7-B2f ^1+(200-200)2 +(200-200/其中綠色像素G6之權值W2為: ·— \ __1_ ^1+(G4-G6)? +(B7-^B57 /l+(200-200^ +(200-200]?其中綠色像素G8之權值W3為: =1 = 0.005 ^(GIO-GS)2 +(B7^B9f ^1+(0-0)2+(200-Ο)2 其中綠色像1 素G11之權值W4為··^ Ji+(〇-〇)2+(200-0)2 、、至上述權值計算後,權值W1與W2為1,而權值W3與 W4為〇·〇〇5,得到像素G3、G6有相同的權值,實際上此二 個像素亦處於相同的區域内,像素G8與GU有相同的權 值’此二像素事實上亦處於相同區域内,故本發明所提出 的具方向性權值之色彩内插方法解決習知技術有斜角邊緣 模糊現象的缺失。 本發明提出之具方向性權值之色彩内插方法亦可採用 形差異值域實施影像内插,係將各鄰近像素之色彩差異 ,域應用於權重之判斷,藉以改善影像内插後之品質,亦 =此方H财色彩差異值域上作權重满可提高影像品 貝〇 本I明之第一實施例係以加權方式施行於紅、綠、藍 =枯始平面(RGBspace)上,其中本發明所提之具方向性 之色彩内插方法包括下列複數個步驟: 一、内插紅色像素(R)與藍色像素⑻位置上的綠 *色像素(G),藉以產生綠色像素的内插值: 如第六圖所示之彩色濾光片陣列,其係參考第一圖所 W4: = 0.005 13 1282519 示陣列之各像素相關位置,以於紅色像素R44上内插綠色 像素(G44)為例,先計算紅色像素R44鄰近各方向之綠色 像素(G)權值,如以下方程式: 相對於紅色像素R44,其鄰近之綠色像素〇34方向之 權值W34為 1 _ n 一 _ —> · /l + (R44 - G14)2, 紅色像素R44鄰近之綠色像素G43方向之權值w43為 —— ", , · φ VT+ (R44 -^42)^ (G43 - G41)2 ’ 紅色像素R44鄰近之綠色彳i素G54方向之權值14為 φ + (R44 - R64)2 + (G54 - G74)2 , 紅色像素R44鄰近之綠色像素G45方向之權值w45為 "j- 丨丨丨·丨丨·_ — · VI + (R44 - R464)2 + (G45 - G47)2, k 上述分母於根號内加上1係為了避免分母為〇之問 題,然其並不影響權重之判斷。 之後’計算雙線性内插法產生的内插值,此例中,色 _ 彩差異值域係以此雙線性内插法來評估,即計算兩相鄰同 色系之平均值,如紅色像素R44與R24的雙線性内插值為 其平均值(R44+R24)/2,R44與R42的雙線性内插值為 (R44+R42)/2,R44 與 R64 的雙線性内插值為(R44+R64)/2, R44與R46的雙線性内插值為(R44+R46)/2。而進一步計算 鄰近像素(如G34、G43、G54、G45等)與雙線性内插值之 像素差值,如K34=G34-(R44+R24)/2為紅色像素R44與R24 間的像素差值’其他像素差值如K43=G43-(R44+R42)/2 ; K54=G54-(R44+R64)/2 ; K45=G45-(R44+R46)/2 等。 上述各相鄰像素間差值K34、K43、K54、K45乘上其中權 1282519 * 值W34、W43、Ws4、W45 ’則計算出紅色像素R44上内插綠色像 素(G44),如方程式(1)所述: G44=R44+(W34X K34 + W43X K43 + W54X K54 + W45X K45)/(W34 + W43+W54+W45)--------—_______________________⑴ 然而’内插藍色像素(B)上的綠色像素(G)步驟如 同上述内插紅色像素(R)的綠色像素(G)。 二、内插紅色像素(R)位置上的藍色像素(B),並 藍色像素(B)上的紅色像素(R); 如第六圖所示’以在彩色濾光片陣列中的紅色像素 R44上内插藍色像素(B44)為例,需先計算紅色像素R44 鄰近各藍色像素(B)方向之權值,如以下算式: 相對於紅色像素R44,其鄰近藍色像素B33方向之權 值 W33 為 1 — · a/1 + (R44 — R22)2 + (B33-B11)2, 相對於紅色像素R44,鄰近藍色像素B53方向之權值 W53 為 ~r _ 1 _ · 彳1 + (R44 - R62)2 + (B53 - B71)2 ’ 相對於紅色像素R44,鄰近藍色像素B55方向之權值 W55 為 1 1 :: -. · VI + (R44 ~ R66)2 + (B55 - B77)2 , 相對於紅色像素R44,鄰近藍色像素B35方向之權值 W35 為 ~f=— 1 - 〇 + (R44 - R26)2 + (B35 - B17)2 得知上述各斜角方向的權值(W)後,需由上一步驟中 所得之綠色像素G44與需内插的紅色像素R44來得出内插 藍色像素B44的值。如步驟一所得之各方向内插之綠色像 素G33、G53、G55與G35等,以此可進一步算出欲内插之 紅色像素R44與斜角鄰近像素(如B33、B53、B55、B35 等)間之像素差值(K),如紅色像素R44與其斜角鄰近像 15 1282519 其他如 K53=G53-B53、 素之像素差值K33=G33-B33, K55=G55-B55、K35=G35-B35 等。 接著,由上述各相鄰像素差值K33、k 值w33、W53、W55、w35之關係(如方程式⑵ ^ 素R44上内插藍色像素(B44),其中引用方程 值,並代入方程式(2): K35)/(W33 一—-⑵Wl= W2: W3= The weight W1 of the green pixel G3 is: — 1 ___1_ ^l+(Gl-G3f +(B7-B2f ^1+(200-200)2 +(200-200/where the green pixel G6 The weight W2 is: · - \ __1_ ^1+(G4-G6)? +(B7-^B57 /l+(200-200^ +(200-200]? Where the weight of the green pixel G8 is W3: =1 = 0.005 ^(GIO-GS)2 +(B7^B9f ^1+(0-0)2+(200-Ο)2 where the green image is the weight of W1 of G11 is ··^ Ji+(〇-〇) 2+(200-0)2, after the weight calculation, the weights W1 and W2 are 1, and the weights W3 and W4 are 〇·〇〇5, and the pixels G3 and G6 have the same weight, actually The two pixels are also in the same area, and the pixels G8 and GU have the same weights. The two pixels are actually in the same area. Therefore, the color interpolation method with directional weights proposed by the present invention is solved. The prior art has the lack of oblique edge blurring phenomenon. The color interpolation method with directional weight proposed by the present invention can also perform image interpolation by using the shape difference value domain, and apply the color difference of each adjacent pixel to the domain. The judgment of the weight, in order to improve the quality of the image after interpolation, also = the value of the H-color difference The first embodiment of the present invention is implemented in a weighted manner on red, green, and blue = RGB space, wherein the directional color interpolation method of the present invention includes The following multiple steps: 1. Interpolating the red pixel (R) and the green color pixel (G) at the position of the blue pixel (8) to generate an interpolated value of the green pixel: a color filter array as shown in FIG. Referring to the first figure, W4: = 0.005 13 1282519 shows the position of each pixel of the array, for example, by interpolating the green pixel (G44) on the red pixel R44, first calculating the green pixel of the red pixel R44 adjacent to each direction ( G) Weight, such as the following equation: Relative to the red pixel R44, the weight W34 of the adjacent green pixel 〇 34 direction is 1 _ n _ —> · /l + (R44 - G14)2, red pixel R44 The weight w43 of the direction of the adjacent green pixel G43 is —— ", , · φ VT+ (R44 -^42)^ (G43 - G41)2 'The red pixel R44 is adjacent to the green 彳i G54 direction weight 14 is φ + (R44 - R64)2 + (G54 - G74)2 , green pixel G adjacent to red pixel R44 The weight w45 of the 45 direction is "j- 丨丨丨·丨丨·_ — · VI + (R44 - R464)2 + (G45 - G47)2, k The above denominator adds 1 to the root number to avoid The denominator is a question of ambiguity, but it does not affect the judgment of weight. Then calculate the interpolated value produced by the bilinear interpolation method. In this case, the color gamut difference value range is evaluated by this bilinear interpolation method, that is, the average value of two adjacent homochromatic systems is calculated, such as red pixels. The bilinear interpolation of R44 and R24 is the average value (R44+R24)/2, the bilinear interpolation of R44 and R42 is (R44+R42)/2, and the bilinear interpolation of R44 and R64 is ( R44+R64)/2, the bilinear interpolation of R44 and R46 is (R44+R46)/2. Further calculating the pixel difference between the adjacent pixels (such as G34, G43, G54, G45, etc.) and the bilinear interpolation value, such as K34=G34-(R44+R24)/2 is the pixel difference between the red pixels R44 and R24. 'Other pixel difference values such as K43=G43-(R44+R42)/2; K54=G54-(R44+R64)/2; K45=G45-(R44+R46)/2 and so on. The above-mentioned adjacent pixel-to-pixel difference values K34, K43, K54, and K45 are multiplied by the weights of 1282519*values W34, W43, Ws4, and W45' to calculate the interpolated green pixel (G44) on the red pixel R44, as in equation (1). Said: G44=R44+(W34X K34 + W43X K43 + W54X K54 + W45X K45)/(W34 + W43+W54+W45)--------________________________ (1) However, 'interpolated blue pixel (B) The green pixel (G) step is like the green pixel (G) in which the red pixel (R) is interpolated as described above. 2. Interpolating the blue pixel (B) at the red pixel (R) position and the red pixel (R) at the blue pixel (B); as shown in the sixth figure, 'in the color filter array For example, the blue pixel (B44) is interpolated on the red pixel R44. The weight of the red pixel R44 adjacent to each blue pixel (B) direction is calculated first, as shown in the following formula: Relative to the red pixel R44, adjacent to the blue pixel B33 The weight W33 of the direction is 1 - · a / 1 + (R44 - R22) 2 + (B33 - B11) 2, and the weight W53 of the direction adjacent to the blue pixel B53 is ~r _ 1 _ with respect to the red pixel R44.彳1 + (R44 - R62)2 + (B53 - B71)2 ' With respect to the red pixel R44, the weight W55 in the direction of the adjacent blue pixel B55 is 1 1 :: -. · VI + (R44 ~ R66)2 + (B55 - B77)2 , relative to the red pixel R44, the weight W35 in the direction of the adjacent blue pixel B35 is ~f=-1 - 〇+ (R44 - R26)2 + (B35 - B17)2 After the weight (W) in the angular direction, the value of the interpolated blue pixel B44 is obtained from the green pixel G44 obtained in the previous step and the red pixel R44 to be interpolated. The green pixels G33, G53, G55, and G35 are interpolated in each direction obtained in the first step, thereby further calculating the red pixel R44 to be interpolated and the adjacent pixels (such as B33, B53, B55, B35, etc.) to be interpolated. The pixel difference value (K), such as the red pixel R44 and its oblique angle adjacent to the image 15 1282519, such as K53=G53-B53, the pixel difference K33=G33-B33, K55=G55-B55, K35=G35-B35, etc. . Next, the relationship between the adjacent pixel difference values K33, k values w33, W53, W55, w35 (such as equation (2) ^ R44 is interpolated with blue pixels (B44), where the equation value is referenced and substituted into the equation (2) ): K35)/(W33 one--(2)

B44=G44-(W33x K33 + W53X K53 + W55X K55 + W35X + W53 +W55 +W35)--------------------—B44=G44-(W33x K33 + W53X K53 + W55X K55 + W35X + W53 +W55 +W35)--------------------

於此步驟中,内插藍色像素(B)上的紅色像素(趵 步驟如同上述内插紅色像素(R)的藍色像素(B)^ 三、内插綠色像素(G)位置上的紅色像素(R)與藍 色像素(B) : m 以第七圖所示之彩色濾光片陣列中的綠色像素G45上 内插紅色像素R45為例,需先計算該綠色像素G45鄰近各 方向之權值,如以下算式: 相對於綠色像素G45,其鄰近紅色像素R44方向之權 值 W44 為 1 -Γ ; λ/1 + (G45 - G43)2 + (R44 - R42)2 相對於綠色像素G45,鄰近藍色像素Β55方向之權值 W55 為 — —; V1 + (G45 - G65)2 + (B55 - B75)2 相對於綠色像^ G45,鄰近紅色像素R46方向之權值 W46 為 ~j====:=:= •.一 ; VI + (G45 - G47)2 + (R46 - R48)2 相對於綠色像素G45,鄰近藍色像素B35方向之權值 W35 為 ~Γ==^— --0 VI + (G45 - G25)2 + (B35 - B15)2 得出上述之各方向權值後,即以步驟一所得之結果得 知鄰近上述綠色像素G45之各像素之内插值,如内插紅色 !282519 · 像素R44之綠色像素G44、内插藍色像素B45之綠色像素 G55、内插紅色像素R46之綠色像素G46與内插藍色像素 B35之綠色像素G35。 再以步驟二所得之結果得知各鄰近像素之内插值,如 • 内插紅色像素R44之藍色像素B44與内插紅色像素R46之 • 藍色像素B46,與其鄰近像素B35與B55可得像素差值 (K ),如 K44=G44-B44、K55=G55-B55、K46=G46-B46 與 K35=G35-B35等。並由上述之權值與像素差值可得本實施例 • 内插綠色像素G45之藍色像素B45,如方程式(3): B45=G45-(W44x K44 + W55X K55 + W46X K46 + W35X K35)/(W33 + W53 + W55 + W35)----------------------------- (3) - 並且,内插綠色像素G45之紅色像素R45之步驟同理 於上述内插之藍色像素B45。 ^ 四、重建影像綠色像素色彩校正: 經由步驟一、二、三後,需對其中紅色平面位置上遺 落的綠色像素色彩校正,但此為一選擇性之步驟,並非一 • 定要執行,係因於步驟一中,其色彩差異值域是以雙線性 内插法評估,此一評估方式會造成内插上的誤差,因此在 此最後步驟中,可以選擇性地再以内插法校正此一誤差, 此一校正步驟會增加影像訊噪比(Peak Signal—1〇—N〇iceIn this step, the red pixel on the blue pixel (B) is interpolated (the step is as the blue pixel (B) of the above-mentioned interpolated red pixel (R). 3. The red at the position where the green pixel (G) is interpolated. The pixel (R) and the blue pixel (B): m is an example in which the red pixel R45 is interpolated on the green pixel G45 in the color filter array shown in FIG. 7 , and the green pixel G45 is first calculated in all directions. The weight, as shown in the following formula: Relative to the green pixel G45, the weight W44 of the direction adjacent to the red pixel R44 is 1 - Γ; λ / 1 + (G45 - G43) 2 + (R44 - R42) 2 relative to the green pixel G45 The weight W55 of the direction adjacent to the blue pixel Β55 is -;; V1 + (G45 - G65)2 + (B55 - B75)2 is relative to the green image ^ G45, and the weight W46 of the direction adjacent to the red pixel R46 is ~j= ===:=:= •.1; VI + (G45 - G47)2 + (R46 - R48)2 Relative to the green pixel G45, the weight W35 in the direction of the adjacent blue pixel B35 is ~Γ==^— -0 VI + (G45 - G25)2 + (B35 - B15)2 After obtaining the above-mentioned weights in the respective directions, the interpolated values of the pixels adjacent to the green pixel G45 are obtained as a result of the first step, such as Red! 282519 · Green pixel G44 of pixel R44, green pixel G55 of interpolated blue pixel B45, green pixel G46 of interpolated red pixel R46 and green pixel G35 of interpolated blue pixel B35. Result of step 2 Knowing the interpolated values of each adjacent pixel, such as • the blue pixel B44 of the red pixel R44 and the blue pixel B46 of the interpolated red pixel R46, and the pixel difference (K) of the neighboring pixels B35 and B55, such as K44=G44-B44, K55=G55-B55, K46=G46-B46 and K35=G35-B35, etc. The present embodiment can be obtained from the above-mentioned weight value and pixel difference. • Blue pixel of the interpolated green pixel G45 B45, as in equation (3): B45=G45-(W44x K44 + W55X K55 + W46X K46 + W35X K35)/(W33 + W53 + W55 + W35)--------------- -------------- (3) - Also, the step of interpolating the red pixel R45 of the green pixel G45 is the same as the above-mentioned interpolated blue pixel B45. ^ 4. Reconstructing the image green pixel Color correction: After steps one, two, and three, the color of the green pixel left in the red plane position needs to be corrected, but this is a selective step, not a must Because of the first step, the color difference range is evaluated by bilinear interpolation. This evaluation method will cause interpolation error, so in this final step, it can be selectively interpolated. Correcting this error, this calibration step will increase the image signal-to-noise ratio (Peak Signal—1〇—N〇ice

Ratio, PSNR)2-4分貝左右,如以校正綠色像素G44為例: 如同步驟一所1述鄰近紅色像素以4各方向的權值: ^/l + (R44 - R24)j^(G34 - G14)2, λ/1 + (R44 - R42)j2T(G43 - G41)2, yjl + (R44 - R64) 2^7g54 - G74)2, 17 1 l282519 φ + (R44 - R46)2 + (G45 - G47Y : 不同的是,其中各相鄰像素間差值Κ34、K43、K54、— 的計算方式,由步驟三可知内插綠色像素(G)位置上的紅 色像素(R) ’並不用原來的雙線性内插法,以減少誤差。 故各像素差值如 K34=G34-R34、K43=G43-R43、、 K45=G45-R45 等。 最後再與各方向權值W34、W43、W54、W45校正内插紅色 像素R44的綠色像素G44,如步驟一之方程式(i) · G44 = R44+(W34X K34+W43X K43 + W54X K54+W45X K45)/(W34 + W43+ W54+ W45)----------------------------- (1) 其他於1色平面位置上遺落的綠色像素色彩校正亦類 似上述校正於紅色平面位置上遺落的綠色像素。 、 * 如上述本發明第一實施例,藉計算原始紅色像素R鄰 ^各^向(如垂直、水平、斜角方向等)的權值與像素差 ,侍出該像素之内插值G與Β,並同理推導藍色像素Β =插像素R與G,再計算出綠色像素G之内插值R與Β, ⑩卩得έΗ完整原始平面巾各像素之_值通式。 本發明之第二實施例,不同於第—實施例利用之 =始平面上依據各縣像素之各方向權值進行内插像素, μ以色Μ異值域胁縣像素之各方向權值靖,再計 像素鄰近各方向(如垂直、水平、斜角方向等)的 馬ki、像素差值,得出該原始像素之内插值,以得出完整 ,、口平面中各像素之内插值通式。 纽第二實施例中,加權方式係施行於綠—紅色彩差異值域 s 现色W差異值域上,其中本發明所提之具方向性權值 1282519 之色彩内插方法包括下列複數個步驟: 一、内插紅色像素(R)與藍色像素(B)位置上的綠 色像素(G),藉以產生綠色像素的内插值: 如第六圖所示之彩色濾光片陣列,於紅色像素R44上 内插綠色像素(G44)為例,先計算紅色像素R44鄰近各方 向之綠色像素(G)權值,如以下方程式: 相對於紅色像素R44,其鄰近之綠色像素G34方向之 權值W34為 ___ 1 Τίΐ石44 一 R24)2 + (G34^^ ; 紅色像素R44i鄰近之綠色像素G43方向之權值W43為 a/T+7r44 - R42)2 + (G43^G41)2, 紅色像素R44f近之綠色像素G54方向之權值—為 λ[ι~+ (R44 - R64)2 + (G5i^T(j74)2, 紅色像素R44i鄰近之綠色像素G45方向之權值ψ45為 Vl + (R44 - R464)2 + (G4^Tg47)2, 上述分母於根號内加上1係為了避免分母為〇之問 題,然其並不影響權重之判斷。 再計算R44之鄰近像素(如G34、G43、G54、G45等) 與雙線性内插值(如第一實施例所述)之像素差值,如: Ks4=G34-(R44+R24)/2 K43=G43-(R44+R42)/2 K54=G54-(R44+R64)/2 K45=G45-(R44+R46)/2 藉上述各相鄰像素間差值Km、K43、Km、Κα與權值W34、 19 1282519 W43、W54、W45計算出紅色像素r44上内插綠色像素(G44), 如同第一實施例之方程式(丨)所述: G44=R44+(Ws4X K34 + W43X K43 + W54X K54 + W45X K45)/(W34 + W43 + W54 + W45)--------------------------------⑴ 同理’内插藍色像素(B)上的綠色像素(g)步驟如 同上述内插紅色像素(R)的綠色像素(G)。 二、内插紅色像素(R)位置上的藍色像素(β),並 藍色像素(Β)上的紅色像素(R); 如第六圖所示,以在彩色濾光片陣列中的紅色像素 R44上内插藍色像素(B44)為例,需先計算紅色像素以4 鄰近各藍色像素(B)方向之權值。 有別於第一實施例進行内插法時利用原始像素計算各 方向權值之方法,第二實施例係以綠(G)-紅(R)色彩差 異值或綠(G)-藍(β)色彩差異值計算各方向之權值,藉 以得到精確之内插值。 先計算原始像素平面上各像素之色彩差異值,如綠一 紅色彩差異值或綠-藍色彩差異值,如於第八圖所示之第一 斜角方向81,該方向各像素之色彩差異值為Ratio, PSNR) is about 2-4 decibels, for example, to correct the green pixel G44: as in step 1, the adjacent red pixel has weights in each direction: ^/l + (R44 - R24)j^(G34 - G14)2, λ/1 + (R44 - R42)j2T(G43 - G41)2, yjl + (R44 - R64) 2^7g54 - G74)2, 17 1 l282519 φ + (R44 - R46)2 + (G45 - G47Y : The difference is that the calculation method of the difference Κ34, K43, K54, - between adjacent pixels is as follows: Step 3 shows that the red pixel (R) at the position of the green pixel (G) is interpolated. Bilinear interpolation method to reduce the error. Therefore, the difference of each pixel is K34=G34-R34, K43=G43-R43, K45=G45-R45, etc. Finally, the weights W34, W43, W54, W45 corrects the green pixel G44 of the red pixel R44, as in Equation (i) · G44 = R44+ (W34X K34+W43X K43 + W54X K54+W45X K45)/(W34 + W43+ W54+ W45)----- ------------------------ (1) Other green pixel color corrections that are left at the 1-color plane position are similar to the above-mentioned corrections in the red plane position. Falling green pixels., * As described above, the first embodiment of the present invention The weight of the original red pixel R is adjacent to each other (such as vertical, horizontal, oblique direction, etc.) and the pixel difference, and the interpolated values G and Β of the pixel are given, and the blue pixel 推 = interpolated pixel R is similarly derived. And G, and then calculate the interpolated values R and Β of the green pixel G, 10 卩 to obtain the _ value of each pixel of the original original flat towel. The second embodiment of the present invention is different from the first embodiment. In the plane, the pixels are interpolated according to the weights of the pixels in each county, and the weights of the pixels in the different values of the color are different, and the pixels are adjacent to each direction (such as vertical, horizontal, oblique, etc.). The horse ki, the pixel difference, the interpolated value of the original pixel is obtained to obtain the complete interpolation formula of each pixel in the mouth plane. In the second embodiment, the weighting method is implemented in the green-red color The color value interpolation method with the directional weight value of 1282519 proposed by the present invention includes the following multiple steps: 1. Interpolating red pixel (R) and blue pixel (B) ) a green pixel (G) at the location to generate an interpolation of green pixels For example, in the color filter array shown in FIG. 6, the green pixel (G44) is interpolated on the red pixel R44 as an example. First, the green pixel (G) weight of the red pixel R44 adjacent to each direction is calculated, as shown in the following equation: With respect to the red pixel R44, the weight W34 of the direction of the adjacent green pixel G34 is ___ 1 Τ ΐ ΐ 44 44 R R R 24) 2 + (G34^^ ; the weight W43 of the direction of the green pixel G43 adjacent to the red pixel R44i is a/ T+7r44 - R42)2 + (G43^G41)2, the weight of the red pixel R44f near the green pixel G54—for λ[ι~+ (R44 - R64)2 + (G5i^T(j74)2, The weight ψ45 in the direction of the green pixel G45 adjacent to the red pixel R44i is Vl + (R44 - R464) 2 + (G4^Tg47) 2, and the above denominator adds 1 in the root number to avoid the problem that the denominator is 〇, Does not affect the judgment of weights. Recalculate the pixel difference between adjacent pixels (such as G34, G43, G54, G45, etc.) of R44 and the bilinear interpolation value (as described in the first embodiment), such as: Ks4=G34-(R44+R24)/2 K43=G43-(R44+R42)/2 K54=G54-(R44+R64)/2 K45=G45-(R44+R46)/2 By the difference Km, K43, Km, Κα between the adjacent pixels The weights W34, 19 1282519 W43, W54, W45 calculate the interpolated green pixel (G44) on the red pixel r44, as described in the equation (丨) of the first embodiment: G44=R44+(Ws4X K34 + W43X K43 + W54X K54 + W45X K45)/(W34 + W43 + W54 + W45)--------------------------------(1) Same as ' The step of interpolating the green pixel (g) on the blue pixel (B) is as the green pixel (G) in which the red pixel (R) is interpolated as described above. 2. Interpolating the blue pixel (β) at the red pixel (R) position and the red pixel (R) on the blue pixel (Β); as shown in the sixth figure, in the color filter array For example, the blue pixel (B44) is interpolated on the red pixel R44, and the weight of the red pixel to the direction of each blue pixel (B) is calculated first. Different from the first embodiment, the original pixel is used to calculate the weight of each direction, and the second embodiment is a green (G)-red (R) color difference value or green (G)-blue (β). The color difference value calculates the weight of each direction to obtain an accurate interpolated value. First calculate the color difference value of each pixel on the original pixel plane, such as the green-red color difference value or the green-blue color difference value, as shown in the first oblique direction direction 81 shown in the eighth figure, the color difference of each pixel in the direction Value

Kr44=G44-R44 、 Kr22=G22-R22 、 Kb33=G33-Β33 與Kr44=G44-R44, Kr22=G22-R22, Kb33=G33-Β33 and

Kbll=Gll-Bll等;而第二斜角方向82之各像素色彩差異 值為 Kr44=G44-R44、Kr62=G62-B62、Kb53=G53-B53 與 Kb71=G71-B71等;第三斜角方向83之各像素色彩差異值 為 Kr44=G44-R44 、 Kr66=G66-R66 、 Kb55=G55-B55 與 Kb77=G77-B77等;第四斜角方向84之各像素色彩差異值 為 Kr44=G44-R44 、 Kr26=G26-R26 、 Kb35二G35-B35 與 20 1282519Kbll=Gll-Bll, etc.; and the color difference value of each pixel in the second oblique direction 82 is Kr44=G44-R44, Kr62=G62-B62, Kb53=G53-B53 and Kb71=G71-B71, etc.; third oblique angle The color difference value of each pixel in the direction 83 is Kr44=G44-R44, Kr66=G66-R66, Kb55=G55-B55 and Kb77=G77-B77, etc.; the color difference value of each pixel in the fourth oblique direction 84 is Kr44=G44 -R44, Kr26=G26-R26, Kb35 two G35-B35 and 20 1282519

Kbl7=G17-B17 等。 由上述各方向之色彩差異值,可得出相對於紅色像素 R44 ’其鄰近藍色像素B33方向之權值W33為 ▽1 + (Kr44 - Kr22^T(Kb33 - Kbl 1)^, 相對於紅色像素R44,鄰近藍色像素B53方向之權值 W53 為 ~7 --=======—- 1 ........"; VI + (Kr44 - Kr62)2 + (Kb53 - Kbl\)2 相對於紅色像素R44,鄰近藍色像素B55方向之權值 W55 為 ~r 1 · V1 + (Kr44~Kr66)2+(Kb55-Kb77)2 相對於紅色像素R44,鄰近藍色像素B35方向之權值 W35為~1 - ———— =-〇 VI + (Kr44 - Kr26)2 + (Kb35 - Kbl7)2 得知上述各斜角方向的權值(W)後,藉其斜角鄰近像 素之像素差值 K33=G33-B33、K53=G53-B53、K55=G55-B55、 Km-G35-B35專,並由上一步驟中所得之綠色像素G44與需 内插的紅色像素R44來得出内插藍色像素B44的值,如方 程式(2): B44=G44-(W33X K33 + W53X K53 + W55X K55 + W35X K35)/(W33 + W53 + W55 + W35)--------------------------------(2) 並同理可算出欲内插之紅色像素R44與斜角鄰近像素 (如 B33、B53、B55、B35 等)。 於此步驟中,内插藍色像素(B)上的紅色像素(R) 步驟如同上述内插紅色像素(R)的藍色像素(B)。 二、内插綠色像素(G)位置上的紅色像素(R)與藍 色像素(B) : ^ ^ 以第七圖所示之彩色濾光片陣列中的綠色像素G45上 内插紅色像素R45為例,需先計算該綠色像素G45鄰近各 21 1282519 方向之權值,而權值係利用各方向色彩差異值計算,以得 到精確之内插值,如以下算式: 相對於綠色像素G45 ’其鄰近紅色像素R44方向之權 5 W“為G43); + (Κτ44^Γ,其中該色彩差異值 為 Kr44=G44-R44 、 Kr42=G42-R42 ; 相對於綠色像素G45,鄰近藍色像素B55方向之權值 ^55 ^ V^+(G45 -G65)2 + (Kb55 -Kb75)2,其中該色彩差異值 為 Kb55=G55-B55 、 Kb75=G75-B75 ; k 相對於綠色像素G45,鄰近紅色像素R46方向之權值 趴6為7^^-〇47)2 + (&46-;^48)2,其中該色彩差異值為Kbl7=G17-B17 and so on. From the color difference values in the above directions, the weight W33 of the direction adjacent to the blue pixel B33 with respect to the red pixel R44' is ▽1 + (Kr44 - Kr22^T(Kb33 - Kbl 1)^, relative to the red Pixel R44, the weight W53 of the direction adjacent to the blue pixel B53 is ~7 --=======-- 1 ........"; VI + (Kr44 - Kr62)2 + (Kb53 - Kbl\)2 Relative to the red pixel R44, the weight W55 of the direction adjacent to the blue pixel B55 is ~r 1 · V1 + (Kr44~Kr66)2+(Kb55-Kb77)2 relative to the red pixel R44, adjacent to the blue The weight W35 in the direction of the pixel B35 is ~1 - ———— =-〇VI + (Kr44 - Kr26)2 + (Kb35 - Kbl7)2 After learning the weight (W) of each of the above-mentioned oblique directions, The pixel difference between the adjacent pixels of the oblique angle is K33=G33-B33, K53=G53-B53, K55=G55-B55, Km-G35-B35, and the green pixel G44 obtained in the previous step and the red to be interpolated Pixel R44 to get the value of the interpolated blue pixel B44, as in equation (2): B44=G44-(W33X K33 + W53X K53 + W55X K55 + W35X K35)/(W33 + W53 + W55 + W35)---- ---------------------------- (2) And the same reason can be calculated to interpolate the red pixel R44 and bevel Near pixels (such as B33, B53, B55, B35, etc.). In this step, the red pixel (R) on the blue pixel (B) is interpolated as the blue pixel (B) in which the red pixel (R) is interpolated. 2. Interpolating the red pixel (R) and the blue pixel (B) at the green pixel (G) position: ^ ^ Interpolating the red pixel G45 in the color filter array shown in the seventh figure For example, the pixel R45 needs to calculate the weight of the green pixel G45 adjacent to each of the 21 1282519 directions, and the weight is calculated by using the color difference value in each direction to obtain an accurate interpolation value, as shown in the following formula: Relative to the green pixel G45 ' Its weight adjacent to the direction of the red pixel R44 is 5 W "G43"; + (Κτ44^Γ, where the color difference value is Kr44=G44-R44, Kr42=G42-R42; relative to the green pixel G45, adjacent to the blue pixel B55 The weight of the direction is ^55 ^ V^+(G45 -G65)2 + (Kb55 -Kb75)2, where the color difference value is Kb55=G55-B55, Kb75=G75-B75; k is relative to the green pixel G45, adjacent The weight 趴6 of the red pixel R46 direction is 7^^-〇47)2 + (&46-;^48)2, where the color difference value is

Kr46=G46-R46 、 Kr48=G48-R48 ; 相對於綠色像素G45,鄰近藍色像素B35方向之權值 —為 λ/Ϊ+ (G45 - G25)2 + (Kb35 - Kbl5)2,其中該色彩差異值 為 Kb35=G35-B35 、 Kbl5=G15-B15 。 得出上述之各方向權值後,即以本實施例步驟一所得 之結果得知鄰近上述綠色像素G45之各像素之内插值,如 齡 内插紅色像素R44之綠色像素G44、内插藍色像素B45之 綠色像素G55、内插紅色像素R46之綠色像素G46與内插 藍色像素B35之綠色像素G35。 再以步驟二所得之結果得知各鄰近像素之内插值,如 内插紅色像素R44之藍色像素B44與内插紅色像素R46之 藍色像素B46,與其鄰近像素B35與B55可得像素差值 (K ),如 K44=G44-B44、K55=G55-B55、K46=G46-B46 與 K35二G35-B35等。並由上述之權值與像素差值可得本實施例 内插綠色像素G45之藍色像素Β45,如同第一實施例之方 22 1282519 · 程式(3): B45=G45-(W44x K44 + W55X κ, + w.x K. + W.x KsO/CWss + W53+ W55 + W35)------〜一— (3) 内插綠色像素G45之红 心、、工邑像素R45之步驟如同上述内 • 插之藍色像素B45。 . 四、重建影像綠色像素色彩校正: 、經由本實施例步驟-、二、三後,需對其中紅色平面 位置上遺、落的綠色像素色彩校正,但此為—選擇性之步 馨 驟,並非一定要執行,係因於步驟一中,其色彩差異值域 是以雙線性内插法評估,j:匕一評估方式會造成内插上的誤 差,因此在此最後步驟中,可以選擇性地再以内插法校正 • 此一誤差,如以校正綠色像素G44為例: • 請參閱第八圖’先計算原始像素(如R44)與鄰近相 同像素之色彩差異值,係利用各方向色彩差異值產生鄰近 紅色像素R44各方向的權值: I— -1—— ^— , ^/1 + (Kr44 - Kr24)2 + (Kr34 - Krl4)2 ⑩ 其中 Kr44=G44-R44、Kr24=G24-R24、Kr34=G34-R34 與 Krl4=G14-R14 ; W43 = V- , yi + (Kr44 - Kr42)2 + (Kr43 - Kr41)2 其中 Kr44=G44-R44、Kr42=G42-R42、Kr43=G43-R43 與 Kr41=G41-R41 ; W54= / ,, ▽1 + (Kr44 - Kr64)2 + (Kr54 - Kr74)2 其中 Kr44=G44-R44、Kr64=G64-R64、Kr54=G54-R54 與 Kr74=G74-R74 ; W45= - - , ψ + (Kr44 - Kr46)2 + (Kr45 - Kr47)2 23 1282519 其中 Kr44=G44-R44、Kr24=G24-R24、Kr34=G34-R34 與 Krl4=G14-R14 。 再計算各相鄰像素間差值K34、K43、K54、K45,如Kr46=G46-R46, Kr48=G48-R48; with respect to the green pixel G45, the weight of the direction adjacent to the blue pixel B35 is λ/Ϊ+(G45 - G25)2 + (Kb35 - Kbl5)2, where the color The difference values are Kb35=G35-B35 and Kbl5=G15-B15. After obtaining the weight values of the above-mentioned directions, the interpolated values of the pixels adjacent to the green pixel G45 are obtained as a result of the first step of the embodiment, such as inserting the green pixel G44 of the red pixel R44, interpolating blue. The green pixel G55 of the pixel B45, the green pixel G46 of the red pixel R46, and the green pixel G35 of the blue pixel B35 are interpolated. Then, the interpolation result of each neighboring pixel is obtained by the result obtained in the second step, for example, the blue pixel B44 of the red pixel R44 and the blue pixel B46 of the red pixel R46 are interpolated, and the pixel difference between the neighboring pixels B35 and B55 is obtained. (K), such as K44=G44-B44, K55=G55-B55, K46=G46-B46 and K35 two G35-B35. And the blue pixel Β45 of the green pixel G45 is inserted in the embodiment according to the weight value and the pixel difference value as described above, as in the case of the first embodiment 22 1282519 · Program (3): B45=G45-(W44x K44 + W55X κ, + wx K. + Wx KsO/CWss + W53+ W55 + W35)------~1—(3) The steps of interpolating the red pixel of the green pixel G45 and the process pixel R45 are as described above. Blue pixel B45. 4. Reconstructing the image green pixel color correction: After the steps -, 2, and 3 of the embodiment, the color of the green pixel in the red plane position needs to be corrected, but this is a selective step, It is not necessary to perform, because in step 1, the color difference range is evaluated by bilinear interpolation, j: the evaluation method will cause interpolation error, so in this last step, you can choose Correctly interpolate • This error, such as the correction of green pixel G44 as an example: • Refer to Figure 8 'First calculate the color difference between the original pixel (such as R44) and the adjacent pixel, using the color in each direction The difference value produces weights in all directions adjacent to the red pixel R44: I - -1 - ^ - , ^/1 + (Kr44 - Kr24)2 + (Kr34 - Krl4)2 10 where Kr44=G44-R44, Kr24=G24 -R24, Kr34=G34-R34 and Krl4=G14-R14; W43 = V- , yi + (Kr44 - Kr42)2 + (Kr43 - Kr41)2 where Kr44=G44-R44, Kr42=G42-R42, Kr43= G43-R43 and Kr41=G41-R41; W54= / ,,▽1 + (Kr44 - Kr64)2 + (Kr54 - Kr74)2 where Kr44=G44-R44, Kr6 4=G64-R64, Kr54=G54-R54 and Kr74=G74-R74; W45= - - , ψ + (Kr44 - Kr46)2 + (Kr45 - Kr47)2 23 1282519 where Kr44=G44-R44, Kr24=G24 -R24, Kr34=G34-R34 and Krl4=G14-R14. Then calculate the difference between each adjacent pixel K34, K43, K54, K45, such as

KwG34-R34、K43=G43-R43、K54=G54-R54、K45=G45-R45 等。 最後再與各方向權值14、?43、界54、145校正内插紅色 • 像素以4的綠色像素G44,如步驟一之方程式(1): G44=R44+(Ws4X K34 + W43X K43 + W54X K54 + W45X K45)/(Ws4 ^ +W43 + W54 + W45)--------------------------------⑴ 其他於藍色平面位置上遺落的綠色像素色彩校正亦類 似上述校正於紅色平面位置上遺落的綠色像素。 上述藉計算原始紅色像素R鄰近各方向(如垂直、水 '平、斜角方向等)的權值與像素差值,權值之計算可以原 • 始像素各方向之相鄰像素間差值(K)得出,亦可藉各方向 之色I差異值所计鼻之各相鄰像素間差值(Kr或Kb )得出 該像素之内插值G與B,並同理推導藍色像素B之内插像 素R與G,再計算出綠色像素g之内插值R與b,即得出完 • 整原始平面中各像素之内插值通式。 以上述原始像素與鄰近像素之關係内插出該像素之内 插值,其步驟如第九圖所示: 開始時,由感光元件上擷取原始影像資料(raw data) ’並產生彩色濾光片陣列(CFA)為貝爾圖形的數位 影像’與取得相關像素位置,其中包括需内插像素之複數 個原始像素,如第一原始像素、第二原始像素與第三原始 t象素’可分別表示紅色像素R、藍色像素B與綠色像素G 等’如第六圖中的紅色像素R44、藍色像素B33與綠色像 24 1282519 * 素G45等原始像素,在個別計算該原始像素之另外兩 插像素(步驟S901); 首先,先計算該第一原始像素之第一組鄰近像素方向 之權值,其實施例可藉第一原始像素之垂直或水平方向^ 的各鄰近像素間的關係計算各鄰近像素的權值,如第^ 中鄰近紅色像素R44的G34、G43、G54、G45等綠色像素之 複數個權值w (步驟S903); ”KwG34-R34, K43=G43-R43, K54=G54-R54, K45=G45-R45, and the like. Finally, with the weight of each direction 14,? 43. Boundary 54, 145 corrects the interpolated red • pixel with green pixel G44 of 4, as in step 1 of equation (1): G44=R44+(Ws4X K34 + W43X K43 + W54X K54 + W45X K45)/(Ws4 ^ +W43 + W54 + W45)--------------------------------(1) Other green pixels left in the blue plane position The color correction is also similar to the green pixel corrected for the red plane position described above. The above calculation calculates the weight of the original red pixel R adjacent to each direction (such as vertical, water 'flat, oblique direction, etc.) and the pixel difference value, and the weight value can be calculated as the difference between adjacent pixels in each direction of the original pixel ( K) It is concluded that the interpolated values G and B of the pixel can also be obtained by the difference between the adjacent pixels (Kr or Kb) of the nose in the difference of the color I in each direction, and the blue pixel B is derived in the same manner. The pixels R and G are interpolated, and the interpolated values R and b of the green pixel g are calculated, that is, the interpolation formula of each pixel in the original plane is obtained. The interpolated value of the pixel is interpolated in the relationship between the original pixel and the adjacent pixel, and the step is as shown in the ninth figure: At the beginning, the original image data is captured from the photosensitive element and the color filter is generated. The array (CFA) is a digital image of the Bell pattern 'and the associated pixel position, including a plurality of original pixels to be interpolated pixels, such as the first original pixel, the second original pixel and the third original t pixel' can be respectively represented The red pixel R, the blue pixel B, the green pixel G, and the like, such as the red pixel R44, the blue pixel B33, and the green image 24 1282519 * G45, etc. in the sixth figure, calculate the other two insertions of the original pixel individually. a pixel (step S901); first, first calculating a weight of a first set of adjacent pixel directions of the first original pixel, and an embodiment thereof may calculate each of the neighboring pixels in a vertical or horizontal direction of the first original pixel a weight of a neighboring pixel, such as a plurality of weights w of green pixels such as G34, G43, G54, G45 adjacent to the red pixel R44 in the first step (step S903);

本發明實施例係採用色彩差異值域實施影像内插,而 其色彩差異值域係以雙線性内插法來評估,即以此雙線性 内插法計算該第—原始像素與其相鄰同色系像素之平均值 (第一組雙線性内插值),計算出如第六圖中原始像素R44 與R24的雙線性内插值(R44 + R24)/2 (步驟S9〇5); «交’計算該第 — 外扣⑼尔〜郇处1豕I興步驟S8〇5 ^-組雙線性内插值間之第—組像素差值,即為第六圖 中複數個K值(步驟S907);In the embodiment of the present invention, the image interpolation is performed by using the color difference value domain, and the color difference value domain is evaluated by bilinear interpolation, that is, the first original pixel is calculated by the bilinear interpolation method. The average of the same color pixels (the first set of bilinear interpolation values), calculate the bilinear interpolation (R44 + R24)/2 of the original pixels R44 and R24 as shown in the sixth figure (step S9〇5); Crossing 'calculates the first-outer buckle (9) er ~ 郇 1 豕 I 步骤 step S8 〇 5 ^ - group bilinear interpolation value between the first group of pixel difference, that is, the multiple K values in the sixth figure (step S907);

…利用上述各方向鄰近像素之權值(w)與像素差值(κ) =出内插於第-原始像素之第像素,即代入方程式 德去中/與]·為像素於陣列中的位置,Xi j為第一原始 二,i,i為内插第一原始像素之第一内插像素。如第六圖 原始紅色像素R44之綠色像*⑽與其鄰近像素 理曾山甘’如内播藍色像素B33之綠色像素G33,並可同 S9&)广他鄰近像素之内插值G53、G35與G55等(步驟 -Xi.-+(Ww,jX Κμ,, + W.wx Κ,Μ + WiH.-x K1+1,J + Wl,J+i j J j + Wi, j-i +Wi+i, j +Wi, j+i)--------(4) 25 1282519 · 之權ί4 算該第—原始像素之第二_近像素方向 的各ΐ近ίΓ 藉第r原始像素之垂直或水平方命上 中irh素間的關細算各鄰近像素的權值,如第六圖 —=近、=色像素R44的B33、B53、B55、B35等藍色像素之 禝數個權值f (步驟S911 ); 、 後’將由絲式⑷所得出之各_像素與鄰近該第 像素之複數個原始像素相減,得出該第-原始像素 #去β像素之第二組像素差值(K),如第六圖所示之藍色 ’、33之像素差值K33=G33-Β33等(步驟S913); 利用上述第一原始像素之第二組鄰近像素方向之權值 與第二組像素差值〇〇代入方程式(5),得出内插於 第原始像素之第二内插像素,其中i與j為像素於陣列 中,位置,Xu為第一原始像素,Zi j為内插第一原始像素 之第二内插像素。如第六圖所示内插原始紅色像素R44之 藍色像素B44,與其鄰近像素之内插值,如内插藍色像素 B33之紅色像素r33,與其他鄰近像素之内插值奶3、R35 與R55等(步驟S915);...using the weight (w) and the pixel difference (κ) of the neighboring pixels in the above directions to be interpolated to the pixel of the first-original pixel, that is, to enter the equation, and to be the position of the pixel in the array. , Xi j is the first original two, i, i is the first interpolated pixel of the first original pixel. For example, in the sixth picture, the green image of the original red pixel R44*(10) and its neighboring pixels are Zengshangan', such as the green pixel G33 of the blue pixel B33, and can be interpolated with G53 and G35 in the vicinity of the S9& G55, etc. (Step-Xi.-+(Ww, jX Κμ,, + W.wx Κ, Μ + WiH.-x K1+1, J + Wl, J+ij J j + Wi, ji + Wi+i, j +Wi, j+i)--------(4) 25 1282519 · The right ί4 counts the first—the second of the original pixels _ near the pixel direction Γ Γ 借 第 第 原始 原始 原始 原始Or the weight of each neighboring pixel between the horizontal and the irh prime, as shown in the sixth figure—= near, = color pixel R44, B33, B53, B55, B35, etc. f (step S911); , after 'subtracting each _pixel obtained by the silk type (4) from a plurality of original pixels adjacent to the first pixel, and obtaining a second set of pixel difference values of the first-original pixel #-β pixel (K), as shown in FIG. 6, the pixel difference K33=G33-Β33 of 33, etc. (step S913); using the weight of the second group of adjacent pixels of the first original pixel and the second The group pixel difference 〇〇 is substituted into equation (5), and the interpolation is obtained. a second interpolated pixel of the first pixel, wherein i and j are pixels in the array, the position, Xu is the first original pixel, and Zi j is the second interpolated pixel interpolating the first original pixel. Inserting the blue pixel B44 of the original red pixel R44, the interpolated value of the adjacent pixel, such as the red pixel r33 of the interpolated blue pixel B33, interpolating the milk 3, R35 and R55 with other neighboring pixels (step S915) ;

Zi^-Xi^^CWi-uMX Ki~i,M + WiH,MX KiH,M + Wi + i,j+iX KiH, jH + Wi-1, jHX Ki-1, jH )/(Wi-l, M + WiH, M + WiH, jH + Wi-1, j + 〇 -------(5) 最後’進行校正遺落之色彩(步驟S917),如重建影 像綠色像素。 由上述步驟中,計算出該第一原始像素之第一内插像 素與第二内插像素,同理亦可得第二原始像素之第一内插 像素與第二内插像素,再以一不同於第一原始像素與第二 26 1282519 · 原始^素之第三原始像素為其主要的原始像素,依據已推 導計算内插像素之方程式計算其另外兩_像素,即可推 導出所有原始平面上的所有原始像素之内插值。 々並且,上述步驟S903與步驟S911中所提之權值計算 如第實知例所述施行於紅、綠、藍之原始平面上依據原 =像素各方向之像素值計算權值,而第二實施例中係以色 ¥差異值域用於原始像素之各方向權值判斷,以計算像素 差值,再進一步計算内插值,主要步驟如第十圖所示: 先由原始像素平面中擷取原始影像資料(raw data) (步驟S10),接著計算第一原始像素之第一組鄰近像素方 向之權值4卩W值(步驟S12),再計算第―原始像素與其 相鄰同色系像素之第一組雙線性内插值(步驟S14); ^之後,計算第一原始像素與第一組雙線性内插值間之 f一組像素差值,即K值(步驟⑽,並由此得出内插於 第一原始像素之第一内插像素(步驟S18); > 疋计异第二内插像素,與第一實施例不同之處為 先计算第原始像素與鄰近原始像素之色彩差異值,如Kr 或Kb ^ (步驟S2〇),再依據此色彩差異值計算第一原始 像素之第二組鄰近像素方向之權值(步驟S22),再計算第 一原始像素各鄰近像素之第二組像素差值,此為^ (步 ,S24)有此得出内插於第—原始像素之第二 (步驟S26); 為了杈正上述步驟可能產生的誤差,可繼續計算第一 L始像素ί鄰近i目同像素之色彩差異值,如以值(步驟 ,猎新叶异當中像素差值,進行校正遺落之色彩(步 27 1282519 . 驟 S30)〇 如第十一圖所示之流程,其應用上述第九與十圖所述 之流程,計算出原始平面上各原始像素之内插值,流程如 下·· 開始時,擷取原始影像資料,並產生彩色濾光片陣列 (CFA)為貝爾圖形的數位影像(步驟si〇〇); 接著計算第一原始像素之第一組鄰近像素方向之 (步驟 S101);Zi^-Xi^^CWi-uMX Ki~i, M + WiH, MX KiH, M + Wi + i, j+iX KiH, jH + Wi-1, jHX Ki-1, jH )/(Wi-l, M + WiH, M + WiH, jH + Wi-1, j + 〇-------(5) Finally 'correct the color of the fall (step S917), such as reconstructing the image green pixel. From the above steps Calculating the first interpolated pixel and the second interpolated pixel of the first original pixel, and similarly obtaining the first interpolated pixel and the second interpolated pixel of the second original pixel, and then different from the first The original pixel and the second 26 1282519 · the original original pixel of the original element is its main original pixel, and the other two _ pixels are calculated according to the equation for deriving the calculated interpolation pixel, and all the originals on all the original planes can be derived. Interpolating the pixels. In addition, the weight calculations in the above steps S903 and S911 are performed on the original planes of red, green, and blue as described in the practical example, and the calculation is performed according to the pixel values of the original = pixel directions. Value, and in the second embodiment, the color ¥ difference value field is used for the weight determination of each direction of the original pixel to calculate the pixel difference value, and then further calculate the interpolation value, the main The steps are as shown in the tenth figure: Raw data is first taken from the original pixel plane (step S10), and then the weight of the first set of adjacent pixels of the first original pixel is calculated as 4卩W value ( Step S12), recalculating the first set of bilinear interpolation values of the first original pixel and its adjacent homochromatic pixels (step S14); ^, calculating the f between the first original pixel and the first set of bilinear interpolation values a set of pixel difference values, that is, a K value (step (10), and thereby obtaining a first interpolated pixel interpolated to the first original pixel (step S18); > a second interpolated pixel, and the first The difference between the embodiments is that the color difference value between the original pixel and the adjacent original pixel is calculated first, such as Kr or Kb ^ (step S2〇), and then the second set of adjacent pixel directions of the first original pixel is calculated according to the color difference value. Weight (step S22), recalculating the second set of pixel difference values of each adjacent pixel of the first original pixel, where ^ (step, S24) is obtained by interpolating the second pixel of the first original pixel (step S26) In order to correct the error that may occur in the above steps, the first L initial image can be continuously calculated. ίThe color difference value of the pixel adjacent to i, such as the value (step, hunting the difference between the pixels in the new leaf, to correct the color of the fall (step 27 1282519. S30), such as the process shown in Figure 11 Applying the flow described in the above ninth and tenth drawings to calculate the interpolation value of each original pixel on the original plane, the flow is as follows: · At the beginning, the original image data is captured, and a color filter array (CFA) is generated. a digital image of the Bell pattern (step si〇〇); then calculating a first set of adjacent pixel directions of the first original pixel (step S101);

再計算第一原始像素之第一組像素差值,其中運用了 第一原始像素與其相鄰同色系像素間之雙線性内插法來 算該像素差值(步驟S103); " 、即以權值與像素差值代入内插公式(如本發明之方程 式(4)或(5)),得出内插於第一原始像素之第一内插 (步驟 S105) ; μ 再進行計算第-原始像素之第二_近像素方向Recalculating the first set of pixel difference values of the first original pixel, wherein the pixel difference is calculated by using a bilinear interpolation between the first original pixel and its adjacent homochromatic pixels (step S103); " Substituting the weight value and the pixel difference value into the interpolation formula (such as equation (4) or (5) of the present invention), the first interpolation interpolated into the first original pixel is obtained (step S105); - second pixel of the original pixel_near pixel direction

值(步驟S1G7) ’計算第-原始像素各鄰近像素之第二組 像素差值(步驟S1G9) ’接著將權值與像素差值代入内插 公式’並得出内插於第-原始像素之第二内插像素(步驟 Sill); 弟一原始像素之 之第一組鄰近像 於開始擷取原始像素後,可同時進行 内插像素之計算,即先計算第二原始像素 素方向之權值(步驟S102); 再運用了第-原始像素與其相鄰同色系像素間之 性内插法來計算該像素差值,”算第 ^ 像素之第一組像素差值(步驟S104). 象素各#近 28 1282519 原始像素之第-内插像素(步 驟 以得出内插於第 S106); 繼續計算第二原始像素之第二組鄰 (步驟测),並計算第二原始像素二象=權: ,素差似步驟S1H)),最後代人本發明之内插公式# 出内插於第二原始像素之第二内插像素(步驟S112)。于 當計算出上述第-原始像素與第二原始像素之内插像 素後,以此結果可得丨第三原始像素之内插像素。 開始時,計算第三原始像素之第-組鄰近像素方向之 權值(步驟S113); 辽财方向之 像始像素與第二原始像素所得之内插 像素计异第二原始像素各鄰近像素之第一組像素差值 驟S115),並代入本發明之内插公式得出内插於第於 像素之第一内插像素(步驟Si 17); 、 同理’接著計算第三原始像素之第二組鄰近像素 ^權值(步驟SU9),再計算第三原始像素各鄰近像素之 第二組像素差值(步驟S121),最後,得出内插於第 始像素之第二内插像素(步驟S123)。 ’、 然而,上述步驟S103與S104係以雙線性内插法來評 ,各像素狀色彩差異值域,會造助插上的誤差, =後-步驟S125中’即針對當時使用雙線性内插法計 ,差值的部分校正’重新計算#中像素差值,如K34、^、 、K‘5 等。 經第十一圖所7F之流程,以不同顏色之第一原 素、第二原始像素㈣三原始像素為基礎,由各鄰近i素 29 1282519 =出各方向之權值’並算出之間像素差值,以本發明所提 七、之内插公式得出各原始像素之内插像素。 、綜上所述,本發明提供一具方向性權值之色彩内插方 ^,改善習用内插法產生的邊緣模糊,有效對影像邊緣進 仃内插’實為-不可多得之發明物品,及具產業上之利用 性:新穎性及進步性,完全符合發明專利申請要件,爰依 ,提出中請,敬請詳查並賜準本案專利,以保障發明者權 盈0Value (step S1G7) 'calculating the second set of pixel difference values of each adjacent pixel of the first-original pixel (step S1G9) 'Substituting the weight value and the pixel difference value into the interpolation formula' and deriving the interpolation into the first-origin pixel The second interpolated pixel (step Sill); the first set of adjacent pixels of the original pixel can be simultaneously calculated by inserting the original pixel, that is, the weight of the second original pixel direction is calculated first. (Step S102); using the sexual interpolation between the first original pixel and its adjacent homochromatic pixels to calculate the pixel difference value, "the first set of pixel difference values of the second pixel (step S104). Pixels Each #近28 1282519 first-interpolated pixel of the original pixel (step to get interpolated at step S106); continue to calculate the second set of neighbors of the second original pixel (step measurement), and calculate the second original pixel two image = Weight: , the prime difference is similar to step S1H)), the last generation of the interpolation formula of the present invention # is inserted into the second interpolation pixel of the second original pixel (step S112). When calculating the above-mentioned first-original pixel After inserting the pixels into the second original pixel, the result is obtained. Interpolating the pixels of the three original pixels. Initially, calculating the weight of the first set of adjacent pixel directions of the third original pixel (step S113); the interpolated pixel difference between the image start pixel and the second original pixel in the Liaocai direction a first set of pixel difference values of adjacent pixels of the second original pixel, and substituting the interpolation formula of the present invention to obtain a first interpolated pixel interpolated to the pixel (step Si 17); Then calculating a second set of neighboring pixel weights of the third original pixel (step SU9), and then calculating a second set of pixel difference values of each adjacent pixel of the third original pixel (step S121), and finally, interpolating at the beginning The second interpolated pixel of the pixel (step S123). ', however, the above steps S103 and S104 are evaluated by bilinear interpolation, and each pixel-like color difference value domain will cause an error of insertion, after - In step S125, 'for the time using the bilinear interpolation method, the partial correction of the difference 'recalculates the pixel difference in #, such as K34, ^, K, 5, etc.. Process, with the first element of different colors, the second original pixel (four) three original Based on the pixel, each neighboring element i 29 2982519 = the weight value in each direction 'and calculate the pixel difference between the two, and the interpolated formula of each original pixel is obtained by the interpolation formula of the present invention. As described above, the present invention provides a color interpolation method with directional weights, which improves the edge blur generated by the conventional interpolation method, and effectively interpolates the image edge into a real-unique invention article, and With industrial use: novelty and progressiveness, fully in line with the requirements for invention patent applications, conversion, and requests, please check and grant the patent in this case to protect the inventor's rights.

准以上所述僅為本發明之車交佳可行實施例,非因此即 拘=本u之專利範圍,故舉凡運用本發明說明書及圖示 内合所為之等效結構變化,均同理包含於本發明之範圍 内,合予陳明。 【圖式簡單說明】 第一圖所不為習知技術彩色濾光片陣列示意圖; 第二A圖係為習用技術影像邊緣示意圖; 第二B圖係為習用技術中通過之影像邊緣彩色濾光片 陣列示意圖; 第二A圖係為習用技術影像邊緣示意圖; 第二B圖係為習用技術中通過之影像邊緣彩色濾光片 陣列示意圖; 第四A圖所不為各鄰近像素實施例示意圖; 第四B至四E圖所示為需内插之像素與其鄰近像素關 係示意圖; 第五圖所不為斜角邊緣之鄰近像素實施例示意圖; 30 1282519 - 第六圖所示為本發明計算内插像素值的彩色濾光片陣 列不意圖, 第七圖所示為本發明計算内插像素值的彩色濾光片陣 列示意圖; 第八圖所示為本發明利用色彩差異值計算方向權值示 意圖; 第九圖所示為本發明内插法實施例流程圖; 第十圖所示為本發明内插法實施例流程圖; 第十一圖所示為本發明内插法實施例流程圖。 【主要元件符號說明】 第一區域21 第二區域22 第三區域33 第四區域34 左方區域41 右方區域42 上方區域51 下方區域52 第一斜角方向81 第二斜角方向82 第三斜角方向83 第四斜角方向84 31The above is only a feasible embodiment of the vehicle of the present invention, and therefore, the scope of the patent is not limited to the scope of the patent. Therefore, the equivalent structural changes in the specification and the illustration of the present invention are equally included in Within the scope of the present invention, Chen Ming is incorporated. [Simple diagram of the diagram] The first diagram is not a schematic diagram of a conventional color filter array; the second diagram is a schematic diagram of the edges of the conventional technology image; the second diagram is the image edge color filter adopted by the conventional technique. Schematic diagram of the chip array; the second A picture is a schematic diagram of the edge of the conventional technology image; the second B picture is a schematic diagram of the image edge color filter array adopted in the conventional technology; the fourth A picture is not a schematic diagram of each adjacent pixel embodiment; 4B to EE are diagrams showing the relationship between pixels to be interpolated and their neighboring pixels; FIG. 5 is a schematic diagram of an embodiment of adjacent pixels not being beveled edges; 30 1282519 - Figure 6 is shown in the calculation of the present invention The color filter array with pixel values is not intended. The seventh figure shows a color filter array for calculating the interpolated pixel values according to the present invention. The eighth figure shows the method for calculating the direction weights by using the color difference values. The ninth figure shows a flow chart of an embodiment of the interpolation method of the present invention; the tenth figure shows a flow chart of an embodiment of the interpolation method of the present invention; and the eleventh figure shows the implementation of the interpolation method of the present invention; Example flow chart. [Description of main component symbols] First region 21 Second region 22 Third region 33 Fourth region 34 Left region 41 Right region 42 Upper region 51 Lower region 52 First oblique direction 81 Second oblique direction 82 Third Bevel direction 83 fourth bevel direction 84 31

Claims (1)

1282519 •、申請專利範圍: 1· -種具方向性權值之色彩内插方法,該方法步驟包括 有: 榻取複數個原始像素; 產生一彩色濾、光片陣列之數位影像; 計^該原始像素之第一組鄰近像素方向之權值; 計算該原始像素之第—組雙線性内插值; 计算该原始像素之複數個鄰近像素與該第一組雙線性 内插值間之第一組像素差值; 得f内插於該原始像素之-第-内插像素; 計=該原始像素之第二組鄰近像素方向之權值; 計算該原始像素之第二峰素差值;以及 得出内插於該原始像素之—第二内插像素。 2. f申請專利範圍第1項所述之具方向性權值之色彩内 主其中該原始像素之第—組鄰近像素與第二組 .…方向之權值係為由該原始像素之垂直或水平 方向上的複數個鄰近像素計算之。 3·專利乾圍第1項所述之具方向性權值之色彩内 ㈣=其中於該計算該原始像素之第一組雙線性内 該色^Γ ’係採用一色彩差異值域實施影像内插, “ ^ 、值域係以-雙線性内插法來評估。 :::專:!圍第3項所述之具方向性權值之色彩内 相_“===插法係計算紗始像素與其 32 1282519 5. 如申請專利範圍第1項所述之具方向性權值之色彩内 插方法,其中該第一内插像素係由該第一組鄰近像素 方向之權值與該第一組像素差值代入下列方程式得 出: Yi, i=Xi, j+(Wi-i, jX Ki-i, j + Wi, j-iX Ki, j-i + Wi+i, jX Ki+i, j + Wi, j+i x Ki,川)/(Wi-i,J + Wi,]—i + WhuJ + Wi,川) 其中i與j為該複數個原始像素於一彩色濾光片陣列 (CFA)中的位置,乂心為該原始像素,Yi,j為内插該原 始像素之該第一内插像素。 6. 如申請專利範圍第1項所述之具方向性權值之色彩内 插方法,其中該第二内插像素係由該第二組鄰近像素 方向之權值與該第二組像素差值代入下列方程式得 出: Zi, j = Xi, j-(Wi-l, j-lX Ki-1, j-1 + Wi + 1, j-lX Ki + 1, j-1 + Wi + 1, j + lX Ki + 1, j + 1 + Wi-1, j + lX Ki-1, j + l)/(Wi-l, j-1 + Wi + 1, j-1 + Wi + 1, j + 1 + Wi-1, j + l) 其中i與j為該複數個原始像素於一彩色濾光片陣列 (CFA)中的位置,Xu為該原始像素,Zu為内插該原 始像素之該第二内插像素。 7. 如申請專利範圍第1項所述之具方向性權值之色彩内 插方法,藉重新計算該第一組像素差值進行校正使用 該雙線性内插法計算得的誤差。 8. —種具方向性權值之色彩内插方法,該方法步驟包括 有: 擷取複數個原始像素; 產生一彩色濾光片陣列之數位影像; 33 1282519 计异该原始像素之第一組鄰近像素方向之權值· 計算該原始像素之第一組雙線性内插值; 計算該原始像素之複數個鄰近像素與該第一組雙線性 内插值間之第一組像素差值; 得出該原始像素之一第一内插像素; 計^該原始像素與該鄰近原始像素之複數個異 值; ’、 計始像素之第二組鄰近像素方向之權值,係基 於该色彩差異值計算之; 計算該原始像素之第二組像素差值;以及 得出該原始像素之一第二内插像素。 9. C範圍第8項所述之具方向性權值之色彩内 鄰=音^該原始像素之第—組鄰近像素與第二組 =像素方向之權值係為由該原始像素之垂直或水平 方向上的複數個鄰近像素計算之。 第8項所述之具方向性權值之色彩内 插2步= 帽該原始像素之第-組雙線性内 該色木帛^差異值域實施影像内插, η.如=異?域係以一雙線性内插法來評估。 插方:,項所述之具方向性權值 之色彩内 相鄰同色系像插法係計算該原始像素與其 12.=專=圍第8項所述之具方向性權值之色彩内 方向ΐ權该第一内插像素係由該第-組鄰近像素 之㈣㈣第—峰素差域人下财程式得 34 1282519 · 出: Yi, j = Xi, j+(Wi-l, jX Ki-1, j + Wi, j-lX Ki, j-1 + Wi + 1, jX Ki + 1, j + Wi, j + 1 X Ki, j + l)/(Wi-l, j + Wi, j-1 + Wi + 1, j + Wi, j + l) 其中i與j為該複數個原始像素於一彩色濾光片陣列 • (CFA)中的位置,Xu為該原始像素,Yi,j為内插該原 始像素之該第一内插像素。 13. 如申請專利範圍第8項所述之具方向性權值之色彩内 插方法,其中該第二内插像素係由該第二組鄰近像素 • 方向之權值與該第二組像素差值代入下列方程式得 出: Zi, j^Xi, j-(Wi-l, j-lX Ki-1, j-1 + Wi + 1, j-lX Ki + 1, j-1 + Wi + 1, j + lX Ki + 1, j + l + Wi-1, j + lX Ki-1, j + l)/ (Wi-1, j-1 + Wi + 1, j-1 + Wi + 1, j + l + Wi-1, j + l) 其中i與j為該複數個原始像素於一彩色濾光片陣列 (CFA)中的位置,乂“為該原始像素,Zu為内插該原 始像素之該第二内插像素。 14. 如申請專利範圍第8項所述之具方向性權值之色彩内 φ 插方法,更藉重新計算該第一組像素差值進行校正使 用該雙線性内插法計算得的誤差。 15. 如申請專利範圍第8項所述之具方向性權值之色彩内 插方法,藉計算該原始像素與鄰近相同像素之色彩差 異值重新計算該第一組像素差值,以校正遺落之色彩。 16. —種具方向性權值之色彩内插方法,該方法步驟包括 有: 擷取複數個原始像素; 產生一彩色濾光片陣列之數位影像; 35 1282519 計算一第一原始像素之第一組鄰近像素方向之權值; 計算該第一原始像素各鄰近像素之第一組像素差值; 得出内插於該第一原始像素之一第一内插像素; 計算該第一原始像素之第二組鄰近像素方向之權值; 计鼻該第一原始像素各鄰近像素之第二組像素差值; 付出内插於該第一原始像素之一第二内插像素; 計算一第二原始像素之第一組鄰近像素方向之權值; 計算該第二原始像素各鄰近像素之第一組像素差值; 得出該第二原始像素之一第一内插像素; 計异該苐二原始像素之第二組鄰近像素方向之權值; 計算該第二原始像素各鄰近像素之第二組像素差值; 付出内插於该苐二原始像素之一第二内插像素; 计异一弟二原始像素之第一組鄰近像素方向之權值; 計异該苐二原始像素各鄰近像素之第一組像素差值; 得出内插於該第三原始像素之一第一内插像素; 计异该苐二原始像素之第二組鄰近像素方向之權值; 計算該第三原始像素各鄰近像素之第二組像素差值; 以及 得出内插於該第三原始像素之一第二内插像素。 π·如申請專利範圍第16項所述之具方向性權值之色彩内 插方法,其中該第一原始像素之第一組鄰近像素與第 一組鄰近像素方向之權值係為由該原始像素之垂直或 水平方向上的複數個鄰近像素計算之。 18·如申請專利範圍第16項所述之具方向性權值之色彩内 36 1282519 近C 一原始像素之第-組鄰近像素與第 近原向之權值係藉該第—原始像素與該鄰 ,、:像素之複數個色彩差異值得出。 插方i專16項所述之具方向性權值之色彩内 二組鄰近ΐιϊ第二原始像素之第—組鄰近像素與第 水平方向上的、之權值係為由該原始像素之垂直或 9 门上的後數個鄰近像素計算之。 插方i專16項所述之具方向性權值之色彩内 水平方向上值係為由該原始像素之垂直或 乃门上的硬數個鄰近像素計算之。 •插2專==:之具方向性權值之色彩内 插值之步驟,係素之第一組雙線性内 該色彩差里彳帛〜差異值域實施影像内插, 22.如申社專^域係以一雙線性内插法來評估。 插方項所述之具方向性權值之色彩内 相鄰同色以:=插法係計算該原爾^ 23:5專:=16項所述之具方向性權值之色彩内 —組鄰近if方^始像素之該第~内插像素係由該第 列方程ΐΐί向之權值與該第—組像素差值代入下 Xy+dijX Ki-i j + Wi 】]χ κ Ax Kl+1>J + Wl'J+1 其中1與j為該複數個原始像素於一彩色濾光片陣列 37 1282519 (CFA)中的位置,Xi’j為該第一原始像素、該第二原 ,像素或該第三原始像素,Yu為内插該原始像素之該 第一内插像素。 24·如申請專利範圍第16項所述之具方向性權值之色彩内 插方法,其中各原始像素之該第二内插像素係由該第 二組鄰近像素方向之權值與該第二組像素差值代入下 列方程式得出:1282519 •, the scope of application for patents: 1· - a color interpolation method with directional weights, the method steps include: taking a plurality of original pixels on the couch; generating a digital image of the color filter and the light film array; Calculating a weight of a first set of adjacent pixels of the original pixel; calculating a first set of bilinear interpolation values of the original pixel; calculating a first of a plurality of adjacent pixels of the original pixel and the first set of bilinear interpolation values a pixel difference value; a f-interpolated pixel of the original pixel; a weight of the second set of adjacent pixel directions of the original pixel; a second peak difference of the original pixel; A second interpolated pixel interpolated into the original pixel is derived. 2. f applies for the directional weight value described in item 1 of the patent scope. The weight of the first group of adjacent pixels and the second group of the original pixel is the vertical of the original pixel or Calculated by a plurality of adjacent pixels in the horizontal direction. 3. In the color of the directional weight as described in Item 1 of the patent circumstance (4) = where the color is calculated in the first set of bilinearity of the original pixel; Interpolation, "^, the range is evaluated by the - bilinear interpolation method. :::Special:! The color internal phase with directional weights as described in item 3_"===插法系Calculating the starting edge of the yarn and its 32 1282519 5. The color interpolation method with directional weight as described in claim 1 wherein the first interpolated pixel is weighted by the direction of the first set of adjacent pixels The first set of pixel differences is substituted into the following equation: Yi, i=Xi, j+(Wi-i, jX Ki-i, j + Wi, j-iX Ki, ji + Wi+i, jX Ki+i, j + Wi, j+ix Ki, Chuan) / (Wi-i, J + Wi,] - i + WhuJ + Wi, Sichuan) where i and j are the plurality of original pixels in a color filter array (CFA) The position in the center is the original pixel, and Yi, j is the first interpolated pixel in which the original pixel is interpolated. 6. The color interpolation method with directional weight according to claim 1, wherein the second interpolated pixel is a weight of the second group of adjacent pixels and the second group of pixels Substituting the following equation: Zi, j = Xi, j-(Wi-l, j-lX Ki-1, j-1 + Wi + 1, j-lX Ki + 1, j-1 + Wi + 1, j + lX Ki + 1, j + 1 + Wi-1, j + lX Ki-1, j + l)/(Wi-l, j-1 + Wi + 1, j-1 + Wi + 1, j + 1 + Wi-1, j + l) where i and j are the positions of the plurality of original pixels in a color filter array (CFA), Xu is the original pixel, and Zu is the second of the original pixels interpolated Interpolate pixels. 7. For the color interpolation method with directional weight as described in item 1 of the patent application, the error calculated by the bilinear interpolation method is corrected by recalculating the first group of pixel differences. 8. A color interpolation method with directional weights, the method steps comprising: capturing a plurality of original pixels; generating a digital image of a color filter array; 33 1282519 counting the first group of the original pixels Calculating a weight of a neighboring pixel direction, calculating a first set of bilinear interpolation values of the original pixel, and calculating a first set of pixel difference values between the plurality of neighboring pixels of the original pixel and the first set of bilinear interpolation values; Deriving a first interpolated pixel of the original pixel; calculating a plurality of different values of the original pixel and the adjacent original pixel; ', the weight of the second set of adjacent pixel directions of the counting pixel is based on the color difference value Calculating; calculating a second set of pixel difference values of the original pixel; and deriving a second interpolated pixel of the original pixel. 9. The chromaticity value of the directionality value in the eighth item of the C range is as follows: the first group of adjacent pixels of the original pixel and the weight of the second group = pixel direction are perpendicular to the original pixel or Calculated by a plurality of adjacent pixels in the horizontal direction. Color interpolation with directional weights as described in item 8 = 2 caps The first set of bilinears in the original pixel, the color 帛^ difference value domain performs image interpolation, η. It is evaluated by a bilinear interpolation method. Insertion: The adjacent color-matching method in the color of the directional weights described in the item calculates the in-color direction of the original pixel and its directional weight as described in item 12.=. The first interpolated pixel is obtained from the (four) (four) first-peak difference field of the first group of neighboring pixels. 34 1282519 · Out: Yi, j = Xi, j+(Wi-l, jX Ki-1 , j + Wi, j-lX Ki, j-1 + Wi + 1, jX Ki + 1, j + Wi, j + 1 X Ki, j + l)/(Wi-l, j + Wi, j-1 + Wi + 1, j + Wi, j + l) where i and j are the positions of the plurality of original pixels in a color filter array • (CFA), Xu is the original pixel, and Yi, j is interpolated The first interpolated pixel of the original pixel. 13. The color interpolation method with directional weight according to claim 8, wherein the second interpolated pixel is different from the second group of pixels by the weight of the second group of adjacent pixels. The value is substituted into the following equation: Zi, j^Xi, j-(Wi-l, j-lX Ki-1, j-1 + Wi + 1, j-lX Ki + 1, j-1 + Wi + 1, j + lX Ki + 1, j + l + Wi-1, j + lX Ki-1, j + l)/ (Wi-1, j-1 + Wi + 1, j-1 + Wi + 1, j + l + Wi-1, j + l) where i and j are the positions of the plurality of original pixels in a color filter array (CFA), 乂 "for the original pixel, Zu is the interpolation of the original pixel The second interpolated pixel. 14. The intra-color φ interpolation method with directional weight as described in claim 8 of the patent application, further recalculating the first set of pixel differences for correction using the bilinear interpolation The error calculated by the method. 15. The color interpolation method with directional weight as described in claim 8 recalculates the first group of pixel differences by calculating the color difference value of the original pixel and the adjacent pixel. Value to correct the color of the fall. 16. - Directions a color interpolation method of weights, the method steps comprising: capturing a plurality of original pixels; generating a digital image of a color filter array; 35 1282519 calculating a weight of a first set of adjacent pixel directions of a first original pixel Calculating a first set of pixel difference values of each adjacent pixel of the first original pixel; obtaining a first interpolated pixel interpolated in one of the first original pixels; calculating a second set of adjacent pixel directions of the first original pixel a second set of pixel difference values of each adjacent pixel of the first original pixel; a second interpolated pixel interpolated to one of the first original pixels; and a first set of adjacent pixels of a second original pixel Calculating a weight of the direction; calculating a first set of pixel difference values of each adjacent pixel of the second original pixel; obtaining a first interpolated pixel of the second original pixel; and discriminating the second set of adjacent pixels of the second original pixel Calculating a weight of the direction; calculating a second set of pixel difference values of each adjacent pixel of the second original pixel; and applying a second interpolated pixel interpolated to one of the second original pixels; a weight of the first group of adjacent pixels; a first set of pixel differences of adjacent pixels of the second pixel; a first interpolated pixel interpolated to one of the third original pixels; a weight of a second set of adjacent pixel directions of the original pixel; a second set of pixel difference values of each adjacent pixel of the third original pixel; and a second interpolated pixel interpolated to one of the third original pixels π· The color interpolation method with directional weight as described in claim 16 wherein the weight of the first set of adjacent pixels of the first original pixel and the direction of the first set of adjacent pixels is Calculated by a plurality of adjacent pixels in the vertical or horizontal direction of the original pixel. 18. Within the color of the directional weight as described in claim 16 of the patent scope 36 1282519 near C, the first group of neighboring pixels of the original pixel and the weight of the near-original direction are borrowed by the first-original pixel and the Neighbor, ,: The multiple color differences of pixels are worthy of being worth. The color of the directional weight value of the two sets of adjacent ΐιϊ second original pixels in the color of the insert i is specified by the first pixel of the second original pixel and the weight in the horizontal direction is perpendicular to the original pixel or The last few neighboring pixels on the 9 gate are calculated. The value in the horizontal direction of the color of the directional weight described in item 16 is calculated from the vertical pixels of the original pixel or a hard number of adjacent pixels on the gate. • Insert 2 special ==: the step of the color interpolation value of the directional weight, the first set of bilinearity within the first linearity of the color difference 差异 ~ difference value domain to implement image interpolation, 22. The domain is evaluated by a linear interpolation method. The adjacent color in the color of the directional weight described in the interpolation term is: = interpolation method calculates the color of the original ^ 23:5 special: = 16 items with directional weights - group proximity The first-interpolated pixel of the if-square pixel is substituted by the first-order equation ΐΐί and the first-group pixel difference into Xy+dijX Ki-i j + Wi 】] χ κ Ax Kl+1&gt ; J + Wl'J+1 where 1 and j are the positions of the plurality of original pixels in a color filter array 37 1282519 (CFA), and Xi'j is the first original pixel, the second original, and the pixel Or the third original pixel, Yu is the first interpolated pixel interpolating the original pixel. 24. The color interpolation method of directional weight according to claim 16, wherein the second interpolated pixel of each original pixel is weighted by the second set of adjacent pixel directions and the second The group pixel difference is substituted into the following equation: Zi^^j-(Wi-i,MX Ki-l,M + Wi + l,MX Ki+l,M + Wi + i,j + lX Ki + l,J + l + Wi-l, j + lX Ki-1, j + l)/(Wi-l, j-1 + Win, j-1 + WiH, j + l + Wi-1, j + l) 其中i與j為該複數個原始像素於一彩色濾光片陣列 (CFA)中的位置,Xu為該第一原始像素、該第二原 始像素或該第三原始像素,Zi,j為内插該原始像素之該 第二内插像素。 X 25·如申請專利範圍第16項所述之具方向性權值之色彩内 插方法,係藉重新計算該複數個像素差值進行校正使 用該雙線性内插法計算得的誤差。 26.如申請專利範圍第16項所述之具方向性權值之色奪 插方法,該第一原始像素與該第二原始像素之該第— 内插像素係以-雙線性内插法來評估各像素間= 差異值域,並針對使用該雙線性内插法 ^ 值的部分校正。 以彳冢素差 27·如申請專利範圍第16項所述之具方向性權值之 插方法,藉計异該原始像素與鄰近相同像素之乂、, 異值重新計算像素差值,以校正遺落之色彩。形差 38Zi^^j-(Wi-i, MX Ki-l, M + Wi + l, MX Ki+l, M + Wi + i, j + lX Ki + l, J + l + Wi-l, j + lX Ki-1, j + l)/(Wi-l, j-1 + Win, j-1 + WiH, j + l + Wi-1, j + l) where i and j are the plurality of original pixels in one The position in the color filter array (CFA), Xu is the first original pixel, the second original pixel or the third original pixel, and Zi, j is the second interpolated pixel interpolating the original pixel. X 25· The color interpolation method with directional weight as described in claim 16 of the patent application is performed by recalculating the plurality of pixel differences to correct the error calculated by the bilinear interpolation method. 26. The color interpolation method of directional weight according to claim 16, wherein the first original pixel and the first interpolated pixel of the second original pixel are bilinearly interpolated. To evaluate the inter-pixel = difference value field and correct for the partial use of the bilinear interpolation method. With the morphological weight insertion method described in item 16 of the patent application scope, the difference between the original pixel and the adjacent pixel is recalculated to correct the pixel difference value. The color of the fall. Shape difference 38
TW94118444A 2005-06-03 2005-06-03 Color interpolation method with directed weights TWI282519B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW94118444A TWI282519B (en) 2005-06-03 2005-06-03 Color interpolation method with directed weights

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW94118444A TWI282519B (en) 2005-06-03 2005-06-03 Color interpolation method with directed weights

Publications (2)

Publication Number Publication Date
TW200643820A TW200643820A (en) 2006-12-16
TWI282519B true TWI282519B (en) 2007-06-11

Family

ID=38823755

Family Applications (1)

Application Number Title Priority Date Filing Date
TW94118444A TWI282519B (en) 2005-06-03 2005-06-03 Color interpolation method with directed weights

Country Status (1)

Country Link
TW (1) TWI282519B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11076139B2 (en) 2018-08-16 2021-07-27 Realtek Semiconductor Corporation Color reconstruction device and method
US11645734B2 (en) 2019-05-15 2023-05-09 Realtek Semiconductor Corp. Circuitry for image demosaicing and contrast enhancement and image-processing method

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI400961B (en) * 2007-08-24 2013-07-01 Holtek Semiconductor Inc Algorithm of interpolation applied to ymcg color filter array
CN103974043B (en) * 2013-01-24 2016-02-10 瑞昱半导体股份有限公司 Image processor and image treatment method
TWI612800B (en) 2016-12-12 2018-01-21 瑞昱半導體股份有限公司 Flc-based image compression method and device thereof
CN108206955B (en) * 2016-12-19 2020-06-12 瑞昱半导体股份有限公司 Image compression method and device based on fixed length coding

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11076139B2 (en) 2018-08-16 2021-07-27 Realtek Semiconductor Corporation Color reconstruction device and method
US11645734B2 (en) 2019-05-15 2023-05-09 Realtek Semiconductor Corp. Circuitry for image demosaicing and contrast enhancement and image-processing method

Also Published As

Publication number Publication date
TW200643820A (en) 2006-12-16

Similar Documents

Publication Publication Date Title
CN1812592B (en) Method and apparatus for processing image data of a color filter array
CN103842879B (en) Imaging device and the method for the sensitivity ratio that calculates phase differential pixel
US8237831B2 (en) Four-channel color filter array interpolation
TWI504276B (en) Image sensor for capturing a color image
US9379156B2 (en) Per-channel image intensity correction
US20100309347A1 (en) Interpolation for four-channel color filter array
JP5040519B2 (en) Image processing apparatus, image processing method, and program
US20120002113A1 (en) Image processing device, image processing method, and program
US8494260B2 (en) Image processing device, image processing method, program, and imaging device
TWI282519B (en) Color interpolation method with directed weights
CN101006731A (en) Image processing device and method, imaging device, and computer program
JP2006134157A (en) Shading correction device, shading correction value computation device and imaging device
JP2005269645A (en) High-quality gradient correction linear interpolation for demosaic processing of color image
WO2010141055A2 (en) Color filter array pattern having four-channels
CN104202583B (en) Image processing device and method
US20090263047A1 (en) Converting bayer pattern rgb images to full resolution rgb images via intermediate hue, saturation and intensity (hsi) conversion
TWI338511B (en)
JP2010199650A (en) Image processing apparatus and method
CN113170061A (en) Image sensor, imaging device, electronic apparatus, image processing system, and signal processing method
CN101998127A (en) Signal processing device, imaging device, and signal processing method
JP4614601B2 (en) Shading correction method and apparatus
CN114762312A (en) Method for generating output signal of PDAF pixel
JP2002112276A (en) Color solid-state image pickup device
US7453503B2 (en) Pixel interpolation method
JP4032579B2 (en) Single plate solid-state image sensor color interpolation method and recording medium recording single-chip solid-state image sensor color interpolation processing program