200424954 玖、發明說明: 【發明所屬之技術領域】 本發明為一種數位影像銳利度及亮度調整方法,特別是一種 可節省記憶空間之數位影像銳利度及亮度調整方法。 【先前技術】 為增進觀影品質,目前數位影像在實際應用上常需要調整銳 利度(sharpness)以及亮度(brightness),傳統上亮度以及銳利度的調 整係採兩分離的步驟進行;其中銳利度的調整作業可採用以下的 一種習用的演算式: /r y)= f{x9 y)+AfH (x, y) 乂係為經過銳利度調整後之函式,///(^)係為高頻部分的 相關函式,A則為銳利度控制參數,其係為一實數;若控制參數a 為正’則輸出的入(AV)將會銳利化(sharpened);反之,若控制參 數A為負,則輸出的Λ(^)將會模糊化(blurred)。 另,用以調整明亮度的作業則可採用以下的一種習用的演算 式: 其中係為經過亮度調整後之函式,B則為亮度控制參 數,其係為一實數;若控制參數Α為正,則輸出的將會明亮 化(brightened);反之,若控制參數Α為負,則輸出的Λ(μ)將 會暗化(darkened)。 習知的數位影像調整方式係分別進行上述銳利度及亮度的作 業’在硬體實施的設計需求上需先進行其中一步驟然後再進行另 一步驟,增加硬體設計的複雜度;而且需要一緩衝器(buffer)去 暫存前一處理步驟的輸出資料,耗費記憶體空間。 為解決上述傳統數位影像調整銳利度及亮度所遇到的問題, 200424954 本發明提出一種數位影像銳利度及亮度調整方法來達到更有效率 且節省記憶體空間的目的。 【發明内容】 本發明為一種數位影像銳利度及亮度調整方法,其主要係將 銳利度處理步驟以及亮度處理步驟整合於一個步驟中即可完成, 如此達到簡化電路設計以及減少記憶體的空間的目的。 為達成上述目的,本發明數位影像銳利度及亮度調整方法首 先先輸入一原始影像資料;接著設定複數個控制參數值;然後再 將每一畫素依序代入原始影像資料中根據該等控制參數值以進行 對應的銳利度及亮度的調整運算作業;最後輸出調整後的影像資 料即完成銳利度及亮度的調整流程。 【實施方式】 第一圖係為本發明數位影像銳利度及亮度調整方法一較佳實 施例之流程示意圖,係藉由一處理器達成,該處理器中儲存有可 計算出調整數位影像其銳利度及亮度之演算式,有關此演算式的 詳細敘述容後再敘,調整方式係包括下列步驟: 首先,進行步驟10,輸入一影像資料f (x,y)至該處理器中 並代入該演算式;接著於步驟11中輸入控制參數值;步驟12,將 每一畫素依序代入影像資料f(x,y)中進行對應的銳利度及亮度 調整運算作業;步驟13,輸出調整後之影像資料,如此即完成銳 利度及亮度的調整流程。 上述數位影像其銳利度及亮度之演算式係如下所示: 200424954 g{^y)=:f(^y)+kx ΣΣ^ i-~mj=-n 其中是數位影像經銳利度及亮度調整後的影像資料; 是原始影像資料;ki是銳利度控制參數;岣,y)係為可獲得原 始影像資料其面頻率部分的局通空間滤波矩陣(spatial high-pass filtering image mask),在本實施例中此矩陣係如下所示: 心'-1 ^〇,〇+k2 ^3^1,0 … k^ll k3W0,l200424954 (1) Description of the invention: [Technical field to which the invention belongs] The present invention is a method for adjusting sharpness and brightness of digital images, particularly a method for adjusting sharpness and brightness of digital images that can save memory space. [Previous technology] In order to improve the viewing quality, digital images often need to adjust sharpness and brightness in practical applications. Traditionally, brightness and sharpness are adjusted by two separate steps; the sharpness The adjustment can be performed using one of the following conventional calculation formulas: / ry) = f {x9 y) + AfH (x, y) 乂 is a function after sharpness adjustment, /// (^) is high For the correlation function of the frequency part, A is the sharpness control parameter, which is a real number; if the control parameter a is positive, the input (AV) of the output will be sharpened; otherwise, if the control parameter A is Negative, the output Λ (^) will be blurred. In addition, the operation to adjust the brightness can use one of the following conventional calculation formulas: where is the function after the brightness adjustment, B is the brightness control parameter, which is a real number; if the control parameter A is positive , The output will be brightened; conversely, if the control parameter A is negative, the output Λ (μ) will be darkened. The conventional digital image adjustment method is to perform the above-mentioned operations of sharpness and brightness, respectively. In the design requirements of hardware implementation, one of the steps must be performed before the other step, which increases the complexity of the hardware design. The buffer temporarily stores the output data of the previous processing step and consumes memory space. In order to solve the above-mentioned problems encountered in adjusting sharpness and brightness of traditional digital images, 200424954, the present invention proposes a method for adjusting sharpness and brightness of digital images to achieve more efficient and save memory space. [Summary of the Invention] The present invention is a method for adjusting the sharpness and brightness of a digital image, which is mainly completed by integrating the sharpness processing step and the brightness processing step in one step, so as to simplify the circuit design and reduce the memory space. purpose. In order to achieve the above object, the digital image sharpness and brightness adjusting method of the present invention first inputs an original image data; then sets a plurality of control parameter values; and then sequentially substitutes each pixel into the original image data according to the control parameters Value to perform the corresponding sharpness and brightness adjustment operation; finally output the adjusted image data to complete the sharpness and brightness adjustment process. [Embodiment] The first diagram is a schematic flow chart of a preferred embodiment of a method for adjusting sharpness and brightness of a digital image according to the present invention, which is achieved by a processor that stores the sharpness of the adjusted digital image that can be calculated The calculation formula of degree and brightness. The detailed description of this calculation formula will be described later. The adjustment method includes the following steps: First, go to step 10, input an image data f (x, y) into the processor and substitute it into the processor. Calculation formula; then input the control parameter value in step 11; step 12, each pixel is sequentially substituted into the image data f (x, y) to perform the corresponding sharpness and brightness adjustment operation; step 13, output after adjustment The image data, so as to complete the adjustment process of sharpness and brightness. The calculation formula for the sharpness and brightness of the above digital image is as follows: 200424954 g {^ y) =: f (^ y) + kx ΣΣ ^ i- ~ mj = -n where the digital image has been adjusted for sharpness and brightness The subsequent image data; is the original image data; ki is the sharpness control parameter; 岣, y) is a local high-pass filtering image mask for obtaining the face frequency portion of the original image data. In the embodiment, this matrix system is as follows: heart '-1 ^ 〇, 〇 + k2 ^ 3 ^ 1,0… k ^ ll k3W0, l
w(i,j)= L · · ··」w (i, j) = L · · · · "
其中&係為亮度控制參數,&係為銳利度調整致能參數,而W 則為此濾波矩陣之正常化參數(normalized parametrer ) 〇 第二圖係為有關上述參數,包括銳利度控制參數A、亮度控 制參數~以及銳利度調整致能參數&的功能表,若銳利度控制參數 & >0,則會進行影像銳利化調整的步驟;反之,若銳利度控制參 數勾<0則會進行影像模糊化調整的步驟。若亮度控制參數&>0 · 會進行影像亮化調整的步驟;反之,若亮度控制參數々2<0則會進 行影像暗化調整的步驟。若銳利度調整致能參數&3==〇則亮化調整 的功能會被禁能(disable);反之,若銳利度調整致能參數^ = 1 則亮化調整的功能會被致能(enable)。 值得注意的是上述演算式中’若n==〇則僅進行水平向量的影 像調整;若m=0則僅進行垂直向量的影像調整。 更進一步的是,上述銳利度及亮度的調整僅適用於灰階值 200424954 (grayscale components),若是RGB系統,則可適用於三種色彩 都可調整亮度及銳利度;若是YUV系統,則僅能對γ調亮度及銳 利度,對U及V則僅能調銳利度而無法調整亮度。 以下係為上述影像其銳利度及亮度之演算式的另一較佳實施 例,若藉猶兩習知的拉普拉斯高通滤波器(Laplacian high-pass filters)去擷取一影像的高頻部分,其一維的取樣資料為: F1 = [-1,2,-1]及 F2= [ΊΑ2,0-ΐ] 其中F1係為1/2週期的取樣頻率資料、F2則為1/4週期的取 樣頻率資料。因此,此影像的銳利度調整的高頻部分則可使用此 兩頻率範圍;亮度調整則與此無關。 與上述取樣頻率F1相對應之空間濾波矩陣係為: 一 1 —1 —1 + -1 8 -1 wi= L一1 -1 -k 與F2相對應的空間濾波矩陣則為 一 1 0 一 1 0 一 1 W2 =Where & is the brightness control parameter, & is the sharpness adjustment enable parameter, and W is the normalized parametrer of the filter matrix. The second picture is about the above parameters, including the sharpness control parameter A. The brightness control parameter ~ and the sharpness adjustment enable parameter & menu, if the sharpness control parameter & > 0, the image sharpening adjustment step will be performed; otherwise, if the sharpness control parameter is checked < 0 will perform the image blur adjustment steps. If the brightness control parameter & > 0 · will perform the image brightness adjustment step; on the contrary, if the brightness control parameter 々2 < 0 will perform the image darkening adjustment step. If the sharpness adjustment enable parameter & 3 == 〇, the brightness adjustment function will be disabled; conversely, if the sharpness adjustment enable parameter ^ = 1, the brightness adjustment function will be enabled ( enable). It is worth noting that in the above calculation formula, if 'n == 0, only the horizontal vector image adjustment is performed; if m = 0, only the vertical vector image adjustment is performed. Furthermore, the above sharpness and brightness adjustments are only applicable to grayscale components 200424954 (grayscale components). If it is an RGB system, it can be applied to all three colors. The brightness and sharpness can be adjusted; if it is a YUV system, it can only adjust γ adjusts the brightness and sharpness. For U and V, you can only adjust the sharpness but not the brightness. The following is another preferred embodiment of the calculation formula for the sharpness and brightness of the above-mentioned image. If the Laplacian high-pass filters are used to capture the high frequency of an image, In part, its one-dimensional sampling data is: F1 = [-1, 2, -1] and F2 = [ΊΑ2,0-ΐ], where F1 is the sampling frequency data of 1/2 cycle, and F2 is 1/4 Periodic sampling frequency data. Therefore, the high-frequency portion of the sharpness adjustment of this image can use these two frequency ranges; the brightness adjustment has nothing to do with it. The spatial filter matrix corresponding to the above sampling frequency F1 is:-1 -1 -1 + -1 8 -1 wi = L-1 -1 -k The spatial filter matrix corresponding to F2 is-1 0-1 0 to 1 W2 =
0 0 0 0 一 1 0 0 0 0 8 0 -1 0 0 0 1 0 一 1 其中W係為上述兩空間滤波矩陣的正規化參數(normalized parameter ),其中係以7至11為最佳。 將上述矩陣W1及W2應用在本發明中,藉由前一較佳實施 200424954 例中的高通空間》慮波矩陣公式可對應轉換 成如 wiM=0 0 0 0 1 1 0 0 0 0 8 0 -1 0 0 0 1 0 1 1 where W is the normalized parameter of the above two spatial filtering matrices, and 7 to 11 is the best. By applying the above matrices W1 and W2 in the present invention, the high-pass space in the example of the previous preferred implementation of 200424954, the wave matrix formula can be correspondingly transformed into, for example, wiM =
k3 L一 Lk3 L-L
-k3S + k7 一 I 下 及 W2(W) = -k3 〇 〇 0 —k3 〇 0 0 一A 〇 ^k3 0 〇 o k38 + k2 〇 0 〇 o rK 〇 -a:3 〇 —-k3S + k7-I and W2 (W) = -k3 〇 〇 0 —k3 〇 0 0-A 〇 ^ k3 0 〇 k38 + k2 〇 0 〇 rK 〇 -a: 3 〇 —
K 則本發明則可用下列公式表示 1 1 2 2 ΣΣ ι=一 2 (1-a) ^y)^f(x.y)+?imkx ΣΣ^(〇*)·/(χ+ζ,;;+7·) w2(ij)9f(x^i9y + j) ^其中知)是經調整後的影像資料,/(以係為原始影像資料, 系為1/2取樣頻率之頻率資料;(⑷j則為μ取樣頻率 之頻率資料,其中a的值係為〇训。 以上為本發明數位影像銳利度及亮度調整方法實施例之詳細 說明’其主要係將銳利度處理步驟以及亮度處理步驟整合於一個 步驟中即可完成,如此達到簡化電路設計以及減少記憶體的空間 的功效。 綜上所述,充份顯示出本發明數位影像銳利度及亮度調整方 法在目的及功效上均深富實施之進步性,極具產業之利用價值, 且為目前市面上前所未見之新發明,完全符合發明專利之要件, 妥依法提出申請。 200424954 唯以上所述者,僅為本發明之較佳實施例而已·,當不能以之 限定本發明所實施之範圍。即大凡依本發明申請專利範圍所作之 均等變化與修飾,皆應仍屬於本發明專利涵蓋之範圍内,謹請貴 審查委員明鑑,並祈惠准,是所至禱。 【圖式簡單說明】 第一圖係為本發明數位影像銳利度及亮度調整方法一較佳實 施例之流程示意圖;及 第二圖係為本發明較佳實施例中其參數&以及&的功能 表0K, the present invention can be expressed by the following formula: 1 1 2 2 ΣΣ ι =-2 (1-a) ^ y) ^ f (xy) +? Imkx ΣΣ ^ (〇 *) · / (χ + ζ ,; + 7 ·) w2 (ij) 9f (x ^ i9y + j) ^ is known) is the adjusted image data, / (the system is the original image data, and it is the frequency data of 1/2 sampling frequency; (⑷j 则It is the frequency data of μ sampling frequency, where the value of a is 0. The above is a detailed description of the embodiment of the method for adjusting the sharpness and brightness of the digital image of the present invention. It is mainly a combination of the sharpness processing step and the brightness processing step in one. It can be completed in steps, thus achieving the effect of simplifying the circuit design and reducing the memory space. In summary, it fully shows that the digital image sharpness and brightness adjustment method of the present invention is rich in implementation progress in terms of purpose and efficacy. Nature, has great industrial use value, and is a new invention not seen on the market today, which fully meets the requirements of the invention patent, and properly applies in accordance with the law. 200424954 The only mentioned above are only the preferred embodiments of the present invention. That is, when it cannot be used to limit the scope of the invention. The equal changes and modifications made in accordance with the scope of the patent application of the present invention should still fall within the scope of the patent of the present invention. I would like to ask your reviewing committee to make a clear note and pray for your approval. [Schematic description of the diagram] First The figure is a schematic flow chart of a preferred embodiment of a method for adjusting sharpness and brightness of a digital image according to the present invention; and the second diagram is a function table of parameters & and & in a preferred embodiment of the present invention.
1313