玖、發明說明: 【技術領域】 本發明為一種數位影像銳利度及亮度調整方法,特別是一種可節 省記憶空間之數位影像銳利度及亮度調整方法。 【先前技術】 為增進觀影品質,目前數位影像在實際應用上常需要調整銳利度 (sharpness)以及亮度(brightness),傳統上亮度以及銳利度的調整 係採兩分離的步驟進行;其中銳利度的調整作業可採用以下的一種習 用的演算式: fXx>y)=f{x>y) AfH(x9y) 係為經過銳利度調整後之函式,係為高頻 部分的相關函式,Α則為銳利度控制參數,其係為一實數; 若控制參數A為正,則輸出的乂k/)將會銳利化 (sharpened);反之,若控制參數A為負,則輸出的乂(x,y)將 會模糊化(blurred)。 另,用以調整明亮度的作業則可採用以下的一種習用的 演算式: Λ(Ί/(χ〇0(1+5) 其中Λ(χ’7)係為經過亮度調整後之函式,β則為亮度控制參 數,其係為一實數;若控制參數Α為正,則輸出的/A,j)將 會明亮化(brightened);反之,若控制參數a為負,則輸 出的將會暗化(darkened)。 習知的數位影像調整方式係分別進行上述銳利度及亮 度的作業,在硬體實施的設計需求上需先進行其中一步驟然 1241534 後再進行另—步驟,增加硬體設計的複雜度;而且需要一緩 衝器(buffer)去暫存前一處理步驟的輸出資料,耗費記憶 體空間。 、〜 β為解決上述傳統數位影像調整銳利度及亮度所遇到的 問題’本發赂it}—魏姆彡佩繼及統調整方法來達 到更有效率且節省記憶體空間的目的。 【發明内容】 本發明為一種數位影像銳利度及亮度調整方法,其主要 係將銳利度處理步驟以及亮度處理步驟整合於一個步驟中 即可完成,如此達到簡化電路設計以及減少記憶體的空間的 目的。 為達成上述目的,本發明數位影像銳利度及亮度調整方 法首先輸入一原始影像資料;輸入一銳利度控制參數;利用 一濾波器以同時調整該原始影像之亮度以及銳利度,其係包 含一壳度控制參數與一銳利度調整致能參數;輸出調整後之 影像資料。 再者,本發明更可包含當垂直向量影像固定時,則僅進 行水平向量的影像調整;當水平向量影像固定時,則僅進行 垂直向量的影像調整。 【實施方式】 第一圖係為本發明數位影像銳利度及亮度調整方法一 較佳實施例之流程示意圖,係藉由一處理器達成,該處理器 中儲存有可計算出調整數位影像其銳利度及亮度之演算 式,有關此演算式的詳細敘述容後再敘,調整方式係包括下 6发明 Description of the invention: [Technical Field] The present invention is a method for adjusting the sharpness and brightness of digital images, in particular, a method for adjusting the 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 operation can be performed using one of the following conventional calculation formulas: fXx > y) = f {x > y) AfH (x9y) is a function after adjustment for sharpness, and is a related function for the high-frequency part. Α Is the sharpness control parameter, which is a real number; if the control parameter A is positive, the output 乂 k /) will be sharpened; otherwise, if the control parameter A is negative, the output 乂 (x , Y) will be blurred. In addition, the operation to adjust the brightness can use one of the following conventional calculation formulas: Λ (Ί / (χ〇0 (1 + 5) where Λ (χ'7) is a function after brightness adjustment, β is the brightness control parameter, which is a real number; if the control parameter A is positive, the output / A, j) will be brightened; otherwise, 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 first, and then 1241534, and then the other step is added to the hardware design. Complexity; and a buffer is needed to temporarily store the output data of the previous processing step, which consumes memory space. ~ Β To solve the problems encountered in adjusting the sharpness and brightness of the traditional digital image described above Itit} —Weim Pei's follow-up adjustment method to achieve more efficient and save memory space. [Abstract] The present invention is a digital image sharpness and brightness adjustment method, which mainly deals with sharpness step And brightness processing steps can be completed in one step, so as to achieve the purpose of simplifying circuit design and reducing memory space. In order to achieve the above purpose, the digital image sharpness and brightness adjustment method of the present invention first inputs an original image data; input A sharpness control parameter; using a filter to simultaneously adjust the brightness and sharpness of the original image, which includes a shell control parameter and a sharpness adjustment enabling parameter; and output adjusted image data. Furthermore, this The invention may further include: when the vertical vector image is fixed, only the horizontal vector image adjustment is performed; when the horizontal vector image is fixed, only the vertical vector image adjustment is performed. [Embodiment] The first figure is a sharp digital image of the present invention. The flow diagram of a preferred embodiment of the method for adjusting the degree and brightness is achieved by a processor. The processor stores a calculation formula that can calculate the sharpness and brightness of a digital image. A detailed description of this calculation formula I will repeat later, the adjustment method includes the following 6
1241534 列步驟: 首先’進行步驟1〇,輸入一影像資料f (x,y)至該處理 器中並代入該演算式;接著於步驟11中輸入控制參數值;步 驟12,將每一晝素依序代入影像資料f (x,y)中進行對應的 銳利度及亮度調整運算作業;步驟13,輸出調整後之影像資 料’如此即完成銳利度及亮度的調整流程。 上述數位影像其銳利度及亮度之演算式係如下所示: g{x>y)= 其中是數位影像經銳利度及亮度調整後的影像資 料;/W)是原始影像資料;ki是銳利度控制參數;吨力係 為可獲得原始影像資料其高頻率部分的高通空間濾波矩陣” (spatial high-pass filtering image mask),在本實施 例中此矩陣係如下所示: w(i, j)= ^WHid ^3WDl〇 + ^,._丨 ^3WI.D 丨·丨 其中匕係為亮度控制參數,t係為銳利度調整致能參數, 而w則為此濾波矩陣之正常化參數(normalized parametrer) 〇 第二圖係為有關上述參數,包括銳利度控制參數&、亮 度控制參數&以及銳利度調整致能參數h的功能表,若銳^ 度控制參數^ >0,則會進行影像銳利化調整的步驟;反之, 若銳利度控制參數h<0則會進行影像模糊化調整的步驟。 若亮度控制參數h>0會進行影像亮化調整的步驟;^之, 若亮度控齡數^<_會進行縣暗化調麵步驟。若銳 7 9]Ι241534γ: ί、:说 〆》 * ΤΊ ri 利度調整致能參數則亮化調整的功能會被禁能 (disable),反之’若銳利度調整致能參數則亮化調 整的功能會被致能(enable)。 值传注思的是上述演算式中,若n=〇(當垂直向量影像固 定時)則僅進行水平向量的影像調整;若旧吖當水平向量影 像固定時)則僅進行垂直向量的影像調整。 更進一步的是,上述銳利度及亮度的調整僅適用於灰階 值(grayscale components),若是RGB系統,則可適用於 三種色彩都可調整亮度及銳利度;若是γυν系統,則僅能對γ 調党度及銳利度,對U及V則僅能調銳利度而無法調整亮度。 high - 取樣資料為: Fl = [-1,2,-1]及 以下係為上述影像其銳利度及亮度之演算式的另一較 佳實施例,若藉躺習知的拉普拉斯高賴波n (Laplacian filters)去擷取一影像的高頻部分,其一維的 卩2=[-1卿,-1] 其中F1係為1/2聊的轉解資料、_為1/4週 取樣頻率龍。因此’此影像的銳利度調整的高頻部分則可 使用此兩頻率範圍;亮度調整則與此無關。 、 與上述,樣頻率F1相對應之空間渡波矩陣係為:1241534 Steps: First, go to step 10, enter an image data f (x, y) into the processor and substitute the calculation formula; then enter the control parameter values in step 11; step 12, each day element Substitute the corresponding sharpness and brightness adjustment operations into the image data f (x, y) in order; step 13, output the adjusted image data 'so that the adjustment process of sharpness and brightness is completed. The calculation formula for the sharpness and brightness of the above digital image is as follows: g {x > y) = where is the image data of the digital image after sharpness and brightness adjustment; / W) is the original image data; ki is the sharpness Control parameters; ton-force is a spatial high-pass filtering image mask that obtains the high-frequency portion of the original image data. In this embodiment, this matrix system is as follows: w (i, j) = ^ WHid ^ 3WDl〇 + ^, ._ 丨 ^ 3WI.D 丨 · 丨 where d is the brightness control parameter, t is the sharpness adjustment enable parameter, and w is the normalized parameter of the filter matrix (normalized parametrer) 〇 The second picture is a function table related to the above parameters, including the sharpness control parameter &, the brightness control parameter & and the sharpness adjustment enabling parameter h. If the sharpness control parameter ^ > 0, then Steps for performing image sharpness adjustment; conversely, if the sharpness control parameter h < 0, it will perform image blurring adjustment steps. If brightness control parameter h > 0, it will perform image brightness adjustment steps; ^ In other words, if the brightness control parameter Age ^ < _ will proceed County darkening adjustment steps. Ruo Rui 7 9] Ι241534γ: ί ,: Say * * * ΤΊ ri If the profit adjustment adjustment parameter is enabled, the brightness adjustment function will be disabled. Otherwise, if the sharpness adjustment is caused If the parameter is enabled, the brightness adjustment function will be enabled. It is worth considering that in the above calculation formula, if n = 0 (when the vertical vector image is fixed), only the horizontal vector image adjustment will be performed; if the old (When the horizontal vector image is fixed), only the vertical vector image adjustment is performed. Furthermore, the above sharpness and brightness adjustments are only applicable to grayscale components. If it is an RGB system, it can be applied to three colors. Both can adjust the brightness and sharpness; if it is γυν system, it can only adjust γ party and sharpness, and U and V can only adjust the sharpness and cannot adjust the brightness. High-The sampling data is: Fl = [-1 , 2, -1] and the following are another preferred embodiment of the calculation formula for the sharpness and brightness of the above image. If the conventional Laplacian filters are used to capture a High-frequency part of the image, whose one-dimensional 卩 2 = [-1 卿 , -1] Among them, F1 is 1/2 of the conversion data, _ is the 1/4 week sampling frequency dragon. Therefore, 'the high-frequency part of the sharpness adjustment of this image can use these two frequency ranges; the brightness adjustment has nothing to do with this. The space wave matrix corresponding to the above-mentioned sample frequency F1 is:
W W1 與F2相對應的空間濾波矩陣則為 8 w W2 其中w係社述岐_波鱗的正規化參數 (_allzed parameter) ’其中係以了至⑽最佳。 將上述矩陣W1及職用在本發明中,藉由前一較佳實施 例中的高通郎·鱗公式可對雜換成如下:The spatial filter matrix corresponding to W W1 and F2 is 8 w W2, where w is the normalization parameter (_allzed parameter) of the company ’s scale__scale, which is the most optimal. Applying the above matrix W1 and functions in the present invention, the miscellaneous substitutions of Gao Tonglang and Scale in the previous preferred embodiment are as follows:
Wl(u) 及Wl (u) and
W w 是3 ~ ^3 一 < -k2S + k2W w is 3 ~ ^ 3 a < -k2S + k2
W2M - κ ο 一 Κ ο -κ ο -k2Z+k7 - κ ο - κ ο 一 Κ 則本發明則可用下列公式表示 + (1-a) 2 2 ΣΣ ί—2>-2 Ο/㈣,w) 其中A,7)是經調整後的影像資料,/(x,7)係為原始影 像資料,a·^係為1/2取樣頻率之頻率資料;(卜a) 則為 1/4取樣頻率之頻率資料,其中a的值係為〇iail。 以上為本發明數位影像銳利度及亮度調整方法實施例 之詳細說明,其主要係將銳利度處理步驟以及亮度處理步驟 9 整合於-個步射即可完成,如此達到簡化電路設計以及減 少記憶體的空間的功效。 敕綜上所述’充份顯示出本發明數位影像銳利度及亮度調 整f法在目的及功效上均深富實施之進錄,極具產業之利 用仏值’且為目前市面上前所未見之新發明,完全符合發明 專利之要件,爰依法提出申請。 唯以上所述者,僅為本發明之較佳實施例而已,當不能 以之限疋本發明所實施之範圍。即大凡依本發明申請專利範 圍所作之均等變化與修飾,皆應仍屬於本發明專利涵蓋之範 圍内’謹請貴審查委員明鑑,並祈惠准,是所至禱。 【圖示簡單說明】 第一圖係為本發明數位影像銳利度及亮度調整方法一較佳 實施例之流程示意圖;及 第二圖係為本發明較佳實施例中其參數以及h的 功能表。W2M-κ ο Κ ο -κ ο -k2Z + k7-κ ο-κ ο κ The present invention can be expressed by the following formula + (1-a) 2 2 ΣΣ ί—2 > -2 〇 / ㈣, w ) Where A, 7) are adjusted image data, / (x, 7) is the original image data, a · ^ is the frequency data of 1/2 sampling frequency; (b) a is 1/4 sampling Frequency data of frequencies, where the value of a is 0iail. The above is a detailed description of the embodiment of the digital image sharpness and brightness adjustment method, which is mainly completed by integrating the sharpness processing step and the brightness processing step 9 in one step, so as to simplify the circuit design and reduce the memory. Effect of space. In summary, the 'full display of the sharpness and brightness adjustment method of the digital image of the present invention is well-implemented in terms of purpose and efficacy, which is extremely valuable for industrial use' and is unprecedented in the current market. The new invention you see fully meets the requirements for an invention patent, and you apply according to law. The above are only preferred embodiments of the present invention, and should not be limited to the scope of implementation of the present invention. That is to say, all 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. [Brief description of the diagram] 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; and the second diagram is a function table of its parameters and h in the preferred embodiment of the present invention .