TWI274908B - A method for interpolating the color of color filter array - Google Patents
A method for interpolating the color of color filter array Download PDFInfo
- Publication number
- TWI274908B TWI274908B TW94140979A TW94140979A TWI274908B TW I274908 B TWI274908 B TW I274908B TW 94140979 A TW94140979 A TW 94140979A TW 94140979 A TW94140979 A TW 94140979A TW I274908 B TWI274908 B TW I274908B
- Authority
- TW
- Taiwan
- Prior art keywords
- color
- pixel
- pixels
- value
- interpolation
- Prior art date
Links
Landscapes
- Color Television Image Signal Generators (AREA)
- Color Image Communication Systems (AREA)
- Image Processing (AREA)
- Facsimile Image Signal Circuits (AREA)
Abstract
Description
1274908 九、發明說明 【發明所屬之技術領域】 本發明是有關於一種影像色彩内插之方法,且特別是有 關於利用預先估算最小平方誤差(Mean Squafe麻瓜⑽; MSE)來内插彩色遽光器陣列所得到之影像之—種色彩内插 的方法。 Φ 【先前技術】 ,近年來,數位相機(Digitalst出cameras;DSCS)成為非 常受歡迎的消費性電子產品。數位相機—般係利用電荷耗人 元件(Charge C〇Uple Device; CCD)或互補式金氧半導: (CMOS)感側器將所感測到之入射光轉化成電氣信號,铁後 這些電氣信號經類比/數位的轉換,成為數位影像信號。' 為了節省取樣的色彩像素及感測器的尺寸,一般最常扩 用彩色遽光片陣列(Color Filter Array;⑽)來作為一種: _樣格式,因此鍍一層彩色濾光片陣列於CCD或cm〇s感側 器上。一般常使用之彩色濾光片陣列係採用貝爾(Βπα £ .以㈣所發表之CFA ’如第i圖所示’ #中r係為紅色、g 係為綠色以及B係為藍色。 當採用CFA時,每一個取樣點只有一個顏色,即全色 系(即紅、綠、藍三色)的三分之―,又因人類視覺對亮度 (Luimnance)即綠色(Green channel)較敏感,因此整個[FA 中,一半的濾光片係為綠色。接著藉由適當的處理運算,將 所要内插之像素所含之基本色素成分,藉由内插的方式加以 5 1274908 處理,得到最佳之真實影像結果。 -般習知之内插方法,是指決定函數中位在一些已知 取樣點中的未知值。傳統的内插方法非常多,例如最鄰近 點(Nearest Neighbor)内插、雙線性(BUinear)内插、三次 • B-SPHne (Cubic B-spHne)内插和三次迴旋(a- • C_ — )内插等内插方法。但這些傳統内插方法各有其 缺點,例如,最鄰近點内插法和雙線性内插法的運算速度 鲁雖快’但内插補償的品質普遍偏低,内插後的影像常出現 嚴重的模糊,且在邊界影像區域上出現很嚴重的瑕疲(即鑛 齒制小故未能提供良好的影像品質,在視訊影像日漸講 未高解析度、高對比度的現今,最鄰近點内插法和雙線性 内插法已經不太適用。 而三次B-spline内插法和三次迴旋内插法的運算,由 於需要眾多參數進行多重運算,故運算過程過於複雜,於 影像信號處理系絲中,絲A匕# Μ ,士山 示、、兄〒,雖忐提供精確且品質良好的内插 參,’但由於運异複雜且耗時,在實施時將造成產品的成本 提高’且亦不適用於即時的數位彩色取像系統。而且,於 應用CCD和CFA取樣格式的數位彩色取像系統中,應用 、傳統内插方法時,内插後的影像容易出現彩色雜點和邊緣 ,模糊,it匕為傳統内插方法最主要的缺點。 因此有必要提供一種新式的影像色彩内插技術,可使一 種數位影像處理系統内(例如:數位相機或數位攝影機)之彩 色肩光片陣列之色彩内插成較高品質之影像,且提供一 規則f生之决算法,有利於數位信號處理器或積體電路之實 6 1274908 現。 【發明内容】 因此根據上述之目的,本發明的目的之一就是在提供一 種影像色彩内插之方法,此影像色彩内插之方法係利用預先 估异最小平方誤差(Mean Square Minimum; MSE)來内插、還 原彩色慮光片陣列(Color Filter Array; CFA)的彩色影像。過 •程中亦採用一種色彩模型(KR,KB),使還原之色彩更接近於 人類的視覺反應。因此,本發明比習知技術具有較高的影像 品質,且於藍色像素之效果表現上更突出。 / 本發明之另一目的係在提供一種影像色彩内插之方 法,此影像色彩内插之方法係利用由矩陣運算所求出之鄰近 色彩像素權重值(Weights)。因為本發明之矩陣運算較規則 性,所以適合於將本發明之演算法實現於硬體上。。 振據本發明之上述目的,提出一種影像色彩内 _ 包含: 徒供棋盤陣列,具有交錯排列之複數個奇數列和複數個 偶數列’其中祺盤陣列上設置右 °又直百禝數個弟一像素、複數個第 一像素、和複數個第三像辛,筮_ 苐二像素之一部分與第一像素 係父錯排列在奇數列上,第伤 六料〇 素之另一部分與第二像素係 乂錯排列在偶數列上,其中第r 弟—像素之母四者係分別水平且 £直地緊相鄰於第一傻夸夕甘 者,每自“ 者或第二像素之其中- 者,母一苐一像素具有第一原色 一楚一f巳值弟一第二色内插值和第 弟二色内插值,每一第-祿|曰丄 母弟一像素具有第二原色值、第二第一 7 1274908 色内插值和第-笛_ Λ βπ 4:^ 一弟一色内插值,每一第三像素具有第三原色 值、弟二弟-色内插值和第三第二色内插值; 利用一内插步驟,以針對第-像素之第-標的像素, i Λ 中與第一標的像素最相鄰之十二個第三像 备主 、弟 的像素水平或垂直相鄰之四個第 •μ :、二士計算出第一標的像素之第一第三色内插值; 利用内插步驟’以針對第二像素之第二標的像素, 利用第二像素中愈第— 〃二 ,'弟一私的像素最相鄰之十二個第三像 ':庶冬弟像▲素:與第二標的像素水平或垂直相鄰之四個第 :、一來:异出第二標的像素之第二第三色内插值; 音φ 二一内插步驟’以針對第-標的像素,利用第二像 夕/二::標的像素對角線相鄰之四個第二像素、第一像素 4a& ^ ^ , γ興弟一標的像素對角線相鄰和位於第 一標的像素位置之五個 ^ 個弟一像素之第一第三内插值、及第一 像素中與弟一標的傻夸 狄山々 豕素對角線最相鄰之四個第一像素,來計 异出第一標的像夸夕键 豕f之弟—第二色内插值; 進行第四内插舟 利用第二像素二目:,?情第三像素之第三標的像素’ .^ 娜於第二標的像素之六個第二像素、第 «像素之第一第 一 徊筮屈主i —色内插值中最相鄰於第三標的像素之六 個第一像素中之第一繁一 Λ^. ^ 弟二色内插值、第一像素之第一第三色 内插值中與第三樟 楚一 Α Λ ,、的像素水平相鄰之二個第一像素之第一 弟二色内插值、第二 你主丰士 1 — 1家素之第二第三色内插值中與第三標的 像素垂直相鄰之二個 ^ 始本^ , 第二像素之第二第三色内插值、及第三 像素中水平與垂直如 ^ 邮於第三標的像素之四個第三像素,來 1274908 计算出第三標的像素 — |之第二第一色内插值; 仃弟五内插步騍,以針對第二 素中與第二標的像素”的像素,利用第-像 之第二第:内插值線相…個第-像素、第二像素 二標的像素位置之五個第二像素之第角線相鄰和位於第 像专中盥笛昂一弟二内插值、及第二 ’、’、一軚的像素對角線最相鄰之w ^ $ 算出第-庐μ#古 州心四個弟二像素,來計 弟-私的像素之第二第-色内插值;以及 辛中插步驟,以針對第三標的像素,利用第-像 ::標的像素之六個第-像素、第二像素之第 一弟二色内插值中最相鄰於第二 則目郇於弟—私的像素之六個第二像素 二-弟三色内插值、第二像素之第二第三色内插值中與 :二私的像素水平相鄰之二個第二像素之第二第三色内插 ,、第-像素之第一第三色内插值中與第三標的像素垂直相 4之二個第-像素之第—第三色内插值、及第三像素中水平 與垂直相鄰於第三標的像素之四個第三像素,來計算出第三 標的像素之第三第一色内插值。 【實施方式】 本發明係有關於一種影像色彩内插之方法,且特別是有 關於利用預先估异最小平方誤差(Meail Square Minimum; MSE)來内插彩色濾光器陣列中所得到之影像之一種色彩内 插的方法。以下將詳細討論本發明之較佳實施例的操作。然 而’在此所揭示的實施例並非本發明僅能思及的應用與使 用。所討論之特定實施例只是用來描述使用本發明的特定方 9 1274908 式,並非用以限定本發明之範圍或後附之申請專利範圍。 請再參照第1圖,本發明之影像色彩内插演算法係由下 述式(1)推導開始,其中尺㈠係為中心點實際值、尤,»為中心 點像素的估算值,而κ,(χ)是鄰近像素χ的實際值,其中i、· 係為鄰近像素之索引值(Index),Wi、Wj係為鄰近像素之權 重值(Weights),η係為鄰近像素點數。 = (1) 經由中心點實際值^和估算值^"(χ)之間的最小 差定義如式(2): " k{xyK(x)j) η η η 1 7-1 /=1 (2) η η η =Σ Σ wiwjc{x^ ^ 2Χ wtc(x, xt) + C(〇) )=1 ζ=1 方誤差,將 步推導出式 其中¢:(^7.)= ^(χ,)·尺(Ά,為了得到最小化平 式(2)偏微分如式(3)所示並令結果等於零,進— (4): (3) (4) 4,並將式(4) = 2^wJc(xi,Xj)- 2C(x,xi),i = 1,...,η f C(X丨·,X)) = C(X,Xy ),/ 1 f...yf7 在本發明之實施例中,將式(4)中的n設為 展開成式(5): 1274908 其中係為c(x〃x)),Q係為),最後鄰近色彩像素的 值可A 忘妨;π击二笛哲. ~w{ W2 W3 = w4 _ A _ CH c12 c13 C14 i C21 C22 C23 C24 1 C31 C32 C33 c34 i C41 C42 C43 C44 i ~ 1 1 1 l〇 γ-1 'c10~ C2〇 C30 C40 - 1 (6) 其中%請參照第2圖、第3圖,此个。叫· ,_ ..........讯%員 %例之一種影像色彩内插方法的流程圖、第3圖係繪示依照 本發明實施例之一種影像色彩内插方法的實施步驟流程圖 百先步驟10 :擷取彩色濾光片陣列之像素,然後送3 步驟20來進行。請再參照第1圖,設藍色像素(Bi,j)為中< ”、占像素,接著進行第2圖中之步驟20 ··内插綠色於此藍爸 像素上,内插方法之流程圖如第3圖所示,實施方法如下 步驟U0 :計算平均像素,如式(8)所示: 〇α ^ + G/+UJ" 〇iJ~l + )/4 ⑺ 第2圖係繪示依照本發明實 〜 :+2 J-l + ^/+2,7+1, ru+2 = fe-U+2 + GiJ+l + Gi+lJ+2)/3G·…-1,卜2 +G/+1 上2)/3 K、j “2,y G··」也u+G“2j+1)/3 G, (8) 其中此平均像素(G,)之計算係利用與中心點像素(Bi :鄰之 Gi-2,川、Gm,[2、G…、GM,j+2、Gi j i、 Gm,j-2、Gi+1,j、Gi+l j+2、Gi+2 j i 及 Gi+2,…的像素值。 接著如式(9)所示,進行步驟12(^計算不同位置的像 色差值,以求出十組的像素色差值後,其中計算像素 1274908 差值之計算係利用%o,2Ag,J B;+2;j"^^ 和’接著代回式(6),即進;;2 :;、:叫’ 此些權重值係為位 ·“權重值’ ΠΓ 士“、 …占像素(Bi,j)之四個鄰近位置(上、 下、左及右)的權重值(Wi,W2, W3, D。 接著步驟14G:進行色彩模型轉換,以求出於中心 素(BU)相鄰之四組不同像素位置(上、下、左及右)的轉換值 (KB ),轉換值(κΒ )係定義為Kb = g_b。轉換值之計算係利用 Gi.1J、^,卜1、Gi’j + 1、G…,j、B%·、Bi,j-2、BU、Βί+2,』及 Bi j+2。 而色彩轉換過程如式(10)所示。 C30 =1^/+2,7 ~5/,>HG/+2J C40 =“j+2 -'」+|G/j+2 ’12 =1^-2,厂 5/J-2| 啦一 2 j C13 =(|尽-2,厂尽+2 2,y C14 APi-2J ^BiJ^+\Gi-lJ [j-2^K2j\+\Gu_2 ^24 APiJ-l 和/+2,厂尽"+2丨啦+2,7· -0,^)/256+1 _G/j 1)/256+1 Ί产6+1 〜-2,|)/512+1 ,()/512+1 -G, -G,y+2()/512+l ))/512+1 {/512+1 -G, 、+2j \j^2 JU+2 丨/512+1 (9)BACKGROUND OF THE INVENTION 1. Field of the Invention This invention relates to a method of image color interpolation, and more particularly to interpolating color 利用 using a pre-estimated least square error (Mean Squafe Muggle (10); MSE). A method of color interpolation of an image obtained by an array of optics. Φ [Prior Art] In recent years, digital cameras (Digitalst out cameras; DSCS) have become very popular consumer electronics products. Digital cameras generally use a Charge C〇Uple Device (CCD) or a complementary MOS semiconductor: (CMOS) sensor to convert the sensed incident light into an electrical signal. The analog/digital conversion becomes a digital image signal. In order to save the size of the sampled color pixels and sensors, it is common to use a color filter array (Color Filter Array; (10)) as a type: _-like format, so a color filter array is coated on the CCD or Cm〇s on the side sensor. The commonly used color filter arrays are Bell (Βπα £. The CFA published by (4) is shown in Figure i. # 中中r is red, g is green, and B is blue. In CFA, each sampling point has only one color, that is, the full color system (ie, the three colors of red, green, and blue), and because human vision is sensitive to Luimnance or Green channel. In the whole [FA, half of the filters are green. Then, by appropriate processing, the basic pigment components contained in the pixels to be interpolated are processed by interpolation to 5 1274908. Real image results. - The conventional interpolation method refers to determining the unknown value of the function in some known sampling points. Traditional interpolation methods are very many, such as nearest neighbor (Nearest Neighbor) interpolation, double line Interpolation methods such as BUinear interpolation, cubic • B-SPHne (Cubic B-spHne) interpolation and cubic convolution (a- • C_ — ) interpolation, but these traditional interpolation methods have their own disadvantages, for example, Nearest point interpolation and bilinear interpolation Although the speed is fast, but the quality of the interpolation compensation is generally low, the image after interpolation often appears severely blurred, and there is a serious fatigue in the boundary image area (ie, the mineral tooth system is not good enough). Image quality, in the current video image is not high resolution, high contrast, the nearest neighbor interpolation and bilinear interpolation is not suitable. And three B-spline interpolation and three cyclotron interpolation The calculation of the method requires too many parameters for multiple operations, so the calculation process is too complicated. In the image signal processing system, silk A匕# Μ, Shishan, and Xiong, although providing accurate and good quality interpolation Participation, 'But because of the complexity and time-consuming operation, the cost of the product will increase when implemented' and it is not suitable for the instant digital color image acquisition system. Moreover, the digital color image acquisition system using the CCD and CFA sampling formats In the application, traditional interpolation method, the interpolated image is prone to color noise and edges, and blur, which is the main disadvantage of the traditional interpolation method. Therefore, it is necessary to provide a new type of Like color interpolation technology, the color of a color shoulder array in a digital image processing system (for example, a digital camera or a digital camera) can be interpolated into a higher quality image, and a rule algorithm is provided. It is advantageous for a digital signal processor or an integrated circuit. 6 1274908. [Invention] Therefore, in accordance with the above object, one of the objects of the present invention is to provide a method for image color interpolation, which is a color interpolation method. The color image of the Color Filter Array (CFA) is interpolated and restored using a pre-estimated least square error (MSE). A color model (KR, KB) is also used in the process to make the restored color closer to the human visual response. Therefore, the present invention has higher image quality than the prior art, and is more prominent in the effect of blue pixels. Another object of the present invention is to provide a method of image color interpolation which utilizes adjacent color pixel weights (Weights) as determined by matrix operations. Since the matrix operation of the present invention is relatively regular, it is suitable to implement the algorithm of the present invention on a hardware. . According to the above object of the present invention, an image color _ is included: Included: an array of chessboards having a plurality of odd-numbered columns and a plurality of even-numbered columns arranged in a staggered manner. One pixel, a plurality of first pixels, and a plurality of third pixels, one of the two pixels of the first pixel and the first pixel are arranged in an odd column, and the other part of the first pixel and the second pixel of the first pixel The system is arranged in an even column, where the second brother-pixel mother is horizontally and immediately adjacent to the first silly, each of the "or" or the second pixel. The mother has a first primary color, a first color, a second color interpolation value, and a second color interpolation value, and each of the first and second mothers has a second primary color value, a first 7 1274908 color interpolation value and a first - flute _ Λ βπ 4: ^ a color interpolated value, each third pixel has a third primary color value, a second color-interpolation value and a third second color interpolation; Using an interpolation step to target the first-target pixel of the first pixel, i Λ The first and third color interpolated values of the pixels of the first target are calculated by four pixels of the twelve third image masters and the younger brothers adjacent to the first target pixel horizontally or vertically adjacent to each other. Using the interpolation step 'to target the second target pixel of the second pixel, using the second pixel in the second - second, 'different private pixel's nearest twelve twelve images': 庶冬弟像▲ prime: four horizontally or vertically adjacent to the second target pixel: one, one: the second third color interpolated value of the second target pixel; the sound φ two one interpolation step 'for the first target a pixel, using the second pixel of the second image of the second/second::: the second pixel adjacent to the diagonal of the pixel, the first pixel 4a & ^ ^, the diagonal of the pixel of the first pixel and the pixel of the first target The first and third interpolated values of the five pixels of the position, and the four first pixels adjacent to the diagonal of the silly Quaidine in the first pixel, A standard like the quaint 豕f brother - the second color interpolation; the fourth interpolation boat uses the second pixel two: The third target pixel of the third pixel '.^ is the second pixel of the second target pixel, the first pixel of the first pixel is the most adjacent to the third interpolated value. The first one of the six first pixels of the target pixel is ^. ^ The second color interpolated value, the first third color interpolated value of the first pixel, and the pixel level of the third one. The first two-color interpolated value of the two adjacent first pixels, and the second second color interpolated value of the second main color of the second main pixel of the second main pixel are perpendicularly adjacent to the third target pixel. ^, the second third color interpolated value of the second pixel, and the third pixel in the third pixel horizontally and vertically as the third target pixel, to calculate the third target pixel - 2 of the second pixel Interpolating the first color; inserting the step by the fifth, with the second pixel of the first image: interpolating the value of the pixel of the second pixel and the pixel of the second pixel. The diagonal lines of the five second pixels of the pixel position of the pixel are adjacent to each other and are interpolated in the first image of the image. And the second ', ', and the next diagonal of the pixel diagonally the nearest w ^ $ to calculate the first - 庐μ# Guzhou heart four brothers two pixels, to count the younger-private pixels in the second - color Interpolating; and symplectic interpolation step, for the third target pixel, using the first pixel of the first-image::pixel, and the first two-color interpolated value of the second pixel being the most adjacent to the second target In the second pixel of the private-private pixel, the second-third-color interpolated value, and the second-third interpolated value of the second pixel are The third color interpolation, the first third color interpolating value of the first pixel, the third color interpolating value of the two first pixels of the vertical phase 4 of the third target pixel, and the horizontal sum of the third pixel The third first color interpolated value of the third target pixel is calculated by vertically adjacent to the fourth third pixel of the third target pixel. [Embodiment] The present invention relates to a method for image color interpolation, and in particular to interpolating an image obtained in a color filter array by using a Meail Square Minimum (MSE). A method of color interpolation. The operation of the preferred embodiment of the present invention will be discussed in detail below. However, the embodiments disclosed herein are not intended to be used and utilized in the present invention. The specific embodiments discussed are merely illustrative of the specific aspects of the invention, and are not intended to limit the scope of the invention or the scope of the appended claims. Referring to FIG. 1 again, the image color interpolation algorithm of the present invention is started by the following formula (1), wherein the ruler (1) is the actual value of the center point, especially, the value of the pixel is the center point, and κ (χ) is the actual value of the neighboring pixel ,, where i, · is the index value (Index) of the neighboring pixel, Wi, Wj is the weight value of the neighboring pixels, and η is the number of neighboring pixels. = (1) The minimum difference between the actual value of the center point ^ and the estimated value ^"(χ) is defined as (2): " k{xyK(x)j) η η η 1 7-1 /= 1 (2) η η η =Σ Σ wiwjc{x^ ^ 2Χ wtc(x, xt) + C(〇) )=1 ζ=1 square error, the step is derived from where ¢:(^7.)= ^(χ,)·尺(Ά, in order to get the minimum flat (2) partial differential as shown in equation (3) and let the result be equal to zero, enter - (4): (3) (4) 4, and (4) = 2^wJc(xi,Xj)- 2C(x,xi),i = 1,...,η f C(X丨·,X)) = C(X,Xy ), / 1 f ...yf7 In an embodiment of the present invention, n in equation (4) is set to expand into equation (5): 1274908 where c(x〃x)), Q system is), and finally adjacent color pixels The value of A can be forgotten; π 击二笛哲. ~w{ W2 W3 = w4 _ A _ CH c12 c13 C14 i C21 C22 C23 C24 1 C31 C32 C33 c34 i C41 C42 C43 C44 i ~ 1 1 1 l〇γ -1 'c10~ C2〇C30 C40 - 1 (6) For %, please refer to Fig. 2 and Fig. 3 for this one. A flowchart of an image color interpolation method of the example of the %, and a third figure illustrates the implementation of an image color interpolation method according to an embodiment of the present invention. Step Flow Chart Step 10: Capture the pixels of the color filter array and send 3 steps 20 to perform. Referring to FIG. 1 again, the blue pixel (Bi, j) is set to middle < ”, and the pixel is occupied, and then step 20 in FIG. 2 is performed. · Interpolating green on the blue dad pixel, the interpolation method is The flow chart is as shown in Fig. 3. The implementation method is as follows. Step U0: Calculate the average pixel as shown in equation (8): 〇α ^ + G/+UJ" 〇iJ~l + )/4 (7) Figure 2 Show in accordance with the present invention ~ : +2 Jl + ^ / + 2, 7 + +, ru + 2 = fe-U + 2 + GiJ + l + Gi + lJ + 2) / 3G · ... -1, Bu 2 + G/+1 2)/3 K, j “2, y G··” also u+G “2j+1)/3 G, (8) where the calculation of the average pixel (G,) is utilized and centered Point pixel (Bi: neighboring Gi-2, Sichuan, Gm, [2, G..., GM, j+2, Gi ji, Gm, j-2, Gi+1, j, Gi+l j+2, Gi +2 ji and the pixel value of Gi+2, .... Then, as shown in equation (9), step 12 is performed (^ calculates the color difference values of different positions to obtain ten groups of pixel color difference values, wherein Pixel 1274908 The difference is calculated by using %o, 2Ag, JB; +2; j"^^ and 'subsequently returning (6), ie;; 2:;,: called 'the weight values are in bits · "weight value" “士", ... occupies pixels (B i, j) the weight values of the four adjacent positions (up, down, left, and right) (Wi, W2, W3, D. Next step 14G: performing color model conversion to find the center (BU) adjacent The conversion values (KB) of the four different pixel positions (up, down, left, and right), and the conversion value (κΒ) are defined as Kb = g_b. The calculation of the conversion value is performed using Gi.1J, ^, Bu 1, Gi 'j + 1, G..., j, B%·, Bi, j-2, BU, Βί+2, 』 and Bi j+2. The color conversion process is as shown in equation (10). C30 =1^/ +2,7 ~5/,>HG/+2J C40 ="j+2 -'"+|G/j+2 '12 =1^-2,厂5/J-2| 啦一2 j C13 =(|Do as well-2, the factory does +2 2,y C14 APi-2J ^BiJ^+\Gi-lJ [j-2^K2j\+\Gu_2 ^24 APiJ-l and /+2, the factory is done" +2丨啦+2,7· -0,^)/256+1 _G/j 1)/256+1 Ί6+1 ~2,|)/512+1 ,()/512+1 - G, -G,y+2()/512+l ))/512+1 {/512+1 -G, , +2j \j^2 JU+2 丨/512+1 (9)
Cj! =C22 =〔33 =C44 =〇 ,iVu) = GU,r((t2J+t)/2)^ ^ B(i,j-l) ~ ~ ((^i,y-2 + ^i,j-(fe+2,y + A" V 2) (10)IW".+i) = A+i - ((尽"+2 + 尽"·)/ 2) 接著,由式(6)求出之權重值與式(10)求出之轉換值(Kb, 值,經由式(11)即步驟150 :計算色彩估算值。接著進行步 12 1274908 驟1 60 :計算内插值(Gi,j ),此内插值係利用中心點像素與 色彩估算值之計算,如式(12)所示。此内插值(Gij,,)係為在 藍色像素位置之藍色綠色内插值。 = ><K:B{ijA)+W, x^B(i+lj)+W4 xiCB(ij+l) WBij+Bid (12) 重覆進行本步驟20,直到CFA中所有藍色像素處理完 成,才進行下一步驟。Cj! =C22 =[33 =C44 =〇,iVu) = GU,r((t2J+t)/2)^ ^ B(i,jl) ~ ~ ((^i,y-2 + ^i,j -(fe+2,y + A" V 2) (10)IW".+i) = A+i - ((to do "+2 + do "·)/ 2) Next, by equation (6) Calculate the weight value and the conversion value (Kb, value obtained by equation (10), and calculate the color estimation value via equation (11), step 150. Then proceed to step 12 1274908, step 1 60: calculate the interpolation value (Gi,j) The interpolated value is calculated using the center point pixel and the color estimate, as shown in equation (12). This interpolated value (Gij,,) is the blue-green interpolated value at the blue pixel position. = ><K:B{ijA)+W, x^B(i+lj)+W4 xiCB(ij+l) WBij+Bid (12) Repeat step 20 until all blue pixels in the CFA are processed. Go to the next step.
^請參照第4圖,設一紅色像素(Ru)為中心點像素,接 著進行第2圖中之步驟30 :内插綠色於此紅色像素上,此 步驟30類似於步驟20,惟中心點像素不相同。内插方法亦 如第3圖之流程圖所示,實施方法如下: 步驟110 :計算平均像素,如式(8)所示: 八中此平均像素(G )之計异係利用與中心點像素(心』) 相郴之 Gw,』」、Gi_2J + 1、Gmj-2、Gm,』、Gi'j+2、Gi’p、Gi j + 1、 、Gi+1,j、Gi+1,j+2、Gi+2,w 及 Gi+2J + 1 之像素值。 接著如式(13)所示,以進行步驟12〇 :計算不同位置的 像素色差值,以求出十組的像素色差值(Cij)後,其中計算像 素色差值之計算係利用Ri 2 j、Ri j 2、Ri j、&,卜2及U j之 像素值及式(8)所計算之平均像素(G,),接著代回式(6),’即 進仃步驟130 :計算權重值,此些權重值係為位於中心點像 素(Ri,』)之四個鄰近位置(上、下、左及右)的權重值 W3, W4)。 , 接著步驟 素d,j)相鄰之 140 :進行色彩模型轉換,以求出於中心點像 四組不同像素位置(上、下、左及右)的轉換值 13 1274908 (KR’),轉換值(KR’)係定義為kr=G-R。轉換值之外瞀 DT异係利用^Please refer to FIG. 4, set a red pixel (Ru) as the center pixel, and then proceed to step 30 in FIG. 2: interpolate the green pixel on the red pixel, this step 30 is similar to step 20, but the center pixel Not the same. The interpolation method is also shown in the flowchart of FIG. 3, and the implementation method is as follows: Step 110: Calculate the average pixel, as shown in the formula (8): The average pixel (G) of the eight is used and the center point pixel (heart)) Gw, 』", Gi_2J + 1, Gmj-2, Gm, 』, Gi'j+2, Gi'p, Gi j + 1, Gi+1, j, Gi+1, The pixel values of j+2, Gi+2, w and Gi+2J + 1. Then, as shown in the formula (13), to perform step 12: calculating pixel color difference values at different positions to obtain ten sets of pixel color difference values (Cij), wherein calculating the pixel color difference values is performed by using Ri 2 j, Ri j 2, Ri j, &, the pixel values of Bu 2 and U j and the average pixel (G,) calculated by equation (8), and then returning to (6), 'that is, step 130 : Calculate the weight value, which is the weight value W3, W4) of the four adjacent positions (up, down, left, and right) of the center point pixel (Ri, 』). Then, the step element d, j) adjacent 140: performs color model conversion to obtain a conversion value 13 1274908 (KR') at a central point image of four different pixel positions (up, down, left, and right), and converts The value (KR') is defined as kr=GR. Outside the conversion value 瞀 DT heterogeneous use
Gi-ij - Gij.! ' Gijj + 1 - Gi + 1J > Ri.2,j ' Rij-2 " Rij - Ri + 2 . ^ R ’ J ^ i, j -f 2 0 而色彩轉換過程如式(14)所示。 c川十一2 〜卜丨。一2,产 十 ^如,/-,-Gz·,/丨)/2 漏 C3〇=(^+2j*-^ji^/+2j--G/,yj)/255+7 C^+z.J>2-/?〇.|+|(^J+2f—Gz.,/|)/z^+7 。/2+/-,)-'7-2丨+丨。/-2,产%—2,|)/犯+/Gi-ij - Gij.! ' Gijj + 1 - Gi + 1J > Ri.2,j ' Rij-2 " Rij - Ri + 2 . ^ R ' J ^ i, j -f 2 0 and the color conversion process As shown in formula (14). c Chuan eleven 2 ~ divination. One 2, production ten ^, /-, -Gz·, /丨)/2 leak C3〇=(^+2j*-^ji^/+2j--G/,yj)/255+7 C^+ z.J>2-/?〇.|+|(^J+2f—Gz.,/|)/z^+7. /2+/-,)-'7-2丨+丨. /-2, production % - 2, |) / commit + /
。"=卜._以-〜+2|+卜2,)%">2||/5/2+/ c23 ^\Ri,j-2-Ri+2j\+\GiJ-~2,-Gi+2,j,^l^^+i C 一 〜_2 -/^2|+|G/,^LGi J+y|j/5/2+/ 04=^+2,)-^+21+6+2,/-(^+/1)/5/2+/ 、CU 二C22 33 =C44 =0 , ( 1 3 ) ^fR(i-l,j) = ^i-lj ~ ((^/-2J + ^/j)/ ^ ^R(ij-i) = ^ij-i - ((^/,;-2 + ^/j)/ ^ R(i+l,j) = ^i+JJ ^{{Ri+2j+Rij)/2) (14) K’R(U+” = GiJ+】 — ((RiJ+2 + Ru)/ 2) 接著,由上述求出之權重值與轉換值(KR,)值,經由式 (15)即步驟150 :計算色彩估算值。接著進行步驟16〇 · ^十 算内插值(Gi,j ),此内插值係利用中心點像素與色彩估曾值 之計算,如式(16)所示。此内插值(Gi,」’’)係為在紅色像素位 置之紅色綠色内插值。 ^r,R〇J) = X^R〇-lJ)+W2 ^RO+Jj)'^ R(. } (15) (16) 直到CFA中所有紅色像素處理完. "=卜._以-~+2|+卜2,)%">2||/5/2+/ c23 ^\Ri,j-2-Ri+2j\+\GiJ-~2 ,-Gi+2,j,^l^^+i C~~_2 -/^2|+|G/,^LGi J+y|j/5/2+/ 04=^+2,)-^ +21+6+2, /-(^+/1)/5/2+/ , CU II C22 33 =C44 =0 , ( 1 3 ) ^fR(il,j) = ^i-lj ~ (( ^/-2J + ^/j)/ ^ ^R(ij-i) = ^ij-i - ((^/,;-2 + ^/j)/ ^ R(i+l,j) = ^i +JJ ^{{Ri+2j+Rij)/2) (14) K'R(U+" = GiJ+] — ((RiJ+2 + Ru)/ 2) Next, the weight value and conversion value obtained from the above (KR,) value, via equation (15), step 150: Calculate the color estimate. Then proceed to step 16〇·^10 to calculate the interpolation value (Gi,j), which uses the center point pixel and the color estimate. The calculation is as shown in equation (16). This interpolated value (Gi, "'') is the red-green interpolated value at the red pixel position. ^r,R〇J) = X^R〇-lJ)+W2 ^RO+Jj)'^ R(. } (15) (16) Until all red pixels in CFA have been processed
GUn=K、,RU 重覆進行本步驟30, 成,才進行下一步驟。 14 1274908 請再參照第1圖,設一藍色像素(Bi,〗)為中心點像素, 接著進行第2圖中之步驟40 :内插紅色於此藍色像素上, 内插方法之流程圖如第5圖所示,第5圖係繪示依照本發明 實施例之一種影像色彩内插方法的第二實施步驟流程圖,實 施方法如下:GUn=K,, RU Repeat this step 30, and then proceed to the next step. 14 1274908 Please refer to Fig. 1 again, set a blue pixel (Bi, 〗) as the center point pixel, then proceed to step 40 in Fig. 2: interpolate the red pixel on the blue pixel, the flow chart of the interpolation method As shown in FIG. 5, FIG. 5 is a flow chart showing a second implementation step of an image color interpolation method according to an embodiment of the present invention, and the implementation method is as follows:
Bi-2j-2 ^ BiJ + C60=( BU2j-2 - Bu + 。吨卜!、'-Gq' C7。=( + C80 == \ Bi~2j+2 - Bij + Gi-2,j+2”-GJ’ 1/256 + 1 )/256 + 1 )/256 + 1 步騍,210:計算不同位置的像素色差值,如式〇7)所示: ' Λ , "、/256 + 1 ’ (17) ^ ^/+2,7-2 + ^/-2J-2 ~^/+2j-2M )/256 + 1 - h,J、2 + ^/-2J-2 ~^/+2j+2M )/256 + 1 -尽一2,_/+2 + ^/-2,7-2 ~^/-2j+2f, )/256 + 1 一 β Ui+2J+2 + ^/+2,7-2 ~^/+2j+2M )/256 + 1 -A-2,y+2 + ^;+2J-2 -^/-2,7+2 ' )/256 + 1 -尽-2 J+2 + ^/+2,y+2 J+2M )/256 + 1 C55 = C66 = C77 = C88 = 0Bi-2j-2 ^ BiJ + C60=( BU2j-2 - Bu + . Ton!!, '-Gq' C7.=( + C80 == \ Bi~2j+2 - Bij + Gi-2,j+2 "-GJ' 1/256 + 1 )/256 + 1 )/256 + 1 Step 210, 210: Calculate the pixel color difference at different positions, as shown in 〇7): ' Λ , ", /256 + 1 ' (17) ^ ^/+2,7-2 + ^/-2J-2 ~^/+2j-2M )/256 + 1 - h,J,2 + ^/-2J-2 ~^/+ 2j+2M )/256 + 1 - do one 2, _/+2 + ^/-2,7-2 ~^/-2j+2f, )/256 + 1 -β Ui+2J+2 + ^/+ 2,7-2 ~^/+2j+2M )/256 + 1 -A-2,y+2 + ^;+2J-2 -^/-2,7+2 ' )/256 + 1 -End - 2 J+2 + ^/+2, y+2 J+2M )/256 + 1 C55 = C66 = C77 = C88 = 0
• 其中計算像素色差值之計算係利用Bi.m、Bi_2 j 2、• The calculation of the pixel color difference is calculated using Bi.m, Bi_2 j 2
Bi’j、Bi+2,j.2& Bi+2,j + 2之像素值及式(12)所獲得之藍色綠色 •内插值 Gi-2’j-2、Gi-2.j.2,,、Gu,’、Gi+mi Gi+2 j + 2,,。求出 •:組不同位置的像素色差值(cy後,接著代回式(6),以進 行步驟220 :計算權重值,此些權重值係為位於中心點像素 (U之四個鄰近位置(右上、右下、左上及左下)的權重值(Wi W2, w3, w4)。 步驟230:接著進行色彩轉換,以求出於中心點像素(B. · 相鄰之四組不同像素位置(右上、右τ、左上及左下)的轉換j 15 1274908Bi'j, Bi+2, j.2& Bi+2, j + 2 pixel values and blue green obtained by equation (12) • Interpolated values Gi-2'j-2, Gi-2.j. 2,,,Gu,', Gi+mi Gi+2 j + 2,,. Find the color difference of the pixel at different positions in the group (after cy, then return to equation (6) to perform step 220: calculate the weight value, which is the pixel at the center point (four adjacent positions of U) Weight values (Wi W2, w3, w4) (upper right, lower right, upper left, and lower left) Step 230: Next, perform color conversion to find the pixel at the center point (B. · four adjacent sets of different pixel positions ( Conversion of upper right, right τ, upper left and lower left) j 15 1274908
相鄰之 R 、R i+! 、R 值(KR)。轉換值(KR)之計料心與中心點像素…)對角 M,j + 1、R i + + i 與式(16)所獲得 1 小i’’、Gi+j + Γ及 Gi + l j_ (18) 之紅色綠色内插值GmjY’、 色彩轉換過程係如式(1 8)所示 K = G 丨、! H 一 h K = Gi+JJ.j - Ri+J j_j K Hi一!,j+〇= Gm 川'一 Ri j 川Adjacent R, R i+! , R value (KR). The conversion value (KR) of the billing center and the center point pixel...) diagonal M, j + 1, R i + + i and the formula (16) obtained 1 small i'', Gi+j + Γ and Gi + l J_ (18) The red and green interpolated value GmjY', the color conversion process is as shown in equation (18) K = G 丨, ! H a h K = Gi+JJ.j - Ri+J j_j K Hi one!, j+〇= Gm 川'一Ri j 川
K R(i+I'j+〇 - G - Ri+J J+J • 接著,由上述求出之權重值與轉換值(κό,經由計曾 式(i9)之步驟2你求出色彩估算值(Kr,,),然後進行如式 中心點像素(Bu)與色彩估算值之計算,以進行步驟25〇:求 出内插值(Ru ),此内插值(Ri j’’)係為在紅色像素位置之紅 色藍色内插值。 KR(iJ) =^x^(M,-1)+^x^(,lj_I)+^ ) (20) 重覆進行本步驟40,直到CFA中所有藍色像素處理完 φ 成,才進行下一步驟。 来請參照第6圖,本發明並不限於此圖,綠色像素水平相 .郇亦可為紅色像素,請再參照第6圖,設綠色像素(Gj j)為 ^心點像素,接著進行第2圖中之步驟5〇:内插紅色於此 •綠色像素上,内插方法之流程圖如第3圖所示,實施方法如 下: 步驟110 :計算平均像素,如式(25)所示: 16 (25)1274908KR(i+I'j+〇- G - Ri+J J+J • Next, from the above-mentioned weight value and conversion value (κό, you can find the color estimate by step 2 of the equation (i9) ( Kr,,), then perform the calculation of the pixel (Bu) and color estimation values of the center point to perform step 25: find the interpolation value (Ru ), and the interpolation value (Ri j'') is in the red pixel. The red and blue interpolation values of the position. KR(iJ) =^x^(M,-1)+^x^(,lj_I)+^ ) (20) Repeat step 40 until all blue pixels in the CFA After the processing is completed, the next step is performed. Referring to Figure 6, the present invention is not limited to this figure, and the green pixel horizontal phase may also be a red pixel. Please refer to FIG. 6 again, and set a green pixel (Gj). j) is the pixel of the heart point, and then proceeds to step 5 in FIG. 2: interpolating the red color on the green pixel, the flow chart of the interpolation method is as shown in FIG. 3, and the implementation method is as follows: Step 110: Calculating The average pixel, as shown in equation (25): 16 (25) 1274908
+^7+lj· 4 .\J+^i-2J+\ V ) ,)/3 n '/+2J~1 +i?/+ij+-Kz+2j+lf,)/3 ')+2、fc-U+2+AJ+1”+〜u+2)/3+^7+lj· 4 .\J+^i-2J+\ V ) ,)/3 n '/+2J~1 +i?/+ij+-Kz+2j+lf,)/3 ')+2, fc -U+2+AJ+1”+~u+2)/3
其中此平均像素(R’)之計算係利用與中心點像素( 相郴之 R“l j-2、Ri i j、Ri i j + 2、R ,J 2 八1 + 1 j、Ki+i i + 2 和 $ ⑽中獲得之、Ri.2,j+i,,、Lw,、^ 及Ri + 2,j + 2之像素值。 1)J + 1 接著如式(26)所示,步驟120 :計瞀τ门,职 ΐπ不同位置的像素色 差值=求出十組的像素色差值(Cij)。其中計算像素色差值 之什异係利用 Gi.2,j、Gu.2、Gi j、& . & p .,, .. : ,J 2 及 Gi+2,j 之像素值及 式(25)所计异之平均像素Ri2j、 Ri + 2j,、 R , , 及Ru,接著代回式(6),即進行步驟13〇 :計瞀 1,J+2 些權重值係為位於中心點像素(Gi j)之四個‘位重=此 下、左及右)的權重值(Wh W2, w3, w4)。 、 C2HGU-2-G/,j+j〜-2u〜j)/256fl 〜如,厂 °4〇=^+2-〜|+丨〜+2’一 Μσ,-πσ。·一 糾〜-'』)/25“1The calculation of the average pixel (R') utilizes the pixel with the center point (R"l j-2, Ri ij, Ri ij + 2, R, J 2 八 1 + 1 j, Ki+ii + 2 And the pixel values of Ri.2, j+i,, Lw, ^ and Ri + 2, j + 2 obtained in $10. 1) J + 1 Then, as shown in equation (26), step 120: Calculate the pixel color difference at different positions of the job ΐ = find the pixel color difference value (Cij) of the ten groups. The calculation of the pixel color difference is the use of Gi.2, j, Gu.2, Gi j, & . & p .,, .. : , the pixel values of J 2 and Gi+2,j and the average pixels Ri2j, Ri + 2j, R , , and Ru calculated by equation (25), Then, return to equation (6), that is, proceed to step 13: calculate 瞀1, and the weight values of J+2 are the weights of the four 'bit weights=the bottom, the left and the right at the center point pixel (Gi j). Value (Wh W2, w3, w4)., C2HGU-2-G/, j+j~-2u~j)/256fl ~, such as factory °4〇=^+2-~|+丨~+2' Μσ, -πσ.·一纠~-'』))/25"1
Cl永2,厂 c14 如 〜+2jy2洲 〔24=“;_2-〜+2丨松^^ (26) cx! =C22 =C33 =〇44 =0 接著步驟140 ··進行色彩模型轉換, 八®於中心點像 17Cl Yong 2, factory c14 such as ~+2jy2 continent [24=";_2-~+2丨松^^ (26) cx! =C22 =C33 =〇44 =0 Then step 140 ··Color model conversion, eight ® at the center point like 17
1274908 素(GU)相鄰之四組不同像素位置(上、下、左及右)的轉換值 (Kr’)。轉換值之計算係利用由式(16)中獲得之Gm/和 Gi屮u、與由式(12)中獲得之Gu + 1’’和Gi j i,,、與中心點像 素(Gi’j)相鄰之Rkj、Ri+1』、與由式(2〇)中獲得之心」丨,,及 RU + 1 。而色彩轉換過程如式(2 7)所示。 k'r{mj) = Gi+lJ^Ri+{j (27) 、尺、(,,"ι) = G/,川"-及。+1’’ 接著,由上述求出之權重值與轉換值(Kr,)值,經由式 (28)即步驟150:計算色彩估算值(Kr”),然後進行如式(2^) 中心點像素(Gu)與色彩估算值(Kr’’)之計算,接著進行步驟 160 ·•計算内插值(Xij )。此内插值(Xu’’)係為在綠色像素位 置之綠色紅色内插值。。 (28) xu’:Gu-K\ (29) 重覆進行本步驟50,直到CFA中所有綠色像素處理完 成0 請參照第4圖,設一紅色像素(Ri j)為中心點像素,接 著進行第2圖中之步驟60 :内插藍色於此紅色像素上,内 插方法之流程圖如第5圖所示,實施方法如下: 步驟210:計算不同位置的像素色差值,如式(3〇)所示: 18 (30)1274908 0^ 0 0 6 7 8 7 8 8 C5C6C7C8 Q Q C5 Q a C7 -2,7- V+2J-2 /+2J+2 /-2,y+2 -Ri,j + -Ri,j + -Ru + G,•…Ά,, "RiJ + - GJ /256 + 1 /256 + 1 /256 + 1 /256 + 1 ^/-2,7-2 ^/-2,7-2 -2j-2 /+2,y-2 :+2,)-2 /+2J+2 Ri+2j-2 + Gi-lJ-Ί -GiVl,卜Ί )/256 + 1 ^+2j+2 + Gi-2,j-2”-Gi+2J+2 )/256 + 1 ^/-2,7+2 + ^/-2,y-2 -^/-2,7+2 )/256 + 1 ^i+2,j+2 + ^i+2J-2 -^/+2,7+2 )/256 + 1 ^/-2,y+2 + Gi+2j-2'- Gi-2J+2 )/256 + 1 及,-2"+2 + ^/+2,7+2 ·~^/-2,;+2 )/256 + 1 "66 "77 "88 55 c 其中計算像素色差值之計算係利用Ri-2j-2、Ri2j2、 、Ri+2,j-2及Ri+2,j+2之像素值及式(16)所獲得之紅色綠色 内插值 0“2小2”、0“2小2’,、Gi,j”、Gi+2,j-2’,及 Gi+2 j+2’,。求出 十組不同位置的像素色差值(Cij)後,接著代回式(6),以進 行步驟220 :計算權重值,此些權重值係為位於中心點像素 (U之四個鄰近位置(右上、右下、左上及左下)的權重值(W】 w2, w3, w4) 〇 步驟230:接著進行色彩轉換,以求出於中心點像素(1 相鄰之四組不同像素位置(右上、右下、左上及左下)的轉換 值(Kb’)。轉換值(Kb’)之計算係利用與中心點像素(r i + i,W、d M,j + 1、B i+i j + i 與式(12)所獲得 相鄰之 + ’ ’ GM,j + 1 及 Gi + l j + 1’’ 之藍色綠色内插值Gi-uj-Γ、Gi+1 · 1小1 色彩轉換過程係如式(31)所示: 19 (31) 1274908 K R{i-l,j~l) = G ^ K,Hi^j~〇= Gi+1J^ K = G^J j+jK = G/+yy+;1274908 The conversion value (Kr') of four different pixel positions (up, down, left, and right) adjacent to the prime (GU). The conversion value is calculated by using Gm/ and Gi屮u obtained in the equation (16), Gu + 1'' and Gi ji obtained from the equation (12), and the center point pixel (Gi'j). Adjacent Rkj, Ri+1′′, and the heart obtained by the formula (2〇), and RU + 1 . The color conversion process is shown in equation (27). K'r{mj) = Gi+lJ^Ri+{j (27) , ruler, (,, "ι) = G/, Chuan "- and. +1'' Next, from the weight value and the converted value (Kr,) value obtained above, the color estimation value (Kr" is calculated via the equation (28), that is, step 150: and then the center point of the equation (2^) is performed. The calculation of the pixel (Gu) and the color estimate (Kr'' is followed by step 160. • Calculating the interpolated value (Xij). This interpolated value (Xu'') is the interpolated value of the green red at the green pixel position. (28) xu':Gu-K\ (29) Repeat this step 50 until all green pixels in the CFA are processed. 0 Refer to Figure 4, set a red pixel (Ri j) as the center pixel, and then proceed. Step 60 in FIG. 2: Interpolating blue on the red pixel, the flowchart of the interpolation method is as shown in FIG. 5, and the implementation method is as follows: Step 210: Calculate pixel color difference values at different positions, such as 3〇) shown: 18 (30) 1274908 0^ 0 0 6 7 8 7 8 8 C5C6C7C8 QQ C5 Q a C7 -2,7- V+2J-2 /+2J+2 /-2,y+2 - Ri,j + -Ri,j + -Ru + G,•...Ά,, "RiJ + - GJ /256 + 1 /256 + 1 /256 + 1 /256 + 1 ^/-2,7-2 ^ /-2,7-2 -2j-2 /+2,y-2 :+2,)-2 /+2J+2 Ri+2j-2 + Gi-lJ-Ί -GiVl,卜Ί ) /256 + 1 ^+2j+2 + Gi-2,j-2"-Gi+2J+2 )/256 + 1 ^/-2,7+2 + ^/-2,y-2 - ^/-2,7+2 )/256 + 1 ^i+2,j+2 + ^i+2J-2 -^/+2,7+2 )/256 + 1 ^/-2,y+2 + Gi+2j-2'- Gi-2J+2 )/256 + 1 and,-2"+2 + ^/+2,7+2 ·~^/-2,;+2 )/256 + 1 " ;66 "77 "88 55 c The calculation of the pixel color difference is based on the pixel values and expressions of Ri-2j-2, Ri2j2, Ri+2, j-2 and Ri+2, j+2 ( 16) The obtained red-green interpolated values are 0 "2 small 2", 0 "2 small 2', Gi, j", Gi+2, j-2', and Gi+2 j+2'. After finding the pixel color difference values (Cij) of ten different positions, then returning to equation (6) to perform step 220: calculating the weight values, which are located at the central point pixels (four adjacent positions of U) Weight values (W], w2, w3, w4) 〇Step 230: Then perform color conversion to find the pixel at the center point (1 adjacent four different pixel positions (upper right) , bottom right, top left, and bottom left) conversion values (Kb'). The calculation of the conversion value (Kb') is based on the center point pixels (ri + i, W, d M, j + 1, B i+ij + i The blue-green interpolated value Gi-uj-Γ, Gi+1 · 1 small 1 color conversion process adjacent to + ' ' GM, j + 1 and Gi + lj + 1'' obtained by equation (12) Equation (31): 19 (31) 1274908 KR{il,j~l) = G ^ K, Hi^j~〇= Gi+1J^ K = G^J j+jK = G/+yy+;
—R —R—R —R
R -i,H ,j-i ~i,j+l 者’由上述求出之權重值與轉換 式(32)之步驟240••求出色彩估算值(Kb,,),缺 、、二由汁τ 中心點像素(U與色彩估算值 仃如式(33) 出内插值Ο,此内插值(Bij,,)係為在^丁/驟25〇:求 色紅色内插值。 ',"係為在藍色像素位置之藍 K\id, =^x^,_w_1)^2 ΧΙ0Β(Μ.^ xKB(iAJ+l)+W4 χΚβ(^ (32) v 鳴,' (33) 重覆進行本步驟60,直到CFA中所有紅色像素處理完 成’才進行下一步驟。 請參照第7圖,本發明並不限於此圖,綠色像素水平相 鄰亦可為藍色像素,請再參照第7圖,設綠色像素為 中心點像素,接著進行第2圖中之步驟7〇 :内插藍色^此 綠色像素上,内插方法之流程圖如第3圖所示,實施方法如 下: 步驟110 :計算平均像素,如式(34)所示: 飞,/今,)/4 5/-2,y. J-1"+尽一1 j + Bi -2J+1 丨,)/3 (34) < 5,+2j’=(A+2,/+A+U+5,+2j+l")/3R -i, H , ji ~ i, j + l 'from the above-mentioned weight value and conversion formula (32) step 240 • • find the color estimate (Kb,,), lack, and two by juice τ center point pixel (U and color estimation value, for example, (33) out of interpolation value, this interpolation value (Bij,,) is in the ^ □ / 〇 25 〇: color red interpolation value. ', " For the blue pixel position, the blue K\id, =^x^, _w_1)^2 ΧΙ0Β(Μ.^ xKB(iAJ+l)+W4 χΚβ(^ (32) v 鸣,' (33) repeat In this step 60, until the processing of all the red pixels in the CFA is completed, the next step is performed. Referring to FIG. 7, the present invention is not limited to this figure, and the green pixels may be horizontally adjacent to the blue pixel, please refer to the seventh. In the figure, the green pixel is set as the center pixel, and then the step 7 in FIG. 2 is performed: the blue pixel is interpolated, and the flow chart of the interpolation method is as shown in FIG. 3, and the implementation method is as follows: Step 110 : Calculate the average pixel, as shown in equation (34): fly, /, now,) /4 5/-2, y. J-1"+1:1 j + Bi -2J+1 丨,)/3 (34 ) <5,+2j'=(A+2,/+A+U+5,+2j+l")/3
BiJ+2 f==fe-i5y+2 + Bij+\ ^BMj+2 )/ 3 ; 1274908BiJ+2 f==fe-i5y+2 + Bij+\ ^BMj+2 )/ 3 ; 1274908
其中此平均像素(B’)之計算利 相鄰之Bi-丨i.2、R. Ώ 不〗用興Τ。點像素(Gu) ’ 卜1’·1、Βμ,·ϊ + 2、Bi + 1 j-2、Bi + 1 j、B (33)中獲得之、Bi2M, ’ ’ ,j+2和式 及Bi+2j + 2之像素值。 i,j + i差值接=;3:)所示’步驟12。:計算不同位置的像素色 之計算係利用G—i”、。·、:),及中广像素色差值4 、糾社曾i f M Gi,的及Gi + 2,j之像素值及 式(34)所計算之平均像素Bi 2 j,The calculation of the average pixel (B') is advantageous for the adjacent Bi-丨i.2, R. Ώ not used. Point pixel (Gu) 'Bu 1'·1, Βμ,·ϊ + 2, Bi + 1 j-2, Bi + 1 j, B (33), Bi2M, ' ' , j+2 and The pixel value of Bi+2j + 2. i, j + i difference = = 3:) shown in step 12. : Calculate the pixel color of different positions by using G—i”, .·, :), and the pixel value of the medium-wide pixel color difference 4, the correction of the if M Gi, and the pixel value of Gi + 2,j (34) The calculated average pixel Bi 2 j,
B i + 2,jB i + 2,j
B i J-2B i J-2
B ,j + 2B, j + 2
, ,J -L /,」接著代回式(6),即進行步驟130 ··計算權重值,此 些權重值係為位於中心點像素(Gy)之四個鄰近位置(上、 -ΤΓ、去 丄、^ V 下 左,f )的權重值(1,W2, W3, W4) 1+1^/+2,/-5^/1)/256 +1 C2〇 = Ip; y_2 -g c3。=φ,.+2 r G/ C4〇=fG,.+2-GΗ、"-。。·-: …'G i C,4 =f〇^2 .-G,.y+2 C ' c, , J - L /," and then return to equation (6), that is, step 130 is performed. · Calculate the weight value, which is the four adjacent positions of the center point pixel (Gy) (upper, -ΤΓ, Weight value of (1, W2, W3, W4) 1+1^/+2, /-5^/1)/256 +1 C2〇= Ip; y_2 -g c3 . =φ,.+2 r G/ C4〇=fG,.+2-GΗ,"-. . ·-: ...'G i C,4 =f〇^2 .-G,.y+2 C ' c
C C13 =φ,、2,广(ii+2 )· 卜i、j+‘‘ i,y-2 -^/ + 2,C C13 = φ, 2, wide (ii + 2 ) · i, j + ‘ ii, y-2 -^/ + 2,
iG C 34 = ^1+1^/,^2^5,/1)/256 +1 十,-2,/-^:2.1)/256 +1 卜卜Όί+2 /丨)/256 +1 + \B»-2,J'-Bi j+2^256 +1 |5,·.;ϋ + 2"·|)/256 +1 \B^j-2-Bitj+2^/256 +1 + \Bi^i,j-Bi J+2^/256 +1 (35) C11 =c22 =c33 =c44 =〇 接著步驟140 :進行色彩模型轉換,以求出於中心點像 素(Gu)相鄰之四組不同像素位置(上、下、左及右)的轉換值 (κΒ)。轉換值之計算係利用由式(12)中獲得之Gi l j’’和 Gi + 1,j’’、與由式(16)中獲得之GiJ + 1’’和Gi,】·〗,,、與中心點像 素(Gu)相鄰之BM,j、Bi+1,j、與由式(34)中獲得之Bij-1,,及 Bi,j + i 。而色彩轉換過程如式(36)所示。 21 (36) 1274908iG C 34 = ^1+1^/,^2^5,/1)/256 +1 Ten,-2,/-^:2.1)/256 +1 BubΌί+2 /丨)/256 +1 + \B»-2,J'-Bi j+2^256 +1 |5,·.;ϋ + 2"·|)/256 +1 \B^j-2-Bitj+2^/256 +1 + \Bi^i,j-Bi J+2^/256 +1 (35) C11 =c22 =c33 =c44 =〇Next step 140: Perform color model conversion to find the pixel adjacent to the center point (Gu) The conversion values (κΒ) of the four different pixel positions (up, down, left, and right). The conversion value is calculated by using Gi l j'' and Gi + 1, j'' obtained in the equation (12), and GiJ + 1'' and Gi obtained from the equation (16), BM, j, Bi+1, j adjacent to the center point pixel (Gu), and Bij-1, and Bi, j + i obtained from the equation (34). The color conversion process is as shown in equation (36). 21 (36) 1274908
= Gi-lJ Ίζ I B. -i,y 接著,由上述求出之權重值與轉換值(Kb’)值,妙由弋 (37)即步驟150:計算色彩估算值(Kb’,),然後進行如 中心點像素队)與色彩估算值(Kb”)之計算,接著進^步驟 ’計算内插值(Xi j”)。此内插值(〜Γ)係為在綠色料位 置之綠色藍色内插值。。 μ Κ、 财哨㈣年‘〜綱 (37) xid =GK「KBiJ (38) 成 重覆進行本步驟7〇,直到CFA中所有綠色像素處理完 =上述本發明較佳實施例可知,本發明之特徵係利用預 先估算最小平#誤差來内插還原彩色濾、光片P車列的彩色今 像。為了估算在彩色濾光片陣列影像中所失去的影像值,: •近色彩像素的權重值是由矩陣演算所決定。過程中亦採用一 色彩模型(KR ’ κΒ)來達到較佳的影像效果。 . 雖然本發明已以一較佳實施例揭露如上,然其並非用以 限定本發明’任何熟習此技藝者,在不脫離本發明之 圍内’當可作各種之更動與潤飾,因此本發明之保護範圍 §視後附之申請專利範圍所界定者為準。 【圖式簡單說明】 為讓本發明之上述和其他目的、特徵、和優點能更明顯 22 Ϊ274908 易懂,下文特舉一較佳實施例,並配合所附圖式,作詳細說 明如下·· 、W 圖第1圖係繪示習知之彩色濾光片陣列的—種平面示意 第2圖係繪示依照本發明實施例之一種影像色彩内插 万法的流程圖。 第2圖係繪示依照本發明實施例之一種影像色彩内插 万法的第一實施步驟流程圖。 第4圖係繪示依照本發明實施例之一種之第二平 面示意圖。 一 第5圖係繪示依照本發明實施例之一種影像色彩内插 万法的第二實施步驟流程圖。 第6圖係繪示依照本發明實施例之一種之第三平 面示意圖。 一 第7圖係繪示依照本發明實施例之一種CFA之第四平 面示意圖。 【主要元件符號說明】 步驟1 〇 :擷取彩色濾光片陣列之像素 步驟20 ··内插綠色於藍色像素上 步驟30 :内插綠色於紅色像素上 步驟40 :内插紅色於藍色像素上 步驟50 ··内插紅色於綠色像素上 23 1274908 步驟60 :内插藍色於紅色像素上 步驟70 ··内插藍色於綠色像素上 步驟11 0 :計算平均像素 步驟120、210 :計算不同位置的像素色差值 步驟130、220 :計算權重值 步驟140、230 :進行色彩模型轉換 步驟150、240 :計算色彩估算值 步驟160、250 :計算内插值 5 :彩色濾光片陣列= Gi-lJ Ίζ I B. -i,y Next, from the weight value and the converted value (Kb') value obtained above, by (37) step 150: calculating the color estimate (Kb',), Then, calculations such as the center point pixel group and the color estimation value (Kb" are performed, and then the step 'calculate the interpolation value (Xi j)). This interpolated value (~Γ) is interpolated in green blue at the green level. . μ Κ, 财 哨(四)年 '~纲(37) xid =GK"KBiJ (38) Repeat this step 7〇 until all green pixels in the CFA have been processed = the preferred embodiment of the present invention described above, the present invention The feature is to interpolate and restore the color image of the color filter and the light P train by estimating the minimum flat error. In order to estimate the image value lost in the color filter array image, the weight of the near color pixel is: The value is determined by the matrix calculus. A color model (KR ' κ Β ) is also used in the process to achieve a better image effect. Although the invention has been disclosed above in a preferred embodiment, it is not intended to limit the invention. 'Anyone skilled in the art can make various changes and refinements without departing from the scope of the invention. Therefore, the scope of protection of the present invention is defined by the scope of the appended patent application. The above and other objects, features, and advantages of the present invention will become more apparent from the description of the appended claims. Diagram A schematic diagram of a color filter array is shown in FIG. 2 is a flow chart showing an image color interpolation method according to an embodiment of the present invention. FIG. 2 is a diagram showing an image color according to an embodiment of the present invention. FIG. 4 is a second plan view showing an image color interpolation method according to an embodiment of the present invention. FIG. 5 is a second plan view showing an image color interpolation method according to an embodiment of the present invention. FIG. 6 is a third plan view showing a CFA according to an embodiment of the present invention. FIG. 7 is a fourth plan view showing a CFA according to an embodiment of the present invention. Component Symbol Description Step 1 〇: Capture the pixels of the color filter array Step 20 · Interpolate the green on the blue pixel Step 30: Interpolate the green on the red pixel Step 40: Interpolate the red on the blue pixel Step 50 ··Insert red on green pixels 23 1274908 Step 60: Interpolate blue on red pixels Step 70 · Interpolate blue on green pixels Step 11 0: Calculate average pixels Steps 120, 210: Calculating pixel color difference values at different positions Steps 130, 220: Calculating weight values Steps 140, 230: Performing color model conversion Steps 150, 240: Calculating color estimation values Steps 160, 250: Calculating interpolation values 5: Color filter array
24twenty four
Claims (1)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW94140979A TWI274908B (en) | 2005-11-22 | 2005-11-22 | A method for interpolating the color of color filter array |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW94140979A TWI274908B (en) | 2005-11-22 | 2005-11-22 | A method for interpolating the color of color filter array |
Publications (2)
Publication Number | Publication Date |
---|---|
TWI274908B true TWI274908B (en) | 2007-03-01 |
TW200720716A TW200720716A (en) | 2007-06-01 |
Family
ID=38624206
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
TW94140979A TWI274908B (en) | 2005-11-22 | 2005-11-22 | A method for interpolating the color of color filter array |
Country Status (1)
Country | Link |
---|---|
TW (1) | TWI274908B (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TWI455063B (en) * | 2011-08-12 | 2014-10-01 | Univ Nat Cheng Kung | Color interpolation device and method thereof |
TWI463430B (en) * | 2011-08-12 | 2014-12-01 | Univ Nat Cheng Kung | Color interpolation and image magnifying device and method thereof |
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 |
-
2005
- 2005-11-22 TW TW94140979A patent/TWI274908B/en not_active IP Right Cessation
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TWI455063B (en) * | 2011-08-12 | 2014-10-01 | Univ Nat Cheng Kung | Color interpolation device and method thereof |
TWI463430B (en) * | 2011-08-12 | 2014-12-01 | Univ Nat Cheng Kung | Color interpolation and image magnifying device and method thereof |
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 |
---|---|
TW200720716A (en) | 2007-06-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7577315B2 (en) | Method and apparatus for processing image data of a color filter array | |
JP6584131B2 (en) | Imaging apparatus, imaging system, and signal processing method | |
US7982781B2 (en) | Image processing device, image processing method, and imaging apparatus | |
EP2728545B1 (en) | Image processing method and device based on bayer format | |
CN107018395A (en) | Image processing apparatus, image processing method and camera device | |
WO2008001629A1 (en) | Image processing device, image processing program, and image processing method | |
JP4232086B2 (en) | Digital image sensor including an array of two-color photodetectors and method for demosaicing of an array of two-color photodetectors | |
TWI274908B (en) | A method for interpolating the color of color filter array | |
JP2016219977A (en) | Imaging device, imaging system and image processing system | |
US20090027525A1 (en) | Techniques For Reducing Color Artifacts In Digital Images | |
WO2007071194A1 (en) | Method for realizing color interpolation of value correction of exceptional points | |
JP2008015946A5 (en) | ||
TW200915861A (en) | Method and apparatus for improving low-light performance for small pixel image sensors | |
CN105993169A (en) | System and method for image demosaicing | |
TWI547169B (en) | Image processing method and module | |
TW201003566A (en) | Interpolation system and method | |
US20200382728A1 (en) | High-dynamic image sensor | |
CN101998127B (en) | Signal processing device, imaging device, and signal processing method | |
JP2010130686A (en) | Image data processing method, image sensor, and integrated circuit | |
TWI282519B (en) | Color interpolation method with directed weights | |
CN116503259B (en) | Mosaic interpolation method and system | |
JP3609606B2 (en) | Single plate color camera | |
JPH0313192A (en) | Solid-state image pickup device | |
Lee et al. | High quality image interpolation for color filter arrays | |
Lee et al. | An Effective Demosaicking and Zooming Algorithm for CFA Images |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
MM4A | Annulment or lapse of patent due to non-payment of fees |