201004371 九、發明說明: 【發明所屬之技術領域】 本發明是有關於一種色彩校正方法與具有色彩校正 功能之整合型晶片,且特別是有關於一種可應用於顯示器 或投影機之色彩校正方法與具有色彩校正功能之整合型 晶片。 【先前技術】 c 目前,各式顯示技術已臻成熟,尤其是顯示器或投影 機等裝置更已廣泛為市場所使用。如何更為忠實地呈現影 像色彩尤其是許多製造廠商的發展重點之一。 然而,受限於裝置的特性,同樣的影像在不同裝置上 呈現的效果並不見得相同。以顯示器為例,傳統上,當顯 示器接收到影像資料時,是直接將影像資料的灰階訊號儲 存在顯示器的隨機存取記憶體(random-access memory, RAM)中,並依據迦瑪(Gamma)電壓對應到相對應的電 L 壓輸出。由於此方式並沒有考慮到接收的影像訊號與顯示 器的色域是否相同,致使所顯示影像產生偏差的現象。 舉例來說,如果一影像是依據sRGB標準色域定義所 產生的影像,每個晝素的灰階資料是希望人眼接收到的 X、Y、Z刺激值是在sRGB色域範圍中的某一點,但由於 顯示器本身的色域大小或是純紅、純綠與純藍色三個頂點 與sRGB色域不一樣,所以當影像資料直接輸入到顯示器 上,人眼將接收到不同的X、Y、Z刺激值,因而產生前 6 述之影像偏差問題。 【發明内容】 本發明係有關於一種色彩校正方法與具有色彩校正 功能之整合型晶片,其根據一待校正裝置之特性調整影像 資料,使影像資料在調整後能夠如實地讓人眼感受到原本 影像所要呈現的效果。 本發明提出一種色彩校正方法,其包括步驟:將一影 ( 像資料之三原色灰階值轉換成一色彩空間之特徵值;根據 該色彩空間定義之標準白光之座標位置與該特徵值於該 色彩空間定義之座標位置之關係以及該三原色灰階值去 調整該特徵值,以產生一調整後特徵值;量測一待校正裝 置於各別顯示三原色時之三個特徵值;根據該待校正裝置 之該三個特徵值與一色彩空間變換式,將該調整後特徵值 轉換成三原色調整後亮度值;以及,量測該待校正裝置於 各別顯示三原色時之迦瑪特性曲線,並將量測到的三原色 I 各別之迦瑪特性曲線模型化,以產生該三原色各別之新的 灰階-亮度關係,藉此以獲得該三原色調整後亮度值對應之 三原色調整後灰階值。 本發明另提出一種具色彩校正功能之整合型晶片,其 包括一儲存單元、一暫存單元以及一色彩校正單元。儲存 單元儲存有多筆不同影像格式之轉換特徵值資料。暫存單 元用以寫入一待校正裝置於各別顯示三原色時所量測之 三個特徵值,以及用以寫入該待校正裝置於各別顯示三原 7 201004371 色時所量測之迦瑪特性曲線。色彩校正單元用以接收一影 像資料’並根據該影像資料之影像格式於儲存單元取得該 影像資料之轉換特徵值資料,藉此將該影像資料之三原色 灰階值轉換成一色彩空間之特徵值。色彩校正單元並用以 根據此色彩空間定義之一標準白光之座標位置與該特徵 值於此色彩空間定義之座標位置之關係以及該三原色灰 階值去調整特徵值,以產生一調整後特徵值。色彩校正單 ^ 元更用以根據該待校正裝置於各別顯示三原色時所量測 之二個特徵值與一色彩空間變換式,將該調整後特徵值轉 換成二原色调整後亮度值。色彩校正單元並將所量測之該 待校正裝置之三原色各別之迦瑪特性曲線模型化,以產生 二原色各別之新的灰階-亮度關係’藉此以獲得該三原色調 整後亮度值對應之三原色調整後灰階值。 為讓本發明之上述内容能更明顯易懂,下文特舉較佳 實施例,並配合所附圖式,作詳細說明如下: 【實施方式】 實施例一 凊參照第1圖,其繪示依照本發明實施例一的色彩校 正方法之流程圖。此色彩校正方法包括步驟sn至S15。 由步驟S11㈤始,先將一影像資料之三原& (紅、綠、藍 色)灰階值轉換成一色彩空間之特徵值。接著,如步驟S12 所示,根據該色彩空間定義之標準白光之座標位置與該特 徵值於該色彩空間定義之座標位置之關係以及該三原色 8 201004371 灰階值去調整該特徵值’以產生一調整後特徵值。然後, 見步驟S13,量測一待校正裝置於各別顯示三原色時之二 個特徵值。接著,如步驟S14所示’根據該待校正裝置之 該三個特徵值與一色彩空間變換式,將該調整後特徵值轉 換成三原色調整後亮度值。然後,如步驟S15所示,量 '、則 該待校正裝置於各別顯示三原色時之迦瑪特性曲線,並將 量測到的三原色各別之迦瑪特性曲線模型化,以產生該三 原色各別之新的灰階-亮度關係,藉此以獲得該三原色調整 後亮度值對應之三原色調整後灰階值。 待校正裝置例如是一顯示器。於此,本實施例並提出 一種具色彩校正功能之整合型晶片’其可為一獨立的晶片 設計,例如是一特殊應用積體電路(APPlicati〇n_spe(^fic integrated Circuit,ASIC )’並可被裝設於顯示器之顯示器晶 片中直接進行色彩校正。具色彩校正功能之整合型晶片ι〇 其電路方塊圖請參照第2A圖,顯示器晶片2〇 圖則請參照第2B®。如第2A圖所千^丨塊 U紅一处— 3 圖所不,整合型晶片10包 元11G、—暫存單元⑽以及—色彩校正單元 值資^暫^單1"^存有多筆不同影像格式之轉換特徵 校正農置於各別Γ頁 精由一輸入介面140肖以寫入待 用以寫入該待二二原色時所量測之三個特徵值,以及 瑪特性曲線。色二:正置,各別顯示三原色時所量測之迦 影像資料,並招姑早70 130藉由輸入介面H0接收一 取得該影像資像㈣之影像格式於儲存單元 4之轉換特徵值資料,藉此將鄉像資料之 9 三原色灰階值轉換成一色彩空間之特徵值。色彩校正單元 130並用以根據此色彩空間定義之一標準白光之座標位置 與該特徵值於此色彩空間定義之座標位置之關係以及該 三原色灰階值去調整特徵值,以產生一調整後特徵值。色 彩校正單元130更用以根據該待校正裝置於各別顯示三原 色時所量測之三個特徵值與一色彩空間變換式,將該調整 後特徵值轉換成三原色調整後亮度值。色彩校正單元130 並將所量測之該待校正裝置之三原色各別之迦瑪特性曲 線模型化,以產生三原色各別之新的灰階-亮度關係,藉此 以獲得該三原色調整後亮度值對應之三原色調整後灰階 值。 如第2B圖所示,顯示器晶片20中裝設有整合型晶片 10之儲存單元110、暫存單元120及色彩校正單元130外, 更包括一掃描驅動單元210、一資料驅動單元220、一隨 機存取記憶體(random-access memory, RAM) 230、一迦 瑪(Gamma )電壓源240、一時序產生單元250及一電源 供應電路260。色彩校正單元130根據顯示器特性去校正 的影像資料會被儲存於顯示器晶片20之隨機存取記憶體 230中,然後搭配前述元件顯示色彩校正後之影像。以下 附圖詳細說明本實施例之色彩校正方法的各個步驟内容。 本實施例是以輸入影像資料為s R G B標準定義之影像 資料為例做說明。此影像資料係轉換至CIE XYZ色彩空 間,其中於CIEXYZ色彩空間之特徵值(X, Y, Z)為對人 眼的三個刺激值,其亦為影像資料的三原色灰階值(R,G, 201004371 Β)顯示於sRGB標準螢幕上,人眼所看到的訊號。 在步驟S11中,將影像資料之三原色灰階值(R, G, B) 轉換成CIEXYZ色彩空間之特徵值(X,Y, Z)時,必須先 將三原色灰階值(R,G,B)轉換成三原色原始亮度值(dR, dG,dB),再接著將三原色原始亮度值(dR,dG,dB)轉換 成特徵值(X, Y, Z)。色彩校正單元130係依照下列式子 分別將三原色灰階值(R, G, B)轉換成三原色原始亮度值 (dR, dG, dB ): ί 當 R Max _ grey 仝 0.03928 時,dR = R/Max_grey 12.92 若否,則 (1) , (R/Max _ grey + 0.055 V'4201004371 IX. Description of the Invention: [Technical Field] The present invention relates to a color correction method and an integrated wafer having a color correction function, and more particularly to a color correction method applicable to a display or a projector Integrated wafer with color correction. [Prior Art] c At present, various display technologies have matured, especially devices such as displays or projectors have been widely used in the market. How to more faithfully present image color is one of the development priorities of many manufacturers. However, due to the nature of the device, the same images are not necessarily identical on different devices. Taking a display as an example, conventionally, when the display receives image data, it directly stores the grayscale signal of the image data in a random-access memory (RAM) of the display, and according to Gamma (Gamma). The voltage corresponds to the corresponding electrical L-voltage output. Since this method does not take into account whether the received image signal is the same as the color gamut of the display, the displayed image is deviated. For example, if an image is an image generated according to the sRGB standard color gamut definition, the grayscale data of each pixel is such that the X, Y, and Z stimulus values received by the human eye are in the sRGB color gamut. One point, but because the color gamut of the display itself or the three vertices of pure red, pure green and pure blue are not the same as the sRGB color gamut, when the image data is directly input to the display, the human eye will receive a different X, Y, Z stimulus values, thus producing the image deviation problem described in the previous six. SUMMARY OF THE INVENTION The present invention relates to a color correction method and an integrated wafer having a color correction function, which adjusts image data according to the characteristics of a device to be corrected, so that the image data can be faithfully perceived as the original after adjustment. The effect that the image will have. The invention provides a color correction method, comprising the steps of: converting a shadow (the three primary color gray scale values of the image data into a feature value of a color space; and determining a coordinate position of the white light according to the color space and the feature value in the color space; Defining the relationship between the coordinate positions and the three primary color grayscale values to adjust the feature value to generate an adjusted feature value; measuring three feature values of the device to be corrected in displaying the three primary colors respectively; according to the device to be corrected And the three eigenvalues and a color space conversion formula, the adjusted eigenvalues are converted into three primary color adjusted luminance values; and the gamma characteristic curve of the to-be-corrected device for displaying the three primary colors is measured, and the measurement is performed. The respective gamma characteristic curves of the three primary colors I are modeled to generate a new gray-scale relationship of the three primary colors, thereby obtaining the adjusted primary gray scale values corresponding to the three primary colors adjusted brightness values. Another integrated wafer with color correction function includes a storage unit, a temporary storage unit and a color correction unit. The storage unit stores a plurality of conversion feature value data of different image formats. The temporary storage unit is configured to write three characteristic values measured by the device to be corrected when displaying the three primary colors, and to write the device to be corrected. The gamma characteristic curve measured by each of the three original 7 201004371 colors is used. The color correction unit is configured to receive an image data and obtain the converted feature value data of the image data in the storage unit according to the image format of the image data. Converting the three primary color grayscale values of the image data into the feature values of a color space. The color correction unit is further configured to determine, according to one of the color space definitions, a coordinate position of the standard white light and a coordinate value of the feature value defined by the color space and The three primary color grayscale values are used to adjust the feature values to generate an adjusted feature value. The color correction unit is further configured to convert two feature values and a color space according to the device to be corrected to display the three primary colors respectively. And converting the adjusted feature value into the adjusted values of the two primary colors. The color correction unit and measuring the to-be-measured The gamma characteristic curves of the three primary colors of the positive device are modeled to generate a new gray-scale relationship of the two primary colors, thereby obtaining the adjusted grayscale values of the three primary colors corresponding to the adjusted values of the three primary colors. The above-mentioned contents of the present invention can be more clearly understood. The following description of the preferred embodiments and the accompanying drawings will be described in detail as follows: [Embodiment] Embodiment 1 refers to FIG. 1 and illustrates the present invention. A flowchart of the color correction method of Embodiment 1. The color correction method includes steps sn to S15. Starting from step S11 (f), first converting the three original & (red, green, blue) gray scale values of an image data into a color space. a feature value. Then, as shown in step S12, the coordinate value of the standard white light defined by the color space and the relationship between the feature value and the coordinate position defined by the color space and the gray level value of the three primary colors 8 201004371 are used to adjust the feature value. 'To produce an adjusted feature value. Then, referring to step S13, the two feature values of the three primary colors displayed by the device to be corrected are measured. Next, as shown in step S14, the adjusted feature value is converted into the three primary color adjusted luminance values according to the three characteristic values of the to-be-corrected device and a color space conversion formula. Then, as shown in step S15, the quantity is ', the gamma characteristic curve of the device to be corrected is displayed in each of the three primary colors, and the measured gamma characteristic curves of the three primary colors are modeled to generate the three primary colors. A new gray-scale relationship is obtained, thereby obtaining the adjusted grayscale values of the three primary colors corresponding to the adjusted values of the three primary colors. The device to be corrected is for example a display. In this embodiment, an integrated chip with a color correction function is provided, which can be a stand-alone chip design, for example, a special application integrated circuit (APPlicati〇n_spe (^fic integrated circuit, ASIC)' Color correction is performed directly on the display chip mounted on the display. For integrated chip with color correction function, please refer to Figure 2A for the circuit block diagram and 2B® for the display chip 2〇. For example, Figure 2A One thousand ^ 丨 block U red one - 3 figure no, integrated chip 10 package 11G, - temporary storage unit (10) and - color correction unit value ^ temporary ^ single 1 " ^ stored in multiple different image formats The conversion feature correction is placed on each page by an input interface 140 to write three characteristic values to be measured when the to-be-two primary colors are to be written, and the Ma characteristic curve. , the Kagami image data measured when the three primary colors are displayed separately, and Zhao Guzao 70 130 receives the converted characteristic value data of the image format of the image (4) in the storage unit 4 through the input interface H0, thereby Like the data of 9 The grayscale value is converted into a feature value of a color space. The color correction unit 130 is further configured to determine, according to the color space, the coordinate position of the standard white light and the coordinate value of the feature value defined by the color space and the grayscale value of the three primary colors. Adjusting the feature value to generate an adjusted feature value. The color correction unit 130 is further configured to: according to the three feature values measured by the device to be corrected when displaying the three primary colors respectively, and a color space conversion formula, the adjusted feature The value is converted into the adjusted value of the three primary colors. The color correcting unit 130 models the measured gamma characteristic curves of the three primary colors of the device to be corrected to generate a new gray-light relationship of the three primary colors. The three primary color adjusted grayscale values corresponding to the brightness values of the three primary colors are adjusted. As shown in FIG. 2B, the storage unit 110, the temporary storage unit 120, and the color correction unit 130 of the integrated wafer 10 are mounted in the display wafer 20. In addition, a scan driving unit 210, a data driving unit 220, and a random access memory (RAM) 230 are included. A Gamma voltage source 240, a timing generating unit 250, and a power supply circuit 260. The image data corrected by the color correcting unit 130 according to the display characteristics is stored in the random access memory 230 of the display chip 20. Then, the color corrected image is displayed in combination with the foregoing components. The following figures detail the steps of the color correction method of the embodiment. This embodiment is an example of the image data defined by the input image data as the s RGB standard. The image data is converted to the CIE XYZ color space, wherein the characteristic values (X, Y, Z) in the CIEXYZ color space are three stimulus values to the human eye, which are also the three primary color grayscale values of the image data (R, G, 201004371 Β) Displayed on the sRGB standard screen, the signal seen by the human eye. In step S11, when the three primary color grayscale values (R, G, B) of the image data are converted into the characteristic values (X, Y, Z) of the CIEXYZ color space, the three primary color grayscale values (R, G, B) must be first used. Converting to the original primary luminance values (dR, dG, dB), and then converting the original primary luminance values (dR, dG, dB) into characteristic values (X, Y, Z). The color correction unit 130 converts the three primary color grayscale values (R, G, B) into the original primary luminance values (dR, dG, dB) according to the following formula: ί when R Max _ grey is the same as 0.03928, dR = R/ Max_grey 12.92 If no, then (1) , (R/Max _ grey + 0.055 V'4
Cliv =-—- I 1.055 ) 當 G Max _ greyCliv =--- I 1.055 ) when G Max _ grey
< 0.03928 , dG G/Max_grey 12.92 若否,則 (2) dG _〔 G/Max _ grey + 0.055 丫4 1.055 y< 0.03928 , dG G/Max_grey 12.92 If no, then (2) dG _[ G/Max _ grey + 0.055 丫 4 1.055 y
當 ^1^^0.03928 時 dB_ B/Max_grey _ 12.92 若否,則 (3) _ΓB/Max _grey+ 0.055 γ4 1.055 y 上列式子(1)至(3)中,Max_grey係為該待校正裝置所 能顯示之最大灰階值,以8 bit的裝置為例,其最大灰階值 為255。在第2A圖中,當輸入的影像格式確定為SRGB標 準所定義的影像格式時,色彩校正單元130便可從儲存單 元110中獲得上述式子中的各個參數如〇.〇3928、2.4、12.92 11 201004371 1 VV rv 等’以計算出三原色原始亮度值(dR, dG,dB )。 接著,係根據下列式子(4)將該三原色原始亮度值(dR, dG, dB )轉換成ciE XYZ色彩空間之特徵值(X, γ,z):When ^1^^0.03928, dB_B/Max_grey _ 12.92 If no, then (3) _ΓB/Max _grey+ 0.055 γ4 1.055 y In the above equations (1) to (3), Max_grey is the device to be calibrated. The maximum grayscale value displayed, for example, is an 8-bit device with a maximum grayscale value of 255. In FIG. 2A, when the input image format is determined to be the image format defined by the SRGB standard, the color correction unit 130 can obtain various parameters in the above formula from the storage unit 110, such as 〇.〇3928, 2.4, 12.92. 11 201004371 1 VV rv etc. to calculate the original luminance values of the three primary colors (dR, dG, dB). Then, the original primary luminance values (dR, dG, dB) of the three primary colors are converted into the characteristic values (X, γ, z) of the ciE XYZ color space according to the following formula (4):
X' •0.4124 0.3576 0.1805— 'dR' Y = 0.2126 0.7152 0.0722 dG Z 0.0193 0.1192 0.9505 dB (4) 藉由上述之矩陣計算去獲得三原色灰階值(r,g,b) 广所對應之特徵值(X,乂 Z)後,如步驟S12所示,藉由適 當調整特徵值(Χ,γ,Ζ)以產生一調整後特徵值(χ,,γ,, Ζ )。此步驟的目的是在增加影像的色彩飽和度,以提高 影像顯示在顯示器上的鮮豔度。 於步驟S12中,色彩校正單元13〇是先根據標準白光 之座標位置與特徵值(χ,γ,ζ)於色彩空間定義之座標位 置去決定一色彩增豔方向。接著,根據三原色灰階值(r, G,B)中之最大值與最小值之差值去決定—色彩增盤係數 (k。然後,根據標準白光之座標位置、特徵值(χ,乂 z) 於色彩空間定義之座標位置、色彩增懿方向以及色彩增盤 係數k以將特徵值(χ,γ,ζ)轉換為調整後特徵值(χ,,γ, ζ’)。以下附圖說明。 ’ ’ 請參照第3圖,其繪示影像資料於聊931色度圖上 調整之示意圖。於第3圖中,標準白光之座標為(xs,ys), 特徵值(Χ,γ,ζ)於CIEXYZ色彩空間定義之座標為(xin, 而假定色彩職後之座標為(x,,y,)。座標(如» 係根據下列式子(5)、(6)求得: 12 201004371X' •0.4124 0.3576 0.1805— 'dR' Y = 0.2126 0.7152 0.0722 dG Z 0.0193 0.1192 0.9505 dB (4) The eigenvalues corresponding to the gray values (r, g, b) of the three primary colors are obtained by the above matrix calculation ( After X, 乂Z), as shown in step S12, an adjusted feature value (χ, γ, Ζ) is generated by appropriately adjusting the feature values (Χ, γ, Ζ). The purpose of this step is to increase the color saturation of the image to improve the vividness of the image displayed on the display. In step S12, the color correction unit 13 first determines a color brightening direction based on the coordinate position of the standard white light and the feature value (χ, γ, ζ) at the coordinate position defined by the color space. Then, according to the difference between the maximum value and the minimum value of the three primary color grayscale values (r, G, B), the color increasing coefficient (k. Then, according to the coordinate position and characteristic value of the standard white light (χ, 乂z) The coordinate position defined by the color space, the color enhancement direction, and the color enhancement coefficient k are used to convert the feature values (χ, γ, ζ) into the adjusted feature values (χ, γ, ζ '). ' ' Please refer to Figure 3, which shows the adjustment of the image data on the 931 chromaticity diagram. In Figure 3, the coordinates of the standard white light are (xs, ys), eigenvalues (Χ, γ, ζ The coordinates defined in the CIEXYZ color space are (xin, and the coordinates of the assumed color are (x, y,). The coordinates (such as » are obtained according to the following equations (5), (6): 12 201004371
1 ▼ ▼ -r V1 / I1 ▼ ▼ -r V1 / I
xin = X (5) X + Y + Z yin = Υ (6) X + Y + Z 其中’為使色彩能往正確的方向增盤,即由(xs,ys)往(xin, yin )之方向增盤,需加入兩組條件: 當xii^xs ’則Xlxs ’若否,則x,〈XS⑺ 當yin2yS,則y>ys,若否,則y,<ys⑻ Γ通過座標(XS,yS)與(xin,yin)之直線方程式為: y-ys _ yin-ys x'-xs xin - xs (9) 另外,令(XS,ys)與(x,,y,)兩點距離為(xs,ys)與(xh yin)兩點距離之1^倍(即為色彩增豔係數): , V^^T^y'-ys)2 (1〇) 其中,色衫增豔係數k是根據三原色灰階值cR, G,B)中 I;之最大值與最小值之差值去決定,此差值實際上可視為一 影像晝素之色彩純度值。當差值越大,代表影像晝素之色 彩純度值越大,影像晝素於呈現時傾向於一特定色彩之比 例越大,此時可做比較小程度的色彩增豔,即採用二較小 的k值。另一方面,當差值越小,代表此影像晝素之^彩 純度值越小,因此可做較大程度的色彩增豔,取一較大^ k值。較佳地,可將计算出來差值(或色彩純度值)區分 為多個級別,每個級別之間以門限值做區分,並對應—二 色彩增徵係數k,以表1為例作說明: 13 201004371 表1 門限值 — ..... 150 _色彩增豔係數k 1 門限值 72 色彩增豔係數k 1.325 144 — 1.025 66 1.35 138 _ 1.05 60 1.375 132 1.075 54 1.4 126 1.1 48 1.425 120 1.125 42 1.45 114 1.15 36 1.475 108 1.175 30 1.5 102 1.2 24 1.525 96 1.225 18 1.55 90 1.25 12 1.575 84 1.275 其餘門限值 1.6 78 1.3 舉例來說’若一影像晝素之灰階值為(200, 20, 20),最大Xin = X (5) X + Y + Z yin = Υ (6) X + Y + Z where 'in order to increase the color in the correct direction, that is, from (xs, ys) to (xin, yin) To add, you need to add two sets of conditions: When xii^xs 'then Xlxs 'if no, then x, <XS(7) When yin2yS, then y>ys, if not, then y, <ys(8) Γ pass coordinates (XS, yS) The straight line equation with (xin, yin) is: y-ys _ yin-ys x'-xs xin - xs (9) In addition, let (XS, ys) and (x, y,) be separated by two points (xs , ys) and (xh yin) two times the distance between the two points (that is, the color enhancement coefficient): , V^^T^y'-ys) 2 (1〇) where the color shirt brightness coefficient k is based on The difference between the maximum value and the minimum value of the three primary color grayscale values cR, G, B) is determined, and the difference is actually regarded as the color purity value of an image element. When the difference is larger, the color purity value representing the image element is larger, and the image is more inclined to be a certain color when presenting. At this time, a relatively small degree of color enhancement can be performed, that is, the second is smaller. The k value. On the other hand, the smaller the difference, the smaller the purity value of the color of the image, so that a larger degree of color enhancement can be achieved, taking a larger value of k. Preferably, the calculated difference value (or color purity value) can be divided into multiple levels, and each level is distinguished by a threshold value, and corresponding to the two-color increasing coefficient k, as shown in Table 1 : 13 201004371 Table 1 Threshold - ..... 150 _Color Brightness Coefficient k 1 Threshold 72 Color Brightness Coefficient k 1.325 144 — 1.025 66 1.35 138 _ 1.05 60 1.375 132 1.075 54 1.4 126 1.1 48 1.425 120 1.125 42 1.45 114 1.15 36 1.475 108 1.175 30 1.5 102 1.2 24 1.525 96 1.225 18 1.55 90 1.25 12 1.575 84 1.275 The remaining thresholds 1.6 78 1.3 For example, 'If the gray level of an image element is (200, 20, 20) ),maximum
.f' S 灰階值與最小灰階值之差值為180,其大於門限值150, 由表1可得色彩增豔係數k為丨,因此此影像畫素可不做 色彩增豔處理。若另一影像畫素之灰階值為(15〇,14〇, 145),其最大灰階值與最小灰階值之差值為1〇,由表卫; 得色彩增盤係數k $ 1.6,此影像晝素因而有較大的色 增觀程度。色彩增盤係* k決定後,即可代人式子( /之後’將上述式子⑺至(1G)聯立,即可求得色车 後之座標(X’,y’),而調整後特徵值(X,,γ,,2,)各別^ 14 201004371 X’=X’X(Y/y,), Y,=Y, Z’=(l-X’_y’)x(Y/y,) (Π) 為證明本實施例之色彩校正方法的確能有效提升影 像的色彩飽和度,以輸入六個測試點,其灰階值分別為 ( 192, 80, 80)、( 192, 192, 80)、( 96, 192, 96)、(96, 192 192)、( 128, 128, 192)及(192, 128, 192),其測試結果請 / ^照。圖。第4圖中’點Pr、Pg、Pb、Pw分別為s_ 標準定義的紅、綠、藍、白色的CIE 1931座標位置,Η 至Ρ6為輸入的六個測試點,ρι,至ρ6,則為ρι至經過 色衫增豔步驟處理後之座標點。由第4圖可觀察到,六個 測試點的座標皆能往色彩飽和度較高的位置移動。 接著進入步驟S13,量測該待校正裝置於各別顯示三 原色時之三個特徵值(Xr,Yr,Zr)、(Xg,Yg,Zg)、(xb,^ z^b)’其中,(Xr,Yr,Zr)是於驅使待校正裝置顯示純紅色 日守,由色度計所量測之特徵值,(Xg,Yg,Zg)為待校正 ^員不純綠色時所量測之特徵值,(Xb,Yb,zb)則為待^ 虞置顯不純藍色時所量測之特徵值,這些特徵值是於旦 測後由輸人介面14〇 (見第2A圖)傳送至暫存單元 並暫存,暫存單元12。巾,較佳地,暫存單元⑽具 個暫存器’分別用以儲存Xr、Xg、Xb、H&、 數Γ由光線之加法性,可得到調整後特徵: 之關係 轉換至三原色調整後亮度值(此身肩υ 15 201004371 本實施例雖然是以待校正裝置為一顯示器做說明,然 而亦可應用於一投影機之色彩校正。舉例來說,此步驟可 為量測投影機投射於布幕上之紅、綠、藍色各別之特徵 值,再根據此投影機之特性進行調整,使投影機所投出的 影像具有校正與色彩增豔的效果。 於接下來的步驟S14中,由於待校正裝置之三個特徵 值(Xr,Yr, Zr)、(Xg, Yg, Zg)、(Xb, Yb, Zb)已知,根據 一色彩空間變換式,色彩校正單元130可將調整後特徵值 (X’,Y’,Z’)轉換成三原色調整後亮度值(dR’,dG’, dB’)。此色彩空間變換式係為: dR'" ~Xr Xg Xb" -I "xr dG’ = Yr Yg Yb Y' dB' Zr Zg Zb Z' (12) 藉由式子(12)之矩陣運算,可求取出三原色調整後亮 度值(dR’,dG’,dB’)。然後,便是將三原色調整後亮度值 (dR,,dG,,dB,)轉換成三原色調整後灰階值(R,,G,, B’),如步驟S15所示。 於步驟S15中,是先量測待校正裝置於各別顯示三原 色時之迦瑪特性曲線,並將量測到的三原色各別之迦瑪特 性曲線模型化,以產生該三原色各別之新的灰階-亮度關 係,進而獲得三原色調整後亮度值對應之三原色調整後灰 階值。以紅色為例,請參照第5圖,其繪示待校正裝置於 顯示紅色時所量測到與模型化後之灰階與亮度關係圖,其 中橫軸R’為灰階值(範圍取0至1 ),縱軸dR’為亮度值。 16 201004371 於第5圖中,例如是取17個量測點,並以波茲曼函式 (Boltzmann function)對這17個量測點所構成之紅色 Gamma特性曲線模型化,藉此以產生新的灰階_亮度關 係。綠色與藍色之Gamma特性曲線亦可依此方式模型化。 以波茲曼函式將Gamma特性曲線模型化之公式如下表示: dR': _ AI,r~ ' A2,r '+ A2,r 1 4. e(R,_X〇,r)/X|,r (13) dG' = -Ai,g ' ' A2,g + A2,g 1 + e(G,- -x〇,s)/xu (14) .Ai,b~ '^2,b + 2,b l + e(B,- x〇,b)^i,b (15) ^式子(13)至(15)中的係數Ai、&、x〇與X〗皆為使用波 茲曼函式對Gamma特性曲線模型化時所得到的係數。因 而,由灰階值R,對亮度值dR,之關係,可得某一灰階值R 的訊號輸入後,經校正後的訊號值R,。同理,可由相同方 法求得灰階值G、B校正後之訊號值g,、B,。 傳統上,當一顯示器晶片接收到影像資料的灰階值(r, g,b)訊號時,是直接將訊號儲存在晶片内的ram,並依 據Gamma電壓源對應到相對應的電壓輸出,且電壓為驅 動每一個晝素之電壓,然而此方式並沒有考慮到接收的(R, G,B)訊號與顯示器的色域是否相同。舉例來說,如果(r G,B)是依據sRGB標準色域定義所產生的影像,每個r、 G、B晝素的灰階資料是希望人眼接收到的χ、γ、z刺激 值是在sRGB色域範圍中的某一點,但由於顯示器本身的 色域大小或是純色的R、G、B三個頂點與sRGB不一樣, 17 201004371 所以當(R,G,B)訊號直接輸入到顯示器上,人眼將接收 到不同的X、Y、Z刺激值。 是以,本實施例所提出之色彩校正方法與具有色彩校 正功能之整合型晶片10中,色彩校正單元130是先將接 收到的影像資料其灰階值(R, G,B)訊號轉換成(X, Y, Z) 訊號,再依據待校正裝置(如一顯示器或是一投影機)的 特性去轉換並進行色彩飽和度之調整,以得到校正後的灰 階值(R’,G’,B’)訊號,並將之儲存於顯示器晶片20内 的RAM 230中然後顯示,即可獲得想讓人眼看到的(Χ,Υ, Ζ)訊號,亦可解決影像偏差的問題。 雖然本實施例是以sRGB標準定義之影像資料轉換至 CIE XYZ色彩空間做說明,然而實際上亦可輸入Adobe RGB標準定義之影像資料或是其他標準所定義之影像資 料,並使之轉換至CIE XYZ色彩空間,再依循上述步驟進 行影像色彩的校正調整。 實施例二 請參照第6圖,其繪示依照本發明實施例二的色彩校 正方法之流程圖。實施例二之色彩校正方法是用於設定一 待校正裝置,其例如是一顯示器之Gamma特性曲線,包 括步驟S61至S67。步驟S61是先根據待校正裝置之特性 與一目標Gamma值,於待校正裝置中設定三原色各別之 初始Gamma特性曲線。請參照第7A至7C圖,其分別繪 示待校正裝置於校正前後紅、綠、藍色的灰階對電壓(G-V ) 18 201004371 艮據待校正裝置的特性與預計顯示# Ga_ 、 線(一般目標的Gamma值為2.2)所得之紅、綠 J色G-V曲線’即為紅、綠、藍色各別之目標曲線,於後 ',步驟中/待校正裝置便是依照這些目標曲線做顯示。 一一接著’如步驟S62所示,量測此待校正裝置於各別顯 不二原色時的二個特徵值’如顯示紅色時所量測之特徵值 (Xr,Yr,Zr )、顯示綠色時所量測(々,作,zg )、顯示藍 色時所量測Ub,Yb,Zb)。此步驟與實施例—的步驟su 相同,在此不再贅述。 然後,如步驟S63所示,將一調整用之影像資料之三 原色(紅、綠、藍色)灰階值(R,G,B)轉換成二色彩; 間=特徵值,如CIEXYZ色彩空間之特徵值(χ,γ,ζ)。 接著如步驟S64所示,根據該色彩空間定義之標準白光之 座標位置與該特徵值(Χ,γ,ζ)於該色彩空間定義之座標 位置之關係以及該三原色灰階值(R,G,B)去調整該特禮: 值(X,Y,z),以產生一調整後特徵值(χ,,γ,,ζ,)。步驟 S64主制以調整影像之色彩飽和度,且由於步驟^盘 S64與實施例-之步驟su與犯相同,在此亦不再費述。 然後,如步驟S65所示,根據待校正裝置之該三個 徵值(Xr,Yr,Z〇、( Xg, Yg, Zg )、( Xb,Yb,zb )與一色彩 空間變換式,如實施例一中的式子(12)’將該調整後特徵 值,(χ’,γ’,z’)轉換成三原色調整後亮度值(dR,,dG,, 昍1)。接著,如步驟S66所示,量測待校正裝置於各別顯 示三原色時之迦瑪特性曲線’並將量測到的三原色各別之 19 201004371 迦瑪特性曲線模型化,以產生該三原色各別之新的灰階- 亮度關係。 由於步驟S65及S66與實施例一之步驟S14及S15 相同,在此不再贅述。於三原色各別之新的灰階-亮度關係 產生後,便可得知紅、綠、藍色各別色彩校正後之G-V曲 線,如第7A至7C圖所示。以第7C圖為例,校正後之藍 色G-V曲線在較高灰階區域會被拉昇至更高灰階,可將待 校正裝置的色域往藍色的方向校正,使其更接近sRGB所 定義的色域。 接著,如步驟S67所示,根據三原色各別之新的灰階 -亮度關係去重新設定待校正裝置之三原色各別之迦瑪特 性曲線。將校正後的Gamma特性曲線直接設定到待校正 裝置中以後,當輸入新的影像灰階訊號(Rin, Gin, Bin) 時,透過新的R、G、B Gamma特性曲線產生的電壓驅動 顯示時,已經具有色彩校正的功能,因而可獲得影像(Rin, Gin, Bin)實際上想讓人眼所看到的X、Y、Z訊號。 綜上所述,雖然本發明已以較佳實施例揭露如上,然 其並非用以限定本發明。本發明所屬技術領域中具有通常 知識者,在不脫離本發明之精神和範圍内,當可作各種之 更動與潤飾。因此,本發明之保護範圍當視後附之申請專 利範圍所界定者為準。 20 201004371 【圖式簡單說明】 第1圖纟會示依照本發明實施例一的色彩校正方法之 流程圖。 第2 A圖纟會不貫施例一具色彩校正功能之整合型晶片 之電路方塊圖。 第2B圖繪示實施例一的顯示器晶片之電路方塊圖。 第3圖繪示影像資料於CIE193]色度圖上調整之示意 圖。 第4圖繪示以六個測試點經色彩增豔步驟處理後之 測試結果圖。 第5圖繪示待校正裝置於顯示紅色時所量測到與 型化後之灰階與亮度關係圖。 〃 第6圖繪示依照本發明實施例二的色彩校正方法 模 流程圖 之 【主要元件符號說明】 10 :整合型晶片 20 :顯示器晶片 110 :儲存單元 120 :暫存單元 130 :色彩校正單元 210 .掃猫驅動單元 201004371 220 : 230 : 240 : 250 : 260 : 貢料驅動平元 隨機存取單元 迦瑪電壓源 時序產生單元 電源供應電路 22The difference between the .f' S grayscale value and the minimum grayscale value is 180, which is greater than the threshold value of 150. The color enhancement coefficient k obtained by Table 1 is 丨, so this image pixel can be processed without color enhancement. If the grayscale value of another image pixel is (15〇, 14〇, 145), the difference between the maximum grayscale value and the minimum grayscale value is 1〇, by the defender; the color increasing factor k $ 1.6 This image has a greater degree of color enhancement. After the color addition system*k is determined, the generation formula (/after 'the above equations (7) to (1G) can be combined to obtain the coordinates (X', y') of the color car, and the adjustment is made. Post-feature values (X, γ, 2,) respectively ^ 14 201004371 X'=X'X(Y/y,), Y,=Y, Z'=(l-X'_y')x(Y /y,) (Π) In order to prove that the color correction method of the embodiment can effectively improve the color saturation of the image, six test points are input, and the grayscale values are (192, 80, 80), (192, respectively). 192, 80), (96, 192, 96), (96, 192 192), (128, 128, 192) and (192, 128, 192), the test results please / ^. Figure. Figure 4 'Points Pr, Pg, Pb, Pw are the red, green, blue, white CIE 1931 coordinate positions defined by the s_ standard, Η to Ρ6 are the six test points entered, ρι, to ρ6, then ρι to the color The coordinate point after the processing step of the shirt is increased. It can be observed from Fig. 4 that the coordinates of the six test points can be moved to the position with higher color saturation. Then, the process proceeds to step S13, and the device to be corrected is measured separately. Three characteristic values when displaying the three primary colors (Xr, Yr, Zr), (Xg, Yg, Zg), (xb, ^ z^b)' where (Xr, Yr, Zr) is used to drive the device to be calibrated to display a pure red day, measured by a colorimeter The characteristic value, (Xg, Yg, Zg) is the characteristic value measured when the uncorrected green is to be corrected, and (Xb, Yb, zb) is the characteristic value measured when the impure blue is displayed. The characteristic values are transmitted to the temporary storage unit and temporarily stored by the input interface 14〇 (see FIG. 2A) after the measurement, and the temporary storage unit 12. The towel, preferably, the temporary storage unit (10) has a temporary register. 'Respectively for storing Xr, Xg, Xb, H&, and the addition of light by ray, the adjusted feature can be obtained: the relationship is converted to the brightness value after the adjustment of the three primary colors (this shoulder 15 201004371 The device to be calibrated is described as a display, but can also be applied to the color correction of a projector. For example, this step can measure the characteristic values of red, green and blue projected on the screen by the projector. Then, according to the characteristics of the projector, the image projected by the projector has the effect of correction and color enhancement. In step S14, since the three characteristic values (Xr, Yr, Zr), (Xg, Yg, Zg), (Xb, Yb, Zb) of the device to be corrected are known, according to a color space conversion formula, the color correction unit 130 can convert the adjusted feature values (X', Y', Z') into three primary color adjusted brightness values (dR', dG', dB'). This color space transformation is: dR'" ~Xr Xg Xb" -I "xr dG' = Yr Yg Yb Y' dB' Zr Zg Zb Z' (12) By using the matrix operation of equation (12), the adjusted brightness values of the three primary colors (dR', dG' can be obtained. , dB'). Then, the three primary color adjusted luminance values (dR,, dG, dB,) are converted into the three primary color adjusted grayscale values (R, G, B') as shown in step S15. In step S15, the gamma characteristic curve of the three primary colors to be corrected is first measured, and the measured gamma characteristic curves of the three primary colors are modeled to generate new ones of the three primary colors. The gray-scale relationship is obtained, and the adjusted grayscale values of the three primary colors corresponding to the luminance values after the adjustment of the three primary colors are obtained. Taking red as an example, please refer to FIG. 5, which shows the relationship between the gray scale and the brightness measured by the device to be corrected when the red color is displayed, wherein the horizontal axis R′ is a gray scale value (the range is 0). To 1), the vertical axis dR' is a luminance value. 16 201004371 In Fig. 5, for example, 17 measurement points are taken, and the red Gamma characteristic curve formed by the 17 measurement points is modeled by the Boltzmann function, thereby generating new Grayscale_brightness relationship. The green and blue Gamma characteristic curves can also be modeled in this way. The formula for modeling the Gamma characteristic curve by the Boltzmann function is expressed as follows: dR': _ AI,r~ ' A2,r '+ A2,r 1 4. e(R,_X〇,r)/X|, r (13) dG' = -Ai,g ' ' A2,g + A2,g 1 + e(G,- -x〇,s)/xu (14) .Ai,b~ '^2,b + 2 , bl + e(B,- x〇,b)^i,b (15) ^The coefficients Ai, &, x〇 and X in the equations (13) to (15) are all using Boltzmann functions. The coefficient obtained by modeling the Gamma characteristic curve. Therefore, the relationship between the gray scale value R and the luminance value dR can be obtained after the signal of a certain gray scale value R is input, and the corrected signal value R. Similarly, the signal values g, B, after the gray scale values G and B are corrected can be obtained by the same method. Conventionally, when a display chip receives the grayscale value (r, g, b) signal of the image data, it directly stores the signal in the ram of the chip, and corresponds to the corresponding voltage output according to the Gamma voltage source, and The voltage is the voltage that drives each pixel. However, this method does not take into account whether the received (R, G, B) signal is the same as the color gamut of the display. For example, if (r G, B) is an image generated according to the sRGB standard color gamut definition, the gray scale data of each r, G, B element is the χ, γ, z stimulus value that the human eye expects to receive. Is a point in the sRGB gamut range, but because the gamut size of the display itself or the solid color R, G, B three vertices are not the same as sRGB, 17 201004371 so when the (R, G, B) signal is directly input On the display, the human eye will receive different X, Y, Z stimulus values. Therefore, in the color correction method and the integrated wafer 10 having the color correction function, the color correction unit 130 first converts the grayscale value (R, G, B) signals of the received image data into (X, Y, Z) signal, according to the characteristics of the device to be calibrated (such as a display or a projector) to convert and adjust the color saturation to obtain the corrected grayscale value (R', G', The B') signal is stored in the RAM 230 in the display chip 20 and then displayed, and the desired (Χ, Υ, Ζ) signal can be obtained, and the problem of image deviation can also be solved. Although the embodiment converts the image data defined by the sRGB standard into the CIE XYZ color space for illustration, in practice, the image data defined by the Adobe RGB standard or the image data defined by other standards may be input and converted to CIE. In the XYZ color space, follow the above steps to adjust the image color. Embodiment 2 Please refer to FIG. 6 , which is a flow chart of a color correction method according to Embodiment 2 of the present invention. The color correction method of the second embodiment is for setting a device to be corrected, which is, for example, a Gamma characteristic curve of a display, and includes steps S61 to S67. In step S61, the initial gamma characteristic curves of the three primary colors are set in the device to be corrected according to the characteristics of the device to be corrected and a target gamma value. Please refer to the figures 7A to 7C, which respectively show the gray-to-voltage (GV) of the red, green and blue before and after the correction of the device to be corrected. 18 201004371 特性 According to the characteristics of the device to be corrected and the expected display # Ga_ , line (general The target gamma value is 2.2) The red and green J color GV curves obtained are the target curves of red, green and blue, respectively, and the step/to-correction device is displayed according to these target curves. One by one, as shown in step S62, measuring two characteristic values of the device to be corrected in the respective dominant primary colors, such as the characteristic values (Xr, Yr, Zr) measured when the red color is displayed, and displaying green Ub, Yb, Zb) measured at the time of measurement (々, ,, zg). This step is the same as the step su of the embodiment - and will not be described again here. Then, as shown in step S63, the three primary color (red, green, blue) grayscale values (R, G, B) of the image data for adjustment are converted into two colors; the intermediate = feature value, such as the CIEXYZ color space. Characteristic values (χ, γ, ζ). Then, as shown in step S64, the coordinate position of the standard white light defined by the color space and the relationship between the feature value (Χ, γ, ζ) at the coordinate position defined by the color space and the gray level values of the three primary colors (R, G, B) To adjust the special gift: value (X, Y, z) to produce an adjusted feature value (χ, γ, ζ,). Step S64 is mainly used to adjust the color saturation of the image, and since the step S64 is the same as the step su of the embodiment, it will not be described here. Then, as shown in step S65, according to the three levy values (Xr, Yr, Z〇, (Xg, Yg, Zg), (Xb, Yb, zb) and a color space conversion formula of the device to be corrected, as implemented The equation (12) in the first example converts the adjusted feature value, (χ', γ', z') into the three primary color adjusted luminance values (dR, dG, 昍1). Then, as in step S66 As shown, measuring the gamma characteristic curve of the device to be corrected in displaying the three primary colors respectively, and modeling the measured gamma characteristic curves of the three primary colors, respectively, to generate new gray scales of the three primary colors. - The brightness relationship. Since steps S65 and S66 are the same as steps S14 and S15 of the first embodiment, they will not be described here. After the new gray-scale relationship of the three primary colors is generated, the red, green and blue colors are known. The color-corrected GV curve is shown in Figures 7A to 7C. Taking Figure 7C as an example, the corrected blue GV curve is pulled up to a higher gray level in the higher gray level region. Correct the color gamut of the device to be calibrated to the blue direction to make it closer to the gamut defined by sRGB. As shown in S67, according to the new gray-scale relationship of the three primary colors, the gamma characteristic curves of the three primary colors of the device to be corrected are reset. After the corrected Gamma characteristic curve is directly set to the device to be corrected, when inputting When the new image gray-scale signal (Rin, Gin, Bin) is driven by the voltage generated by the new R, G, B Gamma characteristic curve, the color correction function is already available, so that the image can be obtained (Rin, Gin, Bin). The X, Y, and Z signals actually appear to be visible to the eye. In summary, although the present invention has been disclosed above in the preferred embodiments, it is not intended to limit the present invention. It is to be understood that the scope of the present invention is defined by the scope of the appended claims. BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a flow chart showing a color correction method according to a first embodiment of the present invention. FIG. 2A illustrates a circuit diagram of an integrated chip with a color correction function. Figure 2B is a block diagram of the display chip of the first embodiment. Figure 3 is a schematic diagram showing the adjustment of the image data on the CIE 193] chromaticity diagram. Figure 4 shows the color increase by six test points. The test result graph after the step processing. The fifth graph shows the relationship between the gray scale and the brightness measured by the device to be corrected when the red color is displayed. 〃 FIG. 6 is a diagram showing the relationship between the gray scale and the brightness according to the second embodiment of the present invention. Color Correction Method Mode Flow Chart [Main Component Symbol Description] 10: Integrated Chip 20: Display Wafer 110: Storage Unit 120: Temporary Memory Unit 130: Color Correction Unit 210. Scanning Mouse Drive Unit 201004371 220 : 230 : 240 : 250 : 260 : tributary driving flat element random access unit gamma voltage source timing generating unit power supply circuit 22