[go: up one dir, main page]

TWI533708B - Method and image processing device for image enhancement - Google Patents

Method and image processing device for image enhancement Download PDF

Info

Publication number
TWI533708B
TWI533708B TW102133944A TW102133944A TWI533708B TW I533708 B TWI533708 B TW I533708B TW 102133944 A TW102133944 A TW 102133944A TW 102133944 A TW102133944 A TW 102133944A TW I533708 B TWI533708 B TW I533708B
Authority
TW
Taiwan
Prior art keywords
input
pixel
input pixel
image
value
Prior art date
Application number
TW102133944A
Other languages
Chinese (zh)
Other versions
TW201513676A (en
Inventor
蔡奇謚
李世安
Original Assignee
私立淡江大學
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 私立淡江大學 filed Critical 私立淡江大學
Priority to TW102133944A priority Critical patent/TWI533708B/en
Publication of TW201513676A publication Critical patent/TW201513676A/en
Application granted granted Critical
Publication of TWI533708B publication Critical patent/TWI533708B/en

Links

Landscapes

  • Image Processing (AREA)

Description

影像增強處理方法及影像處理裝置 Image enhancement processing method and image processing device

本發明是有關於一種影像處理方法及裝置,且特別是有關於一種影像增強處理方法及影像處理裝置。 The present invention relates to an image processing method and apparatus, and more particularly to an image enhancement processing method and an image processing apparatus.

像素為構成一張影像的最小基本元素,而每張影像即是由多個各種不同顏色的像素所組合而成。「動態範圍」的定義是指影像的所有像素中最高和最低亮度的比值。所謂高動態範圍場景是指明暗之間亮度差別很大的場景,例如日出、夕陽、煙火等。 A pixel is the smallest basic element that makes up an image, and each image is composed of a plurality of pixels of different colors. "Dynamic range" is defined as the ratio of the highest and lowest brightness of all pixels in an image. The so-called high dynamic range scene is a scene indicating that the brightness varies greatly between dark, such as sunrise, sunset, fireworks, and the like.

人眼所能感受景物的亮度變化非常大,而且所謂視覺適應的能力能夠使得人眼在短時間內適應外界亮度的改變,而感受分辨出變化的範圍更大。人眼的動態範圍比一般影像擷取裝置較大許多。以顯示器而言,當環境光源不平均時,顯示器所顯示的影像可能會造成明亮區域曝光過度和黑暗區曝光不足,便是顯示器的動態範圍不足所造成的。因此,當影像的動態範圍越高,影像所能呈現原始場景的細節和資訊也越多;換言之,影像也更貼近於人眼所看到的原始景物。 The human eye can feel the brightness of the scene changes very much, and the so-called visual adaptation ability can make the human eye adapt to the change of the external brightness in a short time, and the range of the change is perceived to be greater. The dynamic range of the human eye is much larger than that of a general image capturing device. In the case of a display, when the ambient light source is uneven, the image displayed on the display may cause overexposure in the bright area and underexposure in the dark area, which is caused by insufficient dynamic range of the display. Therefore, the higher the dynamic range of the image, the more detail and information the image can present in the original scene; in other words, the image is closer to the original scene seen by the human eye.

高動態範圍的場景可藉由動態範圍壓縮在顯示器上重現影像的高對比和資訊。動態範圍壓縮可以在同時保留影像亮部與暗部的細節資訊的前提下,將影像的動態範圍降低。然而,現有技術大部份需透過成本較高的硬體加速設計來實現即時處理功能或是高運算效能的處理器來執行演算法,以達到影像的動態範圍壓縮與對比度增強的目的。因此,如何讓高動態範圍的影像顯示在低成本的顯示器等電子產品,並且同時實現即時影像訊號處理的性能以及保存原始影像的色彩資訊,已成為亟欲解決的問題之一。 High dynamic range scenes can reproduce high contrast and information on the display by dynamic range compression. Dynamic range compression reduces the dynamic range of the image while preserving the details of the highlights and shadows of the image. However, most of the prior art needs to implement a real-time processing function or a high-performance processor through a cost-effective hardware acceleration design to perform an algorithm to achieve dynamic range compression and contrast enhancement of the image. Therefore, how to display high dynamic range images on electronic products such as low-cost displays, and at the same time realize the performance of instant image signal processing and preserve the color information of the original images has become one of the problems to be solved.

本發明提供一種影像增強處理方法及影像處理裝置,其利用動態範圍壓縮與局部對比增強的方式以提升影像的品質。 The invention provides an image enhancement processing method and an image processing device, which utilize dynamic range compression and local contrast enhancement to improve image quality.

本發明提出一種影像增強處理方法。此方法先接收一個影像的多個輸入像素,並且取得各所述輸入像素的輸入色彩像素資料,其中所述輸入像素包括第一輸入像素。接著,根據所述輸入像素的所述輸入色彩像素資料,取得各所述輸入像素的輸入亮度像素值以及輸入亮度成份資料。根據所述輸入亮度像素值,進行濾波器運算,以獲得第一輸入像素的濾波器結果。根據第一輸入像素的濾波器結果,進行調整增益運算,以獲得第一輸入像素的調整增益值。根據第一輸入像素的輸入亮度成份資料,進行調整更新運算,以獲得第一輸入像素的調整更新值。之後,根據第一輸入像素的輸入色彩像素資料以及第一輸入像素的調整增益值與調整更新值的 乘積,取得第一輸入像素的輸出色彩像素資料。 The invention provides an image enhancement processing method. The method first receives a plurality of input pixels of an image and obtains input color pixel data for each of the input pixels, wherein the input pixels comprise a first input pixel. Then, according to the input color pixel data of the input pixel, an input luminance pixel value and an input luminance component data of each of the input pixels are obtained. A filter operation is performed based on the input luminance pixel value to obtain a filter result of the first input pixel. Adjusting the gain operation according to the filter result of the first input pixel to obtain an adjusted gain value of the first input pixel. The adjustment update operation is performed according to the input luminance component data of the first input pixel to obtain an adjustment update value of the first input pixel. Then, according to the input color pixel data of the first input pixel and the adjusted gain value of the first input pixel and the adjusted update value The product is used to obtain the output color pixel data of the first input pixel.

在本發明的一實施例中,上述根據第一輸入像素的濾波器結果,進行調整增益運算,以獲得第一輸入像素的調整增益值的步驟包括根據亮度轉移函數,將第一輸入像素的濾波器結果轉換為第一輸入像素的亮度轉移輸出值;以及根據第一輸入像素的亮度轉移輸出值與濾波器結果之間的比值,獲得第一輸入像素的調整增益值。 In an embodiment of the invention, the step of adjusting the gain operation according to the filter result of the first input pixel to obtain the adjusted gain value of the first input pixel comprises filtering the first input pixel according to the brightness transfer function. The result is converted to a luminance transfer output value of the first input pixel; and an adjustment gain value of the first input pixel is obtained according to a ratio between the luminance transfer output value of the first input pixel and the filter result.

在本發明的一實施例中,上述根據第一輸入像素的輸入亮度成份資料,進行調整更新運算,以獲得第一輸入像素的調整更新值的步驟包括根據第一輸入像素的輸入色彩像素資料、第一輸入像素的輸入亮度成份資料以及色彩飽合度參數,獲得第一輸入像素的調整更新值。 In an embodiment of the invention, the step of performing an adjustment update operation according to the input luminance component data of the first input pixel to obtain an adjustment update value of the first input pixel includes: inputting color pixel data according to the first input pixel, The input luminance component data of the first input pixel and the color saturation parameter obtain an adjustment update value of the first input pixel.

在本發明的一實施例中,上述根據第一輸入像素的輸入色彩像素資料以及第一輸入像素的調整增益值與調整更新值的乘積,取得第一輸入像素的輸出色彩像素資訊的演算公式包括方程式(1)~(3): 其中x以及y為正整數,(x,y)為影像中第x列第y行的輸入像素的輸入色彩像素資料,(x,y)為影像中第x列第y行的輸入像 素的輸出色彩像素資料,g(x,y)為影像中第x列第y行的輸入像素的調整增益值,D RGB (x,y)為影像中第x列第y行的輸入像素的調整更新值,L avg (x,y)為影像中第x列第y行的輸入像素的濾波器結果,T為亮度轉移函數,w為色彩飽合度參數並且符合w [0,1],E為常數向量;其中Y in (x,y)為影像中第x列第y行的輸入像素的輸入亮度成份資料,並且Y in (x,y)定義為方程式(4)或是將R in (x,y)、G in (x,y)以及B in (x,y)分別進行至少一位元移動運算而取得之方程式(4)的結果逼近值:Y in (x,y)=r 0 R in (x,y)+g 0 G in (x,y)+b 0 B in (x,y)+N 方程式(4)其中R in (x,y)、G in (x,y)以及B in (x,y)為影像中第x列第y行的輸入像素的輸入色彩像素資料的多個輸入色彩像素元素,r 0g 0以及b 0為輸入亮度成份資料的多個輸入亮度成份比率,N為常數,r 0 [0,1]、g 0 [0,1]以及b 0 [0,1]。 In an embodiment of the invention, the calculation formula for obtaining the output color pixel information of the first input pixel according to the input color pixel data of the first input pixel and the product of the adjusted gain value of the first input pixel and the adjusted update value includes: Equation (1)~(3): Where x and y are positive integers, ( x , y ) is the input color pixel data of the input pixel of the yth row of the xth column in the image, ( x , y ) is the output color pixel data of the input pixel of the xth column and the yth row in the image, and g ( x , y ) is the adjustment gain value of the input pixel of the xth column and the yth row in the image, D RGB ( x , y ) is the adjustment update value of the input pixel of the yth row of the xth column in the image, L avg ( x , y ) is the filter result of the input pixel of the yth row of the xth column in the image, and T is the luminance transfer function. w is the color saturation parameter and matches w [0,1], E is a constant vector; where Y in ( x , y ) is the input luminance component data of the input pixel of the yth row of the xth column in the image, and Y in ( x , y ) is defined as the equation (4) Or the approximation of the result of equation (4) obtained by performing at least one bit shift operation on R in ( x , y ), G in ( x , y ), and B in ( x , y ): Y in ( x , y )= r 0 R in ( x , y )+ g 0 G in ( x , y )+ b 0 B in ( x , y )+ N Equation (4) where R in ( x , y ), G In ( x , y ) and B in ( x , y ) are the input color pixel elements of the input color pixel data of the input pixel of the xth column and the yth row in the image, and r 0 , g 0 and b 0 are input brightness The ratio of multiple input luminance components of the component data, N is a constant, r 0 [0,1], g 0 [0,1] and b 0 [0,1].

在本發明的一實施例中,在上述獲得第一輸入像素的調整增益以及第一輸入像素的調整更新值的步驟後,上述方法更包括將第一輸入像素的調整增益值進行整數化運算,以獲得第一輸入像素的調整增益整數值;將第一輸入像素的調整更新值進行整數化運算,以獲得第一輸入像素的調整更新整數值;以及根據第一輸入像素的輸入色彩像素資料以及第一輸入像素的調整增益整數值與調整更新整數值的乘積,取得第一輸入像素的輸出色彩像素近似資料。 In an embodiment of the invention, after the step of obtaining the adjustment gain of the first input pixel and the adjustment update value of the first input pixel, the method further comprises performing an integer operation on the adjustment gain value of the first input pixel. Obtaining an adjusted gain integer value of the first input pixel; performing an integer operation on the adjusted update value of the first input pixel to obtain an adjusted update integer value of the first input pixel; and inputting color pixel data according to the first input pixel and The product of the adjusted gain integer value of the first input pixel and the adjusted updated integer value obtains the output color pixel approximation of the first input pixel.

在本發明的一實施例中,上述根據第一輸入像素的輸入色 彩像素資料以及第一輸入像素的調整增益整數值與調整更新整數值的乘積,取得第一輸入像素的輸出色彩像素近似資料的演算公式包括方程式(5)~(7): 其中x以及y為正整數,(x,y)為影像中第x列第y行的輸入像素的輸入色彩像素資料,(x,y)為影像中第x列第y行的輸入像素的輸出色彩像素近似資料,g n (x,y)為影像中第x列第y行的輸入像素的調整增益整數值,g(x,y)為影像中第x列第y行的輸入像素的調整增益值,(x,y)為影像中第x列第y行的輸入像素的調整更新整數值,D RGB (x,y)為影像中第x列第y行的輸入像素的調整更新值,L avg (x,y)為影像中第x列第y行的輸入像素的濾波器結果,E為常數向量;T為亮度轉移函數,並且對於任意L avg (x,y)>0,T必須滿足下列條件: 其中運算子表示小於或等於X的最大整數;w n =以及=255-w n ,其中w為色彩飽合度整數參數並且符合w [0,1];Y in (x,y)為影像中第x列第y行的輸入像素的輸入亮度成份資料,並且定義為將R in (x,y)、G in (x,y)以及B in (x,y)分別進行至少一位元移動運算而取得之方程式(8)的結果逼近值 Y in (x,y)=r 0 R in (x,y)+g 0 G in (x,y)+b 0 B in (x,y)+16 方程式(8)其中R in (x,y)、G in (x,y)以及B in (x,y)為影像中第x列第y行的輸入像素的輸入色彩像素資料的多個輸入色彩像素元素,r 0g 0以及b 0為輸入亮度成份資料的多個輸入亮度成份比率,r 0 [0,1]、g 0 [0,1]以及b 0 [0,1]。 In an embodiment of the invention, the input color pixel data of the first input pixel and the adjusted gain integer value of the first input pixel and the adjusted update integer value are used to obtain the output color pixel approximation of the first input pixel. The calculus formula includes equations (5)~(7): Where x and y are positive integers, ( x , y ) is the input color pixel data of the input pixel of the yth row of the xth column in the image, ( x , y ) is the output color pixel approximation of the input pixel of the xth column and the yth row in the image, and g n ( x , y ) is the integer value of the adjustment gain of the input pixel of the yth row of the xth column in the image, g ( x , y ) is the adjusted gain value of the input pixel of the yth row of the xth column in the image. ( x , y ) is the adjustment of the input pixel of the xth row and the yth row of the image to update the integer value, and D RGB ( x , y ) is the adjusted update value of the input pixel of the yth row of the xth column in the image, L avg ( x , y ) is the filter result of the input pixel of the yth row of the xth column in the image, E is a constant vector; T is a luminance transfer function, and for any L avg ( x , y ) > 0, T must satisfy the following conditions : Operator Represents the largest integer less than or equal to X; w n = as well as =255- w n , where w is the color saturation integer parameter and conforms to w [0,1]; Y in ( x , y ) is the input luminance component data of the input pixel of the yth row of the xth column in the image, and is defined as R in ( x , y ), G in ( x , y ) And the approximate approximation value of the equation (8) obtained by performing at least one bit shift operation on B in ( x , y ) is Y in ( x , y ) = r 0 R in ( x , y ) + g 0 G in ( x , y ) + b 0 B in ( x , y )+16 Equation (8) where R in ( x , y ), G in ( x , y ) and B in ( x , y ) are the xth column in the image The input pixel of the input pixel of the yth row is a plurality of input color pixel elements of the color pixel data, r 0 , g 0 and b 0 are the ratios of the input luminance components of the input luminance component data, r 0 [0,1], g 0 [0,1] and b 0 [0,1].

在本發明的一實施例中,上述影像增強處理方法更包括根據方程式(6),建立調整增益查找表,以獲得第一輸入像素的調整增益整數值,其中調整增益查找表的輸入索引為第一輸入像素的濾波器結果。 In an embodiment of the invention, the image enhancement processing method further includes establishing an adjustment gain lookup table according to equation (6) to obtain an adjustment gain integer value of the first input pixel, wherein the input index of the adjustment gain lookup table is The filter result of an input pixel.

本發明提出一種影像處理裝置,此影像處理裝置包括:色彩擷取電路、亮度擷取電路、濾波器運算電路以及像素調整電路。色彩擷取電路用以接收影像的多個輸入像素,並且取得各所述輸入像素的輸入色彩像素資料,其中所述輸入像素包括第一輸入像素。亮度擷取電路,耦接至色彩擷取電路,用以根據所述輸入像素的所述輸入色彩像素資料,取得各所述輸入像素的輸入亮度像素值以及輸入亮度成份資料。濾波器運算電路,耦接至亮度擷取電路,用以根據所述輸入亮度像素值,進行濾波器運算,以獲得第一輸入像素的濾波器結果。像素調整電路耦接至色彩擷取電路、亮度擷取電路以及濾波器運算電路,用以根據第一輸入像素的濾波器結果,進行調整增益運算,以獲得第一輸入像素的調整增益值,並且根據第一輸入像素的輸入亮度成份資料,進行調整更新運算,以獲得第一輸入像素的調整更新值,再根據第一輸入像素的輸入色彩像素資料以 及第一輸入像素的調整增益值與調整更新值的乘積,取得第一輸入像素的輸出色彩像素資料。 The invention provides an image processing device, which comprises: a color capture circuit, a brightness capture circuit, a filter operation circuit and a pixel adjustment circuit. The color capture circuit is configured to receive a plurality of input pixels of the image and obtain input color pixel data of each of the input pixels, wherein the input pixel comprises a first input pixel. The brightness capture circuit is coupled to the color capture circuit for obtaining the input luminance pixel value and the input luminance component data of each of the input pixels according to the input color pixel data of the input pixel. The filter operation circuit is coupled to the brightness extraction circuit for performing a filter operation according to the input brightness pixel value to obtain a filter result of the first input pixel. The pixel adjustment circuit is coupled to the color capture circuit, the brightness extraction circuit, and the filter operation circuit for performing an adjustment gain operation according to the filter result of the first input pixel to obtain an adjustment gain value of the first input pixel, and Adjusting and updating the operation according to the input brightness component data of the first input pixel to obtain an adjustment update value of the first input pixel, and then according to the input color pixel data of the first input pixel And the product of the adjusted gain value of the first input pixel and the adjusted update value, and the output color pixel data of the first input pixel is obtained.

在本發明的一實施例中,上述的像素調整電路根據亮度轉移函數,將第一輸入像素的濾波器結果轉換為第一輸入像素的亮度轉移輸出值,再根據第一輸入像素的亮度轉移輸出值與第一輸入像素的濾波器結果的比值,獲得第一輸入像素的調整增益值。 In an embodiment of the invention, the pixel adjustment circuit converts the filter result of the first input pixel into a brightness transfer output value of the first input pixel according to the brightness transfer function, and then shifts the output according to the brightness of the first input pixel. The ratio of the value to the filter result of the first input pixel obtains an adjusted gain value for the first input pixel.

在本發明的一實施例中,上述的像素調整電路根據第一輸入像素的輸入色彩像素資料、第一輸入像素的輸入亮度成份資料以及色彩飽合度參數,獲得第一輸入像素的調整更新值。 In an embodiment of the invention, the pixel adjustment circuit obtains an adjustment update value of the first input pixel according to the input color pixel data of the first input pixel, the input luminance component data of the first input pixel, and the color saturation parameter.

在本發明的一實施例中,上述的像素調整電路根據第一輸入像素的輸入色彩像素資料以及第一輸入像素的調整增益值與調整更新值的乘積,取得第一輸入像素的輸出色彩像素資訊的演算公式包括方程式(1)~(3): 其中x以及y為正整數,(x,y)為影像中第x列第y行的輸入像素的輸入色彩像素資料,(x,y)為影像中第x列第y行的輸入像素的輸出色彩像素資料,g(x,y)為影像中第x列第y行的輸入像素的調整增益值,D RGB (x,y)為影像中第x列第y行的輸入像素的調整更新值,L avg (x,y)為影像中第x列第y行的輸入像素的濾波器結果, T為亮度轉移函數,w為色彩飽合度參數並且符合w [0,1],E為常數向量;其中Y in (x,y)為影像中第x列第y行的輸入像素的輸入亮度成份資料,並且Y in (x,y)定義為方程式(4)或是將R in (x,y)、G in (x,y)以及B in (x,y)分別進行至少一位元移動運算而取得之方程式(4)的結果逼近值:Y in (x,y)=r 0 R in (x,y)+g 0 G in (x,y)+b 0 B in (x,y)+N 方程式(4)其中R in (x,y)、G in (x,y)以及B in (x,y)為影像中第x列第y行的輸入像素的輸入色彩像素資料的多個輸入色彩像素元素,r 0g 0以及b 0為輸入亮度成份資料的多個輸入亮度成份比率,N為常數,r 0 [0,1]、g 0 [0,1]以及b 0 [0,1]。 In an embodiment of the invention, the pixel adjustment circuit obtains the output color pixel information of the first input pixel according to the input color pixel data of the first input pixel and the product of the adjusted gain value of the first input pixel and the adjusted update value. The calculus formula includes equations (1)~(3): Where x and y are positive integers, ( x , y ) is the input color pixel data of the input pixel of the yth row of the xth column in the image, ( x , y ) is the output color pixel data of the input pixel of the xth column and the yth row in the image, and g ( x , y ) is the adjustment gain value of the input pixel of the xth column and the yth row in the image, D RGB ( x , y ) is the adjustment update value of the input pixel of the yth row of the xth column in the image, L avg ( x , y ) is the filter result of the input pixel of the yth row of the xth column in the image, and T is the luminance transfer function. w is the color saturation parameter and matches w [0,1], E is a constant vector; where Y in ( x , y ) is the input luminance component data of the input pixel of the yth row of the xth column in the image, and Y in ( x , y ) is defined as the equation (4) Or the approximation of the result of equation (4) obtained by performing at least one bit shift operation on R in ( x , y ), G in ( x , y ), and B in ( x , y ): Y in ( x , y )= r 0 R in ( x , y )+ g 0 G in ( x , y )+ b 0 B in ( x , y )+ N Equation (4) where R in ( x , y ), G In ( x , y ) and B in ( x , y ) are the input color pixel elements of the input color pixel data of the input pixel of the xth column and the yth row in the image, and r 0 , g 0 and b 0 are input brightness The ratio of multiple input luminance components of the component data, N is a constant, r 0 [0,1], g 0 [0,1] and b 0 [0,1].

在本發明的一實施例中,上述的像素調整電路更將第一輸入像素的調整增益值進行整數化運算,以獲得第一輸入像素的調整增益整數值,再將第一輸入像素的調整更新值進行整數化運算,以獲得第一輸入像素的調整更新整數值,並且根據第一輸入像素的輸入色彩像素資料以及第一輸入像素的調整增益整數值與調整更新整數值的乘積,取得第一輸入像素的輸出色彩像素近似資料。 In an embodiment of the invention, the pixel adjustment circuit further performs an integer operation on the adjustment gain value of the first input pixel to obtain an adjustment gain integer value of the first input pixel, and then updates the adjustment of the first input pixel. The value is integerized to obtain an adjusted update integer value of the first input pixel, and the first is obtained according to the input color pixel data of the first input pixel and the product of the adjusted gain integer value of the first input pixel and the adjusted update integer value. The output color pixel approximation of the input pixel.

在本發明的一實施例中,上述的像素調整電路根據第一輸入像素的輸入色彩像素資料以及第一輸入像素的調整增益整數值與調整更新整數值的乘積,取得第一輸入像素的輸出色彩像素近似資訊的演算公式包括方程式(5)~(7): In an embodiment of the invention, the pixel adjustment circuit obtains the output color of the first input pixel according to the input color pixel data of the first input pixel and the product of the adjustment gain integer value of the first input pixel and the adjusted update integer value. The calculation formula of the pixel approximation information includes equations (5)~(7):

其中x以及y為正整數,(x,y)為影像中第x列第y行的輸入像素的輸入色彩像素資料,(x,y)為影像中第x列第y行的輸入像素的輸出色彩像素近似資料,g n (x,y)為影像中第x列第y行的輸入像素的調整增益整數值,g(x,y)為影像中第x列第y行的輸入像素的調整增益值,(x,y)為影像中第x列第y行的輸入像素的調整更新整數值,D RGB (x,y)為影像中第x列第y行的輸入像素的調整更新值,L avg (x,y)為影像中第x列第y行的輸入像素的濾波器結果,E為常數向量;T為亮度轉移函數,並且對於任意L avg (x,y)>0,T必須滿足下列條件: 其中運算子表示小於或等於X的最大整數;w n =以及=255-w n ,其中w為色彩飽合度整數參數並且符合w [0,1];Y in (x,y)為影像中第x列第y行的輸入像素的輸入亮度成份資料,並且定義為將R in (x,y)、G in (x,y)以及B in (x,y)分別進行至少一位元移動運算而取得之方程式(8)的結果逼近值Y in (x,y)=r 0 R in (x,y)+g 0 G in (x,y)+b 0 B in (x,y)+16 方程式(8)其中R in (x,y)、G in (x,y)以及B in (x,y)為影像中第x列第y行的輸入像素的輸入色彩像素資料的多個輸入色彩像素元素,r 0g 0以及b 0為輸入亮度成份資料的多個輸入亮度成份比率,r 0 [0,1]、g 0 [0,1]以及 b 0 [0,1]。 Where x and y are positive integers, ( x , y ) is the input color pixel data of the input pixel of the yth row of the xth column in the image, ( x , y ) is the output color pixel approximation of the input pixel of the xth column and the yth row in the image, and g n ( x , y ) is the integer value of the adjustment gain of the input pixel of the yth row of the xth column in the image, g ( x , y ) is the adjusted gain value of the input pixel of the yth row of the xth column in the image. ( x , y ) is the adjustment of the input pixel of the xth row and the yth row of the image to update the integer value, and D RGB ( x , y ) is the adjusted update value of the input pixel of the yth row of the xth column in the image, L avg ( x , y ) is the filter result of the input pixel of the yth row of the xth column in the image, E is a constant vector; T is a luminance transfer function, and for any L avg ( x , y ) > 0, T must satisfy the following conditions : Operator Represents the largest integer less than or equal to X; w n = as well as =255- w n , where w is the color saturation integer parameter and conforms to w [0,1]; Y in ( x , y ) is the input luminance component data of the input pixel of the yth row of the xth column in the image, and is defined as R in ( x , y ), G in ( x , y ) And the approximate approximation value of the equation (8) obtained by performing at least one bit shift operation on B in ( x , y ) is Y in ( x , y ) = r 0 R in ( x , y ) + g 0 G in ( x , y ) + b 0 B in ( x , y )+16 Equation (8) where R in ( x , y ), G in ( x , y ) and B in ( x , y ) are the xth column in the image The input pixel of the input pixel of the yth row is a plurality of input color pixel elements of the color pixel data, r 0 , g 0 and b 0 are the ratios of the input luminance components of the input luminance component data, r 0 [0,1], g 0 [0,1] and b 0 [0,1].

在本發明的一實施例中,上述的像素調整電路更包括調整增益查找表。調整增益查找表是根據方程式(6)所建立,其中調整增益查找表的輸入索引為第一輸入像素的濾波器結果,調整增益查找表的輸出為第一輸入像素的調整增益整數值。 In an embodiment of the invention, the pixel adjustment circuit further includes an adjustment gain lookup table. The adjustment gain lookup table is established according to equation (6), wherein the input index of the adjustment gain lookup table is the filter result of the first input pixel, and the output of the adjustment gain lookup table is the adjusted gain integer value of the first input pixel.

基於上述,本發明所提出的影像增強處理方法及影像處理裝置,結合任何連續可微分的亮度轉移函數以及控制色彩飽合度的相關演算,可同時提高影像亮度、局部對比度以及保留原始得色彩資訊,以避免影像的失真。此外,藉由調整增益查找表的索引操作、整數化以及位元移動的運算方式,可大幅加快整個動態範圍壓縮與局部對比增強演算的處理程序。 Based on the above, the image enhancement processing method and the image processing apparatus proposed by the present invention, combined with any continuously differentiable luminance transfer function and related calculations for controlling color saturation, can simultaneously improve image brightness, local contrast, and preserve original color information. To avoid distortion of the image. In addition, by adjusting the index operation of the gain lookup table, the integerization, and the bit movement, the processing procedure of the entire dynamic range compression and local contrast enhancement calculation can be greatly accelerated.

為讓本發明的上述特徵和優點能更明顯易懂,下文特舉實施例,並配合所附圖式作詳細說明如下。 The above described features and advantages of the invention will be apparent from the following description.

100、400‧‧‧影像處理裝置 100, 400‧‧‧ image processing device

110、410‧‧‧色彩擷取電路 110,410‧‧‧Color capture circuit

120、420‧‧‧亮度擷取電路 120, 420‧‧‧ Brightness capture circuit

125‧‧‧濾波器 125‧‧‧ filter

130、430‧‧‧濾波器運算電路 130, 430‧‧‧ filter arithmetic circuit

140、440‧‧‧像素調整電路 140, 440‧‧‧ pixel adjustment circuit

442‧‧‧調整增益查找表 442‧‧‧Adjustment gain lookup table

444‧‧‧調整更新電路 444‧‧‧Adjustment update circuit

446、447a~447c、448a~448c‧‧‧乘法器 446, 447a~447c, 448a~448c‧‧‧ multiplier

447d~447f、449a~449c‧‧‧加法器 447d~447f, 449a~449c‧‧‧Adder

445‧‧‧非揮發性記憶體 445‧‧‧Non-volatile memory

450‧‧‧色彩輸出電路 450‧‧‧Color output circuit

A、A'‧‧‧輸入影像、輸出影像 A, A'‧‧‧ Input image, output image

AC‧‧‧第一輸入像素 A C ‧‧‧first input pixel

S201~S211‧‧‧動態範圍壓縮與局部對比增強方法的流程 S201~S211‧‧‧ Flow of dynamic range compression and local contrast enhancement method

圖1繪示依據本發明第一實施例的一種影像處理裝置的方塊示意圖。 1 is a block diagram of an image processing apparatus according to a first embodiment of the present invention.

圖2繪示依據本發明第一實施例的一種影像增強處理方法的流程圖。 2 is a flow chart of an image enhancement processing method according to a first embodiment of the present invention.

圖3繪示依據本發明第一實施例的影像示意圖。 3 is a schematic diagram of an image according to a first embodiment of the present invention.

圖4繪示依據本發明第二實施例的一種影像處理裝置的方塊 示意圖。 4 is a block diagram of an image processing apparatus according to a second embodiment of the present invention; schematic diagram.

本發明的部份實施例接下來將會配合附圖來詳細描述,以下的描述所引用的元件符號,當不同附圖出現相同的元件符號將視為相同或相似的元件。這些實施例只是本發明的一部份,並未揭示所有本發明的可實施方式。更確切的說,這些實施例只是本發明的專利申請範圍中的裝置與方法的範例。 The components of the present invention will be described in detail in the following description in conjunction with the accompanying drawings. These examples are only a part of the invention and do not disclose all of the embodiments of the invention. Rather, these embodiments are merely examples of devices and methods within the scope of the patent application of the present invention.

〔第一實施例〕 [First Embodiment]

圖1繪示依據本發明第一實施例的一種影像處理裝置的方塊示意圖,但此僅是為了方便說明,並不用以限制本發明。首先圖1先介紹影像處理裝置的所有構件以及配置關係,詳細功能將配合圖2一併揭露。 1 is a block diagram of an image processing apparatus according to a first embodiment of the present invention, but is for convenience of description and is not intended to limit the present invention. First, all components and configuration relationships of the image processing apparatus will be described first in FIG. 1. The detailed functions will be disclosed in conjunction with FIG.

請參照圖1,本實施例的影像處理裝置100接收影像A,並輸出影像A'。影像處理裝置100針對影像A進行動態範圍的壓縮以及局部對比度的增強,以增強影像A的細節資訊,其輸出結果為輸出影像A'。影像處理裝置100可以為個人電腦、筆記型電腦、數位相機、數位攝影機、網路攝影機、智慧型手機、平板電腦、掃描機、行車紀錄器、投影機、車用影音系統等電子裝置,本發明不以此為限。 Referring to FIG. 1, the image processing apparatus 100 of the present embodiment receives an image A and outputs an image A'. The image processing apparatus 100 performs dynamic range compression and local contrast enhancement on the image A to enhance the detail information of the image A, and the output result is the output image A'. The image processing apparatus 100 can be an electronic device such as a personal computer, a notebook computer, a digital camera, a digital camera, a network camera, a smart phone, a tablet computer, a scanner, a driving recorder, a projector, a car audio and video system, and the like. Not limited to this.

影像處理裝置100包括色彩擷取電路110、亮度擷取電路 120、濾波器運算電路130以及像素調整電路140,其中色彩擷取電路110、亮度擷取電路120、濾波器運算電路130以及像素調整電路140可被實作為一或多個積體電路,其中各個積體電路包括多個邏輯閘(logic gate)。 The image processing device 100 includes a color capture circuit 110 and a brightness capture circuit. 120, the filter operation circuit 130 and the pixel adjustment circuit 140, wherein the color capture circuit 110, the brightness capture circuit 120, the filter operation circuit 130, and the pixel adjustment circuit 140 can be implemented as one or more integrated circuits, each of which The integrated circuit includes a plurality of logic gates.

色彩擷取電路110接收影像A中的多個輸入像素,且每一個輸入像素都包括至少一個色彩像素值。 The color capture circuit 110 receives a plurality of input pixels in the image A, and each of the input pixels includes at least one color pixel value.

亮度擷取電路120耦接至色彩擷取電路110,將每一個輸入像素的色彩像素值進行色域(color space)轉換,以取得每一個輸入像素在不同色域中的亮度像素值。 The brightness capture circuit 120 is coupled to the color capture circuit 110 to perform color space conversion on the color pixel values of each input pixel to obtain luminance pixel values of each input pixel in different color gamuts.

濾波器運算電路130耦接至亮度擷取電路120,針對亮度像素值進行濾波器運算。此濾波器運算為空間低通濾波運算(spatial low-pass filtering),但本發明不以此為限。 The filter operation circuit 130 is coupled to the brightness extraction circuit 120 for performing a filter operation on the luminance pixel values. This filter operation is spatial low-pass filtering, but the invention is not limited thereto.

像素調整電路140耦接至色彩擷取電路110、亮度擷取電路120以及濾波器運算電路130,可調整影像A中的色彩像素值,以產生影像A'。在本實施例中,像素調整電路140為多個加法器與乘法器所組成的積體電路。此外,像素調整電路140更可包括非揮發性記憶體,用以儲存多個參數。 The pixel adjustment circuit 140 is coupled to the color capture circuit 110, the brightness capture circuit 120, and the filter operation circuit 130. The color pixel values in the image A can be adjusted to generate the image A'. In the embodiment, the pixel adjustment circuit 140 is an integrated circuit composed of a plurality of adders and multipliers. In addition, the pixel adjustment circuit 140 may further include a non-volatile memory for storing a plurality of parameters.

圖2是依照本發明第一實施例所繪示之影像增強處理方法的流程圖。請參照圖2,本實施例的方法適用於圖1的影像處理裝置100,以下即搭配影像處理裝置100中的各項元件說明本發明之影像增強處理方法的詳細步驟。 FIG. 2 is a flowchart of an image enhancement processing method according to a first embodiment of the present invention. Referring to FIG. 2, the method of the present embodiment is applied to the image processing apparatus 100 of FIG. 1. Hereinafter, the detailed steps of the image enhancement processing method of the present invention will be described with reference to various elements in the image processing apparatus 100.

首先,色彩擷取電路110接收影像中的多個輸入像素,並 且取得各個輸入像素的輸入色彩像素資料,其中這些輸入像素包括第一輸入像素(步驟S201)。詳言之,請同時參照圖3所繪示之影像A的示意圖。影像A包括多個輸入像素,且這些輸入像素是以行(column)與列(row)的方式排列成一個矩陣。舉例而言,輸入像素A11為影像A中第1列第1行的輸入像素,輸入像素A12為影像A中第1列第2行的輸入像素,輸入像素A21為影像A中第2列第1行的輸入像素,以此類推。每一個輸入像素會包括至少一個像素值。在本實施例中,影像A為在RGB色域中的彩色影像,其中每一個像素會包括紅色像素值(R像素值)、綠色像素值(G像素值)以及藍色像素值(B像素值),即為前述的「輸入色彩像素資料」。然而,在其它實施例中,輸入色彩像素資料亦可以包括YCbCr色域中的Y像素值、Cb像素值以及Cr像素值,本發明不在此設限。此外,為方便說明,以下僅將針對影像A中的第一輸入像素AC說明影像增強處理的步驟流程。 First, the color capture circuit 110 receives a plurality of input pixels in the image and obtains input color pixel data of the respective input pixels, wherein the input pixels include the first input pixels (step S201). In detail, please refer to the schematic diagram of the image A shown in FIG. 3 at the same time. The image A includes a plurality of input pixels, and the input pixels are arranged in a matrix in a row and a row. For example, the input pixel A 11 is the input pixel of the first row of the first row in the image A, the input pixel A 12 is the input pixel of the second row of the first row of the image A, and the input pixel A 21 is the second of the image A. The input pixels in row 1 of the column, and so on. Each input pixel will include at least one pixel value. In this embodiment, the image A is a color image in the RGB color gamut, where each pixel includes a red pixel value (R pixel value), a green pixel value (G pixel value), and a blue pixel value (B pixel value). ), which is the aforementioned "input color pixel data". However, in other embodiments, the input color pixel data may also include Y pixel values, Cb pixel values, and Cr pixel values in the YCbCr color gamut, and the present invention is not limited thereto. In addition, for convenience of explanation, only the step flow of the image enhancement processing will be described for the first input pixel A C in the image A.

接著,亮度擷取電路120根據各個輸入像素的輸入色彩像素資料,取得各個輸入像素的輸入亮度像素值以及輸入亮度成份資料(步驟S203)。詳言之,亮度擷取電路120根據每一個輸入像素的輸入色彩像素資料,取得每一個輸入像素在不同色域的亮度像素值。在本實施例中,前述的輸入亮度像素值是在HSV(hue,saturation,value)色域中的V像素值,而前述的輸入亮度成份資料是在YCbCr色域中的Y像素值。然而在其它實施例中,亮度像素值也可以是將RGB像素值轉換為其它標準的像素值。在以下的說明中,輸入色彩 像素資料可以下列數學式表示: 其中(x,y)為影像中第x列第y行的輸入像素的輸入色彩像素資料,其為R in (x,y)、G in (x,y)以及B in (x,y)所組成,即RGB像素值,在此定義為「輸入色彩像素元素」。此外,在以下的說明當中,L in (x,y)可用以表示影像A中第x列第y行的輸入像素的輸入亮度像素值,Y in (x,y)可用以表示影像A中第x列第y行的輸入像素的輸入亮度成份資料。 Next, the brightness capture circuit 120 obtains the input luminance pixel value and the input luminance component data of each input pixel according to the input color pixel data of each input pixel (step S203). In detail, the brightness capture circuit 120 obtains the luminance pixel values of each input pixel in different color gamuts according to the input color pixel data of each input pixel. In this embodiment, the aforementioned input luminance pixel value is a V pixel value in the HSV (hue, saturation, value) color gamut, and the aforementioned input luminance component data is a Y pixel value in the YCbCr color gamut. In other embodiments, however, the luma pixel value may also be a pixel value that converts RGB pixel values to other criteria. In the following description, the input color pixel data can be expressed in the following mathematical formula: among them ( x , y ) is the input color pixel data of the input pixel of the xth column and the yth row in the image, which is composed of R in ( x , y ), G in ( x , y ), and B in ( x , y ) , RGB pixel value, defined here as "input color pixel element". In addition, in the following description, L in ( x , y ) can be used to represent the input luminance pixel value of the input pixel of the xth row and the yth row in the image A, and Y in ( x , y ) can be used to represent the image A The input luminance component data of the input pixel of the xth row of the xth column.

濾波器運算電路130會針對這些輸入像素的輸入亮度像素值進行濾波器運算,以獲得第一輸入像素AC的濾波器結果(步驟S205)。詳言之,濾波器運算電路120是根據濾波器125來進行濾波器運算。在本實施例中,濾波器125以第一輸入像素AC為中心,利用空間低通濾波器核心函數(spatial low-pass filter kernel function),在濾波器125範圍內所有輸入像素的輸入亮度像素值進行迴旋積運算(convolution operation)。在此,第一輸入像素AC的濾波器結果可由下列方程式取得: 其中x以及y為正整數,表示二維旋積運算,F L (x,y)表示空間低通濾波器核心函數,並且所有的x以及y滿足 的條件。在本實施例中,濾波器125可以是高斯模糊濾波器(Gaussian blur filter)、均值濾波器(mean filter)、邊緣保留濾波 器(edge-preserving filter)或其它種類的低通濾波器,本發明不以此為限。 The filter operation circuit 130 performs a filter operation on the input luminance pixel values of the input pixels to obtain a filter result of the first input pixel A C (step S205). In detail, the filter operation circuit 120 performs filter calculation based on the filter 125. In this embodiment, the filter 125 is centered on the first input pixel A C and utilizes a spatial low-pass filter kernel function to input luminance pixels of all input pixels in the range of the filter 125. The value is subjected to a convolution operation. Here, the filter result of the first input pixel A C can be obtained by the following equation: Where x and y are positive integers, Represents a two-dimensional convolution operation, F L ( x , y ) represents the spatial low-pass filter kernel function, and all x and y are satisfied conditions of. In this embodiment, the filter 125 may be a Gaussian blur filter, a mean filter, an edge-preserving filter or other kinds of low-pass filters, and the present invention Not limited to this.

本發明的影像增強處理方法是以動態範圍壓縮與局部對比增強的概念,利用輸入色彩像素資料加上其像素調整資料來產生輸出色彩像素資料。在本實施例中,是採用方程式(1)來產生輸出色彩像素資料: 其中(x,y)為影像中第x列第y行的輸入像素的輸入色彩像素資料,(x,y)為影像中第x列第y行的輸入像素的輸出色彩像素資料,g(x,y)為影像中第x列第y行的輸入像素的調整增益值(adjustment gain),D RGB (x,y)為影像中第x列第y行的輸入像素的調整更新值(adjustment innovation)。在本實施例中,上述像素調整資料即為g(x,y)D RGB (x,y)。 The image enhancement processing method of the present invention is based on the concept of dynamic range compression and local contrast enhancement, and uses input color pixel data plus its pixel adjustment data to generate output color pixel data. In this embodiment, equation (1) is used to generate output color pixel data: among them ( x , y ) is the input color pixel data of the input pixel of the yth row of the xth column in the image, (X, y) of the image x-th column of an output color pixel data input pixel y-th row, g (x, y) of the image x-th column to adjust the gain value of the input pixel y-th row (adjustment gain), D RGB ( x , y ) is the adjustment innovation of the input pixels of the yth row of the xth column in the image. In the embodiment, the pixel adjustment data is g ( x , y ) D RGB ( x , y ).

詳細而言,像素調整電路140根據第一輸入像素AC的濾波器結果,進行調整增益運算,以獲得第一輸入像素AC的調整增益值(步驟S207)。像素調整電路140根據一個連續可微分的亮度轉移函數,將第一輸入像素AC的濾波器結果轉換為第一輸入像素的亮度轉移輸出值,接著再根據第一輸入像素的亮度轉移輸出值與第一輸入像素AC的濾波器結果之間的比值,獲得第一輸入像素AC的調整增益值。在本實施例中,像素調整電路140可以是根據方程式(2)取得第一輸入像素AC的調整增益值: 其中L avg (x,y)為影像中第x列第y行的輸入像素的濾波器結果,T為亮度轉移函數,g(x,y)為影像中第x列第y行的輸入像素的調整增益值。 Specifically, the pixel circuit 140 according to the adjustment result of the first input pixel filter A C, the gain adjustment operation, in order to obtain an adjusted gain value of the first input pixel A C (step S207). The pixel adjustment circuit 140 converts the filter result of the first input pixel A C into a luminance transfer output value of the first input pixel according to a continuously differentiable luminance transfer function, and then shifts the output value according to the brightness of the first input pixel. the ratio between the first input pixel filter a C the results obtained first input pixel value adjustment gain of a C. In this embodiment, the pixel adjustment circuit 140 may obtain the adjusted gain value of the first input pixel A C according to equation (2): Where L avg ( x , y ) is the filter result of the input pixel of the yth row of the xth column in the image, T is the luminance transfer function, and g ( x , y ) is the input pixel of the yth row of the xth column in the image. Adjust the gain value.

舉例而言,為了提高影像A中低亮度的輸入像素之輸入亮度像素值,並且同時保留高亮度的輸入像素之對比度,上述的亮度轉移函數T可以為方程式(2.1): 其中m(x,y)=L avg (x,y)s+m min For example, in order to increase the input luminance pixel value of the low-intensity input pixel in the image A while preserving the contrast of the high-brightness input pixel, the above-described luminance transfer function T may be Equation (2.1): Where m ( x , y )= L avg ( x , y ) s + m min

s為縮放係數並且s>0,m min為常數並且m min>0,為所有輸入亮度像素值的最大值。在利用方程式(2.1)的轉移函數的架構下,方程式(2)可以改寫為方程式(2.2): 其中ε為極小的正數值以避免任何除以0的運算產生。 s is the scaling factor and s >0, m min is a constant and m min >0, The maximum value for all input luminance pixel values. Using the transfer function of equation (2.1) Under the architecture, equation (2) can be rewritten as equation (2.2): Where ε is a very small positive value to avoid any operation divided by zero.

像素調整電路140又根據第一輸入像素AC的輸入亮度成份資料,進行調整更新運算,以獲得第一輸入像素AC的調整更新值(步驟S209)。詳言之,像素調整電路140根據第一輸入像素AC的輸入色彩像素資料、輸入亮度成份資料以及色彩飽合度參數,獲 得第一輸入像素AC的調整更新值。在本實施例中,像素調整電路140可以是根據方程式(3)取得第一輸入像素AC的調整更新值: 其中w為色彩飽合度參數並且符合w [0,1],E為常數向量[1 1 1] T D RGB (x,y)為影像中第x列第y行的輸入像素的調整更新值,Y in (x,y)為影像中第x列第y行的輸入像素的輸入亮度成份資料。 And adjusting the pixel circuit 140 according to the input luminance component of the pixel data of the first input A C, the update operation is adjusted to obtain an adjusted input pixel value of the first update of the A C (step S209). In detail, the pixel adjustment circuit 140 obtains an adjustment update value of the first input pixel A C according to the input color pixel data, the input luminance component data, and the color saturation parameter of the first input pixel A C . In this embodiment, the pixel adjustment circuit 140 may obtain an adjustment update value of the first input pixel A C according to equation (3): Where w is the color saturation parameter and conforms to w [0,1], E is a constant vector [1 1 1] T , D RGB ( x , y ) is the adjusted update value of the input pixel of the yth row of the xth column in the image, Y in ( x , y ) is the image Input luminance component data of the input pixel of the xth column and the yth row.

在一實施例中,上述所謂的「輸入亮度成份資料」為RGB輸入像素的NTSC亮度成份資訊,Y in (x,y)定義為方程式(4):Y in (x,y)=r 0 R in (x,y)+g 0 G in (x,y)+b 0 B in (x,y)+N 方程式(4)r 0g 0以及b 0為輸入亮度成份資料的多個輸入亮度成份比率,r 0 [0,1]、g 0 [0,1]以及b 0 [0,1],N為常數。舉例而言,在一實施例中,方程式(4)中的參數可以分別為r 0=0.257、g 0=0.5044、b 0=0.0977並且N=16,而方程式(4)可改寫為方程式(4.1):Y in (x,y)=0.257R in (x,y)+0.5044G in (x,y)+0.0977B in (x,y)+16 方程式(4.1) In one embodiment, the so-called "input luminance component data" is NTSC luminance component information of RGB input pixels, and Y in ( x , y ) is defined as equation (4): Y in ( x , y ) = r 0 R In ( x , y )+ g 0 G in ( x , y )+ b 0 B in ( x , y )+ N Equation (4) r 0 , g 0 and b 0 are the multiple input luminances of the input luminance component data Composition ratio, r 0 [0,1], g 0 [0,1] and b 0 [0,1], N is a constant. For example, in one embodiment, the parameters in equation (4) may be r 0 =0.257, g 0 =0.5044, b 0 =0.0977, and N =16, and equation (4) may be rewritten as equation (4.1). ): Y in ( x , y )=0.257 R in ( x , y )+0.5044 G in ( x , y )+0.0977 B in ( x , y )+16 Equation (4.1)

在另一實施例中,為了加快計算方程式(4)的速度,亮度擷取電路120更可包括多個位元暫存器(bit register),其可分別針對R in (x,y)、G in (x,y)以及B in (x,y)進行至少一位元移動運算(bit-shift operation)後進行累加運算,而取得方程式(4)的結果逼近值。以方程式(4.1)為例,可以由方程式(4.2)或方程式(4.3)之一近似求得: In another embodiment, in order to speed up the calculation of the speed of equation (4), the brightness capture circuit 120 may further include a plurality of bit registers, which may be respectively for R in ( x , y ), G In ( x , y ) and B in ( x , y ) perform an accumulation operation after performing at least one bit-shift operation, and obtain a result approximation value of equation (4). Taking equation (4.1) as an example, it can be approximated by one of equation (4.2) or equation (4.3):

其中<<與>>分別表示位元左移(bit-shift left)以及位元右移(bit-shift right)的運算子。利用方程式(4.2)與方程式(4.3)所得的輸入亮度成份資料Y in (x,y)除了近似於方程式(4.1)的結果,由於其採用位元移動運算以及累加運算來取代乘法運算,因此大幅增加取得輸入亮度成份資料Y in (x,y)的速度及減少硬體電路成本。 Where << and >> respectively represent the operator of bit-shift left and bit-shift right. The input luminance component data Y in ( x , y ) obtained by using equations (4.2) and (4.3) is similar to the result of equation (4.1), because it uses bit shifting and accumulating operations instead of multiplication, so Increase the speed of inputting the luminance component data Y in ( x , y ) and reduce the cost of the hardware circuit.

必須特別說明的是,本實施例中的步驟S207以及步驟S209的順序可進行對調,本發明不以此為限。 It should be noted that the order of step S207 and step S209 in this embodiment can be reversed, and the present invention is not limited thereto.

像素調整電路140在取得調整增益值以及調整更新值後,即根據第一輸入像素AC的輸入色彩像素資料以及第一輸入像素AC的調整增益值與調整更新值的乘積,取得第一輸入像素AC的輸出色彩像素資料(步驟S211)。也就是說,像素調整電路140利用前述方程式(1)來產生輸出色彩像素資料: 其中輸出色彩像素資料可以下列數學式表示: 藉此,影像A的輸出色彩像素資料可組成影像A’,其可達到動態範圍壓縮的功效以及保留影像A中的細節資訊。 Adjusting the pixel circuit 140 after obtaining the updated adjustment value and an adjustment gain value, i.e., the product of the input color adjustment data of the first pixel and the input pixel A C A C of the first input pixel value and the gain adjustment value is updated, to obtain a first input The color pixel data of the pixel A C is output (step S211). That is, the pixel adjustment circuit 140 generates the output color pixel data using the aforementioned equation (1): The output color pixel data can be expressed in the following mathematical formula: Thereby, the output color pixel data of the image A can constitute the image A', which can achieve the effect of dynamic range compression and preserve the detail information in the image A.

〔第二實施例〕 [Second embodiment]

第二實施例與第一實施例類似,在此僅描述不同之處。在第一實施例中所採取的方式涉及多種非線性運算,其較適用於具有高運算效能的影像處理裝置。在第二實施例中所採用的方法,除了可加速處理彩色影像的功效,其更適用於低成本硬體設計的影像處理裝置。 The second embodiment is similar to the first embodiment, and only the differences will be described herein. The approach taken in the first embodiment involves a variety of non-linear operations, which are more suitable for image processing devices with high computational efficiency. The method employed in the second embodiment is more suitable for an image processing apparatus of a low cost hardware design, in addition to speeding up the processing of color images.

圖4繪示依據本發明第二實施例的一種影像處理裝置的方塊示意圖。請參照圖5,影像處理裝置400包括色彩擷取電路410、亮度擷取電路420、濾波器運算電路430、像素調整電路440以及色彩輸出電路450,其中色彩擷取電路410以及濾波器運算電路430分別與第一實施例中的色彩擷取電路110以及濾波器運算電路130具有相同的功能,在此不再贅述。類似地,亮度擷取電路420耦接至色彩擷取電路410;濾波器運算電路430耦接至亮度擷取電路420;像素調整電路440耦接至色彩擷取電路410、亮度擷取電路420以及濾波器運算電路430。色彩輸出電路450耦接至像素調整電路440,用以輸出影像。 4 is a block diagram of an image processing apparatus according to a second embodiment of the present invention. Referring to FIG. 5 , the image processing apparatus 400 includes a color capture circuit 410 , a brightness capture circuit 420 , a filter operation circuit 430 , a pixel adjustment circuit 440 , and a color output circuit 450 . The color capture circuit 410 and the filter operation circuit 430 . The color capture circuit 110 and the filter operation circuit 130 in the first embodiment have the same functions, and will not be described again. Similarly, the brightness capture circuit 420 is coupled to the color capture circuit 410; the filter operation circuit 430 is coupled to the brightness capture circuit 420; the pixel adjustment circuit 440 is coupled to the color capture circuit 410, the brightness capture circuit 420, and Filter operation circuit 430. The color output circuit 450 is coupled to the pixel adjustment circuit 440 for outputting an image.

在本實施例中,亮度擷取電路420包括多個16位元暫存器以及加法器(未繪示)。像素調整電路440包括調整增益查找表442、調整更新電路444、乘法器448a~448c以及加法器449a~449c。調整更新電路444更包括非揮發性記憶體445、乘法器446、乘法器447a~447c、加法器447d~447f所組成的積體電路。 In this embodiment, the brightness capture circuit 420 includes a plurality of 16-bit registers and an adder (not shown). The pixel adjustment circuit 440 includes an adjustment gain lookup table 442, an adjustment update circuit 444, multipliers 448a to 448c, and adders 449a to 449c. The adjustment and update circuit 444 further includes an integrated circuit composed of a non-volatile memory 445, a multiplier 446, multipliers 447a to 447c, and adders 447d to 447f.

在本實施例中,影像A包括多個輸入像素,並且是在RGB色域中,其中這些輸入像素包括第一輸入像素AC。色彩擷取電路410接收影像A中的多個輸入像素,並且取得各個輸入像素的輸入色彩像素資料,亦即R像素值、G像素值以及B像素值,並且分別傳輸至亮度擷取電路420。接著,亮度擷取電路420會將輸入色彩像素資料轉換為HSV色域的V像素值,亦即輸入亮度像素值。在此,輸入色彩像素資料仍是以下列數學式表示: 其中(x,y)為影像中第x列第y行的輸入像素的輸入色彩像素資料,其為輸入色彩像素元素R in (x,y)、G in (x,y)以及B in (x,y)所組成。此外,L in (x,y)可用以表示影像A中第x列第y行的輸入像素的輸入亮度像素值,可以由下列數學式表示:L in (x,y)=max(R in (x,y),G in (x,y),B in (x,y))其中運算子max(x,y,z)表示取x、y、z三者中的最大值。此外,亮度擷取電路420亦會將輸入色彩像素資料轉換為YCbCr色域中的Y像素值,亦即輸入亮度成份資料。值得注意的是,由於本實施例適用於低成本硬體設計的影像處理裝置400,因此可利用第一實施例中的方程式(4.2)或方程式(4.3)之一近似求得輸入亮度成份資料Y in (x,y),大幅提高取得輸入亮度成份資料Y in (x,y)的速度及減少亮度擷取電路420的硬體成本。相關說明請參照第一實施例,於此不再贅述。 In the present embodiment, image A includes a plurality of input pixels and is in the RGB color gamut, wherein the input pixels include a first input pixel A C . The color capture circuit 410 receives the plurality of input pixels in the image A, and obtains the input color pixel data of each input pixel, that is, the R pixel value, the G pixel value, and the B pixel value, and transmits the same to the brightness capture circuit 420. Next, the brightness capture circuit 420 converts the input color pixel data into V pixel values of the HSV color gamut, that is, input luminance pixel values. Here, the input color pixel data is still expressed in the following mathematical formula: among them ( x , y ) is the input color pixel data of the input pixel of the xth row and the yth row in the image, which are the input color pixel elements R in ( x , y ), G in ( x , y ), and B in ( x , y ) is composed. In addition, L in ( x , y ) can be used to represent the input luminance pixel value of the input pixel of the xth column and the yth row in the image A, which can be expressed by the following mathematical expression: L in ( x , y )=max( R in ( x , y ), G in ( x , y ), B in ( x , y )) wherein the operator max( x , y , z ) represents the maximum value among x, y, and z. In addition, the brightness capture circuit 420 also converts the input color pixel data into Y pixel values in the YCbCr color gamut, that is, inputs luminance component data. It should be noted that since the present embodiment is applicable to the image processing apparatus 400 of a low-cost hardware design, the input luminance component data Y can be approximated by using one of the equations (4.2) or (4.3) in the first embodiment. In ( x , y ) greatly increases the speed at which the input luminance component data Y in ( x , y ) is obtained and reduces the hardware cost of the luminance capture circuit 420. For related description, please refer to the first embodiment, and details are not described herein again.

亮度擷取電路420將輸入亮度像素值傳輸至濾波器運算電 路430,而濾波器運算電路430計算第一輸入像素AC的濾波器結果,並且將濾波器結果傳輸至像素調整電路440的調整增益查找表442。濾波器運算電路430產生濾波器結果的方式請參照第一實施例的相關說明,於此不再贅述。 The luminance capture circuit 420 transmits the input luminance pixel value to the filter operation circuit 430, and the filter operation circuit 430 calculates the filter result of the first input pixel A C and transmits the filter result to the adjustment gain of the pixel adjustment circuit 440. Look up table 442. For the manner in which the filter operation circuit 430 generates the filter result, refer to the related description of the first embodiment, and details are not described herein again.

本實施例之動態範圍壓縮與局部對比增強的概念亦是以輸入色彩像素資料加上其像素調整資料來產生輸出色彩像素資料。在本實施例中,是採用方程式(5)來產生輸出色彩像素資料: 其中x以及y為正整數,(x,y)為影像中第x列第y行的輸入像素的輸出色彩像素近似資料,g n (x,y)為影像中第x列第y行的輸入像素的調整增益整數值,(x,y)為影像中第x列第y行的輸入像素的調整更新整數值。在本實施例中,上述像素調整資料即為 。在本實施例的影像處理裝置400中,像素調整電路 440主要的功能是來計算上述像素調整資料。同樣地,在本實施例中,僅針對影像A中的第一輸入像素AC的輸入亮度像素值進行說明。 The concept of dynamic range compression and local contrast enhancement in this embodiment also produces output color pixel data by inputting color pixel data plus its pixel adjustment data. In this embodiment, equation (5) is used to generate output color pixel data: Where x and y are positive integers, ( x , y ) is the output color pixel approximation of the input pixel of the xth column and the yth row in the image, and g n ( x , y ) is the integer value of the adjustment gain of the input pixel of the yth row of the xth column in the image, ( x , y ) is the adjustment of the input pixel of the xth column and the yth row in the image to update the integer value. In this embodiment, the pixel adjustment data is . In the image processing apparatus 400 of the present embodiment, the main function of the pixel adjustment circuit 440 is to calculate the pixel adjustment data. Similarly, in the present embodiment, only the input luminance pixel value of the first input pixel A C in the image A will be described.

在本實施例中,調整增益查找表442為一個一維調整增益查找表(1-dimensional adjustment gain lookup table,1D adjustment gain LUT),其根據濾波器結果與調整增益整數值所建立。詳言之,調整增益整數值定義為方程式(6): 其中對於任意L avg (x,y)>0的濾波器結果,必須滿足下列條件: 此外,運算子表示小於或等於X的最大整數。由於亮度轉移函數可在影像A進行任何處理前預先計算,進而利用方程式(6)預先被建立調整增益查找表442。調整增益查找表442的輸入索引即為自濾波器運算電路430取得的濾波器結果L avg (x,y),而調整增益查找表442的輸出為調整增益整數值g n (x,y)。 In this embodiment, the adjustment gain lookup table 442 is a 1-dimensional adjustment gain lookup table (1D adjustment gain LUT), which is established according to the filter result and the adjustment gain integer value. In detail, the adjustment gain integer value is defined as equation (6): For the filter result of any L avg ( x , y )>0, the following conditions must be met: In addition, the operator Represents the largest integer less than or equal to X. Brightness transfer function The image A can be pre-calculated before any processing is performed, and the adjusted gain lookup table 442 is previously established using Equation (6). The input index of the adjustment gain lookup table 442 is the filter result L avg ( x , y ) obtained from the filter operation circuit 430, and the output of the adjustment gain lookup table 442 is the adjustment gain integer value g n ( x , y ).

另一方面,像素調整電路440的調整更新電路444可分別自色彩擷取電路410以及亮度擷取電路420取得第一輸入像素AC的輸入色彩像素資料的輸入色彩像素元素以及輸入亮度成份資料,利用乘法器446、乘法器447a~447c、加法器447d~447f以及16位元暫存器計算調整更新整數值。詳言之,調整更新整數值定義為方程式(7): 其中w n =以及=255-w n 分別為控制影像A的色彩飽合度的整數參數。w為色彩飽合度參數,其符合w [0,1]並且可預先儲存於非揮發性記憶體445。 On the other hand, the adjustment and update circuit 444 of the pixel adjustment circuit 440 can obtain the input color pixel elements and the input brightness component data of the input color pixel data of the first input pixel A C from the color capture circuit 410 and the brightness capture circuit 420, respectively. The adjustment and update integer values are calculated by the multiplier 446, the multipliers 447a to 447c, the adders 447d to 447f, and the 16-bit register. In particular, the adjustment update integer value is defined as equation (7): Where w n = as well as =255- w n are integer parameters that control the color saturation of image A, respectively. w is the color saturation parameter, which is consistent with w [0, 1] and may be stored in advance in the non-volatile memory 445.

值得注意的是,在另一實施例中,輸入亮度成份資料Y in (x,y)可以直接由調整更新電路444來執行運算。在此架構下,像素調整電路420無須耦接至亮度擷取電路420,而像素調整電路440中的調整更新電路444則更包括多個位元暫存器。 It should be noted that in another embodiment, the input luminance component data Y in ( x , y ) can be directly operated by the adjustment update circuit 444. In this architecture, the pixel adjustment circuit 420 does not need to be coupled to the brightness capture circuit 420, and the adjustment update circuit 444 in the pixel adjustment circuit 440 further includes a plurality of bit registers.

像素調整電路440的調整增益查找表442以及調整更新電 路444分別產生調整增益整數值以及調整更新整數值後,便可根據前述方程式(5),利用乘法器448a~448c以及加法器449a~449c計算輸出色彩像素近似資料 其中輸出色彩像素近似資料可以下列數學式表示: 接著,影像A的輸出色彩像素近似資料可自像素調整電路440傳輸至色彩輸出電路450,以產生影像A’,其可達到動態範圍壓縮的功效以及保留影像A中的細節資訊。 After the adjustment gain lookup table 442 and the adjustment update circuit 444 of the pixel adjustment circuit 440 respectively generate the adjustment gain integer value and adjust the update integer value, the multipliers 448a to 448c and the adders 449a to 449c can be calculated according to the above equation (5). Output color pixel approximation The output color pixel approximation data can be expressed in the following mathematical formula: Then, the output color pixel approximation data of the image A can be transmitted from the pixel adjustment circuit 440 to the color output circuit 450 to generate an image A', which can achieve the effect of dynamic range compression and preserve the detailed information in the image A.

在本實施例中,由於調整增益查找表442的建立,使得影像增強處理方法流程所需的運算可簡化為輸入亮度像素值的運算、濾波器運算、調整增益整數值的索引操作、調整更新整數值的運算以及像素調整資料的運算與輸出,而大幅加快整體動態範圍壓縮與局部對比增強的處理程序。 In this embodiment, due to the establishment of the adjustment gain lookup table 442, the operations required for the image enhancement processing method flow can be simplified to the operation of inputting the luminance pixel value, the filter operation, the index operation of adjusting the gain integer value, and the adjustment and update. Numerical calculations and pixel adjustment data operations and outputs greatly speed up the overall dynamic range compression and local contrast enhancement processing.

綜上所述,本發明所提出的影像增強處理方法及影像處理裝置,結合任何連續可微分的亮度轉移函數以及控制色彩飽合度的相關演算,可同時提高影像亮度、局部對比度以及保留原始得色彩資訊,以避免影像的失真。此外,藉由調整增益查找表的索引操作、整數化以及位元移動的運算方式,可大幅加快整體動態範圍壓縮與局部對比增強演算的處理程序。此影像增強處理方法及影像處理裝置不僅可達到彩色影像增強的功效,並且可達到即時影像或視訊處理的效能,以運用於低成本的消費性電子產品上,增強本發明在實 際應用中的適用性。 In summary, the image enhancement processing method and image processing apparatus provided by the present invention combines any continuously differentiable luminance transfer function and related calculations for controlling color saturation, thereby simultaneously improving image brightness, local contrast, and retaining original color. Information to avoid image distortion. In addition, by adjusting the index operation of the gain lookup table, the integerization, and the bit shifting operation, the processing procedure of the overall dynamic range compression and the local contrast enhancement calculation can be greatly accelerated. The image enhancement processing method and the image processing device can not only achieve the effect of color image enhancement, but also achieve the performance of instant image or video processing, and can be applied to low-cost consumer electronic products, and the invention is enhanced. Applicability in inter-applications.

雖然本發明已以實施例揭露如上,然其並非用以限定本發明,任何所屬技術領域中具有通常知識者,在不脫離本發明的精神和範圍內,當可作些許的更動與潤飾,故本發明的保護範圍當視後附的申請專利範圍所界定者為準。 Although the present invention has been disclosed in the above embodiments, it is not intended to limit the present invention, and any one of ordinary skill in the art can make some changes and refinements without departing from the spirit and scope of the present invention. The scope of the invention is defined by the scope of the appended claims.

S201~S211‧‧‧動態範圍壓縮與局部對比增強方法的流程 S201~S211‧‧‧ Flow of dynamic range compression and local contrast enhancement method

Claims (14)

一種影像增強處理方法,包括:接收一影像的多個輸入像素,並且取得各所述輸入像素的一輸入色彩像素資料,其中所述輸入像素包括一第一輸入像素;根據所述輸入像素的所述輸入色彩像素資料,取得各所述輸入像素的一輸入亮度像素值以及一輸入亮度成份資料;根據所述輸入亮度像素值,進行一濾波器運算,以獲得該第一輸入像素的一濾波器結果;根據該第一輸入像素的該濾波器結果,進行一調整增益運算,以獲得該第一輸入像素的一調整增益值;根據該第一輸入像素的該輸入亮度成份資料,進行一調整更新運算,以獲得該第一輸入像素的一調整更新值;以及根據該第一輸入像素的該輸入色彩像素資料以及該第一輸入像素的該調整增益值與該第一輸入像素的調整更新值的乘積,取得該第一輸入像素的一輸出色彩像素資料。 An image enhancement processing method includes: receiving a plurality of input pixels of an image, and obtaining an input color pixel data of each of the input pixels, wherein the input pixel includes a first input pixel; according to the input pixel Inputting color pixel data, obtaining an input luminance pixel value of each input pixel and an input luminance component data; performing a filter operation according to the input luminance pixel value to obtain a filter of the first input pixel As a result, an adjustment gain operation is performed according to the filter result of the first input pixel to obtain an adjusted gain value of the first input pixel; and an adjustment update is performed according to the input luminance component data of the first input pixel. Computing to obtain an adjusted update value of the first input pixel; and the input color pixel data of the first input pixel and the adjusted gain value of the first input pixel and the adjusted update value of the first input pixel The product is used to obtain an output color pixel data of the first input pixel. 如申請專利範圍第1項所述的影像增強處理方法,根據該第一輸入像素的該濾波器結果,進行該調整增益運算,以獲得該第一輸入像素的該調整增益值的步驟包括:根據一亮度轉移函數,轉換該第一輸入像素的該濾波器結果為該第一輸入像素的一亮度轉移輸出值;以及根據該第一輸入像素的該亮度轉移輸出值與該第一輸入像素的該濾波器結果的比值,獲得該第一輸入像素的該調整增益值。 The image enhancement processing method of claim 1, according to the filter result of the first input pixel, performing the adjustment gain operation to obtain the adjusted gain value of the first input pixel comprises: a brightness transfer function, the filter result of converting the first input pixel is a brightness transfer output value of the first input pixel; and the brightness transfer output value according to the first input pixel and the first input pixel The ratio of the filter results is obtained for the adjusted gain value of the first input pixel. 如申請專利範圍第2項所述的影像增強處理方法,其中根據該第一輸入像素的該輸入亮度成份資料,進行該調整更新運算,以獲得該第一輸入像素的該調整更新值的步驟包括:根據該第一輸入像素的該輸入色彩像素資料、該第一輸入像素的該輸入亮度成份資料以及一色彩飽合度參數,獲得該第一輸入像素的該調整更新值。 The image enhancement processing method of claim 2, wherein the step of performing the adjustment update operation to obtain the adjustment update value of the first input pixel according to the input luminance component data of the first input pixel comprises: And obtaining, according to the input color pixel data of the first input pixel, the input luminance component data of the first input pixel, and a color saturation parameter, the adjusted update value of the first input pixel. 如申請專利範圍第3項所述的影像增強處理方法,其中根據該第一輸入像素的該輸入色彩像素資料以及該第一輸入像素的該調整增益值與該第一輸入像素的調整更新值的乘積,取得該第一輸入像素的該輸出色彩像素資訊的演算公式包括方程式(1)~(3): 其中x以及y為正整數,(x,y)為該影像中第x列第y行的輸入像素的該輸入色彩像素資料,(x,y)為該影像中第x列第y行的輸入像素的該輸出色彩像素資料,g(x,y)為該影像中第x列第y行的輸入像素的該調整增益值,D RGB (x,y)為該影像中第x列第y行的輸入像素的該調整更新值,L avg (x,y)為該影像中第x列第y行的輸入像素的該濾波器結果,T為該亮度轉移函數,w為該色彩飽合度參數並且符合w [0,1],E為一常數向量,運算子表示小於 或等於X的最大整數,其中Y in (x,y)為該影像中第x列第y行的輸入像素的該輸入亮度成份資料,並且Y in (x,y)定義為方程式(4)或是將R in (x,y)、G in (x,y)以及B in (x,y)分別進行至少一位元移動運算而取得之方程式(4)的結果逼近值:Y in (x,y)=r 0 R in (x,y)+g 0 G in (x,y)+b 0 B in (x,y)+N 方程式(4)其中R in (x,y)、G in (x,y)以及B in (x,y)為該影像中第x列第y行的輸入像素的該輸入色彩像素資料的多個輸入色彩像素元素,r 0g 0以及b 0為該輸入亮度成份資料的多個輸入亮度成份比率,N為一常數,r 0 [0,]、g 0 [0,]以及b 0 [0,1]。 The image enhancement processing method of claim 3, wherein the input color pixel data of the first input pixel and the adjusted gain value of the first input pixel and the adjusted update value of the first input pixel are The calculation formula for obtaining the output color pixel information of the first input pixel includes the equations (1) to (3): Where x and y are positive integers, ( x , y ) is the input color pixel data of the input pixel of the yth row of the xth column in the image, ( x , y ) is the output color pixel data of the input pixel of the yth row of the xth column in the image, and g ( x , y ) is the adjusted gain value of the input pixel of the yth row of the xth column in the image, D RGB ( x , y ) is the adjustment update value of the input pixel of the yth row of the xth column in the image, and L avg ( x , y ) is the filter of the input pixel of the yth row of the xth column in the image. As a result, T is the luminance transfer function, w is the color saturation parameter and conforms to w [0,1], E is a constant vector, operator Represents the largest integer less than or equal to X, where Y in ( x , y ) is the input luminance component data of the input pixel of the yth row of the xth column in the image, and Y in ( x , y ) is defined as the equation (4) Or the approximation of the result of equation (4) obtained by performing at least one bit shift operation on R in ( x , y ), G in ( x , y ), and B in ( x , y ): Y in ( x , y )= r 0 R in ( x , y )+ g 0 G in ( x , y )+ b 0 B in ( x , y )+ N Equation (4) where R in ( x , y ), G In ( x , y ) and B in ( x , y ) are a plurality of input color pixel elements of the input color pixel data of the input pixel of the yth row of the xth column in the image, r 0 , g 0 and b 0 are The ratio of the input luminance components of the input luminance component data, N is a constant, r 0 [0,], g 0 [0,] and b 0 [0,1]. 如申請專利範圍第3項所述的影像增強處理方法,其中在獲得該第一輸入像素的該調整增益以及該第一輸入像素的該調整更新值的步驟後,更包括:將該第一輸入像素的該調整增益值進行一整數化運算,以獲得該第一輸入像素的一調整增益整數值;將該第一輸入像素的該調整更新值進行該整數化運算,以獲得該第一輸入像素的一調整更新整數值;以及根據該第一輸入像素的該輸入色彩像素資料以及該第一輸入像素的該調整增益整數值與該第一輸入像素的調整更新整數值的乘積,取得該第一輸入像素的一輸出色彩像素近似資料。 The image enhancement processing method of claim 3, wherein after the step of obtaining the adjustment gain of the first input pixel and the adjustment update value of the first input pixel, the method further comprises: the first input Performing an integer operation on the adjusted gain value of the pixel to obtain an adjusted gain integer value of the first input pixel; performing the integer operation on the adjusted update value of the first input pixel to obtain the first input pixel And adjusting the integer value; and obtaining the first according to the input color pixel data of the first input pixel and the product of the adjusted gain integer value of the first input pixel and the adjusted update integer value of the first input pixel An output color pixel approximation of the input pixel. 如申請專利範圍第5項所述的影像增強處理方法,其中根據該第一輸入像素的該輸入色彩像素資料以及該第一輸入像素的 該調整增益整數值與該第一輸入像素的該調整更新整數值的乘積,取得該第一輸入像素的該輸出色彩像素近似資料的演算公式包括方程式(5)~(7): 其中x以及y為正整數,(x,y)為該影像中第x列第y行的輸入像素的該輸入色彩像素資料,(x,y)為該影像中第x列第y行的輸入像素的該輸出色彩像素近似資料,g n (x,y)為該影像中第x列第y行的輸入像素的該調整增益整數值,g(x,y)為該影像中第x列第y行的輸入像素的該調整增益值,(x,y)為該影像中第x列第y行的輸入像素的該調整更新整數值,D RGB (x,y)為該影像中第x列第y行的輸入像素的該調整更新值,L avg (x,y)為該影像中第x列第y行的輸入像素的該濾波器結果,E為一常數向量,其中T為該亮度轉移函數,並且對於任意L avg (x,y)>0,T必須滿足下列條件: 其中運算子表示小於或等於X的最大整數,其中以及,其中w為該色彩飽合度整數參數並且符合w [0,],其中Y in (x,y)為該影像中第x列第y行的輸入像素的該輸入亮度 成份資料,並且定義為將R in (x,y)、G in (x,y)以及B in (x,y)分別進行至少一位元移動運算而取得之方程式(8)的結果逼近值Y in (x,y)=r 0 R in (x,y)+g 0 G in (x,y)+b 0 B in (x,y)+16 方程式(8)其中R in (x,y)、G in (x,y)以及B in (x,y)為該影像中第x列第y行的輸入像素的該輸入色彩像素資料的多個輸入色彩像素元素,r 0g 0以及b 0為該輸入亮度成份資料的多個輸入亮度成份比率,r 0 [0,]、g 0 [0,1]以及b 0 [0,1]。 The image enhancement processing method of claim 5, wherein the input color pixel data of the first input pixel and the adjustment gain integer value of the first input pixel and the adjustment update of the first input pixel are The product of the integer value, the calculation formula for obtaining the approximate color pixel of the first input pixel includes equations (5)~(7): Where x and y are positive integers, ( x , y ) is the input color pixel data of the input pixel of the yth row of the xth column in the image, ( x , y ) is the output color pixel approximation of the input pixel of the yth row of the xth column in the image, and g n ( x , y ) is the adjustment gain of the input pixel of the yth row of the xth column in the image. The integer value, g ( x , y ), is the adjusted gain value of the input pixel of the yth row of the xth column in the image, ( x , y ) is an integer value of the adjustment of the input pixel of the yth row of the xth column in the image, and D RGB ( x , y ) is the adjusted update value of the input pixel of the yth row of the xth column in the image. , L avg ( x , y ) is the filter result of the input pixel of the yth row of the xth column in the image, E is a constant vector, where T is the luminance transfer function, and for any L avg ( x , y )>0, T must meet the following conditions: Operator Represents the largest integer less than or equal to X, where as well as , where w is the integer parameter of the color saturation and conforms to w [0,], where Y in ( x , y ) is the input luminance component data of the input pixel of the yth row of the xth column in the image, and is defined as R in ( x , y ), G in ( x , y ) and B in ( x , y ) The result approximation of the equation (8) obtained by performing at least one bit shift operation, respectively, Y in ( x , y ) = r 0 R in ( x , y ) + g 0 G In ( x , y )+ b 0 B in ( x , y )+16 Equation (8) where R in ( x , y ), G in ( x , y ) and B in ( x , y ) are in the image a plurality of input color pixel elements of the input color pixel data of the input pixel of the xth row and the yth row, r 0 , g 0 and b 0 are a plurality of input luminance component ratios of the input luminance component data, r 0 [0,], g 0 [0,1] and b 0 [0,1]. 如申請專利範圍第6項所述的影像增強處理方法更包括:根據方程式(6),建立一調整增益查找表,以獲得該第一輸入像素的該調整增益整數值,其中該調整增益查找表的輸入索引為該第一輸入像素的該濾波器結果。 The image enhancement processing method of claim 6, further comprising: establishing an adjustment gain lookup table according to equation (6) to obtain the adjusted gain integer value of the first input pixel, wherein the adjustment gain lookup table The input index is the filter result of the first input pixel. 一種影像處理裝置,包括:一色彩擷取電路,接收一影像的多個輸入像素,並且取得各所述輸入像素的一輸入色彩像素資料,其中所述輸入像素包括一第一輸入像素;一亮度擷取電路,耦接至該色彩擷取電路,根據所述輸入像素的所述輸入色彩像素資料,取得各所述輸入像素的一輸入亮度像素值以及一輸入亮度成份資料;一濾波器運算電路,耦接至該亮度擷取電路,根據所述輸入亮度像素值,進行一濾波器運算,以獲得該第一輸入像素的一濾波器結果;以及一像素調整電路,耦接該色彩擷取電路、該亮度擷取電路以 及該濾波器運算電路,根據該第一輸入像素的該濾波器結果,進行一調整增益運算,以獲得該第一輸入像素的一調整增益值,並且根據該第一輸入像素的該輸入亮度成份資料,進行一調整更新運算,以獲得該第一輸入像素的一調整更新值,再根據該第一輸入像素的該輸入色彩像素資料以及該第一輸入像素的該調整增益值與該第一輸入像素的調整更新值的乘積,取得該第一輸入像素的一輸出色彩像素資料。 An image processing device includes: a color capture circuit that receives a plurality of input pixels of an image, and obtains an input color pixel data of each of the input pixels, wherein the input pixel includes a first input pixel; The capture circuit is coupled to the color capture circuit, and obtains an input luminance pixel value and an input luminance component data of each of the input pixels according to the input color pixel data of the input pixel; and a filter operation circuit And coupled to the brightness extraction circuit, performing a filter operation according to the input brightness pixel value to obtain a filter result of the first input pixel; and a pixel adjustment circuit coupled to the color capture circuit The brightness capture circuit And the filter operation circuit, performing an adjustment gain operation according to the filter result of the first input pixel to obtain an adjusted gain value of the first input pixel, and according to the input brightness component of the first input pixel Data, performing an adjustment update operation to obtain an adjustment update value of the first input pixel, and then according to the input color pixel data of the first input pixel and the adjustment gain value of the first input pixel and the first input The product of the adjusted update value of the pixel obtains an output color pixel data of the first input pixel. 如申請專利範圍第8項所述的影像處理裝置,其中該像素調整電路根據一亮度轉移函數,轉換該第一輸入像素的該濾波器結果為該第一輸入像素的一亮度轉移輸出值,再根據該第一輸入像素的該亮度轉移輸出值與該第一輸入像素的該濾波器結果的比值,獲得該第一輸入像素的該調整增益值。 The image processing device of claim 8, wherein the pixel adjustment circuit converts the filter result of the first input pixel to a brightness transfer output value of the first input pixel according to a brightness transfer function, and then And obtaining the adjusted gain value of the first input pixel according to a ratio of the brightness transfer output value of the first input pixel to the filter result of the first input pixel. 如申請專利範圍第9項所述的影像處理裝置,其中該像素調整電路根據該第一輸入像素的該輸入色彩像素資料、該第一輸入像素的該輸入亮度成份資料以及一色彩飽合度參數,獲得該第一輸入像素的該調整更新值。 The image processing device of claim 9, wherein the pixel adjustment circuit is configured according to the input color pixel data of the first input pixel, the input luminance component data of the first input pixel, and a color saturation parameter. Obtaining the adjustment update value of the first input pixel. 如申請專利範圍第10項所述的影像處理裝置,其中該像素調整電路根據該第一輸入像素的該輸入色彩像素資料以及該第一輸入像素的該調整增益值與該第一輸入像素的調整更新值的乘積,取得該第一輸入像素的一輸出色彩像素資訊的演算公式包括方程式(1)~(3): 其中x以及y為正整數,(x,y)為該影像中第x列第y行的輸入像素的該輸入色彩像素資料,(x,y)為該影像中第x列第y行的輸入像素的該輸出色彩像素資料,g(x,y)為該影像中第x列第y行的輸入像素的該調整增益值,D RGB (x,y)為該影像中第x列第y行的輸入像素的該調整更新值,L avg (x,y)為該影像中第x列第y行的輸入像素的該濾波器結果,T為該亮度轉移函數,w為該色彩飽合度參數並且符合w [0,1],E為一常數向量,運算子表示小於或等於X的最大整數,其中Y in (x,y)為該影像中第x列第y行的輸入像素的該輸入亮度成份資料,並且Y in (x,y)定義為方程式(4)或是將R in (x,y)、G in (x,y)以及B in (x,y)分別進行至少一位元移動運算而取得之方程式(4)的結果逼近值:Y in (x,y)=r 0 R in (x,y)+g 0 G in (x,y)+b 0 B in (x,y)+N 方程式(4)其中R in (x,y)、G in (x,y)以及B in (x,y)為該影像中第x列第y行的輸入像素的該輸入色彩像素資料的多個輸入色彩像素元素,r 0g 0以及b 0為該輸入亮度成份資料的多個輸入亮度成份比率,N為一常數,r 0 [0,1]、g 0 [0,]以及b 0 [0,1]。 The image processing device of claim 10, wherein the pixel adjustment circuit is configured according to the input color pixel data of the first input pixel and the adjustment gain value of the first input pixel and the adjustment of the first input pixel The calculation formula of the output color pixel information of the first input pixel including the product of the updated value includes equations (1) to (3): Where x and y are positive integers, ( x , y ) is the input color pixel data of the input pixel of the yth row of the xth column in the image, ( x , y ) is the output color pixel data of the input pixel of the yth row of the xth column in the image, and g ( x , y ) is the adjusted gain value of the input pixel of the yth row of the xth column in the image, D RGB ( x , y ) is the adjustment update value of the input pixel of the yth row of the xth column in the image, and L avg ( x , y ) is the filter of the input pixel of the yth row of the xth column in the image. As a result, T is the luminance transfer function, w is the color saturation parameter and conforms to w [0,1], E is a constant vector, operator Represents the largest integer less than or equal to X, where Y in ( x , y ) is the input luminance component data of the input pixel of the yth row of the xth column in the image, and Y in ( x , y ) is defined as the equation (4) Or the approximation of the result of equation (4) obtained by performing at least one bit shift operation on R in ( x , y ), G in ( x , y ), and B in ( x , y ): Y in ( x , y )= r 0 R in ( x , y )+ g 0 G in ( x , y )+ b 0 B in ( x , y )+ N Equation (4) where R in ( x , y ), G In ( x , y ) and B in ( x , y ) are a plurality of input color pixel elements of the input color pixel data of the input pixel of the yth row of the xth column in the image, r 0 , g 0 and b 0 are The ratio of the input luminance components of the input luminance component data, N is a constant, r 0 [0,1], g 0 [0,] and b 0 [0,1]. 如申請專利範圍第10項所述的影像處理裝置,其中該像 素調整電路更將該第一輸入像素的該調整增益值進行一整數化運算,以獲得該第一輸入像素的一調整增益整數值,再將該第一輸入像素的該調整更新值進行該整數化運算,以獲得該第一輸入像素的一調整更新整數值,並且根據該第一輸入像素的該輸入色彩像素資料以及該第一輸入像素的該調整增益整數值與該第一輸入像素的調整更新整數值的乘積,取得該第一輸入像素的一輸出色彩像素近似資料。 The image processing device of claim 10, wherein the image The adjusting circuit further performs an integer operation on the adjusted gain value of the first input pixel to obtain an adjusted gain integer value of the first input pixel, and then performs the adjusted update value of the first input pixel to the integer. An operation to obtain an adjusted update integer value of the first input pixel, and according to the input color pixel data of the first input pixel and the adjusted gain integer value of the first input pixel and the adjustment of the first input pixel Updating the product of the integer values to obtain an output color pixel approximation of the first input pixel. 如申請專利範圍第12項所述的影像處理裝置,其中該像素調整電路根據該第一輸入像素的該輸入色彩像素資料以及該第一輸入像素的該調整增益整數值與該第一輸入像素的該調整更新整數值的乘積,取得該第一輸入像素的該輸出色彩像素近似資訊的演算公式包括方程式(5)~(7): 其中x以及y為正整數,(x,y)為該影像中第x列第y行的輸入像素的該輸入色彩像素資料,(x,y)為該影像中第x列第y行的輸入像素的該輸出色彩像素近似資料,g n (x,y)為該影像中第x列第y行的輸入像素的該調整增益整數值,g(x,y)為該影像中第x列第y行的輸入像素的該調整增益值,(x,y)為該影像中第x列第y行的輸入像素的該調整更新整數值,(x,y)為該影像中第x 列第y行的輸入像素的該調整更新值,L avg (x,y)為該影像中第x列第y行的輸入像素的該濾波器結果,E為一常數向量,其中T為該亮度轉移函數,並且對於任意L avg (x,y)>0,T必須滿足下列條件: 其中運算子表示小於或等於X的最大整數,其中以及,其中w為該色彩飽合度參數並且符合w [0,],其中,Y in (x,y)為該影像中第x列第y行的輸入像素的該輸入亮度成份資料,並且定義為將R in (x,y)、G in (x,y)以及B in (x,y)分別進行至少一位元移動運算而取得之方程式(8)的結果逼近值:Y in (x,y)=r 0 R in (x,y)+g 0 G qq (x,y)+b 0 B in (x,y)+16 方程式(8)其中R in (x,y)、G in (x,y)以及B in (x,y)為該影像中第x列第y行的輸入像素的該輸入色彩像素資料的多個輸入色彩像素元素,r 0g 0以及b 0為該輸入亮度成份資料的多個輸入亮度成份比率,r 0 [0,1]、g 0 [0,1]以及b 0 [0,1]。 The image processing device of claim 12, wherein the pixel adjustment circuit is based on the input color pixel data of the first input pixel and the adjusted gain integer value of the first input pixel and the first input pixel The adjustment updates the product of the integer values, and the calculation formula for obtaining the output color pixel approximation information of the first input pixel includes equations (5)~(7): Where x and y are positive integers, ( x , y ) is the input color pixel data of the input pixel of the yth row of the xth column in the image, ( x , y ) is the output color pixel approximation of the input pixel of the yth row of the xth column in the image, and g n ( x , y ) is the adjustment gain of the input pixel of the yth row of the xth column in the image. The integer value, g ( x , y ), is the adjusted gain value of the input pixel of the yth row of the xth column in the image, ( x , y ) is the integer value of the adjustment of the input pixel of the yth row of the xth column in the image, ( x , y ) is the adjusted update value of the input pixel of the yth row of the xth column in the image, and L avg ( x , y ) is the filter result of the input pixel of the yth row of the xth column in the image, E is a constant vector, where T is the luminance transfer function, and for any L avg ( x , y ) > 0, T must satisfy the following conditions: Operator Represents the largest integer less than or equal to X, where as well as Where w is the color saturation parameter and conforms to w [0,], where Y in ( x , y ) is the input luminance component data of the input pixel of the yth row of the xth column in the image, and is defined as R in ( x , y ), G in ( x , y ) and B in ( x , y ) result of approximating the result of equation (8) obtained by performing at least one bit shift operation: Y in ( x , y )= r 0 R in ( x , y )+ g 0 G qq ( x , y )+ b 0 B in ( x , y )+16 Equation (8) where R in ( x , y ), G in ( x , y ) and B in ( x , y ) are a plurality of input color pixel elements of the input color pixel data of the input pixel of the xth column and the yth row in the image, r 0 , g 0 and b 0 are ratios of the plurality of input luminance components of the input luminance component data, r 0 [0,1], g 0 [0,1] and b 0 [0,1]. 如申請專利範圍第13項所述的影像處理裝置,其中該像素調整電路更包括:一調整增益查找表,該調整增益查找表是根據方程式(6)所建立,,其中該調整增益查找表的輸入索引為該第一輸入像素的該濾波器結果,該調整增益查找表的輸出為該第一輸入像素的該調整增益整數值。 The image processing device of claim 13, wherein the pixel adjustment circuit further comprises: an adjustment gain lookup table, wherein the adjustment gain lookup table is established according to equation (6), wherein the adjustment gain lookup table is The input index is the filter result of the first input pixel, and the output of the adjusted gain lookup table is the adjusted gain integer value of the first input pixel.
TW102133944A 2013-09-18 2013-09-18 Method and image processing device for image enhancement TWI533708B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW102133944A TWI533708B (en) 2013-09-18 2013-09-18 Method and image processing device for image enhancement

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW102133944A TWI533708B (en) 2013-09-18 2013-09-18 Method and image processing device for image enhancement

Publications (2)

Publication Number Publication Date
TW201513676A TW201513676A (en) 2015-04-01
TWI533708B true TWI533708B (en) 2016-05-11

Family

ID=53437322

Family Applications (1)

Application Number Title Priority Date Filing Date
TW102133944A TWI533708B (en) 2013-09-18 2013-09-18 Method and image processing device for image enhancement

Country Status (1)

Country Link
TW (1) TWI533708B (en)

Also Published As

Publication number Publication date
TW201513676A (en) 2015-04-01

Similar Documents

Publication Publication Date Title
TWI473039B (en) Image dynamic range compression and local contrast enhancement method and image processing device
TWI399100B (en) Image processing method
CN113810641B (en) Video processing method and device, electronic equipment and storage medium
CN113810642B (en) Video processing method and device, electronic equipment and storage medium
CN109416831B (en) Low-cost color expansion module for extending the color of images
JP5810803B2 (en) Method, apparatus and system for adjusting whiteboard image
CN113824914B (en) Video processing method, apparatus, electronic device and storage medium
CN103826113B (en) A kind of color rendition method and device
CN115242992A (en) Video processing method, apparatus, electronic device and storage medium
CN107918928B (en) A color restoration method
CN105993170B (en) Image processing apparatus, camera device, image processing method
CN113507598A (en) Video screen display method, device, terminal and storage medium
WO2019012112A1 (en) Method and system for color gamut mapping
US9444975B2 (en) Image sensor gamut mapping
TWI523500B (en) Image dynamic range compression method and image processing device
CN119011740B (en) Image processing method, device, electronic device and readable storage medium
CN116320776B (en) Image processing method, device, chip, electronic equipment and storage medium
TWI533708B (en) Method and image processing device for image enhancement
US12106458B2 (en) Method and device for image processing, and storage medium
CN113271450B (en) White balance adjusting method, image processing device and image processing system
US20210297558A1 (en) Cubiform method
CN109146815B (en) Image contrast adjusting method and device and computer equipment
US20250203033A1 (en) Image processing without color channel clipping
CN121329836A (en) Image processing method and device and electronic equipment
TW201511522A (en) Color conversion method and color conversion system

Legal Events

Date Code Title Description
MM4A Annulment or lapse of patent due to non-payment of fees